hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 | qsc_code_num_words_quality_signal int64 | qsc_code_num_chars_quality_signal float64 | qsc_code_mean_word_length_quality_signal float64 | qsc_code_frac_words_unique_quality_signal float64 | qsc_code_frac_chars_top_2grams_quality_signal float64 | qsc_code_frac_chars_top_3grams_quality_signal float64 | qsc_code_frac_chars_top_4grams_quality_signal float64 | qsc_code_frac_chars_dupe_5grams_quality_signal float64 | qsc_code_frac_chars_dupe_6grams_quality_signal float64 | qsc_code_frac_chars_dupe_7grams_quality_signal float64 | qsc_code_frac_chars_dupe_8grams_quality_signal float64 | qsc_code_frac_chars_dupe_9grams_quality_signal float64 | qsc_code_frac_chars_dupe_10grams_quality_signal float64 | qsc_code_frac_chars_replacement_symbols_quality_signal float64 | qsc_code_frac_chars_digital_quality_signal float64 | qsc_code_frac_chars_whitespace_quality_signal float64 | qsc_code_size_file_byte_quality_signal float64 | qsc_code_num_lines_quality_signal float64 | qsc_code_num_chars_line_max_quality_signal float64 | qsc_code_num_chars_line_mean_quality_signal float64 | qsc_code_frac_chars_alphabet_quality_signal float64 | qsc_code_frac_chars_comments_quality_signal float64 | qsc_code_cate_xml_start_quality_signal float64 | qsc_code_frac_lines_dupe_lines_quality_signal float64 | qsc_code_cate_autogen_quality_signal float64 | qsc_code_frac_lines_long_string_quality_signal float64 | qsc_code_frac_chars_string_length_quality_signal float64 | qsc_code_frac_chars_long_word_length_quality_signal float64 | qsc_code_frac_lines_string_concat_quality_signal float64 | qsc_code_cate_encoded_data_quality_signal float64 | qsc_code_frac_chars_hex_words_quality_signal float64 | qsc_code_frac_lines_prompt_comments_quality_signal float64 | qsc_code_frac_lines_assert_quality_signal float64 | qsc_codepython_cate_ast_quality_signal float64 | qsc_codepython_frac_lines_func_ratio_quality_signal float64 | qsc_codepython_cate_var_zero_quality_signal bool | qsc_codepython_frac_lines_pass_quality_signal float64 | qsc_codepython_frac_lines_import_quality_signal float64 | qsc_codepython_frac_lines_simplefunc_quality_signal float64 | qsc_codepython_score_lines_no_logic_quality_signal float64 | qsc_codepython_frac_lines_print_quality_signal float64 | qsc_code_num_words int64 | qsc_code_num_chars int64 | qsc_code_mean_word_length int64 | qsc_code_frac_words_unique null | qsc_code_frac_chars_top_2grams int64 | qsc_code_frac_chars_top_3grams int64 | qsc_code_frac_chars_top_4grams int64 | qsc_code_frac_chars_dupe_5grams int64 | qsc_code_frac_chars_dupe_6grams int64 | qsc_code_frac_chars_dupe_7grams int64 | qsc_code_frac_chars_dupe_8grams int64 | qsc_code_frac_chars_dupe_9grams int64 | qsc_code_frac_chars_dupe_10grams int64 | qsc_code_frac_chars_replacement_symbols int64 | qsc_code_frac_chars_digital int64 | qsc_code_frac_chars_whitespace int64 | qsc_code_size_file_byte int64 | qsc_code_num_lines int64 | qsc_code_num_chars_line_max int64 | qsc_code_num_chars_line_mean int64 | qsc_code_frac_chars_alphabet int64 | qsc_code_frac_chars_comments int64 | qsc_code_cate_xml_start int64 | qsc_code_frac_lines_dupe_lines int64 | qsc_code_cate_autogen int64 | qsc_code_frac_lines_long_string int64 | qsc_code_frac_chars_string_length int64 | qsc_code_frac_chars_long_word_length int64 | qsc_code_frac_lines_string_concat null | qsc_code_cate_encoded_data int64 | qsc_code_frac_chars_hex_words int64 | qsc_code_frac_lines_prompt_comments int64 | qsc_code_frac_lines_assert int64 | qsc_codepython_cate_ast int64 | qsc_codepython_frac_lines_func_ratio int64 | qsc_codepython_cate_var_zero int64 | qsc_codepython_frac_lines_pass int64 | qsc_codepython_frac_lines_import int64 | qsc_codepython_frac_lines_simplefunc int64 | qsc_codepython_score_lines_no_logic int64 | qsc_codepython_frac_lines_print int64 | effective string | hits int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b8eeae7341e09cf8d911ebd5985806f15f14f470 | 15,085 | py | Python | fs/copy.py | dhirschfeld/pyfilesystem2 | b2c0d96f55d4dfe777b4f9476676b77d01f36bf7 | [
"MIT"
] | null | null | null | fs/copy.py | dhirschfeld/pyfilesystem2 | b2c0d96f55d4dfe777b4f9476676b77d01f36bf7 | [
"MIT"
] | null | null | null | fs/copy.py | dhirschfeld/pyfilesystem2 | b2c0d96f55d4dfe777b4f9476676b77d01f36bf7 | [
"MIT"
] | null | null | null | """Functions for copying resources *between* filesystem.
"""
from __future__ import print_function, unicode_literals
import typing
from .errors import FSError
from .opener import manage_fs
from .path import abspath, combine, frombase, normpath
from .tools import is_thread_safe
from .walk import Walker
if False: # typing.TYPE_CHECKING
from typing import Callable, Optional, Text, Union
from .base import FS
from .walk import Walker
_OnCopy = Callable[[FS, Text, FS, Text], object]
def copy_fs(
src_fs, # type: Union[FS, Text]
dst_fs, # type: Union[FS, Text]
walker=None, # type: Optional[Walker]
on_copy=None, # type: Optional[_OnCopy]
workers=0, # type: int
):
# type: (...) -> None
"""Copy the contents of one filesystem to another.
Arguments:
src_fs (FS or str): Source filesystem (URL or instance).
dst_fs (FS or str): Destination filesystem (URL or instance).
walker (~fs.walk.Walker, optional): A walker object that will be
used to scan for files in ``src_fs``. Set this if you only want
to consider a sub-set of the resources in ``src_fs``.
on_copy (callable):A function callback called after a single file copy
is executed. Expected signature is ``(src_fs, src_path, dst_fs,
dst_path)``.
workers (int): Use `worker` threads to copy data, or ``0`` (default) for
a single-threaded copy.
"""
return copy_dir(
src_fs, "/", dst_fs, "/", walker=walker, on_copy=on_copy, workers=workers
)
def copy_fs_if_newer(
src_fs, # type: Union[FS, Text]
dst_fs, # type: Union[FS, Text]
walker=None, # type: Optional[Walker]
on_copy=None, # type: Optional[_OnCopy]
workers=0, # type: int
):
# type: (...) -> None
"""Copy the contents of one filesystem to another, checking times.
If both source and destination files exist, the copy is executed
only if the source file is newer than the destination file. In case
modification times of source or destination files are not available,
copy file is always executed.
Arguments:
src_fs (FS or str): Source filesystem (URL or instance).
dst_fs (FS or str): Destination filesystem (URL or instance).
walker (~fs.walk.Walker, optional): A walker object that will be
used to scan for files in ``src_fs``. Set this if you only want
to consider a sub-set of the resources in ``src_fs``.
on_copy (callable):A function callback called after a single file copy
is executed. Expected signature is ``(src_fs, src_path, dst_fs,
dst_path)``.
workers (int): Use `worker` threads to copy data, or ``0`` (default) for
a single-threaded copy.
"""
return copy_dir_if_newer(
src_fs, "/", dst_fs, "/", walker=walker, on_copy=on_copy, workers=workers
)
def _source_is_newer(src_fs, src_path, dst_fs, dst_path):
# type: (FS, Text, FS, Text) -> bool
"""Determine if source file is newer than destination file.
Arguments:
src_fs (FS): Source filesystem (instance or URL).
src_path (str): Path to a file on the source filesystem.
dst_fs (FS): Destination filesystem (instance or URL).
dst_path (str): Path to a file on the destination filesystem.
Returns:
bool: `True` if the source file is newer than the destination
file or file modification time cannot be determined, `False`
otherwise.
"""
try:
if dst_fs.exists(dst_path):
namespace = ("details", "modified")
src_modified = src_fs.getinfo(src_path, namespace).modified
if src_modified is not None:
dst_modified = dst_fs.getinfo(dst_path, namespace).modified
return dst_modified is None or src_modified > dst_modified
return True
except FSError: # pragma: no cover
# todo: should log something here
return True
def copy_file(
src_fs, # type: Union[FS, Text]
src_path, # type: Text
dst_fs, # type: Union[FS, Text]
dst_path, # type: Text
):
# type: (...) -> None
"""Copy a file from one filesystem to another.
If the destination exists, and is a file, it will be first truncated.
Arguments:
src_fs (FS or str): Source filesystem (instance or URL).
src_path (str): Path to a file on the source filesystem.
dst_fs (FS or str): Destination filesystem (instance or URL).
dst_path (str): Path to a file on the destination filesystem.
"""
with manage_fs(src_fs, writeable=False) as _src_fs:
with manage_fs(dst_fs, create=True) as _dst_fs:
if _src_fs is _dst_fs:
# Same filesystem, so we can do a potentially optimized
# copy
_src_fs.copy(src_path, dst_path, overwrite=True)
else:
# Standard copy
with _src_fs.lock(), _dst_fs.lock():
if _dst_fs.hassyspath(dst_path):
with _dst_fs.openbin(dst_path, "w") as write_file:
_src_fs.getfile(src_path, write_file)
else:
with _src_fs.openbin(src_path) as read_file:
_dst_fs.setbinfile(dst_path, read_file)
def copy_file_internal(
src_fs, # type: FS
src_path, # type: Text
dst_fs, # type: FS
dst_path, # type: Text
):
# type: (...) -> None
"""Low level copy, that doesn't call manage_fs or lock.
If the destination exists, and is a file, it will be first truncated.
This method exists to optimize copying in loops. In general you
should prefer `copy_file`.
Arguments:
src_fs (FS): Source filesystem.
src_path (str): Path to a file on the source filesystem.
dst_fs (FS: Destination filesystem.
dst_path (str): Path to a file on the destination filesystem.
"""
if src_fs is dst_fs:
# Same filesystem, so we can do a potentially optimized
# copy
src_fs.copy(src_path, dst_path, overwrite=True)
elif dst_fs.hassyspath(dst_path):
with dst_fs.openbin(dst_path, "w") as write_file:
src_fs.getfile(src_path, write_file)
else:
with src_fs.openbin(src_path) as read_file:
dst_fs.setbinfile(dst_path, read_file)
def copy_file_if_newer(
src_fs, # type: Union[FS, Text]
src_path, # type: Text
dst_fs, # type: Union[FS, Text]
dst_path, # type: Text
):
# type: (...) -> bool
"""Copy a file from one filesystem to another, checking times.
If the destination exists, and is a file, it will be first truncated.
If both source and destination files exist, the copy is executed only
if the source file is newer than the destination file. In case
modification times of source or destination files are not available,
copy is always executed.
Arguments:
src_fs (FS or str): Source filesystem (instance or URL).
src_path (str): Path to a file on the source filesystem.
dst_fs (FS or str): Destination filesystem (instance or URL).
dst_path (str): Path to a file on the destination filesystem.
Returns:
bool: `True` if the file copy was executed, `False` otherwise.
"""
with manage_fs(src_fs, writeable=False) as _src_fs:
with manage_fs(dst_fs, create=True) as _dst_fs:
if _src_fs is _dst_fs:
# Same filesystem, so we can do a potentially optimized
# copy
if _source_is_newer(_src_fs, src_path, _dst_fs, dst_path):
_src_fs.copy(src_path, dst_path, overwrite=True)
return True
else:
return False
else:
# Standard copy
with _src_fs.lock(), _dst_fs.lock():
if _source_is_newer(_src_fs, src_path, _dst_fs, dst_path):
copy_file_internal(_src_fs, src_path, _dst_fs, dst_path)
return True
else:
return False
def copy_structure(
src_fs, # type: Union[FS, Text]
dst_fs, # type: Union[FS, Text]
walker=None, # type: Optional[Walker]
):
# type: (...) -> None
"""Copy directories (but not files) from ``src_fs`` to ``dst_fs``.
Arguments:
src_fs (FS or str): Source filesystem (instance or URL).
dst_fs (FS or str): Destination filesystem (instance or URL).
walker (~fs.walk.Walker, optional): A walker object that will be
used to scan for files in ``src_fs``. Set this if you only
want to consider a sub-set of the resources in ``src_fs``.
"""
walker = walker or Walker()
with manage_fs(src_fs) as _src_fs:
with manage_fs(dst_fs, create=True) as _dst_fs:
with _src_fs.lock(), _dst_fs.lock():
for dir_path in walker.dirs(_src_fs):
_dst_fs.makedir(dir_path, recreate=True)
def copy_dir(
src_fs, # type: Union[FS, Text]
src_path, # type: Text
dst_fs, # type: Union[FS, Text]
dst_path, # type: Text
walker=None, # type: Optional[Walker]
on_copy=None, # type: Optional[_OnCopy]
workers=0, # type: int
):
# type: (...) -> None
"""Copy a directory from one filesystem to another.
Arguments:
src_fs (FS or str): Source filesystem (instance or URL).
src_path (str): Path to a directory on the source filesystem.
dst_fs (FS or str): Destination filesystem (instance or URL).
dst_path (str): Path to a directory on the destination filesystem.
walker (~fs.walk.Walker, optional): A walker object that will be
used to scan for files in ``src_fs``. Set this if you only
want to consider a sub-set of the resources in ``src_fs``.
on_copy (callable, optional): A function callback called after
a single file copy is executed. Expected signature is
``(src_fs, src_path, dst_fs, dst_path)``.
workers (int): Use `worker` threads to copy data, or ``0`` (default) for
a single-threaded copy.
"""
on_copy = on_copy or (lambda *args: None)
walker = walker or Walker()
_src_path = abspath(normpath(src_path))
_dst_path = abspath(normpath(dst_path))
def src():
return manage_fs(src_fs, writeable=False)
def dst():
return manage_fs(dst_fs, create=True)
from ._bulk import Copier
with src() as _src_fs, dst() as _dst_fs:
with _src_fs.lock(), _dst_fs.lock():
_thread_safe = is_thread_safe(_src_fs, _dst_fs)
with Copier(num_workers=workers if _thread_safe else 0) as copier:
_dst_fs.makedir(_dst_path, recreate=True)
for dir_path, dirs, files in walker.walk(_src_fs, _src_path):
copy_path = combine(_dst_path, frombase(_src_path, dir_path))
for info in dirs:
_dst_fs.makedir(info.make_path(copy_path), recreate=True)
for info in files:
src_path = info.make_path(dir_path)
dst_path = info.make_path(copy_path)
copier.copy(_src_fs, src_path, _dst_fs, dst_path)
on_copy(_src_fs, src_path, _dst_fs, dst_path)
def copy_dir_if_newer(
src_fs, # type: Union[FS, Text]
src_path, # type: Text
dst_fs, # type: Union[FS, Text]
dst_path, # type: Text
walker=None, # type: Optional[Walker]
on_copy=None, # type: Optional[_OnCopy]
workers=0, # type: int
):
# type: (...) -> None
"""Copy a directory from one filesystem to another, checking times.
If both source and destination files exist, the copy is executed only
if the source file is newer than the destination file. In case
modification times of source or destination files are not available,
copy is always executed.
Arguments:
src_fs (FS or str): Source filesystem (instance or URL).
src_path (str): Path to a directory on the source filesystem.
dst_fs (FS or str): Destination filesystem (instance or URL).
dst_path (str): Path to a directory on the destination filesystem.
walker (~fs.walk.Walker, optional): A walker object that will be
used to scan for files in ``src_fs``. Set this if you only
want to consider a sub-set of the resources in ``src_fs``.
on_copy (callable, optional): A function callback called after
a single file copy is executed. Expected signature is
``(src_fs, src_path, dst_fs, dst_path)``.
workers (int): Use `worker` threads to copy data, or ``0`` (default) for
a single-threaded copy.
"""
on_copy = on_copy or (lambda *args: None)
walker = walker or Walker()
_src_path = abspath(normpath(src_path))
_dst_path = abspath(normpath(dst_path))
def src():
return manage_fs(src_fs, writeable=False)
def dst():
return manage_fs(dst_fs, create=True)
from ._bulk import Copier
with src() as _src_fs, dst() as _dst_fs:
with _src_fs.lock(), _dst_fs.lock():
_thread_safe = is_thread_safe(_src_fs, _dst_fs)
with Copier(num_workers=workers if _thread_safe else 0) as copier:
_dst_fs.makedir(_dst_path, recreate=True)
namespace = ("details", "modified")
dst_state = {
path: info
for path, info in walker.info(_dst_fs, _dst_path, namespace)
if info.is_file
}
src_state = [
(path, info)
for path, info in walker.info(_src_fs, _src_path, namespace)
]
for dir_path, copy_info in src_state:
copy_path = combine(_dst_path, frombase(_src_path, dir_path))
if copy_info.is_dir:
_dst_fs.makedir(copy_path, recreate=True)
elif copy_info.is_file:
# dst file is present, try to figure out if copy
# is necessary
try:
src_modified = copy_info.modified
dst_modified = dst_state[dir_path].modified
except KeyError:
do_copy = True
else:
do_copy = (
src_modified is None
or dst_modified is None
or src_modified > dst_modified
)
if do_copy:
copier.copy(_src_fs, dir_path, _dst_fs, copy_path)
on_copy(_src_fs, dir_path, _dst_fs, copy_path)
| 38.979328 | 81 | 0.600398 | 2,060 | 15,085 | 4.185437 | 0.090777 | 0.042334 | 0.017397 | 0.021109 | 0.821155 | 0.802482 | 0.797727 | 0.788448 | 0.775226 | 0.739968 | 0 | 0.000966 | 0.314021 | 15,085 | 386 | 82 | 39.080311 | 0.832238 | 0.471793 | 0 | 0.591623 | 0 | 0 | 0.004856 | 0 | 0 | 0 | 0 | 0.002591 | 0 | 1 | 0.068063 | false | 0 | 0.062827 | 0.020942 | 0.198953 | 0.005236 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
771212058e5415c9a57c92689249326a2bb43153 | 9,697 | py | Python | tests/test_metrics.py | aboucaud/BlendingToolKit | b25653113da5030c1b54fbe674b2e9a4ed69072f | [
"MIT"
] | null | null | null | tests/test_metrics.py | aboucaud/BlendingToolKit | b25653113da5030c1b54fbe674b2e9a4ed69072f | [
"MIT"
] | null | null | null | tests/test_metrics.py | aboucaud/BlendingToolKit | b25653113da5030c1b54fbe674b2e9a4ed69072f | [
"MIT"
] | null | null | null | import pytest
import btk
import os
import sys
import numpy as np
def compare_basic_metric(
user_config_dict,
simulation_config_dict,
btk_input,
):
"""Compares summary table output from btk default detection to the expected
result test_metric_summary.
"""
test_metric_summary = np.array(
[
[4, 1, 3, 0, 0, 1, 3, 0, 0],
[5, 1, 4, 0, 0, 1, 4, 0, 0],
[6, 1, 5, 0, 0, 1, 5, 0, 0],
[4, 1, 3, 0, 0, 1, 3, 0, 0],
]
)
shifts = [
[[-2.4, -0.8, 0.9, 1.4], [-2.3, -0.4, 2.3, 1.9]],
[[-2.3, 2.0, 0.0, 0.4, 0.7], [1.6, 0.1, 0.7, 0.9, 2.3]],
[[0.6, -0.6, 1.7, 0.4, 2.3, 0.2], [-1.7, -1.1, -1.6, 0.7, 1.0, -1.5]],
[[-1.3, -1.0, 1.2, -2.3], [-0.2, -0.9, -1.8, 1.4]],
]
indexes = [
[
3,
1,
9,
6,
],
[6, 10, 3, 7, 4],
[10, 0, 7, 1, 9, 4],
[1, 3, 2, 8],
]
np.random.seed(int(simulation_config_dict["seed"]))
draw_blend_generator = btk_input.make_draw_generator(
user_config_dict, simulation_config_dict, shifts=shifts, indexes=indexes
)
measure_generator = btk_input.make_measure_generator(
user_config_dict, draw_blend_generator
)
metric_param = btk.utils.Basic_metric_params(
meas_generator=measure_generator,
batch_size=simulation_config_dict["batch_size"],
)
results = btk.compute_metrics.run(metric_param, test_size=1)
detected_metrics_summary = results["detection"][2]
np.testing.assert_array_almost_equal(
detected_metrics_summary,
test_metric_summary,
decimal=3,
err_msg="Did not get desired detection metrics summary",
)
pass
def run_metrics_basic(input_args):
"""Test detection summary metrics with default detection algorithm."""
args = input_args()
sys.path.append(os.getcwd())
btk_input = __import__("btk_input")
config_dict = btk_input.read_configfile(
args.configfile, args.simulation, args.verbose
)
simulation_config_dict = config_dict["simulation"][args.simulation]
simulation_config_dict["max_number"] = 6
simulation_config_dict["batch_size"] = 4
user_config_dict = config_dict["user_input"]
catalog_name = os.path.join(
user_config_dict["data_dir"], simulation_config_dict["catalog"]
)
compare_basic_metric(
user_config_dict,
simulation_config_dict,
btk_input,
)
pass
def compare_sep_group_metric(
user_config_dict,
simulation_config_dict,
btk_input,
):
"""Compares summary table output from btk sep detection to the expected
result, test_metric_summary.
"""
test_metric_summary = np.array(
[
[3, 1, 2, 0, 0, 1, 2, 0, 0],
[2, 1, 1, 0, 0, 1, 1, 0, 0],
[3, 1, 2, 0, 0, 1, 2, 0, 0],
[2, 2, 0, 0, 0, 2, 0, 0, 0],
[2, 1, 1, 0, 0, 1, 1, 0, 0],
[3, 1, 2, 0, 0, 1, 2, 0, 0],
[2, 1, 1, 0, 0, 1, 1, 0, 0],
[5, 2, 3, 0, 0, 2, 3, 0, 0],
[5, 2, 3, 0, 0, 2, 3, 0, 0],
[3, 1, 2, 0, 0, 1, 2, 0, 0],
[3, 2, 1, 0, 0, 2, 1, 0, 0],
[4, 2, 2, 0, 0, 2, 2, 0, 0],
[5, 2, 3, 0, 0, 2, 3, 0, 0],
[3, 1, 2, 0, 0, 1, 2, 0, 0],
[2, 1, 1, 0, 0, 1, 1, 0, 0],
[2, 1, 1, 0, 0, 1, 1, 0, 0],
]
)
shifts = [
[[-2.4, -0.8, 0.9, 1.4], [-2.3, -0.4, 2.3, 1.9]],
[[-2.3, 2.0, 0.0, 0.4, 0.7], [1.6, 0.1, 0.7, 0.9, 2.3]],
[[0.6, -0.6, 1.7, 0.4, 2.3, 0.2], [-1.7, -1.1, -1.6, 0.7, 1.0, -1.5]],
[[-1.3, -1.0, 1.2, -2.3], [-0.2, -0.9, -1.8, 1.4]],
]
indexes = [
[
3,
1,
9,
6,
],
[6, 10, 3, 7, 4],
[10, 0, 7, 1, 9, 4],
[1, 3, 2, 8],
]
np.random.seed(int(simulation_config_dict["seed"]))
draw_blend_generator = btk_input.make_draw_generator(
user_config_dict, simulation_config_dict, shifts=shifts, indexes=indexes
)
measure_generator = btk_input.make_measure_generator(
user_config_dict, draw_blend_generator
)
metric_param = btk.utils.Basic_metric_params(
meas_generator=measure_generator,
batch_size=simulation_config_dict["batch_size"],
)
results = btk.compute_metrics.run(metric_param, test_size=2)
detected_metrics_summary = results["detection"][2]
np.testing.assert_array_almost_equal(
detected_metrics_summary,
test_metric_summary,
decimal=3,
err_msg="Did not get desired detection metrics summary",
)
pass
def run_metrics_sep(input_args):
"""Test detection summary metrics with SEP"""
simulations = [
"group",
]
for simulation in simulations:
args = input_args(simulation=simulation)
sys.path.append(os.getcwd())
btk_input = __import__("btk_input")
config_dict = btk_input.read_configfile(
args.configfile, args.simulation, args.verbose
)
simulation_config_dict = config_dict["simulation"][args.simulation]
user_config_dict = config_dict["user_input"]
user_config_dict["utils_input"]["measure_function"] = "SEP_params"
catalog_name = os.path.join(
user_config_dict["data_dir"], simulation_config_dict["catalog"]
)
compare_sep_group_metric(
user_config_dict,
simulation_config_dict,
btk_input,
)
pass
def compare_stack_group_metric(
user_config_dict,
simulation_config_dict,
btk_input,
):
"""Compares summary table output from btk stack detection to the expected
result, test_metric_summary.
"""
test_metric_summary = np.array(
[
[3, 1, 2, 0, 0, 1, 2, 0, 0],
[2, 1, 1, 0, 0, 1, 1, 0, 0],
[3, 1, 2, 0, 0, 1, 2, 0, 0],
[2, 2, 0, 0, 0, 2, 0, 0, 0],
[2, 1, 1, 0, 0, 1, 1, 0, 0],
[3, 1, 2, 0, 0, 1, 2, 0, 0],
[2, 1, 1, 0, 0, 1, 1, 0, 0],
[5, 0, 5, 0, 0, 0, 5, 0, 0],
[2, 1, 1, 0, 0, 1, 1, 0, 0],
[2, 1, 1, 0, 0, 1, 1, 0, 0],
[3, 1, 2, 0, 0, 1, 2, 0, 0],
[5, 2, 3, 0, 0, 2, 3, 0, 0],
[5, 1, 4, 0, 0, 1, 4, 0, 0],
[6, 3, 3, 0, 0, 3, 3, 0, 0],
[2, 1, 1, 0, 0, 1, 1, 0, 0],
[6, 3, 3, 0, 0, 3, 3, 0, 0],
]
)
shifts = [
[[-2.4, -0.8, 0.9, 1.4], [-2.3, -0.4, 2.3, 1.9]],
[[-2.3, 2.0, 0.0, 0.4, 0.7], [1.6, 0.1, 0.7, 0.9, 2.3]],
[[0.6, -0.6, 1.7, 0.4, 2.3, 0.2], [-1.7, -1.1, -1.6, 0.7, 1.0, -1.5]],
[[-1.3, -1.0, 1.2, -2.3], [-0.2, -0.9, -1.8, 1.4]],
]
indexes = [
[
3,
1,
9,
6,
],
[6, 10, 3, 7, 4],
[10, 0, 7, 1, 9, 4],
[1, 3, 2, 8],
]
np.random.seed(int(simulation_config_dict["seed"]))
draw_blend_generator = btk_input.make_draw_generator(
user_config_dict, simulation_config_dict, shifts=shifts, indexes=indexes
)
measure_generator = btk_input.make_measure_generator(
param, user_config_dict, draw_blend_generator
)
metric_param = btk.utils.Stack_metric_params(
meas_generator=measure_generator,
batch_size=simulation_config_dict["batch_size"],
)
results = btk.compute_metrics.run(metric_param, test_size=2)
detected_metrics_summary = results["detection"][2]
np.testing.assert_array_almost_equal(
detected_metrics_summary,
test_metric_summary,
decimal=3,
err_msg="Did not get desired detection metrics summary",
)
pass
def run_metrics_stack(input_args):
"""Test detection summary metrics with stack"""
simulations = [
"group",
]
for simulation in simulations:
args = input_args(simulation=simulation)
sys.path.append(os.getcwd())
btk_input = __import__("btk_input")
config_dict = btk_input.read_configfile(
args.configfile, args.simulation, args.verbose
)
simulation_config_dict = config_dict["simulation"][args.simulation]
user_config_dict = config_dict["user_input"]
user_config_dict["utils_input"]["measure_function"] = "Stack_params"
compare_stack_group_metric(
user_config_dict,
simulation_config_dict,
btk_input,
)
pass
@pytest.mark.timeout(25)
def test_metrics_all(input_args):
"""Test detection summary table with default detection algorithm and SEP/
stack if installed"""
run_metrics_basic(input_args)
##### Broken by btk_input
# try:
# run_metrics_sep(input_args)
# except ImportError:
# print("sep not found")
# try:
# run_metrics_stack(input_args)
# except ImportError:
# print("stack not found")
@pytest.mark.timeout(3)
def test_detection_eff_matrix():
"""Tests detection efficiency matrix computation in utils by inputting a
summary table with 4 entries, with number of true sources between 1-4 and
all detected and expecting matrix with
secondary diagonal being one"""
summary = np.array(
[[1, 1, 0, 0, 0], [2, 2, 0, 0, 0], [3, 3, 0, 0, 0], [4, 4, 0, 0, 0]]
)
num = 4
eff_matrix = btk.utils.get_detection_eff_matrix(summary, num)
test_eff_matrix = np.eye(num + 2)[:, : num + 1] * 100
test_eff_matrix[0, 0] = 0.0
np.testing.assert_array_equal(
eff_matrix, test_eff_matrix, err_msg="Incorrect efficiency matrix"
)
pass
| 31.586319 | 80 | 0.547901 | 1,454 | 9,697 | 3.448418 | 0.090784 | 0.038692 | 0.016753 | 0.018349 | 0.848424 | 0.810531 | 0.809733 | 0.777024 | 0.777024 | 0.774631 | 0 | 0.097842 | 0.302258 | 9,697 | 306 | 81 | 31.689542 | 0.643216 | 0.096937 | 0 | 0.686047 | 0 | 0 | 0.052419 | 0 | 0 | 0 | 0 | 0 | 0.015504 | 1 | 0.031008 | false | 0.027132 | 0.031008 | 0 | 0.062016 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
773832ee10e3d577c432cc046ea397ed9d8e4be6 | 20 | py | Python | build/lib/url2/__init__.py | zkung/url2 | 7f8f15d344c40be3d0a9dbfd0a51940f29dd3d5d | [
"MIT"
] | null | null | null | build/lib/url2/__init__.py | zkung/url2 | 7f8f15d344c40be3d0a9dbfd0a51940f29dd3d5d | [
"MIT"
] | null | null | null | build/lib/url2/__init__.py | zkung/url2 | 7f8f15d344c40be3d0a9dbfd0a51940f29dd3d5d | [
"MIT"
] | null | null | null | from .url2 import *
| 10 | 19 | 0.7 | 3 | 20 | 4.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0625 | 0.2 | 20 | 1 | 20 | 20 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
62233e2f54ce21ea3ac095eb63c32ea562254067 | 79 | py | Python | tests/unit/conftest.py | DEX-Company/ocean-py | 1534b50a0cf8b72473efe3712cc1cbab51651c35 | [
"Apache-2.0"
] | null | null | null | tests/unit/conftest.py | DEX-Company/ocean-py | 1534b50a0cf8b72473efe3712cc1cbab51651c35 | [
"Apache-2.0"
] | 14 | 2019-01-21T07:49:45.000Z | 2019-02-06T01:46:23.000Z | tests/unit/conftest.py | DEX-Company/ocean-py | 1534b50a0cf8b72473efe3712cc1cbab51651c35 | [
"Apache-2.0"
] | null | null | null | import pytest
@pytest.fixture(scope="module")
def config():
return None
| 9.875 | 31 | 0.696203 | 10 | 79 | 5.5 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.177215 | 79 | 7 | 32 | 11.285714 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0.076923 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0.25 | 0.25 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 6 |
622d6895a97d21a44803a49c18fe65ae0cffab26 | 130 | py | Python | class/lect/Lect-22/tf_hw/01-import.py | MikenzieAlasca/F21-1010 | a7c15b8d9bf84f316aa6921f6d8a588c513a22b8 | [
"MIT"
] | 5 | 2021-09-09T21:08:14.000Z | 2021-12-14T02:30:52.000Z | class/lect/Lect-22/tf_hw/01-import.py | MikenzieAlasca/F21-1010 | a7c15b8d9bf84f316aa6921f6d8a588c513a22b8 | [
"MIT"
] | null | null | null | class/lect/Lect-22/tf_hw/01-import.py | MikenzieAlasca/F21-1010 | a7c15b8d9bf84f316aa6921f6d8a588c513a22b8 | [
"MIT"
] | 8 | 2021-09-09T17:46:07.000Z | 2022-02-08T22:41:35.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
# Install TensorFlow
import tensorflow as tf
| 21.666667 | 82 | 0.846154 | 16 | 130 | 6.4375 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.123077 | 130 | 5 | 83 | 26 | 0.903509 | 0.138462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 6 |
622f3b87b64113cfbc71392654991a492c8d66e9 | 123 | py | Python | five.py | G-Cordova/pythonclass | 239b539f42fb44e3df390393c079073e4fcac762 | [
"Apache-2.0"
] | null | null | null | five.py | G-Cordova/pythonclass | 239b539f42fb44e3df390393c079073e4fcac762 | [
"Apache-2.0"
] | null | null | null | five.py | G-Cordova/pythonclass | 239b539f42fb44e3df390393c079073e4fcac762 | [
"Apache-2.0"
] | null | null | null | def plus_five(startingnumber):
return(startingnumber + 5)
print(plus_five(4))
print(plus_five(7))
print(plus_five(8))
| 17.571429 | 30 | 0.747967 | 19 | 123 | 4.631579 | 0.526316 | 0.363636 | 0.443182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036364 | 0.105691 | 123 | 6 | 31 | 20.5 | 0.763636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0.2 | 0.2 | 0.6 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 6 |
657e8fb73950e1ff961a664455db50912e8df4ea | 26 | py | Python | train/trainer/__init__.py | jdasam/ddsp-pytorch | cefa59881331e0f76eb073317a311c867e331ac2 | [
"MIT"
] | 88 | 2020-02-26T16:37:53.000Z | 2022-03-16T23:27:17.000Z | train/trainer/__init__.py | hihunjin/my_ddsp-pytorch | 2f7f9222b20ba34b3976a8f78c8efa696b4665c5 | [
"MIT"
] | 3 | 2020-07-25T05:03:17.000Z | 2022-03-23T17:37:38.000Z | train/trainer/__init__.py | hihunjin/my_ddsp-pytorch | 2f7f9222b20ba34b3976a8f78c8efa696b4665c5 | [
"MIT"
] | 17 | 2020-06-03T09:11:10.000Z | 2021-11-25T10:24:25.000Z | from . import io, trainer
| 13 | 25 | 0.730769 | 4 | 26 | 4.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.192308 | 26 | 1 | 26 | 26 | 0.904762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
6599340af19eb447e97aba6d4790aa085ae152b6 | 208 | py | Python | ojp/admin.py | harshkothari410/ocportal | d2fc46e290532e51351958bf850e774094f5535c | [
"MIT"
] | null | null | null | ojp/admin.py | harshkothari410/ocportal | d2fc46e290532e51351958bf850e774094f5535c | [
"MIT"
] | null | null | null | ojp/admin.py | harshkothari410/ocportal | d2fc46e290532e51351958bf850e774094f5535c | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import *
admin.site.register(UserProfile)
admin.site.register(Problem)
admin.site.register(TestCase)
admin.site.register(Submission) | 26 | 32 | 0.817308 | 28 | 208 | 6.071429 | 0.5 | 0.211765 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.081731 | 208 | 8 | 33 | 26 | 0.890052 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
b83e2cc765789574d2e21e19c416e6f41ca90e7d | 104 | py | Python | src/style_transfer/content_fusion/unique_weight.py | trbay/style_transfer_via_texture_synthesis | 4824fa1b74573e48d3e340fb691dea8d502cfd50 | [
"MIT"
] | null | null | null | src/style_transfer/content_fusion/unique_weight.py | trbay/style_transfer_via_texture_synthesis | 4824fa1b74573e48d3e340fb691dea8d502cfd50 | [
"MIT"
] | null | null | null | src/style_transfer/content_fusion/unique_weight.py | trbay/style_transfer_via_texture_synthesis | 4824fa1b74573e48d3e340fb691dea8d502cfd50 | [
"MIT"
] | null | null | null | import numpy as np
def no_segmentation(image):
return np.ones(image.shape, dtype=np.float64)
| 17.333333 | 50 | 0.711538 | 16 | 104 | 4.5625 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02381 | 0.192308 | 104 | 5 | 51 | 20.8 | 0.845238 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0.333333 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 6 |
b226fa657a1d1fbd198717247a9730d02f19591e | 205 | py | Python | pca/packages/errors/__init__.py | pcah/pca-errors | b07c49b96a894721c0c0344d8b6d7e059741695c | [
"MIT"
] | 2 | 2021-11-15T16:40:20.000Z | 2021-12-05T03:50:53.000Z | pca/packages/errors/__init__.py | pcah/pca-errors | b07c49b96a894721c0c0344d8b6d7e059741695c | [
"MIT"
] | null | null | null | pca/packages/errors/__init__.py | pcah/pca-errors | b07c49b96a894721c0c0344d8b6d7e059741695c | [
"MIT"
] | null | null | null | from .boundary import * # noqa: F401, F403
from .builder import * # noqa: F401, F403
from .catalog import * # noqa: F401, F403
from .types import * # noqa: F401, F403
VERSION = (0, 0, 2, "alpha", 0)
| 25.625 | 43 | 0.639024 | 30 | 205 | 4.366667 | 0.433333 | 0.305344 | 0.427481 | 0.549618 | 0.503817 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175 | 0.219512 | 205 | 7 | 44 | 29.285714 | 0.64375 | 0.326829 | 0 | 0 | 0 | 0 | 0.037594 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.8 | 0 | 0.8 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
b2670d26cae772113784fd0d6e987490c66c702a | 10,503 | py | Python | model-optimizer/extensions/ops/interp_test.py | shinh/dldt | 693ab4e79a428e0801f17f4511b129a3fa8f4a62 | [
"Apache-2.0"
] | 1 | 2021-02-20T21:48:36.000Z | 2021-02-20T21:48:36.000Z | model-optimizer/extensions/ops/interp_test.py | erinpark33/dldt | edd86d090592f7779f4dbb2681546e1f4e81284f | [
"Apache-2.0"
] | null | null | null | model-optimizer/extensions/ops/interp_test.py | erinpark33/dldt | edd86d090592f7779f4dbb2681546e1f4e81284f | [
"Apache-2.0"
] | 1 | 2021-02-19T01:06:12.000Z | 2021-02-19T01:06:12.000Z | """
Copyright (c) 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest
import numpy as np
from extensions.ops.interp import InterpOp
from mo.graph.graph import Node
from mo.utils.unittest.graph import build_graph
nodes_attributes = {'node_1': {'type': 'Identity', 'kind': 'op'},
'node_2': {'type': 'Identity', 'value': None, 'kind': 'data'},
'interp': {'type': 'Interp', 'kind': 'op', 'factor': None, 'parse_2nd_input': 'value'},
'node_3': {'type': 'Identity', 'shape': None, 'value': None, 'kind': 'data'},
'op_output': { 'kind': 'op', 'op': 'OpOutput'}
}
class TestInterpOp(unittest.TestCase):
def test_caffe_interp_infer_shrink(self):
graph = build_graph(nodes_attributes,
[('node_1', 'interp'),
('interp', 'node_3'),
('node_3', 'op_output')
],
{'node_3': {'shape': None},
'node_1': {'shape': np.array([1, 3, 1025, 2049])},
'interp': {'shrink_factor': 2,
'height': 0,
'width': 0,
'zoom_factor': 1,
'pad_beg': 0,
'pad_end': 0}
})
graph.graph['layout'] = 'NCHW'
interp_node = Node(graph, 'interp')
InterpOp.interp_infer(interp_node)
exp_shape = np.array([1, 3, 513, 1025])
res_shape = graph.node['node_3']['shape']
for i in range(0, len(exp_shape)):
self.assertEqual(exp_shape[i], res_shape[i])
def test_caffe_interp_infer_wh(self):
graph = build_graph(nodes_attributes,
[('node_1', 'interp'),
('interp', 'node_3'),
('node_3', 'op_output')
],
{'node_3': {'shape': None},
'node_1': {'shape': np.array([1, 1024, 1, 1])},
'interp': {'width': 65,
'height': 33,
'zoom_factor': 1,
'shrink_factor': 1,
'pad_beg': 0,
'pad_end': 0}
})
graph.graph['layout'] = 'NCHW'
interp_node = Node(graph, 'interp')
InterpOp.interp_infer(interp_node)
exp_shape = np.array([1, 1024, 33, 65])
res_shape = graph.node['node_3']['shape']
for i in range(0, len(exp_shape)):
self.assertEqual(exp_shape[i], res_shape[i])
def test_caffe_interp_infer_zoom(self):
graph = build_graph(nodes_attributes,
[('node_1', 'interp'),
('interp', 'node_3'),
('node_3', 'op_output')
],
{'node_3': {'shape': None},
'node_1': {'shape': np.array([1, 256, 33, 65])},
'interp': {'zoom_factor': 2,
'height': 0,
'width': 0,
'shrink_factor': 1,
'pad_beg': 0,
'pad_end': 0}
})
graph.graph['layout'] = 'NCHW'
interp_node = Node(graph, 'interp')
InterpOp.interp_infer(interp_node)
exp_shape = np.array([1, 256, 66, 130])
res_shape = graph.node['node_3']['shape']
for i in range(0, len(exp_shape)):
self.assertEqual(exp_shape[i], res_shape[i])
def test_caffe_interp_infer_zoom_shrink(self):
graph = build_graph(nodes_attributes,
[('node_1', 'interp'),
('interp', 'node_3'),
('node_3', 'op_output')
],
{'node_3': {'shape': None},
'node_1': {'shape': np.array([1, 256, 33, 65])},
'interp': {'zoom_factor': 2,
'height': 0,
'width': 0,
'shrink_factor': 2,
'pad_beg': 0,
'pad_end': 0}
})
graph.graph['layout'] = 'NCHW'
interp_node = Node(graph, 'interp')
InterpOp.interp_infer(interp_node)
exp_shape = np.array([1, 256, 33, 65])
res_shape = graph.node['node_3']['shape']
for i in range(0, len(exp_shape)):
self.assertEqual(exp_shape[i], res_shape[i])
def test_caffe_interp_infer_zoom_shrink_error(self):
graph = build_graph(nodes_attributes,
[('node_1', 'interp'),
('interp', 'node_3'),
('node_3', 'op_output')
],
{'node_3': {'shape': None},
'node_1': {'shape': np.array([1, 256, 33, 65])},
'interp': {'zoom_factor': 0,
'height': 0,
'width': 0,
'shrink_factor': 0,
'pad_beg': 0,
'pad_end': 0}
})
graph.graph['layout'] = 'NCHW'
interp_node = Node(graph, 'interp')
InterpOp.interp_infer(interp_node)
self.assertIsNone(graph.node['node_3']['shape'])
def test_caffe_interp_infer_zoom_default(self):
graph = build_graph(nodes_attributes,
[('node_1', 'interp'),
('interp', 'node_3'),
('node_3', 'op_output')
],
{'node_3': {'shape': None},
'node_1': {'shape': np.array([1, 256, 33, 65])},
'interp': {'zoom_factor': 1,
'height': 0,
'width': 0,
'shrink_factor': 1,
'pad_beg': 0,
'pad_end': 0
}
})
graph.graph['layout'] = 'NCHW'
interp_node = Node(graph, 'interp')
InterpOp.interp_infer(interp_node)
exp_shape = np.array([1, 256, 33, 65])
res_shape = graph.node['node_3']['shape']
for i in range(0, len(exp_shape)):
self.assertEqual(exp_shape[i], res_shape[i])
def test_caffe_interp_2_blobs(self):
graph = build_graph(nodes_attributes,
[('node_1', 'interp'),
('node_2', 'interp'),
('interp', 'node_3'),
('node_3', 'op_output')
],
{'node_3': {'shape': None},
'node_1': {'shape': np.array([1, 256, 33, 66])},
'node_2': {'shape': np.array([1, 1, 3, 6])},
'interp': {'zoom_factor': 1,
'shrink_factor': 1,
'pad_beg': 0,
'pad_end': 0,
'parse_2nd_input': 'shape',
}
})
graph.graph['layout'] = 'NCHW'
interp_node = Node(graph, 'interp')
InterpOp.interp_infer(interp_node)
exp_shape = np.array([1, 256, 3, 6])
res_shape = graph.node['node_3']['shape']
for i in range(0, len(exp_shape)):
self.assertEqual(exp_shape[i], res_shape[i])
def test_tf_interp_infer_two_inputs(self):
graph = build_graph(nodes_attributes,
[('node_1', 'interp'),
('node_2', 'interp'),
('interp', 'node_3')],
{'node_1': {'shape': np.array([1, 20, 30, 100])},
'node_2': {'shape': np.array([2]), 'value': np.array([2, 3])}})
graph.graph['layout'] = 'NHWC'
interp_node = Node(graph, 'interp')
InterpOp.interp_infer(interp_node)
exp_shape = np.array([1, 2, 3, 100])
res_shape = graph.node['node_3']['shape']
for i in range(0, len(exp_shape)):
self.assertEqual(exp_shape[i], res_shape[i])
def test_tf_interp_infer_one_input_hw(self):
graph = build_graph(nodes_attributes,
[('node_1', 'interp'),
('interp', 'node_3')],
{'node_1': {'shape': np.array([1, 20, 30, 100])},
'interp': {'height': 4, 'width': 6, 'pad_beg': 0, 'pad_end': 0, 'zoom_factor': None,
'shrink_factor': None}})
graph.graph['layout'] = 'NHWC'
interp_node = Node(graph, 'interp')
InterpOp.interp_infer(interp_node)
exp_shape = np.array([1, 4, 6, 100])
res_shape = graph.node['node_3']['shape']
for i in range(0, len(exp_shape)):
self.assertEqual(exp_shape[i], res_shape[i])
| 45.271552 | 113 | 0.410645 | 1,014 | 10,503 | 4.025641 | 0.142998 | 0.040421 | 0.055855 | 0.057325 | 0.756982 | 0.735914 | 0.707496 | 0.707496 | 0.707496 | 0.707496 | 0 | 0.046933 | 0.458345 | 10,503 | 231 | 114 | 45.467532 | 0.670592 | 0.053985 | 0 | 0.762887 | 0 | 0 | 0.141561 | 0 | 0 | 0 | 0 | 0 | 0.046392 | 1 | 0.046392 | false | 0 | 0.025773 | 0 | 0.07732 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
b28375546f2ab6d983202a4ed1dfdb84c43f7d4c | 12,700 | py | Python | django/bossobject/test/bounding_box_view.py | jhuapl-boss/boss | c2e26d272bd7b8d54abdc2948193163537e31291 | [
"Apache-2.0"
] | 20 | 2016-05-16T21:08:13.000Z | 2021-11-16T11:50:19.000Z | django/bossobject/test/bounding_box_view.py | jhuapl-boss/boss | c2e26d272bd7b8d54abdc2948193163537e31291 | [
"Apache-2.0"
] | 31 | 2016-10-28T17:51:11.000Z | 2022-02-10T08:07:31.000Z | django/bossobject/test/bounding_box_view.py | jhuapl-boss/boss | c2e26d272bd7b8d54abdc2948193163537e31291 | [
"Apache-2.0"
] | 12 | 2016-10-28T17:47:01.000Z | 2021-05-18T23:47:06.000Z | # Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from django.conf import settings
import blosc
import unittest
import os
from rest_framework.test import APITestCase, APIRequestFactory
from rest_framework.test import force_authenticate
from rest_framework import status
from bossspatialdb.views import Cutout
from bossobject.views import BoundingBox
from bosscore.test.setup_db import SetupTestDB
import numpy as np
from unittest.mock import patch
from fakeredis import FakeStrictRedis
version = settings.BOSS_VERSION
class BoundingBoxMixin(object):
@unittest.skip('Skipping - indexing is now an asynchronous process')
def test_get_object_bounding_box_single_cuboid(self):
""" Test getting the bounding box of a object"""
test_mat = np.ones((128, 128, 16))
test_mat[0:128, 0:128, 0:16] = 4
test_mat = test_mat.astype(np.uint64)
test_mat = test_mat.reshape((16, 128, 128))
bb = blosc.compress(test_mat, typesize=64)
# Create request
factory = APIRequestFactory()
request = factory.post('/' + version + '/cutout/col1/exp1/bbchan1/0/1536:1664/1536:1664/0:16/', bb,
content_type='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', x_range='1536:1664', y_range='1536:1664', z_range='0:16', t_range=None)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
# Create Request to get data you posted
request = factory.get('/' + version + '/cutout/col1/exp1/bbchan1/0/1536:1664/1536:1664/0:16/',
accepts='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', x_range='1536:1664', y_range='1536:1664', z_range='0:16', t_range=None).render()
self.assertEqual(response.status_code, status.HTTP_200_OK)
# Decompress
raw_data = blosc.decompress(response.content)
data_mat = np.fromstring(raw_data, dtype=np.uint64)
data_mat = np.reshape(data_mat, (16, 128, 128), order='C')
# Test for data equality (what you put in is what you got back!)
np.testing.assert_array_equal(data_mat, test_mat)
# get the bounding box
# Create request
factory = APIRequestFactory()
request = factory.get('/' + version + '/boundingbox/col1/exp1/bbchan1/0/4')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = BoundingBox.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', id='4')
self.assertEqual(response.status_code, status.HTTP_200_OK)
bb = response.data
self.assertEqual(bb['t_range'], [0, 1])
self.assertEqual(bb['x_range'], [1536, 2048])
self.assertEqual(bb['y_range'], [1536, 2048])
self.assertEqual(bb['z_range'], [0, 16])
#@unittest.skipUnless(settings.RUN_HIGH_MEM_TESTS, "Test Requires >2.5GB of Memory")
@unittest.skip('Skipping - indexing is now an asynchronous process')
def test_get_object_bounding_box_span_cuboid_boundary(self):
""" Test getting the bounding box of a object that spans the z boundary of a cuboid"""
test_mat = np.ones((516, 516, 18))
test_mat = test_mat.astype(np.uint64)
test_mat = test_mat.reshape((18, 516, 516))
bb = blosc.compress(test_mat, typesize=64)
# Create request
factory = APIRequestFactory()
request = factory.post('/' + version + '/cutout/col1/exp1/bbchan1/0/0:516/0:526/0:18/', bb,
content_type='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', x_range='0:516', y_range='0:516', z_range='0:18', t_range=None)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
# Create Request to get data you posted
request = factory.get('/' + version + '/cutout/col1/exp1/bbchan1/0/0:516/0:516/0:18/',
accepts='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', x_range='0:516', y_range='0:516', z_range='0:18', t_range=None).render()
self.assertEqual(response.status_code, status.HTTP_200_OK)
# Decompress
raw_data = blosc.decompress(response.content)
data_mat = np.fromstring(raw_data, dtype=np.uint64)
data_mat = np.reshape(data_mat, (18, 516, 516), order='C')
# Test for data equality (what you put in is what you got back!)
np.testing.assert_array_equal(data_mat, test_mat)
# get the bounding box
# Create request
factory = APIRequestFactory()
request = factory.get('/' + version + '/boundingbox/col1/exp1/bbchan1/0/1')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = BoundingBox.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', id='1')
self.assertEqual(response.status_code, status.HTTP_200_OK)
bb = response.data
self.assertEqual(bb['t_range'], [0, 1])
self.assertEqual(bb['x_range'], [0, 1024])
self.assertEqual(bb['y_range'], [0, 1024])
self.assertEqual(bb['z_range'], [0, 32])
@unittest.skip('Skipping - indexing is now an asynchronous process')
def test_get_object_bounding_box_tight_single_cuboid(self):
""" Test getting the bounding box of a object"""
test_mat = np.ones((128, 128, 16))
test_mat[0:516, 0:516, 0:18] = 3
test_mat = test_mat.astype(np.uint64)
test_mat = test_mat.reshape((16, 128, 128))
bb = blosc.compress(test_mat, typesize=64)
# Create request
factory = APIRequestFactory()
request = factory.post('/' + version + '/cutout/col1/exp1/bbchan1/0/1024:1152/1024:1152/0:16/', bb,
content_type='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', x_range='1024:1152', y_range='1024:1152', z_range='0:16', t_range=None)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
# Create Request to get data you posted
request = factory.get('/' + version + '/cutout/col1/exp1/bbchan1/0/1024:1152/1024:1152/0:16/',
accepts='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', x_range='1024:1152', y_range='1024:1152', z_range='0:16', t_range=None).render()
self.assertEqual(response.status_code, status.HTTP_200_OK)
# Decompress
raw_data = blosc.decompress(response.content)
data_mat = np.fromstring(raw_data, dtype=np.uint64)
data_mat = np.reshape(data_mat, (16, 128, 128), order='C')
# Test for data equality (what you put in is what you got back!)
np.testing.assert_array_equal(data_mat, test_mat)
# get the bounding box
# Create request
factory = APIRequestFactory()
request = factory.get('/' + version + '/boundingbox/col1/exp1/bbchan1/0/3?type=tight')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = BoundingBox.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', id='3')
self.assertEqual(response.status_code, status.HTTP_200_OK)
bb = response.data
self.assertEqual(bb['t_range'], [0, 1])
self.assertEqual(bb['x_range'], [1024, 1152])
self.assertEqual(bb['y_range'], [1024, 1152])
self.assertEqual(bb['z_range'], [0, 16])
#@unittest.skipUnless(settings.RUN_HIGH_MEM_TESTS, "Test Requires >2.5GB of Memory")
@unittest.skip('Skipping - indexing is now an asynchronous process')
def test_get_object_bounding_box_tight_span_cuboid_boundary(self):
""" Test getting the bounding box of a object that spans the z boundary of a cuboid"""
test_mat = np.ones((516, 516, 18))
test_mat[0:516, 0:516, 0:18] = 2
test_mat = test_mat.astype(np.uint64)
test_mat = test_mat.reshape((18, 516, 516))
bb = blosc.compress(test_mat, typesize=64)
# Create request
factory = APIRequestFactory()
request = factory.post('/' + version + '/cutout/col1/exp1/bbchan1/0/0:516/0:516/0:18/', bb,
content_type='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', x_range='0:516', y_range='0:516', z_range='0:18', t_range=None)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
# Create Request to get data you posted
request = factory.get('/' + version + '/cutout/col1/exp1/bbchan1/0/0:516/0:516/0:18/',
accepts='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', x_range='0:516', y_range='0:516', z_range='0:18', t_range=None).render()
self.assertEqual(response.status_code, status.HTTP_200_OK)
# Decompress
raw_data = blosc.decompress(response.content)
data_mat = np.fromstring(raw_data, dtype=np.uint64)
data_mat = np.reshape(data_mat, (18, 516, 516), order='C')
# Test for data equality (what you put in is what you got back!)
np.testing.assert_array_equal(data_mat, test_mat)
# get the bounding box
# Create request
factory = APIRequestFactory()
request = factory.get('/' + version + '/boundingbox/col1/exp1/bbchan1/0/2/?type=tight')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = BoundingBox.as_view()(request, collection='col1', experiment='exp1', channel='bbchan1',
resolution='0', id='2')
self.assertEqual(response.status_code, status.HTTP_200_OK)
bb = response.data
self.assertEqual(bb['t_range'], [0, 1])
self.assertEqual(bb['x_range'], [0, 516])
self.assertEqual(bb['y_range'], [0, 516])
self.assertEqual(bb['z_range'], [0, 18])
@patch('redis.StrictRedis', FakeStrictRedis)
class TestBoundingBoxView(BoundingBoxMixin, APITestCase):
def setUp(self):
"""
Initialize the database
:return:
"""
# Create a user
dbsetup = SetupTestDB()
self.user = dbsetup.create_user('testuser')
# Populate DB
dbsetup.insert_spatialdb_test_data()
| 42.333333 | 132 | 0.626614 | 1,608 | 12,700 | 4.812811 | 0.133085 | 0.02804 | 0.035147 | 0.024809 | 0.856829 | 0.849593 | 0.825559 | 0.825559 | 0.822845 | 0.822845 | 0 | 0.064964 | 0.250945 | 12,700 | 299 | 133 | 42.474916 | 0.748555 | 0.158504 | 0 | 0.65 | 0 | 0.05 | 0.130595 | 0.052143 | 0 | 0 | 0 | 0 | 0.2 | 1 | 0.03125 | false | 0 | 0.08125 | 0 | 0.125 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
a22ed1e599908f0fd2975b81ecdc21566c8d1661 | 147 | py | Python | stripe_modern/api_resources/checkout/__init__.py | photocrowd/stripe-python | 7c705e3d41f38f8524e419eb7ea18c1425a4ad89 | [
"MIT"
] | null | null | null | stripe_modern/api_resources/checkout/__init__.py | photocrowd/stripe-python | 7c705e3d41f38f8524e419eb7ea18c1425a4ad89 | [
"MIT"
] | null | null | null | stripe_modern/api_resources/checkout/__init__.py | photocrowd/stripe-python | 7c705e3d41f38f8524e419eb7ea18c1425a4ad89 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
# flake8: noqa
from stripe_modern.api_resources.checkout.session import Session
| 24.5 | 64 | 0.85034 | 19 | 147 | 6.157895 | 0.789474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007576 | 0.102041 | 147 | 5 | 65 | 29.4 | 0.878788 | 0.081633 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 6 |
a23a4c7e82e02d5d2b9aac5e4dc69540cadbdb80 | 3,612 | py | Python | tests/string_utils_test.py | kirillstrelkov/easyselenium | 99af15df42d3b4fe2c83a4a8d8d73b0f468539f7 | [
"MIT"
] | 1 | 2021-06-13T10:49:01.000Z | 2021-06-13T10:49:01.000Z | tests/string_utils_test.py | kirillstrelkov/easelenium | 99af15df42d3b4fe2c83a4a8d8d73b0f468539f7 | [
"MIT"
] | null | null | null | tests/string_utils_test.py | kirillstrelkov/easelenium | 99af15df42d3b4fe2c83a4a8d8d73b0f468539f7 | [
"MIT"
] | 1 | 2019-02-24T03:06:56.000Z | 2019-02-24T03:06:56.000Z | from unittest.case import TestCase
from easelenium.ui.string_utils import StringUtils
class StringUtilsTest(TestCase):
def test_is_test_file_name_correct(self):
assert StringUtils.is_test_file_name_correct("my_new_test.py")
assert StringUtils.is_test_file_name_correct("2my_new_test.py")
assert StringUtils.is_test_file_name_correct("my_2new_test.py")
assert not StringUtils.is_test_file_name_correct("test.py")
assert not StringUtils.is_test_file_name_correct("_test.py")
assert not StringUtils.is_test_file_name_correct("A_test.py")
assert not StringUtils.is_test_file_name_correct("9B_test.py")
assert not StringUtils.is_test_file_name_correct("B9_test.py")
def test_is_test_case_name_correct(self):
assert StringUtils.is_test_case_name_correct("test_1")
assert StringUtils.is_test_case_name_correct("test_new")
assert StringUtils.is_test_case_name_correct("test_search")
assert not StringUtils.is_test_case_name_correct("test.py")
assert not StringUtils.is_test_case_name_correct("test")
assert not StringUtils.is_test_case_name_correct("_test_asd")
assert not StringUtils.is_test_case_name_correct("asd")
assert not StringUtils.is_test_case_name_correct("453453sfs")
def test_is_method_name_correct(self):
assert StringUtils.is_method_name_correct("method_1")
assert StringUtils.is_method_name_correct("new_method")
assert StringUtils.is_method_name_correct("search")
assert StringUtils.is_method_name_correct("asd")
assert not StringUtils.is_method_name_correct("test.py")
assert not StringUtils.is_method_name_correct("_test_asd")
assert not StringUtils.is_method_name_correct("453453sfs")
def test_is_area_correct(self):
assert StringUtils.is_area_correct("(0,0,0,0)")
assert StringUtils.is_area_correct("(0, 0, 0, 0)")
assert StringUtils.is_area_correct("( 0, 0, 0, 0 )")
assert StringUtils.is_area_correct("(100, 100, 100, 100)")
assert not StringUtils.is_area_correct("(0, 0, 0)")
assert not StringUtils.is_area_correct("(0, 0, 0, d)")
assert not StringUtils.is_area_correct("0, 0, 0, 0")
assert not StringUtils.is_area_correct("(0, 0, 0, 0, 0)")
assert not StringUtils.is_area_correct("[0, 0, 0, 0]")
def test_is_url_correct(self):
assert StringUtils.is_url_correct("http://google.com")
assert StringUtils.is_url_correct("http://google.com/")
assert StringUtils.is_url_correct("http://www.google.com")
assert StringUtils.is_url_correct("http://www.google.com/")
assert StringUtils.is_url_correct("https://google.com/")
assert StringUtils.is_url_correct("https://google.com/sdf/we/qwe/asd?q=4")
assert not StringUtils.is_url_correct("")
assert not StringUtils.is_url_correct("google.com")
assert not StringUtils.is_url_correct("www.google.com")
def test_is_class_name_correct(self):
assert StringUtils.is_class_name_correct("AsDaAs")
assert StringUtils.is_class_name_correct("AAASdsd")
assert StringUtils.is_class_name_correct("Azczxc")
assert StringUtils.is_class_name_correct("AWEasd8")
assert StringUtils.is_class_name_correct("XCZXC32423")
assert StringUtils.is_class_name_correct("X")
assert not StringUtils.is_class_name_correct("")
assert not StringUtils.is_class_name_correct("google")
assert not StringUtils.is_class_name_correct("google.com")
| 48.810811 | 82 | 0.727021 | 504 | 3,612 | 4.829365 | 0.109127 | 0.26705 | 0.202958 | 0.216927 | 0.881265 | 0.86401 | 0.656532 | 0.624076 | 0.464256 | 0.358258 | 0 | 0.022727 | 0.17165 | 3,612 | 73 | 83 | 49.479452 | 0.790775 | 0 | 0 | 0.050847 | 0 | 0 | 0.14701 | 0 | 0 | 0 | 0 | 0 | 0.847458 | 1 | 0.101695 | false | 0 | 0.033898 | 0 | 0.152542 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
a2400504a4b86af55f5b0acd272b539f00173819 | 69 | py | Python | tests/fixtures.py | hanzhichao/runnerz | 3a42b7281972871b16c6347a2e233c5215047b08 | [
"MIT"
] | null | null | null | tests/fixtures.py | hanzhichao/runnerz | 3a42b7281972871b16c6347a2e233c5215047b08 | [
"MIT"
] | 2 | 2021-03-31T19:45:39.000Z | 2021-12-13T20:43:55.000Z | tmp/tests/fixtures.py | hanzhichao/runnerz | 3a42b7281972871b16c6347a2e233c5215047b08 | [
"MIT"
] | null | null | null | def print_me(a):
print('*'* 100)
print(a)
print('*'* 100) | 17.25 | 19 | 0.492754 | 10 | 69 | 3.3 | 0.5 | 0.363636 | 0.545455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 0.26087 | 69 | 4 | 20 | 17.25 | 0.529412 | 0 | 0 | 0.5 | 0 | 0 | 0.028571 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.25 | 1 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 6 |
a24c13ebc49a85924f87be804e424fad1573212e | 156 | py | Python | triggerflow/eventsourcing/callable_model.py | Dahk/triggerflow-examples | c492942ab911615d144a1375f4bc7933831203bd | [
"Apache-2.0"
] | 38 | 2020-06-11T08:05:21.000Z | 2022-03-17T10:21:18.000Z | triggerflow/eventsourcing/callable_model.py | Dahk/triggerflow-examples | c492942ab911615d144a1375f4bc7933831203bd | [
"Apache-2.0"
] | 1 | 2020-07-07T15:47:56.000Z | 2020-07-07T15:47:56.000Z | triggerflow/eventsourcing/callable_model.py | Dahk/triggerflow-examples | c492942ab911615d144a1375f4bc7933831203bd | [
"Apache-2.0"
] | 7 | 2020-05-18T16:32:06.000Z | 2021-11-30T17:11:12.000Z |
class Callable:
def __init__(self):
pass
def call(self, *args, **kwargs):
pass
def map(self, *args, **kwargs):
pass
| 13 | 36 | 0.519231 | 18 | 156 | 4.277778 | 0.555556 | 0.181818 | 0.363636 | 0.467532 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.352564 | 156 | 11 | 37 | 14.181818 | 0.762376 | 0 | 0 | 0.428571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | false | 0.428571 | 0 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 6 |
a2699689d1f3a3452d775ec7d5077c6bf738da1a | 48 | py | Python | build/lib/poloticker/__init__.py | hmallen/poloticker | 05b720b15b7776ca352e352f78060a428b10686e | [
"MIT"
] | 2 | 2018-09-02T11:53:27.000Z | 2018-09-03T02:07:28.000Z | poloticker/__init__.py | hmallen/poloticker | 05b720b15b7776ca352e352f78060a428b10686e | [
"MIT"
] | null | null | null | poloticker/__init__.py | hmallen/poloticker | 05b720b15b7776ca352e352f78060a428b10686e | [
"MIT"
] | 1 | 2018-09-03T02:07:32.000Z | 2018-09-03T02:07:32.000Z | from .poloticker import TickerGenerator, Ticker
| 24 | 47 | 0.854167 | 5 | 48 | 8.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104167 | 48 | 1 | 48 | 48 | 0.953488 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
a2b88d5dd31972656193e2fc1e570d8292517267 | 80 | py | Python | pages/tests/__init__.py | shipci/pythondotorg | eab6421261174c5f9040a4b50654e54e2ce90c9c | [
"Apache-2.0"
] | null | null | null | pages/tests/__init__.py | shipci/pythondotorg | eab6421261174c5f9040a4b50654e54e2ce90c9c | [
"Apache-2.0"
] | 1 | 2019-03-28T22:12:58.000Z | 2019-03-28T22:12:58.000Z | pages/tests/__init__.py | shipci/pythondotorg | eab6421261174c5f9040a4b50654e54e2ce90c9c | [
"Apache-2.0"
] | 1 | 2019-04-03T20:26:54.000Z | 2019-04-03T20:26:54.000Z | from .test_models import *
from .test_views import *
from .test_parser import *
| 20 | 26 | 0.775 | 12 | 80 | 4.916667 | 0.5 | 0.40678 | 0.474576 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 80 | 3 | 27 | 26.666667 | 0.867647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
0c00dc922163ed4c42c7e2c6cf6a0941cac8b641 | 163 | py | Python | pokemon/battle/__init__.py | Rix565/PygaMone | 58879a01b5427328824ab4558f6ea3916f1b844a | [
"MIT"
] | null | null | null | pokemon/battle/__init__.py | Rix565/PygaMone | 58879a01b5427328824ab4558f6ea3916f1b844a | [
"MIT"
] | null | null | null | pokemon/battle/__init__.py | Rix565/PygaMone | 58879a01b5427328824ab4558f6ea3916f1b844a | [
"MIT"
] | null | null | null | from . import animation
from . import background
from . import battle
from . import evolution_animaiton
from . import wild_start
from . import xp_battle_animation
| 23.285714 | 33 | 0.815951 | 22 | 163 | 5.863636 | 0.454545 | 0.465116 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147239 | 163 | 6 | 34 | 27.166667 | 0.928058 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
0c081ea021fa73dd8ae27fb8189498927154d14f | 113 | py | Python | lefi/voice/__init__.py | Moros0741/Lefi | 707dfcee45c386c4e9a70c776ac8ed1d0417bc14 | [
"MIT"
] | null | null | null | lefi/voice/__init__.py | Moros0741/Lefi | 707dfcee45c386c4e9a70c776ac8ed1d0417bc14 | [
"MIT"
] | null | null | null | lefi/voice/__init__.py | Moros0741/Lefi | 707dfcee45c386c4e9a70c776ac8ed1d0417bc14 | [
"MIT"
] | null | null | null | from .protocol import *
from .wsclient import *
from .state import *
from .player import *
from .client import *
| 18.833333 | 23 | 0.734513 | 15 | 113 | 5.533333 | 0.466667 | 0.481928 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176991 | 113 | 5 | 24 | 22.6 | 0.892473 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
0c1883c0e1806ae68fc3539106915ca84c6fec47 | 18,426 | py | Python | tests/test_special.py | skn123/butterfly | 7217b5d93bc78e1229fed3761bcc70d943f604b7 | [
"Apache-2.0"
] | 52 | 2020-08-05T08:32:24.000Z | 2022-03-27T21:56:34.000Z | tests/test_special.py | skn123/butterfly | 7217b5d93bc78e1229fed3761bcc70d943f604b7 | [
"Apache-2.0"
] | 13 | 2020-09-14T23:34:32.000Z | 2022-02-15T10:51:03.000Z | tests/test_special.py | skn123/butterfly | 7217b5d93bc78e1229fed3761bcc70d943f604b7 | [
"Apache-2.0"
] | 11 | 2020-10-15T07:03:25.000Z | 2022-03-25T12:03:49.000Z | import math
import unittest
import numpy as np
from scipy import linalg as la
import scipy.fft
import torch
from torch import nn
from torch.nn import functional as F
import torch.fft
import pywt # To test wavelet
import torch_butterfly
class ButterflySpecialTest(unittest.TestCase):
def setUp(self):
self.rtol = 1e-3
self.atol = 1e-5
def test_fft(self):
batch_size = 10
n = 16
input = torch.randn(batch_size, n, dtype=torch.complex64)
for normalized in [False, True]:
out_torch = torch.fft.fft(input, norm=None if not normalized else 'ortho')
for br_first in [True, False]:
b = torch_butterfly.special.fft(n, normalized=normalized, br_first=br_first)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_fft_unitary(self):
batch_size = 10
n = 16
input = torch.randn(batch_size, n, dtype=torch.complex64)
normalized = True
out_torch = torch.fft.fft(input, norm=None if not normalized else 'ortho')
for br_first in [True, False]:
b = torch_butterfly.special.fft_unitary(n, br_first=br_first)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_ifft(self):
batch_size = 10
n = 16
input = torch.randn(batch_size, n, dtype=torch.complex64)
for normalized in [False, True]:
out_torch = torch.fft.ifft(input, norm=None if not normalized else 'ortho')
for br_first in [True, False]:
b = torch_butterfly.special.ifft(n, normalized=normalized, br_first=br_first)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_ifft_unitary(self):
batch_size = 10
n = 16
input = torch.randn(batch_size, n, dtype=torch.complex64)
normalized = True
out_torch = torch.fft.ifft(input, norm=None if not normalized else 'ortho')
for br_first in [True, False]:
b = torch_butterfly.special.ifft_unitary(n, br_first=br_first)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_dct(self):
batch_size = 10
n = 16
input = torch.randn(batch_size, n)
for type in [2, 3, 4]:
for normalized in [False, True]:
out_sp = torch.tensor(scipy.fft.dct(input.numpy(), type=type,
norm=None if not normalized else 'ortho'))
b = torch_butterfly.special.dct(n, type=type, normalized=normalized)
out = b(input)
self.assertTrue(torch.allclose(out, out_sp, self.rtol, self.atol))
def test_dst(self):
batch_size = 1
n = 16
input = torch.randn(batch_size, n)
for type in [2, 4]:
for normalized in [False, True]:
out_sp = torch.tensor(scipy.fft.dst(input.numpy(), type=type,
norm=None if not normalized else 'ortho'))
b = torch_butterfly.special.dst(n, type=type, normalized=normalized)
out = b(input)
self.assertTrue(torch.allclose(out, out_sp, self.rtol, self.atol))
def test_circulant(self):
batch_size = 10
n = 13
for complex in [False, True]:
dtype = torch.float32 if not complex else torch.complex64
col = torch.randn(n, dtype=dtype)
C = la.circulant(col.numpy())
input = torch.randn(batch_size, n, dtype=dtype)
out_torch = torch.tensor(input.detach().numpy() @ C.T)
out_np = torch.tensor(np.fft.ifft(np.fft.fft(input.numpy()) * np.fft.fft(col.numpy())),
dtype=dtype)
self.assertTrue(torch.allclose(out_torch, out_np, self.rtol, self.atol))
# Just to show how to implement circulant multiply with FFT
if complex:
input_f = torch.fft.fft(input)
col_f = torch.fft.fft(col)
prod_f = input_f * col_f
out_fft = torch.fft.ifft(prod_f)
self.assertTrue(torch.allclose(out_torch, out_fft, self.rtol, self.atol))
for separate_diagonal in [True, False]:
b = torch_butterfly.special.circulant(col, transposed=False,
separate_diagonal=separate_diagonal)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
row = torch.randn(n, dtype=dtype)
C = la.circulant(row.numpy()).T
input = torch.randn(batch_size, n, dtype=dtype)
out_torch = torch.tensor(input.detach().numpy() @ C.T)
# row is the reverse of col, except the 0-th element stays put
# This corresponds to the same reversal in the frequency domain.
# https://en.wikipedia.org/wiki/Discrete_Fourier_transform#Time_and_frequency_reversal
row_f = np.fft.fft(row.numpy())
row_f_reversed = np.hstack((row_f[:1], row_f[1:][::-1]))
out_np = torch.tensor(np.fft.ifft(np.fft.fft(input.numpy())
* row_f_reversed), dtype=dtype)
self.assertTrue(torch.allclose(out_torch, out_np, self.rtol, self.atol))
for separate_diagonal in [True, False]:
b = torch_butterfly.special.circulant(row, transposed=True,
separate_diagonal=separate_diagonal)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_toeplitz(self):
batch_size = 10
for n, m in [(13, 38), (27, 11)]:
for complex in [False, True]:
dtype = torch.float32 if not complex else torch.complex64
col = torch.randn(n, dtype=dtype)
row = torch.randn(m, dtype=dtype)
T = la.toeplitz(col.numpy(), row.numpy())
input = torch.randn(batch_size, m, dtype=dtype)
out_torch = torch.tensor(input.detach().numpy() @ T.T)
for separate_diagonal in [True, False]:
b = torch_butterfly.special.toeplitz(col, row,
separate_diagonal=separate_diagonal)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_hadamard(self):
batch_size = 10
n = 16
H = torch.tensor(la.hadamard(n), dtype=torch.float32)
input = torch.randn(batch_size, n)
out_torch = F.linear(input, H) / math.sqrt(n)
for increasing_stride in [True, False]:
b = torch_butterfly.special.hadamard(n, normalized=True,
increasing_stride=increasing_stride)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_hadamard_diagonal(self):
batch_size = 10
n = 16
H = torch.tensor(la.hadamard(n), dtype=torch.float32) / math.sqrt(n)
for k in [1, 2, 3]:
diagonals = torch.randint(0, 2, (k, n)) * 2 - 1.0
input = torch.randn(batch_size, n)
out_torch = input
for diagonal in diagonals.unbind():
out_torch = F.linear(out_torch * diagonal, H)
for increasing_stride in [True, False]:
for separate_diagonal in [True, False]:
b = torch_butterfly.special.hadamard_diagonal(
diagonals, normalized=True, increasing_stride=increasing_stride,
separate_diagonal=separate_diagonal
)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_conv1d_circular_singlechannel(self):
batch_size = 10
for n in [13, 16]:
for kernel_size in [1, 3, 5, 7]:
padding = (kernel_size - 1) // 2
conv = nn.Conv1d(1, 1, kernel_size, padding=padding, padding_mode='circular',
bias=False)
weight = conv.weight
input = torch.randn(batch_size, 1, n)
out_torch = conv(input)
# Just to show how to implement conv1d with FFT
input_f = torch.fft.rfft(input)
col = F.pad(weight.flip(dims=(-1,)), (0, n - kernel_size)).roll(-padding, dims=-1)
col_f = torch.fft.rfft(col)
prod_f = input_f * col_f
out_fft = torch.fft.irfft(prod_f, n=n)
self.assertTrue(torch.allclose(out_torch, out_fft, self.rtol, self.atol))
for separate_diagonal in [True, False]:
b = torch_butterfly.special.conv1d_circular_singlechannel(n, weight,
separate_diagonal)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_conv1d_circular_multichannel(self):
batch_size = 10
in_channels = 3
out_channels = 4
for n in [13, 16]:
for kernel_size in [1, 3, 5, 7]:
padding = (kernel_size - 1) // 2
conv = nn.Conv1d(in_channels, out_channels, kernel_size, padding=padding,
padding_mode='circular', bias=False)
weight = conv.weight
input = torch.randn(batch_size, in_channels, n)
out_torch = conv(input)
# Just to show how to implement conv1d with FFT
input_f = torch.fft.rfft(input)
col = F.pad(weight.flip(dims=(-1,)), (0, n - kernel_size)).roll(-padding, dims=-1)
col_f = torch.fft.rfft(col)
prod_f = (input_f.unsqueeze(1) * col_f).sum(dim=2)
out_fft = torch.fft.irfft(prod_f, n=n)
self.assertTrue(torch.allclose(out_torch, out_fft, self.rtol, self.atol))
b = torch_butterfly.special.conv1d_circular_multichannel(n, weight)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_fft2d(self):
batch_size = 10
n1 = 16
n2 = 32
input = torch.randn(batch_size, n2, n1, dtype=torch.complex64)
for normalized in [False, True]:
out_torch = torch.fft.fftn(input, dim=(-1, -2),
norm=None if not normalized else 'ortho')
# Just to show how fft2d is exactly 2 ffts on each dimension
input_f = torch.fft.fft(input, dim=-1, norm=None if not normalized else 'ortho')
out_fft = torch.fft.fft(input_f, dim=-2, norm=None if not normalized else 'ortho')
self.assertTrue(torch.allclose(out_torch, out_fft, self.rtol, self.atol))
for br_first in [True, False]:
for flatten in [False, True]:
b = torch_butterfly.special.fft2d(n1, n2, normalized=normalized,
br_first=br_first, flatten=flatten)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_fft2d_unitary(self):
batch_size = 10
n1 = 16
n2 = 32
input = torch.randn(batch_size, n2, n1, dtype=torch.complex64)
normalized = True
out_torch = torch.fft.fftn(input, dim=(-1, -2), norm=None if not normalized else 'ortho')
for br_first in [True, False]:
b = torch_butterfly.special.fft2d_unitary(n1, n2, br_first=br_first)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_ifft2d(self):
batch_size = 10
n1 = 32
n2 = 16
input = torch.randn(batch_size, n2, n1, dtype=torch.complex64)
for normalized in [False, True]:
out_torch = torch.fft.ifftn(input, dim=(-1, -2),
norm=None if not normalized else 'ortho')
# Just to show how ifft2d is exactly 2 iffts on each dimension
input_f = torch.fft.ifft(input, dim=-1, norm=None if not normalized else 'ortho')
out_fft = torch.fft.ifft(input_f, dim=-2, norm=None if not normalized else 'ortho')
self.assertTrue(torch.allclose(out_torch, out_fft, self.rtol, self.atol))
for br_first in [True, False]:
for flatten in [False, True]:
b = torch_butterfly.special.ifft2d(n1, n2, normalized=normalized,
br_first=br_first, flatten=flatten)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_ifft2d_unitary(self):
batch_size = 10
n1 = 16
n2 = 32
input = torch.randn(batch_size, n2, n1, dtype=torch.complex64)
normalized = True
out_torch = torch.fft.ifftn(input, dim=(-1, -2), norm=None if not normalized else 'ortho')
for br_first in [True, False]:
b = torch_butterfly.special.ifft2d_unitary(n1, n2, br_first=br_first)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_conv2d_circular_multichannel(self):
batch_size = 10
in_channels = 3
out_channels = 4
for n1 in [13, 16]:
for n2 in [27, 32]:
# flatten is only supported for powers of 2 for now
if n1 == 1 << int(math.log2(n1)) and n2 == 1 << int(math.log2(n2)):
flatten_cases = [False, True]
else:
flatten_cases = [False]
for kernel_size1 in [1, 3, 5, 7]:
for kernel_size2 in [1, 3, 5, 7]:
padding1 = (kernel_size1 - 1) // 2
padding2 = (kernel_size2 - 1) // 2
conv = nn.Conv2d(in_channels, out_channels, (kernel_size2, kernel_size1),
padding=(padding2, padding1), padding_mode='circular',
bias=False)
weight = conv.weight
input = torch.randn(batch_size, in_channels, n2, n1)
out_torch = conv(input)
# Just to show how to implement conv2d with FFT
input_f = torch.fft.rfftn(input, dim=(-1, -2))
col = F.pad(weight.flip(dims=(-1,)), (0, n1 - kernel_size1)).roll(
-padding1, dims=-1)
col = F.pad(col.flip(dims=(-2,)), (0, 0, 0, n2 - kernel_size2)).roll(
-padding2, dims=-2)
col_f = torch.fft.rfftn(col, dim=(-1, -2))
prod_f = (input_f.unsqueeze(1) * col_f).sum(dim=2)
out_fft = torch.fft.irfftn(prod_f, dim=(-1, -2), s=(n1, n2))
self.assertTrue(torch.allclose(out_torch, out_fft, self.rtol, self.atol))
for flatten in flatten_cases:
b = torch_butterfly.special.conv2d_circular_multichannel(
n1, n2, weight, flatten=flatten)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_fastfood(self):
batch_size = 10
n = 32
H = torch.tensor(la.hadamard(n), dtype=torch.float32) / math.sqrt(n)
diag1 = torch.randint(0, 2, (n,)) * 2 - 1.0
diag2, diag3 = torch.randn(2, n)
permutation = torch.randperm(n)
input = torch.randn(batch_size, n)
out_torch = F.linear(input * diag1, H)[:, permutation]
out_torch = F.linear(out_torch * diag2, H) * diag3
for increasing_stride in [True, False]:
for separate_diagonal in [True, False]:
b = torch_butterfly.special.fastfood(
diag1, diag2, diag3, permutation, normalized=True,
increasing_stride=increasing_stride, separate_diagonal=separate_diagonal
)
out = b(input)
self.assertTrue(torch.allclose(out, out_torch, self.rtol, self.atol))
def test_acdc(self):
batch_size = 10
n = 32
input = torch.randn(batch_size, n)
diag1, diag2 = torch.randn(2, n)
for separate_diagonal in [True, False]:
out_sp = torch.tensor(scipy.fft.dct(input.numpy(), norm='ortho')) * diag1
out_sp = torch.tensor(scipy.fft.idct(out_sp.numpy(), norm='ortho')) * diag2
b = torch_butterfly.special.acdc(diag1, diag2, dct_first=True,
separate_diagonal=separate_diagonal)
out = b(input)
self.assertTrue(torch.allclose(out, out_sp, self.rtol, self.atol))
out_sp = torch.tensor(scipy.fft.idct(input.numpy(), norm='ortho')) * diag1
out_sp = torch.tensor(scipy.fft.dct(out_sp.numpy(), norm='ortho')) * diag2
b = torch_butterfly.special.acdc(diag1, diag2, dct_first=False,
separate_diagonal=separate_diagonal)
out = b(input)
self.assertTrue(torch.allclose(out, out_sp, self.rtol, self.atol))
def test_wavelet_haar(self):
batch_size = 10
n = 32
input = torch.randn(batch_size, n)
out_pywt = torch.tensor(np.hstack(pywt.wavedec(input.numpy(), 'haar')))
b = torch_butterfly.special.wavelet_haar(n)
out = b(input)
self.assertTrue(torch.allclose(out, out_pywt, self.rtol, self.atol))
if __name__ == "__main__":
unittest.main()
| 48.875332 | 99 | 0.549332 | 2,288 | 18,426 | 4.283654 | 0.083916 | 0.037547 | 0.058157 | 0.082645 | 0.819814 | 0.807265 | 0.771656 | 0.761861 | 0.746556 | 0.734619 | 0 | 0.027204 | 0.345653 | 18,426 | 376 | 100 | 49.005319 | 0.785685 | 0.031966 | 0 | 0.5625 | 0 | 0 | 0.007069 | 0 | 0 | 0 | 0 | 0 | 0.089286 | 1 | 0.0625 | false | 0 | 0.032738 | 0 | 0.098214 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
a7bbe11be5f75f28b7c6da5c4a279b7d3f76d4d3 | 96 | py | Python | venv/lib/python3.8/site-packages/rope/refactor/change_signature.py | GiulianaPola/select_repeats | 17a0d053d4f874e42cf654dd142168c2ec8fbd11 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/rope/refactor/change_signature.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/rope/refactor/change_signature.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/90/4a/29/1143923b58e9a12ae6ed2e60ac0bc75dfd6a1ad8ac43d94d7129548ad2 | 96 | 96 | 0.895833 | 9 | 96 | 9.555556 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.40625 | 0 | 96 | 1 | 96 | 96 | 0.489583 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
ac1534ecc4a944877935b9852cfc6e7ef13d11e2 | 152 | py | Python | transformers_keras/adapters/__init__.py | ParikhKadam/transformers-keras | 58b87d5feb5632e3830c2d3b27873df6ae6be4b3 | [
"Apache-2.0"
] | 74 | 2019-09-20T02:47:35.000Z | 2022-02-08T12:31:13.000Z | transformers_keras/adapters/__init__.py | ParikhKadam/transformers-keras | 58b87d5feb5632e3830c2d3b27873df6ae6be4b3 | [
"Apache-2.0"
] | 6 | 2020-06-07T11:24:24.000Z | 2021-09-30T08:01:12.000Z | transformers_keras/adapters/__init__.py | ParikhKadam/transformers-keras | 58b87d5feb5632e3830c2d3b27873df6ae6be4b3 | [
"Apache-2.0"
] | 11 | 2019-12-17T04:03:28.000Z | 2022-03-28T09:42:48.000Z | from .abstract_adapter import parse_pretrained_model_files, zip_weights
from .albert_adapter import AlbertAdapter
from .bert_adapter import BertAdapter
| 38 | 71 | 0.888158 | 20 | 152 | 6.4 | 0.7 | 0.304688 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.085526 | 152 | 3 | 72 | 50.666667 | 0.920863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
ac7936e0f67a40c93e2d2a4f5d66c253a3c670af | 72 | py | Python | qdserver/messaging/__init__.py | sipsop/qdserver | 5b372242241eb765cfe2ee57203449717bb81ed2 | [
"BSD-3-Clause"
] | null | null | null | qdserver/messaging/__init__.py | sipsop/qdserver | 5b372242241eb765cfe2ee57203449717bb81ed2 | [
"BSD-3-Clause"
] | null | null | null | qdserver/messaging/__init__.py | sipsop/qdserver | 5b372242241eb765cfe2ee57203449717bb81ed2 | [
"BSD-3-Clause"
] | null | null | null | from .types import *
from .send import send_message_async, send_message
| 24 | 50 | 0.819444 | 11 | 72 | 5.090909 | 0.545455 | 0.392857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 72 | 2 | 51 | 36 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
3bdbd004425e606b565c88188f0873b6cb6c0100 | 202 | py | Python | models.py | inesp/blog-structuring-old-python | f9790cf5b84c06d8689c7a82c5a082333e6e0839 | [
"Apache-2.0"
] | null | null | null | models.py | inesp/blog-structuring-old-python | f9790cf5b84c06d8689c7a82c5a082333e6e0839 | [
"Apache-2.0"
] | null | null | null | models.py | inesp/blog-structuring-old-python | f9790cf5b84c06d8689c7a82c5a082333e6e0839 | [
"Apache-2.0"
] | null | null | null | from mock import Mock
class Animal:
def __init__(self, name):
self.name = name
class Person:
def __init__(self, name):
self.name = name
query = Mock()
name = Mock()
| 13.466667 | 29 | 0.589109 | 26 | 202 | 4.269231 | 0.423077 | 0.288288 | 0.198198 | 0.27027 | 0.486486 | 0.486486 | 0.486486 | 0 | 0 | 0 | 0 | 0 | 0.311881 | 202 | 14 | 30 | 14.428571 | 0.798561 | 0 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.111111 | 0 | 0.777778 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 6 |
3bf8ee938abb5591acd740dbd26cbc50ca25dd2a | 301 | py | Python | tests/integration/conftest.py | alex817/ksnap | fec22fb42023f9bec51eaba4f47da3532fea8970 | [
"MIT"
] | 2 | 2020-06-26T06:59:32.000Z | 2021-06-03T17:28:17.000Z | tests/integration/conftest.py | alex817/ksnap | fec22fb42023f9bec51eaba4f47da3532fea8970 | [
"MIT"
] | 9 | 2020-07-03T08:42:38.000Z | 2021-10-05T08:04:40.000Z | tests/integration/conftest.py | alex817/ksnap | fec22fb42023f9bec51eaba4f47da3532fea8970 | [
"MIT"
] | 2 | 2020-11-02T18:26:08.000Z | 2021-03-23T06:44:58.000Z | import pytest
@pytest.fixture
def KAFKA_HOSTS():
return ['hkstgkafka02.hk.eclipseoptions.com',
'hkstgkafka03.hk.eclipseoptions.com',
'hkstgkafka04.hk.eclipseoptions.com',
'hkstgkafka05.hk.eclipseoptions.com',
'hkstgkafka06.hk.eclipseoptions.com']
| 27.363636 | 49 | 0.664452 | 28 | 301 | 7.107143 | 0.535714 | 0.40201 | 0.477387 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042373 | 0.215947 | 301 | 10 | 50 | 30.1 | 0.800847 | 0 | 0 | 0 | 0 | 0 | 0.564784 | 0.564784 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | true | 0 | 0.125 | 0.125 | 0.375 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 6 |
ce0e71f68a6ea5a444644e1d151250ec801786f9 | 45 | py | Python | src/wai/annotations/festvox/util/__init__.py | waikato-ufdl/wai-annotations-festvox | b42216325758e4304e3b85be1cf00f037cfea201 | [
"Apache-2.0"
] | null | null | null | src/wai/annotations/festvox/util/__init__.py | waikato-ufdl/wai-annotations-festvox | b42216325758e4304e3b85be1cf00f037cfea201 | [
"Apache-2.0"
] | null | null | null | src/wai/annotations/festvox/util/__init__.py | waikato-ufdl/wai-annotations-festvox | b42216325758e4304e3b85be1cf00f037cfea201 | [
"Apache-2.0"
] | null | null | null | from ._regex import LINE_PATTERN, LINE_REGEX
| 22.5 | 44 | 0.844444 | 7 | 45 | 5 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 45 | 1 | 45 | 45 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
ce327628b7aad3e09c87204a2913dab8fbbf2cfb | 13,357 | py | Python | sequential_learn.py | adholmgren/bayesian | d17cf6a377862b4bcdf386e6aa94583fe5aef7e9 | [
"MIT"
] | null | null | null | sequential_learn.py | adholmgren/bayesian | d17cf6a377862b4bcdf386e6aa94583fe5aef7e9 | [
"MIT"
] | null | null | null | sequential_learn.py | adholmgren/bayesian | d17cf6a377862b4bcdf386e6aa94583fe5aef7e9 | [
"MIT"
] | null | null | null | {
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is a notebook that looks at sequential learning with some toy cases \n",
"Author: Andrew Holmgren \n",
"BSD3 license"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Imports"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import scipy\n",
"import sklearn\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"normal = lambda x, u, s: 1 / np.sqrt(2 * np.pi * s**2) * np.exp(-(x - u) / (2 * s**2))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Simple model with linear parameters"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## The model"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(3.7) in Bishop, \"Pattern Recognition and Machine Learning\" \n",
"$$\n",
"t = y(\\mathbf{x}, \\mathbf{w}) + \\epsilon\n",
"$$\n",
"giving\n",
"$$\n",
"p(\\mathbf{t} \\mid \\mathbf{X}, \\mathbf{w}, \\beta) = \\pi_{n=1}^N \\mathcal{N}(t_N\\mid \\mathbf{w}^T \\phi(\\mathbf{x}_n), \\beta^{-1})\n",
"$$\n",
"where $\\phi$ are modeled basis functions such that\n",
"$$\n",
"y(\\mathbf{x}, \\mathbf{w})=\\sum_{j=0}^{M-1}w_j \\phi_j(\\mathbf{x}) = \\mathbf{w}^T \\phi(\\mathbf{x})\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"y = lambda x, w: w[0] + w[1] * x"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-0.3"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"w_true = [-0.3, 0.5]\n",
"y(0, w_true)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"beta = (1 / .2)**2\n",
"alpha = 2."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Generate the data"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 0.54745344 0.93100045 0.63493354 -0.69220357 -0.99392913 -0.52278428\n",
" -0.99281482 0.87394508 0.51413821 -0.85681813 -0.16657292 -0.02506078\n",
" 0.38854114 -0.83446589 0.4818891 0.12262944 0.20868325 0.0241436\n",
" -0.54247351 0.09946953]\n"
]
}
],
"source": [
"x_vals = np.random.rand(20) * 2 - 1\n",
"print(x_vals)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"t = y(x_vals, w_true) + np.random.normal(loc=0, scale=np.sqrt(1 / beta), size=x_vals.size)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0xa1978aef0>,\n",
" <matplotlib.lines.Line2D at 0xa197920b8>,\n",
" <matplotlib.lines.Line2D at 0xa19792908>]"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAD8CAYAAACVZ8iyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFiNJREFUeJzt3X+MXWd95/H3BweHIkhxEhNCksFhSVksqKA7zWaKCgYnENAqDiVQsws4u0Eupez+garFVZZqRbRyCNpFqorUupQ2YSVCCBvFbcOGxGSWfyZsHJWSXwo2aZu4cQkE80tADOa7f9wz7GVyZ3xnzpm519fvlzS695zz3PN8feb6fvw85xzfVBWSpJPbM0ZdgCRp9AwDSZJhIEkyDCRJGAaSJAwDSRKGgSQJw0CShGEgSQJOGXUBiznzzDNr06ZNoy5Dkk4o995777eqauNyXze2YbBp0yb2798/6jIk6YSS5B9X8jqniSRJhoEkyTCQJNFRGCS5NMnDSQ4m2bVEuyuSVJLpLvqVJHWjdRgkWQd8HHgTsBl4R5LNA9o9F/hPwJfb9ilJ6lYXI4MLgYNV9UhVHQVuBLYNaHcNcB3w4w76lCR1qIswOAd4rG/5ULPu55K8Cjivqv66g/4kaWLdt2eO2Tfu5r49c2vabxf3GWTAup9/l2aSZwAfA6487o6SncBOgKmpqQ5Kk6QTx3175vgXv7OVl3GUo19Yz33s4xU7Z9ak7y5GBoeA8/qWzwUe71t+LvByYDbJPwAXAXsHnUSuqj1VNV1V0xs3LvsGOkk6oT35uVnWc5RTOMYzOcqTn5tds767CIN7gAuSnJ9kPbAd2Du/saq+W1VnVtWmqtoE3A1cVlXeXixJfc546xaOsp6fsI6fsJ4z3rplzfpuPU1UVT9N8n7gdmAd8MmqeiDJh4H9VbV36T1IkgBesXOG+9jHk5+b5Yy3blmzKSKAVNXxW43A9PR0+X8TSdLyJLm3qpZ9L5d3IEuSDANJkmEgScIwkCRhGEiSMAwkSRgGkiQMA0kShoEkCcNAkoRhIEnCMJAkYRhIkjAMJEkYBpIkDANJEoaBJImOwiDJpUkeTnIwya4B2z+Q5MEkX02yL8mLuuhXktSN1mGQZB3wceBNwGbgHUk2L2j2t8B0Vf0qcDNwXdt+JUnd6WJkcCFwsKoeqaqjwI3Atv4GVXVXVf2wWbwbOLeDfiVJHekiDM4BHutbPtSsW8xVwOc76FeS1JFTOthHBqyrgQ2TdwLTwGsX2b4T2AkwNTXVQWmSpGF0MTI4BJzXt3wu8PjCRkkuBq4GLquqpwbtqKr2VNV0VU1v3Lixg9IkScPoIgzuAS5Icn6S9cB2YG9/gySvAv6UXhA80UGfkqQOtQ6Dqvop8H7gduAh4KaqeiDJh5Nc1jT7KPAc4LNJvpJk7yK7kySNQBfnDKiq24DbFqz7w77nF3fRjyRpdXgHsiTJMJAkGQaSJAwDSRKGgSQJw0CShGEgScIwkCRhGEiSMAwkSRgGkiQMA0kShoEkCcNAkoRhIEnCMJAkYRhIkjAMJEl0FAZJLk3ycJKDSXYN2H5qks8027+cZFMX/UqSutE6DJKsAz4OvAnYDLwjyeYFza4CjlTVS4CPAR9p268kqTtdjAwuBA5W1SNVdRS4Edi2oM024Prm+c3A1iTpoG9JOmHMzcHu3b3HcXNKB/s4B3isb/kQ8K8Xa1NVP03yXeAM4Fv9jZLsBHYCTE1NdVCaJI2HuTnYuhWOHoX162HfPpiZGXVV/18XI4NB/8KvFbShqvZU1XRVTW/cuLGD0iSdiB697lGO3HXkF9YduesIj1736Igqam92thcEx471HmdnR13RL+piZHAIOK9v+Vzg8UXaHEpyCvDLwLc76FvSBHrurz+XB9/+IL/0bvje/V/itJe/hh/dAJtvWng68sSxZUtvRDA/MtiyZdQV/aIuwuAe4IIk5wP/BGwH/u2CNnuBHcAccAXwxap62shAkgA2vG4Dv/Ru+OH/+BbncZDDX9jMsz9wJhtet2HUpa3YzExvamh2thcE4zRFBB2EQXMO4P3A7cA64JNV9UCSDwP7q2ov8OfAp5IcpDci2N62X0mT7Xv3f4nzOMhjvItz+RSH7n8J8OpRl9XKzMz4hcC8LkYGVNVtwG0L1v1h3/MfA2/roi9JJ4fTXv4aDn9hM+fyKf6Zyzjt5WeOuqSJ5h3I0oQY58sWl+vIXUf40Q3w7A+cyaE3vIRnf+BMfnQDTzuprO50MjKQNFrjftnicn3/nu+z+abNzTmC3tTQkX9zhO/f8/2hzhvMzY3v3Py4MgykCTDossUT+UNw6j8//T6jDa/bMHQQTFIwrhWniaQJMH/Z4rp143nZ4loa9+v5x5UjA2kCjPtli2tp3K/nH1eGgTQhxvmyxbVkMK6MYSBp4hiMy+c5A0lrbpIug50UjgykFfDSxZXzap/xZBhIy+SHWTuTdhnspHCaSFomL11sx8tgx5MjA2mZvHSxHa/2GU+GgbRMfpi159U+48cwkFbADzNNGs8ZSBoLXm46Wo4MJI2cV2iNniMDSSPnFVqj1yoMkpye5I4kB5rHp/3/sklemWQuyQNJvprkt9v0KU2ik32KxMtNR6/tNNEuYF9VXZtkV7P8wQVtfgi8u6oOJHkhcG+S26vqOy37libCiTpF0uVd2F6hNXptw2AbsKV5fj0wy4IwqKqv9T1/PMkTwEbAMJA4Me/IXY0A8wqt0Wp7zuCsqjoM0Dw+f6nGSS4E1gNfb9mvNDFOxCkS5/gnz3FHBknuBF4wYNPVy+koydnAp4AdVfWzRdrsBHYCTE09/WvvpEl0Ik6ReBf25ElVrfzFycPAlqo63HzYz1bVSwe0O43eFNLuqvrsMPuenp6u/fv3r7g2SavL/7l1PCW5t6qml/u6tucM9gI7gGubx1sHFLYeuAW4YdggkDT+nOOfLG3PGVwLXJLkAHBJs0yS6SSfaNq8HXgNcGWSrzQ/r2zZrySpQ62miVaT00SStHwrnSbyDmRJkmEgSTIMJEkYBpIkDANJEoaBJAnDQJKEYSBJwjCQJGEYSJIwDCRJGAaSJAwDSRKGgSbY3Bzs3t17lLS0tl9uI42l1fjCdmmSOTLQRPIL26XlMQw0kea/sH3dutF8YbtTVDrROE10EpvkLzSfmelNDY3iz+cUlU5ErcIgyenAZ4BNwD8Ab6+qI4u0PQ14CLilqt7fpl+1dzJ8YI3qC9sHTVEtp45JDmmNr7bTRLuAfVV1AbCvWV7MNcD/admfOuKc+uppM0U1H9If+lDv0WkmrZW2YbANuL55fj1w+aBGSf4VcBbwhZb9qSOjnlOfZPNTVNdcs/wRlyGtUWl7zuCsqjoMUFWHkzx/YYMkzwD+O/AuYOtSO0uyE9gJMDU11bI0LWWUc+ong5VOUc2H9Pz0nSGttXLcMEhyJ/CCAZuuHrKP9wG3VdVjSZZsWFV7gD0A09PTNeT+tUKjmlPX4gxpjcpxw6CqLl5sW5JvJDm7GRWcDTwxoNkM8JtJ3gc8B1if5AdVtdT5BemkZUhrFNpOE+0FdgDXNo+3LmxQVf9u/nmSK4Fpg0CSxkvbE8jXApckOQBc0iyTZDrJJ9oWJ0laG6kaz6n56enp2r9//6jLkKQTSpJ7q2p6ua/zv6OQJBkGkiTDQJKEYSBJwjCQJGEYSJIwDCRJGAaSJAwDSRKGwdD8TltJk8zvQB7CyfAVkZJObo4MhuC3T0madIbBEPyKSEmTzmmiIfjtU5ImnWEwJL99StIkc5pIkmQYSJJahkGS05PckeRA87hhkXZTSb6Q5KEkDybZ1KbfSeb9DJJGoe3IYBewr6ouAPY1y4PcAHy0ql4GXAg80bLfiTR/P8OHPtR7XI1AMGwkDdL2BPI2YEvz/HpgFvhgf4Mkm4FTquoOgKr6Qcs+J9ag+xm6PGntzXOSFtN2ZHBWVR0GaB6fP6DNrwDfSfK/kvxtko8mWdey34m02vczePOcpMUcd2SQ5E7gBQM2Xb2MPn4TeBXwKPAZ4Ergzwf0tRPYCTA1NTXk7ifHat/PMB828yMDb56TNC9VtfIXJw8DW6rqcJKzgdmqeumCNhcB11bVlmb5XcBFVfV7S+17enq69u/fv+LaNNjcnDfPSZMsyb1VNb3c17U9Z7AX2AFc2zzeOqDNPcCGJBur6pvA6wE/5UfEm+ckDdL2nMG1wCVJDgCXNMskmU7yCYCqOgb8PrAvyX1AgD9r2a8kqUOtRgZV9SSwdcD6/cB7+pbvAH61TV+SpNXjHciSJMNAkmQYSJIwDCRJGAaSJAwDSRKGgSQJw0CShGEgScIwkCRhGEiSMAwkSRgGkiQMA0kShoEkCcNAkoRhIEnCMJAk0TIMkpye5I4kB5rHDYu0uy7JA0keSvJHSdKmX0lSt9qODHYB+6rqAmBfs/wLkvwG8Gp634H8cuDXgde27FeS1KG2YbANuL55fj1w+YA2BTwLWA+cCjwT+EbLfpc0Nwe7d/ceJUnHd0rL159VVYcBqupwkucvbFBVc0nuAg4DAf64qh4atLMkO4GdAFNTUysqaG4Otm6Fo0dh/XrYtw9mZla0K0k6aRx3ZJDkziT3D/jZNkwHSV4CvAw4FzgHeH2S1wxqW1V7qmq6qqY3bty4nD/Hz83O9oLg2LHe4+zsinYjSSeV444MqurixbYl+UaSs5tRwdnAEwOavQW4u6p+0Lzm88BFwJdWWPOStmzpjQjmRwZbtqxGL5I0WdqeM9gL7Gie7wBuHdDmUeC1SU5J8kx6J48HThN1YWamNzV0zTVOEUnSsNqeM7gWuCnJVfQ+9N8GkGQaeG9VvQe4GXg9cB+9k8n/u6r+qmW/S5qZMQQkaTlahUFVPQlsHbB+P/Ce5vkx4Hfa9CNJWl3egSxJMgxWynsZJE2StucMTkreyyBp0jgyWAHvZZA0aQyDFZi/l2HdOu9lkDQZnCZagfl7GWZne0HgFJGkE51hsELeyyBpkjhNJEkyDCRJhoEkCcNAkoRhIEnCMJAkYRhIkjAMJEkYBpIkDANJEi3DIMnbkjyQ5GfNV10u1u7SJA8nOZhkV5s+JUndazsyuB/4LeBLizVIsg74OPAmYDPwjiSbW/YrSepQ2+9AfgggyVLNLgQOVtUjTdsbgW3Ag236liR1Zy3OGZwDPNa3fKhZJ0kaE8cdGSS5E3jBgE1XV9WtQ/QxaNhQi/S1E9gJMDU1NcSuJUldOG4YVNXFLfs4BJzXt3wu8Pgife0B9gBMT08PDAxJUvfWYproHuCCJOcnWQ9sB/auQb+SpCG1vbT0LUkOATPA3yS5vVn/wiS3AVTVT4H3A7cDDwE3VdUD7cqWJHWp7dVEtwC3DFj/OPDmvuXbgNva9CVJWj3egSxJMgwkSYaBJAnDQJKEYSBJwjCQJGEYSJKY0DCYm4Pdu3uPkqTja3XT2Tiam4OtW+HoUVi/Hvbtg5mZUVclSeNt4kYGs7O9IDh2rPc4OzvqiiRp/E1cGGzZ0hsRrFvXe9yyZdQVSdL4m7hpopmZ3tTQ7GwvCJwikqTjm7gwgF4AGAKSNLyJmyaSJC2fYSBJMgwkSYaBJAnDQJKEYSBJAlJVo65hoCTfBP5xhS8/E/hWh+V0aZxrg/Gub5xrg/Gub5xrg/Gub5xrg6fX96Kq2rjcnYxtGLSRZH9VTY+6jkHGuTYY7/rGuTYY7/rGuTYY7/rGuTborj6niSRJhoEkaXLDYM+oC1jCONcG413fONcG413fONcG413fONcGHdU3kecMJEnLM6kjA0nSMpywYZDkbUkeSPKzJIueSU9yaZKHkxxMsqtv/flJvpzkQJLPJFnfYW2nJ7mj2fcdSTYMaPO6JF/p+/lxksubbX+Z5O/7tr2yq9qGra9pd6yvhr1960d97F6ZZK75/X81yW/3bev82C32HurbfmpzHA42x2VT37Y/aNY/nOSNbWtZYX0fSPJgc6z2JXlR37aBv+M1rO3KJN/sq+E9fdt2NO+DA0l2dF3bkPV9rK+2ryX5Tt+21T52n0zyRJL7F9meJH/U1P7VJL/Wt235x66qTsgf4GXAS4FZYHqRNuuArwMvBtYDfwdsbrbdBGxvnv8J8Lsd1nYdsKt5vgv4yHHanw58G3h2s/yXwBWreOyGqg/4wSLrR3rsgF8BLmievxA4DDxvNY7dUu+hvjbvA/6keb4d+EzzfHPT/lTg/GY/6zr+XQ5T3+v63lu/O1/fUr/jNaztSuCPB7z2dOCR5nFD83zDWte3oP1/BD65Fseu2f9rgF8D7l9k+5uBzwMBLgK+3ObYnbAjg6p6qKoePk6zC4GDVfVIVR0FbgS2JQnweuDmpt31wOUdlret2eew+74C+HxV/bDDGpay3Pp+bhyOXVV9raoONM8fB54Aln2TzZAGvoeWqPlmYGtznLYBN1bVU1X198DBZn9rWl9V3dX33robOLfjGlZc2xLeCNxRVd+uqiPAHcClI67vHcCnO65hUVX1JXr/SFzMNuCG6rkbeF6Ss1nhsTthw2BI5wCP9S0fatadAXynqn66YH1XzqqqwwDN4/OP0347T3+T/bdm6PexJKd2WNty6ntWkv1J7p6fwmLMjl2SC+n9q+7rfau7PHaLvYcGtmmOy3fpHadhXtvWcvu4it6/JucN+h2vdW1vbX5fNyc5b5mvXYv6aKbWzge+2Ld6NY/dMBarf0XHbqy/6SzJncALBmy6uqpuHWYXA9bVEus7qW2Z+zkbeAVwe9/qPwD+md6H3B7gg8CHR1DfVFU9nuTFwBeT3Ad8b0C7UR67TwE7qupnzerWx25hNwPWLfzzrtr7bAhD95HkncA08Nq+1U/7HVfV1we9fpVq+yvg01X1VJL30hthvX7I165FffO2AzdX1bG+dat57IbR6fturMOgqi5uuYtDwHl9y+cCj9P7fzyel+SU5l9y8+s7qS3JN5KcXVWHmw+sJ5bY1duBW6rqJ337Ptw8fSrJXwC/v5zauqqvmYKhqh5JMgu8CvgcY3DskpwG/A3wX5oh8vy+Wx+7BRZ7Dw1qcyjJKcAv0xveD/PatobqI8nF9ML2tVX11Pz6RX7HXX2gHbe2qnqyb/HPgI/0vXbLgtfOdlTX0PX12Q78Xv+KVT52w1is/hUdu0mfJroHuCC9q1/W0/uF7q3eWZa76M3VA+wAhhlpDGtvs89h9v20ecjmQ3B+fv5yYODVBKtZX5IN81MsSc4EXg08OA7Hrvld3kJvvvSzC7Z1fewGvoeWqPkK4IvNcdoLbE/vaqPzgQuA/9uynmXXl+RVwJ8Cl1XVE33rB/6O17i2s/sWLwMeap7fDryhqXED8AZ+cfS8JvU1Nb6U3onYub51q33shrEXeHdzVdFFwHebfwyt7Nit5tnw1fwB3kIvAZ8CvgHc3qx/IXBbX7s3A1+jl9hX961/Mb2/mAeBzwKndljbGcA+4EDzeHqzfhr4RF+7TcA/Ac9Y8PovAvfR+yD7n8BzOj52x60P+I2mhr9rHq8al2MHvBP4CfCVvp9XrtaxG/Qeojf1dFnz/FnNcTjYHJcX97326uZ1DwNvWqW/C8er787m78j8sdp7vN/xGta2G3igqeEu4F/2vfY/NMf0IPDvR3HsmuX/Cly74HVrcew+Te9KuZ/Q+6y7Cngv8N5me4CPN7XfR99VlSs5dt6BLEma+GkiSdIQDANJkmEgSTIMJEkYBpIkDANJEoaBJAnDQJIE/D81wR24Co+eVgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure()\n",
"plt.plot(x_vals, t, '.b', x_vals[:2], t[:2], '.r', x_vals[:1], t[:1], 'xm')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Set up the posterior"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
"v_m0 = np.array([0., 0.])\n",
"m_S0 = 1/alpha*np.identity(2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
},
"varInspector": {
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"delete_cmd_postfix": "",
"delete_cmd_prefix": "del ",
"library": "var_list.py",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"delete_cmd_postfix": ") ",
"delete_cmd_prefix": "rm(",
"library": "var_list.r",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
],
"window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}
| 49.287823 | 7,800 | 0.768661 | 883 | 13,357 | 11.518686 | 0.545866 | 0.013371 | 0.011798 | 0.020647 | 0.080425 | 0.025956 | 0.013765 | 0.010029 | 0.010029 | 0 | 0 | 0.131228 | 0.113424 | 13,357 | 270 | 7,801 | 49.47037 | 0.727664 | 0 | 0 | 0.322222 | 0 | 0.033333 | 0.823388 | 0.600285 | 0 | 1 | 0.002471 | 0 | 0 | 1 | 0 | true | 0 | 0.018519 | 0 | 0.018519 | 0.007407 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
ce342975856dda86b59e3befd5d0f654cd43eb08 | 269 | py | Python | core/backend/repository/admin.py | Djacket/djacket | 8f5258ae34ab2fb2849324145681e6d4932a22ba | [
"MIT"
] | 85 | 2016-02-19T06:46:29.000Z | 2022-03-25T20:20:47.000Z | core/backend/repository/admin.py | Djacket/djacket | 8f5258ae34ab2fb2849324145681e6d4932a22ba | [
"MIT"
] | 15 | 2016-04-08T02:46:11.000Z | 2022-01-29T08:20:45.000Z | core/backend/repository/admin.py | Djacket/djacket | 8f5258ae34ab2fb2849324145681e6d4932a22ba | [
"MIT"
] | 20 | 2016-04-08T02:39:08.000Z | 2021-12-16T14:05:28.000Z | from django.contrib import admin
from repository.models import Repository, RepositoryAccess, RepositoryStar, RepositoryFork
admin.site.register(Repository)
admin.site.register(RepositoryStar)
admin.site.register(RepositoryFork)
admin.site.register(RepositoryAccess)
| 26.9 | 90 | 0.855019 | 29 | 269 | 7.931034 | 0.413793 | 0.156522 | 0.295652 | 0.269565 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066915 | 269 | 9 | 91 | 29.888889 | 0.916335 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
cbf8a4ee8a1e211fe86e2c029a8d04798eeeefe8 | 3,689 | py | Python | packages/pytea/pylib/torch/nn/modules/conv.py | Sehun0819/pytea | 3f068016a71a1915722e51d977fedab01427a42c | [
"MIT"
] | 241 | 2021-03-19T01:11:44.000Z | 2022-03-25T03:15:22.000Z | packages/pytea/pylib/torch/nn/modules/conv.py | Sehun0819/pytea | 3f068016a71a1915722e51d977fedab01427a42c | [
"MIT"
] | 2 | 2021-02-26T08:16:04.000Z | 2022-02-28T02:52:58.000Z | packages/pytea/pylib/torch/nn/modules/conv.py | Sehun0819/pytea | 3f068016a71a1915722e51d977fedab01427a42c | [
"MIT"
] | 14 | 2021-01-08T02:22:58.000Z | 2022-01-19T14:13:14.000Z | import LibCall
from .module import Module
from .... import torch
from .. import functional as F
class Conv2d(Module):
def __init__(
self,
in_channels,
out_channels,
kernel_size,
stride=1,
padding=0,
dilation=1,
groups=1,
bias=True,
padding_mode="zeros",
):
super(Conv2d, self).__init__()
if isinstance(kernel_size, int):
kernel_size = (kernel_size, kernel_size)
if isinstance(stride, int):
stride = (stride, stride)
if isinstance(padding, int):
padding = (padding, padding)
if isinstance(dilation, int):
dilation = (dilation, dilation)
assert LibCall.guard.require_eq(
in_channels % groups,
0,
"from Conv2d: in_channels must be divisible by groups",
)
assert LibCall.guard.require_eq(
out_channels % groups,
0,
"from Conv2d: out_channels must be divisible by groups",
)
self.weight = torch.rand(
out_channels, in_channels // groups, kernel_size[0], kernel_size[1]
)
self.in_channels = in_channels
self.out_channels = out_channels
self.kernel_size = kernel_size
self.stride = stride
self.padding = padding
self.dilation = dilation
self.groups = groups
if bias:
self.bias = torch.rand(out_channels)
else:
self.bias = None
def forward(self, input):
return F.conv2d(
input,
self.weight,
self.bias,
self.stride,
self.padding,
self.dilation,
self.groups,
)
class ConvTranspose2d(Module):
def __init__(
self,
in_channels,
out_channels,
kernel_size,
stride=1,
padding=0,
output_padding=0,
groups=1,
bias=True,
dilation=1,
padding_mode="zeros",
):
super(ConvTranspose2d, self).__init__()
if isinstance(kernel_size, int):
kernel_size = (kernel_size, kernel_size)
if isinstance(stride, int):
stride = (stride, stride)
if isinstance(padding, int):
padding = (padding, padding)
if isinstance(dilation, int):
dilation = (dilation, dilation)
if isinstance(output_padding, int):
output_padding = (output_padding, output_padding)
assert LibCall.guard.require_eq(
in_channels % groups,
0,
"from ConvTranspose2d: in_channels must be divisible by groups",
)
assert LibCall.guard.require_eq(
out_channels % groups,
0,
"from ConvTranspose2d: out_channels must be divisible by groups",
)
self.weight = torch.rand(
in_channels, out_channels // groups, kernel_size[0], kernel_size[1]
)
self.in_channels = in_channels
self.out_channels = out_channels
self.kernel_size = kernel_size
self.stride = stride
self.padding = padding
self.output_padding = output_padding
self.dilation = dilation
self.groups = groups
if bias:
self.bias = torch.rand(out_channels)
else:
self.bias = None
def forward(self, input):
return F.conv_transpose2d(
input,
self.weight,
self.bias,
self.stride,
self.padding,
self.output_padding,
self.groups,
self.dilation,
)
| 27.736842 | 79 | 0.549471 | 379 | 3,689 | 5.150396 | 0.134565 | 0.092213 | 0.04918 | 0.061475 | 0.787398 | 0.765881 | 0.765881 | 0.765881 | 0.765881 | 0.765881 | 0 | 0.011588 | 0.368393 | 3,689 | 132 | 80 | 27.94697 | 0.82618 | 0 | 0 | 0.760331 | 0 | 0 | 0.064534 | 0 | 0 | 0 | 0 | 0 | 0.033058 | 1 | 0.033058 | false | 0 | 0.033058 | 0.016529 | 0.099174 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
cbfbd65aa552f71d915251e80481947591b528be | 2,332 | py | Python | tests/unit_tests/test_nn/test_converters/test_tensorflow/test_Unsqueeze.py | samysweb/dnnv | 58fb95b7300914d9da28eed86c39eca473b1aaef | [
"MIT"
] | 5 | 2022-01-28T20:30:34.000Z | 2022-03-17T09:26:52.000Z | tests/unit_tests/test_nn/test_converters/test_tensorflow/test_Unsqueeze.py | samysweb/dnnv | 58fb95b7300914d9da28eed86c39eca473b1aaef | [
"MIT"
] | 9 | 2022-01-27T03:50:28.000Z | 2022-02-08T18:42:17.000Z | tests/unit_tests/test_nn/test_converters/test_tensorflow/test_Unsqueeze.py | samysweb/dnnv | 58fb95b7300914d9da28eed86c39eca473b1aaef | [
"MIT"
] | 2 | 2022-02-03T17:32:43.000Z | 2022-03-24T16:38:49.000Z | import numpy as np
import pytest
from dnnv.nn.converters.tensorflow import *
from dnnv.nn.operations import *
def test_Unsqueeze():
x = np.random.randn(1, 3, 1, 5).astype(np.float32)
axes = np.array([0]).astype(np.int64)
y = np.expand_dims(x, axis=0)
op = Unsqueeze(x, axes)
tf_op = TensorflowConverter().visit(op)
result = tf_op().numpy()
assert np.allclose(result, y)
op = Unsqueeze(Input(x.shape, x.dtype), Input(axes.shape, axes.dtype))
tf_op = TensorflowConverter().visit(op)
result = tf_op(x, axes).numpy()
assert np.allclose(result, y)
def test_Unsqueeze_negative_axes():
x = np.random.randn(1, 3, 1, 5).astype(np.float32)
axes = np.array([-2]).astype(np.int64)
y = np.expand_dims(x, axis=-2)
op = Unsqueeze(x, axes)
tf_op = TensorflowConverter().visit(op)
result = tf_op().numpy()
assert np.allclose(result, y)
def test_Unsqueeze_one_axis():
x = np.random.randn(3, 4, 5).astype(np.float32)
for i in range(x.ndim):
axes = np.array([i]).astype(np.int64)
y = np.expand_dims(x, axis=i)
op = Unsqueeze(x, axes)
tf_op = TensorflowConverter().visit(op)
result = tf_op().numpy()
assert np.allclose(result, y)
def test_Unsqueeze_three_axes():
x = np.random.randn(3, 4, 5).astype(np.float32)
axes = np.array([2, 4, 5]).astype(np.int64)
y = np.expand_dims(x, axis=2)
y = np.expand_dims(y, axis=4)
y = np.expand_dims(y, axis=5)
op = Unsqueeze(x, axes)
tf_op = TensorflowConverter().visit(op)
result = tf_op().numpy()
assert np.allclose(result, y)
def test_Unsqueeze_two_axes():
x = np.random.randn(3, 4, 5).astype(np.float32)
axes = np.array([1, 4]).astype(np.int64)
y = np.expand_dims(x, axis=1)
y = np.expand_dims(y, axis=4)
op = Unsqueeze(x, axes)
tf_op = TensorflowConverter().visit(op)
result = tf_op().numpy()
assert np.allclose(result, y)
def test_Unsqueeze_unsorted_axes():
x = np.random.randn(3, 4, 5).astype(np.float32)
axes = np.array([5, 4, 2]).astype(np.int64)
y = np.expand_dims(x, axis=2)
y = np.expand_dims(y, axis=4)
y = np.expand_dims(y, axis=5)
op = Unsqueeze(x, axes)
tf_op = TensorflowConverter().visit(op)
result = tf_op().numpy()
assert np.allclose(result, y)
| 27.761905 | 74 | 0.632504 | 373 | 2,332 | 3.844504 | 0.13941 | 0.039052 | 0.069038 | 0.099721 | 0.839609 | 0.83682 | 0.83682 | 0.82357 | 0.794979 | 0.699442 | 0 | 0.034483 | 0.204117 | 2,332 | 83 | 75 | 28.096386 | 0.738147 | 0 | 0 | 0.629032 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.112903 | 1 | 0.096774 | false | 0 | 0.064516 | 0 | 0.16129 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
0203ea62cf8e5bf20251daf8ab024d6a6b132a8e | 35 | py | Python | app/libs/sso.py | anjali-92/tuesday | e85366ee4d88e3821d6a3177881dfbf050dd7c34 | [
"MIT"
] | 6 | 2019-04-04T06:10:56.000Z | 2020-06-09T22:30:08.000Z | app/libs/sso.py | anjali-92/tuesday | e85366ee4d88e3821d6a3177881dfbf050dd7c34 | [
"MIT"
] | 2 | 2019-04-05T04:38:45.000Z | 2019-08-16T11:17:43.000Z | app/libs/sso.py | anjali-92/tuesday | e85366ee4d88e3821d6a3177881dfbf050dd7c34 | [
"MIT"
] | 4 | 2019-08-26T06:27:03.000Z | 2020-10-07T11:55:39.000Z | from app.libs.sso_default import *
| 17.5 | 34 | 0.8 | 6 | 35 | 4.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.114286 | 35 | 1 | 35 | 35 | 0.870968 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
02863ec8441436f1e2ee00cc4d1061f06bb28860 | 46 | py | Python | setup.py | renatojobal/gpt-3-examples | 6d52e596ca92483daaa0c54f5617257c3764331c | [
"MIT"
] | 1 | 2021-05-15T23:49:32.000Z | 2021-05-15T23:49:32.000Z | setup.py | renatojobal/gpt-3-examples | 6d52e596ca92483daaa0c54f5617257c3764331c | [
"MIT"
] | null | null | null | setup.py | renatojobal/gpt-3-examples | 6d52e596ca92483daaa0c54f5617257c3764331c | [
"MIT"
] | null | null | null |
from dotenv import load_dotenv
load_dotenv() | 11.5 | 30 | 0.826087 | 7 | 46 | 5.142857 | 0.571429 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 46 | 4 | 31 | 11.5 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
5a43b948a87aeb08f71af3d9d04dd3111957e71b | 153 | py | Python | squids/__init__.py | mmgalushka/squids | 2d6e1bbeb89721a2ff232a7031997111c600abb6 | [
"MIT"
] | null | null | null | squids/__init__.py | mmgalushka/squids | 2d6e1bbeb89721a2ff232a7031997111c600abb6 | [
"MIT"
] | 37 | 2022-01-15T21:42:23.000Z | 2022-02-23T23:43:31.000Z | squids/__init__.py | mmgalushka/squids | 2d6e1bbeb89721a2ff232a7031997111c600abb6 | [
"MIT"
] | null | null | null | """A module for handling synthetic and real datasets."""
from .dataset import * # noqa
from .tfrecords import * # noqa
from .actions import * # noqa
| 25.5 | 56 | 0.699346 | 20 | 153 | 5.35 | 0.7 | 0.280374 | 0.261682 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.196078 | 153 | 5 | 57 | 30.6 | 0.869919 | 0.431373 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
5a5fbded847b725d3931e93b88283a20055e2a4a | 43 | py | Python | foliant/preprocessors/confluence_final/__init__.py | foliant-docs/foliantcontrib.confluence_upload | ca85cc5a7cac34fee8c10648074b78f777bc7529 | [
"MIT"
] | 2 | 2020-07-01T11:18:12.000Z | 2020-08-26T11:30:18.000Z | foliant/preprocessors/confluence_final/__init__.py | foliant-docs/foliantcontrib.confluence_upload | ca85cc5a7cac34fee8c10648074b78f777bc7529 | [
"MIT"
] | null | null | null | foliant/preprocessors/confluence_final/__init__.py | foliant-docs/foliantcontrib.confluence_upload | ca85cc5a7cac34fee8c10648074b78f777bc7529 | [
"MIT"
] | null | null | null | from .confluence_final import Preprocessor
| 21.5 | 42 | 0.883721 | 5 | 43 | 7.4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.093023 | 43 | 1 | 43 | 43 | 0.948718 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
ce4b1f7995b9d4f285b0790514678849cecbd254 | 93 | py | Python | Code/3.Modules-Package/MyMainPackage/__init__.py | davidMartinVergues/PYTHON | dd39d3aabfc43b3cb09aadb2919e51d03364117d | [
"DOC"
] | null | null | null | Code/3.Modules-Package/MyMainPackage/__init__.py | davidMartinVergues/PYTHON | dd39d3aabfc43b3cb09aadb2919e51d03364117d | [
"DOC"
] | null | null | null | Code/3.Modules-Package/MyMainPackage/__init__.py | davidMartinVergues/PYTHON | dd39d3aabfc43b3cb09aadb2919e51d03364117d | [
"DOC"
] | null | null | null | from .some_main_script import report_main
from .SubPackage.my_sub_script import sub_report
| 18.6 | 48 | 0.860215 | 15 | 93 | 4.933333 | 0.6 | 0.324324 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107527 | 93 | 4 | 49 | 23.25 | 0.891566 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
ce4b94e35f2eba3af890dc3b06a94b878d3b0b6f | 48 | py | Python | prov2bigchaindb/version.py | DLR-SC/prov2bigchaindb | a21c78a80e502409281aa25999756f2b695d8301 | [
"Apache-2.0"
] | 6 | 2017-04-06T07:34:20.000Z | 2020-12-31T07:56:29.000Z | prov2bigchaindb/version.py | DLR-SC/prov2bigchaindb | a21c78a80e502409281aa25999756f2b695d8301 | [
"Apache-2.0"
] | 25 | 2017-04-07T12:45:11.000Z | 2018-11-08T11:21:04.000Z | prov2bigchaindb/version.py | DLR-SC/prov2bigchaindb | a21c78a80e502409281aa25999756f2b695d8301 | [
"Apache-2.0"
] | null | null | null | __version__ = '0.4.1'
__short_version__ = '0.4'
| 16 | 25 | 0.6875 | 8 | 48 | 3 | 0.625 | 0.666667 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119048 | 0.125 | 48 | 2 | 26 | 24 | 0.452381 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
ce57423637da1930ade0693e836ca7e375b39a64 | 404 | py | Python | RecoBTag/ONNXRuntime/python/pfDeepDoubleX_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoBTag/ONNXRuntime/python/pfDeepDoubleX_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoBTag/ONNXRuntime/python/pfDeepDoubleX_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | from RecoBTag.ONNXRuntime.pfDeepDoubleBvLJetTags_cfi import pfDeepDoubleBvLJetTags
from RecoBTag.ONNXRuntime.pfDeepDoubleCvBJetTags_cfi import pfDeepDoubleCvBJetTags
from RecoBTag.ONNXRuntime.pfDeepDoubleCvLJetTags_cfi import pfDeepDoubleCvLJetTags
from RecoBTag.ONNXRuntime.pfMassIndependentDeepDoubleXJetTags_cff import *
from RecoBTag.ONNXRuntime.pfMassIndependentDeepDoubleXV2JetTags_cff import *
| 44.888889 | 82 | 0.913366 | 33 | 404 | 11.030303 | 0.333333 | 0.164835 | 0.315934 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002625 | 0.056931 | 404 | 8 | 83 | 50.5 | 0.952756 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
ce7f4c16275b34e44abb44bef2bfa929fa9424a3 | 44 | py | Python | dbmodel/models.py | imokyou/admin_backend | d2415fb57277cde1dab34a317fc77f6d7405088f | [
"MIT"
] | null | null | null | dbmodel/models.py | imokyou/admin_backend | d2415fb57277cde1dab34a317fc77f6d7405088f | [
"MIT"
] | null | null | null | dbmodel/models.py | imokyou/admin_backend | d2415fb57277cde1dab34a317fc77f6d7405088f | [
"MIT"
] | null | null | null | # coding=utf8
from django.db import models
| 11 | 28 | 0.772727 | 7 | 44 | 4.857143 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027027 | 0.159091 | 44 | 3 | 29 | 14.666667 | 0.891892 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
cedcb4d27356d847a520fd3df2142814ef65d1f0 | 514 | py | Python | resources/dot_PyCharm/system/python_stubs/cache/18942e98caa5521a326bbb69822241dc2eb380cea397ddff92f804a083499354/win32lz.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | 1 | 2020-04-20T02:27:20.000Z | 2020-04-20T02:27:20.000Z | resources/dot_PyCharm/system/python_stubs/cache/18942e98caa5521a326bbb69822241dc2eb380cea397ddff92f804a083499354/win32lz.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | null | null | null | resources/dot_PyCharm/system/python_stubs/cache/18942e98caa5521a326bbb69822241dc2eb380cea397ddff92f804a083499354/win32lz.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | null | null | null | # encoding: utf-8
# module win32lz
# from C:\Python27\lib\site-packages\win32\win32lz.pyd
# by generator 1.147
# no doc
# imports
from pywintypes import error
# functions
def Close(*args, **kwargs): # real signature unknown
pass
def Copy(*args, **kwargs): # real signature unknown
pass
def GetExpandedName(*args, **kwargs): # real signature unknown
pass
def Init(*args, **kwargs): # real signature unknown
pass
def OpenFile(*args, **kwargs): # real signature unknown
pass
# no classes
| 17.724138 | 62 | 0.698444 | 68 | 514 | 5.279412 | 0.544118 | 0.139276 | 0.194986 | 0.320334 | 0.506964 | 0.506964 | 0.412256 | 0 | 0 | 0 | 0 | 0.0311 | 0.18677 | 514 | 28 | 63 | 18.357143 | 0.827751 | 0.492218 | 0 | 0.454545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.454545 | true | 0.454545 | 0.090909 | 0 | 0.545455 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 6 |
0cd04634bf518ec1b24a380d8d9c03f54d22f0eb | 163 | py | Python | ermaket/utils/xml/__init__.py | SqrtMinusOne/ERMaket_Experiment | c4a7b61651edd15a619d9b690e2aaeaab4de282d | [
"Apache-2.0"
] | null | null | null | ermaket/utils/xml/__init__.py | SqrtMinusOne/ERMaket_Experiment | c4a7b61651edd15a619d9b690e2aaeaab4de282d | [
"Apache-2.0"
] | null | null | null | ermaket/utils/xml/__init__.py | SqrtMinusOne/ERMaket_Experiment | c4a7b61651edd15a619d9b690e2aaeaab4de282d | [
"Apache-2.0"
] | null | null | null | from .xmlroot import *
from .xml_object import *
from .xmlall import *
from .xmlenum import *
from .xmllist import *
from .xmltag import *
from .xmltuple import *
| 20.375 | 25 | 0.742331 | 22 | 163 | 5.454545 | 0.454545 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171779 | 163 | 7 | 26 | 23.285714 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
0cf8ca2b7538c3ed1d0b575f2ff9fa4ffd128784 | 190 | py | Python | urbinsight/app/admin.py | calocan/urbinsight-server | f500a30f2bda466cfa5cf5f04effeaacca03a71a | [
"MIT"
] | null | null | null | urbinsight/app/admin.py | calocan/urbinsight-server | f500a30f2bda466cfa5cf5f04effeaacca03a71a | [
"MIT"
] | 3 | 2020-06-05T18:18:39.000Z | 2021-06-10T20:20:58.000Z | urbinsight/app/admin.py | calocan/urbinsight-server | f500a30f2bda466cfa5cf5f04effeaacca03a71a | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from django.contrib.gis import admin
from rescape_region.models import Region
admin.site.register(Region, admin.GeoModelAdmin) | 27.142857 | 48 | 0.831579 | 27 | 190 | 5.814815 | 0.518519 | 0.127389 | 0.216561 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 190 | 7 | 48 | 27.142857 | 0.923529 | 0.136842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.75 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
0b424565ca42c8391b54d773f986e4963f2ee328 | 151 | py | Python | tests/test_factory.py | mrchi/flask-tutorial | caeacec5738d28ab67762095df0ceafea4139726 | [
"MIT"
] | 5 | 2019-05-01T15:00:21.000Z | 2019-05-05T02:15:03.000Z | tests/test_factory.py | chiqj/flask-tutorial | caeacec5738d28ab67762095df0ceafea4139726 | [
"MIT"
] | 2 | 2021-08-25T07:18:45.000Z | 2021-08-25T07:19:01.000Z | tests/test_factory.py | mrchi/flask-tutorial | caeacec5738d28ab67762095df0ceafea4139726 | [
"MIT"
] | null | null | null | # coding=utf-8
from flask import current_app
def test_app_config(app):
assert current_app.testing is True
assert current_app.debug is False
| 16.777778 | 38 | 0.768212 | 25 | 151 | 4.44 | 0.68 | 0.27027 | 0.288288 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008065 | 0.178808 | 151 | 8 | 39 | 18.875 | 0.887097 | 0.07947 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
0b674b9cefe7c98c66b17b35c3d8a861c30aacaf | 10,832 | py | Python | tests/djangoapp/test_webhook.py | Thermondo/closeio | 724f0dcf5c91d2b4abf7fd4c558ed1c9a24e1790 | [
"Apache-2.0"
] | 3 | 2015-02-10T17:37:02.000Z | 2019-05-10T08:22:51.000Z | tests/djangoapp/test_webhook.py | Thermondo/closeio | 724f0dcf5c91d2b4abf7fd4c558ed1c9a24e1790 | [
"Apache-2.0"
] | 65 | 2015-02-10T16:56:07.000Z | 2020-02-24T10:30:56.000Z | tests/djangoapp/test_webhook.py | Thermondo/closeio | 724f0dcf5c91d2b4abf7fd4c558ed1c9a24e1790 | [
"Apache-2.0"
] | 2 | 2018-10-23T18:44:14.000Z | 2020-02-24T18:08:05.000Z | import json
from datetime import date
from functools import partial
import pytest
from django.test.client import Client
from django.urls import reverse
from closeio.contrib.django import signals, views
@pytest.fixture
def csrf_client(client):
return Client(enforce_csrf_checks=True)
@pytest.fixture
def closeio_signals():
data = []
def log(signal_name, *args, **kwargs):
data.append((
signal_name,
args,
kwargs
))
signals.closeio_event.connect(
partial(log, "closeio_event"),
weak=False)
signals.closeio_create.connect(
partial(log, "closeio_create"),
weak=False)
signals.closeio_update.connect(
partial(log, "closeio_update"),
weak=False)
signals.closeio_delete.connect(
partial(log, "closeio_delete"),
weak=False)
signals.closeio_merge.connect(
partial(log, "closeio_merge"),
weak=False)
signals.lead_create.connect(
partial(log, "lead_create"),
weak=False)
signals.lead_update.connect(
partial(log, "lead_update"),
weak=False)
signals.lead_delete.connect(
partial(log, "lead_delete"),
weak=False)
signals.lead_merge.connect(
partial(log, "lead_merge"),
weak=False)
return data
def test_no_data(csrf_client):
url = reverse('closeio_webhook')
response = csrf_client.post(url)
assert response.status_code == 400
def test_invalid_json(csrf_client):
url = reverse('closeio_webhook')
response = csrf_client.post(
url,
data="asdf",
content_type="application/json")
assert response.status_code == 400
def test_formencode(csrf_client):
url = reverse('closeio_webhook')
response = csrf_client.post(
url,
data=dict(
event=1,
model=2,
data={}
))
assert response.status_code == 400
def test_wrong_json(csrf_client):
url = reverse('closeio_webhook')
response = csrf_client.post(
url,
data=json.dumps(dict()),
content_type="application/json")
assert response.status_code == 400
def test_ok_unknown(csrf_client, closeio_signals):
url = reverse('closeio_webhook')
response = csrf_client.post(
url,
data=json.dumps(dict(
event='testevent',
model='testmodel',
data=dict(data=1),
)),
content_type="application/json")
assert response.status_code == 200
assert closeio_signals == [
('closeio_event', (), {
'event': 'testevent',
'instance': dict(data=1),
'model': 'testmodel',
'signal': signals.closeio_event,
'sender': views.CloseIOWebHook,
}),
]
def test_ok_create(csrf_client, closeio_signals):
url = reverse('closeio_webhook')
response = csrf_client.post(
url,
data=json.dumps(dict(
event='create',
model='testmodel',
data=dict(data=1),
)),
content_type="application/json")
assert response.status_code == 200
assert closeio_signals == [
('closeio_create', (), {
'instance': dict(data=1),
'model': 'testmodel',
'signal': signals.closeio_create,
'sender': views.CloseIOWebHook,
}),
('closeio_event', (), {
'event': 'create',
'instance': dict(data=1),
'model': 'testmodel',
'signal': signals.closeio_event,
'sender': views.CloseIOWebHook,
}),
]
def test_ok_lead_create(csrf_client, closeio_signals):
url = reverse('closeio_webhook')
response = csrf_client.post(
url,
data=json.dumps(dict(
event='create',
model='lead',
data=dict(
data=1,
date_='2014-01-01',
),
)),
content_type="application/json")
assert response.status_code == 200
assert closeio_signals == [
('closeio_create', (), {
'instance': dict(
data=1,
date_=date(2014, 1, 1),
),
'model': 'lead',
'signal': signals.closeio_create,
'sender': views.CloseIOWebHook,
}),
('lead_create', (), {
'instance': dict(
data=1,
date_=date(2014, 1, 1),
),
'signal': signals.lead_create,
'sender': views.CloseIOWebHook,
}),
('closeio_event', (), {
'event': 'create',
'instance': dict(
data=1,
date_=date(2014, 1, 1),
),
'model': 'lead',
'signal': signals.closeio_event,
'sender': views.CloseIOWebHook,
}),
]
def test_ok_update(csrf_client, closeio_signals):
url = reverse('closeio_webhook')
response = csrf_client.post(
url,
data=json.dumps(dict(
event='update',
model='testmodel',
data=dict(data=1),
)),
content_type="application/json")
assert response.status_code == 200
assert closeio_signals == [
('closeio_update', (), {
'instance': dict(data=1),
'model': 'testmodel',
'signal': signals.closeio_update,
'sender': views.CloseIOWebHook,
}),
('closeio_event', (), {
'event': 'update',
'instance': dict(data=1),
'model': 'testmodel',
'signal': signals.closeio_event,
'sender': views.CloseIOWebHook,
}),
]
def test_ok_lead_update(client, closeio_signals):
url = reverse('closeio_webhook')
response = client.post(url,
data=json.dumps(dict(
event='update',
model='lead',
data=dict(data=1),
)),
content_type="application/json")
assert response.status_code == 200
assert closeio_signals == [
('closeio_update', (), {
'instance': dict(data=1),
'model': 'lead',
'signal': signals.closeio_update,
'sender': views.CloseIOWebHook,
}),
('lead_update', (), {
'instance': dict(data=1),
'signal': signals.lead_update,
'sender': views.CloseIOWebHook,
}),
('closeio_event', (), {
'event': 'update',
'instance': dict(data=1),
'model': 'lead',
'signal': signals.closeio_event,
'sender': views.CloseIOWebHook,
}),
]
def test_ok_delete(csrf_client, closeio_signals):
url = reverse('closeio_webhook')
response = csrf_client.post(
url,
data=json.dumps(dict(
event='delete',
model='testmodel',
data=dict(id=321),
)),
content_type="application/json")
assert response.status_code == 200
assert closeio_signals == [
('closeio_delete', (), {
'instance_id': 321,
'model': 'testmodel',
'signal': signals.closeio_delete,
'sender': views.CloseIOWebHook,
}),
('closeio_event', (), {
'event': 'delete',
'instance': dict(id=321),
'model': 'testmodel',
'signal': signals.closeio_event,
'sender': views.CloseIOWebHook,
}),
]
def test_ok_lead_delete(client, closeio_signals):
url = reverse('closeio_webhook')
response = client.post(url,
data=json.dumps(dict(
event='delete',
model='lead',
data=dict(id=321),
)),
content_type="application/json")
assert response.status_code == 200
assert closeio_signals == [
('closeio_delete', (), {
'instance_id': 321,
'model': 'lead',
'signal': signals.closeio_delete,
'sender': views.CloseIOWebHook,
}),
('lead_delete', (), {
'instance_id': 321,
'signal': signals.lead_delete,
'sender': views.CloseIOWebHook,
}),
('closeio_event', (), {
'event': 'delete',
'instance': dict(id=321),
'model': 'lead',
'signal': signals.closeio_event,
'sender': views.CloseIOWebHook,
}),
]
def test_ok_merge(csrf_client, closeio_signals):
url = reverse('closeio_webhook')
response = csrf_client.post(
url,
data=json.dumps(dict(
event='merge',
model='testmodel',
data=dict(source_id=321, destination_id=123),
)),
content_type="application/json")
assert response.status_code == 200
assert closeio_signals == [
('closeio_merge', (), {
'source_id': 321,
'destination_id': 123,
'model': 'testmodel',
'signal': signals.closeio_merge,
'sender': views.CloseIOWebHook,
}),
('closeio_event', (), {
'event': 'merge',
'instance': dict(source_id=321, destination_id=123),
'model': 'testmodel',
'signal': signals.closeio_event,
'sender': views.CloseIOWebHook,
}),
]
def test_ok_lead_merge(client, closeio_signals):
url = reverse('closeio_webhook')
response = client.post(url,
data=json.dumps(dict(
event='merge',
model='lead',
data=dict(source_id=321, destination_id=123),
)),
content_type="application/json")
assert response.status_code == 200
assert closeio_signals == [
('closeio_merge', (), {
'source_id': 321,
'destination_id': 123,
'model': 'lead',
'signal': signals.closeio_merge,
'sender': views.CloseIOWebHook,
}),
('lead_merge', (), {
'source_id': 321,
'destination_id': 123,
'signal': signals.lead_merge,
'sender': views.CloseIOWebHook,
}),
('closeio_event', (), {
'event': 'merge',
'instance': dict(source_id=321, destination_id=123),
'model': 'lead',
'signal': signals.closeio_event,
'sender': views.CloseIOWebHook,
}),
]
| 26.291262 | 76 | 0.513663 | 982 | 10,832 | 5.471487 | 0.077393 | 0.080774 | 0.097711 | 0.058068 | 0.793784 | 0.789503 | 0.785595 | 0.734227 | 0.734227 | 0.728643 | 0 | 0.020944 | 0.356444 | 10,832 | 411 | 77 | 26.355231 | 0.749821 | 0 | 0 | 0.779104 | 0 | 0 | 0.152696 | 0 | 0 | 0 | 0 | 0 | 0.065672 | 1 | 0.047761 | false | 0 | 0.020896 | 0.002985 | 0.074627 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
0b6fd159e17f3170013b4e533fba559dc7309761 | 17,966 | py | Python | chits/tests.py | dushyant19/MUN-with-sqlite | 94c9518f511e13fe7150908f75c28c12e8df5903 | [
"bzip2-1.0.6"
] | null | null | null | chits/tests.py | dushyant19/MUN-with-sqlite | 94c9518f511e13fe7150908f75c28c12e8df5903 | [
"bzip2-1.0.6"
] | null | null | null | chits/tests.py | dushyant19/MUN-with-sqlite | 94c9518f511e13fe7150908f75c28c12e8df5903 | [
"bzip2-1.0.6"
] | 2 | 2020-07-21T19:32:31.000Z | 2020-09-25T13:48:15.000Z | from django.test import TestCase,client
from accounts.models import *
from django.contrib.auth import authenticate,login
from chits.models import *
import random
import json
from django.urls import reverse
# Create your tests here.
def create_chit(status,chit_from,chit_to,reply_to_chit,chit) :
return Chit.objects.create(chit_from = chit_from , chit = chit ,chit_to=chit_to ,reply_to_chit=reply_to_chit,status = status)
def create_deligates_teams_countries() :
for i in range(75) :
Country.objects.create(name="Country_{}".format(i+1),country_id="country_{}@iitgmun".format(i+1))
for i in range(15) :
team = Team.objects.create(name="Team_{}".format(i+1),info="Dummy data")
for j in range(5) :
user = User.objects.create(username="Country{}_deligate".format(i*5+j+1),role="DT",email="Country{}_deligate@gmail.com".format(i*5+j+1))
profile = DeligateProfile.objects.create(user=user,country=Country.objects.get(name="Country_{}".format(i*5+j+1)),team=team,first_name="Who tf care!",last_name="Oh lol")
user.save()
profile.save()
if j==0 :
team.leader = user
team.save()
def create_judge_moderator() :
User.objects.create(username="moderator1",role="MD",email="moderator1@gmail.com")
User.objects.create(username="moderator2",role="MD",email="moderator2@gmail.com")
User.objects.create(username="judge",role="JD",email="judge@gmail.com")
class ChitsViewTestClass(TestCase) :
@classmethod
def setUpTestData(cls) :
create_deligates_teams_countries()
create_judge_moderator()
cls.user = User.objects.get(username="Country{}_deligate".format(random.randint(1,75)))
cls.user.set_password("TestUser")
cls.user.save()
cls.moderator1 = User.objects.get(username="moderator1",role="MD")
cls.moderator2 = User.objects.get(username="moderator2",role="MD")
cls.judge = User.objects.get(username="judge",role="JD")
cls.moderator1.set_password("TestUser")
cls.moderator1.save()
cls.moderator2.set_password("TestUser")
cls.moderator2.save()
cls.judge.set_password("TestUser")
cls.judge.save()
def setUp(self) :
team1 = Team.objects.get(pk=random.randint(1,3))
team2 = Team.objects.get(pk=random.randint(4,6))
team3 = Team.objects.get(pk=random.randint(7,9))
team4 = Team.objects.get(pk=random.randint(10,12))
team5 = Team.objects.get(pk=random.randint(13,15))
def logout_user(self) :
self.client.logout()
def tearDown(self) :
self.logout_user()
def login_user(self,user) :
self.client.login(username=user.username,password ="TestUser")
def check_redirect(self,url) :
self.assertEqual(self.client.get(url).status_code,302)
'''
Checking the countries returned and login redirect
'''
def test_index_view_countries(self) :
#login
response = self.client.get(reverse('chits:deligate_index'))
self.check_redirect(reverse('chits:deligate_index'))
self.assertEqual(self.user.role,"DT")
response = self.client.post(reverse('accounts:login'),{
'username':self.user.username,
'password' :"TestUser"
})
self.assertEqual(response.status_code ,302)
self.assertEqual(response.url,reverse('chits:deligate_index'))
#after login
self.login_user(self.user)
response = self.client.get(reverse('chits:deligate_index'))
self.assertEqual(response.status_code,200)
self.assertQuerysetEqual(list(response.context["countries"]),[f'<Country: Country object ({c.id})>' for c in Country.objects.all()])
self.logout_user()
'''
deligate_post_view
'''
def test_deligate_post(self) :
#before login
#after login
self.login_user(self.user)
send_to = Country.objects.all().exclude(deligate__user__username=self.user.username)[random.randint(1,74)]
response = self.client.post(reverse('chits:deligate_index'),{
'chit_to':send_to.country_id,
'content' :"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised."
},content_type='application/json')
response_data = json.loads(response.content)
chit_created= Chit.objects.get(pk=response_data['id'])
self.assertEqual(response.status_code,200)
self.assertEqual(response_data['message'],"Chit sent to Moderator for checking")
self.assertEqual(chit_created.chit,"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised.")
self.assertEqual(chit_created.chit_from,self.user.deligate_profile.country)
self.assertEqual(chit_created.chit_to,send_to)
self.assertEqual(chit_created.reply_to_chit,None)
self.logout_user()
'''
deligate_reply_view
'''
def test_deligate_reply(self) :
self.test_deligate_post()
#after login
self.login_user(self.user)
chit_from = Country.objects.all().exclude(deligate__user__username=self.user.username)[random.randint(1,74)]
create_chit(status=3,chit_from =chit_from,chit_to=self.user.deligate_profile.country,reply_to_chit=None,
chit="By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised.")
send_to = Chit.objects.all().last()
# send_to = Country.objects.all().exclude(deligate__user__username=self.user.username)[random.randint(1,74)]
response = self.client.post(reverse('chits:deligate_reply'),{
'chit_to':send_to.chit_from.country_id,
'reply_to' : send_to.id ,
'content' :"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised."
},content_type='application/json')
response_data = json.loads(response.content)
chit_created= Chit.objects.get(pk=response_data['id'])
self.assertEqual(response.status_code,200)
self.assertEqual(response_data['message'],"Reply to chit {} sent to moderator".format(send_to.id))
self.assertEqual(chit_created.chit,"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised.")
self.assertEqual(chit_created.chit_from,self.user.deligate_profile.country)
self.assertEqual(chit_created.chit_to,send_to.chit_from)
self.assertEqual(chit_created.reply_to_chit,send_to)
self.logout_user()
def test_moderator_approve(self) :
#after login
self.login_user(self.user)
chit_from = Country.objects.all().exclude(deligate__user__username=self.user.username)[random.randint(1,74)]
create_chit(status=1,chit_from =chit_from,chit_to=self.user.deligate_profile.country,reply_to_chit=None,
chit="By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised.")
send_to = Chit.objects.all().last()
# send_to = Country.objects.all().exclude(deligate__user__username=self.user.username)[random.randint(1,74)]
response = self.client.post(reverse('chits:deligate_reply'),{
'chit_to':send_to.chit_from.country_id,
'reply_to' : send_to.id ,
'content' :"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised."
},content_type='application/json')
response_data = json.loads(response.content)
chit_created= Chit.objects.get(pk=response_data['id'])
self.assertEqual(response.status_code,200)
self.assertEqual(response_data['message'],"Reply to chit {} sent to moderator".format(send_to.id))
self.assertEqual(chit_created.chit,"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised.")
self.assertEqual(chit_created.chit_from,self.user.deligate_profile.country)
self.assertEqual(chit_created.chit_to,send_to.chit_from)
self.assertEqual(chit_created.reply_to_chit,send_to)
self.logout_user()
def test_moderator_reject(self) :
#after login
self.login_user(self.user)
chit_from = Country.objects.all().exclude(deligate__user__username=self.user.username)[random.randint(1,74)]
create_chit(status=3,chit_from =chit_from,chit_to=self.user.deligate_profile.country,reply_to_chit=None,
chit="By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised.")
send_to = Chit.objects.all().last()
# send_to = Country.objects.all().exclude(deligate__user__username=self.user.username)[random.randint(1,74)]
response = self.client.post(reverse('chits:deligate_reply'),{
'chit_to':send_to.chit_from.country_id,
'reply_to' : send_to.id ,
'content' :"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised."
},content_type='application/json')
response_data = json.loads(response.content)
chit_created= Chit.objects.get(pk=response_data['id'])
self.assertEqual(response.status_code,200)
self.assertEqual(response_data['message'],"Reply to chit {} sent to moderator".format(send_to.id))
self.assertEqual(chit_created.chit,"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised.")
self.assertEqual(chit_created.chit_from,self.user.deligate_profile.country)
self.assertEqual(chit_created.chit_to,send_to.chit_from)
self.assertEqual(chit_created.reply_to_chit,send_to)
self.logout_user()
def test_judge_ratify(self) :
#after login
self.login_user(self.user)
chit_from = Country.objects.all().exclude(deligate__user__username=self.user.username)[random.randint(1,74)]
create_chit(status=3,chit_from =chit_from,chit_to=self.user.deligate_profile.country,reply_to_chit=None,
chit="By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised.")
send_to = Chit.objects.all().last()
# send_to = Country.objects.all().exclude(deligate__user__username=self.user.username)[random.randint(1,74)]
response = self.client.post(reverse('chits:deligate_reply'),{
'chit_to':send_to.chit_from.country_id,
'reply_to' : send_to.id ,
'content' :"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised."
},content_type='application/json')
response_data = json.loads(response.content)
chit_created= Chit.objects.get(pk=response_data['id'])
self.assertEqual(response.status_code,200)
self.assertEqual(response_data['message'],"Reply to chit {} sent to moderator".format(send_to.id))
self.assertEqual(chit_created.chit,"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised.")
self.assertEqual(chit_created.chit_from,self.user.deligate_profile.country)
self.assertEqual(chit_created.chit_to,send_to.chit_from)
self.assertEqual(chit_created.reply_to_chit,send_to)
self.logout_user()
def test_judge_reject(self) :
#after login
self.login_user(self.user)
chit_from = Country.objects.all().exclude(deligate__user__username=self.user.username)[random.randint(1,74)]
create_chit(status=3,chit_from =chit_from,chit_to=self.user.deligate_profile.country,reply_to_chit=None,
chit="By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised.")
send_to = Chit.objects.all().last()
# send_to = Country.objects.all().exclude(deligate__user__username=self.user.username)[random.randint(1,74)]
response = self.client.post(reverse('chits:deligate_reply'),{
'chit_to':send_to.chit_from.country_id,
'reply_to' : send_to.id ,
'content' :"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised."
},content_type='application/json')
response_data = json.loads(response.content)
chit_created= Chit.objects.get(pk=response_data['id'])
self.assertEqual(response.status_code,200)
self.assertEqual(response_data['message'],"Reply to chit {} sent to moderator".format(send_to.id))
self.assertEqual(chit_created.chit,"By default, the comparison is also ordering dependent. If qs doesn’t provide an implicit ordering, you can set the ordered parameter to False, which turns the comparison into a collections.Counter comparison. If the order is undefined (if the given qs isn’t ordered and the comparison is against more than one ordered values), a ValueError is raised.")
self.assertEqual(chit_created.chit_from,self.user.deligate_profile.country)
self.assertEqual(chit_created.chit_to,send_to.chit_from)
self.assertEqual(chit_created.reply_to_chit,send_to)
self.logout_user()
def test_chit_received_by_modertor(self) :
pass
def test_chit_received_by_judge(self) :
pass
def test_chit_received_by_deligate(self) :
pass
| 42.372642 | 396 | 0.701659 | 2,497 | 17,966 | 4.911894 | 0.072087 | 0.054056 | 0.041582 | 0.050876 | 0.825764 | 0.812719 | 0.792254 | 0.776519 | 0.776519 | 0.768365 | 0 | 0.007959 | 0.202716 | 17,966 | 423 | 397 | 42.472813 | 0.848297 | 0.036291 | 0 | 0.574359 | 0 | 0.087179 | 0.408606 | 0.001633 | 0 | 0 | 0 | 0 | 0.215385 | 1 | 0.097436 | false | 0.046154 | 0.035897 | 0.005128 | 0.14359 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
e7fd4532dac3fd4f62bd307fc4bc5e1517daff8a | 130 | py | Python | tests/test_term.py | gkmngrgn/gork | 7b2bf2dc8e2404010fbe0908000fefb07d86af05 | [
"MIT"
] | 2 | 2019-11-24T14:34:29.000Z | 2020-11-05T19:56:50.000Z | tests/test_term.py | gkmngrgn/gork | 7b2bf2dc8e2404010fbe0908000fefb07d86af05 | [
"MIT"
] | null | null | null | tests/test_term.py | gkmngrgn/gork | 7b2bf2dc8e2404010fbe0908000fefb07d86af05 | [
"MIT"
] | 1 | 2021-04-01T12:41:27.000Z | 2021-04-01T12:41:27.000Z | import unittest
class GorkTermTest(unittest.TestCase):
def test_get_size(self):
# TODO: not ready yet.
pass
| 16.25 | 38 | 0.661538 | 16 | 130 | 5.25 | 0.9375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.261538 | 130 | 7 | 39 | 18.571429 | 0.875 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 0 | 1 | 0.25 | false | 0.25 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 6 |
f0079817815d3f240d69088cbd48d429f648c0a7 | 2,068 | py | Python | synthetic_data_experiments/PacGAN/pacgan/streams.py | RyanHonwad/Two-Samples-in-GANs | 190853e56d6e7843c0d991dc64658cfb3311135e | [
"MIT"
] | 79 | 2018-02-18T22:37:29.000Z | 2022-03-28T08:32:56.000Z | synthetic_data_experiments/PacGAN/pacgan/streams.py | RyanHonwad/Two-Samples-in-GANs | 190853e56d6e7843c0d991dc64658cfb3311135e | [
"MIT"
] | 1 | 2019-11-24T03:06:32.000Z | 2019-11-24T18:08:09.000Z | synthetic_data_experiments/PacGAN/pacgan/streams.py | RyanHonwad/Two-Samples-in-GANs | 190853e56d6e7843c0d991dc64658cfb3311135e | [
"MIT"
] | 7 | 2018-04-30T18:06:28.000Z | 2020-11-20T09:54:54.000Z | """Functions for creating data streams."""
from fuel.datasets import CIFAR10, SVHN, CelebA
from fuel.datasets.toy import Spiral
from fuel.schemes import ShuffledScheme
from fuel.streams import DataStream
from datasets import GaussianPackingMixture, VEEGAN1200DPackingMixture
def create_packing_VEEGAN1200D_data_streams(num_packings, batch_size, monitoring_batch_size, rng=None, num_examples=100000, sources=('features', )):
train_set = VEEGAN1200DPackingMixture(num_packings=num_packings, num_examples=num_examples, rng=rng, sources=sources)
valid_set = VEEGAN1200DPackingMixture(num_packings=num_packings, num_examples=num_examples, rng=rng, sources=sources)
main_loop_stream = DataStream(train_set, iteration_scheme=ShuffledScheme(train_set.num_examples, batch_size=batch_size, rng=rng))
train_monitor_stream = DataStream(train_set, iteration_scheme=ShuffledScheme(5000, batch_size, rng=rng))
valid_monitor_stream = DataStream(valid_set, iteration_scheme=ShuffledScheme(5000, batch_size, rng=rng))
return main_loop_stream, train_monitor_stream, valid_monitor_stream
def create_packing_gaussian_mixture_data_streams(num_packings, batch_size, monitoring_batch_size, means=None, variances=None, priors=None, rng=None, num_examples=100000, sources=('features', )):
train_set = GaussianPackingMixture(num_packings=num_packings, num_examples=num_examples, means=means, variances=variances, priors=priors, rng=rng, sources=sources)
valid_set = GaussianPackingMixture(num_packings=num_packings, num_examples=num_examples, means=means, variances=variances, priors=priors, rng=rng, sources=sources)
main_loop_stream = DataStream(train_set, iteration_scheme=ShuffledScheme(train_set.num_examples, batch_size=batch_size, rng=rng))
train_monitor_stream = DataStream(train_set, iteration_scheme=ShuffledScheme(5000, batch_size, rng=rng))
valid_monitor_stream = DataStream(valid_set, iteration_scheme=ShuffledScheme(5000, batch_size, rng=rng))
return main_loop_stream, train_monitor_stream, valid_monitor_stream
| 54.421053 | 194 | 0.824468 | 266 | 2,068 | 6.082707 | 0.18797 | 0.066749 | 0.069221 | 0.118665 | 0.800989 | 0.800989 | 0.794808 | 0.794808 | 0.794808 | 0.678616 | 0 | 0.024494 | 0.091876 | 2,068 | 37 | 195 | 55.891892 | 0.837061 | 0.017408 | 0 | 0.421053 | 0 | 0 | 0.007897 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.105263 | false | 0 | 0.263158 | 0 | 0.473684 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
f03e533a0c9141058950620a0bb7294e1d6b2c04 | 46 | py | Python | oskb/__init__.py | rushic24/oskb | d453a707d2a1d78d859d5e1648fe3804e40b4148 | [
"MIT"
] | 6 | 2020-05-06T16:59:48.000Z | 2021-09-18T12:48:21.000Z | oskb/__init__.py | rushic24/oskb | d453a707d2a1d78d859d5e1648fe3804e40b4148 | [
"MIT"
] | 1 | 2022-03-24T19:19:11.000Z | 2022-03-24T19:19:11.000Z | oskb/__init__.py | rushic24/oskb | d453a707d2a1d78d859d5e1648fe3804e40b4148 | [
"MIT"
] | 3 | 2020-05-06T16:59:52.000Z | 2021-09-18T12:48:54.000Z | import pkg_resources
from oskb.oskb import *
| 11.5 | 23 | 0.804348 | 7 | 46 | 5.142857 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152174 | 46 | 3 | 24 | 15.333333 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
b2d7b2943427c457413773355afa94396d9cbb7a | 198 | py | Python | attrs/admin.py | zostera/django-attrs | c1f1b4bb4bfb9cf836423cd5c7f121d61322a86b | [
"BSD-3-Clause"
] | null | null | null | attrs/admin.py | zostera/django-attrs | c1f1b4bb4bfb9cf836423cd5c7f121d61322a86b | [
"BSD-3-Clause"
] | null | null | null | attrs/admin.py | zostera/django-attrs | c1f1b4bb4bfb9cf836423cd5c7f121d61322a86b | [
"BSD-3-Clause"
] | 1 | 2019-12-01T22:14:45.000Z | 2019-12-01T22:14:45.000Z | from django.contrib import admin
# Register your models here.
from attrs.models import Attribute, Choice, Unit
admin.site.register(Attribute)
admin.site.register(Unit)
admin.site.register(Choice)
| 22 | 48 | 0.808081 | 28 | 198 | 5.714286 | 0.5 | 0.16875 | 0.31875 | 0.2625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.10101 | 198 | 8 | 49 | 24.75 | 0.898876 | 0.131313 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
b2fe91217e6d8f0c9bcf426726e4015074d67b20 | 30 | py | Python | mskit/post_analysis/_diann/__init__.py | gureann/MSKit | 8b360d38288100476740ad808e11b6c1b454dc2c | [
"MIT"
] | null | null | null | mskit/post_analysis/_diann/__init__.py | gureann/MSKit | 8b360d38288100476740ad808e11b6c1b454dc2c | [
"MIT"
] | null | null | null | mskit/post_analysis/_diann/__init__.py | gureann/MSKit | 8b360d38288100476740ad808e11b6c1b454dc2c | [
"MIT"
] | null | null | null | from . import diann_constants
| 15 | 29 | 0.833333 | 4 | 30 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 30 | 1 | 30 | 30 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
652967af9e3d9c659f30c12ef8f29fa406c4a967 | 44 | py | Python | sotalab/core/__init__.py | sota-lab/core | 3f2a5cdc1336b9f98d6e18756287c075128e4867 | [
"MIT"
] | null | null | null | sotalab/core/__init__.py | sota-lab/core | 3f2a5cdc1336b9f98d6e18756287c075128e4867 | [
"MIT"
] | null | null | null | sotalab/core/__init__.py | sota-lab/core | 3f2a5cdc1336b9f98d6e18756287c075128e4867 | [
"MIT"
] | null | null | null | from .config import ClassRegistry, register
| 22 | 43 | 0.840909 | 5 | 44 | 7.4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.113636 | 44 | 1 | 44 | 44 | 0.948718 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
33191f800ec8af9ba3835991a6a3e72dd7531d83 | 152 | py | Python | src/nbc_analysis/utils/func_utils.py | wmcabee-cs/nbc_analysis | d6c717aea0bd3638f9f6d03e2facb45fdbb062fc | [
"MIT"
] | null | null | null | src/nbc_analysis/utils/func_utils.py | wmcabee-cs/nbc_analysis | d6c717aea0bd3638f9f6d03e2facb45fdbb062fc | [
"MIT"
] | null | null | null | src/nbc_analysis/utils/func_utils.py | wmcabee-cs/nbc_analysis | d6c717aea0bd3638f9f6d03e2facb45fdbb062fc | [
"MIT"
] | null | null | null | from toolz import take, first, cons, merge, partial
def take_if_limit(reader, limit):
return take(limit, reader) if limit is not None else reader
| 25.333333 | 63 | 0.75 | 25 | 152 | 4.48 | 0.68 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.177632 | 152 | 5 | 64 | 30.4 | 0.896 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0.333333 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 6 |
33309395d2e693429583990b120b1d8057b0e8b7 | 310 | py | Python | tests/test_model_configs.py | Pandora-Intelligence/crosslingual-coreference | 27b82bd7e49eaf47e427ccc50bf0ed5761da4917 | [
"MIT"
] | 5 | 2022-03-28T17:44:01.000Z | 2022-03-31T09:13:31.000Z | tests/test_model_configs.py | Pandora-Intelligence/crosslingual-coreference | 27b82bd7e49eaf47e427ccc50bf0ed5761da4917 | [
"MIT"
] | 1 | 2022-03-30T10:21:01.000Z | 2022-03-30T10:21:01.000Z | tests/test_model_configs.py | Pandora-Intelligence/crosslingual-coreference | 27b82bd7e49eaf47e427ccc50bf0ed5761da4917 | [
"MIT"
] | 1 | 2022-03-29T08:03:25.000Z | 2022-03-29T08:03:25.000Z | def test_standalone():
from crosslingual_coreference.examples import test_individual # noqa: F401
def test_standalone_chunking():
from crosslingual_coreference.examples import test_chunking # noqa: F401
def test_spacy():
from crosslingual_coreference.examples import test_spacy # noqa: F401
| 28.181818 | 79 | 0.793548 | 37 | 310 | 6.378378 | 0.351351 | 0.088983 | 0.34322 | 0.444915 | 0.572034 | 0.572034 | 0 | 0 | 0 | 0 | 0 | 0.034091 | 0.148387 | 310 | 10 | 80 | 31 | 0.859848 | 0.103226 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0 | 0.5 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
334add858b4f89d23b93604330911c681a3c962f | 70 | py | Python | darklim/__init__.py | slwatkins/DarkLim | 22a0f8ea7dd609075d55c413b598e42da8ef348f | [
"MIT"
] | 1 | 2022-01-21T16:56:36.000Z | 2022-01-21T16:56:36.000Z | darklim/__init__.py | slwatkins/DarkLim | 22a0f8ea7dd609075d55c413b598e42da8ef348f | [
"MIT"
] | null | null | null | darklim/__init__.py | slwatkins/DarkLim | 22a0f8ea7dd609075d55c413b598e42da8ef348f | [
"MIT"
] | null | null | null | from . import limit
from . import constants
from . import sensitivity
| 17.5 | 25 | 0.785714 | 9 | 70 | 6.111111 | 0.555556 | 0.545455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171429 | 70 | 3 | 26 | 23.333333 | 0.948276 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
682539c87847046d11204fb3c39601493debf1cc | 13,329 | py | Python | scripts/job_creators/utils.py | hysds/hysds | 839d527114e115603ea0a2c4c1b7fe474f7b7b39 | [
"Apache-2.0"
] | 17 | 2018-04-30T17:53:23.000Z | 2021-11-10T18:24:24.000Z | scripts/job_creators/utils.py | hysds/hysds | 839d527114e115603ea0a2c4c1b7fe474f7b7b39 | [
"Apache-2.0"
] | 54 | 2017-10-17T23:22:53.000Z | 2022-02-09T22:05:07.000Z | scripts/job_creators/utils.py | hysds/hysds | 839d527114e115603ea0a2c4c1b7fe474f7b7b39 | [
"Apache-2.0"
] | 9 | 2018-01-13T01:07:21.000Z | 2021-02-25T21:21:43.000Z | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import json
from pprint import pprint, pformat
def get_job_json(info, job_type):
"""
Basic passthru of job info.
"""
return {
"type": job_type,
"params": info,
"localize_urls": info.get("localize_urls", []),
}
def ingest_dataset(info):
"""
Create job json for dataset ingest.
Example:
job = {
'type': 'ingest_dataset',
'name': 'ingest_dataset-AIRS.2010.01.01.222',
'params': {
'dataset': 'AIRS.2010.01.01.222'
},
'localize_urls': [
{
'url': 'https://msas-dav-pub.jpl.nasa.gov/sciflo/work/sciflowuid-3234234/AIRS.2010.01.01.222/AIRS.2010.01.01.222.nc',
'local_path': 'AIRS.2010.01.01.222/'
},
{
'url': 'https://msas-dav-pub.jpl.nasa.gov/sciflo/work/sciflowuid-3234234/AIRS.2010.01.01.222/test.png',
'local_path': 'AIRS.2010.01.01.222/'
},
{
'url': 'https://msas-dav-pub.jpl.nasa.gov/sciflo/work/sciflowuid-3234234/AIRS.2010.01.01.222/AIRS.2010.01.01.222.met.json',
'local_path': 'AIRS.2010.01.01.222/'
}
]
}
"""
# build params
params = {}
params["dataset"] = info["dataset"]
job = {
"type": "ingest_dataset",
"name": "ingest_dataset-%s" % params["dataset"],
"params": params,
"localize_urls": info["dataset_urls"],
}
# print "Job:"
# pprint(job, indent=2)
return job
def notify_by_email(info):
"""
Create job json for email notification.
Example:
job = {
'type': 'notify_by_email',
'name': 'action-notify_by_email-CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336',
'tag': 'Email CSK ingest',
'username': 'ops',
'params': {
'id': 'CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336'
'emails': 'test@test.com,test2@test.com',
'url': 'http://path_to_repo',
'rule_name': 'Email CSK ingest'
},
'localize_urls': []
}
"""
# build params
params = {}
params["id"] = info["objectid"]
params["rule_name"] = info["rule"]["rule_name"]
params["username"] = info["rule"]["username"]
kwargs = json.loads(info["rule"]["kwargs"])
params["emails"] = kwargs["email_addresses"]
rule_hit = info["rule_hit"]
urls = rule_hit["_source"]["urls"]
if len(urls) > 0:
params["url"] = urls[0]
else:
params["url"] = None
job = {
"type": "notify_by_email",
"name": "action-notify_by_email-%s" % info["objectid"],
"tag": params["rule_name"],
"username": params["username"],
"params": params,
"localize_urls": [],
}
# pprint(job, indent=2)
return job
def notify_by_tweet(info):
"""
Create job json for tweet notification.
Example:
job = {
'type': 'notify_by_tweet',
'name': 'action-notify_by_tweet-CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336',
'tag': 'tweet CSK ingest',
'username': 'ops',
'params': {
'id': 'CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336'
'url': 'http://path_to_repo',
'rule_name': 'tweet CSK ingest',
'hash_tags': '#thisrocks #datageek'
},
'localize_urls': []
}
"""
# build params
params = {}
params["id"] = info["objectid"]
params["rule_name"] = info["rule"]["rule_name"]
params["username"] = info["rule"]["username"]
kwargs = json.loads(info["rule"]["kwargs"])
params["hash_tags"] = kwargs["hash_tags"]
rule_hit = info["rule_hit"]
urls = rule_hit["_source"]["urls"]
if len(urls) > 0:
params["url"] = urls[0]
else:
params["url"] = None
job = {
"type": "notify_by_tweet",
"name": "action-notify_by_tweet-%s" % info["objectid"],
"tag": params["rule_name"],
"username": params["username"],
"params": params,
"localize_urls": [],
}
# pprint(job, indent=2)
return job
def ftp_push(info):
"""
Create job json for FTP push.
Example:
job = {
'type': 'ftp_push',
'name': 'action-ftp_push-CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336',
'tag': 'FTP Push CSK Calimap',
'username': 'ops',
'params': {
'id': 'CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336'
'url': 'http://path_to_repo'
'ftp_url': 'ftp://username:password@test.ftp.com/public/data_drop_off',
'emails': 'test@test.com,test2@test.com',
'rule_name': 'FTP Push CSK Calimap'
},
'localize_urls': []
}
"""
# build params
params = {}
params["id"] = info["objectid"]
params["rule_name"] = info["rule"]["rule_name"]
params["username"] = info["rule"]["username"]
kwargs = json.loads(info["rule"]["kwargs"])
params["ftp_url"] = kwargs["ftp_url"]
params["emails"] = kwargs["email_addresses"]
rule_hit = info["rule_hit"]
urls = rule_hit["_source"]["urls"]
if len(urls) > 0:
params["url"] = urls[0]
else:
params["url"] = None
job = {
"type": "ftp_push",
"name": "action-ftp_push-%s" % info["objectid"],
"tag": params["rule_name"],
"username": params["username"],
"params": params,
"localize_urls": [],
}
# pprint(job, indent=2)
return job
def sftp_push(info):
"""
Create job json for FTP push.
Example:
job = {
'type': 'sftp_push',
'name': 'action-sftp_push-CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336',
'tag': 'SFTP Push CSK Calimap',
'username': 'ops',
'params': {
'id': 'CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336'
'url': 'http://path_to_repo'
'sftp_url': 'sftp://username@test.ftp.com/public/data_drop_off',
'emails': 'test@test.com,test2@test.com',
'rule_name': 'SFTP Push CSK Calimap'
},
'localize_urls': []
}
"""
# build params
params = {}
params["id"] = info["objectid"]
params["rule_name"] = info["rule"]["rule_name"]
params["username"] = info["rule"]["username"]
kwargs = json.loads(info["rule"]["kwargs"])
params["sftp_url"] = kwargs["sftp_url"]
params["emails"] = kwargs["email_addresses"]
rule_hit = info["rule_hit"]
urls = rule_hit["_source"]["urls"]
if len(urls) > 0:
params["url"] = urls[0]
else:
params["url"] = None
job = {
"type": "sftp_push",
"name": "action-sftp_push-%s" % info["objectid"],
"tag": params["rule_name"],
"username": params["username"],
"params": params,
"localize_urls": [],
}
# pprint(job, indent=2)
return job
def rsync_push(info):
"""
Create job json for rsync push.
Example:
job = {
'type': 'rsync_push',
'name': 'action-rsync_push-CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336',
'tag': 'Rsync Push CSK Calimap',
'username': 'ops',
'params': {
'id': 'CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336'
'url': 'http://path_to_repo'
'rsync_url': 'file://username@test.ftp.com/home/username/data_drop_off',
'emails': 'test@test.com,test2@test.com',
'rule_name': 'Rsync Push CSK Calimap'
},
'localize_urls': []
}
"""
# build params
params = {}
params["id"] = info["objectid"]
params["rule_name"] = info["rule"]["rule_name"]
params["username"] = info["rule"]["username"]
kwargs = json.loads(info["rule"]["kwargs"])
params["rsync_url"] = kwargs["rsync_url"]
params["emails"] = kwargs["email_addresses"]
rule_hit = info["rule_hit"]
urls = rule_hit["_source"]["urls"]
if len(urls) > 0:
params["url"] = urls[0]
else:
params["url"] = None
job = {
"type": "rsync_push",
"name": "action-rsync_push-%s" % info["objectid"],
"tag": params["rule_name"],
"username": params["username"],
"params": params,
"localize_urls": [],
}
# pprint(job, indent=2)
return job
def purge_dataset(info):
"""
Create job json for dataset purge.
Example:
job = {
'type': 'purge_dataset',
'name': 'action-purge_dataset-CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336',
'tag': 'v0.3 purge',
'username': 'ops',
'params': {
'index': 'grq_dev_v03_csk',
'id': 'CSKS4_RAW_B_HI_11_HH_RD_20131004020329_20131004020336',
'url': 'http://path_to_repo'
},
'localize_urls': []
}
"""
# build params
params = {}
rule_hit = info["rule_hit"]
params["index"] = rule_hit["_index"]
params["doctype"] = rule_hit["_type"]
params["id"] = info["objectid"]
urls = rule_hit["_source"]["urls"]
if len(urls) > 0:
params["url"] = urls[0]
else:
params["url"] = None
params["rule_name"] = info["rule"]["rule_name"]
params["username"] = info["rule"]["username"]
job = {
"type": "purge_dataset",
"name": "action-purge_dataset-%s" % info["objectid"],
"tag": params["rule_name"],
"username": params["username"],
"params": params,
"localize_urls": [],
}
# pprint(job, indent=2)
return job
def purge_datasets(info):
"""
Create job json for purge of datasets by query.
Example:
job = {
'type': 'purge_datasets',
'name': 'action-purge_datasets',
'tag': 'v0.3 purge',
'username': 'ops',
'params': {
'index': 'grq_dev_v03_csk',
'query': '<ES query>'
},
'localize_urls': []
}
"""
# build params
params = {}
params["index"] = info["index"]
params["query"] = info["query"]
params["rule_name"] = info["rule"]["rule_name"]
params["username"] = info["rule"]["username"]
job = {
"type": "purge_datasets",
"name": "action-purge_datasets",
"tag": params["rule_name"],
"username": params["username"],
"params": params,
"localize_urls": [],
}
# pprint(job, indent=2)
return job
def custom_script(info):
"""
Create job json for custom script.
Example:
job = {
'type': 'custom_script',
'name': 'action-custom_script',
'tag': 'v0.3 custom_script',
'username': 'ops',
'params': {
'index': 'grq_dev_v03_csk',
'query': '<ES query>'
},
'localize_urls': []
}
"""
# build params
params = {}
params["index"] = info["index"]
params["query"] = info["query"]
params["rule_name"] = info["rule"]["rule_name"]
params["username"] = info["rule"]["username"]
# update params with kwargs
kwargs = json.loads(info["rule"]["kwargs"])
params.update(kwargs)
job = {
"type": "custom_script",
"name": "action-custom_script",
"tag": params["rule_name"],
"username": params["username"],
"params": params,
"localize_urls": [],
}
# pprint(job, indent=2)
return job
def import_prov_es(info):
"""
Create job json for importing of PROV-ES JSON.
Example:
job = {
'type': 'import_prov_es',
'name': 'action-import_prov_es',
'tag': 'v0.3_import',
'username': 'ops',
'params': {
'prod_url': '<dataset url>'
},
'localize_urls': []
}
"""
# build params
params = {}
rule_hit = info["rule_hit"]
params["index"] = rule_hit["_index"]
params["doctype"] = rule_hit["_type"]
params["id"] = info["objectid"]
urls = rule_hit["_source"]["urls"]
if len(urls) > 0:
params["prod_url"] = urls[0]
for url in urls:
if url.startswith("s3"):
params["prod_url"] = url
break
else:
params["prod_url"] = None
params["rule_name"] = info["rule"]["rule_name"]
params["username"] = info["rule"]["username"]
job = {
"type": "import_prov_es",
"name": "action-import_prov_es",
"tag": params["rule_name"],
"username": params["username"],
"params": params,
"localize_urls": [],
}
# pprint(job, indent=2)
return job
| 27.653527 | 139 | 0.524796 | 1,449 | 13,329 | 4.599724 | 0.093858 | 0.03841 | 0.037809 | 0.019805 | 0.84141 | 0.826407 | 0.811553 | 0.772093 | 0.740735 | 0.710278 | 0 | 0.059283 | 0.309025 | 13,329 | 481 | 140 | 27.711019 | 0.664387 | 0.419161 | 0 | 0.691244 | 0 | 0 | 0.273808 | 0.016469 | 0 | 0 | 0 | 0 | 0 | 1 | 0.050691 | false | 0 | 0.046083 | 0 | 0.147465 | 0.009217 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
6828dcc02eceb41abc0c80989476ab5a93d61ed4 | 9,443 | py | Python | tests/contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/test_michelson_coding_KT1KXA.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2020-08-11T02:31:24.000Z | 2020-08-11T02:31:24.000Z | tests/contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/test_michelson_coding_KT1KXA.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2020-12-30T16:44:56.000Z | 2020-12-30T16:44:56.000Z | tests/contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/test_michelson_coding_KT1KXA.py | tqtezos/pytezos | a4ac0b022d35d4c9f3062609d8ce09d584b5faa8 | [
"MIT"
] | 1 | 2022-03-20T19:01:00.000Z | 2022-03-20T19:01:00.000Z | from unittest import TestCase
from tests import get_data
from pytezos.michelson.micheline import michelson_to_micheline
from pytezos.michelson.formatter import micheline_to_michelson
class MichelsonCodingTestKT1KXA(TestCase):
def setUp(self):
self.maxDiff = None
def test_michelson_parse_code_KT1KXA(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/code_KT1KXA.json')
actual = michelson_to_micheline(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/code_KT1KXA.tz'))
self.assertEqual(expected, actual)
def test_michelson_format_code_KT1KXA(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/code_KT1KXA.tz')
actual = micheline_to_michelson(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/code_KT1KXA.json'),
inline=True)
self.assertEqual(expected, actual)
def test_michelson_inverse_code_KT1KXA(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/code_KT1KXA.json')
actual = michelson_to_micheline(micheline_to_michelson(expected))
self.assertEqual(expected, actual)
def test_michelson_parse_storage_KT1KXA(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/storage_KT1KXA.json')
actual = michelson_to_micheline(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/storage_KT1KXA.tz'))
self.assertEqual(expected, actual)
def test_michelson_format_storage_KT1KXA(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/storage_KT1KXA.tz')
actual = micheline_to_michelson(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/storage_KT1KXA.json'),
inline=True)
self.assertEqual(expected, actual)
def test_michelson_inverse_storage_KT1KXA(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/storage_KT1KXA.json')
actual = michelson_to_micheline(micheline_to_michelson(expected))
self.assertEqual(expected, actual)
def test_michelson_parse_parameter_oob71y(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oob71y.json')
actual = michelson_to_micheline(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oob71y.tz'))
self.assertEqual(expected, actual)
def test_michelson_format_parameter_oob71y(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oob71y.tz')
actual = micheline_to_michelson(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oob71y.json'),
inline=True)
self.assertEqual(expected, actual)
def test_michelson_inverse_parameter_oob71y(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oob71y.json')
actual = michelson_to_micheline(micheline_to_michelson(expected))
self.assertEqual(expected, actual)
def test_michelson_parse_parameter_oovEPa(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oovEPa.json')
actual = michelson_to_micheline(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oovEPa.tz'))
self.assertEqual(expected, actual)
def test_michelson_format_parameter_oovEPa(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oovEPa.tz')
actual = micheline_to_michelson(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oovEPa.json'),
inline=True)
self.assertEqual(expected, actual)
def test_michelson_inverse_parameter_oovEPa(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oovEPa.json')
actual = michelson_to_micheline(micheline_to_michelson(expected))
self.assertEqual(expected, actual)
def test_michelson_parse_parameter_onsNL6(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onsNL6.json')
actual = michelson_to_micheline(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onsNL6.tz'))
self.assertEqual(expected, actual)
def test_michelson_format_parameter_onsNL6(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onsNL6.tz')
actual = micheline_to_michelson(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onsNL6.json'),
inline=True)
self.assertEqual(expected, actual)
def test_michelson_inverse_parameter_onsNL6(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onsNL6.json')
actual = michelson_to_micheline(micheline_to_michelson(expected))
self.assertEqual(expected, actual)
def test_michelson_parse_parameter_onkKtd(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onkKtd.json')
actual = michelson_to_micheline(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onkKtd.tz'))
self.assertEqual(expected, actual)
def test_michelson_format_parameter_onkKtd(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onkKtd.tz')
actual = micheline_to_michelson(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onkKtd.json'),
inline=True)
self.assertEqual(expected, actual)
def test_michelson_inverse_parameter_onkKtd(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onkKtd.json')
actual = michelson_to_micheline(micheline_to_michelson(expected))
self.assertEqual(expected, actual)
def test_michelson_parse_parameter_oo1gZ9(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oo1gZ9.json')
actual = michelson_to_micheline(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oo1gZ9.tz'))
self.assertEqual(expected, actual)
def test_michelson_format_parameter_oo1gZ9(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oo1gZ9.tz')
actual = micheline_to_michelson(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oo1gZ9.json'),
inline=True)
self.assertEqual(expected, actual)
def test_michelson_inverse_parameter_oo1gZ9(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_oo1gZ9.json')
actual = michelson_to_micheline(micheline_to_michelson(expected))
self.assertEqual(expected, actual)
def test_michelson_parse_parameter_onrnbX(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onrnbX.json')
actual = michelson_to_micheline(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onrnbX.tz'))
self.assertEqual(expected, actual)
def test_michelson_format_parameter_onrnbX(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onrnbX.tz')
actual = micheline_to_michelson(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onrnbX.json'),
inline=True)
self.assertEqual(expected, actual)
def test_michelson_inverse_parameter_onrnbX(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_onrnbX.json')
actual = michelson_to_micheline(micheline_to_michelson(expected))
self.assertEqual(expected, actual)
def test_michelson_parse_parameter_op1reV(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_op1reV.json')
actual = michelson_to_micheline(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_op1reV.tz'))
self.assertEqual(expected, actual)
def test_michelson_format_parameter_op1reV(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_op1reV.tz')
actual = micheline_to_michelson(get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_op1reV.json'),
inline=True)
self.assertEqual(expected, actual)
def test_michelson_inverse_parameter_op1reV(self):
expected = get_data(
path='contracts/KT1KXAV7cZmN8ouCqd4rMnMPHy9Wy4Jc3Xvi/parameter_op1reV.json')
actual = michelson_to_micheline(micheline_to_michelson(expected))
self.assertEqual(expected, actual)
| 46.9801 | 90 | 0.733983 | 880 | 9,443 | 7.563636 | 0.05 | 0.048377 | 0.074369 | 0.135216 | 0.963341 | 0.963341 | 0.963341 | 0.963341 | 0.947416 | 0.947416 | 0 | 0.049764 | 0.191359 | 9,443 | 200 | 91 | 47.215 | 0.821896 | 0 | 0 | 0.639053 | 0 | 0 | 0.316531 | 0.316531 | 0 | 0 | 0 | 0 | 0.159763 | 1 | 0.16568 | false | 0 | 0.023669 | 0 | 0.195266 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
68480627b26d1d66d53ab4f975a25b46e7e4ba32 | 3,524 | py | Python | test-framework/test-suites/integration/tests/remove/test_remove_host_route.py | shivanshs9/stacki | 258740748281dfe89b0f566261eaf23102f91aa4 | [
"BSD-3-Clause"
] | null | null | null | test-framework/test-suites/integration/tests/remove/test_remove_host_route.py | shivanshs9/stacki | 258740748281dfe89b0f566261eaf23102f91aa4 | [
"BSD-3-Clause"
] | null | null | null | test-framework/test-suites/integration/tests/remove/test_remove_host_route.py | shivanshs9/stacki | 258740748281dfe89b0f566261eaf23102f91aa4 | [
"BSD-3-Clause"
] | null | null | null | import json
from textwrap import dedent
class TestRemoveHostRoute:
def test_remove_host_route_invalid_host(self, host):
result = host.run('stack remove host route test')
assert result.rc == 255
assert result.stderr == 'error - cannot resolve host "test"\n'
def test_remove_host_route_no_args(self, host):
result = host.run('stack remove host route')
assert result.rc == 255
assert result.stderr == dedent('''\
error - "host" argument is required
{host ...} {address=string} [syncnow=string]
''')
def test_remove_host_route_no_host_matches(self, host):
result = host.run('stack remove host route a:test')
assert result.rc == 255
assert result.stderr == dedent('''\
error - "host" argument is required
{host ...} {address=string} [syncnow=string]
''')
def test_remove_host_route_no_address(self, host):
result = host.run('stack remove host route frontend-0-0')
assert result.rc == 255
assert result.stderr == dedent('''\
error - "address" parameter is required
{host ...} {address=string} [syncnow=string]
''')
def test_remove_host_route_no_syncnow(self, host, revert_routing_table):
# Add a route with sync now so it is added to the routing table
result = host.run(
'stack add host route frontend-0-0 '
'address=127.0.0.3 gateway=127.0.0.3 syncnow=true'
)
assert result.rc == 0
# Confirm it is in the DB
result = host.run(
'stack list host route frontend-0-0 output-format=json'
)
assert result.rc == 0
assert '127.0.0.3' in {
route['network'] for route in json.loads(result.stdout)
}
# Also check that the test route is in our routing table
result = host.run('ip route list')
assert result.rc == 0
assert '127.0.0.3' in result.stdout
# Now remove it from the the DB, but don't sync
result = host.run(
'stack remove host route frontend-0-0 address=127.0.0.3'
)
assert result.rc == 0
# Confirm it is no longer in the DB
result = host.run(
'stack list host route frontend-0-0 output-format=json'
)
assert result.rc == 0
assert '127.0.0.3' not in {
route['network'] for route in json.loads(result.stdout)
}
# Make sure it is still in the routing table
result = host.run('ip route list')
assert result.rc == 0
assert '127.0.0.3' in result.stdout
def test_remove_host_route_with_syncnow(self, host, revert_routing_table):
# Add a route with sync now so it is added to the routing table
result = host.run(
'stack add host route frontend-0-0 '
'address=127.0.0.3 gateway=127.0.0.3 syncnow=true'
)
assert result.rc == 0
# Confirm it is in the DB
result = host.run(
'stack list host route frontend-0-0 output-format=json'
)
assert result.rc == 0
assert '127.0.0.3' in {
route['network'] for route in json.loads(result.stdout)
}
# Also check that the test route is in our routing table
result = host.run('ip route list')
assert result.rc == 0
assert '127.0.0.3' in result.stdout
# Now remove it from the the DB and also sync
result = host.run(
'stack remove host route frontend-0-0 address=127.0.0.3 syncnow=true'
)
assert result.rc == 0
# Confirm it is no longer in the DB
result = host.run(
'stack list host route frontend-0-0 output-format=json'
)
assert result.rc == 0
assert '127.0.0.3' not in {
route['network'] for route in json.loads(result.stdout)
}
# Make sure it is also removed from the routing table
result = host.run('ip route list')
assert result.rc == 0
assert '127.0.0.3' not in result.stdout
| 29.864407 | 75 | 0.685868 | 583 | 3,524 | 4.085763 | 0.135506 | 0.019312 | 0.087322 | 0.035264 | 0.921495 | 0.903023 | 0.892947 | 0.892947 | 0.874895 | 0.800588 | 0 | 0.044507 | 0.196652 | 3,524 | 117 | 76 | 30.119658 | 0.796892 | 0.151532 | 0 | 0.659091 | 0 | 0.034091 | 0.362445 | 0 | 0 | 0 | 0 | 0 | 0.318182 | 1 | 0.068182 | false | 0 | 0.022727 | 0 | 0.102273 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
d7a1135638059b4741f84e37ba5ce3448f4c400b | 11,928 | py | Python | primitives_ubc/cnn/test_cnn.py | tonyjo/ubc_primitives | bc94a403f176fe28db2a9ac9d1a48cb9db021f90 | [
"Apache-2.0"
] | null | null | null | primitives_ubc/cnn/test_cnn.py | tonyjo/ubc_primitives | bc94a403f176fe28db2a9ac9d1a48cb9db021f90 | [
"Apache-2.0"
] | 4 | 2020-07-19T00:45:29.000Z | 2020-12-10T18:25:41.000Z | primitives_ubc/cnn/test_cnn.py | tonyjo/ubc_primitives | bc94a403f176fe28db2a9ac9d1a48cb9db021f90 | [
"Apache-2.0"
] | 1 | 2021-04-30T18:13:49.000Z | 2021-04-30T18:13:49.000Z | import os
import numpy as np
import pandas as pd
import unittest
from d3m.container.dataset import Dataset
from d3m.metadata import base as metadata_base
from common_primitives.denormalize import DenormalizePrimitive
from common_primitives.dataset_to_dataframe import DatasetToDataFramePrimitive
from common_primitives.xgboost_regressor import XGBoostGBTreeRegressorPrimitive
from common_primitives.extract_columns_semantic_types import ExtractColumnsBySemanticTypesPrimitive
# Testing primitive
from primitives_ubc.cnn import ConvolutionalNeuralNetwork
class TestConvolutionalNeuralNetwork(unittest.TestCase):
def test_1(self):
"""
Feature extraction only and Testing on seed dataset from D3M datasets
"""
print('\n')
print('########################')
print('#--------TEST-1--------#')
print('########################')
# Get volumes:
all_weights = os.listdir('./static')
all_weights = {w: os.path.join('./static', w) for w in all_weights}
# Loading dataset.
path1 = 'file://{uri}'.format(uri=os.path.abspath('/ubc_primitives/datasets/seed_datasets_current/22_handgeometry/TRAIN/dataset_TRAIN/datasetDoc.json'))
dataset = Dataset.load(dataset_uri=path1)
# Get dataset paths
path2 = 'file://{uri}'.format(uri=os.path.abspath('/ubc_primitives/datasets/seed_datasets_current/22_handgeometry/SCORE/dataset_TEST/datasetDoc.json'))
score_dataset = Dataset.load(dataset_uri=path2)
# Step 0: Denormalize primitive
denormalize_hyperparams_class = DenormalizePrimitive.metadata.get_hyperparams()
denormalize_primitive = DenormalizePrimitive(hyperparams=denormalize_hyperparams_class.defaults())
denormalized_dataset = denormalize_primitive.produce(inputs=dataset)
print(denormalized_dataset.value)
print('------------------------')
print('Loading Training Dataset....')
# Step 1: Dataset to DataFrame
dataframe_hyperparams_class = DatasetToDataFramePrimitive.metadata.get_hyperparams()
dataframe_primitive = DatasetToDataFramePrimitive(hyperparams=dataframe_hyperparams_class.defaults())
dataframe = dataframe_primitive.produce(inputs=denormalized_dataset.value)
print(dataframe.value)
print('------------------------')
print('Loading Testing Dataset....')
# Step 0: Denormalize primitive
score_denormalize_hyperparams_class = DenormalizePrimitive.metadata.get_hyperparams()
score_denormalize_primitive = DenormalizePrimitive(hyperparams=score_denormalize_hyperparams_class.defaults())
score_denormalized_dataset = score_denormalize_primitive.produce(inputs=score_dataset)
print(score_denormalized_dataset.value)
print('------------------------')
score_hyperparams_class = DatasetToDataFramePrimitive.metadata.get_hyperparams()
score_primitive = DatasetToDataFramePrimitive(hyperparams=score_hyperparams_class.defaults())
score = score_primitive.produce(inputs=score_denormalized_dataset.value)
print(score.value)
print('------------------------')
extractA_hyperparams_class = ExtractColumnsBySemanticTypesPrimitive.metadata.query()['primitive_code']['class_type_arguments']['Hyperparams']
extractA_hyperparams_class = extractA_hyperparams_class.defaults().replace(
{
'semantic_types': ('https://metadata.datadrivendiscovery.org/types/FileName',)
}
)
extractA_primitive = ExtractColumnsBySemanticTypesPrimitive(hyperparams=extractA_hyperparams_class)
extractA = extractA_primitive.produce(inputs=dataframe.value)
print(extractA.value)
print('------------------------')
extractP_hyperparams_class = ExtractColumnsBySemanticTypesPrimitive.metadata.query()['primitive_code']['class_type_arguments']['Hyperparams']
extractP_hyperparams = extractP_hyperparams_class.defaults().replace(
{
'semantic_types': ('https://metadata.datadrivendiscovery.org/types/SuggestedTarget',)
}
)
extractP_primitive = ExtractColumnsBySemanticTypesPrimitive(hyperparams=extractP_hyperparams)
extractP = extractP_primitive.produce(inputs=dataframe.value)
print(extractP.value)
print('------------------------')
# Call primitives
hyperparams_class = ConvolutionalNeuralNetwork.metadata.query()['primitive_code']['class_type_arguments']['Hyperparams']
hyperparams_class = hyperparams_class.defaults().replace(
{
'feature_extract_only': False,
'cnn_type': 'mobilenet',
'num_iterations': 150,
'output_dim': 1
}
)
primitive = ConvolutionalNeuralNetwork(hyperparams=hyperparams_class, volumes=all_weights)
primitive.set_training_data(inputs = dataframe.value, outputs = extractP.value)
test_out = primitive.fit()
test_out = primitive.produce(inputs=score.value)
test_out = test_out.value
print(test_out)
print('------------------------')
for col in range(test_out.shape[1]):
col_dict = dict(test_out.metadata.query((metadata_base.ALL_ELEMENTS, col)))
print('Meta-data - {}'.format(col), col_dict)
# Computer Error
ground_truth = ((score.value['WRISTBREADTH']).to_numpy()).astype(np.float)
predictions = (test_out.iloc[:, -1]).to_numpy()
print(ground_truth)
print(predictions)
print('------------------------')
print('Mean squared error (lower better): ', (np.mean((predictions - ground_truth)**2)))
print('------------------------')
def test_2(self):
"""
Training and Testing on seed dataset from D3M datasets
"""
print('\n')
print('########################')
print('#--------TEST-2--------#')
print('########################')
# Get volumes:
all_weights = os.listdir('./static')
all_weights = {w: os.path.join('./static', w) for w in all_weights}
# Loading dataset.
path1 = 'file://{uri}'.format(uri=os.path.abspath('/ubc_primitives/datasets/seed_datasets_current/22_handgeometry/TRAIN/dataset_TRAIN/datasetDoc.json'))
dataset = Dataset.load(dataset_uri=path1)
# Get dataset paths
path2 = 'file://{uri}'.format(uri=os.path.abspath('/ubc_primitives/datasets/seed_datasets_current/22_handgeometry/SCORE/dataset_TEST/datasetDoc.json'))
score_dataset = Dataset.load(dataset_uri=path2)
# Step 0: Denormalize primitive
denormalize_hyperparams_class = DenormalizePrimitive.metadata.get_hyperparams()
denormalize_primitive = DenormalizePrimitive(hyperparams=denormalize_hyperparams_class.defaults())
denormalized_dataset = denormalize_primitive.produce(inputs=dataset)
print(denormalized_dataset.value)
print('------------------------')
print('Loading Training Dataset....')
# Step 1: Dataset to DataFrame
dataframe_hyperparams_class = DatasetToDataFramePrimitive.metadata.get_hyperparams()
dataframe_primitive = DatasetToDataFramePrimitive(hyperparams=dataframe_hyperparams_class.defaults())
dataframe = dataframe_primitive.produce(inputs=denormalized_dataset.value)
print(dataframe.value)
print('------------------------')
print('Loading Testing Dataset....')
# Step 0: Denormalize primitive
score_denormalize_hyperparams_class = DenormalizePrimitive.metadata.get_hyperparams()
score_denormalize_primitive = DenormalizePrimitive(hyperparams=score_denormalize_hyperparams_class.defaults())
score_denormalized_dataset = score_denormalize_primitive.produce(inputs=score_dataset)
print(score_denormalized_dataset.value)
print('------------------------')
score_hyperparams_class = DatasetToDataFramePrimitive.metadata.get_hyperparams()
score_primitive = DatasetToDataFramePrimitive(hyperparams=score_hyperparams_class.defaults())
score = score_primitive.produce(inputs=score_denormalized_dataset.value)
print(score.value)
print('------------------------')
# Call primitives
hyperparams_class = ConvolutionalNeuralNetwork.metadata.query()['primitive_code']['class_type_arguments']['Hyperparams']
hyperparams_class = hyperparams_class.defaults().replace(
{
'include_top': False,
'cnn_type': 'mobilenet',
'output_dim': 1,
}
)
primitive = ConvolutionalNeuralNetwork(hyperparams=hyperparams_class, volumes=all_weights)
test_out = primitive.produce(inputs=dataframe.value)
print(test_out)
print('------------------------')
extractA_hyperparams_class = ExtractColumnsBySemanticTypesPrimitive.metadata.query()['primitive_code']['class_type_arguments']['Hyperparams']
extractA_hyperparams_class = extractA_hyperparams_class.defaults().replace(
{
'semantic_types': ('https://metadata.datadrivendiscovery.org/types/Attribute',)
}
)
extractA_primitive = ExtractColumnsBySemanticTypesPrimitive(hyperparams=extractA_hyperparams_class)
extractA = extractA_primitive.produce(inputs=test_out.value)
print(extractA.value)
print('------------------------')
extractP_hyperparams_class = ExtractColumnsBySemanticTypesPrimitive.metadata.query()['primitive_code']['class_type_arguments']['Hyperparams']
extractP_hyperparams = extractP_hyperparams_class.defaults().replace(
{
'semantic_types': ('https://metadata.datadrivendiscovery.org/types/SuggestedTarget',)
}
)
extractP_primitive = ExtractColumnsBySemanticTypesPrimitive(hyperparams=extractP_hyperparams)
extractP = extractP_primitive.produce(inputs=dataframe.value)
extractP = extractP.value
# Update Metadata from SuggestedTarget to TrueTarget
for col in range((extractP).shape[1]):
col_dict = dict(extractP.metadata.query((metadata_base.ALL_ELEMENTS, col)))
col_dict['structural_type'] = type(1.0)
col_dict['name'] = "WRISTBREADTH"
col_dict["semantic_types"] = ("http://schema.org/Float", "https://metadata.datadrivendiscovery.org/types/TrueTarget",)
extractP.metadata = extractP.metadata.update((metadata_base.ALL_ELEMENTS, col), col_dict)
print(extractP)
print('------------------------')
# Call primitives
score_out = primitive.produce(inputs=score.value)
XGB_hyperparams_class = XGBoostGBTreeRegressorPrimitive.metadata.query()['primitive_code']['class_type_arguments']['Hyperparams']
XGB_primitive = XGBoostGBTreeRegressorPrimitive(hyperparams=XGB_hyperparams_class.defaults())
XGB_primitive.set_training_data(inputs=test_out.value, outputs=extractP)
XGB_primitive.fit()
test_out_xgb = XGB_primitive.produce(inputs=score_out.value)
test_out_xgb = test_out_xgb.value
print('Predictions')
print(test_out_xgb)
print('------------------------')
# Computer Error
ground_truth = ((score.value['WRISTBREADTH']).to_numpy()).astype(np.float)
predictions = (test_out_xgb.iloc[:, -1]).to_numpy()
print(ground_truth)
print(predictions)
print('------------------------')
print('Mean squared error (lower better): ', (np.mean((predictions - ground_truth)**2)))
print('------------------------')
if __name__ == '__main__':
unittest.main()
| 48.096774 | 160 | 0.657193 | 1,081 | 11,928 | 6.99445 | 0.132285 | 0.080413 | 0.046555 | 0.030684 | 0.814046 | 0.791033 | 0.774501 | 0.758894 | 0.75162 | 0.75162 | 0 | 0.004496 | 0.198105 | 11,928 | 247 | 161 | 48.291498 | 0.785991 | 0.045775 | 0 | 0.598901 | 0 | 0 | 0.189184 | 0.087479 | 0 | 0 | 0 | 0 | 0 | 1 | 0.010989 | false | 0 | 0.06044 | 0 | 0.076923 | 0.296703 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
d7a886dc8f5045b3a0f4d7ae9bce7405d48a6a3a | 170 | py | Python | nes/processors/registers/flags/__init__.py | Hexadorsimal/pynes | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | 1 | 2017-05-13T18:57:09.000Z | 2017-05-13T18:57:09.000Z | nes/processors/registers/flags/__init__.py | Hexadorsimal/py6502 | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | 7 | 2020-10-24T17:16:56.000Z | 2020-11-01T14:10:23.000Z | nes/processors/registers/flags/__init__.py | Hexadorsimal/pynes | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | null | null | null | from .flag import Flag
from .carry_flag import CarryFlag
from .negative_flag import NegativeFlag
from .overflow_flag import OverflowFlag
from .zero_flag import ZeroFlag
| 24.285714 | 39 | 0.847059 | 24 | 170 | 5.833333 | 0.458333 | 0.357143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.123529 | 170 | 6 | 40 | 28.333333 | 0.939597 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
d7ba91d6e610e86158a54acc4e9f0dcb4f537104 | 48 | py | Python | cdpl/__init__.py | Zeroto521/Wox.Plugin.cPDL | 76caf0f2966c2bcdbb7631cb004677fb317511e0 | [
"MIT"
] | 1 | 2021-04-19T22:53:42.000Z | 2021-04-19T22:53:42.000Z | cdpl/__init__.py | Zeroto521/Wox.Plugin.cPDL | 76caf0f2966c2bcdbb7631cb004677fb317511e0 | [
"MIT"
] | null | null | null | cdpl/__init__.py | Zeroto521/Wox.Plugin.cPDL | 76caf0f2966c2bcdbb7631cb004677fb317511e0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .cdpl import cdpl
| 12 | 23 | 0.583333 | 7 | 48 | 4 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026316 | 0.208333 | 48 | 3 | 24 | 16 | 0.710526 | 0.4375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
d7fb862ffbd2339cde539dadce0e1d23e870ad8c | 1,201 | py | Python | src/api/migrations/0002_auto_20190522_1618.py | pradipta/back-end | 05895b051afc4c8e0cb17db708063d80102e9de5 | [
"MIT"
] | 17 | 2019-05-11T22:15:34.000Z | 2022-03-26T22:45:33.000Z | src/api/migrations/0002_auto_20190522_1618.py | pradipta/back-end | 05895b051afc4c8e0cb17db708063d80102e9de5 | [
"MIT"
] | 390 | 2019-05-23T10:48:57.000Z | 2021-12-17T21:01:43.000Z | src/api/migrations/0002_auto_20190522_1618.py | pradipta/back-end | 05895b051afc4c8e0cb17db708063d80102e9de5 | [
"MIT"
] | 40 | 2019-05-21T14:41:57.000Z | 2021-01-30T13:39:38.000Z | # Generated by Django 2.2.1 on 2019-05-22 21:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("api", "0001_initial")]
operations = [
migrations.AlterField(
model_name="codeschool",
name="created_at",
field=models.DateTimeField(auto_now_add=True),
),
migrations.AlterField(
model_name="codeschool",
name="updated_at",
field=models.DateTimeField(auto_now=True),
),
migrations.AlterField(
model_name="location",
name="created_at",
field=models.DateTimeField(auto_now_add=True),
),
migrations.AlterField(
model_name="location",
name="updated_at",
field=models.DateTimeField(auto_now=True),
),
migrations.AlterField(
model_name="teammember",
name="created_at",
field=models.DateTimeField(auto_now_add=True),
),
migrations.AlterField(
model_name="teammember",
name="updated_at",
field=models.DateTimeField(auto_now=True),
),
]
| 28.595238 | 58 | 0.571191 | 114 | 1,201 | 5.824561 | 0.333333 | 0.180723 | 0.225904 | 0.262048 | 0.793675 | 0.793675 | 0.71988 | 0.665663 | 0.665663 | 0.593373 | 0 | 0.023199 | 0.318068 | 1,201 | 41 | 59 | 29.292683 | 0.787546 | 0.037469 | 0 | 0.857143 | 1 | 0 | 0.113518 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.028571 | 0 | 0.114286 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
cc072b8864d26395c5385069a73bedca65967c4f | 5,602 | py | Python | lib/roi_data_layer/repoolingFourParts.py | someoneAlready/ohem | b7552ceb8ed1e9768e0d522258caa64b79834b54 | [
"BSD-2-Clause"
] | 1 | 2017-01-24T20:41:52.000Z | 2017-01-24T20:41:52.000Z | lib/roi_data_layer/repoolingFourParts.py | cgangEE/ohem | b7552ceb8ed1e9768e0d522258caa64b79834b54 | [
"BSD-2-Clause"
] | null | null | null | lib/roi_data_layer/repoolingFourParts.py | cgangEE/ohem | b7552ceb8ed1e9768e0d522258caa64b79834b54 | [
"BSD-2-Clause"
] | 1 | 2020-10-09T07:49:03.000Z | 2020-10-09T07:49:03.000Z | # --------------------------------------------------------
# Fast R-CNN with OHEM
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Abhinav Shrivastava
# --------------------------------------------------------
"""The data layer used during training to train a Fast R-CNN network.
"""
import sys
import caffe
from fast_rcnn.config import cfg
from fast_rcnn.bbox_transform import clip_boxes, bbox_transform_inv
from roi_data_layer.minibatch import get_minibatch, get_allrois_minibatch, get_ohem_minibatch
import numpy as np
import yaml
from multiprocessing import Process, Queue
class RepoolingLayer(caffe.Layer):
def setup(self, bottom, top):
idx = 0
# rois blob: holds R regions of interest, each is a 5-tuple
# (n, x1, y1, x2, y2) specifying an image batch index n and a
# rectangle (x1, y1, x2, y2)
ohem_size = cfg.TRAIN.BATCH_OHEM_SIZE
for i in range(4):
top[idx].reshape(ohem_size, 5)
idx += 1
top[idx].reshape(ohem_size * 4, 5)
idx += 1
assert len(top) == 5
def forward(self, bottom, top):
"""Compute loss, select RoIs using OHEM. Use RoIs to get blobs and copy them into this layer's top blob vector."""
boxes = bottom[0].data.copy()[:, 1:5]
deltas = []
for i in range(1, 5):
deltas.append(bottom[i].data.copy())
im_info = bottom[5].data.copy()
im_shape = (im_info[0, 0], im_info[0, 1])
j = 1
for i in range(4):
deltas[i][:, j*4:(j+1)*4] *= np.array(
cfg.TRAIN.BBOX_NORMALIZE_STDS)
deltas[i][:, j*4:(j+1)*4] += np.array(
cfg.TRAIN.BBOX_NORMALIZE_MEANS)
deltas[i]= bbox_transform_inv(boxes, deltas[i])
deltas[i] = clip_boxes(deltas[i], im_shape)
deltas[i] = deltas[i][:, 4:]
zeros = np.zeros((deltas[i].shape[0], 1), dtype = np.float32)
deltas[i] = np.hstack((zeros, deltas[i]))
top[i].reshape(*(deltas[i].shape))
top[i].data[...] = deltas[i].astype(np.float32, copy=False)
rois_repool = np.vstack((deltas[0], deltas[1],
deltas[2], deltas[3]))
top[4].reshape(*(rois_repool.shape))
top[4].data[...] = rois_repool.astype(np.float32, copy=False)
def backward(self, top, propagate_down, bottom):
"""This layer does not propagate gradients."""
pass
def reshape(self, bottom, top):
"""Reshaping happens during the call to forward."""
pass
class RepoolingTestLayer(caffe.Layer):
def setup(self, bottom, top):
idx = 0
# rois blob: holds R regions of interest, each is a 5-tuple
# (n, x1, y1, x2, y2) specifying an image batch index n and a
# rectangle (x1, y1, x2, y2)
ohem_size = cfg.TRAIN.BATCH_OHEM_SIZE
for i in range(4):
top[idx].reshape(ohem_size, 5)
idx += 1
top[idx].reshape(ohem_size * 4, 5)
idx += 1
assert len(top) == 5
def forward(self, bottom, top):
"""Compute loss, select RoIs using OHEM. Use RoIs to get blobs and copy them into this layer's top blob vector."""
boxes = bottom[0].data.copy()[:, 1:5]
deltas = []
for i in range(1, 5):
deltas.append(bottom[i].data.copy())
im_info = bottom[5].data.copy()
im_shape = (im_info[0, 0], im_info[0, 1])
j = 1
for i in range(4):
deltas[i]= bbox_transform_inv(boxes, deltas[i])
deltas[i] = clip_boxes(deltas[i], im_shape)
deltas[i] = deltas[i][:, 4:]
zeros = np.zeros((deltas[i].shape[0], 1), dtype = np.float32)
deltas[i] = np.hstack((zeros, deltas[i]))
top[i].reshape(*(deltas[i].shape))
top[i].data[...] = deltas[i].astype(np.float32, copy=False)
rois_repool = np.vstack((deltas[0], deltas[1],
deltas[2], deltas[3]))
top[4].reshape(*(rois_repool.shape))
top[4].data[...] = rois_repool.astype(np.float32, copy=False)
def backward(self, top, propagate_down, bottom):
"""This layer does not propagate gradients."""
pass
def reshape(self, bottom, top):
"""Reshaping happens during the call to forward."""
pass
class SplitLayer(caffe.Layer):
def setup(self, bottom, top):
idx = 0
ohem_size = cfg.TRAIN.BATCH_OHEM_SIZE
top[idx].reshape(ohem_size, 4096)
idx += 1
top[idx].reshape(ohem_size, 4096)
idx += 1
top[idx].reshape(ohem_size, 4096)
idx += 1
top[idx].reshape(ohem_size, 4096)
idx += 1
assert len(top) == 4
def forward(self, bottom, top):
"""Compute loss, select RoIs using OHEM. Use RoIs to get blobs and copy them into this layer's top blob vector."""
fc7 = bottom[0].data.copy()
size = fc7.shape[0] / 4
for i in range(4):
fc7_bbox = fc7[i * size : (i + 1) * size, : ]
top[i].reshape(*(fc7_bbox.shape))
top[i].data[...] = fc7_bbox.astype(np.float32, copy=False)
def backward(self, top, propagate_down, bottom):
diff = np.vstack((top[0].diff.copy(), top[1].diff.copy(),
top[2].diff.copy(), top[3].diff.copy()))
bottom[0].diff[...] = diff.astype(np.float32, copy=False)
def reshape(self, bottom, top):
"""Reshaping happens during the call to forward."""
pass
| 30.11828 | 122 | 0.556765 | 781 | 5,602 | 3.914213 | 0.177977 | 0.054956 | 0.038273 | 0.044488 | 0.796205 | 0.788355 | 0.780504 | 0.771017 | 0.771017 | 0.759568 | 0 | 0.034 | 0.285969 | 5,602 | 185 | 123 | 30.281081 | 0.73025 | 0.204391 | 0 | 0.773585 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028302 | 1 | 0.113208 | false | 0.04717 | 0.075472 | 0 | 0.216981 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
cc0a58571d80215308d7b60e5b9a462131fc8cb1 | 442 | py | Python | main.py | hilmyalbar/Simple-Calculator | da4c231de2d97a640d1084648f40e41bcea66cd3 | [
"MIT"
] | null | null | null | main.py | hilmyalbar/Simple-Calculator | da4c231de2d97a640d1084648f40e41bcea66cd3 | [
"MIT"
] | null | null | null | main.py | hilmyalbar/Simple-Calculator | da4c231de2d97a640d1084648f40e41bcea66cd3 | [
"MIT"
] | null | null | null | print(25*'=')
print('Simple Calculator')
print(25*'=')
while True:
x, y, z = input().split()
if y == '+':
print(25*'=')
print(int(x) + int(z))
print(25*'=')
elif y == '-':
print(25*'=')
print(int(x) - int(z))
print(25*'=')
elif y == 'x' or y == '*':
print(25*'=')
print(int(x) * int(z))
print(25*'=')
elif y == '/':
print(25*'=')
print(int(x) / int(z))
print(25*'=')
else:
print('wrong code!!')
| 18.416667 | 27 | 0.463801 | 65 | 442 | 3.153846 | 0.276923 | 0.341463 | 0.292683 | 0.253659 | 0.609756 | 0.609756 | 0.609756 | 0.609756 | 0.609756 | 0.609756 | 0 | 0.058651 | 0.228507 | 442 | 24 | 28 | 18.416667 | 0.542522 | 0 | 0 | 0.434783 | 0 | 0 | 0.099323 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0.695652 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 6 |
cc12b49ac9030954e2d3e2f9060ac157f71cbf4d | 83 | py | Python | utils/postplotting/__init__.py | shogi880/lossyless | 04f76c765111c4bf7e6b8f870787e5a8a2b66fbd | [
"MIT"
] | 61 | 2021-07-05T20:05:51.000Z | 2022-03-19T08:52:40.000Z | utils/postplotting/__init__.py | shogi880/lossyless | 04f76c765111c4bf7e6b8f870787e5a8a2b66fbd | [
"MIT"
] | 2 | 2021-07-26T15:36:17.000Z | 2021-12-19T10:29:12.000Z | utils/postplotting/__init__.py | shogi880/lossyless | 04f76c765111c4bf7e6b8f870787e5a8a2b66fbd | [
"MIT"
] | 7 | 2021-09-14T08:35:05.000Z | 2022-02-27T20:01:02.000Z | from .decorators import *
from .postplotter import *
from .pretty_renamer import *
| 20.75 | 29 | 0.783133 | 10 | 83 | 6.4 | 0.6 | 0.3125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.144578 | 83 | 3 | 30 | 27.666667 | 0.901408 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
cc23cbffa1be9ae5d70cf06535c76e4d40bbb773 | 129 | py | Python | project_1/src/losses/__init__.py | kkaryl/AI6126-Advanced_Computer_Vision | 6a55fe02f3267dc295b001f88df595e649c1fd31 | [
"MIT"
] | 3 | 2020-12-28T06:58:31.000Z | 2021-08-30T16:47:03.000Z | project_1/src/losses/__init__.py | kkaryl/AI6126-Advanced_Computer_Vision | 6a55fe02f3267dc295b001f88df595e649c1fd31 | [
"MIT"
] | null | null | null | project_1/src/losses/__init__.py | kkaryl/AI6126-Advanced_Computer_Vision | 6a55fe02f3267dc295b001f88df595e649c1fd31 | [
"MIT"
] | 2 | 2020-12-28T06:57:56.000Z | 2022-01-15T09:04:53.000Z | from __future__ import absolute_import
from .FocalLoss import *
from .LabelSmoothingCrossEntropy import *
from .MixedUp import * | 25.8 | 41 | 0.829457 | 14 | 129 | 7.285714 | 0.5 | 0.294118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.124031 | 129 | 5 | 42 | 25.8 | 0.902655 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
0bfc3841fd847d82de265f087ef09050f6ce30d3 | 475 | py | Python | kvdroid/jclass/android/view.py | wilsenmuts/Kvdroid | 9ab29c54e761ce4cfaa9d8f847257c4a975fbe0f | [
"MIT"
] | 27 | 2021-03-09T21:39:43.000Z | 2022-01-25T22:55:34.000Z | kvdroid/jclass/android/view.py | kengoon/Kvdroid | a47ab614079b70f81031c2e16a2a04fba1d39677 | [
"MIT"
] | 10 | 2021-03-22T20:38:17.000Z | 2021-12-23T21:06:40.000Z | kvdroid/jclass/android/view.py | kengoon/Kvdroid | a47ab614079b70f81031c2e16a2a04fba1d39677 | [
"MIT"
] | 7 | 2021-03-23T07:55:47.000Z | 2021-12-17T09:32:35.000Z | from jnius import autoclass
from kvdroid.jclass import _class_call
def View(*args, instantiate: bool = False):
return _class_call(autoclass('android.view.View'), args, instantiate)
def WindowManager(*args, instantiate: bool = False):
return _class_call(autoclass("android.view.WindowManager"), args, instantiate)
def LayoutParams(*args, instantiate: bool = False):
return _class_call(autoclass("android.view.WindowManager$LayoutParams"), args, instantiate)
| 31.666667 | 95 | 0.770526 | 56 | 475 | 6.392857 | 0.321429 | 0.251397 | 0.159218 | 0.201117 | 0.567039 | 0.567039 | 0.567039 | 0.567039 | 0.567039 | 0.567039 | 0 | 0 | 0.117895 | 475 | 14 | 96 | 33.928571 | 0.854415 | 0 | 0 | 0 | 0 | 0 | 0.172632 | 0.136842 | 0 | 0 | 0 | 0 | 0 | 1 | 0.375 | true | 0 | 0.25 | 0.375 | 1 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 6 |
041f5563f5f49646eda96509e593b5120e3f158f | 6,679 | py | Python | tests/test_audit_trail.py | ihorizonUK/workos-python | 80ec96d9c4ed3f2539946a19ad9c9b59ac6ee023 | [
"MIT"
] | 13 | 2020-03-18T20:38:32.000Z | 2022-03-02T20:23:42.000Z | tests/test_audit_trail.py | ihorizonUK/workos-python | 80ec96d9c4ed3f2539946a19ad9c9b59ac6ee023 | [
"MIT"
] | 71 | 2020-02-27T03:53:40.000Z | 2022-03-11T16:54:14.000Z | tests/test_audit_trail.py | ihorizonUK/workos-python | 80ec96d9c4ed3f2539946a19ad9c9b59ac6ee023 | [
"MIT"
] | 5 | 2020-10-29T22:38:41.000Z | 2022-02-20T21:12:58.000Z | from datetime import datetime
import json
from requests import Response
import pytest
import workos
from workos.audit_trail import AuditTrail
class TestAuditTrail(object):
@pytest.fixture(autouse=True)
def setup(self, set_api_key):
self.audit_trail = AuditTrail()
def test_create_audit_trail_event_succeeds(self, mock_request_method):
event = {
"group": "Terrace House",
"location": "1.1.1.1",
"action": "house.created",
"action_type": "C",
"actor_name": "Daiki Miyagi",
"actor_id": "user_12345",
"target_name": "Ryota Yamasato",
"target_id": "user_67890",
"occurred_at": datetime.now().isoformat(),
"metadata": {"a": "b"},
}
mock_request_method("post", {"success": True}, 200)
response = self.audit_trail.create_event(event)
assert response == True
def test_create_audit_trail_event_fails_with_long_metadata(self):
with pytest.raises(ValueError, match=r"Number of metadata keys exceeds .*"):
metadata = {str(num): num for num in range(51)}
event = {
"group": "Terrace House",
"location": "1.1.1.1",
"action": "house.created",
"action_type": "C",
"actor_name": "Daiki Miyagi",
"actor_id": "user_12345",
"target_name": "Ryota Yamasato",
"target_id": "user_67890",
"occurred_at": datetime.utcnow().isoformat(),
"metadata": metadata,
}
self.audit_trail.create_event(event)
def test_get_events_succeeds(self, mock_request_method):
event = {
"id": "evt_123",
"group": "Terrace House",
"location": "1.1.1.1",
"latitude": None,
"longitude": None,
"action": {
"id": "evt_action_123",
"name": "house.created",
"environment_id": "environment_123",
},
"type": "C",
"actor_name": "Daiki Miyagi",
"actor_id": "user_12345",
"target_name": "Ryota Yamasato",
"target_id": "user_67890",
"occurred_at": datetime.now().isoformat(),
"metadata": {"a": "b"},
}
response = {
"data": [event,],
"listMetadata": {"before": None, "after": None,},
}
mock_request_method("get", response, 200)
events, before, after = self.audit_trail.get_events()
assert events[0].to_dict() == event
def test_get_events_correctly_includes_occured_at_filter(
self, capture_and_mock_request
):
event = {
"id": "evt_123",
"group": "Terrace House",
"location": "1.1.1.1",
"latitude": None,
"longitude": None,
"action": {
"id": "evt_action_123",
"name": "house.created",
"environment_id": "environment_123",
},
"type": "C",
"actor_name": "Daiki Miyagi",
"actor_id": "user_12345",
"target_name": "Ryota Yamasato",
"target_id": "user_67890",
"occurred_at": datetime.now().isoformat(),
"metadata": {"a": "b"},
}
response = {
"data": [event,],
"listMetadata": {"before": None, "after": None,},
}
request_args, request_kwargs = capture_and_mock_request("get", response, 200)
self.audit_trail.get_events(
occurred_at=datetime.now(),
occurred_at_gte=datetime.now(),
occurred_at_gt=datetime.now(),
occurred_at_lte=datetime.now,
occurred_at_lt=datetime.now(),
)
request_params = request_kwargs["params"]
assert "occurred_at" in request_params
assert "occurred_at_gte" not in request_params
assert "occurred_at_gt" not in request_params
assert "occurred_at_lte" not in request_params
assert "occurred_at_lt" not in request_params
def test_get_events_correctly_includes_occurred_at_gte(
self, capture_and_mock_request
):
event = {
"id": "evt_123",
"group": "Terrace House",
"location": "1.1.1.1",
"latitude": None,
"longitude": None,
"action": {
"id": "evt_action_123",
"name": "house.created",
"environment_id": "environment_123",
},
"type": "C",
"actor_name": "Daiki Miyagi",
"actor_id": "user_12345",
"target_name": "Ryota Yamasato",
"target_id": "user_67890",
"occurred_at": datetime.now().isoformat(),
"metadata": {"a": "b"},
}
response = {
"data": [event,],
"listMetadata": {"before": None, "after": None,},
}
request_args, request_kwargs = capture_and_mock_request("get", response, 200)
self.audit_trail.get_events(
occurred_at_gte=datetime.now(), occurred_at_gt=datetime.now(),
)
request_params = request_kwargs["params"]
assert "occurred_at_gte" in request_params
assert "occurred_at_gt" not in request_params
def test_get_events_correctly_includes_occured_at_lte(
self, capture_and_mock_request
):
event = {
"id": "evt_123",
"group": "Terrace House",
"location": "1.1.1.1",
"latitude": None,
"longitude": None,
"action": {
"id": "evt_action_123",
"name": "house.created",
"environment_id": "environment_123",
},
"type": "C",
"actor_name": "Daiki Miyagi",
"actor_id": "user_12345",
"target_name": "Ryota Yamasato",
"target_id": "user_67890",
"occurred_at": datetime.now().isoformat(),
"metadata": {"a": "b"},
}
response = {
"data": [event,],
"listMetadata": {"before": None, "after": None,},
}
request_args, request_kwargs = capture_and_mock_request("get", response, 200)
self.audit_trail.get_events(
occurred_at_lte=datetime.now, occurred_at_lt=datetime.now()
)
request_params = request_kwargs["params"]
assert "occurred_at_lte" in request_params
assert "occurred_at_lt" not in request_params
| 33.732323 | 85 | 0.527324 | 673 | 6,679 | 4.937593 | 0.160475 | 0.075233 | 0.010834 | 0.059585 | 0.842311 | 0.825459 | 0.763768 | 0.757147 | 0.7418 | 0.7418 | 0 | 0.031335 | 0.34062 | 6,679 | 197 | 86 | 33.903553 | 0.723206 | 0 | 0 | 0.68 | 0 | 0 | 0.238658 | 0 | 0 | 0 | 0 | 0 | 0.062857 | 1 | 0.04 | false | 0 | 0.034286 | 0 | 0.08 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
044835ee8abb157b923ec58c83562a59170f602f | 109 | py | Python | examples/test_peripheral_turtle.py | maxtrussell/python-computer-craft | 9e318d2a0d368faf7a5c2a91e750fe8008aa9b81 | [
"MIT"
] | 42 | 2016-12-17T21:26:34.000Z | 2022-03-30T06:16:34.000Z | examples/test_peripheral_turtle.py | maxtrussell/python-computer-craft | 9e318d2a0d368faf7a5c2a91e750fe8008aa9b81 | [
"MIT"
] | 9 | 2018-02-21T22:44:18.000Z | 2022-03-14T04:14:02.000Z | examples/test_peripheral_turtle.py | maxtrussell/python-computer-craft | 9e318d2a0d368faf7a5c2a91e750fe8008aa9b81 | [
"MIT"
] | 7 | 2018-04-02T09:08:29.000Z | 2022-03-31T15:19:02.000Z | from cc import import_file
_lib = import_file('_lib.py', __file__)
_lib._computer_peri('turtle', 'turtle')
| 18.166667 | 39 | 0.752294 | 16 | 109 | 4.4375 | 0.5625 | 0.295775 | 0.366197 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.110092 | 109 | 5 | 40 | 21.8 | 0.731959 | 0 | 0 | 0 | 0 | 0 | 0.174312 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
04502fb41f6c41e50555ae4a5aa4b31fb1099a4f | 11,406 | py | Python | GENBOT/webhook/Request.py | Snd18/GENBOT_public | a60f69749ffdf43b9b688153d5c4a3488b3a9396 | [
"Apache-2.0"
] | null | null | null | GENBOT/webhook/Request.py | Snd18/GENBOT_public | a60f69749ffdf43b9b688153d5c4a3488b3a9396 | [
"Apache-2.0"
] | null | null | null | GENBOT/webhook/Request.py | Snd18/GENBOT_public | a60f69749ffdf43b9b688153d5c4a3488b3a9396 | [
"Apache-2.0"
] | null | null | null |
class Request():
def __init__(self, req):
self.req = req
@property
def req(self):
return self.__req
@property
def columns_select(self):
return self.__getColumnsSelect()
@property
def fieldMap(self):
return self.__getFieldMap()
@property
def valueMap(self):
return self.__getValueMap()
@property
def lat(self):
return self.__getLat()
@property
def long(self):
return self.__getLon()
@property
def extrainfo(self):
return self.__getExtrainfo()
@property
def command(self):
return self.__getComand()
@property
def intent(self):
return self.__getIntentName()
@property
def typeSimpleGraph(self):
return self.__getTypeSimpleGraph()
@property
def typeComplexGraph(self):
return self.__getTypeComplexGraph()
@property
def user(self):
return self.__getUser()
@property
def parameters(self):
return self.__getParameters()
@property
def idFromReq(self):
return self.__getIdFromReq()
@property
def tablename(self):
return self.__getTableName()
@property
def databasename(self):
return self.__getDatabaseName()
@property
def simpleGrapField(self):
return self.__getSimpleGrapField()
@property
def graphFields(self):
return self.__getGraphFields()
@req.setter
def req(self, req):
self.__req = req
def __getFieldMap(self):
'''
Return the value of map field.
'''
value = None
if self.req.get('queryResult').get('parameters').get('fieldname'):
value = self.req.get('queryResult').get('parameters').get('fieldname')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('fieldname'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('fieldname')
return value
def __getColumnsSelect(self):
'''
Return columns select values
'''
value = None
if self.req.get('queryResult').get('parameters').get('columns_select'):
value = self.req.get('queryResult').get('parameters').get('columns_select')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('columns_select'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('columns_select')
return value
def __getValueMap(self):
'''
Return the value of map field.
'''
value = None
if self.req.get('queryResult').get('parameters').get('valueMap'):
value = self.req.get('queryResult').get('parameters').get('valueMap')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('valueMap'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('valueMap')
return value
def __getLat(self):
'''
Return the value of map field.
'''
value = None
if self.req.get('queryResult').get('parameters').get('latitude'):
value = self.req.get('queryResult').get('parameters').get('latitude')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('latitude'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('latitude')
return value
def __getLon(self):
'''
Return the value of map field.
'''
value = None
if self.req.get('queryResult').get('parameters').get('longitude'):
value = self.req.get('queryResult').get('parameters').get('longitude')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('longitude'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('longitude')
return value
def __getExtrainfo(self):
'''
Return the value of map field.
'''
value = None
if self.req.get('queryResult').get('parameters').get('extraInfo'):
value = self.req.get('queryResult').get('parameters').get('extraInfo')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('extraInfo'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('extraInfo')
return value
def __getComand(self):
'''
Return the command from request.
'''
value = None
if self.req.get('queryResult').get('parameters').get('commands'):
value = self.req.get('queryResult').get('parameters').get('commands')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('commands'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('commands')
return value
def __getIntentName(self):
'''
Return the name of intent from request.
'''
value = None
if self.req.get('queryResult').get('intent').get('displayName'):
value = self.req.get('queryResult').get('intent').get('displayName')
return value
def __getTypeSimpleGraph(self):
'''
Return the type of one var graph.
'''
value = None
if self.req.get('queryResult').get('parameters').get('simple_graph'):
value = self.req.get('queryResult').get('parameters').get('simple_graph')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('simple_graph'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('simple_graph')
return value
def __getTypeComplexGraph(self):
'''
Return the type of two var graph.
'''
value = None
if self.req.get('queryResult').get('parameters').get('complex_graph'):
value = self.req.get('queryResult').get('parameters').get('complex_graph')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('complex_graph'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('complex_graph')
return value
def __getUser(self):
value = 'dialogflow'
if self.req.get('originalDetectIntentRequest').get('payload').get('data').get('from'):
value = self.req.get('originalDetectIntentRequest').get('payload').get('data').get('from').get('username')
elif self.req.get('originalDetectIntentRequest').get('payload').get('callback_query'):
value = self.req.get('originalDetectIntentRequest').get('payload').get('callback_query').get('from').get('username')
elif self.req.get('originalDetectIntentRequest').get('payload').get('data').get('callback_query').get('from').get('username'):
value = self.req.get('originalDetectIntentRequest').get('payload').get('data').get('callback_query').get('from').get('username')
return value
def __getParameters(self):
'''
Return the parameters from request.
'''
value = None
if self.req['queryResult']['parameters']:
value = self.req['queryResult']['parameters']
return value
def __getIdFromReq(self):
'''
Return the image id from request.
'''
value = None
if self.req.get('queryResult').get('parameters').get('idImage'):
value = str(int(self.req.get('queryResult').get('parameters').get('idImage')))
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('idImage'):
value = str(int(self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('idImage')))
return value
def __getTableName(self):
'''
Return the table name from request.
'''
value = None
if self.req.get('queryResult').get('parameters').get('tablename'):
value = self.req.get('queryResult').get('parameters').get('tablename')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('tablename'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('tablename')
return value
def __getDatabaseName(self):
'''
Return the database name from request.
'''
value = None
if self.req.get('queryResult').get('parameters').get('databasename'):
value = self.req.get('queryResult').get('parameters').get('databasename')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('databasename'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('databasename')
return value
def __getSimpleGrapField(self):
'''
Return the field to make the graph with one variable.
'''
value = None
if self.req.get('queryResult').get('parameters').get('columns_select'):
value = self.req.get('queryResult').get('parameters').get('columns_select')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('columns_select'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('columns_select')
return value
def __getGraphFields(self):
'''
Return the field2 to make the graph.
'''
value = None
if self.req.get('queryResult').get('parameters').get('columns_select'):
value = self.req.get('queryResult').get('parameters').get('columns_select')
else:
if self.req.get('queryResult').get('outputContexts'):
if self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('columns_select'):
value = self.req.get('queryResult').get('outputContexts')[0].get('parameters').get('columns_select')
return value
| 38.664407 | 140 | 0.589076 | 1,196 | 11,406 | 5.533445 | 0.076087 | 0.089906 | 0.11786 | 0.228468 | 0.760653 | 0.749773 | 0.749018 | 0.744636 | 0.704594 | 0.687217 | 0 | 0.003376 | 0.246888 | 11,406 | 294 | 141 | 38.795918 | 0.767055 | 0.049097 | 0 | 0.443902 | 0 | 0 | 0.280477 | 0.015465 | 0 | 0 | 0 | 0 | 0 | 1 | 0.180488 | false | 0 | 0 | 0.087805 | 0.356098 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
045d95a1b6ebd0202406653c55b86793ab6bb498 | 171 | py | Python | diysite/main/views.py | NicoleMulela/diy-home-supply | 79b160e5e057ba73214d48819efe3affb7e0ef3b | [
"MIT"
] | null | null | null | diysite/main/views.py | NicoleMulela/diy-home-supply | 79b160e5e057ba73214d48819efe3affb7e0ef3b | [
"MIT"
] | null | null | null | diysite/main/views.py | NicoleMulela/diy-home-supply | 79b160e5e057ba73214d48819efe3affb7e0ef3b | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(response):
return render(response, "main/home.html",{})
| 21.375 | 48 | 0.760234 | 23 | 171 | 5.652174 | 0.782609 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.140351 | 171 | 7 | 49 | 24.428571 | 0.884354 | 0.134503 | 0 | 0 | 0 | 0 | 0.096552 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.5 | 0.25 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 6 |
f08e256ec8b252c9572fccebd7af70efc403151b | 62 | py | Python | Trial.py | ShuhaoZQGG/Python-Very-Beginner-to-Very-Intermediate | cfad98b1c1c175761d3a68861438562f7d410cb0 | [
"MIT"
] | null | null | null | Trial.py | ShuhaoZQGG/Python-Very-Beginner-to-Very-Intermediate | cfad98b1c1c175761d3a68861438562f7d410cb0 | [
"MIT"
] | null | null | null | Trial.py | ShuhaoZQGG/Python-Very-Beginner-to-Very-Intermediate | cfad98b1c1c175761d3a68861438562f7d410cb0 | [
"MIT"
] | null | null | null | myset = {-124,12,51,32,-1000}
print(myset.pop())
print(myset)
| 15.5 | 29 | 0.66129 | 11 | 62 | 3.727273 | 0.727273 | 0.487805 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.22807 | 0.080645 | 62 | 3 | 30 | 20.666667 | 0.491228 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.666667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 6 |
f0e2547f9f075edc53a01559eb94bd0d5ef7c25d | 122 | py | Python | src/14/testing_output_sent_to_stdout/mymodule.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 14 | 2017-05-20T04:06:46.000Z | 2022-01-23T06:48:45.000Z | src/14/testing_output_sent_to_stdout/mymodule.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 1 | 2021-06-10T20:17:55.000Z | 2021-06-10T20:17:55.000Z | src/14/testing_output_sent_to_stdout/mymodule.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 15 | 2017-03-29T17:57:33.000Z | 2021-08-24T02:20:08.000Z | # mymodule.py
def urlprint(protocol, host, domain):
url = '{}://{}.{}'.format(protocol, host, domain)
print(url)
| 20.333333 | 53 | 0.606557 | 14 | 122 | 5.285714 | 0.714286 | 0.324324 | 0.486486 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172131 | 122 | 5 | 54 | 24.4 | 0.732673 | 0.090164 | 0 | 0 | 0 | 0 | 0.091743 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.333333 | 0.666667 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 6 |
9bcdd546302fb7b8945c3e8d6eb15b6fe444e032 | 57 | py | Python | cortex/server/__init__.py | chib0/asd-winter2019 | c7d95305b1e8b99013fd40da1e7ebe01c2d0102a | [
"Apache-2.0"
] | null | null | null | cortex/server/__init__.py | chib0/asd-winter2019 | c7d95305b1e8b99013fd40da1e7ebe01c2d0102a | [
"Apache-2.0"
] | 4 | 2021-02-02T22:38:53.000Z | 2022-01-13T02:32:33.000Z | cortex/server/__init__.py | chib0/asd-winter2019 | c7d95305b1e8b99013fd40da1e7ebe01c2d0102a | [
"Apache-2.0"
] | null | null | null | from .server import get_server, _run_server as run_server | 57 | 57 | 0.859649 | 10 | 57 | 4.5 | 0.6 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 57 | 1 | 57 | 57 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
9be7739adf0be505413e7881d0f615a75e5126cc | 29 | py | Python | autolearn/hyperoptim/__init__.py | dawidkopczyk/autolearn | 1a69c8714faaba02972b2dfabc1b66b2493a2a8f | [
"BSD-3-Clause"
] | 1 | 2018-11-07T15:56:27.000Z | 2018-11-07T15:56:27.000Z | autolearn/hyperoptim/__init__.py | dawidkopczyk/autolearn | 1a69c8714faaba02972b2dfabc1b66b2493a2a8f | [
"BSD-3-Clause"
] | null | null | null | autolearn/hyperoptim/__init__.py | dawidkopczyk/autolearn | 1a69c8714faaba02972b2dfabc1b66b2493a2a8f | [
"BSD-3-Clause"
] | 1 | 2019-04-05T17:17:38.000Z | 2019-04-05T17:17:38.000Z | from .hyperoptimizer import * | 29 | 29 | 0.827586 | 3 | 29 | 8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.103448 | 29 | 1 | 29 | 29 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
aca3b5989160d7f9f5b4a0b95c57bf09af5f442e | 202 | py | Python | cfgov/regulations3k/models/__init__.py | atuggle/cfgov-refresh | 5a9cfd92b460b9be7befb39f5845abf56857aeac | [
"CC0-1.0"
] | null | null | null | cfgov/regulations3k/models/__init__.py | atuggle/cfgov-refresh | 5a9cfd92b460b9be7befb39f5845abf56857aeac | [
"CC0-1.0"
] | null | null | null | cfgov/regulations3k/models/__init__.py | atuggle/cfgov-refresh | 5a9cfd92b460b9be7befb39f5845abf56857aeac | [
"CC0-1.0"
] | null | null | null | # flake8: noqa F401
from regulations3k.models.django import (
EffectiveVersion, Part, Section, Subpart, sortable_label
)
from regulations3k.models.pages import RegulationLandingPage, RegulationPage
| 33.666667 | 76 | 0.821782 | 21 | 202 | 7.857143 | 0.809524 | 0.206061 | 0.278788 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03352 | 0.113861 | 202 | 5 | 77 | 40.4 | 0.888268 | 0.084158 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
acc011b1974664188185485da5414dea34af51d6 | 8,463 | py | Python | web_helper/name_generator/korean_name_generator.py | kittolau/selepy | b1efaa309fb5c43f7b95de17f1d891d5858f36f0 | [
"MIT"
] | null | null | null | web_helper/name_generator/korean_name_generator.py | kittolau/selepy | b1efaa309fb5c43f7b95de17f1d891d5858f36f0 | [
"MIT"
] | null | null | null | web_helper/name_generator/korean_name_generator.py | kittolau/selepy | b1efaa309fb5c43f7b95de17f1d891d5858f36f0 | [
"MIT"
] | null | null | null | from web_helper.name_generator.abstract_name_generator import AbstractNameGenerator
class KoreanNameGenerator(AbstractNameGenerator):
#name pool from http://fantasynamegenerators.com/chinese_names.php
namesMale = ["Bae","Byeong Cheol","Byeong Ho","Byung Chul","Byung Ho","Byung Hoon","Chang Min","Chang Woo","Chi Hun","Chi Won","Chihu","Chihun","Chin Ho","Chong Ho","Chong Hun","Chong Su","Chong Yol","Chul Soo","Chun Ho","Chun Yong","Chung Hee","Chung Ho","Chunho","Chunso","Chunyong","Chuwon","Dae Ho","Dae Hyun","Dae Jung","Dae Won","Do Hyeon","Do Hyun","Do Yeon","Dong Gun","Dong Hyeon","Dong Hyun","Dong Jun","Dong Min","Dong Sun","Dong Wook","Du Ho","Duck Young","Eun Soo","Geon U","Gun","Gyeong Su","Ha Sun","Hae Il","Hae Seong","Hee Chul","Ho Jin","Ho Sung","Hoon","Hyeon Jun","Hyeon U","Hyo","Hyon U","Hyonjun","Hyonu","Hyuk","Hyun","Hyun Jun","Hyun Ki","Hyun Seok","Hyun Shik","Hyun Su","Hyun Woo","Hyung Joon","Il Seong","Il Song","Il Sung","In Ho","In Su","Ja Kyung","Jae","Jae Hui","Jae Hwa","Jae Sun","Jae Wook","Jae Yong","Jeong Ho","Jeong Hun","Jeong Mun","Ji Hae","Ji Hoon","Ji Hu","Ji Hun","Ji Tae","Ji Won","Jin Hee","Jin Ho","Jin Hwan","Jin Sang","Jin Young","Jong Soo","Jong Su","Jong Yeol","Jong Yul","Joo Won","Joon Ho","Ju Won","Jun Ho","Jun Seo","Jun Yeong","Jun Young","Jung","Jung Eun","Jung Hee","Jung Ho","Jung Hoon","Jung Hwa","Jung Hwan","Jung Min","Jung Nam","Jung Su","Jung Woo","Kang Dae","Ki Nam","Konu","Kun Woo","Kwan","Kwang","Kwang Ho","Kwang Hoon","Kwang Hyok","Kwang Hyun","Kwang Jo","Kwang Min","Kwang Seok","Kwang Seon","Kwang Su","Kwang Sun ","Kyong Su","Kyu Bok","Kyu Bong","Kyung","Kyung Gu","Kyung Ho","Kyung Jae","Kyung Min","Kyung Mo","Kyung Sam","Kyung Soo","Min Gyu","Min Ho","Min Hyuk","Min Jae","Min Jun","Min Ki","Min Kyu","Min Kyung","Min Soo","Min Su","Min'gyu","Minjae","Minjun","Minsu","Mun Hee","Myung Dae","Myung Hee","Myung Ki","Nam Gi","Nam Il","Nam Kyu","Nam Seon","Nam Sun","Pyong Chol","Pyong Ho","Sang Chol","Sang Chul","Sang Hoon","Sang Hun","Sang Jun","Sang Ki","Sang Kyu","Sang Min","Se Yeon","Se Yoon","Seo Jun","Seon","Seong","Seong Gi","Seong Ho","Seong Hun","Seong Hyeon","Seong Jin","Seong Min","Seong Su","Seung Eun","Seung Gi","Seung Hee","Seung Heon","Seung Ho","Seung Hoon","Seung Hyeon","Seung Hyun","Seung Min","Seung Won","Seung Woo","Shi Won","Shi Woo","Shin","Shin Il","Shin Young","Si U","Si'u","Sochun","Song Gi","Song Ho","Song Hun","Song Jin","Song Min","Song Su","Songhyon","Songmin","Soo Hyun","Soo Yeon","Suk Chul","Sun Woo","Sung Chul","Sung Ho","Sung Hoon","Sung Hyun","Sung Jin","Sung Ki","Sung Min","Sung Nam","Sung Soo","Sunghyon","Tae Hee","Tae Hyun","Tae Won","Tae Woo","Tae Woong","Tae Yeon","Tae Young","Tohyon","Tong Hyon","Tonghyon","U Jin","Ujin","Woo Jin","Woo Sung","Ye Jun","Yejun","Yeon Seok","Yeon Woo","Yeong Cheol","Yeong Gi","Yeong Ho","Yeong Hwan","Yeong Jin","Yeong Sik","Yeong Su","Yo Han","Yong Chol","Yong Gi","Yong Ho","Yong Hwan","Yong Jin","Yong Joon","Yong Sik","Yong Sook","Yong Su","Yong Sun","Young","Young Chul","Young Gi","Young Ho","Young Hwan","Young Il","Young Ja","Young Jae","Young Jin","Young Min","Young Nam","Young Nam ","Young Shik","Young Soo","Young Su"];
namesFemale = ["Ae Ra","Ae Ri","Ae","Ah Hyun","Ah Joong","Ah Ra","Bit Na","Bo Hee","Bo Kyung","Bo Ra","Bo Young","Bo Yun","Ch'un Ja","Chae Young","Chi Hye","Chi U","Chi Un","Chi Yon","Chi Yong","Chi'u","Chi'un","Chihye","Chihyon","Chimin","Chiyong","Chiyun","Chong Hui","Chong Ja","Chong Suk","Chong Sun","Chun Hwa","Chun Ja","Chung Ah","Da Bin","Da Hae","Da Hee","Do Yeon","Doo Na","Eon Jeong","Eul Dong","Eun Ah","Eun Bi","Eun Chae","Eun Gyung","Eun Ha","Eun Hee","Eun Hye","Eun Ji","Eun Jin","Eun Joo","Eun Ju","Eun Jung","Eun Kyeong","Eun Kyung","Eun Seo","Eun Song","Eun Soo","Eun Sook","Eun Young","Eun","Ga In","Ga Yun","Geum Suk","Geun Young","Go Eun","Gri Na","Ha Eun","Ha Na","Ha Neul","Ha Sun","Ha'un","Hae Sook","Hae Young","Han Bi","Han Byul","Hee Ae","Hee Bon","Hee Jin","Hee Ra","Hee Sun","Hee Yun","Hee Yung","Ho Jung","Hwa Young","Hwi Hyang","Hye Bin","Hye Gyo","Hye Ja","Hye Jin","Hye Jung","Hye Kyung","Hye Ok","Hye Rim","Hye Soo","Hye Sook","Hye Sun","Hye Young","Hyejin","Hyo Jin","Hyo Joo","Hyo Ju","Hyo Jung","Hyo Ri","Hyo Rin","Hyon Jong","Hyon Ju","Hyon Suk","Hyun Ah","Hyun Joo","Hyun Ju","Hyun Jung","Hyun Sook","In Hye","In Sook","In Suk","In Young","Ja Hye","Ja Hyun","Ja Kyung","Ja Ok","Jae Yun","Jeong Ja","Ji Ae","Ji Eun","Ji Hae","Ji Hee","Ji Ho","Ji Hye","Ji Hyo","Ji Hyun","Ji Min","Ji Na","Ji Soo","Ji Su","Ji Sun","Ji Won","Ji Woo","Ji Yong","Ji Yoon","Ji Young","Ji Yun","Ji Yung","Jin Hee","Jin Ju","Jin Shil","Jin Young","Jin Yung","Jin","Jiyeon","Joo Eun","Ju Ah","Ju Hee","Ju Hyun","Jung Ah","Jung Ahn","Jung Eum","Jung Eun","Jung Hee","Jung Hwa","Jung Hyun","Jung Ok","Jung Soo","Jung Sook","Jung Soon","Jung Won","Jung Yoon","Jung","Kang Hee","Kyong Hui","Kyong Ja","Kyong Ok","Kyong Suk","Kyu Ri","Kyung Hee","Kyung Ja","Kyung Jin","Kyung Min","Kyung Ok","Kyung Sook","Li Na","Mi Gyong","Mi Hyun","Mi Kyung","Mi Ri","Mi Ryung","Mi So","Mi Sook","Mi Suk","Mi Yeon","Mi Yong","Mi Young","Mi Yun","Mi Yung","Min Ah","Min Hee","Min Ji","Min Joo","Min Ju","Min Jung","Min Kyung","Min Seo","Min Sun","Min Yung","Min","Minji","Minso","Moon Hee","Myong Suk","Myung Hee","Myung Sook","Na Rae","Na Woon","Na Young","Nam Joo","Nam Seon","Nam Sun","Nara","Ok Bin","Ok Sook","Ran","Ri Na","Rim","Ryu Won","Sa Rang","San Ha","Sang Hee","Se Ah","Se Bin","Se Eun","Se Jung","Se Yeon","Seo Hee","Seo Hyeon","Seo Yeon","Seo Yun","Seong Eon","Seong Ja","Seong","Seul Gi","Seul Ki","Seung Eun","Seung Hee","Seung Hyun","Seung Min","Seung Yun","Shi Eun","Shi Won","Shin Ae","Shin Hye","Shin Young","Si Yeon","So Hee","So Hyon","So Ra","So Ri","So Yeon","So Yi","So Young","So Yun","So Yung","Sohyon","Sol Bi","Sol Mi","Son Ha","Son Yong","Song Hee","Soo Ah","Soo Hyun","Soo Jin","Soo Jung","Soo Kyung","Soo Yeon","Sook Ja","Soon Hee","Soon Ja","Soyon","Soyun","Su Bin","Su Hwa","Su Hyun","Su Ji","Su Jin","Su Jung","Su Mi","Su Min","Su Yun","Su Yung","Subin","Suh Hyung","Sujin","Suk Ja","Sulgi","Sun Ah","Sun Hi","Sun Hwa","Sun Ja","Sun Jung","Sun Mi","Sun Young","Sun Yung","Sun","Sung Eun","Sung Ryung","Sung Sook","Sung Yun","Tae Hee","Tae Ran","Tae Yeon","Tae Young","Tae Yun","Tam Hee","Un Gyong","Un Jong","Un Ju","Un Yong","Unji","Unso","Won Sook","Woon Kye","Ye Eun","Ye Hee","Ye Jin","Ye Seul","Ye Won","Ye'un","Yeh Jin","Yeo Jin","Yeo Jung","Yeo Woon","Yeon Hee","Yeon Hong","Yeon Joo","Yeon Seo","Yeon Woo","Yeong Hee","Yeong","Yi Hyun","Yi Jae","Yi Jin","Yi","Yo Won","Yong Hui","Yong Ja","Yong Mi","Yong Suk","Yoo Jin","Yoo Mi","Yoo Ri","Yoo Sun","Yoon Ah","Yoon Hee","Yoon Ji","Yoon Jin","Yoon Jung","Yoon Mi","Yoon Sook","Yoon Young","Young Ae","Young Ah","Young Eun","Young Hee","Young Ja","Young Mi","Young Nam","Young Ok","Young Ran","Young Sook","Yu Jin","Yu Ni","Yu Ri","Yujin","Yun Ji","Yun Ju","Yun Seo","Yun Soo","Yung Hee","Yunso"]
namesFamily = ["Ae","Ah","An","Ch'a","Ch'ae","Ch'ang","Ch'o","Ch'oe","Ch'on","Ch'u","Cha","Chang","Changgok","Che","Chegal","Chi","Chin","Cho","Chom","Chon","Chong","Chu","Chun","Chung","Chup","Chwa","Eoh","Ha","Hae","Hak","Ham","Han","Ho","Hong","Hu","Hung","Hwa","Hwan","Hwang","Hwangbo","Hyon","Hyong","Im","In","Ka","Kae","Kal","Kam","Kan","Kang","Kangjon","Ki","Kil","Kim","Ko","Kok","Kong","Ku","Kuk","Kum","Kun","Kung","Kwak","Kwok","Kwon","Kye","Kyo","Kyon","Kyong","Ma","Mae","Maeng","Man","Mangjol","Mi","Min","Mo","Mok","Muk","Mun","Myo","Myong","Na","Nae","Nam","Namgung","Nan","Nang","No","Noe","Nu","Ogum","Oh","Ok","Om","On","Ong","P'aeng","P'an","P'i","P'il","P'o","P'ung","P'yo","P'yon","P'yong","Pae","Paek","Pak","Pan","Pang","Pi","Pin","Ping","Pok","Pom","Pong","Pu","Pyon","Ra","Ran","Rang","Ri","Rim","Ro","Roe","Ru","Ryang","Ryo","Ryom","Ryon","Ryong","Ryu","Ryuk","Sa","Sagong","Sam","Sang","Si","Sim","Sin","Sip","So","Sobong","Sok","Sol","Somun","Son","Song","Sonu","Sop","Su","Sun","Sung","T'ae","T'ak","T'an","Tae","Tam","Tan","Tang","To","Tokko","Ton","Tong","Tongbang","Tu","Uh","Um","Un","Wang","Wi","Won","Wu","Ya","Yang","Ye","Yi","Yo","Yom","Yon","Yong","Yop","Yu","Yuk","Yun"];
def __init__(self):
super(KoreanNameGenerator, self).__init__()
def getMaleName(self):
return self.nameGen(self.namesMale,self.namesFamily)
def getFemaleName(self):
return self.nameGen(self.namesFemale,self.namesFamily)
| 445.421053 | 3,784 | 0.612667 | 1,506 | 8,463 | 3.434263 | 0.2417 | 0.006187 | 0.007541 | 0.005414 | 0.025135 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.079877 | 8,463 | 18 | 3,785 | 470.166667 | 0.664184 | 0.00768 | 0 | 0 | 0 | 0 | 0.64392 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.090909 | 0.181818 | 0.909091 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 6 |
acc8371c2adb4f090b92e4c0bb6c41d156cdac08 | 5,863 | py | Python | experiment_scripts/mnist_reg.py | chawins/princeton_thesis | 114b1f9bc36742827c2cb285249ca30dba0ae85c | [
"MIT"
] | null | null | null | experiment_scripts/mnist_reg.py | chawins/princeton_thesis | 114b1f9bc36742827c2cb285249ca30dba0ae85c | [
"MIT"
] | null | null | null | experiment_scripts/mnist_reg.py | chawins/princeton_thesis | 114b1f9bc36742827c2cb285249ca30dba0ae85c | [
"MIT"
] | null | null | null | # Specify visible cuda device
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "4"
from parameters import *
from lib.utils import *
from lib.attacks import *
from lib.keras_utils import *
import numpy as np
import tensorflow as tf
x_train, y_train, x_test, y_test = load_dataset_mnist()
y_train_cat = keras.utils.to_categorical(y_train)
y_test_cat = keras.utils.to_categorical(y_test)
path = './tmp/mnist_reg/'
adv_all = []
out_all = []
def experiment(mod):
adv = []
out = []
x_adv = PGD(mod, x_test, y_test, grad_fn=None, norm="inf", n_step=50,
step_size=0.01, target=False, init_rnd=0., early_stop=True, proj='img')
ind = np.argmax(mod.predict(x_adv), axis=1) != y_test
adv.append(np.linalg.norm((x_adv - x_test)[ind].reshape(-1, 784), axis=1))
score = mod.evaluate(x_adv, y_test_cat)[1]
out.append(score)
x_adv = PGD(mod, x_test, y_test, grad_fn=None, norm="inf", n_step=100,
step_size=0.01, target=False, init_rnd=0., early_stop=True, proj='img')
ind = np.argmax(mod.predict(x_adv), axis=1) != y_test
adv.append(np.linalg.norm((x_adv - x_test)[ind].reshape(-1, 784), axis=1))
score = mod.evaluate(x_adv, y_test_cat)[1]
out.append(score)
x_adv = PGD(mod, x_test, y_test, grad_fn=None, norm="2", n_step=50,
step_size=0.1, target=False, init_rnd=0., early_stop=True, proj='img')
ind = np.argmax(mod.predict(x_adv), axis=1) != y_test
adv.append(np.linalg.norm((x_adv - x_test)[ind].reshape(-1, 784), axis=1))
score = mod.evaluate(x_adv, y_test_cat)[1]
out.append(score)
x_adv = PGD(mod, x_test, y_test, grad_fn=None, norm="2", n_step=100,
step_size=0.1, target=False, init_rnd=0., early_stop=True, proj='img')
ind = np.argmax(mod.predict(x_adv), axis=1) != y_test
adv.append(np.linalg.norm((x_adv - x_test)[ind].reshape(-1, 784), axis=1))
score = mod.evaluate(x_adv, y_test_cat)[1]
out.append(score)
adv_all.append(adv)
out_all.append(out)
for reg in ['l2']:
if reg == 'l2':
L = [1e-2, 1e-4, 1e-6]
else:
L = [1e-3, 1e-5, 1e-7]
for lamda in L:
model = build_cnn_mnist(reg=reg, lamda=lamda)
# earlystop = keras.callbacks.EarlyStopping(
# monitor='val_loss', patience=5)
# checkpoint = keras.callbacks.ModelCheckpoint(
# './tmp_reg.h5', save_best_only=True, save_weights_only=True, period=1)
# model.fit(x_train, y_train_cat,
# batch_size=128,
# epochs=100,
# verbose=1,
# callbacks=[earlystop, checkpoint],
# validation_data=(x_test, y_test_cat))
# model.load_weights('./tmp_reg.h5')
# print(model.evaluate(x_train, y_train_cat))
# print(model.evaluate(x_test, y_test_cat))
# model.save_weights('{}weights_0_{}_L{}.h5'.format(path, reg, lamda))
model.load_weights('{}weights_0_{}_L{}.h5'.format(path, reg, lamda))
experiment(model)
model = build_cnn_mnist_2(reg=reg, lamda=lamda)
# earlystop = keras.callbacks.EarlyStopping(
# monitor='val_loss', patience=5)
# checkpoint = keras.callbacks.ModelCheckpoint(
# './tmp_reg.h5', save_best_only=True, save_weights_only=True, period=1)
# model.fit(x_train, y_train_cat,
# batch_size=128,
# epochs=100,
# verbose=1,
# callbacks=[earlystop, checkpoint],
# validation_data=(x_test, y_test_cat))
# model.load_weights('./tmp_reg.h5')
# print(model.evaluate(x_train, y_train_cat))
# print(model.evaluate(x_test, y_test_cat))
# model.save_weights('{}weights_1_{}_L{}.h5'.format(path, reg, lamda))
model.load_weights('{}weights_1_{}_L{}.h5'.format(path, reg, lamda))
experiment(model)
model = build_dnn_mnist(784, 300, 4, reg=reg, lamda=lamda)
# earlystop = keras.callbacks.EarlyStopping(
# monitor='val_loss', patience=5)
# checkpoint = keras.callbacks.ModelCheckpoint(
# './tmp_reg.h5', save_best_only=True, save_weights_only=True, period=1)
# model.fit(x_train, y_train_cat,
# batch_size=128,
# epochs=100,
# verbose=1,
# callbacks=[earlystop, checkpoint],
# validation_data=(x_test, y_test_cat))
# model.load_weights('./tmp_reg.h5')
# print(model.evaluate(x_train, y_train_cat))
# print(model.evaluate(x_test, y_test_cat))
# model.save_weights('{}weights_2_{}_L{}.h5'.format(path, reg, lamda))
model.load_weights('{}weights_2_{}_L{}.h5'.format(path, reg, lamda))
experiment(model)
model = build_dnn_mnist(784, 1200, 6, reg=reg, lamda=lamda)
# earlystop = keras.callbacks.EarlyStopping(
# monitor='val_loss', patience=5)
# checkpoint = keras.callbacks.ModelCheckpoint(
# './tmp_reg.h5', save_best_only=True, save_weights_only=True, period=1)
# model.fit(x_train, y_train_cat,
# batch_size=128,
# epochs=100,
# verbose=1,
# callbacks=[earlystop, checkpoint],
# validation_data=(x_test, y_test_cat))
# model.load_weights('./tmp_reg.h5')
# print(model.evaluate(x_train, y_train_cat))
# print(model.evaluate(x_test, y_test_cat))
# model.save_weights('{}weights_3_{}_L{}.h5'.format(path, reg, lamda))
model.load_weights('{}weights_3_{}_L{}.h5'.format(path, reg, lamda))
experiment(model)
pickle.dump(out_all, open(path + 'adv_acc_4.p', 'wb'))
pickle.dump(adv_all, open(path + 'norm_4.p', 'wb'))
| 39.348993 | 87 | 0.607368 | 836 | 5,863 | 3.996411 | 0.149522 | 0.034421 | 0.023346 | 0.038911 | 0.850644 | 0.850644 | 0.831488 | 0.831488 | 0.826998 | 0.818318 | 0 | 0.033071 | 0.241856 | 5,863 | 148 | 88 | 39.614865 | 0.71856 | 0.403036 | 0 | 0.375 | 0 | 0 | 0.056653 | 0.024404 | 0 | 0 | 0 | 0 | 0 | 1 | 0.015625 | false | 0 | 0.109375 | 0 | 0.125 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
acd659cfde424ffe215734b7a0b60a327443c819 | 93 | py | Python | yo_fluq_ds/_misc/__init__.py | okulovsky/yo_ds | 9e1fa2e7a1b9746c3982afc152c024169fec45ca | [
"MIT"
] | 16 | 2019-09-26T09:05:42.000Z | 2021-02-04T01:39:09.000Z | yo_fluq_ds/_misc/__init__.py | okulovsky/yo_ds | 9e1fa2e7a1b9746c3982afc152c024169fec45ca | [
"MIT"
] | 2 | 2019-10-23T19:01:23.000Z | 2020-06-11T09:08:45.000Z | yo_fluq_ds/_misc/__init__.py | okulovsky/yo_ds | 9e1fa2e7a1b9746c3982afc152c024169fec45ca | [
"MIT"
] | 2 | 2019-09-26T09:05:50.000Z | 2019-10-23T18:46:11.000Z | from yo_fluq._misc import *
from .io import *
from .obj import *
from .ordered_enum import *
| 18.6 | 27 | 0.741935 | 15 | 93 | 4.4 | 0.6 | 0.454545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172043 | 93 | 4 | 28 | 23.25 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
acedcb68082587fca81c04b174e60e636cb380d0 | 683 | py | Python | src/cirrus_ngs/server/Pipelines/util/RestoreBackups.py | ucsd-ccbb/cirrus-ngs | 8f51450b3d971b03d4fd08a1aab11d5a076aa23e | [
"MIT"
] | 8 | 2017-01-20T00:00:45.000Z | 2022-02-11T00:20:45.000Z | src/cirrus_ngs/server/Pipelines/util/RestoreBackups.py | ucsd-ccbb/cirrus-ngs | 8f51450b3d971b03d4fd08a1aab11d5a076aa23e | [
"MIT"
] | 3 | 2018-03-23T19:09:06.000Z | 2018-03-26T19:49:55.000Z | src/cirrus_ngs/server/Pipelines/util/RestoreBackups.py | ucsd-ccbb/cirrus-ngs | 8f51450b3d971b03d4fd08a1aab11d5a076aa23e | [
"MIT"
] | 2 | 2018-03-29T06:24:31.000Z | 2019-04-01T18:34:53.000Z | import os
config_dir = "/shared/workspace/cirrus-ngs/src/cirrus_ngs/server/Pipelines/config"
scripts_dir = "/shared/workspace/cirrus-ngs/src/cirrus_ngs/server/Pipelines/scripts"
for path,dirs,files in os.walk(config_dir):
for curr_file in files:
if curr_file.endswith("BACKUP"):
os.rename("{}/{}".format(path, curr_file), "{}/{}".format(path, os.path.splitext(curr_file)[0]))
for path,dirs,files in os.walk(scripts_dir):
dirs[:] = [d for d in dirs if not d == "deprecated"]
for curr_file in files:
if curr_file.endswith("BACKUP"):
os.rename("{}/{}".format(path, curr_file), "{}/{}".format(path, os.path.splitext(curr_file)[0]))
| 42.6875 | 108 | 0.667643 | 102 | 683 | 4.333333 | 0.294118 | 0.144796 | 0.081448 | 0.108597 | 0.809955 | 0.809955 | 0.809955 | 0.701357 | 0.701357 | 0.701357 | 0 | 0.003448 | 0.150805 | 683 | 15 | 109 | 45.533333 | 0.758621 | 0 | 0 | 0.5 | 0 | 0 | 0.259151 | 0.197657 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.083333 | 0 | 0.083333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
4a03351542876f06426dc30d162b79b726e7e774 | 334,235 | py | Python | code/plyj/parsetab.py | jmflorezff/cs-6301 | 89fe2668af3911f3a112adfdd46a5b649c62ec61 | [
"MIT"
] | null | null | null | code/plyj/parsetab.py | jmflorezff/cs-6301 | 89fe2668af3911f3a112adfdd46a5b649c62ec61 | [
"MIT"
] | null | null | null | code/plyj/parsetab.py | jmflorezff/cs-6301 | 89fe2668af3911f3a112adfdd46a5b649c62ec61 | [
"MIT"
] | 1 | 2021-08-17T09:16:17.000Z | 2021-08-17T09:16:17.000Z |
# parsetab.py
# This file is automatically generated. Do not edit.
_tabversion = '3.8'
_lr_method = 'LALR'
_lr_signature = '8671335849935BC5A722EAB243FC04C0'
_lr_action_items = {'?':([12,31,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,107,112,133,134,135,136,137,138,139,141,142,143,145,146,148,150,151,152,156,159,160,161,162,163,164,165,168,213,216,219,221,230,231,238,239,240,241,242,245,246,247,248,250,251,253,256,258,259,260,261,262,263,264,265,277,291,292,300,302,303,308,318,336,345,349,362,366,368,369,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,597,598,602,604,605,619,623,625,626,631,633,634,635,636,637,638,639,640,641,642,643,644,646,649,650,653,656,657,658,659,660,661,662,663,664,665,692,703,730,731,732,733,734,735,736,737,739,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,777,804,805,809,811,813,818,819,820,821,838,843,844,845,846,848,851,855,942,945,946,947,948,959,961,964,967,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1114,1115,1117,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1149,1155,],[-345,-380,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,297,-381,-140,-108,-25,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,364,-119,-111,-130,-58,-30,-40,-50,-129,-45,-122,-35,-343,-383,-117,-119,297,-385,-113,-27,-68,-100,507,-112,509,-37,-60,-123,-131,-133,-47,-42,-132,-81,-53,-32,-126,-116,-91,-118,-156,-155,-398,-392,-399,-391,-389,-134,-135,-120,-109,509,-110,-121,-131,-132,509,-133,-341,-388,-387,509,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,297,-417,-418,817,-400,-384,-335,-339,-340,-152,-31,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-26,-145,297,-64,-67,-65,-66,-36,-46,-59,-52,-51,-41,-145,-466,-33,-71,-86,-84,-82,-69,-73,-75,-28,-44,-85,-106,-39,-55,-95,-87,-29,-93,-70,-72,-83,-102,-34,-74,-49,-76,-61,-104,-57,-43,-54,-56,-48,-92,-94,-62,-38,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-402,-405,-401,-404,-390,-338,-333,-336,-334,-151,-162,-128,817,-421,-422,1042,-406,-623,-337,-163,-159,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-426,-425,1042,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-161,-321,]),'CLASS':([1,4,6,7,8,9,10,18,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,71,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,176,178,179,180,181,182,183,185,186,187,188,190,204,205,207,213,218,226,227,228,229,232,233,234,236,266,271,286,289,311,328,347,360,381,382,383,386,387,388,391,394,405,406,438,439,440,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,465,466,467,468,469,470,471,473,474,475,477,478,479,482,483,484,485,488,514,549,551,559,579,588,594,611,612,614,615,628,630,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,725,783,831,833,834,835,858,862,872,878,906,909,916,917,925,941,953,956,962,969,973,975,976,1000,1007,1011,1015,1016,1018,1063,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[-623,-623,-186,-204,-194,-187,-361,201,-623,-594,-351,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-352,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,-623,-610,-608,-362,-352,-623,-618,-611,-451,-612,-623,-613,-450,-447,-351,-205,-167,-352,-623,-343,-354,-508,-623,-623,-452,-623,-553,-529,-249,-175,-279,-277,586,-286,-588,631,586,-623,-623,-351,-609,-623,-619,-605,-281,-164,-168,-525,-519,-524,-352,-521,201,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,201,-481,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-567,201,-566,-623,-623,586,-283,-280,-260,-278,-344,805,-290,-287,-284,-623,-228,848,-623,-614,-587,-595,-516,-503,-520,-466,-470,-502,-623,-484,-483,-559,-563,-564,-533,586,-285,-288,-296,-289,-616,-263,-231,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,-623,-482,-500,-535,-309,-310,586,-617,-276,-274,-265,-623,-272,-266,-623,-232,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'RSHIFT':([12,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,163,165,213,219,221,231,238,240,241,245,246,250,251,253,259,260,263,264,265,277,291,292,299,300,302,303,304,308,318,336,345,349,362,366,368,369,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,598,602,605,623,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,692,703,731,732,733,734,735,736,737,742,743,746,747,749,750,751,752,753,755,757,759,765,766,769,770,771,772,773,777,804,805,809,811,813,815,817,818,819,820,821,822,823,838,843,844,845,846,848,851,855,945,946,948,959,961,964,967,992,993,1020,1022,1030,1036,1037,1038,1039,1040,1041,1042,1043,1045,1046,1047,1048,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1142,1143,1144,1145,1146,1148,1149,1155,],[-345,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,-140,-108,-343,-88,355,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,-129,-122,-343,-117,-119,-385,-113,502,-100,-112,511,-123,-131,-133,-132,-81,-126,-116,-91,-118,-156,-155,-381,-398,-392,-399,-383,-391,-389,-134,-135,-120,-109,511,-110,-121,-131,-132,511,-133,-341,-388,-387,511,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,-417,-418,-400,-335,-339,-340,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,355,355,355,355,-145,-466,355,-86,-84,-82,355,355,355,-85,-106,-95,-87,-93,355,355,-83,-102,355,355,-104,-92,-94,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-384,945,-402,-405,-401,-404,-380,948,-390,-338,-333,-336,-334,-151,-162,-128,-421,-422,-406,-623,-337,-163,-159,-217,-216,-227,-226,-225,-403,948,-423,948,-424,948,945,-407,-408,-410,-411,948,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,948,-428,948,-409,948,-324,-161,-321,]),'THIS':([1,2,6,7,8,9,11,16,20,25,30,37,40,45,47,49,53,58,59,60,61,64,65,69,73,76,77,79,82,84,88,91,92,93,95,98,99,110,122,127,132,147,154,155,157,190,194,203,204,207,208,220,226,229,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,288,289,290,294,295,300,302,303,308,311,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,360,364,365,370,371,372,373,374,375,377,378,380,394,405,406,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,549,551,552,553,559,560,579,584,590,598,602,605,611,612,614,615,621,624,628,650,653,671,677,685,687,692,700,703,709,713,725,729,776,783,784,785,786,790,791,792,798,799,800,807,809,811,813,818,819,820,821,831,833,834,835,836,841,849,850,852,857,862,872,874,878,882,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,945,946,948,951,953,956,958,962,965,973,975,976,977,983,984,986,987,988,991,1011,1015,1016,1018,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1080,1092,1101,1102,1108,1109,1114,1115,1118,1120,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[70,133,-186,-204,-194,-187,70,133,70,133,-170,70,133,-206,-262,-203,-193,133,-192,-174,-202,-189,274,-172,133,-171,133,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,133,133,133,133,133,-205,133,133,-167,70,133,133,-508,-452,-553,-529,-249,133,133,133,133,-175,133,133,-279,133,133,133,133,-277,581,587,133,133,133,-398,-392,-399,-391,-286,70,-17,-11,-9,-10,133,-18,-12,-15,-8,-19,-16,-14,-13,133,133,133,133,133,133,133,133,133,133,643,133,133,133,133,133,133,133,133,133,133,133,-281,-164,-168,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,643,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,-283,-280,133,133,-260,133,-278,797,802,-417,-418,-400,-290,-287,-284,-623,133,133,-228,133,133,133,70,133,133,133,-516,-466,70,-559,-533,133,133,643,133,133,133,133,133,133,133,133,133,-251,-393,-419,-420,-402,-405,-401,-404,-285,-288,-296,-289,133,133,70,133,133,133,-263,-231,70,-185,133,-536,-534,133,133,-307,-261,133,-308,133,133,133,133,133,133,133,-282,-421,-422,-406,133,-306,-297,133,-234,133,-271,-264,70,133,133,133,70,70,133,133,-535,-309,-310,643,133,133,-403,-423,-424,-407,-408,-410,-411,133,-276,-274,-265,70,-272,-266,70,-232,133,-313,-311,-314,-312,-426,-425,-412,-291,133,-267,-273,70,133,70,70,-315,-317,-318,-316,-427,-428,-409,-236,70,133,70,]),')':([12,13,15,21,23,27,31,32,34,36,38,41,42,43,44,46,48,51,52,55,56,57,62,66,67,72,78,85,86,89,90,96,101,112,117,121,124,128,133,134,135,136,137,138,139,141,142,143,144,145,146,148,150,151,152,153,156,159,160,161,162,163,164,165,167,168,208,210,213,216,219,221,231,238,239,240,241,242,243,244,245,246,247,248,250,251,253,255,256,257,258,259,260,261,262,263,264,265,275,276,277,281,291,292,300,302,303,308,318,321,324,328,336,345,349,362,366,367,368,369,393,404,407,408,410,412,413,414,415,416,417,418,419,420,421,423,425,426,427,431,433,434,441,463,476,480,498,533,534,535,538,552,553,554,555,556,557,558,569,575,585,586,588,592,593,595,596,598,602,605,606,609,619,621,623,625,626,629,631,632,633,634,635,636,637,638,639,640,641,642,643,644,646,649,650,651,652,654,655,656,657,658,659,660,661,662,663,664,665,679,682,684,688,689,692,694,695,696,697,703,707,712,729,730,731,732,733,734,735,736,737,739,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,777,786,790,791,792,798,799,800,804,805,809,811,813,818,819,820,821,824,825,827,836,838,839,840,841,843,844,845,846,848,851,853,855,861,881,883,885,886,899,910,915,920,923,924,927,928,929,930,932,933,934,935,936,937,938,939,940,945,946,948,950,954,957,958,959,960,961,963,964,966,967,990,992,993,994,996,999,1002,1009,1013,1014,1019,1020,1021,1022,1025,1026,1027,1028,1029,1030,1033,1034,1035,1036,1038,1040,1043,1045,1046,1047,1049,1055,1056,1057,1058,1059,1060,1061,1062,1078,1082,1083,1085,1087,1095,1096,1097,1098,1099,1100,1103,1104,1105,1110,1114,1115,1118,1119,1121,1123,1124,1125,1135,1136,1141,1143,1145,1148,1149,1155,1157,1159,],[-345,-375,-370,-594,-212,-374,-380,-372,-209,-369,-347,-211,-138,-585,-378,-349,-341,-346,-376,-142,-137,-342,-136,-373,-379,-144,-210,-348,-371,-350,-208,-586,-139,-381,-213,-207,-584,-377,-140,-108,-25,-343,-88,-63,-141,-77,-143,-107,-3,-128,-96,-127,-20,-119,-111,-1,-130,-58,-30,-40,-50,-129,-45,-122,-4,-35,-623,-623,-343,-383,-117,-119,-385,-113,-27,-68,-100,-22,-5,-2,-112,512,-37,-60,-123,-131,-133,-6,-47,538,-42,-132,-81,-53,-32,-126,-116,-91,-623,-623,-118,-623,-156,-155,-398,-392,-399,-391,-389,-381,-383,-588,-134,-135,-120,-109,650,-623,-110,-121,672,677,-591,-590,-131,-132,682,-596,-577,-575,-589,684,-133,-574,-576,-341,-153,-154,-182,-388,-387,692,-623,-623,-386,-623,-124,-114,-115,-125,-146,-623,-623,-547,-546,-548,777,778,-242,788,-343,-149,-344,-158,-157,806,807,-417,-418,-400,-623,-301,-384,-623,-335,-339,-340,-7,-152,849,-31,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-26,-145,852,-623,857,-153,-64,-67,-65,-66,-36,-46,-59,-52,-51,-41,-581,-587,-595,-184,-183,-145,-488,895,-490,-489,-466,901,903,-623,-33,-71,-86,-84,-82,-69,-73,-75,-28,-44,-85,-106,-39,-55,-95,-87,-29,-93,-70,-72,-83,-102,-34,-74,-49,-76,-61,-104,-57,-43,-54,-56,-48,-92,-94,-62,-38,-105,-101,-103,-332,-331,913,914,-221,-623,-623,-623,-623,-623,-623,-623,-330,-150,-393,-419,-420,-402,-405,-401,-404,-299,949,-300,-623,-390,-384,959,-623,-338,-333,-336,-334,-151,-162,965,-128,970,-580,-579,-592,-593,-487,1012,-549,-243,1020,-623,1022,1023,1024,-623,-623,-623,-623,1030,1031,1032,-623,-623,-623,-421,-422,-406,-302,1051,1055,-623,-623,1060,-337,-21,-163,-623,-159,-578,-217,-216,-492,-491,-506,-486,-570,-23,-24,-623,-227,1100,-226,1103,-623,1105,1106,1107,-225,1110,1111,1112,-403,-423,-424,-407,-408,-410,-411,-304,-623,1124,-326,-327,-320,-623,-160,1126,1129,1131,-218,-493,-505,-569,-246,-247,1134,-248,-224,-623,1136,-223,-222,-426,-425,-412,-305,-292,-323,-623,-319,-322,-623,-427,-428,-409,-324,-161,-321,-623,1160,]),'NEW':([1,2,6,7,8,9,11,16,20,25,30,37,40,45,47,49,53,58,59,60,61,64,69,73,76,77,79,82,84,88,91,92,93,95,98,99,110,111,122,127,132,147,154,155,157,190,194,203,204,207,208,220,226,229,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,288,289,290,294,295,311,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,360,363,364,365,370,371,372,373,374,375,377,378,380,394,405,406,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,549,551,552,553,559,560,579,611,612,614,615,621,624,628,650,653,671,677,685,687,692,700,703,709,713,725,729,776,780,783,784,785,786,790,791,792,798,799,800,807,831,833,834,835,836,841,849,850,852,857,862,872,874,878,882,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,951,953,956,958,962,965,973,975,976,977,983,984,986,987,988,991,1011,1015,1016,1018,1019,1026,1050,1064,1065,1067,1068,1069,1070,1071,1080,1092,1101,1102,1108,1109,1120,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1154,1156,1157,1160,],[116,158,-186,-204,-194,-187,116,158,116,158,-170,116,158,-206,-262,-203,-193,158,-192,-174,-202,-189,-172,158,-171,158,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,317,-196,-195,158,158,158,158,158,-205,158,158,-167,116,158,158,-508,-452,-553,-529,-249,158,158,158,158,-175,158,158,-279,158,158,116,158,-277,583,-325,158,158,158,-286,116,-17,-11,-9,-10,158,-18,-12,-15,-8,-19,-16,-14,-13,158,158,158,158,158,158,158,158,158,158,-325,583,158,158,158,158,158,158,158,158,158,158,158,-281,-164,-168,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,-325,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,-283,-280,158,158,-260,158,-278,-290,-287,-284,-623,158,158,-228,158,158,158,116,158,158,158,-516,-466,116,-559,-533,158,158,583,-325,116,158,158,158,158,158,158,158,158,-251,-285,-288,-296,-289,158,158,116,158,158,158,-263,-231,116,-185,158,-536,-534,158,158,-307,-261,158,-308,158,158,158,158,158,158,158,-282,158,-306,-297,158,-234,158,-271,-264,116,158,158,116,116,116,158,158,-535,-309,-310,-325,116,158,158,-276,-274,-265,116,-272,-266,116,-232,158,-313,-311,-314,-312,-291,158,-267,-273,116,158,116,116,-315,-317,-318,-316,-236,116,116,116,]),'LTEQ':([12,38,42,46,48,51,55,56,57,62,72,85,89,101,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,159,163,165,219,221,238,240,241,245,246,250,251,253,259,260,263,264,265,277,336,345,349,362,366,368,369,410,412,416,419,423,434,498,533,534,535,538,585,586,588,623,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,692,703,732,733,734,742,743,746,747,749,752,753,759,765,766,769,770,771,772,773,777,804,805,843,844,845,846,848,851,959,961,964,967,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1149,1155,],[-345,-347,-138,-349,-341,-346,-142,-137,-342,-136,-144,-348,-350,-139,-140,-108,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,371,-129,-122,-117,-119,-113,506,-100,-112,528,-123,-131,-133,-132,-81,-126,-116,-91,-118,-134,-135,-120,-109,528,-110,-121,-131,-132,528,-133,-341,528,-124,-114,-115,-125,-146,-343,-149,-344,-335,-339,-340,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,-64,-67,-65,-66,-145,-466,-86,-84,-82,-85,-106,-95,-87,-93,-83,-102,-104,-92,-94,-105,-101,-103,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-162,-623,-337,-163,-159,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-161,-321,]),'ENUM':([1,4,6,7,8,9,10,18,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,71,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,176,178,179,180,181,182,183,185,186,187,188,190,204,205,207,213,218,226,227,228,229,232,233,234,236,266,271,286,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,465,466,467,468,469,470,471,473,474,475,477,478,479,482,483,484,485,488,549,551,559,579,588,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,725,831,833,834,835,858,862,872,878,906,909,916,917,925,941,953,956,962,969,973,975,976,1000,1007,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[-623,-623,-186,-204,-194,-187,-361,200,-623,-594,-351,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-352,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,-623,-610,-608,-362,-352,-623,-618,-611,-451,-612,-623,-613,-450,-447,-351,-205,-167,-352,-623,-343,-354,-508,-623,-623,-452,-623,-553,-529,-249,-175,-279,-277,-286,-588,-623,-623,-351,-609,-623,-619,-605,-281,-164,-168,-525,-519,-524,-352,-521,200,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,200,-481,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-567,200,-566,-623,-623,-283,-280,-260,-278,-344,-290,-287,-284,-623,-228,-623,-614,-587,-595,-516,-503,-520,-466,-470,-502,-623,-484,-483,-559,-563,-564,-533,-285,-288,-296,-289,-616,-263,-231,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,-623,-482,-500,-535,-309,-310,-617,-276,-274,-265,-623,-272,-266,-623,-232,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'CONTINUE':([1,6,7,8,9,11,20,30,37,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,207,226,229,233,234,236,266,271,286,311,330,394,405,406,549,551,559,579,611,612,614,615,628,677,700,703,709,713,725,807,831,833,834,835,849,862,872,874,878,906,909,916,917,925,941,953,956,962,973,975,976,986,987,1011,1015,1016,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[63,-186,-204,-194,-187,63,63,-170,63,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,63,-508,-452,-553,-529,-249,-175,-279,-277,-286,63,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,63,-516,-466,63,-559,-533,-251,-285,-288,-296,-289,63,-263,-231,63,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-271,-264,63,63,63,-535,-309,-310,-276,-274,-265,63,-272,-266,63,-232,-313,-311,-314,-312,-291,-267,-273,63,63,63,-315,-317,-318,-316,-236,63,63,]),'STRING_LITERAL':([1,2,6,7,8,9,11,16,20,25,30,37,40,45,47,49,53,58,59,60,61,64,69,73,76,77,79,82,84,88,91,92,93,95,98,99,110,122,127,132,147,154,155,157,190,194,203,204,207,208,220,226,229,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,311,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,394,405,406,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,549,551,552,553,559,560,579,611,612,614,615,621,624,628,650,653,671,677,685,687,692,700,703,709,713,725,729,776,784,785,786,790,791,792,798,799,800,807,831,833,834,835,836,841,849,850,852,857,862,872,874,878,882,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,951,953,956,958,962,965,973,975,976,977,983,984,986,987,988,991,1011,1015,1016,1019,1026,1050,1064,1065,1067,1068,1069,1070,1071,1080,1092,1101,1102,1108,1109,1120,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1154,1156,1157,1160,],[38,38,-186,-204,-194,-187,38,38,38,38,-170,38,38,-206,-262,-203,-193,38,-192,-174,-202,-189,-172,38,-171,38,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,38,38,38,38,38,-205,38,38,-167,38,38,38,-508,-452,-553,-529,-249,38,38,38,38,-175,38,38,-279,38,38,38,38,-277,38,38,38,-286,38,-17,-11,-9,-10,38,-18,-12,-15,-8,-19,-16,-14,-13,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,-281,-164,-168,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,-283,-280,38,38,-260,38,-278,-290,-287,-284,-623,38,38,-228,38,38,38,38,38,38,38,-516,-466,38,-559,-533,38,38,38,38,38,38,38,38,38,38,38,-251,-285,-288,-296,-289,38,38,38,38,38,38,-263,-231,38,-185,38,-536,-534,38,38,-307,-261,38,-308,38,38,38,38,38,38,38,-282,38,-306,-297,38,-234,38,-271,-264,38,38,38,38,38,38,38,38,-535,-309,-310,38,38,38,-276,-274,-265,38,-272,-266,38,-232,38,-313,-311,-314,-312,-291,38,-267,-273,38,38,38,38,-315,-317,-318,-316,-236,38,38,38,]),'NATIVE':([1,4,6,7,8,9,10,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,178,179,180,181,182,183,185,186,187,188,190,204,207,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,720,725,824,826,831,832,833,834,835,858,862,872,878,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1095,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[10,10,-186,-204,-194,-187,-361,10,-594,10,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,10,-610,-608,-362,10,-618,-611,-451,-612,10,-613,-450,-447,10,-205,-167,10,-343,-354,-508,10,10,-452,10,-553,-529,10,-249,-175,-279,10,-277,10,-286,-588,10,10,10,-609,10,-619,-605,-281,-164,-168,-525,-519,-524,10,-521,-527,-526,-523,-528,10,-522,10,-479,-478,-469,10,-472,-481,10,-480,-476,-475,10,-473,-501,-474,-358,-471,-477,-562,-565,10,-567,-566,10,10,10,-283,-280,-260,10,-278,-344,10,-290,-287,-284,-623,-228,10,-614,-587,-595,-516,-503,-520,-466,-470,-502,10,-484,-483,-559,-563,-564,10,-533,-303,10,-285,10,-288,-296,-289,-616,-263,-231,-185,10,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,10,10,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,10,-272,-266,10,-232,-505,-569,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'DO':([1,6,7,8,9,11,20,30,37,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,207,226,229,233,234,236,266,271,286,311,330,394,405,406,549,551,559,579,611,612,614,615,628,677,700,703,709,713,725,807,831,833,834,835,849,862,872,874,878,906,909,916,917,925,941,953,956,962,973,975,976,986,987,1011,1015,1016,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[11,-186,-204,-194,-187,11,11,-170,11,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,11,-508,-452,-553,-529,-249,-175,-279,-277,-286,11,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,11,-516,-466,11,-559,-533,-251,-285,-288,-296,-289,11,-263,-231,11,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-271,-264,11,11,11,-535,-309,-310,-276,-274,-265,11,-272,-266,11,-232,-313,-311,-314,-312,-291,-267,-273,11,11,11,-315,-317,-318,-316,-236,11,11,]),'^':([12,31,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,112,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,159,161,162,163,164,165,168,213,216,219,221,231,238,240,241,245,246,247,248,250,251,253,256,258,259,260,261,263,264,265,277,291,292,300,302,303,308,318,336,345,349,362,366,368,369,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,598,602,605,619,623,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,660,661,662,663,664,665,692,703,731,732,733,734,735,736,737,741,742,743,744,745,746,747,749,750,751,752,753,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,777,804,805,809,811,813,818,819,820,821,838,843,844,845,846,848,851,855,945,946,948,959,961,964,967,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1149,1155,],[-345,-380,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,-381,-140,-108,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,-58,-40,-50,-129,-45,-122,380,-343,-383,-117,-119,-385,-113,-68,-100,-112,510,532,-60,-123,-131,-133,-47,-42,-132,-81,-53,-126,-116,-91,-118,-156,-155,-398,-392,-399,-391,-389,-134,-135,-120,-109,510,-110,-121,-131,-132,510,-133,-341,-388,-387,510,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,-417,-418,-400,-384,-335,-339,-340,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,-64,-67,-65,-66,380,-46,-59,-52,-51,-41,-145,-466,-71,-86,-84,-82,-69,-73,-75,-44,-85,-106,380,-55,-95,-87,-93,-70,-72,-83,-102,-74,-49,-76,-61,-104,-57,-43,-54,-56,-48,-92,-94,-62,380,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-402,-405,-401,-404,-390,-338,-333,-336,-334,-151,-162,-128,-421,-422,-406,-623,-337,-163,-159,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-161,-321,]),'NAME':([1,2,6,7,8,9,10,11,13,15,16,20,21,22,24,25,27,30,31,32,36,37,40,43,44,45,47,48,49,52,53,57,58,59,60,61,63,64,66,67,68,69,71,73,74,75,76,77,79,82,84,86,87,88,91,92,93,94,95,96,98,99,100,102,104,105,106,107,110,112,113,114,115,116,118,122,124,125,127,128,129,130,131,132,147,154,155,157,158,169,170,175,177,181,184,186,187,190,194,199,200,201,202,203,204,207,208,213,214,215,216,217,218,220,223,226,227,228,229,230,231,232,233,234,235,236,237,249,252,254,266,268,270,271,275,276,279,280,281,285,286,288,289,290,291,292,293,294,295,300,302,303,308,309,311,315,317,318,319,323,327,328,330,331,332,333,334,335,337,338,339,340,341,342,343,344,346,348,350,351,352,353,354,355,356,357,358,359,360,363,364,365,370,371,372,373,374,375,376,377,378,380,384,390,394,396,397,405,406,411,422,424,428,430,431,432,433,438,439,440,441,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,463,465,466,467,468,469,470,471,473,474,475,476,477,478,479,480,482,483,484,485,488,491,494,495,499,500,501,502,503,504,505,506,507,508,509,510,511,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,549,551,552,553,559,560,561,565,566,567,574,579,583,584,585,588,590,592,593,597,598,599,600,602,603,604,605,607,608,611,612,614,615,618,619,620,621,624,628,645,647,650,653,669,671,673,674,675,677,682,683,684,685,687,692,693,697,698,699,700,701,702,703,704,705,706,708,709,710,711,713,714,715,716,717,720,725,729,776,780,782,783,784,785,786,789,790,791,792,794,798,799,800,807,809,811,813,818,819,820,821,824,826,829,831,832,833,834,835,836,838,841,849,850,852,854,857,859,862,864,866,872,874,878,882,893,894,898,899,900,905,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,942,943,944,945,946,947,948,951,953,955,956,958,962,965,973,975,976,977,978,979,981,983,984,986,987,988,991,995,999,1000,1002,1004,1007,1009,1011,1015,1016,1018,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1052,1053,1054,1064,1065,1067,1068,1069,1070,1071,1074,1077,1080,1087,1092,1095,1101,1102,1108,1109,1113,1114,1115,1116,1117,1118,1120,1122,1126,1127,1128,1129,1130,1131,1132,1134,1137,1138,1139,1140,1141,1143,1145,1147,1154,1156,1157,1160,],[68,136,-186,-204,-194,-187,-361,68,-375,-370,136,68,-594,210,213,136,-374,-170,-380,-372,-369,68,136,-585,-378,-206,-262,-341,-203,-376,-193,-342,136,-192,-174,-202,272,-189,-373,-379,-343,-172,-352,136,-363,-365,-171,136,-188,-200,-173,-371,287,-191,-201,-197,-199,-368,-190,-586,-169,-198,-383,-362,-360,-356,-353,213,-185,-381,-357,-355,-366,213,213,-196,-584,-367,-195,-377,-359,-358,-364,136,136,136,136,136,213,-449,-448,-362,213,-451,213,-450,-447,-205,136,395,401,402,403,136,-167,68,136,-343,210,213,-383,-367,-354,136,213,-508,-623,-623,-452,213,-385,-623,-553,-529,-623,-249,136,136,136,136,-175,136,136,-279,136,136,561,573,136,213,-277,580,585,136,-156,-155,-388,136,136,-398,-392,-399,-391,213,-286,213,213,-389,213,213,627,-588,68,-17,-11,-9,-10,136,-18,-12,-15,-8,-19,-16,-14,-13,-387,136,136,136,136,136,136,136,136,640,136,136,585,646,136,136,136,136,136,136,136,136,213,136,136,136,213,213,-281,-439,-430,-164,-168,136,213,210,136,691,-388,213,-387,-525,-519,-524,-623,-352,-521,213,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,705,-481,-623,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-386,-562,-352,-565,-623,-567,705,-566,-623,-623,-351,-352,724,136,136,136,136,136,136,136,136,136,136,136,136,136,136,585,136,136,136,136,136,136,136,136,136,136,136,136,136,136,213,136,136,136,136,136,136,136,136,213,136,136,136,136,-283,-280,136,136,-260,136,-343,781,213,-383,787,-278,213,795,-343,-344,801,-158,-157,213,-417,213,213,-418,213,213,-400,210,213,-290,-287,-284,-623,213,-384,213,136,136,-228,801,795,136,136,213,136,395,-441,213,68,-587,213,-595,136,136,136,213,-352,896,213,-516,-503,-520,-466,-470,-343,900,-502,68,-484,-483,-559,904,900,-563,-564,-623,-533,136,136,580,919,585,561,136,136,213,136,136,136,213,136,136,136,-251,-393,-419,-420,-402,-405,-401,-404,-303,213,210,-285,-623,-288,-296,-289,136,-390,136,68,136,136,213,136,213,-263,-440,-442,-231,68,-185,136,210,-623,1001,-487,-343,1010,-536,-534,136,136,-307,-261,136,-308,136,136,136,136,136,136,136,-282,213,213,213,-421,-422,213,-406,136,-306,213,-297,136,-234,136,-271,-264,68,136,-443,213,-444,136,561,68,68,136,136,210,-506,-482,-486,213,-500,-570,-535,-309,-310,585,561,136,-403,-423,-424,-407,-408,-410,-411,136,210,-294,-293,-276,-274,-265,68,-272,-266,68,-446,-445,-232,-505,136,-569,-313,-311,-314,-312,213,-426,-425,213,213,-412,-291,213,136,-267,-273,68,136,68,213,68,-315,-317,-318,-316,-427,-428,-409,-295,-236,68,561,68,]),'.':([12,13,15,23,27,32,36,38,42,46,48,51,52,55,56,57,62,66,68,70,72,81,85,86,89,97,100,101,112,117,125,128,133,136,139,140,142,145,148,166,192,213,216,231,246,251,291,292,293,299,300,302,303,304,308,321,324,328,346,361,366,367,379,385,389,410,416,423,434,476,512,538,561,563,564,567,573,580,585,586,587,588,589,592,593,598,602,605,619,623,625,626,631,640,643,644,646,650,651,652,655,667,670,692,703,705,772,773,777,804,805,809,811,813,815,818,819,820,821,839,843,844,845,846,848,855,856,900,921,945,946,948,959,961,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1155,],[-345,-375,-370,-143,-374,-372,-369,-347,-138,-349,-341,-346,-376,-142,-137,-342,-136,-373,-343,-140,-144,280,-348,-371,-350,288,289,-139,319,-141,347,-377,-140,-343,-141,357,-143,360,363,347,289,-343,432,-385,514,363,-156,-155,594,603,-398,-392,-399,432,-391,620,432,432,630,594,514,347,630,669,432,363,514,-341,514,-386,-145,-146,-343,780,280,783,-329,-328,-343,-149,-147,-344,-148,-158,-157,-417,-418,-400,432,-335,-339,-340,-152,-329,-147,-148,-328,-145,594,854,630,859,432,-145,-466,-343,-332,-331,-221,-330,-150,-393,-419,-420,432,-402,-405,-401,-404,432,-338,-333,-336,-334,-151,514,347,-343,1018,-421,-422,-406,-623,-337,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-321,]),'/':([12,38,42,46,48,51,55,56,57,62,72,85,89,101,133,134,136,137,139,142,143,145,146,148,151,152,156,163,165,219,221,238,241,245,246,250,251,253,259,263,264,265,277,336,345,349,362,366,368,369,410,412,416,419,423,434,498,533,534,535,538,585,586,588,623,625,626,631,634,635,636,640,641,642,643,644,646,650,692,703,743,746,749,753,759,765,766,769,770,771,772,773,777,804,805,843,844,845,846,848,851,855,959,961,964,967,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1149,1155,],[-345,-347,-138,-349,-341,-346,-142,-137,-342,-136,-144,-348,-350,-139,-140,-108,-343,353,-141,-143,-107,-128,-96,-127,-119,-111,-130,-129,-122,-117,-119,-113,-100,-112,530,-123,-131,-133,-132,-126,-116,546,-118,-134,-135,-120,-109,530,-110,-121,-131,-132,530,-133,-341,530,-124,-114,-115,-125,-146,-343,-149,-344,-335,-339,-340,-152,-99,-97,-98,-329,353,353,-147,-148,-328,-145,-145,-466,-106,353,353,-102,-104,353,353,-105,-101,-103,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-162,-128,-623,-337,-163,-159,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-161,-321,]),'|':([12,13,15,27,31,32,36,38,42,44,46,48,51,52,55,56,57,62,66,67,72,85,86,89,94,101,112,128,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,159,160,161,162,163,164,165,168,213,216,217,219,221,231,238,240,241,245,246,247,248,250,251,253,256,258,259,260,261,262,263,264,265,277,291,292,300,302,303,308,318,336,345,349,362,366,368,369,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,598,602,605,619,623,625,626,631,633,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,660,661,662,663,664,665,692,703,730,731,732,733,734,735,736,737,741,742,743,744,745,746,747,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,777,804,805,809,811,813,818,819,820,821,838,843,844,845,846,848,851,855,945,946,948,959,961,964,967,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1053,1054,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1147,1148,1149,1155,],[-345,-375,-370,-374,-380,-372,-369,-347,-138,-378,-349,-341,-346,-376,-142,-137,-342,-136,-373,-379,-144,-348,-371,-350,-368,-139,-381,-377,-140,-108,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,-58,374,-40,-50,-129,-45,-122,-35,-343,-383,-367,-117,-119,-385,-113,-68,-100,-112,515,-37,-60,-123,-131,-133,-47,-42,-132,-81,-53,543,-126,-116,-91,-118,-156,-155,-398,-392,-399,-391,-389,-134,-135,-120,-109,515,-110,-121,-131,-132,515,-133,-341,-388,-387,515,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,-417,-418,-400,-384,-335,-339,-340,-152,374,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,-64,-67,-65,-66,-36,-46,-59,-52,-51,-41,-145,-466,374,-71,-86,-84,-82,-69,-73,-75,-44,-85,-106,-39,-55,-95,-87,-93,-70,-72,-83,-102,374,-74,-49,-76,-61,-104,-57,-43,-54,-56,-48,-92,-94,-62,-38,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-402,-405,-401,-404,-390,-338,-333,-336,-334,-151,-162,-128,-421,-422,-406,-623,-337,-163,-159,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-294,1122,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-295,-324,-161,-321,]),'CATCH':([310,311,405,612,614,615,833,835,1120,],[613,-286,-164,-287,613,613,-288,613,-291,]),'CHAR':([1,2,6,7,8,9,10,11,16,20,21,24,25,30,37,40,43,45,47,48,49,53,57,58,59,60,61,64,69,71,73,74,75,76,77,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,107,110,113,114,115,116,122,124,127,129,130,131,132,147,154,155,157,158,169,170,175,181,186,187,190,194,203,204,207,208,213,218,220,226,227,228,229,230,232,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,309,311,328,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,394,396,397,405,406,411,428,438,439,440,441,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,463,465,466,467,468,469,470,471,473,474,475,477,478,479,480,482,483,484,485,488,491,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,549,551,552,553,559,560,566,579,588,597,599,600,604,605,608,611,612,614,615,621,624,628,650,653,671,674,675,677,682,684,685,687,692,693,697,699,700,701,702,703,704,706,708,709,710,711,713,715,716,717,725,729,776,784,785,786,790,791,792,798,799,800,807,818,819,820,821,824,826,831,832,833,834,835,836,841,849,850,852,857,862,864,866,872,874,878,882,894,899,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,942,943,944,945,946,947,948,951,953,955,956,958,962,965,973,975,976,977,978,979,981,983,984,986,987,988,991,999,1000,1002,1007,1009,1011,1015,1016,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1074,1077,1080,1087,1092,1095,1101,1102,1108,1109,1113,1114,1115,1116,1117,1118,1120,1122,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[13,13,-186,-204,-194,-187,-361,13,13,13,-594,13,13,-170,13,13,-585,-206,-262,-341,-203,-193,-342,13,-192,-174,-202,-189,-172,-352,13,-363,-365,-171,13,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,13,-185,-357,-355,-366,13,-196,-584,-195,-359,-358,-364,13,13,13,13,13,13,-449,-448,-362,-451,-450,-447,-205,13,13,-167,13,13,-343,-354,13,-508,-623,-623,-452,13,-623,-553,-529,-249,13,13,13,13,-175,13,13,-279,13,13,13,13,-277,13,13,13,13,-286,-588,13,-17,-11,-9,-10,13,-18,-12,-15,-8,-19,-16,-14,-13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,-281,-439,-430,-164,-168,13,13,-525,-519,-524,-623,-352,-521,13,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,13,-481,-623,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-623,-567,13,-566,-623,-623,-351,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,-283,-280,13,13,-260,13,13,-278,-344,13,13,13,13,-400,13,-290,-287,-284,-623,13,13,-228,13,13,13,-441,13,13,-587,-595,13,13,13,13,-352,13,-516,-503,-520,-466,-470,13,-502,13,-484,-483,-559,13,-563,-564,-533,13,13,13,13,13,13,13,13,13,13,13,-251,-402,-405,-401,-404,-303,13,-285,-623,-288,-296,-289,13,13,13,13,13,13,-263,-440,-442,-231,13,-185,13,-623,-487,-536,-534,13,13,-307,-261,13,-308,13,13,13,13,13,13,13,-282,13,13,13,-421,-422,13,-406,13,-306,13,-297,13,-234,13,-271,-264,13,13,-443,13,-444,13,13,13,13,13,13,-506,-482,-486,-500,-570,-535,-309,-310,13,13,-403,-423,-424,-407,-408,-410,-411,13,-276,-274,-265,13,-272,-266,13,-446,-445,-232,-505,13,-569,-313,-311,-314,-312,13,-426,-425,13,13,-412,-291,13,13,-267,-273,13,13,13,13,-315,-317,-318,-316,-427,-428,-409,-236,13,13,13,]),'RRSHIFT':([12,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,163,165,213,219,221,231,238,240,241,245,246,250,251,253,259,260,263,264,265,277,291,292,299,300,302,303,304,308,318,336,345,349,362,366,368,369,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,598,602,605,623,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,692,703,731,732,733,734,735,736,737,742,743,746,747,749,750,751,752,753,755,757,759,765,766,769,770,771,772,773,777,804,805,809,811,813,815,818,819,820,821,822,838,843,844,845,846,848,851,855,945,946,948,959,961,964,967,992,993,1020,1022,1030,1036,1038,1040,1042,1043,1045,1046,1047,1048,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1142,1143,1144,1145,1146,1148,1149,1155,],[-345,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,-140,-108,-343,-88,354,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,-129,-122,-343,-117,-119,-385,-113,501,-100,-112,518,-123,-131,-133,-132,-81,-126,-116,-91,-118,-156,-155,-381,-398,-392,-399,-383,-391,-389,-134,-135,-120,-109,518,-110,-121,-131,-132,518,-133,-341,-388,-387,518,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,-417,-418,-400,-335,-339,-340,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,354,354,354,354,-145,-466,354,-86,-84,-82,354,354,354,-85,-106,-95,-87,-93,354,354,-83,-102,354,354,-104,-92,-94,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-384,-402,-405,-401,-404,-380,-390,-338,-333,-336,-334,-151,-162,-128,-421,-422,-406,-623,-337,-163,-159,-217,-216,-227,-226,-225,-403,-423,-424,1115,-407,-408,-410,-411,1118,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,1118,-428,1118,-409,1118,-324,-161,-321,]),'=':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,210,211,213,246,251,253,259,291,292,336,345,366,423,425,426,427,434,512,538,561,563,567,573,580,585,586,587,588,589,592,593,623,625,626,631,640,643,644,646,650,703,772,773,777,781,804,805,828,843,844,845,846,848,884,896,904,918,919,921,952,959,961,992,993,1017,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,340,-140,-343,-141,-143,-128,-127,340,-130,-129,-128,-623,428,-343,-128,-127,-130,-129,-156,-155,-134,-135,-128,685,-153,-154,-182,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-158,-157,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-623,-330,-150,951,-338,-333,-336,-334,-151,685,-623,-623,-182,-623,-128,1050,-623,-337,-217,-216,-182,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'IMPORT':([4,171,173,174,178,180,182,185,381,386,391,668,858,969,1063,],[177,177,-610,-608,177,-611,-612,-613,177,-609,-605,-614,-616,-615,-617,]),'OR':([12,31,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,112,133,134,135,136,137,138,139,141,142,143,145,146,148,150,151,152,156,159,160,161,162,163,164,165,168,213,216,219,221,231,238,239,240,241,242,245,246,247,248,250,251,253,256,258,259,260,261,262,263,264,265,277,291,292,300,302,303,308,318,336,345,349,362,366,368,369,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,598,602,605,619,623,625,626,631,633,634,635,636,637,638,639,640,641,642,643,644,646,649,650,656,657,658,659,660,661,662,663,664,665,692,703,730,731,732,733,734,735,736,737,739,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,777,804,805,809,811,813,818,819,820,821,838,843,844,845,846,848,851,855,945,946,948,959,961,964,967,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1149,1155,],[-345,-380,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,-381,-140,-108,-25,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,365,-119,-111,-130,-58,-30,-40,-50,-129,-45,-122,-35,-343,-383,-117,-119,-385,-113,-27,-68,-100,508,-112,519,-37,-60,-123,-131,-133,-47,-42,-132,-81,-53,-32,-126,-116,-91,-118,-156,-155,-398,-392,-399,-391,-389,-134,-135,-120,-109,519,-110,-121,-131,-132,519,-133,-341,-388,-387,519,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,-417,-418,-400,-384,-335,-339,-340,-152,-31,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-26,-145,-64,-67,-65,-66,-36,-46,-59,-52,-51,-41,-145,-466,-33,-71,-86,-84,-82,-69,-73,-75,-28,-44,-85,-106,-39,-55,-95,-87,-29,-93,-70,-72,-83,-102,-34,-74,-49,-76,-61,-104,-57,-43,-54,-56,-48,-92,-94,-62,-38,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-402,-405,-401,-404,-390,-338,-333,-336,-334,-151,-162,-128,-421,-422,-406,-623,-337,-163,-159,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-161,-321,]),'SWITCH':([1,6,7,8,9,11,20,30,37,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,207,226,229,233,234,236,266,271,286,311,330,394,405,406,549,551,559,579,611,612,614,615,628,677,700,703,709,713,725,807,831,833,834,835,849,862,872,874,878,906,909,916,917,925,941,953,956,962,973,975,976,986,987,1011,1015,1016,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[14,-186,-204,-194,-187,14,14,-170,14,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,14,-508,-452,-553,-529,-249,-175,-279,-277,-286,14,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,14,-516,-466,14,-559,-533,-251,-285,-288,-296,-289,14,-263,-231,14,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-271,-264,14,14,14,-535,-309,-310,-276,-274,-265,14,-272,-266,14,-232,-313,-311,-314,-312,-291,-267,-273,14,14,14,-315,-317,-318,-316,-236,14,14,]),'*':([0,12,38,42,46,48,51,55,56,57,62,72,85,89,101,133,134,136,137,139,142,143,145,146,148,151,152,156,163,165,219,221,238,241,245,246,250,251,253,259,263,264,265,277,336,345,349,362,366,368,369,410,412,416,419,423,434,498,533,534,535,538,585,586,588,623,625,626,631,634,635,636,640,641,642,643,644,646,650,669,692,703,743,746,749,753,759,765,766,769,770,771,772,773,777,804,805,843,844,845,846,848,851,855,859,959,961,964,967,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1149,1155,],[1,-345,-347,-138,-349,-341,-346,-142,-137,-342,-136,-144,-348,-350,-139,-140,-108,-343,352,-141,-143,-107,-128,-96,-127,-119,-111,-130,-129,-122,-117,-119,-113,-100,-112,524,-123,-131,-133,-132,-126,-116,545,-118,-134,-135,-120,-109,524,-110,-121,-131,-132,524,-133,-341,524,-124,-114,-115,-125,-146,-343,-149,-344,-335,-339,-340,-152,-99,-97,-98,-329,352,352,-147,-148,-328,-145,860,-145,-466,-106,352,352,-102,-104,352,352,-105,-101,-103,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-162,-128,968,-623,-337,-163,-159,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-161,-321,]),'MINUSMINUS':([0,1,2,6,7,8,9,11,12,16,20,23,25,30,37,38,40,41,42,45,46,47,48,49,51,53,55,56,57,58,59,60,61,62,64,68,69,70,72,73,76,77,78,79,82,84,85,88,89,91,92,93,95,97,98,99,100,101,110,117,122,123,127,132,133,136,139,142,145,147,148,151,154,155,156,157,163,190,192,194,203,204,207,208,220,221,226,229,233,234,236,237,246,249,251,252,253,254,259,266,268,270,271,275,276,279,281,286,290,294,295,311,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,348,350,351,352,353,354,355,356,358,359,364,365,366,370,371,372,373,374,375,377,378,380,394,405,406,409,410,411,412,416,419,423,428,434,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,538,539,540,541,543,544,545,546,549,551,552,553,559,560,561,563,567,573,579,580,585,586,587,588,589,611,612,614,615,621,623,624,625,626,628,631,640,643,644,646,650,653,671,677,685,687,692,700,703,709,713,725,729,772,773,776,777,784,785,786,790,791,792,798,799,800,804,805,807,831,833,834,835,836,841,843,844,845,846,848,849,850,855,857,862,872,874,878,882,906,909,911,912,916,917,921,924,925,930,932,933,934,938,939,940,941,951,953,956,958,959,961,962,973,975,976,977,983,984,986,987,988,991,992,993,1011,1015,1016,1019,1020,1022,1026,1030,1050,1055,1057,1058,1059,1060,1064,1065,1067,1068,1069,1070,1071,1080,1083,1092,1100,1101,1102,1103,1105,1108,1109,1110,1120,1123,1124,1125,1127,1128,1129,1130,1131,1134,1135,1136,1137,1138,1139,1140,1148,1154,1155,1156,1157,1160,],[2,73,73,-186,-204,-194,-187,73,-345,73,73,-143,73,-170,73,-347,73,-130,-138,-206,-349,-262,-341,-203,-346,-193,-142,-137,-342,73,-192,-174,-202,-136,-189,-343,-172,-140,-144,73,-171,73,-129,-188,-200,-173,-348,-191,-350,-201,-197,-199,-190,-127,-169,-198,-128,-139,-185,-141,-196,345,-195,73,-140,-343,-141,-143,-128,73,-127,345,73,73,-130,73,-129,-205,-128,73,73,-167,73,73,73,345,-508,-452,-553,-529,-249,73,-128,73,-127,73,-130,73,-129,-175,73,73,-279,73,73,73,73,-277,73,73,73,-286,73,-17,-11,-9,-10,73,-134,-18,-12,-15,-8,-19,-16,-14,-13,-135,73,73,73,73,73,73,73,73,73,73,73,73,-128,73,73,73,73,73,73,73,73,73,-281,-164,-168,345,-127,73,-129,-128,-130,-341,73,-128,73,73,73,73,73,73,73,73,73,73,73,73,73,-145,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,-146,73,73,73,73,73,73,73,-283,-280,73,73,-260,73,-343,-127,-128,-329,-278,-328,-343,-149,-147,-344,-148,-290,-287,-284,-623,73,-335,73,-339,-340,-228,-152,-329,-147,-148,-328,-145,73,73,73,73,73,-145,-516,-466,73,-559,-533,73,-332,-331,73,-221,73,73,73,73,73,73,73,73,73,-330,-150,-251,-285,-288,-296,-289,73,73,-338,-333,-336,-334,-151,73,73,-128,73,-263,-231,73,-185,73,-536,-534,73,73,-307,-261,-128,73,-308,73,73,73,73,73,73,73,-282,73,-306,-297,73,-623,-337,-234,-271,-264,73,73,73,73,73,73,73,73,-217,-216,-535,-309,-310,73,-227,-226,73,-225,73,-623,-326,-327,-320,-623,-276,-274,-265,73,-272,-266,73,-232,-218,73,-224,-313,-311,-623,-223,-314,-312,-222,-291,-323,-623,-319,-267,-273,73,73,73,73,-322,-623,-315,-317,-318,-316,-324,-236,-321,73,73,73,]),':':([12,31,38,42,44,46,48,51,55,56,57,62,67,68,72,85,89,101,103,112,120,133,134,135,136,137,138,139,141,142,143,144,145,146,148,150,151,152,153,156,159,160,161,162,163,164,165,167,168,213,216,219,221,231,277,278,291,292,300,302,303,308,318,336,345,349,362,368,369,425,426,431,433,476,538,585,586,588,592,593,598,602,605,619,623,625,626,629,631,633,634,635,636,637,638,639,640,641,642,643,644,646,648,649,650,656,657,658,659,660,661,662,663,664,665,692,703,738,740,772,773,777,781,804,805,809,811,813,818,819,820,821,838,843,844,845,846,848,851,877,918,919,945,946,948,959,961,963,964,967,971,992,993,1017,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1072,1073,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1149,1155,],[-345,-380,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-230,-144,-348,-350,-139,295,-381,330,-140,-108,-25,-343,-88,-63,-141,-77,-143,-107,-3,-128,-96,-127,-20,-119,-111,-1,-130,-58,-30,-40,-50,-129,-45,-122,-4,-35,-343,-383,-117,-119,-385,-118,560,-156,-155,-398,-392,-399,-391,-389,-134,-135,-120,-109,-110,-121,-153,-154,-388,-387,-386,-146,-343,-149,-344,-158,-157,-417,-418,-400,-384,-335,-339,-340,-7,-152,-31,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,850,-26,-145,-64,-67,-65,-66,-36,-46,-59,-52,-51,-41,-145,-466,911,912,-332,-331,-221,-623,-330,-150,-393,-419,-420,-402,-405,-401,-404,-390,-338,-333,-336,-334,-151,-162,987,-252,-623,-421,-422,-406,-623,-337,-21,-163,-159,1065,-217,-216,-253,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,1128,-275,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-161,-321,]),'~':([2,16,25,40,58,73,77,132,147,154,155,157,194,203,208,220,237,249,252,254,268,270,275,276,281,290,294,295,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,685,687,692,729,776,785,786,790,791,792,798,799,800,836,841,850,852,857,882,911,912,924,930,932,933,934,938,939,940,951,958,965,977,983,988,991,1026,1050,1092,1126,1130,],[132,132,132,237,132,132,132,132,132,237,132,132,132,132,237,237,132,132,132,132,132,132,132,132,132,132,132,132,-17,-11,-9,-10,132,-18,-12,-15,-8,-19,-16,-14,-13,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,237,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,237,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,237,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,237,132,132,]),'RETURN':([1,6,7,8,9,11,20,30,37,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,207,226,229,233,234,236,266,271,286,311,330,394,405,406,549,551,559,579,611,612,614,615,628,677,700,703,709,713,725,807,831,833,834,835,849,862,872,874,878,906,909,916,917,925,941,953,956,962,973,975,976,986,987,1011,1015,1016,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[16,-186,-204,-194,-187,16,16,-170,16,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,16,-508,-452,-553,-529,-249,-175,-279,-277,-286,16,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,16,-516,-466,16,-559,-533,-251,-285,-288,-296,-289,16,-263,-231,16,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-271,-264,16,16,16,-535,-309,-310,-276,-274,-265,16,-272,-266,16,-232,-313,-311,-314,-312,-291,-267,-273,16,16,16,-315,-317,-318,-316,-236,16,16,]),'OR_ASSIGN':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,246,251,253,259,336,345,366,434,512,538,561,563,567,573,580,585,586,587,588,589,623,625,626,631,640,643,644,646,650,703,772,773,777,804,805,843,844,845,846,848,921,959,961,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,337,-140,-343,-141,-143,-128,-127,337,-130,-129,-128,-128,-127,-130,-129,-134,-135,-128,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-128,-623,-337,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'IF':([1,6,7,8,9,11,20,30,37,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,207,226,229,233,234,236,266,271,286,311,330,394,405,406,549,551,559,579,611,612,614,615,628,677,700,703,709,713,725,807,831,833,834,835,849,862,872,874,878,906,909,916,917,925,941,953,956,962,973,975,976,986,987,1011,1015,1016,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[19,-186,-204,-194,-187,19,19,-170,19,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,19,-508,-452,-553,-529,-249,-175,-279,-277,-286,19,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,870,-516,-466,19,-559,-533,-251,-285,-288,-296,-289,19,-263,-231,870,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-271,-264,19,19,870,-535,-309,-310,-276,-274,-265,19,-272,-266,19,-232,-313,-311,-314,-312,-291,-267,-273,870,870,19,-315,-317,-318,-316,-236,870,870,]),'{':([1,6,7,8,9,11,17,20,26,28,29,30,31,33,35,37,45,47,48,49,53,54,57,59,60,61,64,69,76,79,82,83,84,88,91,92,93,95,98,99,108,109,110,119,122,127,190,198,204,207,208,213,222,224,225,226,228,229,231,233,234,236,266,267,271,282,283,284,286,291,292,300,302,303,308,311,312,313,314,316,321,324,329,330,394,396,397,401,402,403,405,406,411,425,426,428,435,436,437,454,455,456,458,460,462,464,465,466,467,469,470,471,472,473,474,475,476,488,489,497,547,549,551,559,576,577,578,579,588,592,593,598,602,605,611,612,614,615,616,623,625,626,627,628,672,674,676,677,685,687,691,700,701,703,704,708,709,710,711,713,724,725,726,727,728,806,807,809,811,813,818,819,820,821,830,831,833,834,835,839,843,845,847,849,862,864,866,872,874,878,882,892,895,901,906,909,916,917,925,926,941,945,946,948,949,951,953,956,959,961,962,973,975,976,978,981,986,987,991,997,998,1000,1003,1005,1006,1007,1011,1012,1015,1016,1036,1038,1040,1043,1045,1046,1047,1050,1051,1055,1060,1064,1065,1067,1068,1069,1070,1071,1074,1077,1080,1086,1088,1089,1090,1092,1101,1102,1103,1108,1109,1114,1115,1118,1120,1124,1127,1128,1129,1131,1134,1136,1137,1138,1139,1140,1141,1143,1145,1153,1154,1156,1160,],[20,-186,-204,-194,-187,20,-455,20,-623,227,228,-170,-380,232,235,20,-206,-262,-341,-203,-193,-623,-342,-192,-174,-202,-189,-172,-171,-188,-200,-623,-173,-191,-201,-197,-199,-190,-169,-198,20,-623,-185,-511,-196,-195,-205,-454,-167,20,411,-343,-458,-457,-623,-508,20,-452,-385,-553,-529,-249,-175,-623,-279,-461,-530,-460,-277,-156,-155,-398,-392,-399,-391,-286,20,-514,-509,-513,-381,-383,-510,20,-281,-439,-430,-531,-456,-512,-164,-168,411,-153,-154,687,-459,-382,-554,-479,-478,-469,20,-472,-481,709,-480,-476,-475,-473,-501,-474,709,20,-471,-477,-386,20,228,-623,-453,-283,-280,-260,-463,-462,-465,-278,-344,-158,-157,-417,-418,-400,-290,-287,-284,-623,-515,-335,687,687,-558,-228,863,-441,-532,20,411,687,-555,-516,-503,-466,-470,-502,20,-484,-483,-559,-542,-533,-541,-543,-544,20,-251,-393,-419,-420,-402,-405,-401,-404,20,-285,-288,-296,-289,-384,-338,-336,-557,20,-263,-440,-442,-231,20,-185,411,-556,-623,-623,-536,-534,-307,-261,-308,-464,-282,-421,-422,-406,-298,687,-306,-297,228,-337,-234,-271,-264,20,-443,-444,20,20,687,-623,-507,-482,-495,-494,-485,-500,-535,-545,-309,-310,-403,-423,-424,-407,-408,-410,-411,687,20,228,228,-276,-274,-265,20,-272,-266,20,-446,-445,-232,-504,-499,-496,-497,411,-313,-311,228,-314,-312,-426,-425,-412,-291,228,-267,-273,20,20,20,228,-315,-317,-318,-316,-427,-428,-409,-498,-236,20,20,]),'&':([12,31,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,112,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,159,161,162,163,164,165,213,216,219,221,231,238,240,241,245,246,248,250,251,253,256,258,259,260,261,263,264,265,277,291,292,299,300,302,303,304,306,308,318,336,345,349,362,366,368,369,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,598,602,605,619,623,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,661,662,663,664,665,692,703,731,732,733,734,735,736,737,741,742,743,745,746,747,749,750,751,752,753,755,756,757,758,759,760,761,762,763,764,765,766,767,769,770,771,772,773,777,804,805,809,811,813,815,818,819,820,821,838,843,844,845,846,848,851,855,867,945,946,948,959,961,964,967,980,982,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1075,1076,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1149,1155,],[-345,-380,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,-381,-140,-108,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,-58,375,-50,-129,-45,-122,-343,-383,-117,-119,-385,-113,-68,-100,-112,527,-60,-123,-131,-133,-47,539,-132,-81,-53,-126,-116,-91,-118,-156,-155,-381,-398,-392,-399,-383,-380,-391,-389,-134,-135,-120,-109,527,-110,-121,-131,-132,527,-133,-341,-388,-387,527,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,-417,-418,-400,-384,-335,-339,-340,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,-64,-67,-65,-66,-46,-59,-52,-51,375,-145,-466,-71,-86,-84,-82,-69,-73,-75,375,-85,-106,-55,-95,-87,-93,-70,-72,-83,-102,-74,-49,-76,-61,-104,-57,375,-54,-56,-48,-92,-94,-62,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-384,-402,-405,-401,-404,-390,-338,-333,-336,-334,-151,-162,-128,979,-421,-422,-406,-623,-337,-163,-159,-436,979,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,-438,-437,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-161,-321,]),'TIMES_ASSIGN':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,246,251,253,259,336,345,366,434,512,538,561,563,567,573,580,585,586,587,588,589,623,625,626,631,640,643,644,646,650,703,772,773,777,804,805,843,844,845,846,848,921,959,961,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,333,-140,-343,-141,-143,-128,-127,333,-130,-129,-128,-128,-127,-130,-129,-134,-135,-128,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-128,-623,-337,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'AND_ASSIGN':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,246,251,253,259,336,345,366,434,512,538,561,563,567,573,580,585,586,587,588,589,623,625,626,631,640,643,644,646,650,703,772,773,777,804,805,843,844,845,846,848,921,959,961,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,331,-140,-343,-141,-143,-128,-127,331,-130,-129,-128,-128,-127,-130,-129,-134,-135,-128,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-128,-623,-337,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'FOR':([1,6,7,8,9,11,20,30,37,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,207,226,229,233,234,236,266,271,286,311,330,394,405,406,549,551,559,579,611,612,614,615,628,677,700,703,709,713,725,807,831,833,834,835,849,862,872,874,878,906,909,916,917,925,941,953,956,962,973,975,976,986,987,1011,1015,1016,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[80,-186,-204,-194,-187,80,80,-170,80,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,80,-508,-452,-553,-529,-249,-175,-279,-277,-286,80,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,871,-516,-466,80,-559,-533,-251,-285,-288,-296,-289,80,-263,-231,871,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-271,-264,80,80,871,-535,-309,-310,-276,-274,-265,80,-272,-266,80,-232,-313,-311,-314,-312,-291,-267,-273,871,871,80,-315,-317,-318,-316,-236,871,871,]),'LSHIFT':([12,38,42,46,48,51,55,56,57,62,72,85,89,101,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,163,165,219,221,238,240,241,245,246,250,251,253,259,260,263,264,265,277,336,345,349,362,366,368,369,410,412,416,419,423,434,498,533,534,535,538,585,586,588,623,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,692,703,731,732,733,734,735,736,737,742,743,746,747,749,750,751,752,753,755,757,759,765,766,769,770,771,772,773,777,804,805,843,844,845,846,848,851,855,959,961,964,967,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1149,1155,],[-345,-347,-138,-349,-341,-346,-142,-137,-342,-136,-144,-348,-350,-139,-140,-108,-343,-88,356,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,-129,-122,-117,-119,-113,503,-100,-112,523,-123,-131,-133,-132,-81,-126,-116,-91,-118,-134,-135,-120,-109,523,-110,-121,-131,-132,523,-133,-341,523,-124,-114,-115,-125,-146,-343,-149,-344,-335,-339,-340,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,356,356,356,356,-145,-466,356,-86,-84,-82,356,356,356,-85,-106,-95,-87,-93,356,356,-83,-102,356,356,-104,-92,-94,-105,-101,-103,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-162,-128,-623,-337,-163,-159,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-161,-321,]),'SUPER':([1,2,6,7,8,9,11,16,20,25,30,37,40,45,47,49,53,58,59,60,61,64,65,69,73,76,77,79,82,84,88,91,92,93,95,98,99,110,122,127,132,147,154,155,157,190,194,203,204,207,208,220,226,229,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,288,289,290,294,295,297,300,302,303,308,311,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,360,364,365,370,371,372,373,374,375,377,378,380,394,405,406,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,549,551,552,553,559,560,579,584,590,598,602,605,611,612,614,615,621,624,628,650,653,671,677,685,687,692,700,703,709,713,725,729,776,783,784,785,786,790,791,792,798,799,800,807,809,811,813,817,818,819,820,821,831,833,834,835,836,841,849,850,852,857,862,872,874,878,882,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,945,946,948,951,953,956,958,962,965,973,975,976,977,983,984,986,987,988,991,1011,1015,1016,1018,1019,1026,1036,1038,1040,1042,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1080,1092,1101,1102,1108,1109,1114,1115,1118,1120,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[81,140,-186,-204,-194,-187,81,140,81,140,-170,81,140,-206,-262,-203,-193,140,-192,-174,-202,-189,273,-172,140,-171,140,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,140,140,140,140,140,-205,140,140,-167,81,140,140,-508,-452,-553,-529,-249,140,140,140,140,-175,140,140,-279,140,140,564,140,-277,582,589,140,140,140,600,-398,-392,-399,-391,-286,81,-17,-11,-9,-10,140,-18,-12,-15,-8,-19,-16,-14,-13,140,140,140,140,140,140,140,140,140,140,644,140,140,140,140,140,140,140,140,140,140,140,-281,-164,-168,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,644,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,-283,-280,140,140,-260,140,-278,796,803,-417,-418,-400,-290,-287,-284,-623,140,140,-228,140,140,140,81,140,140,140,-516,-466,81,-559,-533,140,140,644,564,140,140,140,140,140,140,140,140,-251,-393,-419,-420,944,-402,-405,-401,-404,-285,-288,-296,-289,140,140,81,140,140,140,-263,-231,81,-185,140,-536,-534,140,140,-307,-261,140,-308,140,140,140,140,140,140,140,-282,-421,-422,-406,140,-306,-297,140,-234,140,-271,-264,81,140,140,564,81,81,140,140,-535,-309,-310,644,564,140,-403,-423,-424,1116,-407,-408,-410,-411,140,-276,-274,-265,81,-272,-266,81,-232,140,-313,-311,-314,-312,-426,-425,-412,-291,140,-267,-273,81,140,81,81,-315,-317,-318,-316,-427,-428,-409,-236,81,564,81,]),'ELLIPSIS':([13,15,27,31,32,36,44,48,52,57,66,67,86,94,112,128,213,216,217,231,291,292,300,302,303,308,318,431,433,476,588,592,593,598,602,605,619,809,811,813,818,819,820,821,838,893,945,946,948,1036,1038,1040,1043,1045,1046,1047,1114,1115,1118,1141,1143,1145,],[-375,-370,-374,-380,-372,-369,-378,-341,-376,-342,-373,-379,-371,-368,-381,-377,-343,-383,-367,-385,-156,-155,-398,-392,-399,-391,-389,-388,-387,-386,-344,-158,-157,-417,-418,-400,-384,-393,-419,-420,-402,-405,-401,-404,-390,995,-421,-422,-406,-403,-423,-424,-407,-408,-410,-411,-426,-425,-412,-427,-428,-409,]),'TRY':([1,6,7,8,9,11,20,30,37,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,207,226,229,233,234,236,266,271,286,311,330,394,405,406,549,551,559,579,611,612,614,615,628,677,700,703,709,713,725,807,831,833,834,835,849,862,872,874,878,906,909,916,917,925,941,953,956,962,973,975,976,986,987,1011,1015,1016,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[108,-186,-204,-194,-187,108,108,-170,108,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,108,-508,-452,-553,-529,-249,-175,-279,-277,-286,108,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,108,-516,-466,108,-559,-533,-251,-285,-288,-296,-289,108,-263,-231,108,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-271,-264,108,108,108,-535,-309,-310,-276,-274,-265,108,-272,-266,108,-232,-313,-311,-314,-312,-291,-267,-273,108,108,108,-315,-317,-318,-316,-236,108,108,]),'TRUE':([1,2,6,7,8,9,11,16,20,25,30,37,40,45,47,49,53,58,59,60,61,64,69,73,76,77,79,82,84,88,91,92,93,95,98,99,110,122,127,132,147,154,155,157,190,194,203,204,207,208,220,226,229,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,311,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,394,405,406,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,549,551,552,553,559,560,579,611,612,614,615,621,624,628,650,653,671,677,685,687,692,700,703,709,713,725,729,776,784,785,786,790,791,792,798,799,800,807,831,833,834,835,836,841,849,850,852,857,862,872,874,878,882,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,951,953,956,958,962,965,973,975,976,977,983,984,986,987,988,991,1011,1015,1016,1019,1026,1050,1064,1065,1067,1068,1069,1070,1071,1080,1092,1101,1102,1108,1109,1120,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1154,1156,1157,1160,],[85,85,-186,-204,-194,-187,85,85,85,85,-170,85,85,-206,-262,-203,-193,85,-192,-174,-202,-189,-172,85,-171,85,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,85,85,85,85,85,-205,85,85,-167,85,85,85,-508,-452,-553,-529,-249,85,85,85,85,-175,85,85,-279,85,85,85,85,-277,85,85,85,-286,85,-17,-11,-9,-10,85,-18,-12,-15,-8,-19,-16,-14,-13,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,-281,-164,-168,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,-283,-280,85,85,-260,85,-278,-290,-287,-284,-623,85,85,-228,85,85,85,85,85,85,85,-516,-466,85,-559,-533,85,85,85,85,85,85,85,85,85,85,85,-251,-285,-288,-296,-289,85,85,85,85,85,85,-263,-231,85,-185,85,-536,-534,85,85,-307,-261,85,-308,85,85,85,85,85,85,85,-282,85,-306,-297,85,-234,85,-271,-264,85,85,85,85,85,85,85,85,-535,-309,-310,85,85,85,-276,-274,-265,85,-272,-266,85,-232,85,-313,-311,-314,-312,-291,85,-267,-273,85,85,85,85,-315,-317,-318,-316,-236,85,85,85,]),'BYTE':([1,2,6,7,8,9,10,11,16,20,21,24,25,30,37,40,43,45,47,48,49,53,57,58,59,60,61,64,69,71,73,74,75,76,77,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,107,110,113,114,115,116,122,124,127,129,130,131,132,147,154,155,157,158,169,170,175,181,186,187,190,194,203,204,207,208,213,218,220,226,227,228,229,230,232,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,309,311,328,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,394,396,397,405,406,411,428,438,439,440,441,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,463,465,466,467,468,469,470,471,473,474,475,477,478,479,480,482,483,484,485,488,491,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,549,551,552,553,559,560,566,579,588,597,599,600,604,605,608,611,612,614,615,621,624,628,650,653,671,674,675,677,682,684,685,687,692,693,697,699,700,701,702,703,704,706,708,709,710,711,713,715,716,717,725,729,776,784,785,786,790,791,792,798,799,800,807,818,819,820,821,824,826,831,832,833,834,835,836,841,849,850,852,857,862,864,866,872,874,878,882,894,899,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,942,943,944,945,946,947,948,951,953,955,956,958,962,965,973,975,976,977,978,979,981,983,984,986,987,988,991,999,1000,1002,1007,1009,1011,1015,1016,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1074,1077,1080,1087,1092,1095,1101,1102,1108,1109,1113,1114,1115,1116,1117,1118,1120,1122,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[86,86,-186,-204,-194,-187,-361,86,86,86,-594,86,86,-170,86,86,-585,-206,-262,-341,-203,-193,-342,86,-192,-174,-202,-189,-172,-352,86,-363,-365,-171,86,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,86,-185,-357,-355,-366,86,-196,-584,-195,-359,-358,-364,86,86,86,86,86,86,-449,-448,-362,-451,-450,-447,-205,86,86,-167,86,86,-343,-354,86,-508,-623,-623,-452,86,-623,-553,-529,-249,86,86,86,86,-175,86,86,-279,86,86,86,86,-277,86,86,86,86,-286,-588,86,-17,-11,-9,-10,86,-18,-12,-15,-8,-19,-16,-14,-13,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,-281,-439,-430,-164,-168,86,86,-525,-519,-524,-623,-352,-521,86,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,86,-481,-623,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-623,-567,86,-566,-623,-623,-351,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,-283,-280,86,86,-260,86,86,-278,-344,86,86,86,86,-400,86,-290,-287,-284,-623,86,86,-228,86,86,86,-441,86,86,-587,-595,86,86,86,86,-352,86,-516,-503,-520,-466,-470,86,-502,86,-484,-483,-559,86,-563,-564,-533,86,86,86,86,86,86,86,86,86,86,86,-251,-402,-405,-401,-404,-303,86,-285,-623,-288,-296,-289,86,86,86,86,86,86,-263,-440,-442,-231,86,-185,86,-623,-487,-536,-534,86,86,-307,-261,86,-308,86,86,86,86,86,86,86,-282,86,86,86,-421,-422,86,-406,86,-306,86,-297,86,-234,86,-271,-264,86,86,-443,86,-444,86,86,86,86,86,86,-506,-482,-486,-500,-570,-535,-309,-310,86,86,-403,-423,-424,-407,-408,-410,-411,86,-276,-274,-265,86,-272,-266,86,-446,-445,-232,-505,86,-569,-313,-311,-314,-312,86,-426,-425,86,86,-412,-291,86,86,-267,-273,86,86,86,86,-315,-317,-318,-316,-427,-428,-409,-236,86,86,86,]),'BREAK':([1,6,7,8,9,11,20,30,37,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,207,226,229,233,234,236,266,271,286,311,330,394,405,406,549,551,559,579,611,612,614,615,628,677,700,703,709,713,725,807,831,833,834,835,849,862,872,874,878,906,909,916,917,925,941,953,956,962,973,975,976,986,987,1011,1015,1016,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[87,-186,-204,-194,-187,87,87,-170,87,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,87,-508,-452,-553,-529,-249,-175,-279,-277,-286,87,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,87,-516,-466,87,-559,-533,-251,-285,-288,-296,-289,87,-263,-231,87,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-271,-264,87,87,87,-535,-309,-310,-276,-274,-265,87,-272,-266,87,-232,-313,-311,-314,-312,-291,-267,-273,87,87,87,-315,-317,-318,-316,-236,87,87,]),'AND':([12,31,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,112,133,134,135,136,137,138,139,141,142,143,145,146,148,151,152,156,159,160,161,162,163,164,165,168,213,216,219,221,231,238,239,240,241,245,246,247,248,250,251,253,256,258,259,260,261,262,263,264,265,277,291,292,300,302,303,308,318,336,345,349,362,366,368,369,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,598,602,605,619,623,625,626,631,633,634,635,636,637,638,639,640,641,642,643,644,646,649,650,656,657,658,659,660,661,662,663,664,665,692,703,730,731,732,733,734,735,736,737,739,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,777,804,805,809,811,813,818,819,820,821,838,843,844,845,846,848,851,855,945,946,948,959,961,964,967,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1149,1155,],[-345,-380,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,-381,-140,-108,350,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,-58,-30,-40,-50,-129,-45,-122,-35,-343,-383,-117,-119,-385,-113,499,-68,-100,-112,525,-37,-60,-123,-131,-133,-47,-42,-132,-81,-53,-32,-126,-116,-91,-118,-156,-155,-398,-392,-399,-391,-389,-134,-135,-120,-109,525,-110,-121,-131,-132,525,-133,-341,-388,-387,525,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,-417,-418,-400,-384,-335,-339,-340,-152,-31,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,350,-145,-64,-67,-65,-66,-36,-46,-59,-52,-51,-41,-145,-466,-33,-71,-86,-84,-82,-69,-73,-75,350,-44,-85,-106,-39,-55,-95,-87,350,-93,-70,-72,-83,-102,-34,-74,-49,-76,-61,-104,-57,-43,-54,-56,-48,-92,-94,-62,-38,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-402,-405,-401,-404,-390,-338,-333,-336,-334,-151,-162,-128,-421,-422,-406,-623,-337,-163,-159,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-161,-321,]),'PLUS_ASSIGN':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,246,251,253,259,336,345,366,434,512,538,561,563,567,573,580,585,586,587,588,589,623,625,626,631,640,643,644,646,650,703,772,773,777,804,805,843,844,845,846,848,921,959,961,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,338,-140,-343,-141,-143,-128,-127,338,-130,-129,-128,-128,-127,-130,-129,-134,-135,-128,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-128,-623,-337,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'}':([6,7,8,9,12,20,21,30,31,38,42,43,44,45,46,47,48,49,51,53,55,56,57,59,60,61,62,64,67,69,72,76,79,82,84,85,88,89,91,92,93,95,96,98,99,101,110,112,122,124,127,133,134,135,136,137,138,139,141,142,143,144,145,146,148,150,151,152,153,156,159,160,161,162,163,164,165,167,168,169,170,181,186,187,190,204,205,206,207,213,216,219,221,226,227,228,229,231,232,233,234,235,236,238,239,240,241,242,245,247,248,250,256,258,260,261,262,263,264,265,266,271,277,286,291,292,300,302,303,308,311,318,328,336,345,349,362,368,369,394,405,406,410,411,412,415,416,419,420,421,431,433,438,439,440,442,443,445,446,448,449,450,452,453,454,455,456,457,458,459,460,462,465,466,467,469,470,471,474,475,476,477,478,479,481,482,484,485,487,488,489,490,492,493,494,496,497,498,533,534,535,538,549,551,559,579,585,586,588,592,593,598,602,605,611,612,614,615,619,623,625,626,628,629,631,633,634,635,636,637,638,639,640,641,642,643,644,646,649,650,656,657,658,659,660,661,662,663,664,665,678,679,680,681,682,684,687,688,689,692,700,701,702,703,704,708,709,710,711,713,716,717,718,719,720,721,722,723,724,725,726,727,728,730,731,732,733,734,735,736,737,739,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,777,804,805,809,811,813,818,819,820,821,831,833,834,835,838,843,844,845,846,848,851,862,863,872,878,881,882,883,887,888,889,890,891,902,906,907,908,909,916,917,925,941,945,946,948,953,956,959,961,962,963,964,967,972,973,974,975,976,989,990,991,992,993,1000,1007,1011,1012,1013,1014,1015,1016,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1064,1065,1066,1067,1068,1069,1070,1071,1080,1083,1084,1100,1101,1102,1103,1105,1108,1109,1110,1114,1115,1118,1120,1123,1124,1125,1127,1128,1135,1136,1137,1138,1139,1140,1141,1143,1145,1148,1149,1154,1155,],[-186,-204,-194,-187,-345,-623,-594,-170,-380,-347,-138,-585,-378,-206,-349,-262,-341,-203,-346,-193,-142,-137,-342,-192,-174,-202,-136,-189,-379,-172,-144,-171,-188,-200,-173,-348,-191,-350,-201,-197,-199,-190,-586,-169,-198,-139,-185,-381,-196,-584,-195,-140,-108,-25,-343,-88,-63,-141,-77,-143,-107,-3,-128,-96,-127,-20,-119,-111,-1,-130,-58,-30,-40,-50,-129,-45,-122,-4,-35,-449,-448,-451,-450,-447,-205,-167,-166,405,-165,-343,-383,-117,-119,-508,-623,-623,-452,-385,-623,-553,-529,-623,-249,-113,-27,-68,-100,-22,-112,-37,-60,-123,-47,-42,-81,-53,-32,-126,-116,-91,-175,-279,-118,-277,-156,-155,-398,-392,-399,-391,-286,-389,-588,-134,-135,-120,-109,-110,-121,-281,-164,-168,-131,679,-132,-577,-575,-133,-574,-576,-388,-387,-525,-519,-524,-518,-521,700,-527,-526,-523,-528,-522,-517,-479,-478,-469,703,-467,-468,-472,-481,-480,-476,-475,-473,-501,-474,-471,-477,-386,-562,-561,-565,713,-567,-566,-560,-623,-623,-540,-537,-623,-550,-551,725,-623,-124,-114,-115,-125,-146,-283,-280,-260,-278,-343,-149,-344,-158,-157,-417,-418,-400,-290,-287,-284,-623,-384,-335,-339,-340,-228,-7,-152,-31,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-26,-145,-64,-67,-65,-66,-36,-46,-59,-52,-51,-41,-582,-581,881,883,-587,-595,-623,-184,-183,-145,-516,-503,-520,-466,-470,-502,-623,-484,-483,-559,-563,-564,-551,906,-623,-552,-539,909,-542,-533,-541,-543,-544,-33,-71,-86,-84,-82,-69,-73,-75,-28,-44,-85,-106,-39,-55,-95,-87,-29,-93,-70,-72,-83,-102,-34,-74,-49,-76,-61,-104,-57,-43,-54,-56,-48,-92,-94,-62,-38,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-402,-405,-401,-404,-285,-288,-296,-289,-390,-338,-333,-336,-334,-151,-162,-263,975,-231,-185,-580,990,-579,-215,-214,992,-219,993,1007,-536,-538,1011,-534,-307,-261,-308,-282,-421,-422,-406,-306,-297,-623,-337,-234,-21,-163,-159,1067,-271,-268,-264,1070,-583,-578,1083,-217,-216,-482,-500,-535,-545,-23,-24,-309,-310,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,-276,-274,-269,-265,1127,-272,-266,-270,-232,-218,-220,-224,-313,-311,-623,-223,-314,-312,-222,-426,-425,-412,-291,-323,-623,-319,-267,-273,-322,-623,-315,-317,-318,-316,-427,-428,-409,-324,-161,-236,-321,]),'INTERFACE':([1,4,6,7,8,9,10,18,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,71,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,118,122,124,127,129,130,131,169,170,171,173,174,175,176,178,179,180,181,182,183,185,186,187,188,190,204,205,207,213,215,218,226,227,228,229,232,233,234,236,266,271,286,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,465,466,467,468,469,470,471,473,474,475,477,478,479,482,483,484,485,488,549,551,559,579,588,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,725,831,833,834,835,858,862,872,878,906,909,916,917,925,941,953,956,962,969,973,975,976,1000,1007,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[-623,-623,-186,-204,-194,-187,-361,202,-623,-594,-351,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-352,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,327,-196,-584,-195,-359,-358,-364,-449,-448,-623,-610,-608,-362,-352,-623,-618,-611,-451,-612,-623,-613,-450,-447,-351,-205,-167,-352,-623,-343,430,-354,-508,-623,-623,-452,-623,-553,-529,-249,-175,-279,-277,-286,-588,-623,-623,-351,-609,-623,-619,-605,-281,-164,-168,-525,-519,-524,-352,-521,202,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,202,-481,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-567,202,-566,-623,-623,-283,-280,-260,-278,-344,-290,-287,-284,-623,-228,-623,-614,-587,-595,-516,-503,-520,-466,-470,-502,-623,-484,-483,-559,-563,-564,-533,-285,-288,-296,-289,-616,-263,-231,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,-623,-482,-500,-535,-309,-310,-617,-276,-274,-265,-623,-272,-266,-623,-232,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'LONG':([1,2,6,7,8,9,10,11,16,20,21,24,25,30,37,40,43,45,47,48,49,53,57,58,59,60,61,64,69,71,73,74,75,76,77,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,107,110,113,114,115,116,122,124,127,129,130,131,132,147,154,155,157,158,169,170,175,181,186,187,190,194,203,204,207,208,213,218,220,226,227,228,229,230,232,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,309,311,328,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,394,396,397,405,406,411,428,438,439,440,441,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,463,465,466,467,468,469,470,471,473,474,475,477,478,479,480,482,483,484,485,488,491,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,549,551,552,553,559,560,566,579,588,597,599,600,604,605,608,611,612,614,615,621,624,628,650,653,671,674,675,677,682,684,685,687,692,693,697,699,700,701,702,703,704,706,708,709,710,711,713,715,716,717,725,729,776,784,785,786,790,791,792,798,799,800,807,818,819,820,821,824,826,831,832,833,834,835,836,841,849,850,852,857,862,864,866,872,874,878,882,894,899,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,942,943,944,945,946,947,948,951,953,955,956,958,962,965,973,975,976,977,978,979,981,983,984,986,987,988,991,999,1000,1002,1007,1009,1011,1015,1016,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1074,1077,1080,1087,1092,1095,1101,1102,1108,1109,1113,1114,1115,1116,1117,1118,1120,1122,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[27,27,-186,-204,-194,-187,-361,27,27,27,-594,27,27,-170,27,27,-585,-206,-262,-341,-203,-193,-342,27,-192,-174,-202,-189,-172,-352,27,-363,-365,-171,27,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,27,-185,-357,-355,-366,27,-196,-584,-195,-359,-358,-364,27,27,27,27,27,27,-449,-448,-362,-451,-450,-447,-205,27,27,-167,27,27,-343,-354,27,-508,-623,-623,-452,27,-623,-553,-529,-249,27,27,27,27,-175,27,27,-279,27,27,27,27,-277,27,27,27,27,-286,-588,27,-17,-11,-9,-10,27,-18,-12,-15,-8,-19,-16,-14,-13,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,-281,-439,-430,-164,-168,27,27,-525,-519,-524,-623,-352,-521,27,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,27,-481,-623,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-623,-567,27,-566,-623,-623,-351,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,-283,-280,27,27,-260,27,27,-278,-344,27,27,27,27,-400,27,-290,-287,-284,-623,27,27,-228,27,27,27,-441,27,27,-587,-595,27,27,27,27,-352,27,-516,-503,-520,-466,-470,27,-502,27,-484,-483,-559,27,-563,-564,-533,27,27,27,27,27,27,27,27,27,27,27,-251,-402,-405,-401,-404,-303,27,-285,-623,-288,-296,-289,27,27,27,27,27,27,-263,-440,-442,-231,27,-185,27,-623,-487,-536,-534,27,27,-307,-261,27,-308,27,27,27,27,27,27,27,-282,27,27,27,-421,-422,27,-406,27,-306,27,-297,27,-234,27,-271,-264,27,27,-443,27,-444,27,27,27,27,27,27,-506,-482,-486,-500,-570,-535,-309,-310,27,27,-403,-423,-424,-407,-408,-410,-411,27,-276,-274,-265,27,-272,-266,27,-446,-445,-232,-505,27,-569,-313,-311,-314,-312,27,-426,-425,27,27,-412,-291,27,27,-267,-273,27,27,27,27,-315,-317,-318,-316,-427,-428,-409,-236,27,27,27,]),'NULL':([1,2,6,7,8,9,11,16,20,25,30,37,40,45,47,49,53,58,59,60,61,64,69,73,76,77,79,82,84,88,91,92,93,95,98,99,110,122,127,132,147,154,155,157,190,194,203,204,207,208,220,226,229,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,311,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,394,405,406,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,549,551,552,553,559,560,579,611,612,614,615,621,624,628,650,653,671,677,685,687,692,700,703,709,713,725,729,776,784,785,786,790,791,792,798,799,800,807,831,833,834,835,836,841,849,850,852,857,862,872,874,878,882,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,951,953,956,958,962,965,973,975,976,977,983,984,986,987,988,991,1011,1015,1016,1019,1026,1050,1064,1065,1067,1068,1069,1070,1071,1080,1092,1101,1102,1108,1109,1120,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1154,1156,1157,1160,],[89,89,-186,-204,-194,-187,89,89,89,89,-170,89,89,-206,-262,-203,-193,89,-192,-174,-202,-189,-172,89,-171,89,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,89,89,89,89,89,-205,89,89,-167,89,89,89,-508,-452,-553,-529,-249,89,89,89,89,-175,89,89,-279,89,89,89,89,-277,89,89,89,-286,89,-17,-11,-9,-10,89,-18,-12,-15,-8,-19,-16,-14,-13,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,-281,-164,-168,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,-283,-280,89,89,-260,89,-278,-290,-287,-284,-623,89,89,-228,89,89,89,89,89,89,89,-516,-466,89,-559,-533,89,89,89,89,89,89,89,89,89,89,89,-251,-285,-288,-296,-289,89,89,89,89,89,89,-263,-231,89,-185,89,-536,-534,89,89,-307,-261,89,-308,89,89,89,89,89,89,89,-282,89,-306,-297,89,-234,89,-271,-264,89,89,89,89,89,89,89,89,-535,-309,-310,89,89,89,-276,-274,-265,89,-272,-266,89,-232,89,-313,-311,-314,-312,-291,89,-267,-273,89,89,89,89,-315,-317,-318,-316,-236,89,89,89,]),'INSTANCEOF':([12,31,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,112,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,159,162,163,165,213,216,219,221,231,238,240,241,245,246,248,250,251,253,259,260,261,263,264,265,277,291,292,300,302,303,308,318,336,345,349,362,366,368,369,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,598,602,605,619,623,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,662,663,664,692,703,731,732,733,734,735,736,737,742,743,745,746,747,749,750,751,752,753,755,757,758,759,760,762,763,765,766,767,769,770,771,772,773,777,804,805,809,811,813,818,819,820,821,838,843,844,845,846,848,851,855,945,946,948,959,961,964,967,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1149,1155,],[-345,-380,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,-381,-140,-108,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,-58,376,-129,-122,-343,-383,-117,-119,-385,-113,-68,-100,-112,529,-60,-123,-131,-133,-132,-81,542,-126,-116,-91,-118,-156,-155,-398,-392,-399,-391,-389,-134,-135,-120,-109,529,-110,-121,-131,-132,529,-133,-341,-388,-387,529,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,-417,-418,-400,-384,-335,-339,-340,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,-64,-67,-65,-66,-59,376,376,-145,-466,-71,-86,-84,-82,-69,-73,-75,-85,-106,376,-95,-87,-93,-70,-72,-83,-102,-74,-76,-61,-104,376,376,376,-92,-94,-62,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-402,-405,-401,-404,-390,-338,-333,-336,-334,-151,-162,-128,-421,-422,-406,-623,-337,-163,-159,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-161,-321,]),',':([12,21,23,31,34,38,41,42,43,44,46,48,51,55,56,57,62,67,72,78,85,89,90,96,101,112,117,121,124,133,134,135,136,137,138,139,141,142,143,144,145,146,148,150,151,152,153,156,159,160,161,162,163,164,165,167,168,209,210,211,212,213,216,219,221,231,235,238,239,240,241,242,245,247,248,250,256,258,260,261,262,263,264,265,277,291,292,293,296,297,298,299,300,301,302,303,304,306,307,308,318,321,324,328,336,345,346,349,362,368,369,395,398,399,400,407,410,411,412,415,416,417,419,420,421,425,426,427,429,431,433,436,476,487,489,490,497,498,533,534,535,538,555,556,568,569,576,577,578,585,586,588,592,593,598,601,602,605,616,619,623,625,626,629,631,633,634,635,636,637,638,639,640,641,642,643,644,646,649,650,656,657,658,659,660,661,662,663,664,665,678,679,681,682,684,686,687,688,689,690,692,694,696,703,722,724,726,727,728,730,731,732,733,734,735,736,737,739,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,777,781,804,805,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,838,839,843,844,845,846,848,851,855,865,867,881,883,885,886,889,890,896,897,904,907,915,918,919,920,926,945,946,948,959,961,963,964,967,980,982,989,990,992,993,994,996,1012,1013,1014,1017,1020,1022,1030,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1055,1057,1058,1059,1060,1061,1075,1076,1083,1084,1085,1088,1089,1090,1099,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1142,1143,1144,1145,1146,1148,1149,1153,1155,],[-345,-594,-212,-380,-209,-347,-211,-138,-585,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-210,-348,-350,-208,-586,-139,-381,-213,-207,-584,-140,-108,-25,-343,-88,-63,-141,-77,-143,-107,-3,-128,-96,-127,-20,-119,-111,-1,-130,-58,-30,-40,-50,-129,-45,-122,-4,-35,424,-623,-180,-178,-343,-383,-117,-119,-385,492,-113,-27,-68,-100,-22,-112,-37,-60,-123,-47,-42,-81,-53,-32,-126,-116,-91,-118,-156,-155,-388,597,-413,-397,-381,-398,-394,-392,-399,-383,-380,-396,-391,-389,-381,-383,-588,-134,-135,-387,-120,-109,-110,-121,-429,-431,673,-433,-591,-131,680,-132,-577,-575,683,-133,-574,-576,-153,-154,-182,424,-388,-387,-382,-386,720,-540,-537,-623,-124,-114,-115,-125,-146,776,-548,784,-242,-463,789,-465,-343,-149,-344,-158,-157,-417,-414,-418,-400,789,-384,-335,-339,-340,-7,-152,-31,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-26,-145,-64,-67,-65,-66,-36,-46,-59,-52,-51,-41,-582,-581,882,-587,-595,-179,888,-184,-183,-181,-145,894,-490,-466,-539,-542,-541,-543,-544,-33,-71,-86,-84,-82,-69,-73,-75,-28,-44,-85,-106,-39,-55,-95,-87,-29,-93,-70,-72,-83,-102,-34,-74,-49,-76,-61,-104,-57,-43,-54,-56,-48,-92,-94,-62,-38,-105,-101,-103,-332,-331,-221,-623,-330,-150,-395,-393,-396,-419,-415,-420,-416,-384,942,-413,-402,-405,-401,-404,-380,-396,-390,-384,-338,-333,-336,-334,-151,-162,-383,-432,-434,-580,-579,-592,-593,991,-219,-623,424,-623,-538,-549,-182,-623,-243,-464,-421,-422,-406,-623,-337,-21,-163,-159,-436,-435,-583,-578,-217,-216,-492,-491,-545,-23,-24,-182,-227,-226,-225,-403,-396,-423,-415,-424,-416,-413,-407,1117,-408,-410,-411,-396,-623,-326,-327,-320,-623,-160,-438,-437,-218,-220,-493,-499,1132,-497,784,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-415,-428,-416,-409,-396,-324,-161,-498,-321,]),'CASE':([6,7,8,9,30,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,226,229,233,234,236,266,271,286,311,394,405,406,549,551,559,579,611,612,614,615,628,700,703,713,725,831,833,834,835,862,863,872,878,906,909,916,917,925,941,953,956,962,972,973,974,975,976,1011,1015,1016,1064,1065,1066,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[-186,-204,-194,-187,-170,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,-508,-452,-553,-529,-249,-175,-279,-277,-286,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,-516,-466,-559,-533,-285,-288,-296,-289,-263,977,-231,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,977,-271,-268,-264,977,-535,-309,-310,-276,-274,-269,-265,977,-272,-266,-270,-232,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'VOID':([1,2,6,7,8,9,10,11,16,20,21,24,25,30,37,40,43,45,47,48,49,53,57,58,59,60,61,64,69,71,73,74,75,76,77,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,107,110,113,114,115,116,122,124,127,129,130,131,132,147,154,155,157,158,169,170,175,181,186,187,190,194,203,204,207,208,213,218,220,226,227,228,229,230,232,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,309,311,328,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,394,396,397,405,406,411,428,438,439,440,441,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,463,465,466,467,468,469,470,471,473,474,475,477,478,479,480,482,483,484,485,488,491,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,549,551,552,553,559,560,566,579,588,597,599,600,604,605,608,611,612,614,615,621,624,628,650,653,671,674,675,677,682,684,685,687,692,693,697,699,700,701,702,703,704,706,708,709,710,711,713,715,716,717,725,729,776,784,785,786,790,791,792,798,799,800,807,818,819,820,821,824,826,831,832,833,834,835,836,841,849,850,852,857,862,864,866,872,874,878,882,894,899,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,942,943,944,945,946,947,948,951,953,955,956,958,962,965,973,975,976,977,978,979,981,983,984,986,987,988,991,999,1000,1002,1007,1009,1011,1015,1016,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1074,1077,1080,1087,1092,1095,1101,1102,1108,1109,1113,1114,1115,1116,1117,1118,1120,1122,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[15,15,-186,-204,-194,-187,-361,15,15,15,-594,15,15,-170,15,15,-585,-206,-262,-341,-203,-193,-342,15,-192,-174,-202,-189,-172,-352,15,-363,-365,-171,15,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,15,-185,-357,-355,-366,15,-196,-584,-195,-359,-358,-364,15,15,15,15,15,15,-449,-448,-362,-451,-450,-447,-205,15,15,-167,15,15,-343,-354,15,-508,-623,-623,-452,15,-623,-553,-529,-249,15,15,15,15,-175,15,15,-279,15,15,15,15,-277,15,15,15,15,-286,-588,15,-17,-11,-9,-10,15,-18,-12,-15,-8,-19,-16,-14,-13,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,-281,-439,-430,-164,-168,15,15,-525,-519,-524,-623,-352,-521,15,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,15,-481,-623,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-623,-567,15,-566,-623,-623,-351,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,-283,-280,15,15,-260,15,15,-278,-344,15,15,15,15,-400,15,-290,-287,-284,-623,15,15,-228,15,15,15,-441,15,15,-587,-595,15,15,15,15,-352,15,-516,-503,-520,-466,-470,15,-502,15,-484,-483,-559,15,-563,-564,-533,15,15,15,15,15,15,15,15,15,15,15,-251,-402,-405,-401,-404,-303,15,-285,-623,-288,-296,-289,15,15,15,15,15,15,-263,-440,-442,-231,15,-185,15,-623,-487,-536,-534,15,15,-307,-261,15,-308,15,15,15,15,15,15,15,-282,15,15,15,-421,-422,15,-406,15,-306,15,-297,15,-234,15,-271,-264,15,15,-443,15,-444,15,15,15,15,15,15,-506,-482,-486,-500,-570,-535,-309,-310,15,15,-403,-423,-424,-407,-408,-410,-411,15,-276,-274,-265,15,-272,-266,15,-446,-445,-232,-505,15,-569,-313,-311,-314,-312,15,-426,-425,15,15,-412,-291,15,15,-267,-273,15,15,15,15,-315,-317,-318,-316,-427,-428,-409,-236,15,15,15,]),'GTEQ':([12,38,42,46,48,51,55,56,57,62,72,85,89,101,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,159,163,165,219,221,238,240,241,245,246,250,251,253,259,260,263,264,265,277,336,345,349,362,366,368,369,410,412,416,419,423,434,498,533,534,535,538,585,586,588,623,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,692,703,732,733,734,742,743,746,747,749,752,753,759,765,766,769,770,771,772,773,777,804,805,843,844,845,846,848,851,959,961,964,967,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1149,1155,],[-345,-347,-138,-349,-341,-346,-142,-137,-342,-136,-144,-348,-350,-139,-140,-108,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,373,-129,-122,-117,-119,-113,505,-100,-112,526,-123,-131,-133,-132,-81,-126,-116,-91,-118,-134,-135,-120,-109,526,-110,-121,-131,-132,526,-133,-341,526,-124,-114,-115,-125,-146,-343,-149,-344,-335,-339,-340,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,-64,-67,-65,-66,-145,-466,-86,-84,-82,-85,-106,-95,-87,-93,-83,-102,-104,-92,-94,-105,-101,-103,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-162,-623,-337,-163,-159,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-161,-321,]),'MINUS_ASSIGN':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,246,251,253,259,336,345,366,434,512,538,561,563,567,573,580,585,586,587,588,589,623,625,626,631,640,643,644,646,650,703,772,773,777,804,805,843,844,845,846,848,921,959,961,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,344,-140,-343,-141,-143,-128,-127,344,-130,-129,-128,-128,-127,-130,-129,-134,-135,-128,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-128,-623,-337,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'SHORT':([1,2,6,7,8,9,10,11,16,20,21,24,25,30,37,40,43,45,47,48,49,53,57,58,59,60,61,64,69,71,73,74,75,76,77,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,107,110,113,114,115,116,122,124,127,129,130,131,132,147,154,155,157,158,169,170,175,181,186,187,190,194,203,204,207,208,213,218,220,226,227,228,229,230,232,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,309,311,328,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,394,396,397,405,406,411,428,438,439,440,441,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,463,465,466,467,468,469,470,471,473,474,475,477,478,479,480,482,483,484,485,488,491,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,549,551,552,553,559,560,566,579,588,597,599,600,604,605,608,611,612,614,615,621,624,628,650,653,671,674,675,677,682,684,685,687,692,693,697,699,700,701,702,703,704,706,708,709,710,711,713,715,716,717,725,729,776,784,785,786,790,791,792,798,799,800,807,818,819,820,821,824,826,831,832,833,834,835,836,841,849,850,852,857,862,864,866,872,874,878,882,894,899,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,942,943,944,945,946,947,948,951,953,955,956,958,962,965,973,975,976,977,978,979,981,983,984,986,987,988,991,999,1000,1002,1007,1009,1011,1015,1016,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1074,1077,1080,1087,1092,1095,1101,1102,1108,1109,1113,1114,1115,1116,1117,1118,1120,1122,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[32,32,-186,-204,-194,-187,-361,32,32,32,-594,32,32,-170,32,32,-585,-206,-262,-341,-203,-193,-342,32,-192,-174,-202,-189,-172,-352,32,-363,-365,-171,32,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,32,-185,-357,-355,-366,32,-196,-584,-195,-359,-358,-364,32,32,32,32,32,32,-449,-448,-362,-451,-450,-447,-205,32,32,-167,32,32,-343,-354,32,-508,-623,-623,-452,32,-623,-553,-529,-249,32,32,32,32,-175,32,32,-279,32,32,32,32,-277,32,32,32,32,-286,-588,32,-17,-11,-9,-10,32,-18,-12,-15,-8,-19,-16,-14,-13,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,-281,-439,-430,-164,-168,32,32,-525,-519,-524,-623,-352,-521,32,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,32,-481,-623,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-623,-567,32,-566,-623,-623,-351,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,-283,-280,32,32,-260,32,32,-278,-344,32,32,32,32,-400,32,-290,-287,-284,-623,32,32,-228,32,32,32,-441,32,32,-587,-595,32,32,32,32,-352,32,-516,-503,-520,-466,-470,32,-502,32,-484,-483,-559,32,-563,-564,-533,32,32,32,32,32,32,32,32,32,32,32,-251,-402,-405,-401,-404,-303,32,-285,-623,-288,-296,-289,32,32,32,32,32,32,-263,-440,-442,-231,32,-185,32,-623,-487,-536,-534,32,32,-307,-261,32,-308,32,32,32,32,32,32,32,-282,32,32,32,-421,-422,32,-406,32,-306,32,-297,32,-234,32,-271,-264,32,32,-443,32,-444,32,32,32,32,32,32,-506,-482,-486,-500,-570,-535,-309,-310,32,32,-403,-423,-424,-407,-408,-410,-411,32,-276,-274,-265,32,-272,-266,32,-446,-445,-232,-505,32,-569,-313,-311,-314,-312,32,-426,-425,32,32,-412,-291,32,32,-267,-273,32,32,32,32,-315,-317,-318,-316,-427,-428,-409,-236,32,32,32,]),'+':([2,12,16,25,38,40,42,46,48,51,55,56,57,58,62,72,73,77,85,89,101,132,133,134,136,137,139,141,142,143,145,146,147,148,151,152,154,155,156,157,163,165,194,203,208,219,220,221,237,238,241,245,246,249,250,251,252,253,254,259,260,263,264,265,268,270,275,276,277,281,290,294,295,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,348,349,350,351,352,353,354,355,356,358,359,362,364,365,366,368,369,370,371,372,373,374,375,377,378,380,410,411,412,416,419,423,428,434,498,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,533,534,535,536,537,538,539,540,541,543,544,545,546,552,553,560,585,586,588,621,623,624,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,653,671,685,687,692,703,729,732,733,734,742,743,746,747,749,752,753,759,765,766,769,770,771,772,773,776,777,785,786,790,791,792,798,799,800,804,805,836,841,843,844,845,846,848,850,851,855,857,882,911,912,924,930,932,933,934,938,939,940,951,958,959,961,964,967,977,983,988,991,992,993,1020,1022,1026,1030,1050,1055,1057,1058,1059,1060,1061,1083,1092,1100,1103,1105,1110,1123,1124,1125,1130,1135,1136,1148,1149,1155,],[147,-345,147,147,-347,249,-138,-349,-341,-346,-142,-137,-342,147,-136,-144,147,147,-348,-350,-139,147,-140,-108,-343,-88,-141,359,-143,-107,-128,-96,147,-127,-119,-111,249,147,-130,147,-129,-122,147,147,249,-117,249,-119,147,-113,-100,-112,520,147,-123,-131,147,-133,147,-132,540,-126,-116,-91,147,147,147,147,-118,147,147,147,147,-17,-11,-9,-10,147,-134,-18,-12,-15,-8,-19,-16,-14,-13,-135,147,-120,147,147,147,147,147,147,147,147,147,-109,147,147,520,-110,-121,147,147,147,147,147,147,147,147,147,-131,249,-132,520,-133,-341,147,520,-124,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,-114,-115,-125,147,147,-146,147,147,147,147,147,147,147,147,147,147,-343,-149,-344,147,-335,147,-339,-340,-152,-99,-97,-98,359,359,359,-329,-90,-89,-147,-148,-328,-145,147,147,249,147,-145,-466,147,359,359,359,359,-106,-95,359,-93,359,-102,-104,-92,-94,-105,-101,-103,-332,-331,147,-221,147,147,147,147,147,147,147,147,-330,-150,147,147,-338,-333,-336,-334,-151,147,-162,-128,147,249,147,147,147,147,147,147,147,147,147,147,147,147,-623,-337,-163,-159,147,147,147,147,-217,-216,-227,-226,147,-225,147,-623,-326,-327,-320,-623,-160,-218,249,-224,-623,-223,-222,-323,-623,-319,147,-322,-623,-324,-161,-321,]),'STRICTFP':([1,4,6,7,8,9,10,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,178,179,180,181,182,183,185,186,187,188,190,204,207,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,720,725,824,826,831,832,833,834,835,858,862,872,878,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1095,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[75,75,-186,-204,-194,-187,-361,75,-594,75,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,75,-610,-608,-362,75,-618,-611,-451,-612,75,-613,-450,-447,75,-205,-167,75,-343,-354,-508,75,75,-452,75,-553,-529,75,-249,-175,-279,75,-277,75,-286,-588,75,75,75,-609,75,-619,-605,-281,-164,-168,-525,-519,-524,75,-521,-527,-526,-523,-528,75,-522,75,-479,-478,-469,75,-472,-481,75,-480,-476,-475,75,-473,-501,-474,-358,-471,-477,-562,-565,75,-567,-566,75,75,75,-283,-280,-260,75,-278,-344,75,-290,-287,-284,-623,-228,75,-614,-587,-595,-516,-503,-520,-466,-470,-502,75,-484,-483,-559,-563,-564,75,-533,-303,75,-285,75,-288,-296,-289,-616,-263,-231,-185,75,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,75,75,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,75,-272,-266,75,-232,-505,-569,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'RSHIFT_ASSIGN':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,246,251,253,259,336,345,366,434,512,538,561,563,567,573,580,585,586,587,588,589,623,625,626,631,640,643,644,646,650,703,772,773,777,804,805,843,844,845,846,848,921,959,961,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,339,-140,-343,-141,-143,-128,-127,339,-130,-129,-128,-128,-127,-130,-129,-134,-135,-128,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-128,-623,-337,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'TRANSIENT':([1,4,6,7,8,9,10,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,178,179,180,181,182,183,185,186,187,188,190,204,207,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,720,725,824,826,831,832,833,834,835,858,862,872,878,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1095,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[74,74,-186,-204,-194,-187,-361,74,-594,74,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,74,-610,-608,-362,74,-618,-611,-451,-612,74,-613,-450,-447,74,-205,-167,74,-343,-354,-508,74,74,-452,74,-553,-529,74,-249,-175,-279,74,-277,74,-286,-588,74,74,74,-609,74,-619,-605,-281,-164,-168,-525,-519,-524,74,-521,-527,-526,-523,-528,74,-522,74,-479,-478,-469,74,-472,-481,74,-480,-476,-475,74,-473,-501,-474,-358,-471,-477,-562,-565,74,-567,-566,74,74,74,-283,-280,-260,74,-278,-344,74,-290,-287,-284,-623,-228,74,-614,-587,-595,-516,-503,-520,-466,-470,-502,74,-484,-483,-559,-563,-564,74,-533,-303,74,-285,74,-288,-296,-289,-616,-263,-231,-185,74,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,74,74,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,74,-272,-266,74,-232,-505,-569,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'PACKAGE':([4,10,21,43,48,57,74,75,96,104,105,106,113,114,115,124,129,130,131,175,188,213,218,328,588,682,684,],[184,-361,-594,-585,-341,-342,-363,-365,-586,-360,-356,-353,-357,-355,-366,-584,-359,-358,-364,-362,390,-343,-354,-588,-344,-587,-595,]),'%':([12,38,42,46,48,51,55,56,57,62,72,85,89,101,133,134,136,137,139,142,143,145,146,148,151,152,156,163,165,219,221,238,241,245,246,250,251,253,259,263,264,265,277,336,345,349,362,366,368,369,410,412,416,419,423,434,498,533,534,535,538,585,586,588,623,625,626,631,634,635,636,640,641,642,643,644,646,650,692,703,743,746,749,753,759,765,766,769,770,771,772,773,777,804,805,843,844,845,846,848,851,855,959,961,964,967,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1149,1155,],[-345,-347,-138,-349,-341,-346,-142,-137,-342,-136,-144,-348,-350,-139,-140,-108,-343,351,-141,-143,-107,-128,-96,-127,-119,-111,-130,-129,-122,-117,-119,-113,-100,-112,513,-123,-131,-133,-132,-126,-116,544,-118,-134,-135,-120,-109,513,-110,-121,-131,-132,513,-133,-341,513,-124,-114,-115,-125,-146,-343,-149,-344,-335,-339,-340,-152,-99,-97,-98,-329,351,351,-147,-148,-328,-145,-145,-466,-106,351,351,-102,-104,351,351,-105,-101,-103,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-162,-128,-623,-337,-163,-159,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-161,-321,]),'LSHIFT_ASSIGN':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,246,251,253,259,336,345,366,434,512,538,561,563,567,573,580,585,586,587,588,589,623,625,626,631,640,643,644,646,650,703,772,773,777,804,805,843,844,845,846,848,921,959,961,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,343,-140,-343,-141,-143,-128,-127,343,-130,-129,-128,-128,-127,-130,-129,-134,-135,-128,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-128,-623,-337,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'BOOLEAN':([1,2,6,7,8,9,10,11,16,20,21,24,25,30,37,40,43,45,47,48,49,53,57,58,59,60,61,64,69,71,73,74,75,76,77,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,107,110,113,114,115,116,122,124,127,129,130,131,132,147,154,155,157,158,169,170,175,181,186,187,190,194,203,204,207,208,213,218,220,226,227,228,229,230,232,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,309,311,328,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,394,396,397,405,406,411,428,438,439,440,441,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,463,465,466,467,468,469,470,471,473,474,475,477,478,479,480,482,483,484,485,488,491,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,549,551,552,553,559,560,566,579,588,597,599,600,604,605,608,611,612,614,615,621,624,628,650,653,671,674,675,677,682,684,685,687,692,693,697,699,700,701,702,703,704,706,708,709,710,711,713,715,716,717,725,729,776,784,785,786,790,791,792,798,799,800,807,818,819,820,821,824,826,831,832,833,834,835,836,841,849,850,852,857,862,864,866,872,874,878,882,894,899,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,942,943,944,945,946,947,948,951,953,955,956,958,962,965,973,975,976,977,978,979,981,983,984,986,987,988,991,999,1000,1002,1007,1009,1011,1015,1016,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1074,1077,1080,1087,1092,1095,1101,1102,1108,1109,1113,1114,1115,1116,1117,1118,1120,1122,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[36,36,-186,-204,-194,-187,-361,36,36,36,-594,36,36,-170,36,36,-585,-206,-262,-341,-203,-193,-342,36,-192,-174,-202,-189,-172,-352,36,-363,-365,-171,36,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,36,-185,-357,-355,-366,36,-196,-584,-195,-359,-358,-364,36,36,36,36,36,36,-449,-448,-362,-451,-450,-447,-205,36,36,-167,36,36,-343,-354,36,-508,-623,-623,-452,36,-623,-553,-529,-249,36,36,36,36,-175,36,36,-279,36,36,36,36,-277,36,36,36,36,-286,-588,36,-17,-11,-9,-10,36,-18,-12,-15,-8,-19,-16,-14,-13,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,-281,-439,-430,-164,-168,36,36,-525,-519,-524,-623,-352,-521,36,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,36,-481,-623,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-623,-567,36,-566,-623,-623,-351,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,-283,-280,36,36,-260,36,36,-278,-344,36,36,36,36,-400,36,-290,-287,-284,-623,36,36,-228,36,36,36,-441,36,36,-587,-595,36,36,36,36,-352,36,-516,-503,-520,-466,-470,36,-502,36,-484,-483,-559,36,-563,-564,-533,36,36,36,36,36,36,36,36,36,36,36,-251,-402,-405,-401,-404,-303,36,-285,-623,-288,-296,-289,36,36,36,36,36,36,-263,-440,-442,-231,36,-185,36,-623,-487,-536,-534,36,36,-307,-261,36,-308,36,36,36,36,36,36,36,-282,36,36,36,-421,-422,36,-406,36,-306,36,-297,36,-234,36,-271,-264,36,36,-443,36,-444,36,36,36,36,36,36,-506,-482,-486,-500,-570,-535,-309,-310,36,36,-403,-423,-424,-407,-408,-410,-411,36,-276,-274,-265,36,-272,-266,36,-446,-445,-232,-505,36,-569,-313,-311,-314,-312,36,-426,-425,36,36,-412,-291,36,36,-267,-273,36,36,36,36,-315,-317,-318,-316,-427,-428,-409,-236,36,36,36,]),']':([12,31,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,112,133,134,135,136,137,138,139,141,142,143,144,145,146,148,150,151,152,153,156,159,160,161,162,163,164,165,167,168,213,216,219,221,231,277,290,291,292,300,302,303,308,318,320,336,345,349,362,368,369,431,433,476,538,548,550,585,586,588,591,592,593,598,602,605,619,623,624,625,626,629,631,633,634,635,636,637,638,639,640,641,642,643,644,646,649,650,656,657,658,659,660,661,662,663,664,665,692,703,772,773,777,804,805,809,811,813,818,819,820,821,838,842,843,844,845,846,848,851,945,946,948,959,961,963,964,967,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1149,1155,],[-345,-380,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,-381,-140,-108,-25,-343,-88,-63,-141,-77,-143,-107,-3,-128,-96,-127,-20,-119,-111,-1,-130,-58,-30,-40,-50,-129,-45,-122,-4,-35,-343,-383,-117,-119,-385,-118,592,-156,-155,-398,-392,-399,-391,-389,592,-134,-135,-120,-109,-110,-121,-388,-387,-386,-146,772,773,-343,-149,-344,804,-158,-157,-417,-418,-400,-384,-335,843,-339,-340,-7,-152,-31,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-26,-145,-64,-67,-65,-66,-36,-46,-59,-52,-51,-41,-145,-466,-332,-331,-221,-330,-150,-393,-419,-420,-402,-405,-401,-404,-390,961,-338,-333,-336,-334,-151,-162,-421,-422,-406,-623,-337,-21,-163,-159,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-161,-321,]),'INT':([1,2,6,7,8,9,10,11,16,20,21,24,25,30,37,40,43,45,47,48,49,53,57,58,59,60,61,64,69,71,73,74,75,76,77,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,107,110,113,114,115,116,122,124,127,129,130,131,132,147,154,155,157,158,169,170,175,181,186,187,190,194,203,204,207,208,213,218,220,226,227,228,229,230,232,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,309,311,328,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,394,396,397,405,406,411,428,438,439,440,441,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,463,465,466,467,468,469,470,471,473,474,475,477,478,479,480,482,483,484,485,488,491,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,549,551,552,553,559,560,566,579,588,597,599,600,604,605,608,611,612,614,615,621,624,628,650,653,671,674,675,677,682,684,685,687,692,693,697,699,700,701,702,703,704,706,708,709,710,711,713,715,716,717,725,729,776,784,785,786,790,791,792,798,799,800,807,818,819,820,821,824,826,831,832,833,834,835,836,841,849,850,852,857,862,864,866,872,874,878,882,894,899,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,942,943,944,945,946,947,948,951,953,955,956,958,962,965,973,975,976,977,978,979,981,983,984,986,987,988,991,999,1000,1002,1007,1009,1011,1015,1016,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1074,1077,1080,1087,1092,1095,1101,1102,1108,1109,1113,1114,1115,1116,1117,1118,1120,1122,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[66,66,-186,-204,-194,-187,-361,66,66,66,-594,66,66,-170,66,66,-585,-206,-262,-341,-203,-193,-342,66,-192,-174,-202,-189,-172,-352,66,-363,-365,-171,66,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,66,-185,-357,-355,-366,66,-196,-584,-195,-359,-358,-364,66,66,66,66,66,66,-449,-448,-362,-451,-450,-447,-205,66,66,-167,66,66,-343,-354,66,-508,-623,-623,-452,66,-623,-553,-529,-249,66,66,66,66,-175,66,66,-279,66,66,66,66,-277,66,66,66,66,-286,-588,66,-17,-11,-9,-10,66,-18,-12,-15,-8,-19,-16,-14,-13,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,-281,-439,-430,-164,-168,66,66,-525,-519,-524,-623,-352,-521,66,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,66,-481,-623,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-623,-567,66,-566,-623,-623,-351,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,-283,-280,66,66,-260,66,66,-278,-344,66,66,66,66,-400,66,-290,-287,-284,-623,66,66,-228,66,66,66,-441,66,66,-587,-595,66,66,66,66,-352,66,-516,-503,-520,-466,-470,66,-502,66,-484,-483,-559,66,-563,-564,-533,66,66,66,66,66,66,66,66,66,66,66,-251,-402,-405,-401,-404,-303,66,-285,-623,-288,-296,-289,66,66,66,66,66,66,-263,-440,-442,-231,66,-185,66,-623,-487,-536,-534,66,66,-307,-261,66,-308,66,66,66,66,66,66,66,-282,66,66,66,-421,-422,66,-406,66,-306,66,-297,66,-234,66,-271,-264,66,66,-443,66,-444,66,66,66,66,66,66,-506,-482,-486,-500,-570,-535,-309,-310,66,66,-403,-423,-424,-407,-408,-410,-411,66,-276,-274,-265,66,-272,-266,66,-446,-445,-232,-505,66,-569,-313,-311,-314,-312,66,-426,-425,66,66,-412,-291,66,66,-267,-273,66,66,66,66,-315,-317,-318,-316,-427,-428,-409,-236,66,66,66,]),'EXTENDS':([17,26,54,109,119,198,297,329,395,396,397,400,402,403,605,627,674,691,817,818,819,820,821,847,864,866,892,945,946,948,978,981,1036,1038,1040,1042,1043,1045,1046,1047,1074,1077,1114,1115,1118,1141,1143,1145,],[-455,223,223,315,-511,-454,599,-510,-429,-439,-430,675,-456,-512,-400,-558,-441,-555,943,-402,-405,-401,-404,-557,-440,-442,-556,-421,-422,-406,-443,-444,-403,-423,-424,1113,-407,-408,-410,-411,-446,-445,-426,-425,-412,-427,-428,-409,]),'DIVIDE_ASSIGN':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,246,251,253,259,336,345,366,434,512,538,561,563,567,573,580,585,586,587,588,589,623,625,626,631,640,643,644,646,650,703,772,773,777,804,805,843,844,845,846,848,921,959,961,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,334,-140,-343,-141,-143,-128,-127,334,-130,-129,-128,-128,-127,-130,-129,-134,-135,-128,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-128,-623,-337,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'[':([12,13,15,23,27,31,32,36,38,46,48,51,52,55,56,57,62,66,68,70,72,85,86,89,100,101,112,117,125,128,133,136,139,142,145,166,192,210,213,216,217,231,246,291,292,299,300,302,303,304,305,308,321,324,325,326,366,367,416,423,434,476,512,538,561,567,573,580,585,586,587,588,589,592,593,598,602,605,619,623,625,626,631,640,643,644,646,650,652,692,703,705,772,773,777,781,804,805,809,811,813,815,818,819,820,821,839,843,844,845,846,848,855,856,895,896,900,903,904,919,921,945,946,948,959,961,966,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1155,],[-345,-375,-370,-143,-374,-380,-372,-369,-347,-349,-341,-346,-376,-142,268,-342,270,-373,-343,-140,-144,-348,-371,-350,290,-139,320,-141,320,-377,-140,-343,-141,-143,290,320,290,320,-343,320,320,-385,290,-156,320,320,-398,-392,-399,320,320,-391,-381,-383,624,624,290,320,290,-341,290,-386,-145,-146,-343,290,-329,-328,-343,-149,-147,-344,-148,-158,-157,-417,-418,-400,320,-335,624,624,-152,-329,-147,-148,-328,-145,320,-145,-466,-343,-332,-331,-221,320,-330,-150,-393,-419,-420,320,-402,-405,-401,-404,-384,-338,-333,-336,-334,-151,290,320,320,320,-343,320,320,320,290,-421,-422,-406,-623,-337,320,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-321,]),'SYNCHRONIZED':([1,4,6,7,8,9,10,11,20,21,24,30,37,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,178,179,180,181,182,183,185,186,187,188,190,204,207,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,330,381,382,383,386,387,388,391,394,405,406,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,677,682,684,700,701,702,703,704,708,709,710,711,713,716,717,720,725,807,824,826,831,832,833,834,835,849,858,862,872,874,878,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,986,987,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1095,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[102,175,-186,-204,-194,-187,-361,193,102,-594,175,-170,193,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,175,-610,-608,-362,175,-618,-611,-451,-612,175,-613,-450,-447,175,-205,-167,102,-343,-354,-508,175,175,-452,175,-553,-529,175,-249,-175,-279,175,-277,175,-286,-588,193,175,175,175,-609,175,-619,-605,-281,-164,-168,-525,-519,-524,175,-521,-527,-526,-523,-528,175,-522,175,-479,-478,-469,175,-472,-481,175,-480,-476,-475,175,-473,-501,-474,-358,-471,-477,-562,-565,175,-567,-566,175,175,175,-283,-280,-260,175,-278,-344,175,-290,-287,-284,-623,-228,175,-614,193,-587,-595,-516,-503,-520,-466,-470,-502,102,-484,-483,-559,-563,-564,175,-533,-251,-303,175,-285,175,-288,-296,-289,193,-616,-263,-231,193,-185,175,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,102,175,193,193,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,102,-272,-266,102,-232,-505,-569,-313,-311,-314,-312,-291,-267,-273,193,193,193,-315,-317,-318,-316,-236,193,193,]),'EQ':([12,31,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,112,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,159,162,163,164,165,213,216,219,221,231,238,240,241,245,246,248,250,251,253,256,259,260,261,263,264,265,277,291,292,300,302,303,308,318,336,345,349,362,366,368,369,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,598,602,605,619,623,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,661,662,663,664,692,703,731,732,733,734,735,736,737,742,743,745,746,747,749,750,751,752,753,755,756,757,758,759,760,762,763,764,765,766,767,769,770,771,772,773,777,804,805,809,811,813,818,819,820,821,838,843,844,845,846,848,851,855,945,946,948,959,961,964,967,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1149,1155,],[-345,-380,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,-381,-140,-108,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,-58,-50,-129,378,-122,-343,-383,-117,-119,-385,-113,-68,-100,-112,516,-60,-123,-131,-133,536,-132,-81,-53,-126,-116,-91,-118,-156,-155,-398,-392,-399,-391,-389,-134,-135,-120,-109,516,-110,-121,-131,-132,516,-133,-341,-388,-387,516,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,-417,-418,-400,-384,-335,-339,-340,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,-64,-67,-65,-66,378,-59,-52,-51,-145,-466,-71,-86,-84,-82,-69,-73,-75,-85,-106,-55,-95,-87,-93,-70,-72,-83,-102,-74,378,-76,-61,-104,-57,-54,-56,378,-92,-94,-62,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-402,-405,-401,-404,-390,-338,-333,-336,-334,-151,-162,-128,-421,-422,-406,-623,-337,-163,-159,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-161,-321,]),'(':([1,2,6,7,8,9,11,14,16,19,20,21,25,30,31,37,40,45,47,48,49,53,57,58,59,60,61,64,68,69,70,73,76,77,79,80,81,82,84,88,91,92,93,95,98,99,102,108,110,122,126,127,132,136,147,154,155,157,190,193,194,203,204,207,208,213,220,226,229,231,233,234,236,237,249,252,254,266,268,270,271,273,274,275,276,279,281,286,290,294,295,300,302,303,308,311,321,322,324,326,328,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,392,394,405,406,411,428,436,476,497,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,549,551,552,553,559,560,561,573,579,580,581,582,585,587,588,589,598,602,605,611,612,613,614,615,617,621,622,624,628,640,646,650,653,671,677,685,687,692,700,703,705,709,713,724,725,729,776,784,785,786,787,790,791,792,793,795,796,797,798,799,800,801,802,803,807,809,811,813,818,819,820,821,831,833,834,835,836,837,839,841,849,850,852,857,862,870,871,872,874,878,880,882,896,900,904,906,909,911,912,916,917,924,925,930,931,932,933,934,938,939,940,941,945,946,948,951,953,956,958,962,965,973,975,976,977,983,984,986,987,988,991,1001,1010,1011,1015,1016,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1080,1092,1101,1102,1108,1109,1114,1115,1118,1120,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[40,154,-186,-204,-194,-187,40,194,154,203,40,208,220,-170,-380,40,154,-206,-262,-341,-203,-193,-342,154,-192,-174,-202,-189,275,-172,276,220,-171,154,-188,279,281,-200,-173,-191,-201,-197,-199,-190,-169,-198,294,309,-185,-196,348,-195,220,275,220,154,220,220,-205,294,154,154,-167,40,220,-343,154,-508,-452,-385,-553,-529,-249,220,220,220,220,-175,154,154,-279,552,553,154,154,40,154,-277,154,154,154,-398,-392,-399,-391,-286,-381,621,-383,-382,-588,40,-17,-11,-9,-10,154,-18,-12,-15,-8,-19,-16,-14,-13,154,220,220,220,220,220,220,220,220,220,154,220,220,220,220,220,220,220,220,220,220,671,-281,-164,-168,220,154,-382,-386,729,220,220,220,220,220,220,220,220,154,220,154,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,-283,-280,154,154,-260,154,275,786,-278,790,791,792,798,799,-344,800,-417,-418,-400,-290,-287,832,-284,-623,836,154,841,154,-228,786,790,220,220,154,40,220,154,220,-516,-466,899,40,-559,-542,-533,154,154,40,154,154,924,154,154,154,930,932,933,934,154,154,154,938,939,940,-251,-393,-419,-420,-402,-405,-401,-404,-285,-288,-296,-289,154,958,-384,154,40,220,220,220,-263,983,984,-231,40,-185,988,220,999,1002,1009,-536,-534,220,220,-307,-261,154,-308,154,1026,154,154,154,154,154,154,-282,-421,-422,-406,154,-306,-297,154,-234,220,-271,-264,40,154,154,40,40,40,154,154,1087,1095,-535,-309,-310,40,154,-403,-423,-424,-407,-408,-410,-411,154,-276,-274,-265,40,-272,-266,40,-232,220,-313,-311,-314,-312,-426,-425,-412,-291,220,-267,-273,40,154,40,40,-315,-317,-318,-316,-427,-428,-409,-236,40,40,40,]),'-':([2,12,16,25,38,40,42,46,48,51,55,56,57,58,62,72,73,77,85,89,101,132,133,134,136,137,139,141,142,143,145,146,147,148,151,152,154,155,156,157,163,165,194,203,208,219,220,221,237,238,241,245,246,249,250,251,252,253,254,259,260,263,264,265,268,270,275,276,277,281,290,294,295,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,348,349,350,351,352,353,354,355,356,358,359,362,364,365,366,368,369,370,371,372,373,374,375,377,378,380,410,411,412,416,419,423,428,434,498,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,533,534,535,536,537,538,539,540,541,543,544,545,546,552,553,560,585,586,588,621,623,624,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,653,671,685,687,692,703,729,732,733,734,742,743,746,747,749,752,753,759,765,766,769,770,771,772,773,776,777,785,786,790,791,792,798,799,800,804,805,836,841,843,844,845,846,848,850,851,855,857,882,911,912,924,930,932,933,934,938,939,940,951,958,959,961,964,967,977,983,988,991,992,993,1020,1022,1026,1030,1050,1055,1057,1058,1059,1060,1061,1083,1092,1100,1103,1105,1110,1123,1124,1125,1130,1135,1136,1148,1149,1155,],[155,-345,155,155,-347,252,-138,-349,-341,-346,-142,-137,-342,155,-136,-144,155,155,-348,-350,-139,155,-140,-108,-343,-88,-141,358,-143,-107,-128,-96,155,-127,-119,-111,252,155,-130,155,-129,-122,155,155,252,-117,252,-119,155,-113,-100,-112,517,155,-123,-131,155,-133,155,-132,541,-126,-116,-91,155,155,155,155,-118,155,155,155,155,-17,-11,-9,-10,155,-134,-18,-12,-15,-8,-19,-16,-14,-13,-135,155,-120,155,155,155,155,155,155,155,155,155,-109,155,155,517,-110,-121,155,155,155,155,155,155,155,155,155,-131,252,-132,517,-133,-341,155,517,-124,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,-114,-115,-125,155,155,-146,155,155,155,155,155,155,155,155,155,155,-343,-149,-344,155,-335,155,-339,-340,-152,-99,-97,-98,358,358,358,-329,-90,-89,-147,-148,-328,-145,155,155,252,155,-145,-466,155,358,358,358,358,-106,-95,358,-93,358,-102,-104,-92,-94,-105,-101,-103,-332,-331,155,-221,155,155,155,155,155,155,155,155,-330,-150,155,155,-338,-333,-336,-334,-151,155,-162,-128,155,252,155,155,155,155,155,155,155,155,155,155,155,155,-623,-337,-163,-159,155,155,155,155,-217,-216,-227,-226,155,-225,155,-623,-326,-327,-320,-623,-160,-218,252,-224,-623,-223,-222,-323,-623,-319,155,-322,-623,-324,-161,-321,]),'FINAL':([1,4,6,7,8,9,10,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,178,179,180,181,182,183,185,186,187,188,190,204,207,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,720,725,824,826,831,832,833,834,835,858,862,872,878,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1095,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[104,104,-186,-204,-194,-187,-361,104,-594,104,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,104,-610,-608,-362,104,-618,-611,-451,-612,104,-613,-450,-447,104,-205,-167,104,-343,-354,-508,104,104,-452,104,-553,-529,104,-249,-175,-279,104,-277,104,-286,-588,104,104,104,-609,104,-619,-605,-281,-164,-168,-525,-519,-524,104,-521,-527,-526,-523,-528,104,-522,104,-479,-478,-469,104,-472,-481,104,-480,-476,-475,104,-473,-501,-474,-358,-471,-477,-562,-565,104,-567,-566,104,104,104,-283,-280,-260,104,-278,-344,104,-290,-287,-284,-623,-228,104,-614,-587,-595,-516,-503,-520,-466,-470,-502,104,-484,-483,-559,-563,-564,104,-533,-303,104,-285,104,-288,-296,-289,-616,-263,-231,-185,104,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,104,104,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,104,-272,-266,104,-232,-505,-569,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'PROTECTED':([1,4,6,7,8,9,10,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,178,179,180,181,182,183,185,186,187,188,190,204,207,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,720,725,824,826,831,832,833,834,835,858,862,872,878,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1095,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[105,105,-186,-204,-194,-187,-361,105,-594,105,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,105,-610,-608,-362,105,-618,-611,-451,-612,105,-613,-450,-447,105,-205,-167,105,-343,-354,-508,105,105,-452,105,-553,-529,105,-249,-175,-279,105,-277,105,-286,-588,105,105,105,-609,105,-619,-605,-281,-164,-168,-525,-519,-524,105,-521,-527,-526,-523,-528,105,-522,105,-479,-478,-469,105,-472,-481,105,-480,-476,-475,105,-473,-501,-474,-358,-471,-477,-562,-565,105,-567,-566,105,105,105,-283,-280,-260,105,-278,-344,105,-290,-287,-284,-623,-228,105,-614,-587,-595,-516,-503,-520,-466,-470,-502,105,-484,-483,-559,-563,-564,105,-533,-303,105,-285,105,-288,-296,-289,-616,-263,-231,-185,105,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,105,105,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,105,-272,-266,105,-232,-505,-569,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'!':([2,16,25,40,58,73,77,132,147,154,155,157,194,203,208,220,237,249,252,254,268,270,275,276,281,290,294,295,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,685,687,692,729,776,785,786,790,791,792,798,799,800,836,841,850,852,857,882,911,912,924,930,932,933,934,938,939,940,951,958,965,977,983,988,991,1026,1050,1092,1126,1130,],[157,157,157,254,157,157,157,157,157,254,157,157,157,157,254,254,157,157,157,157,157,157,157,157,157,157,157,157,-17,-11,-9,-10,157,-18,-12,-15,-8,-19,-16,-14,-13,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,254,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,254,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,254,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,254,157,157,]),'FINALLY':([310,311,405,610,611,612,614,615,833,834,835,1120,],[-623,-286,-164,830,-290,-287,-289,-623,-288,830,-289,-291,]),'RRSHIFT_ASSIGN':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,246,251,253,259,336,345,366,434,512,538,561,563,567,573,580,585,586,587,588,589,623,625,626,631,640,643,644,646,650,703,772,773,777,804,805,843,844,845,846,848,921,959,961,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,342,-140,-343,-141,-143,-128,-127,342,-130,-129,-128,-128,-127,-130,-129,-134,-135,-128,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-128,-623,-337,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'<':([1,6,7,8,9,10,11,12,17,20,21,30,31,37,38,42,43,45,46,47,48,49,51,53,55,56,57,59,60,61,62,64,68,69,71,72,74,75,76,79,82,84,85,88,89,91,92,93,95,96,98,99,100,101,104,105,106,110,113,114,115,116,119,122,124,127,129,130,131,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,158,159,163,165,169,170,175,181,186,187,190,204,207,213,216,218,219,221,226,227,228,229,232,233,234,236,238,240,241,245,246,250,251,253,259,260,263,264,265,266,271,277,280,286,288,289,304,306,311,317,324,328,330,336,345,349,357,360,362,363,366,368,369,394,401,402,403,405,406,410,412,416,419,423,434,438,439,440,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,465,466,467,468,469,470,471,473,474,475,477,478,479,482,483,484,485,488,498,514,533,534,535,538,549,551,559,561,567,579,583,585,586,588,611,612,614,615,619,623,625,626,627,628,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,677,682,684,691,692,700,701,702,703,704,705,708,709,710,711,713,716,717,725,732,733,734,742,743,746,747,749,752,753,759,765,766,769,770,771,772,773,777,780,783,804,805,807,815,822,831,833,834,835,839,843,844,845,846,848,849,851,855,862,872,874,878,900,906,909,916,917,925,941,953,956,959,961,962,964,967,973,975,976,986,987,992,993,1000,1007,1011,1015,1016,1018,1020,1022,1030,1055,1057,1058,1059,1060,1061,1064,1065,1067,1068,1069,1070,1071,1080,1083,1100,1101,1102,1103,1105,1108,1109,1110,1120,1123,1124,1125,1127,1128,1129,1131,1134,1135,1136,1137,1138,1139,1140,1148,1149,1154,1155,1156,1160,],[107,-186,-204,-194,-187,-361,107,-345,199,107,-594,-170,230,107,-347,-138,-585,-206,-349,-262,-341,-203,-346,-193,-142,-137,-342,-192,-174,-202,-136,-189,-343,-172,-352,-144,-363,-365,-171,-188,-200,-173,-348,-191,-350,-201,-197,-199,-190,-586,-169,-198,-383,-139,-360,-356,-353,-185,-357,-355,-366,107,199,-196,-584,-195,-359,-358,-364,-140,-108,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,107,372,-129,-122,-449,-448,-362,-451,-450,-447,-205,-167,107,-343,-383,-354,-117,-119,-508,-623,-623,-452,-623,-553,-529,-249,-113,504,-100,-112,521,-123,-131,-133,-132,-81,-126,-116,-91,-175,-279,-118,107,-277,107,107,-383,604,-286,107,-383,-588,107,-134,-135,-120,107,107,-109,107,653,-110,-121,-281,199,-456,-512,-164,-168,-131,-132,521,-133,-341,653,-525,-519,-524,-352,-521,199,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,199,-481,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-567,199,-566,-623,-623,-124,107,-114,-115,-125,-146,-283,-280,-260,-343,-383,-278,107,-343,-149,-344,-290,-287,-284,-623,-384,-335,-339,-340,199,-228,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,-64,-67,-65,-66,107,-587,-595,199,-145,-516,-503,-520,-466,-470,-343,-502,107,-484,-483,-559,-563,-564,-533,-86,-84,-82,-85,-106,-95,-87,-93,-83,-102,-104,-92,-94,-105,-101,-103,-332,-331,-221,107,107,-330,-150,-251,-384,947,-285,-288,-296,-289,-384,-338,-333,-336,-334,-151,107,-162,-383,-263,-231,107,-185,-343,-536,-534,-307,-261,-308,-282,-306,-297,-623,-337,-234,-163,-159,-271,-264,107,107,107,-217,-216,-482,-500,-535,-309,-310,107,-227,-226,-225,-623,-326,-327,-320,-623,-160,-276,-274,-265,107,-272,-266,107,-232,-218,-224,-313,-311,-623,-223,-314,-312,-222,-291,-323,-623,-319,-267,-273,107,107,107,-322,-623,-315,-317,-318,-316,-324,-161,-236,-321,107,107,]),'NUM':([1,2,6,7,8,9,11,16,20,25,30,37,40,45,47,49,53,58,59,60,61,64,69,73,76,77,79,82,84,88,91,92,93,95,98,99,110,122,127,132,147,154,155,157,190,194,203,204,207,208,220,226,229,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,311,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,394,405,406,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,549,551,552,553,559,560,579,611,612,614,615,621,624,628,650,653,671,677,685,687,692,700,703,709,713,725,729,776,784,785,786,790,791,792,798,799,800,807,831,833,834,835,836,841,849,850,852,857,862,872,874,878,882,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,951,953,956,958,962,965,973,975,976,977,983,984,986,987,988,991,1011,1015,1016,1019,1026,1050,1064,1065,1067,1068,1069,1070,1071,1080,1092,1101,1102,1108,1109,1120,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1154,1156,1157,1160,],[12,12,-186,-204,-194,-187,12,12,12,12,-170,12,12,-206,-262,-203,-193,12,-192,-174,-202,-189,-172,12,-171,12,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,12,12,12,12,12,-205,12,12,-167,12,12,12,-508,-452,-553,-529,-249,12,12,12,12,-175,12,12,-279,12,12,12,12,-277,12,12,12,-286,12,-17,-11,-9,-10,12,-18,-12,-15,-8,-19,-16,-14,-13,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,-281,-164,-168,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,-283,-280,12,12,-260,12,-278,-290,-287,-284,-623,12,12,-228,12,12,12,12,12,12,12,-516,-466,12,-559,-533,12,12,12,12,12,12,12,12,12,12,12,-251,-285,-288,-296,-289,12,12,12,12,12,12,-263,-231,12,-185,12,-536,-534,12,12,-307,-261,12,-308,12,12,12,12,12,12,12,-282,12,-306,-297,12,-234,12,-271,-264,12,12,12,12,12,12,12,12,-535,-309,-310,12,12,12,-276,-274,-265,12,-272,-266,12,-232,12,-313,-311,-314,-312,-291,12,-267,-273,12,12,12,12,-315,-317,-318,-316,-236,12,12,12,]),'>':([12,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,159,163,165,213,219,221,230,231,238,240,241,245,246,250,251,253,259,260,263,264,265,277,291,292,293,297,299,300,302,303,304,306,307,308,318,336,345,346,349,362,366,368,369,395,400,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,598,602,604,605,623,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,692,703,732,733,734,742,743,746,747,749,752,753,759,765,766,769,770,771,772,773,777,804,805,809,810,811,812,813,814,815,817,818,819,820,821,822,823,838,843,844,845,846,848,851,855,867,945,946,947,948,959,961,964,967,992,993,1020,1022,1030,1036,1037,1038,1039,1040,1041,1042,1043,1045,1046,1047,1048,1055,1057,1058,1059,1060,1061,1075,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1142,1143,1144,1145,1146,1148,1149,1155,],[-345,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,-140,-108,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,370,-129,-122,-343,-117,-119,476,-385,-113,500,-100,-112,522,-123,-131,-133,-132,-81,-126,-116,-91,-118,-156,-155,-388,598,-381,-398,-392,-399,-383,-380,605,-391,-389,-134,-135,-387,-120,-109,522,-110,-121,-429,674,-131,-132,522,-133,-341,-388,-387,522,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,-417,-418,476,-400,-335,-339,-340,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,-64,-67,-65,-66,-145,-466,-86,-84,-82,-85,-106,-95,-87,-93,-83,-102,-104,-92,-94,-105,-101,-103,-332,-331,-221,-330,-150,-393,605,-419,605,-420,605,-384,598,-402,-405,-401,-404,-380,605,-390,-338,-333,-336,-334,-151,-162,-383,605,-421,-422,476,-406,-623,-337,-163,-159,-217,-216,-227,-226,-225,-403,605,-423,605,-424,605,598,-407,-408,-410,-411,605,-623,-326,-327,-320,-623,-160,605,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,605,-428,605,-409,605,-324,-161,-321,]),'REMAINDER_ASSIGN':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,246,251,253,259,336,345,366,434,512,538,561,563,567,573,580,585,586,587,588,589,623,625,626,631,640,643,644,646,650,703,772,773,777,804,805,843,844,845,846,848,921,959,961,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,332,-140,-343,-141,-143,-128,-127,332,-130,-129,-128,-128,-127,-130,-129,-134,-135,-128,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-128,-623,-337,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'PRIVATE':([1,4,6,7,8,9,10,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,178,179,180,181,182,183,185,186,187,188,190,204,207,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,720,725,824,826,831,832,833,834,835,858,862,872,878,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1095,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[113,113,-186,-204,-194,-187,-361,113,-594,113,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,113,-610,-608,-362,113,-618,-611,-451,-612,113,-613,-450,-447,113,-205,-167,113,-343,-354,-508,113,113,-452,113,-553,-529,113,-249,-175,-279,113,-277,113,-286,-588,113,113,113,-609,113,-619,-605,-281,-164,-168,-525,-519,-524,113,-521,-527,-526,-523,-528,113,-522,113,-479,-478,-469,113,-472,-481,113,-480,-476,-475,113,-473,-501,-474,-358,-471,-477,-562,-565,113,-567,-566,113,113,113,-283,-280,-260,113,-278,-344,113,-290,-287,-284,-623,-228,113,-614,-587,-595,-516,-503,-520,-466,-470,-502,113,-484,-483,-559,-563,-564,113,-533,-303,113,-285,113,-288,-296,-289,-616,-263,-231,-185,113,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,113,113,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,113,-272,-266,113,-232,-505,-569,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'FALSE':([1,2,6,7,8,9,11,16,20,25,30,37,40,45,47,49,53,58,59,60,61,64,69,73,76,77,79,82,84,88,91,92,93,95,98,99,110,122,127,132,147,154,155,157,190,194,203,204,207,208,220,226,229,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,311,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,394,405,406,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,549,551,552,553,559,560,579,611,612,614,615,621,624,628,650,653,671,677,685,687,692,700,703,709,713,725,729,776,784,785,786,790,791,792,798,799,800,807,831,833,834,835,836,841,849,850,852,857,862,872,874,878,882,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,951,953,956,958,962,965,973,975,976,977,983,984,986,987,988,991,1011,1015,1016,1019,1026,1050,1064,1065,1067,1068,1069,1070,1071,1080,1092,1101,1102,1108,1109,1120,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1154,1156,1157,1160,],[46,46,-186,-204,-194,-187,46,46,46,46,-170,46,46,-206,-262,-203,-193,46,-192,-174,-202,-189,-172,46,-171,46,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,46,46,46,46,46,-205,46,46,-167,46,46,46,-508,-452,-553,-529,-249,46,46,46,46,-175,46,46,-279,46,46,46,46,-277,46,46,46,-286,46,-17,-11,-9,-10,46,-18,-12,-15,-8,-19,-16,-14,-13,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,-281,-164,-168,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,-283,-280,46,46,-260,46,-278,-290,-287,-284,-623,46,46,-228,46,46,46,46,46,46,46,-516,-466,46,-559,-533,46,46,46,46,46,46,46,46,46,46,46,-251,-285,-288,-296,-289,46,46,46,46,46,46,-263,-231,46,-185,46,-536,-534,46,46,-307,-261,46,-308,46,46,46,46,46,46,46,-282,46,-306,-297,46,-234,46,-271,-264,46,46,46,46,46,46,46,46,-535,-309,-310,46,46,46,-276,-274,-265,46,-272,-266,46,-232,46,-313,-311,-314,-312,-291,46,-267,-273,46,46,46,46,-315,-317,-318,-316,-236,46,46,46,]),';':([1,4,5,6,7,8,9,11,12,16,20,21,23,30,31,34,37,38,41,42,43,44,45,46,47,48,49,50,51,53,55,56,57,59,60,61,62,63,64,67,69,72,76,78,79,82,84,85,87,88,89,90,91,92,93,95,96,98,99,101,110,112,117,121,122,124,127,133,134,135,136,137,138,139,141,142,143,144,145,146,148,150,151,152,153,156,159,160,161,162,163,164,165,167,168,169,170,171,173,174,178,179,180,181,182,183,185,186,187,189,190,195,196,197,204,207,209,210,211,212,213,216,219,221,226,227,228,229,231,232,233,234,235,236,238,239,240,241,242,245,247,248,250,256,258,260,261,262,263,264,265,266,269,271,272,277,278,279,286,287,291,292,300,302,303,308,311,318,321,324,328,330,336,345,349,362,368,369,381,382,385,386,387,388,389,391,394,405,406,410,412,415,416,419,420,421,425,426,427,429,431,433,436,438,439,440,443,446,447,448,449,450,452,453,454,455,456,458,460,462,464,465,466,467,469,470,471,474,475,476,477,479,482,484,485,486,487,488,489,490,492,497,498,533,534,535,538,549,551,559,562,568,569,570,571,572,579,585,586,588,592,593,598,602,605,606,609,611,612,614,615,619,623,625,626,628,629,631,633,634,635,636,637,638,639,640,641,642,643,644,646,649,650,656,657,658,659,660,661,662,663,664,665,666,667,668,670,677,679,682,684,686,688,689,690,692,700,701,702,703,704,708,709,710,711,713,716,717,720,722,724,725,726,727,728,730,731,732,733,734,735,736,737,739,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,777,778,779,781,785,788,804,805,807,809,811,813,818,819,820,821,831,833,834,835,838,839,843,844,845,846,848,849,851,858,860,862,872,874,878,881,883,895,896,897,903,904,906,907,909,913,914,916,917,918,919,920,922,925,941,945,946,948,950,953,956,959,961,962,963,964,967,968,969,970,973,975,976,984,986,987,990,992,993,997,998,1000,1003,1005,1007,1008,1011,1012,1013,1014,1015,1016,1017,1020,1022,1023,1024,1030,1031,1032,1036,1038,1040,1043,1045,1046,1047,1049,1055,1057,1058,1059,1060,1061,1063,1064,1065,1067,1068,1069,1070,1071,1079,1080,1083,1086,1088,1089,1090,1091,1093,1094,1100,1101,1102,1103,1105,1106,1107,1108,1109,1110,1111,1112,1114,1115,1118,1119,1120,1123,1124,1125,1127,1128,1129,1130,1131,1133,1134,1135,1136,1137,1138,1139,1140,1141,1143,1145,1148,1149,1151,1153,1154,1155,1156,1160,],[47,181,190,-186,-204,-194,-187,47,-345,-623,47,-594,-212,-170,-380,-209,47,-347,-211,-138,-585,-378,-206,-349,-262,-341,-203,266,-346,-193,-142,-137,-342,-192,-174,-202,-136,271,-189,-379,-172,-144,-171,-210,-188,-200,-173,-348,286,-191,-350,-208,-201,-197,-199,-190,-586,-169,-198,-139,-185,-381,-213,-207,-196,-584,-195,-140,-108,-25,-343,-88,-63,-141,-77,-143,-107,-3,-128,-96,-127,-20,-119,-111,-1,-130,-58,-30,-40,-50,-129,-45,-122,-4,-35,-449,-448,181,-610,-608,181,-618,-611,-451,-612,181,-613,-450,-447,391,-205,-245,394,-244,-167,47,-176,-623,-180,-178,-343,-383,-117,-119,-508,446,462,-452,-385,181,-553,-529,488,-249,-113,-27,-68,-100,-22,-112,-37,-60,-123,-47,-42,-81,-53,-32,-126,-116,-91,-175,549,-279,551,-118,559,-623,-277,579,-156,-155,-398,-392,-399,-391,-286,-389,-381,-383,-588,47,-134,-135,-120,-109,-110,-121,181,181,668,-609,181,-619,-607,-605,-281,-164,-168,-131,-132,-577,-575,-133,-574,-576,-153,-154,-182,-177,-388,-387,-382,-525,-519,-524,-521,-527,701,-526,-523,-528,-522,446,-479,-478,-469,462,-472,-481,701,-480,-476,-475,-473,-501,-474,-471,-477,-386,-562,-565,-567,-566,181,717,488,462,-540,-537,488,-623,-124,-114,-115,-125,-146,-283,-280,-260,-239,-240,-242,-238,-241,785,-278,-343,-149,-344,-158,-157,-417,-418,-400,824,-301,-290,-287,-284,-623,-384,-335,-339,-340,-228,-7,-152,-31,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-26,-145,-64,-67,-65,-66,-36,-46,-59,-52,-51,-41,181,858,-614,-606,47,-581,-587,-595,-179,-184,-183,-181,-145,-516,-503,-520,-466,-470,-502,47,-484,-483,-559,-563,-564,488,-539,-542,-533,-541,-543,-544,-33,-71,-86,-84,-82,-69,-73,-75,-28,-44,-85,-106,-39,-55,-95,-87,-29,-93,-70,-72,-83,-102,-34,-74,-49,-76,-61,-104,-57,-43,-54,-56,-48,-92,-94,-62,-38,-105,-101,-103,-332,-331,-221,916,917,-623,-623,925,-330,-150,-251,-393,-419,-420,-402,-405,-401,-404,-285,-288,-296,-289,-390,-384,-338,-333,-336,-334,-151,47,-162,-616,969,-263,-231,47,-185,-580,-579,-623,-623,1000,-623,-623,-536,-538,-534,1015,1016,-307,-261,-182,-623,-243,1019,-308,-282,-421,-422,-406,-302,-306,-297,-623,-337,-234,-21,-163,-159,1063,-615,1064,-271,-264,47,-623,47,47,-578,-217,-216,-623,-507,-482,-495,-494,-500,-623,-535,-545,-23,-24,-309,-310,-182,-227,-226,1101,1102,-225,1108,1109,-403,-423,-424,-407,-408,-410,-411,-304,-623,-326,-327,-320,-623,-160,-617,-276,-274,-265,47,-272,-266,47,1130,-232,-218,-504,-499,-496,-497,-571,-568,-572,-224,-313,-311,-623,-223,1137,1138,-314,-312,-222,1139,1140,-426,-425,-412,-305,-291,-323,-623,-319,-267,-273,47,-623,47,-573,47,-322,-623,-315,-317,-318,-316,-427,-428,-409,-324,-161,1157,-498,-236,-321,47,47,]),'ABSTRACT':([1,4,6,7,8,9,10,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,178,179,180,181,182,183,185,186,187,188,190,204,207,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,720,725,824,826,831,832,833,834,835,858,862,872,878,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1095,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[129,129,-186,-204,-194,-187,-361,129,-594,129,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,129,-610,-608,-362,129,-618,-611,-451,-612,129,-613,-450,-447,129,-205,-167,129,-343,-354,-508,129,129,-452,129,-553,-529,129,-249,-175,-279,129,-277,129,-286,-588,129,129,129,-609,129,-619,-605,-281,-164,-168,-525,-519,-524,129,-521,-527,-526,-523,-528,129,-522,129,-479,-478,-469,129,-472,-481,129,-480,-476,-475,129,-473,-501,-474,-358,-471,-477,-562,-565,129,-567,-566,129,129,129,-283,-280,-260,129,-278,-344,129,-290,-287,-284,-623,-228,129,-614,-587,-595,-516,-503,-520,-466,-470,-502,129,-484,-483,-559,-563,-564,129,-533,-303,129,-285,129,-288,-296,-289,-616,-263,-231,-185,129,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,129,129,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,129,-272,-266,129,-232,-505,-569,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'PUBLIC':([1,4,6,7,8,9,10,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,178,179,180,181,182,183,185,186,187,188,190,204,207,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,720,725,824,826,831,832,833,834,835,858,862,872,878,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1095,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[114,114,-186,-204,-194,-187,-361,114,-594,114,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,114,-610,-608,-362,114,-618,-611,-451,-612,114,-613,-450,-447,114,-205,-167,114,-343,-354,-508,114,114,-452,114,-553,-529,114,-249,-175,-279,114,-277,114,-286,-588,114,114,114,-609,114,-619,-605,-281,-164,-168,-525,-519,-524,114,-521,-527,-526,-523,-528,114,-522,114,-479,-478,-469,114,-472,-481,114,-480,-476,-475,114,-473,-501,-474,-358,-471,-477,-562,-565,114,-567,-566,114,114,114,-283,-280,-260,114,-278,-344,114,-290,-287,-284,-623,-228,114,-614,-587,-595,-516,-503,-520,-466,-470,-502,114,-484,-483,-559,-563,-564,114,-533,-303,114,-285,114,-288,-296,-289,-616,-263,-231,-185,114,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,114,114,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,114,-272,-266,114,-232,-505,-569,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'CHAR_LITERAL':([1,2,6,7,8,9,11,16,20,25,30,37,40,45,47,49,53,58,59,60,61,64,69,73,76,77,79,82,84,88,91,92,93,95,98,99,110,122,127,132,147,154,155,157,190,194,203,204,207,208,220,226,229,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,311,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,394,405,406,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,549,551,552,553,559,560,579,611,612,614,615,621,624,628,650,653,671,677,685,687,692,700,703,709,713,725,729,776,784,785,786,790,791,792,798,799,800,807,831,833,834,835,836,841,849,850,852,857,862,872,874,878,882,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,951,953,956,958,962,965,973,975,976,977,983,984,986,987,988,991,1011,1015,1016,1019,1026,1050,1064,1065,1067,1068,1069,1070,1071,1080,1092,1101,1102,1108,1109,1120,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1154,1156,1157,1160,],[51,51,-186,-204,-194,-187,51,51,51,51,-170,51,51,-206,-262,-203,-193,51,-192,-174,-202,-189,-172,51,-171,51,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,51,51,51,51,51,-205,51,51,-167,51,51,51,-508,-452,-553,-529,-249,51,51,51,51,-175,51,51,-279,51,51,51,51,-277,51,51,51,-286,51,-17,-11,-9,-10,51,-18,-12,-15,-8,-19,-16,-14,-13,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,-281,-164,-168,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,-283,-280,51,51,-260,51,-278,-290,-287,-284,-623,51,51,-228,51,51,51,51,51,51,51,-516,-466,51,-559,-533,51,51,51,51,51,51,51,51,51,51,51,-251,-285,-288,-296,-289,51,51,51,51,51,51,-263,-231,51,-185,51,-536,-534,51,51,-307,-261,51,-308,51,51,51,51,51,51,51,-282,51,-306,-297,51,-234,51,-271,-264,51,51,51,51,51,51,51,51,-535,-309,-310,51,51,51,-276,-274,-265,51,-272,-266,51,-232,51,-313,-311,-314,-312,-291,51,-267,-273,51,51,51,51,-315,-317,-318,-316,-236,51,51,51,]),'FLOAT':([1,2,6,7,8,9,10,11,16,20,21,24,25,30,37,40,43,45,47,48,49,53,57,58,59,60,61,64,69,71,73,74,75,76,77,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,107,110,113,114,115,116,122,124,127,129,130,131,132,147,154,155,157,158,169,170,175,181,186,187,190,194,203,204,207,208,213,218,220,226,227,228,229,230,232,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,309,311,328,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,394,396,397,405,406,411,428,438,439,440,441,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,463,465,466,467,468,469,470,471,473,474,475,477,478,479,480,482,483,484,485,488,491,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,549,551,552,553,559,560,566,579,588,597,599,600,604,605,608,611,612,614,615,621,624,628,650,653,671,674,675,677,682,684,685,687,692,693,697,699,700,701,702,703,704,706,708,709,710,711,713,715,716,717,725,729,776,784,785,786,790,791,792,798,799,800,807,818,819,820,821,824,826,831,832,833,834,835,836,841,849,850,852,857,862,864,866,872,874,878,882,894,899,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,942,943,944,945,946,947,948,951,953,955,956,958,962,965,973,975,976,977,978,979,981,983,984,986,987,988,991,999,1000,1002,1007,1009,1011,1015,1016,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1074,1077,1080,1087,1092,1095,1101,1102,1108,1109,1113,1114,1115,1116,1117,1118,1120,1122,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[52,52,-186,-204,-194,-187,-361,52,52,52,-594,52,52,-170,52,52,-585,-206,-262,-341,-203,-193,-342,52,-192,-174,-202,-189,-172,-352,52,-363,-365,-171,52,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,52,-185,-357,-355,-366,52,-196,-584,-195,-359,-358,-364,52,52,52,52,52,52,-449,-448,-362,-451,-450,-447,-205,52,52,-167,52,52,-343,-354,52,-508,-623,-623,-452,52,-623,-553,-529,-249,52,52,52,52,-175,52,52,-279,52,52,52,52,-277,52,52,52,52,-286,-588,52,-17,-11,-9,-10,52,-18,-12,-15,-8,-19,-16,-14,-13,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,-281,-439,-430,-164,-168,52,52,-525,-519,-524,-623,-352,-521,52,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,52,-481,-623,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-623,-567,52,-566,-623,-623,-351,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,-283,-280,52,52,-260,52,52,-278,-344,52,52,52,52,-400,52,-290,-287,-284,-623,52,52,-228,52,52,52,-441,52,52,-587,-595,52,52,52,52,-352,52,-516,-503,-520,-466,-470,52,-502,52,-484,-483,-559,52,-563,-564,-533,52,52,52,52,52,52,52,52,52,52,52,-251,-402,-405,-401,-404,-303,52,-285,-623,-288,-296,-289,52,52,52,52,52,52,-263,-440,-442,-231,52,-185,52,-623,-487,-536,-534,52,52,-307,-261,52,-308,52,52,52,52,52,52,52,-282,52,52,52,-421,-422,52,-406,52,-306,52,-297,52,-234,52,-271,-264,52,52,-443,52,-444,52,52,52,52,52,52,-506,-482,-486,-500,-570,-535,-309,-310,52,52,-403,-423,-424,-407,-408,-410,-411,52,-276,-274,-265,52,-272,-266,52,-446,-445,-232,-505,52,-569,-313,-311,-314,-312,52,-426,-425,52,52,-412,-291,52,52,-267,-273,52,52,52,52,-315,-317,-318,-316,-427,-428,-409,-236,52,52,52,]),'ASSERT':([1,6,7,8,9,11,20,30,37,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,207,226,229,233,234,236,266,271,286,311,330,394,405,406,549,551,559,579,611,612,614,615,628,677,700,703,709,713,725,807,831,833,834,835,849,862,872,874,878,906,909,916,917,925,941,953,956,962,973,975,976,986,987,1011,1015,1016,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[77,-186,-204,-194,-187,77,77,-170,77,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,77,-508,-452,-553,-529,-249,-175,-279,-277,-286,77,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,77,-516,-466,77,-559,-533,-251,-285,-288,-296,-289,77,-263,-231,77,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-271,-264,77,77,77,-535,-309,-310,-276,-274,-265,77,-272,-266,77,-232,-313,-311,-314,-312,-291,-267,-273,77,77,77,-315,-317,-318,-316,-236,77,77,]),'@':([1,4,6,7,8,9,10,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,178,179,180,181,182,183,185,186,187,188,190,204,207,208,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,381,382,383,386,387,388,391,394,405,406,411,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,682,684,685,700,701,702,703,704,708,709,710,711,713,716,717,720,725,824,826,831,832,833,834,835,858,862,872,878,882,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1092,1095,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[118,118,-186,-204,-194,-187,-361,118,-594,215,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,118,-610,-608,-362,118,-618,-611,-451,-612,118,-613,-450,-447,215,-205,-167,118,422,-343,-354,-508,118,118,-452,118,-553,-529,422,-249,-175,-279,422,-277,422,-286,-588,118,118,215,-609,118,-619,-605,-281,-164,-168,422,-525,-519,-524,422,-521,-527,-526,-523,-528,215,-522,118,-479,-478,-469,118,-472,-481,422,-480,-476,-475,215,-473,-501,-474,-358,-471,-477,-562,-565,422,-567,-566,118,118,422,-283,-280,-260,422,-278,-344,422,-290,-287,-284,-623,-228,118,-614,-587,-595,422,-516,-503,-520,-466,-470,-502,118,-484,-483,-559,-563,-564,422,-533,-303,422,-285,422,-288,-296,-289,-616,-263,-231,-185,422,422,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,118,422,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,118,-272,-266,118,-232,-505,422,-569,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'ELSE':([7,8,45,47,49,53,59,61,82,91,92,93,99,122,127,190,271,286,311,394,405,549,551,559,579,611,612,614,615,831,833,834,835,862,868,869,873,875,876,878,879,916,917,925,941,953,956,975,985,1015,1016,1064,1067,1070,1081,1101,1102,1108,1109,1120,1127,1137,1138,1139,1140,1150,1152,1158,1161,],[-204,-194,-206,-262,-203,-193,-192,-202,-200,-201,-197,-199,-198,-196,-195,-205,-279,-277,-286,-281,-164,-283,-280,-260,-278,-290,-287,-284,-623,-285,-288,-296,-289,-263,-255,-257,-256,-258,986,-254,-259,-307,-261,-308,-282,-306,-297,-264,-250,-309,-310,-276,-265,-266,-229,-313,-311,-314,-312,-291,-267,-315,-317,-318,-316,1156,-235,-233,-237,]),'XOR_ASSIGN':([12,23,38,41,42,46,48,51,55,56,57,62,68,70,72,78,85,89,97,100,101,117,123,133,136,139,142,145,148,151,156,163,192,246,251,253,259,336,345,366,434,512,538,561,563,567,573,580,585,586,587,588,589,623,625,626,631,640,643,644,646,650,703,772,773,777,804,805,843,844,845,846,848,921,959,961,992,993,1020,1022,1030,1055,1057,1058,1059,1060,1083,1100,1103,1105,1110,1123,1124,1125,1135,1136,1148,1155,],[-345,-143,-347,-130,-138,-349,-341,-346,-142,-137,-342,-136,-343,-140,-144,-129,-348,-350,-127,-128,-139,-141,341,-140,-343,-141,-143,-128,-127,341,-130,-129,-128,-128,-127,-130,-129,-134,-135,-128,-128,-145,-146,-343,-127,-128,-329,-328,-343,-149,-147,-344,-148,-335,-339,-340,-152,-329,-147,-148,-328,-145,-466,-332,-331,-221,-330,-150,-338,-333,-336,-334,-151,-128,-623,-337,-217,-216,-227,-226,-225,-623,-326,-327,-320,-623,-218,-224,-623,-223,-222,-323,-623,-319,-322,-623,-324,-321,]),'NEQ':([12,31,38,42,44,46,48,51,55,56,57,62,67,72,85,89,101,112,133,134,136,137,138,139,141,142,143,145,146,148,151,152,156,159,162,163,164,165,213,216,219,221,231,238,240,241,245,246,248,250,251,253,256,259,260,261,263,264,265,277,291,292,300,302,303,308,318,336,345,349,362,366,368,369,410,412,416,419,423,431,433,434,476,498,533,534,535,538,585,586,588,592,593,598,602,605,619,623,625,626,631,634,635,636,637,638,639,640,641,642,643,644,646,650,656,657,658,659,661,662,663,664,692,703,731,732,733,734,735,736,737,742,743,745,746,747,749,750,751,752,753,755,756,757,758,759,760,762,763,764,765,766,767,769,770,771,772,773,777,804,805,809,811,813,818,819,820,821,838,843,844,845,846,848,851,855,945,946,948,959,961,964,967,992,993,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1083,1100,1103,1105,1110,1114,1115,1118,1123,1124,1125,1135,1136,1141,1143,1145,1148,1149,1155,],[-345,-380,-347,-138,-378,-349,-341,-346,-142,-137,-342,-136,-379,-144,-348,-350,-139,-381,-140,-108,-343,-88,-63,-141,-77,-143,-107,-128,-96,-127,-119,-111,-130,-58,-50,-129,377,-122,-343,-383,-117,-119,-385,-113,-68,-100,-112,531,-60,-123,-131,-133,537,-132,-81,-53,-126,-116,-91,-118,-156,-155,-398,-392,-399,-391,-389,-134,-135,-120,-109,531,-110,-121,-131,-132,531,-133,-341,-388,-387,531,-386,-124,-114,-115,-125,-146,-343,-149,-344,-158,-157,-417,-418,-400,-384,-335,-339,-340,-152,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-145,-64,-67,-65,-66,377,-59,-52,-51,-145,-466,-71,-86,-84,-82,-69,-73,-75,-85,-106,-55,-95,-87,-93,-70,-72,-83,-102,-74,377,-76,-61,-104,-57,-54,-56,377,-92,-94,-62,-105,-101,-103,-332,-331,-221,-330,-150,-393,-419,-420,-402,-405,-401,-404,-390,-338,-333,-336,-334,-151,-162,-128,-421,-422,-406,-623,-337,-163,-159,-217,-216,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,-218,-224,-623,-223,-222,-426,-425,-412,-323,-623,-319,-322,-623,-427,-428,-409,-324,-161,-321,]),'THROWS':([291,292,425,426,592,593,895,901,997,998,],[-156,-155,-153,-154,-158,-157,-623,1004,1004,-507,]),'IMPLEMENTS':([17,26,31,48,54,57,83,198,213,222,224,225,231,267,300,302,303,308,321,324,396,397,401,402,435,436,476,588,598,602,605,627,674,676,691,809,811,813,818,819,820,821,839,847,864,866,892,945,946,948,978,981,1036,1038,1040,1043,1045,1046,1047,1074,1077,1114,1115,1118,1141,1143,1145,],[-455,-623,-380,-341,-623,-342,285,-454,-343,-458,-457,285,-385,285,-398,-392,-399,-391,-381,-383,-439,-430,-531,-456,-459,-382,-386,-344,-417,-418,-400,-558,-441,-532,-555,-393,-419,-420,-402,-405,-401,-404,-384,-557,-440,-442,-556,-421,-422,-406,-443,-444,-403,-423,-424,-407,-408,-410,-411,-446,-445,-426,-425,-412,-427,-428,-409,]),'PLUSPLUS':([0,1,2,6,7,8,9,11,12,16,20,23,25,30,37,38,40,41,42,45,46,47,48,49,51,53,55,56,57,58,59,60,61,62,64,68,69,70,72,73,76,77,78,79,82,84,85,88,89,91,92,93,95,97,98,99,100,101,110,117,122,123,127,132,133,136,139,142,145,147,148,151,154,155,156,157,163,190,192,194,203,204,207,208,220,221,226,229,233,234,236,237,246,249,251,252,253,254,259,266,268,270,271,275,276,279,281,286,290,294,295,311,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,348,350,351,352,353,354,355,356,358,359,364,365,366,370,371,372,373,374,375,377,378,380,394,405,406,409,410,411,412,416,419,423,428,434,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,538,539,540,541,543,544,545,546,549,551,552,553,559,560,561,563,567,573,579,580,585,586,587,588,589,611,612,614,615,621,623,624,625,626,628,631,640,643,644,646,650,653,671,677,685,687,692,700,703,709,713,725,729,772,773,776,777,784,785,786,790,791,792,798,799,800,804,805,807,831,833,834,835,836,841,843,844,845,846,848,849,850,855,857,862,872,874,878,882,906,909,911,912,916,917,921,924,925,930,932,933,934,938,939,940,941,951,953,956,958,959,961,962,973,975,976,977,983,984,986,987,988,991,992,993,1011,1015,1016,1019,1020,1022,1026,1030,1050,1055,1057,1058,1059,1060,1064,1065,1067,1068,1069,1070,1071,1080,1083,1092,1100,1101,1102,1103,1105,1108,1109,1110,1120,1123,1124,1125,1127,1128,1129,1130,1131,1134,1135,1136,1137,1138,1139,1140,1148,1154,1155,1156,1157,1160,],[4,25,25,-186,-204,-194,-187,25,-345,25,25,-143,25,-170,25,-347,25,-130,-138,-206,-349,-262,-341,-203,-346,-193,-142,-137,-342,25,-192,-174,-202,-136,-189,-343,-172,-140,-144,25,-171,25,-129,-188,-200,-173,-348,-191,-350,-201,-197,-199,-190,-127,-169,-198,-128,-139,-185,-141,-196,336,-195,25,-140,-343,-141,-143,-128,25,-127,336,25,25,-130,25,-129,-205,-128,25,25,-167,25,25,25,336,-508,-452,-553,-529,-249,25,-128,25,-127,25,-130,25,-129,-175,25,25,-279,25,25,25,25,-277,25,25,25,-286,25,-17,-11,-9,-10,25,-134,-18,-12,-15,-8,-19,-16,-14,-13,-135,25,25,25,25,25,25,25,25,25,25,25,25,-128,25,25,25,25,25,25,25,25,25,-281,-164,-168,336,-127,25,-129,-128,-130,-341,25,-128,25,25,25,25,25,25,25,25,25,25,25,25,25,-145,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,-146,25,25,25,25,25,25,25,-283,-280,25,25,-260,25,-343,-127,-128,-329,-278,-328,-343,-149,-147,-344,-148,-290,-287,-284,-623,25,-335,25,-339,-340,-228,-152,-329,-147,-148,-328,-145,25,25,25,25,25,-145,-516,-466,25,-559,-533,25,-332,-331,25,-221,25,25,25,25,25,25,25,25,25,-330,-150,-251,-285,-288,-296,-289,25,25,-338,-333,-336,-334,-151,25,25,-128,25,-263,-231,25,-185,25,-536,-534,25,25,-307,-261,-128,25,-308,25,25,25,25,25,25,25,-282,25,-306,-297,25,-623,-337,-234,-271,-264,25,25,25,25,25,25,25,25,-217,-216,-535,-309,-310,25,-227,-226,25,-225,25,-623,-326,-327,-320,-623,-276,-274,-265,25,-272,-266,25,-232,-218,25,-224,-313,-311,-623,-223,-314,-312,-222,-291,-323,-623,-319,-267,-273,25,25,25,25,-322,-623,-315,-317,-318,-316,-324,-236,-321,25,25,25,]),'DEFAULT':([6,7,8,9,30,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,226,229,233,234,236,266,271,286,291,292,311,394,405,406,425,426,549,551,559,579,592,593,611,612,614,615,628,700,703,713,725,831,833,834,835,862,863,872,878,903,906,909,916,917,925,941,953,956,962,972,973,974,975,976,998,1008,1011,1015,1016,1064,1065,1066,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[-186,-204,-194,-187,-170,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,-508,-452,-553,-529,-249,-175,-279,-277,-156,-155,-286,-281,-164,-168,-153,-154,-283,-280,-260,-278,-158,-157,-290,-287,-284,-623,-228,-516,-466,-559,-533,-285,-288,-296,-289,-263,971,-231,-185,-623,-536,-534,-307,-261,-308,-282,-306,-297,-234,971,-271,-268,-264,971,-507,1092,-535,-309,-310,-276,-274,-269,-265,971,-272,-266,-270,-232,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'WHILE':([1,6,7,8,9,11,20,30,37,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,191,204,207,226,229,233,234,236,266,271,286,311,330,394,405,406,549,551,559,579,611,612,614,615,628,677,700,703,709,713,725,807,831,833,834,835,849,862,872,874,878,906,909,916,917,925,941,953,956,962,973,975,976,986,987,1011,1015,1016,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[126,-186,-204,-194,-187,126,126,-170,126,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,392,-167,126,-508,-452,-553,-529,-249,-175,-279,-277,-286,126,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,880,-516,-466,126,-559,-533,-251,-285,-288,-296,-289,126,-263,-231,880,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-271,-264,126,126,880,-535,-309,-310,-276,-274,-265,126,-272,-266,126,-232,-313,-311,-314,-312,-291,-267,-273,880,880,126,-315,-317,-318,-316,-236,880,880,]),'DOUBLE':([1,2,6,7,8,9,10,11,16,20,21,24,25,30,37,40,43,45,47,48,49,53,57,58,59,60,61,64,69,71,73,74,75,76,77,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,107,110,113,114,115,116,122,124,127,129,130,131,132,147,154,155,157,158,169,170,175,181,186,187,190,194,203,204,207,208,213,218,220,226,227,228,229,230,232,233,234,236,237,249,252,254,266,268,270,271,275,276,279,281,286,290,294,295,309,311,328,330,331,332,333,334,335,337,338,339,340,341,342,343,344,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,394,396,397,405,406,411,428,438,439,440,441,442,443,444,446,448,449,450,451,452,453,454,455,456,458,459,460,461,462,463,465,466,467,468,469,470,471,473,474,475,477,478,479,480,482,483,484,485,488,491,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,549,551,552,553,559,560,566,579,588,597,599,600,604,605,608,611,612,614,615,621,624,628,650,653,671,674,675,677,682,684,685,687,692,693,697,699,700,701,702,703,704,706,708,709,710,711,713,715,716,717,725,729,776,784,785,786,790,791,792,798,799,800,807,818,819,820,821,824,826,831,832,833,834,835,836,841,849,850,852,857,862,864,866,872,874,878,882,894,899,906,909,911,912,916,917,924,925,930,932,933,934,938,939,940,941,942,943,944,945,946,947,948,951,953,955,956,958,962,965,973,975,976,977,978,979,981,983,984,986,987,988,991,999,1000,1002,1007,1009,1011,1015,1016,1019,1026,1036,1038,1040,1043,1045,1046,1047,1050,1064,1065,1067,1068,1069,1070,1071,1074,1077,1080,1087,1092,1095,1101,1102,1108,1109,1113,1114,1115,1116,1117,1118,1120,1122,1126,1127,1128,1129,1130,1131,1134,1137,1138,1139,1140,1141,1143,1145,1154,1156,1157,1160,],[128,128,-186,-204,-194,-187,-361,128,128,128,-594,128,128,-170,128,128,-585,-206,-262,-341,-203,-193,-342,128,-192,-174,-202,-189,-172,-352,128,-363,-365,-171,128,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,128,-185,-357,-355,-366,128,-196,-584,-195,-359,-358,-364,128,128,128,128,128,128,-449,-448,-362,-451,-450,-447,-205,128,128,-167,128,128,-343,-354,128,-508,-623,-623,-452,128,-623,-553,-529,-249,128,128,128,128,-175,128,128,-279,128,128,128,128,-277,128,128,128,128,-286,-588,128,-17,-11,-9,-10,128,-18,-12,-15,-8,-19,-16,-14,-13,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,-281,-439,-430,-164,-168,128,128,-525,-519,-524,-623,-352,-521,128,-527,-526,-523,-528,-351,-522,-623,-479,-478,-469,-623,-352,-472,128,-481,-623,-480,-476,-475,-351,-473,-501,-474,-358,-471,-477,-562,-352,-565,-623,-567,128,-566,-623,-623,-351,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,-283,-280,128,128,-260,128,128,-278,-344,128,128,128,128,-400,128,-290,-287,-284,-623,128,128,-228,128,128,128,-441,128,128,-587,-595,128,128,128,128,-352,128,-516,-503,-520,-466,-470,128,-502,128,-484,-483,-559,128,-563,-564,-533,128,128,128,128,128,128,128,128,128,128,128,-251,-402,-405,-401,-404,-303,128,-285,-623,-288,-296,-289,128,128,128,128,128,128,-263,-440,-442,-231,128,-185,128,-623,-487,-536,-534,128,128,-307,-261,128,-308,128,128,128,128,128,128,128,-282,128,128,128,-421,-422,128,-406,128,-306,128,-297,128,-234,128,-271,-264,128,128,-443,128,-444,128,128,128,128,128,128,-506,-482,-486,-500,-570,-535,-309,-310,128,128,-403,-423,-424,-407,-408,-410,-411,128,-276,-274,-265,128,-272,-266,128,-446,-445,-232,-505,128,-569,-313,-311,-314,-312,128,-426,-425,128,128,-412,-291,128,128,-267,-273,128,128,128,128,-315,-317,-318,-316,-427,-428,-409,-236,128,128,128,]),'THROW':([1,6,7,8,9,11,20,30,37,45,47,49,53,59,60,61,64,69,76,79,82,84,88,91,92,93,95,98,99,110,122,127,190,204,207,226,229,233,234,236,266,271,286,311,330,394,405,406,549,551,559,579,611,612,614,615,628,677,700,703,709,713,725,807,831,833,834,835,849,862,872,874,878,906,909,916,917,925,941,953,956,962,973,975,976,986,987,1011,1015,1016,1064,1065,1067,1068,1069,1070,1071,1080,1101,1102,1108,1109,1120,1127,1128,1129,1131,1134,1137,1138,1139,1140,1154,1156,1160,],[58,-186,-204,-194,-187,58,58,-170,58,-206,-262,-203,-193,-192,-174,-202,-189,-172,-171,-188,-200,-173,-191,-201,-197,-199,-190,-169,-198,-185,-196,-195,-205,-167,58,-508,-452,-553,-529,-249,-175,-279,-277,-286,58,-281,-164,-168,-283,-280,-260,-278,-290,-287,-284,-623,-228,58,-516,-466,58,-559,-533,-251,-285,-288,-296,-289,58,-263,-231,58,-185,-536,-534,-307,-261,-308,-282,-306,-297,-234,-271,-264,58,58,58,-535,-309,-310,-276,-274,-265,58,-272,-266,58,-232,-313,-311,-314,-312,-291,-267,-273,58,58,58,-315,-317,-318,-316,-236,58,58,]),'$end':([3,4,6,7,8,9,12,30,31,38,39,42,44,45,46,47,48,49,51,53,55,56,57,59,60,61,62,64,67,69,72,76,79,82,84,85,88,89,91,92,93,95,98,99,101,110,112,122,127,133,134,135,136,137,138,139,141,142,143,144,145,146,148,149,150,151,152,153,156,159,160,161,162,163,164,165,167,168,169,170,171,172,173,174,176,178,179,180,181,182,183,185,186,187,190,213,216,219,221,226,229,231,233,234,236,266,271,277,286,291,292,300,302,303,308,311,318,336,345,349,362,368,369,381,382,386,387,388,391,394,405,431,433,476,538,549,551,559,579,585,586,588,592,593,598,602,605,611,612,614,615,619,623,625,626,628,629,631,633,634,635,636,637,638,639,640,641,642,643,644,646,649,650,656,657,658,659,660,661,662,663,664,665,666,668,692,700,703,713,725,772,773,777,804,805,809,811,813,818,819,820,821,831,833,834,835,838,843,844,845,846,848,851,858,862,872,878,906,909,916,917,925,941,945,946,948,953,956,959,961,962,963,964,967,969,975,992,993,1011,1015,1016,1020,1022,1030,1036,1038,1040,1043,1045,1046,1047,1055,1057,1058,1059,1060,1061,1063,1064,1067,1070,1080,1083,1100,1101,1102,1103,1105,1108,1109,1110,1114,1115,1118,1120,1123,1124,1125,1127,1135,1136,1137,1138,1139,1140,1141,1143,1145,1148,1149,1154,1155,],[0,-623,-186,-204,-194,-187,-345,-170,-380,-347,-622,-138,-378,-206,-349,-262,-341,-203,-346,-193,-142,-137,-342,-192,-174,-202,-136,-189,-379,-172,-144,-171,-188,-200,-173,-348,-191,-350,-201,-197,-199,-190,-169,-198,-139,-185,-381,-196,-195,-140,-108,-25,-343,-88,-63,-141,-77,-143,-107,-3,-128,-96,-127,-621,-20,-119,-111,-1,-130,-58,-30,-40,-50,-129,-45,-122,-4,-35,-449,-448,-597,-620,-610,-608,-604,-601,-618,-611,-451,-612,-602,-613,-450,-447,-205,-343,-383,-117,-119,-508,-452,-385,-553,-529,-249,-175,-279,-118,-277,-156,-155,-398,-392,-399,-391,-286,-389,-134,-135,-120,-109,-110,-121,-598,-600,-609,-603,-619,-605,-281,-164,-388,-387,-386,-146,-283,-280,-260,-278,-343,-149,-344,-158,-157,-417,-418,-400,-290,-287,-284,-623,-384,-335,-339,-340,-228,-7,-152,-31,-99,-97,-98,-80,-79,-78,-329,-90,-89,-147,-148,-328,-26,-145,-64,-67,-65,-66,-36,-46,-59,-52,-51,-41,-599,-614,-145,-516,-466,-559,-533,-332,-331,-221,-330,-150,-393,-419,-420,-402,-405,-401,-404,-285,-288,-296,-289,-390,-338,-333,-336,-334,-151,-162,-616,-263,-231,-185,-536,-534,-307,-261,-308,-282,-421,-422,-406,-306,-297,-623,-337,-234,-21,-163,-159,-615,-264,-217,-216,-535,-309,-310,-227,-226,-225,-403,-423,-424,-407,-408,-410,-411,-623,-326,-327,-320,-623,-160,-617,-276,-265,-266,-232,-218,-224,-313,-311,-623,-223,-314,-312,-222,-426,-425,-412,-291,-323,-623,-319,-267,-322,-623,-315,-317,-318,-316,-427,-428,-409,-324,-161,-236,-321,]),'STATIC':([1,4,6,7,8,9,10,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,177,178,179,180,181,182,183,185,186,187,188,190,204,207,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,720,725,824,826,831,832,833,834,835,858,862,872,878,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1095,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[130,130,-186,-204,-194,-187,-361,130,-594,130,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,130,-610,-608,-362,384,130,-618,-611,-451,-612,130,-613,-450,-447,130,-205,-167,130,-343,-354,-508,130,473,-452,130,-553,-529,130,-249,-175,-279,130,-277,130,-286,-588,130,130,130,-609,130,-619,-605,-281,-164,-168,-525,-519,-524,130,-521,-527,-526,-523,-528,130,-522,130,-479,-478,-469,473,-472,-481,130,-480,-476,-475,130,-473,-501,-474,-358,-471,-477,-562,-565,130,-567,-566,130,473,130,-283,-280,-260,130,-278,-344,130,-290,-287,-284,-623,-228,130,-614,-587,-595,-516,-503,-520,-466,-470,-502,130,-484,-483,-559,-563,-564,130,-533,-303,130,-285,130,-288,-296,-289,-616,-263,-231,-185,130,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,130,130,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,130,-272,-266,130,-232,-505,-569,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),'VOLATILE':([1,4,6,7,8,9,10,20,21,24,30,43,45,47,48,49,53,57,59,60,61,64,69,74,75,76,79,82,84,88,91,92,93,95,96,98,99,102,104,105,106,110,113,114,115,122,124,127,129,130,131,169,170,171,173,174,175,178,179,180,181,182,183,185,186,187,188,190,204,207,213,218,226,227,228,229,232,233,234,235,236,266,271,279,286,309,311,328,381,382,383,386,387,388,391,394,405,406,438,439,440,441,443,446,448,449,450,451,452,453,454,455,456,458,460,462,463,465,466,467,468,469,470,471,473,474,475,477,479,480,482,484,485,488,491,549,551,559,566,579,588,608,611,612,614,615,628,666,668,682,684,700,701,702,703,704,708,709,710,711,713,716,717,720,725,824,826,831,832,833,834,835,858,862,872,878,894,899,906,909,916,917,925,941,953,956,962,969,973,975,976,984,999,1000,1002,1007,1009,1011,1015,1016,1063,1064,1065,1067,1068,1069,1070,1071,1080,1087,1095,1101,1102,1108,1109,1120,1127,1128,1137,1138,1139,1140,1154,],[131,131,-186,-204,-194,-187,-361,131,-594,131,-170,-585,-206,-262,-341,-203,-193,-342,-192,-174,-202,-189,-172,-363,-365,-171,-188,-200,-173,-191,-201,-197,-199,-190,-586,-169,-198,-362,-360,-356,-353,-185,-357,-355,-366,-196,-584,-195,-359,-358,-364,-449,-448,131,-610,-608,-362,131,-618,-611,-451,-612,131,-613,-450,-447,131,-205,-167,131,-343,-354,-508,131,131,-452,131,-553,-529,131,-249,-175,-279,131,-277,131,-286,-588,131,131,131,-609,131,-619,-605,-281,-164,-168,-525,-519,-524,131,-521,-527,-526,-523,-528,131,-522,131,-479,-478,-469,131,-472,-481,131,-480,-476,-475,131,-473,-501,-474,-358,-471,-477,-562,-565,131,-567,-566,131,131,131,-283,-280,-260,131,-278,-344,131,-290,-287,-284,-623,-228,131,-614,-587,-595,-516,-503,-520,-466,-470,-502,131,-484,-483,-559,-563,-564,131,-533,-303,131,-285,131,-288,-296,-289,-616,-263,-231,-185,131,-487,-536,-534,-307,-261,-308,-282,-306,-297,-234,-615,-271,-264,131,131,-506,-482,-486,-500,-570,-535,-309,-310,-617,-276,-274,-265,131,-272,-266,131,-232,-505,-569,-313,-311,-314,-312,-291,-267,-273,-315,-317,-318,-316,-236,]),}
_lr_action = {}
for _k, _v in _lr_action_items.items():
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_action: _lr_action[_x] = {}
_lr_action[_x][_k] = _y
del _lr_action_items
_lr_goto_items = {'member_values':([411,],[681,]),'statement_expression':([1,11,20,37,207,279,330,677,709,784,849,874,976,984,986,987,1019,1068,1071,1129,1131,1134,1156,1157,1160,],[5,5,5,5,5,569,5,5,5,920,5,5,5,569,5,5,569,5,5,5,5,5,5,569,5,]),'type_parameter1':([199,673,],[396,864,]),'for_update':([1019,1157,],[1096,1096,]),'switch_block':([672,],[862,]),'class_body_declarations':([228,488,],[458,458,]),'try_statement_with_resources':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,]),'catch_type':([955,],[1052,]),'if_then_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,]),'conditional_and_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,364,365,428,507,508,509,519,552,553,560,621,624,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,649,135,135,739,135,748,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,]),'additional_bound':([867,982,],[980,1076,]),'annotation_name':([1,4,20,24,171,178,183,188,207,208,227,228,232,235,279,309,381,382,383,387,411,441,451,453,458,463,468,480,485,488,491,566,608,666,685,709,720,826,832,882,894,976,984,1068,1071,1092,],[21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,]),'single_static_import_declaration':([4,171,178,381,],[182,182,182,182,]),'empty_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,]),'type_argument1':([107,230,597,604,653,942,947,1117,],[302,302,809,302,302,809,302,809,]),'while_statement_no_short_if':([677,874,987,1129,1131,1156,1160,],[869,869,869,869,869,869,869,]),'method_body':([464,472,],[708,710,]),'catch_clause':([310,614,615,835,],[612,833,612,833,]),'default_value':([1008,],[1091,]),'static_initializer':([228,458,488,],[460,460,460,]),'enum_header_name':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,]),'synchronized_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,]),'statement_expression_list':([279,984,1019,1157,],[568,568,1099,1099,]),'array_initializer':([428,625,626,687,951,991,1050,],[688,844,846,688,688,688,688,]),'import_declarations':([4,171,],[178,381,]),'class_header_name1':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,]),'modifiers_opt':([1,4,20,171,178,183,207,227,228,232,235,381,382,387,441,453,458,463,480,485,488,666,709,720,832,894,976,1068,1071,],[18,18,18,18,18,18,18,444,461,483,495,18,18,18,693,444,461,693,693,483,461,18,18,495,955,693,18,18,18,]),'interface_member_declarations_opt':([227,],[445,]),'constant_declaration':([227,232,453,485,],[443,479,443,479,]),'constant_expression':([977,],[1072,]),'constructor_header_name':([228,232,458,485,488,],[463,463,463,463,463,]),'try_block':([108,312,],[310,615,]),'member_value_pairs_opt':([208,],[413,]),'constructor_declaration':([228,232,458,485,488,],[469,484,469,484,469,]),'enum_body_declarations_opt':([235,487,492,720,],[496,719,723,908,]),'additive_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,350,354,355,356,364,365,370,371,372,373,374,375,377,378,380,428,499,500,501,502,503,504,505,506,507,508,509,510,511,515,516,518,519,521,522,523,525,526,527,528,531,532,536,537,539,543,552,553,560,621,624,653,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,637,638,639,141,141,141,141,141,141,141,141,141,141,141,141,141,141,732,733,734,141,141,141,141,141,141,141,742,141,141,747,141,141,141,752,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,]),'static_import_on_demand_declaration':([4,171,178,381,],[185,185,185,185,]),'type':([1,20,24,207,279,309,444,461,483,566,608,693,699,706,709,715,826,955,976,984,1068,1071,1122,],[22,22,214,22,565,607,698,698,714,782,829,893,898,898,22,905,607,1053,22,565,22,22,1147,]),'method_invocation':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[23,142,23,142,23,142,23,142,142,142,142,142,142,142,142,142,142,142,23,142,142,142,142,142,142,142,142,142,142,23,142,142,142,142,23,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,23,142,142,142,23,142,142,23,142,142,142,142,142,142,142,142,142,142,23,142,142,142,23,142,142,142,142,142,142,142,142,142,142,142,142,142,142,23,142,142,23,23,23,142,142,23,142,142,23,23,142,142,23,142,23,23,23,23,23,]),'assignment_expression_not_name':([40,154,220,],[244,244,244,]),'modifiers':([1,4,20,171,178,183,207,227,228,232,235,279,309,381,382,387,441,453,458,463,480,485,488,666,709,720,826,832,894,976,984,1068,1071,],[24,188,24,383,383,383,24,451,468,468,491,566,608,383,383,383,491,451,468,491,491,468,468,383,24,491,608,491,491,24,566,24,24,]),'annotation_method_header_default_value_opt':([1008,],[1093,]),'annotation_type_declaration_header_name':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,]),'literal':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,]),'method_header_throws_clause':([901,997,],[1005,1005,]),'class_header_extends':([26,54,],[224,224,]),'class_header':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,]),'resource':([309,826,],[609,950,]),'inclusive_or_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,350,364,365,428,499,507,508,509,519,525,552,553,560,621,624,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,633,160,160,160,730,160,160,160,160,754,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,]),'statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[30,191,30,236,30,628,872,30,962,236,30,1080,628,30,30,872,962,1154,1080,1154,]),'switch_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,]),'wildcard3':([947,1117,],[1047,1047,]),'interface_header_name':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,]),'interface_type':([285,315,789,],[576,576,926,]),'exclusive_or_expression_not_name':([40,154,208,220,411,685,882,1092,],[247,247,247,247,247,247,247,247,]),'arguments_opt':([497,],[726,]),'wildcard_bounds2':([817,1042,],[946,946,]),'relational_expression_not_name':([40,154,208,220,411,685,882,1092,],[248,248,248,248,248,248,248,248,]),'annotation_type_declaration_header':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,]),'enum_constants':([235,],[487,]),'single_member_annotation_member_value':([208,],[418,]),'goal':([0,],[3,]),'package_declaration':([4,],[171,]),'class_body_opt':([959,1055,1060,1103,1124,1136,],[1059,1123,1125,1135,1148,1155,]),'pre_decrement_expression':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,653,671,677,685,687,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1129,1130,1131,1134,1156,1157,1160,],[34,134,34,134,34,134,34,238,134,134,134,134,134,238,134,134,134,134,34,238,238,134,134,134,134,134,134,134,134,34,134,134,134,134,34,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,238,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,34,238,134,34,134,134,34,134,134,134,134,134,134,134,134,134,134,34,134,134,34,238,134,134,134,134,134,134,134,134,134,134,134,134,34,134,134,34,34,34,134,134,34,134,134,34,34,238,34,134,34,34,34,34,34,]),'wildcard':([107,230,597,604,653,942,947,1117,],[298,298,298,298,298,298,298,298,]),'type_argument_list3':([947,],[1043,]),'conditional_or_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,364,428,507,509,552,553,560,621,624,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,]),'break_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,]),'enhanced_for_statement_header':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[37,37,37,37,37,37,874,37,37,874,37,37,874,37,37,874,874,37,874,874,]),'block_statement':([1,20,207,709,976,1068,1071,],[39,204,406,204,204,204,406,]),'additional_bound_list1':([867,],[978,]),'method_header_extended_dims':([895,903,],[997,1008,]),'class_body':([29,489,959,1055,1060,1103,1124,1136,],[229,722,1057,1057,1057,1057,1057,1057,]),'method_header_name':([227,228,453,458,488,],[441,441,441,441,441,]),'semi_opt':([606,],[825,]),'additive_expression_not_name':([40,154,208,220,411,685,882,1092,],[260,260,260,260,260,260,260,260,]),'interface_header':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,]),'type_declaration':([4,171,178,183,232,381,382,387,485,666,],[179,179,179,388,482,179,388,388,482,388,]),'post_decrement_expression':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[41,156,41,156,41,156,41,253,156,156,156,156,156,253,156,156,156,156,41,419,253,156,156,156,156,156,156,156,156,41,156,156,156,156,41,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,419,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,41,419,156,156,41,156,156,41,156,156,156,156,156,156,156,156,156,156,41,156,156,156,41,419,156,156,156,156,156,156,156,156,156,156,156,156,156,41,156,156,41,41,41,156,156,41,156,156,41,41,419,156,41,156,41,41,41,41,41,]),'one_dim_loop':([100,112,125,145,166,192,210,216,217,246,292,299,304,305,366,367,416,434,567,619,652,781,815,855,856,895,896,903,904,919,921,966,],[291,291,291,291,291,291,291,291,291,291,593,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,]),'class_body_declarations_opt':([228,488,],[457,721,]),'array_creation_without_array_initializer':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,]),'marker_annotation':([1,4,20,24,171,178,183,188,207,208,227,228,232,235,279,309,381,382,383,387,411,441,451,453,458,463,468,480,485,488,491,566,608,666,685,709,720,826,832,882,894,976,984,1068,1071,1092,],[43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,]),'class_or_interface_type':([1,20,24,107,116,158,207,223,230,279,285,309,315,317,323,376,444,461,483,529,542,566,583,597,599,600,604,608,618,653,675,693,699,706,709,715,789,794,826,854,942,943,944,947,955,976,979,984,1004,1068,1071,1113,1116,1117,1122,1132,],[44,44,44,44,326,326,44,436,44,44,578,44,578,436,436,44,44,44,44,44,44,44,436,44,44,44,44,44,436,44,44,44,44,44,44,44,578,436,44,966,44,44,44,44,44,44,44,44,436,44,44,44,44,44,44,436,]),'relational_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,350,364,365,374,375,377,378,380,428,499,507,508,509,510,515,516,519,525,527,531,532,536,537,539,543,552,553,560,621,624,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,]),'annotation_type_member_declarations_opt':([232,],[481,]),'member_value_pairs':([208,],[417,]),'type_argument_list':([107,230,604,653,947,],[296,296,816,296,1044,]),'enum_header':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,]),'unary_expression_not_plus_minus':([2,16,25,58,73,77,132,147,155,157,194,203,237,249,252,254,268,270,275,276,281,290,294,295,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,687,692,729,776,785,786,790,791,792,798,799,800,836,841,850,852,857,911,912,924,930,932,933,934,938,939,940,951,958,965,977,983,988,991,1026,1050,1126,1130,],[152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,851,152,152,152,851,152,152,152,152,152,152,152,152,152,152,152,152,152,964,152,152,152,152,152,152,152,152,152,152,152,152,152,1061,152,152,152,152,152,152,1149,152,]),'assignment_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,364,428,507,509,552,553,560,621,624,671,687,729,776,785,786,790,791,792,798,799,800,836,841,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[153,153,153,153,153,153,153,153,153,153,153,153,153,153,629,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,]),'switch_labels':([863,972,],[976,1068,]),'explicit_constructor_invocation':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,]),'interface_header_extends':([109,],[316,]),'expression_not_name':([40,154,220,],[257,257,257,]),'instanceof_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,350,364,365,374,375,377,378,380,428,499,507,508,509,510,515,516,519,525,527,531,532,536,537,539,543,552,553,560,621,624,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,663,664,162,162,162,162,162,162,162,162,745,162,162,162,760,162,762,763,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,]),'simple_name':([1,2,11,16,20,24,25,37,40,58,73,77,107,116,118,132,147,154,155,157,158,177,184,194,203,207,208,215,220,223,230,237,249,252,254,268,270,275,276,279,281,285,289,290,294,295,309,315,317,319,323,330,335,348,350,351,352,353,354,355,356,358,359,360,364,365,370,371,372,373,374,375,376,377,378,380,384,390,411,422,428,432,444,461,483,499,500,501,502,503,504,505,506,507,508,509,510,511,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,552,553,560,566,583,597,599,600,603,604,608,618,620,621,624,650,653,669,671,675,677,683,685,687,692,693,699,706,709,715,729,776,783,784,785,786,789,790,791,792,794,798,799,800,826,836,841,849,850,852,854,857,859,874,882,911,912,924,930,932,933,934,938,939,940,942,943,944,947,951,955,958,965,976,977,979,983,984,986,987,988,991,1004,1018,1019,1026,1050,1068,1071,1092,1113,1116,1117,1122,1126,1129,1130,1131,1132,1134,1156,1157,1160,],[48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,423,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,588,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,588,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,588,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,588,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,588,48,48,48,884,48,48,48,48,48,48,48,48,48,48,588,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,588,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,588,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,]),'try_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,]),'class_header_implements_opt':([83,225,267,],[283,437,547,]),'local_variable_declaration':([1,20,207,279,709,976,984,1068,1071,],[50,50,50,571,50,50,571,50,50,]),'variable_declarator_id':([22,214,424,565,607,698,714,782,829,893,995,1052,],[211,211,211,211,828,211,211,211,952,994,1085,1121,]),'type_declarations':([4,171,178,381,],[183,382,387,666,]),'annotation_type_body':([33,],[233,]),'postfix_expression_not_name':([40,154,208,220,411,685,882,1092,],[250,250,250,250,250,250,250,250,]),'field_declaration':([227,228,232,453,458,485,488,],[450,467,450,450,467,450,467,]),'type_argument_list2':([604,947,],[820,820,]),'type_parameter_list1':([199,],[397,]),'instanceof_expression_not_name':([40,154,208,220,411,685,882,1092,],[261,261,261,261,261,261,261,261,]),'inclusive_or_expression_not_name':([40,154,208,220,411,685,882,1092,],[262,262,262,262,262,262,262,262,]),'cast_expression':([2,16,25,40,58,73,77,132,147,154,155,157,194,203,208,220,237,249,252,254,268,270,275,276,281,290,294,295,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,685,687,692,729,776,785,786,790,791,792,798,799,800,836,841,850,852,857,882,911,912,924,930,932,933,934,938,939,940,951,958,965,977,983,988,991,1026,1050,1092,1126,1130,],[165,165,165,263,165,165,165,165,165,263,165,165,165,165,263,263,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,263,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,263,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,263,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,263,165,165,]),'wildcard_bounds1':([297,817,1042,],[602,602,602,]),'reference_type':([1,20,24,107,207,230,279,309,376,444,461,483,529,542,566,597,599,600,604,608,653,675,693,699,706,709,715,826,942,943,944,947,955,976,979,984,1068,1071,1113,1116,1117,1122,],[94,94,94,307,94,307,94,94,662,94,94,94,758,767,94,810,812,814,823,94,307,867,94,94,94,94,94,94,1037,1039,1041,1048,94,94,1075,94,94,94,1142,1144,1146,94,]),'array_creation_with_array_initializer':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,]),'enhanced_for_statement_header_init':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,]),'class_declaration':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[76,187,76,187,187,187,76,449,466,187,187,187,187,449,466,187,466,187,76,76,76,76,]),'do_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,]),'enhanced_for_statement_no_short_if':([677,874,987,1129,1131,1156,1160,],[879,879,879,879,879,879,879,]),'catch_formal_parameter':([832,],[954,]),'variable_declarator':([22,214,424,565,698,714,782,],[212,212,686,212,212,212,212,]),'method_declaration':([228,458,488,],[475,475,475,]),'assignment':([1,2,11,16,20,37,40,58,77,154,194,203,207,220,268,270,275,276,279,281,290,294,295,330,335,348,364,428,507,509,552,553,560,621,624,671,677,687,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,874,924,930,932,933,934,938,939,940,951,958,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1129,1130,1131,1134,1156,1157,1160,],[121,144,121,144,121,121,243,144,144,243,144,144,121,243,144,144,144,144,121,144,144,144,144,121,144,144,144,144,144,144,144,144,144,144,144,144,121,144,121,144,144,121,144,144,144,144,144,144,144,144,144,144,121,121,144,144,144,144,144,144,144,144,144,144,121,144,144,121,121,121,144,144,121,144,144,121,121,121,144,121,121,121,121,121,]),'type_argument_list1':([107,230,604,653,947,],[308,308,308,308,308,]),'enum_declaration':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[60,169,60,169,169,169,60,438,454,169,169,169,169,438,454,169,454,169,60,60,60,60,]),'block':([1,11,20,37,108,207,228,312,330,458,473,488,677,709,806,830,849,874,976,986,987,1051,1068,1071,1129,1131,1134,1156,1160,],[59,59,59,59,311,59,471,311,59,471,711,471,59,59,941,953,59,59,59,59,59,1120,59,59,59,59,59,59,59,]),'additional_bound1':([867,982,],[981,1077,]),'arguments':([497,],[727,]),'class_header_extends_opt':([26,54,],[225,267,]),'member_value_pair':([208,683,],[407,885,]),'throw_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,]),'type_parameter_list':([199,],[399,]),'dims':([100,112,125,145,166,192,210,216,217,246,299,304,305,366,367,416,434,567,619,652,781,815,855,856,895,896,903,904,919,921,966,],[293,318,346,361,379,361,425,431,433,361,318,431,433,651,655,361,651,293,838,425,425,838,293,346,425,425,425,425,425,361,425,]),'primary_no_new_array':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,]),'enum_body':([35,],[234,]),'while_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,]),'resource_specification':([108,],[312,]),'type_arguments':([1,11,20,31,37,116,158,207,280,288,289,306,317,330,357,360,363,366,434,514,583,677,709,780,783,822,849,874,976,986,987,1018,1068,1071,1129,1131,1134,1156,1160,],[65,65,65,231,65,323,323,65,574,584,590,231,618,65,574,645,647,652,652,645,794,65,65,647,645,231,65,65,65,65,65,645,65,65,65,65,65,65,65,]),'assignment_operator':([123,151,],[335,335,]),'array_type':([1,20,24,107,207,230,279,309,376,444,461,483,529,542,566,597,599,600,604,608,653,675,693,699,706,709,715,826,942,943,944,947,955,976,979,984,1068,1071,1113,1116,1117,1122,],[67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,]),'and_expression_not_name':([40,154,208,220,411,685,882,1092,],[258,258,258,258,258,258,258,258,]),'class_header_name':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,]),'enum_constant_header_name':([235,720,],[497,497,]),'dims_opt':([210,367,652,781,895,896,903,904,919,966,],[427,654,853,918,998,427,998,427,1017,1062,]),'expression_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,]),'dims_loop':([100,112,125,145,166,192,210,216,217,246,299,304,305,366,367,416,434,567,619,652,781,815,855,856,895,896,903,904,919,921,966,],[292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,]),'multiplicative_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,350,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,428,499,500,501,502,503,504,505,506,507,508,509,510,511,515,516,517,518,519,520,521,522,523,525,526,527,528,531,532,536,537,539,540,541,543,552,553,560,621,624,653,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,641,642,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,746,137,137,749,137,137,137,137,137,137,137,137,137,137,137,137,765,766,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,]),'additional_bound_list':([867,],[982,]),'conditional_and_expression_not_name':([40,154,208,220,411,685,882,1092,],[239,239,239,239,239,239,239,239,]),'empty':([1,4,16,20,26,54,83,109,171,178,183,207,208,210,225,227,228,232,235,267,275,276,279,281,310,367,381,382,387,441,453,458,463,480,485,487,488,492,497,552,553,606,615,621,652,666,687,709,720,729,781,785,786,790,791,792,798,799,800,832,836,841,894,895,896,901,903,904,919,924,930,932,933,934,938,939,940,958,959,966,976,984,997,1008,1019,1026,1055,1060,1068,1071,1103,1124,1130,1136,1157,],[71,176,195,205,222,222,282,313,71,71,71,71,408,426,282,442,459,478,494,282,554,554,562,554,611,426,71,71,71,697,71,71,697,697,71,718,459,718,728,554,554,827,611,554,426,71,887,205,494,554,426,195,554,554,554,554,554,554,554,71,554,554,71,426,426,1003,426,426,426,554,554,554,554,554,554,554,554,554,1058,426,71,562,1003,1094,1097,554,1058,1058,71,71,1058,1058,195,1058,1097,]),'interface_type_list':([285,315,],[577,616,]),'array_access':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,]),'for_update_opt':([1019,1157,],[1098,1159,]),'primary':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[97,148,97,148,97,148,97,251,148,148,148,148,148,251,148,148,148,148,97,410,251,148,148,148,148,148,148,148,148,563,148,148,148,148,97,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,410,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,97,410,148,148,97,148,148,563,148,148,148,148,148,148,148,148,148,148,97,148,148,148,97,410,148,148,148,148,148,148,148,148,148,148,148,148,148,97,148,148,563,97,97,148,148,563,148,148,97,97,410,148,97,148,97,97,97,563,97,]),'resources':([309,],[606,]),'switch_block_statements':([863,],[972,]),'block_statements_opt':([20,709,],[206,902,]),'shift_expression_not_name':([40,154,208,220,411,685,882,1092,],[240,240,240,240,240,240,240,240,]),'formal_parameter_list':([441,463,480,],[694,694,694,]),'unary_expression_not_name':([40,154,208,220,411,685,882,1092,],[241,241,241,241,241,241,241,241,]),'interface_member_declarations':([227,],[453,]),'field_access':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,]),'if_then_else_statement_no_short_if':([677,874,987,1129,1131,1156,1160,],[873,873,873,873,873,873,873,]),'class_instance_creation_expression':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[117,139,117,139,117,139,117,139,139,139,139,139,139,139,139,139,139,139,117,139,139,139,139,139,139,139,139,139,139,117,139,139,139,139,117,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,117,139,139,139,117,139,139,117,139,139,139,139,139,139,139,139,139,139,117,139,139,139,117,139,139,139,139,139,139,139,139,139,139,139,139,139,139,117,139,139,117,117,117,139,139,117,139,139,117,117,139,139,117,139,117,117,117,117,117,]),'if_then_else_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,]),'wildcard_bounds3':([1042,],[1114,]),'return_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,]),'member_value':([208,411,685,882,1092,],[414,678,886,989,1133,]),'finally':([610,834,],[831,956,]),'expression_opt':([16,785,1130,],[196,922,1151,]),'type_parameter':([199,673,],[398,865,]),'annotation_type_declaration':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[84,186,84,186,186,186,84,448,465,186,186,186,186,448,465,186,465,186,84,84,84,84,]),'switch_label':([863,972,976,1068,],[973,973,1069,1069,]),'enum_constant_header':([235,720,],[489,489,]),'argument_list':([275,276,281,552,553,621,729,786,790,791,792,798,799,800,836,841,924,930,932,933,934,938,939,940,958,1026,],[555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,]),'assert_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,]),'abstract_method_declaration':([227,228,453,458,488,],[452,470,452,470,470,]),'enhanced_for_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,]),'type_argument2':([604,942,947,1117,],[818,1036,818,1036,]),'class_type_list':([1004,],[1089,]),'enum_declarations':([235,487,492,720,],[493,493,493,493,]),'pre_increment_expression':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,653,671,677,685,687,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1129,1130,1131,1134,1156,1157,1160,],[90,143,90,143,90,143,90,245,143,143,143,143,143,245,143,143,143,143,90,245,245,143,143,143,143,143,143,143,143,90,143,143,143,143,90,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,245,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,90,245,143,90,143,143,90,143,143,143,143,143,143,143,143,143,143,90,143,143,90,245,143,143,143,143,143,143,143,143,143,143,143,143,90,143,143,90,90,90,143,143,90,143,143,90,90,245,90,143,90,90,90,90,90,]),'package_declaration_name':([4,],[189,]),'annotation_type_member_declarations':([232,],[485,]),'name':([1,2,11,16,20,24,25,37,40,58,73,77,107,116,118,132,147,154,155,157,158,177,184,194,203,207,208,215,220,223,230,237,249,252,254,268,270,275,276,279,281,285,290,294,295,309,315,317,319,323,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,384,390,411,422,428,444,461,483,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,552,553,560,566,583,597,599,600,603,604,608,618,620,621,624,650,653,671,675,677,685,687,692,693,699,706,709,715,729,776,784,785,786,789,790,791,792,794,798,799,800,826,836,841,849,850,852,854,857,874,882,911,912,924,930,932,933,934,938,939,940,942,943,944,947,951,955,958,965,976,977,979,983,984,986,987,988,991,1004,1019,1026,1050,1068,1071,1092,1113,1116,1117,1122,1126,1129,1130,1131,1132,1134,1156,1157,1160,],[100,145,192,145,100,216,145,192,246,145,145,145,304,324,328,145,145,366,145,145,324,385,389,145,145,100,416,328,434,324,304,145,145,145,145,145,145,145,145,567,145,324,145,145,145,216,324,324,619,324,192,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,216,145,145,145,667,670,416,328,145,216,216,216,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,216,145,145,145,145,145,145,145,145,216,145,145,145,145,145,145,145,216,324,304,304,304,815,304,216,324,839,145,145,145,855,145,304,192,416,145,145,216,216,216,100,216,145,145,921,145,145,324,145,145,145,324,145,145,145,216,145,145,192,145,145,324,145,192,416,145,145,145,145,145,145,145,145,145,145,304,304,304,304,145,216,145,145,100,145,304,145,567,192,192,145,145,324,921,145,145,100,100,416,304,304,304,216,145,192,145,192,324,192,192,921,192,]),'class_type_elt':([1004,1132,],[1090,1153,]),'continue_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,]),'class_member_declaration':([228,458,488,],[474,474,474,]),'and_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,350,364,365,374,380,428,499,507,508,509,510,515,519,525,532,543,552,553,560,621,624,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,665,161,161,161,161,161,741,161,161,161,761,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,]),'dim_with_or_without_exprs':([325,326,],[625,626,]),'method_header_throws_clause_opt':([901,997,],[1006,1086,]),'interface_member_declaration':([227,453,],[439,702,]),'unary_expression':([2,16,25,58,73,77,132,147,155,157,194,203,237,249,252,254,268,270,275,276,281,290,294,295,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,653,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,857,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[146,146,219,146,277,146,349,362,368,369,146,146,498,533,534,535,146,146,146,146,146,146,146,146,146,146,146,634,635,636,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,743,146,146,146,146,146,146,146,146,146,753,146,146,146,146,759,146,146,146,146,146,146,146,146,769,770,771,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,967,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,]),'for_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,]),'trailing_semicolon':([606,],[826,]),'single_member_annotation':([1,4,20,24,171,178,183,188,207,208,227,228,232,235,279,309,381,382,383,387,411,441,451,453,458,463,468,480,485,488,491,566,608,666,685,709,720,826,832,882,894,976,984,1068,1071,1092,],[96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,]),'comma_opt':([687,],[891,]),'class_header_implements':([83,225,267,],[284,284,284,]),'local_variable_declaration_statement':([1,20,207,709,976,1068,1071,],[98,98,98,98,98,98,98,]),'formal_parameter':([441,463,480,894,],[696,696,696,996,]),'class_body_declaration':([228,458,488,],[456,704,456,]),'expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,348,364,428,507,509,552,553,560,621,624,671,687,729,776,785,786,790,791,792,798,799,800,836,841,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[149,197,269,278,393,404,548,550,556,556,556,591,595,596,632,648,689,738,740,556,556,779,556,842,861,689,556,915,197,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,689,556,1073,1078,1082,689,556,689,197,]),'single_type_import_declaration':([4,171,178,381,],[173,173,173,173,]),'wildcard2':([604,942,947,1117,],[819,819,819,819,]),'enum_constant':([235,720,],[490,907,]),'postfix_expression':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[123,151,123,151,123,221,123,123,151,221,151,221,221,123,221,221,151,151,123,409,123,221,221,221,221,151,151,151,151,123,151,151,151,151,123,151,151,221,221,221,221,221,221,221,221,221,151,221,221,221,221,221,221,221,221,221,221,409,151,221,221,221,221,221,221,221,221,151,221,151,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,151,151,151,151,151,221,221,151,123,409,151,221,123,151,151,123,151,151,151,151,151,151,151,151,151,151,123,221,221,221,123,409,221,221,151,151,151,151,151,151,151,151,151,151,221,123,151,151,123,123,123,151,151,123,151,151,123,123,409,221,123,151,123,123,123,123,123,]),'annotation_type_member_declaration':([232,485,],[477,716,]),'variable_declarators':([22,214,565,698,714,782,],[209,429,209,897,897,429,]),'interface_header_extends_opt':([109,],[314,]),'dim_with_or_without_expr':([325,326,625,626,],[623,623,845,845,]),'shift_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,350,364,365,370,371,372,373,374,375,377,378,380,428,499,500,504,505,506,507,508,509,510,515,516,519,521,522,525,526,527,528,531,532,536,537,539,543,552,553,560,621,624,653,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,656,657,658,659,138,138,138,138,138,138,138,731,735,736,737,138,138,138,138,138,138,138,750,751,138,755,138,757,138,138,138,138,138,138,138,138,138,138,138,750,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,]),'qualified_name':([1,2,11,16,20,24,25,37,40,58,73,77,107,116,118,132,147,154,155,157,158,177,184,194,203,207,208,215,220,223,230,237,249,252,254,268,270,275,276,279,281,285,290,294,295,309,315,317,319,323,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,384,390,411,422,428,444,461,483,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,552,553,560,566,583,597,599,600,603,604,608,618,620,621,624,650,653,671,675,677,685,687,692,693,699,706,709,715,729,776,784,785,786,789,790,791,792,794,798,799,800,826,836,841,849,850,852,854,857,874,882,911,912,924,930,932,933,934,938,939,940,942,943,944,947,951,955,958,965,976,977,979,983,984,986,987,988,991,1004,1019,1026,1050,1068,1071,1092,1113,1116,1117,1122,1126,1129,1130,1131,1132,1134,1156,1157,1160,],[57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,]),'for_statement_no_short_if':([677,874,987,1129,1131,1156,1160,],[875,875,875,875,875,875,875,]),'import_declaration':([4,171,178,381,],[174,174,386,386,]),'reference_type2':([604,942,943,944,947,1113,1116,1117,],[821,821,1038,1040,821,1038,1040,821,]),'for_init':([279,984,],[570,570,]),'annotation_method_header_name':([232,485,],[480,480,]),'type_argument':([107,230,597,604,653,942,947,1117,],[301,301,808,301,301,808,301,808,]),'reference_type3':([947,1113,1116,1117,],[1046,1141,1143,1046,]),'conditional_expression_not_name':([40,154,208,220,411,685,882,1092,],[255,255,420,255,420,420,420,420,]),'equality_expression_not_name':([40,154,208,220,411,685,882,1092,],[256,256,256,256,256,256,256,256,]),'type_parameter_header':([199,673,],[400,400,]),'class_or_interface':([1,20,24,107,116,158,207,223,230,279,285,309,315,317,323,376,444,461,483,529,542,566,583,597,599,600,604,608,618,653,675,693,699,706,709,715,789,794,826,854,942,943,944,947,955,976,979,984,1004,1068,1071,1113,1116,1117,1122,1132,],[31,31,31,306,31,31,31,31,306,31,31,31,31,31,31,31,31,31,31,31,31,31,31,306,306,306,822,31,31,306,306,31,31,31,31,31,31,31,31,31,822,822,822,822,31,31,306,31,31,31,31,822,822,822,31,31,]),'statement_no_short_if':([677,874,987,1129,1131,1156,1160,],[876,985,1081,1150,1152,1158,1161,]),'variable_initializers':([687,],[889,]),'compilation_unit':([4,],[172,]),'statement_without_trailing_substatement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[110,110,110,110,110,110,878,110,110,878,110,110,878,110,110,878,878,110,878,878,]),'class_instance_creation_expression_name':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,]),'generic_type':([1,20,24,107,116,158,207,223,230,279,285,309,315,317,323,376,444,461,483,529,542,566,583,597,599,600,604,608,618,653,675,693,699,706,709,715,789,794,826,854,942,943,944,947,955,976,979,984,1004,1068,1071,1113,1116,1117,1122,1132,],[112,112,112,299,321,321,112,321,299,112,321,112,321,321,321,112,112,112,112,112,112,112,321,299,299,299,299,112,321,299,299,112,112,112,112,112,321,321,112,321,299,299,299,299,112,112,299,112,321,112,112,299,299,299,112,321,]),'class_type':([116,158,223,317,323,583,618,794,1004,1132,],[322,322,435,617,622,793,837,931,1088,1088,]),'type_import_on_demand_declaration':([4,171,178,381,],[180,180,180,180,]),'interface_body':([28,],[226,]),'labeled_statement_no_short_if':([677,874,987,1129,1131,1156,1160,],[868,868,868,868,868,868,868,]),'argument_list_opt':([275,276,281,552,553,621,729,786,790,791,792,798,799,800,836,841,924,930,932,933,934,938,939,940,958,1026,],[557,558,575,774,775,840,910,923,927,928,929,935,936,937,957,960,1021,1025,1027,1028,1029,1033,1034,1035,1056,1104,]),'type_argument3':([947,1117,],[1045,1145,]),'union_type':([955,],[1054,]),'variable_initializer':([428,687,951,991,1050,],[690,890,1049,1084,1119,]),'reference_type1':([107,230,597,599,600,604,653,675,942,943,944,947,979,1113,1116,1117,],[300,300,300,811,813,300,300,866,300,811,813,300,1074,811,813,300,]),'method_header':([227,228,453,458,488,],[447,464,447,464,464,]),'annotation':([1,4,20,24,171,178,183,188,207,208,227,228,232,235,279,309,381,382,383,387,411,441,451,453,458,463,468,480,485,488,491,566,608,666,685,709,720,826,832,882,894,976,984,1068,1071,1092,],[115,115,115,115,115,115,115,115,115,421,115,115,115,115,115,115,115,115,115,115,421,115,115,115,115,115,115,115,115,115,115,115,115,115,421,115,115,115,115,421,115,115,115,115,115,421,]),'catches_opt':([310,615,],[610,834,]),'switch_block_statement':([863,972,],[974,1066,]),'block_statements':([20,709,976,1068,],[207,207,1071,1071,]),'post_increment_expression':([1,2,11,16,20,25,37,40,58,73,77,132,147,154,155,157,194,203,207,208,220,237,249,252,254,268,270,275,276,279,281,290,294,295,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,377,378,380,411,428,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,530,531,532,536,537,539,540,541,543,544,545,546,552,553,560,621,624,650,653,671,677,685,687,692,709,729,776,784,785,786,790,791,792,798,799,800,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,951,958,965,976,977,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1126,1129,1130,1131,1134,1156,1157,1160,],[78,163,78,163,78,163,78,259,163,163,163,163,163,259,163,163,163,163,78,412,259,163,163,163,163,163,163,163,163,78,163,163,163,163,78,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,412,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,78,412,163,163,78,163,163,78,163,163,163,163,163,163,163,163,163,163,78,163,163,163,78,412,163,163,163,163,163,163,163,163,163,163,163,163,163,78,163,163,78,78,78,163,163,78,163,163,78,78,412,163,78,163,78,78,78,78,78,]),'type_parameters':([17,119,401,444,461,483,627,691,],[198,329,676,699,706,715,847,892,]),'annotation_method_header':([232,485,],[486,486,]),'formal_parameter_list_opt':([441,463,480,],[695,707,712,]),'interface_header_name1':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,]),'label':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[120,120,120,120,120,120,877,120,120,877,120,120,877,120,120,877,877,120,877,877,]),'equality_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,350,364,365,374,375,380,428,499,507,508,509,510,515,519,525,527,532,539,543,552,553,560,621,624,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,661,164,164,164,164,164,164,164,164,164,164,756,164,764,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,]),'member_value_array_initializer':([208,411,685,882,1092,],[415,415,415,415,415,]),'wildcard1':([107,230,597,604,653,942,947,1117,],[303,303,303,303,303,303,303,303,]),'wildcard_bounds':([297,817,1042,],[601,601,601,]),'labeled_statement':([1,11,20,37,207,330,677,709,849,874,976,986,987,1068,1071,1129,1131,1134,1156,1160,],[6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,]),'conditional_or_expression_not_name':([40,154,208,220,411,685,882,1092,],[242,242,242,242,242,242,242,242,]),'for_init_opt':([279,984,],[572,1079,]),'normal_annotation':([1,4,20,24,171,178,183,188,207,208,227,228,232,235,279,309,381,382,383,387,411,441,451,453,458,463,468,480,485,488,491,566,608,666,685,709,720,826,832,882,894,976,984,1068,1071,1092,],[124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,]),'primitive_type':([1,2,11,16,20,24,25,37,40,58,73,77,107,116,132,147,154,155,157,158,194,203,207,208,220,230,237,249,252,254,268,270,275,276,279,281,290,294,295,309,330,335,348,350,351,352,353,354,355,356,358,359,364,365,370,371,372,373,374,375,376,377,378,380,411,428,444,461,483,499,500,501,502,503,504,505,506,507,508,509,510,511,513,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,536,537,539,540,541,542,543,544,545,546,552,553,560,566,597,599,600,604,608,621,624,650,653,671,675,677,685,687,692,693,699,706,709,715,729,776,784,785,786,790,791,792,798,799,800,826,836,841,849,850,852,857,874,882,911,912,924,930,932,933,934,938,939,940,942,943,944,947,951,955,958,965,976,977,979,983,984,986,987,988,991,1019,1026,1050,1068,1071,1092,1113,1116,1117,1122,1126,1129,1130,1131,1134,1156,1157,1160,],[125,166,166,166,125,217,166,166,166,166,166,166,305,325,166,166,367,166,166,325,166,166,125,166,367,305,166,166,166,166,166,166,166,166,125,166,166,166,166,217,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,305,166,166,166,166,166,217,217,217,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,305,166,166,166,166,166,166,166,166,305,166,166,166,166,166,166,166,217,305,305,305,305,217,166,166,166,856,166,305,166,166,166,166,217,217,217,125,217,166,166,166,166,166,166,166,166,166,166,166,217,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,305,305,305,305,166,217,166,166,125,166,305,166,125,166,166,166,166,166,166,166,125,125,166,305,305,305,217,166,166,166,166,166,166,166,166,]),'modifier':([1,4,20,24,171,178,183,188,207,227,228,232,235,279,309,381,382,383,387,441,451,453,458,463,468,480,485,488,491,566,608,666,709,720,826,832,894,976,984,1068,1071,],[106,106,106,218,106,106,106,218,106,106,106,106,106,106,106,106,106,218,106,106,218,106,106,106,218,106,106,106,218,218,218,106,106,106,106,106,106,106,106,106,106,]),'constructor_header':([228,232,458,485,488,],[472,472,472,472,472,]),'unary_expression_not_plus_minus_not_name':([40,154,208,220,411,685,882,1092,],[264,264,264,264,264,264,264,264,]),'conditional_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,364,428,507,509,552,553,560,621,624,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,963,1013,1014,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,]),'catches':([310,615,],[614,835,]),'exclusive_or_expression':([2,16,58,77,194,203,268,270,275,276,281,290,294,295,335,348,350,364,365,374,428,499,507,508,509,515,519,525,543,552,553,560,621,624,671,687,729,776,785,786,790,791,792,798,799,800,836,841,850,911,912,924,930,932,933,934,938,939,940,951,958,977,983,988,991,1026,1050,1130,],[168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,660,168,168,168,168,168,744,168,168,768,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,]),'interface_declaration':([1,4,20,171,178,183,207,227,228,232,381,382,387,453,458,485,488,666,709,976,1068,1071,],[69,170,69,170,170,170,69,440,455,170,170,170,170,440,455,170,455,170,69,69,69,69,]),'multiplicative_expression_not_name':([40,154,208,220,411,685,882,1092,],[265,265,265,265,265,265,265,265,]),}
_lr_goto = {}
for _k, _v in _lr_goto_items.items():
for _x, _y in zip(_v[0], _v[1]):
if not _x in _lr_goto: _lr_goto[_x] = {}
_lr_goto[_x][_k] = _y
del _lr_goto_items
_lr_productions = [
("S' -> goal","S'",1,None,None,None),
('expression -> assignment_expression','expression',1,'p_expression','parser.py',123),
('expression_not_name -> assignment_expression_not_name','expression_not_name',1,'p_expression_not_name','parser.py',127),
('assignment_expression -> assignment','assignment_expression',1,'p_assignment_expression','parser.py',131),
('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','parser.py',132),
('assignment_expression_not_name -> assignment','assignment_expression_not_name',1,'p_assignment_expression_not_name','parser.py',136),
('assignment_expression_not_name -> conditional_expression_not_name','assignment_expression_not_name',1,'p_assignment_expression_not_name','parser.py',137),
('assignment -> postfix_expression assignment_operator assignment_expression','assignment',3,'p_assignment','parser.py',141),
('assignment_operator -> =','assignment_operator',1,'p_assignment_operator','parser.py',145),
('assignment_operator -> TIMES_ASSIGN','assignment_operator',1,'p_assignment_operator','parser.py',146),
('assignment_operator -> DIVIDE_ASSIGN','assignment_operator',1,'p_assignment_operator','parser.py',147),
('assignment_operator -> REMAINDER_ASSIGN','assignment_operator',1,'p_assignment_operator','parser.py',148),
('assignment_operator -> PLUS_ASSIGN','assignment_operator',1,'p_assignment_operator','parser.py',149),
('assignment_operator -> MINUS_ASSIGN','assignment_operator',1,'p_assignment_operator','parser.py',150),
('assignment_operator -> LSHIFT_ASSIGN','assignment_operator',1,'p_assignment_operator','parser.py',151),
('assignment_operator -> RSHIFT_ASSIGN','assignment_operator',1,'p_assignment_operator','parser.py',152),
('assignment_operator -> RRSHIFT_ASSIGN','assignment_operator',1,'p_assignment_operator','parser.py',153),
('assignment_operator -> AND_ASSIGN','assignment_operator',1,'p_assignment_operator','parser.py',154),
('assignment_operator -> OR_ASSIGN','assignment_operator',1,'p_assignment_operator','parser.py',155),
('assignment_operator -> XOR_ASSIGN','assignment_operator',1,'p_assignment_operator','parser.py',156),
('conditional_expression -> conditional_or_expression','conditional_expression',1,'p_conditional_expression','parser.py',160),
('conditional_expression -> conditional_or_expression ? expression : conditional_expression','conditional_expression',5,'p_conditional_expression','parser.py',161),
('conditional_expression_not_name -> conditional_or_expression_not_name','conditional_expression_not_name',1,'p_conditional_expression_not_name','parser.py',168),
('conditional_expression_not_name -> conditional_or_expression_not_name ? expression : conditional_expression','conditional_expression_not_name',5,'p_conditional_expression_not_name','parser.py',169),
('conditional_expression_not_name -> name ? expression : conditional_expression','conditional_expression_not_name',5,'p_conditional_expression_not_name','parser.py',170),
('conditional_or_expression -> conditional_and_expression','conditional_or_expression',1,'p_conditional_or_expression','parser.py',183),
('conditional_or_expression -> conditional_or_expression OR conditional_and_expression','conditional_or_expression',3,'p_conditional_or_expression','parser.py',184),
('conditional_or_expression_not_name -> conditional_and_expression_not_name','conditional_or_expression_not_name',1,'p_conditional_or_expression_not_name','parser.py',188),
('conditional_or_expression_not_name -> conditional_or_expression_not_name OR conditional_and_expression','conditional_or_expression_not_name',3,'p_conditional_or_expression_not_name','parser.py',189),
('conditional_or_expression_not_name -> name OR conditional_and_expression','conditional_or_expression_not_name',3,'p_conditional_or_expression_not_name','parser.py',190),
('conditional_and_expression -> inclusive_or_expression','conditional_and_expression',1,'p_conditional_and_expression','parser.py',194),
('conditional_and_expression -> conditional_and_expression AND inclusive_or_expression','conditional_and_expression',3,'p_conditional_and_expression','parser.py',195),
('conditional_and_expression_not_name -> inclusive_or_expression_not_name','conditional_and_expression_not_name',1,'p_conditional_and_expression_not_name','parser.py',199),
('conditional_and_expression_not_name -> conditional_and_expression_not_name AND inclusive_or_expression','conditional_and_expression_not_name',3,'p_conditional_and_expression_not_name','parser.py',200),
('conditional_and_expression_not_name -> name AND inclusive_or_expression','conditional_and_expression_not_name',3,'p_conditional_and_expression_not_name','parser.py',201),
('inclusive_or_expression -> exclusive_or_expression','inclusive_or_expression',1,'p_inclusive_or_expression','parser.py',205),
('inclusive_or_expression -> inclusive_or_expression | exclusive_or_expression','inclusive_or_expression',3,'p_inclusive_or_expression','parser.py',206),
('inclusive_or_expression_not_name -> exclusive_or_expression_not_name','inclusive_or_expression_not_name',1,'p_inclusive_or_expression_not_name','parser.py',210),
('inclusive_or_expression_not_name -> inclusive_or_expression_not_name | exclusive_or_expression','inclusive_or_expression_not_name',3,'p_inclusive_or_expression_not_name','parser.py',211),
('inclusive_or_expression_not_name -> name | exclusive_or_expression','inclusive_or_expression_not_name',3,'p_inclusive_or_expression_not_name','parser.py',212),
('exclusive_or_expression -> and_expression','exclusive_or_expression',1,'p_exclusive_or_expression','parser.py',216),
('exclusive_or_expression -> exclusive_or_expression ^ and_expression','exclusive_or_expression',3,'p_exclusive_or_expression','parser.py',217),
('exclusive_or_expression_not_name -> and_expression_not_name','exclusive_or_expression_not_name',1,'p_exclusive_or_expression_not_name','parser.py',221),
('exclusive_or_expression_not_name -> exclusive_or_expression_not_name ^ and_expression','exclusive_or_expression_not_name',3,'p_exclusive_or_expression_not_name','parser.py',222),
('exclusive_or_expression_not_name -> name ^ and_expression','exclusive_or_expression_not_name',3,'p_exclusive_or_expression_not_name','parser.py',223),
('and_expression -> equality_expression','and_expression',1,'p_and_expression','parser.py',227),
('and_expression -> and_expression & equality_expression','and_expression',3,'p_and_expression','parser.py',228),
('and_expression_not_name -> equality_expression_not_name','and_expression_not_name',1,'p_and_expression_not_name','parser.py',232),
('and_expression_not_name -> and_expression_not_name & equality_expression','and_expression_not_name',3,'p_and_expression_not_name','parser.py',233),
('and_expression_not_name -> name & equality_expression','and_expression_not_name',3,'p_and_expression_not_name','parser.py',234),
('equality_expression -> instanceof_expression','equality_expression',1,'p_equality_expression','parser.py',238),
('equality_expression -> equality_expression EQ instanceof_expression','equality_expression',3,'p_equality_expression','parser.py',239),
('equality_expression -> equality_expression NEQ instanceof_expression','equality_expression',3,'p_equality_expression','parser.py',240),
('equality_expression_not_name -> instanceof_expression_not_name','equality_expression_not_name',1,'p_equality_expression_not_name','parser.py',244),
('equality_expression_not_name -> equality_expression_not_name EQ instanceof_expression','equality_expression_not_name',3,'p_equality_expression_not_name','parser.py',245),
('equality_expression_not_name -> name EQ instanceof_expression','equality_expression_not_name',3,'p_equality_expression_not_name','parser.py',246),
('equality_expression_not_name -> equality_expression_not_name NEQ instanceof_expression','equality_expression_not_name',3,'p_equality_expression_not_name','parser.py',247),
('equality_expression_not_name -> name NEQ instanceof_expression','equality_expression_not_name',3,'p_equality_expression_not_name','parser.py',248),
('instanceof_expression -> relational_expression','instanceof_expression',1,'p_instanceof_expression','parser.py',252),
('instanceof_expression -> instanceof_expression INSTANCEOF reference_type','instanceof_expression',3,'p_instanceof_expression','parser.py',253),
('instanceof_expression_not_name -> relational_expression_not_name','instanceof_expression_not_name',1,'p_instanceof_expression_not_name','parser.py',257),
('instanceof_expression_not_name -> name INSTANCEOF reference_type','instanceof_expression_not_name',3,'p_instanceof_expression_not_name','parser.py',258),
('instanceof_expression_not_name -> instanceof_expression_not_name INSTANCEOF reference_type','instanceof_expression_not_name',3,'p_instanceof_expression_not_name','parser.py',259),
('relational_expression -> shift_expression','relational_expression',1,'p_relational_expression','parser.py',263),
('relational_expression -> relational_expression > shift_expression','relational_expression',3,'p_relational_expression','parser.py',264),
('relational_expression -> relational_expression < shift_expression','relational_expression',3,'p_relational_expression','parser.py',265),
('relational_expression -> relational_expression GTEQ shift_expression','relational_expression',3,'p_relational_expression','parser.py',266),
('relational_expression -> relational_expression LTEQ shift_expression','relational_expression',3,'p_relational_expression','parser.py',267),
('relational_expression_not_name -> shift_expression_not_name','relational_expression_not_name',1,'p_relational_expression_not_name','parser.py',271),
('relational_expression_not_name -> shift_expression_not_name < shift_expression','relational_expression_not_name',3,'p_relational_expression_not_name','parser.py',272),
('relational_expression_not_name -> name < shift_expression','relational_expression_not_name',3,'p_relational_expression_not_name','parser.py',273),
('relational_expression_not_name -> shift_expression_not_name > shift_expression','relational_expression_not_name',3,'p_relational_expression_not_name','parser.py',274),
('relational_expression_not_name -> name > shift_expression','relational_expression_not_name',3,'p_relational_expression_not_name','parser.py',275),
('relational_expression_not_name -> shift_expression_not_name GTEQ shift_expression','relational_expression_not_name',3,'p_relational_expression_not_name','parser.py',276),
('relational_expression_not_name -> name GTEQ shift_expression','relational_expression_not_name',3,'p_relational_expression_not_name','parser.py',277),
('relational_expression_not_name -> shift_expression_not_name LTEQ shift_expression','relational_expression_not_name',3,'p_relational_expression_not_name','parser.py',278),
('relational_expression_not_name -> name LTEQ shift_expression','relational_expression_not_name',3,'p_relational_expression_not_name','parser.py',279),
('shift_expression -> additive_expression','shift_expression',1,'p_shift_expression','parser.py',283),
('shift_expression -> shift_expression LSHIFT additive_expression','shift_expression',3,'p_shift_expression','parser.py',284),
('shift_expression -> shift_expression RSHIFT additive_expression','shift_expression',3,'p_shift_expression','parser.py',285),
('shift_expression -> shift_expression RRSHIFT additive_expression','shift_expression',3,'p_shift_expression','parser.py',286),
('shift_expression_not_name -> additive_expression_not_name','shift_expression_not_name',1,'p_shift_expression_not_name','parser.py',290),
('shift_expression_not_name -> shift_expression_not_name LSHIFT additive_expression','shift_expression_not_name',3,'p_shift_expression_not_name','parser.py',291),
('shift_expression_not_name -> name LSHIFT additive_expression','shift_expression_not_name',3,'p_shift_expression_not_name','parser.py',292),
('shift_expression_not_name -> shift_expression_not_name RSHIFT additive_expression','shift_expression_not_name',3,'p_shift_expression_not_name','parser.py',293),
('shift_expression_not_name -> name RSHIFT additive_expression','shift_expression_not_name',3,'p_shift_expression_not_name','parser.py',294),
('shift_expression_not_name -> shift_expression_not_name RRSHIFT additive_expression','shift_expression_not_name',3,'p_shift_expression_not_name','parser.py',295),
('shift_expression_not_name -> name RRSHIFT additive_expression','shift_expression_not_name',3,'p_shift_expression_not_name','parser.py',296),
('additive_expression -> multiplicative_expression','additive_expression',1,'p_additive_expression','parser.py',300),
('additive_expression -> additive_expression + multiplicative_expression','additive_expression',3,'p_additive_expression','parser.py',301),
('additive_expression -> additive_expression - multiplicative_expression','additive_expression',3,'p_additive_expression','parser.py',302),
('additive_expression_not_name -> multiplicative_expression_not_name','additive_expression_not_name',1,'p_additive_expression_not_name','parser.py',306),
('additive_expression_not_name -> additive_expression_not_name + multiplicative_expression','additive_expression_not_name',3,'p_additive_expression_not_name','parser.py',307),
('additive_expression_not_name -> name + multiplicative_expression','additive_expression_not_name',3,'p_additive_expression_not_name','parser.py',308),
('additive_expression_not_name -> additive_expression_not_name - multiplicative_expression','additive_expression_not_name',3,'p_additive_expression_not_name','parser.py',309),
('additive_expression_not_name -> name - multiplicative_expression','additive_expression_not_name',3,'p_additive_expression_not_name','parser.py',310),
('multiplicative_expression -> unary_expression','multiplicative_expression',1,'p_multiplicative_expression','parser.py',314),
('multiplicative_expression -> multiplicative_expression * unary_expression','multiplicative_expression',3,'p_multiplicative_expression','parser.py',315),
('multiplicative_expression -> multiplicative_expression / unary_expression','multiplicative_expression',3,'p_multiplicative_expression','parser.py',316),
('multiplicative_expression -> multiplicative_expression % unary_expression','multiplicative_expression',3,'p_multiplicative_expression','parser.py',317),
('multiplicative_expression_not_name -> unary_expression_not_name','multiplicative_expression_not_name',1,'p_multiplicative_expression_not_name','parser.py',321),
('multiplicative_expression_not_name -> multiplicative_expression_not_name * unary_expression','multiplicative_expression_not_name',3,'p_multiplicative_expression_not_name','parser.py',322),
('multiplicative_expression_not_name -> name * unary_expression','multiplicative_expression_not_name',3,'p_multiplicative_expression_not_name','parser.py',323),
('multiplicative_expression_not_name -> multiplicative_expression_not_name / unary_expression','multiplicative_expression_not_name',3,'p_multiplicative_expression_not_name','parser.py',324),
('multiplicative_expression_not_name -> name / unary_expression','multiplicative_expression_not_name',3,'p_multiplicative_expression_not_name','parser.py',325),
('multiplicative_expression_not_name -> multiplicative_expression_not_name % unary_expression','multiplicative_expression_not_name',3,'p_multiplicative_expression_not_name','parser.py',326),
('multiplicative_expression_not_name -> name % unary_expression','multiplicative_expression_not_name',3,'p_multiplicative_expression_not_name','parser.py',327),
('unary_expression -> pre_increment_expression','unary_expression',1,'p_unary_expression','parser.py',331),
('unary_expression -> pre_decrement_expression','unary_expression',1,'p_unary_expression','parser.py',332),
('unary_expression -> + unary_expression','unary_expression',2,'p_unary_expression','parser.py',333),
('unary_expression -> - unary_expression','unary_expression',2,'p_unary_expression','parser.py',334),
('unary_expression -> unary_expression_not_plus_minus','unary_expression',1,'p_unary_expression','parser.py',335),
('unary_expression_not_name -> pre_increment_expression','unary_expression_not_name',1,'p_unary_expression_not_name','parser.py',342),
('unary_expression_not_name -> pre_decrement_expression','unary_expression_not_name',1,'p_unary_expression_not_name','parser.py',343),
('unary_expression_not_name -> + unary_expression','unary_expression_not_name',2,'p_unary_expression_not_name','parser.py',344),
('unary_expression_not_name -> - unary_expression','unary_expression_not_name',2,'p_unary_expression_not_name','parser.py',345),
('unary_expression_not_name -> unary_expression_not_plus_minus_not_name','unary_expression_not_name',1,'p_unary_expression_not_name','parser.py',346),
('pre_increment_expression -> PLUSPLUS unary_expression','pre_increment_expression',2,'p_pre_increment_expression','parser.py',353),
('pre_decrement_expression -> MINUSMINUS unary_expression','pre_decrement_expression',2,'p_pre_decrement_expression','parser.py',357),
('unary_expression_not_plus_minus -> postfix_expression','unary_expression_not_plus_minus',1,'p_unary_expression_not_plus_minus','parser.py',361),
('unary_expression_not_plus_minus -> ~ unary_expression','unary_expression_not_plus_minus',2,'p_unary_expression_not_plus_minus','parser.py',362),
('unary_expression_not_plus_minus -> ! unary_expression','unary_expression_not_plus_minus',2,'p_unary_expression_not_plus_minus','parser.py',363),
('unary_expression_not_plus_minus -> cast_expression','unary_expression_not_plus_minus',1,'p_unary_expression_not_plus_minus','parser.py',364),
('unary_expression_not_plus_minus_not_name -> postfix_expression_not_name','unary_expression_not_plus_minus_not_name',1,'p_unary_expression_not_plus_minus_not_name','parser.py',371),
('unary_expression_not_plus_minus_not_name -> ~ unary_expression','unary_expression_not_plus_minus_not_name',2,'p_unary_expression_not_plus_minus_not_name','parser.py',372),
('unary_expression_not_plus_minus_not_name -> ! unary_expression','unary_expression_not_plus_minus_not_name',2,'p_unary_expression_not_plus_minus_not_name','parser.py',373),
('unary_expression_not_plus_minus_not_name -> cast_expression','unary_expression_not_plus_minus_not_name',1,'p_unary_expression_not_plus_minus_not_name','parser.py',374),
('postfix_expression -> primary','postfix_expression',1,'p_postfix_expression','parser.py',381),
('postfix_expression -> name','postfix_expression',1,'p_postfix_expression','parser.py',382),
('postfix_expression -> post_increment_expression','postfix_expression',1,'p_postfix_expression','parser.py',383),
('postfix_expression -> post_decrement_expression','postfix_expression',1,'p_postfix_expression','parser.py',384),
('postfix_expression_not_name -> primary','postfix_expression_not_name',1,'p_postfix_expression_not_name','parser.py',388),
('postfix_expression_not_name -> post_increment_expression','postfix_expression_not_name',1,'p_postfix_expression_not_name','parser.py',389),
('postfix_expression_not_name -> post_decrement_expression','postfix_expression_not_name',1,'p_postfix_expression_not_name','parser.py',390),
('post_increment_expression -> postfix_expression PLUSPLUS','post_increment_expression',2,'p_post_increment_expression','parser.py',394),
('post_decrement_expression -> postfix_expression MINUSMINUS','post_decrement_expression',2,'p_post_decrement_expression','parser.py',398),
('primary -> primary_no_new_array','primary',1,'p_primary','parser.py',402),
('primary -> array_creation_with_array_initializer','primary',1,'p_primary','parser.py',403),
('primary -> array_creation_without_array_initializer','primary',1,'p_primary','parser.py',404),
('primary_no_new_array -> literal','primary_no_new_array',1,'p_primary_no_new_array','parser.py',408),
('primary_no_new_array -> THIS','primary_no_new_array',1,'p_primary_no_new_array','parser.py',409),
('primary_no_new_array -> class_instance_creation_expression','primary_no_new_array',1,'p_primary_no_new_array','parser.py',410),
('primary_no_new_array -> field_access','primary_no_new_array',1,'p_primary_no_new_array','parser.py',411),
('primary_no_new_array -> method_invocation','primary_no_new_array',1,'p_primary_no_new_array','parser.py',412),
('primary_no_new_array -> array_access','primary_no_new_array',1,'p_primary_no_new_array','parser.py',413),
('primary_no_new_array -> ( name )','primary_no_new_array',3,'p_primary_no_new_array2','parser.py',417),
('primary_no_new_array -> ( expression_not_name )','primary_no_new_array',3,'p_primary_no_new_array2','parser.py',418),
('primary_no_new_array -> name . THIS','primary_no_new_array',3,'p_primary_no_new_array3','parser.py',422),
('primary_no_new_array -> name . SUPER','primary_no_new_array',3,'p_primary_no_new_array3','parser.py',423),
('primary_no_new_array -> name . CLASS','primary_no_new_array',3,'p_primary_no_new_array4','parser.py',428),
('primary_no_new_array -> name dims . CLASS','primary_no_new_array',4,'p_primary_no_new_array4','parser.py',429),
('primary_no_new_array -> primitive_type dims . CLASS','primary_no_new_array',4,'p_primary_no_new_array4','parser.py',430),
('primary_no_new_array -> primitive_type . CLASS','primary_no_new_array',3,'p_primary_no_new_array4','parser.py',431),
('dims_opt -> dims','dims_opt',1,'p_dims_opt','parser.py',438),
('dims_opt -> empty','dims_opt',1,'p_dims_opt2','parser.py',442),
('dims -> dims_loop','dims',1,'p_dims','parser.py',446),
('dims_loop -> one_dim_loop','dims_loop',1,'p_dims_loop','parser.py',450),
('dims_loop -> dims_loop one_dim_loop','dims_loop',2,'p_dims_loop','parser.py',451),
('one_dim_loop -> [ ]','one_dim_loop',2,'p_one_dim_loop','parser.py',458),
('cast_expression -> ( primitive_type dims_opt ) unary_expression','cast_expression',5,'p_cast_expression','parser.py',462),
('cast_expression -> ( name type_arguments dims_opt ) unary_expression_not_plus_minus','cast_expression',6,'p_cast_expression2','parser.py',466),
('cast_expression -> ( name type_arguments . class_or_interface_type dims_opt ) unary_expression_not_plus_minus','cast_expression',8,'p_cast_expression3','parser.py',470),
('cast_expression -> ( name ) unary_expression_not_plus_minus','cast_expression',4,'p_cast_expression4','parser.py',476),
('cast_expression -> ( name dims ) unary_expression_not_plus_minus','cast_expression',5,'p_cast_expression5','parser.py',481),
('block -> { block_statements_opt }','block',3,'p_block','parser.py',488),
('block_statements_opt -> block_statements','block_statements_opt',1,'p_block_statements_opt','parser.py',492),
('block_statements_opt -> empty','block_statements_opt',1,'p_block_statements_opt2','parser.py',496),
('block_statements -> block_statement','block_statements',1,'p_block_statements','parser.py',500),
('block_statements -> block_statements block_statement','block_statements',2,'p_block_statements','parser.py',501),
('block_statement -> local_variable_declaration_statement','block_statement',1,'p_block_statement','parser.py',508),
('block_statement -> statement','block_statement',1,'p_block_statement','parser.py',509),
('block_statement -> class_declaration','block_statement',1,'p_block_statement','parser.py',510),
('block_statement -> interface_declaration','block_statement',1,'p_block_statement','parser.py',511),
('block_statement -> annotation_type_declaration','block_statement',1,'p_block_statement','parser.py',512),
('block_statement -> enum_declaration','block_statement',1,'p_block_statement','parser.py',513),
('local_variable_declaration_statement -> local_variable_declaration ;','local_variable_declaration_statement',2,'p_local_variable_declaration_statement','parser.py',517),
('local_variable_declaration -> type variable_declarators','local_variable_declaration',2,'p_local_variable_declaration','parser.py',521),
('local_variable_declaration -> modifiers type variable_declarators','local_variable_declaration',3,'p_local_variable_declaration2','parser.py',525),
('variable_declarators -> variable_declarator','variable_declarators',1,'p_variable_declarators','parser.py',529),
('variable_declarators -> variable_declarators , variable_declarator','variable_declarators',3,'p_variable_declarators','parser.py',530),
('variable_declarator -> variable_declarator_id','variable_declarator',1,'p_variable_declarator','parser.py',537),
('variable_declarator -> variable_declarator_id = variable_initializer','variable_declarator',3,'p_variable_declarator','parser.py',538),
('variable_declarator_id -> NAME dims_opt','variable_declarator_id',2,'p_variable_declarator_id','parser.py',545),
('variable_initializer -> expression','variable_initializer',1,'p_variable_initializer','parser.py',549),
('variable_initializer -> array_initializer','variable_initializer',1,'p_variable_initializer','parser.py',550),
('statement -> statement_without_trailing_substatement','statement',1,'p_statement','parser.py',554),
('statement -> labeled_statement','statement',1,'p_statement','parser.py',555),
('statement -> if_then_statement','statement',1,'p_statement','parser.py',556),
('statement -> if_then_else_statement','statement',1,'p_statement','parser.py',557),
('statement -> while_statement','statement',1,'p_statement','parser.py',558),
('statement -> for_statement','statement',1,'p_statement','parser.py',559),
('statement -> enhanced_for_statement','statement',1,'p_statement','parser.py',560),
('statement_without_trailing_substatement -> block','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',564),
('statement_without_trailing_substatement -> expression_statement','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',565),
('statement_without_trailing_substatement -> assert_statement','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',566),
('statement_without_trailing_substatement -> empty_statement','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',567),
('statement_without_trailing_substatement -> switch_statement','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',568),
('statement_without_trailing_substatement -> do_statement','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',569),
('statement_without_trailing_substatement -> break_statement','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',570),
('statement_without_trailing_substatement -> continue_statement','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',571),
('statement_without_trailing_substatement -> return_statement','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',572),
('statement_without_trailing_substatement -> synchronized_statement','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',573),
('statement_without_trailing_substatement -> throw_statement','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',574),
('statement_without_trailing_substatement -> try_statement','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',575),
('statement_without_trailing_substatement -> try_statement_with_resources','statement_without_trailing_substatement',1,'p_statement_without_trailing_substatement','parser.py',576),
('expression_statement -> statement_expression ;','expression_statement',2,'p_expression_statement','parser.py',580),
('expression_statement -> explicit_constructor_invocation','expression_statement',1,'p_expression_statement','parser.py',581),
('statement_expression -> assignment','statement_expression',1,'p_statement_expression','parser.py',588),
('statement_expression -> pre_increment_expression','statement_expression',1,'p_statement_expression','parser.py',589),
('statement_expression -> pre_decrement_expression','statement_expression',1,'p_statement_expression','parser.py',590),
('statement_expression -> post_increment_expression','statement_expression',1,'p_statement_expression','parser.py',591),
('statement_expression -> post_decrement_expression','statement_expression',1,'p_statement_expression','parser.py',592),
('statement_expression -> method_invocation','statement_expression',1,'p_statement_expression','parser.py',593),
('statement_expression -> class_instance_creation_expression','statement_expression',1,'p_statement_expression','parser.py',594),
('comma_opt -> ,','comma_opt',1,'p_comma_opt','parser.py',598),
('comma_opt -> empty','comma_opt',1,'p_comma_opt','parser.py',599),
('array_initializer -> { comma_opt }','array_initializer',3,'p_array_initializer','parser.py',603),
('array_initializer -> { variable_initializers }','array_initializer',3,'p_array_initializer2','parser.py',607),
('array_initializer -> { variable_initializers , }','array_initializer',4,'p_array_initializer2','parser.py',608),
('variable_initializers -> variable_initializer','variable_initializers',1,'p_variable_initializers','parser.py',612),
('variable_initializers -> variable_initializers , variable_initializer','variable_initializers',3,'p_variable_initializers','parser.py',613),
('method_invocation -> NAME ( argument_list_opt )','method_invocation',4,'p_method_invocation','parser.py',620),
('method_invocation -> name . type_arguments NAME ( argument_list_opt )','method_invocation',7,'p_method_invocation2','parser.py',624),
('method_invocation -> primary . type_arguments NAME ( argument_list_opt )','method_invocation',7,'p_method_invocation2','parser.py',625),
('method_invocation -> SUPER . type_arguments NAME ( argument_list_opt )','method_invocation',7,'p_method_invocation2','parser.py',626),
('method_invocation -> name . NAME ( argument_list_opt )','method_invocation',6,'p_method_invocation3','parser.py',630),
('method_invocation -> primary . NAME ( argument_list_opt )','method_invocation',6,'p_method_invocation3','parser.py',631),
('method_invocation -> SUPER . NAME ( argument_list_opt )','method_invocation',6,'p_method_invocation3','parser.py',632),
('labeled_statement -> label : statement','labeled_statement',3,'p_labeled_statement','parser.py',636),
('labeled_statement_no_short_if -> label : statement_no_short_if','labeled_statement_no_short_if',3,'p_labeled_statement_no_short_if','parser.py',641),
('label -> NAME','label',1,'p_label','parser.py',646),
('if_then_statement -> IF ( expression ) statement','if_then_statement',5,'p_if_then_statement','parser.py',650),
('if_then_else_statement -> IF ( expression ) statement_no_short_if ELSE statement','if_then_else_statement',7,'p_if_then_else_statement','parser.py',654),
('if_then_else_statement_no_short_if -> IF ( expression ) statement_no_short_if ELSE statement_no_short_if','if_then_else_statement_no_short_if',7,'p_if_then_else_statement_no_short_if','parser.py',658),
('while_statement -> WHILE ( expression ) statement','while_statement',5,'p_while_statement','parser.py',662),
('while_statement_no_short_if -> WHILE ( expression ) statement_no_short_if','while_statement_no_short_if',5,'p_while_statement_no_short_if','parser.py',666),
('for_statement -> FOR ( for_init_opt ; expression_opt ; for_update_opt ) statement','for_statement',9,'p_for_statement','parser.py',670),
('for_statement_no_short_if -> FOR ( for_init_opt ; expression_opt ; for_update_opt ) statement_no_short_if','for_statement_no_short_if',9,'p_for_statement_no_short_if','parser.py',674),
('for_init_opt -> for_init','for_init_opt',1,'p_for_init_opt','parser.py',678),
('for_init_opt -> empty','for_init_opt',1,'p_for_init_opt','parser.py',679),
('for_init -> statement_expression_list','for_init',1,'p_for_init','parser.py',683),
('for_init -> local_variable_declaration','for_init',1,'p_for_init','parser.py',684),
('statement_expression_list -> statement_expression','statement_expression_list',1,'p_statement_expression_list','parser.py',688),
('statement_expression_list -> statement_expression_list , statement_expression','statement_expression_list',3,'p_statement_expression_list','parser.py',689),
('expression_opt -> expression','expression_opt',1,'p_expression_opt','parser.py',696),
('expression_opt -> empty','expression_opt',1,'p_expression_opt','parser.py',697),
('for_update_opt -> for_update','for_update_opt',1,'p_for_update_opt','parser.py',701),
('for_update_opt -> empty','for_update_opt',1,'p_for_update_opt','parser.py',702),
('for_update -> statement_expression_list','for_update',1,'p_for_update','parser.py',706),
('enhanced_for_statement -> enhanced_for_statement_header statement','enhanced_for_statement',2,'p_enhanced_for_statement','parser.py',710),
('enhanced_for_statement_no_short_if -> enhanced_for_statement_header statement_no_short_if','enhanced_for_statement_no_short_if',2,'p_enhanced_for_statement_no_short_if','parser.py',714),
('enhanced_for_statement_header -> enhanced_for_statement_header_init : expression )','enhanced_for_statement_header',4,'p_enhanced_for_statement_header','parser.py',718),
('enhanced_for_statement_header_init -> FOR ( type NAME dims_opt','enhanced_for_statement_header_init',5,'p_enhanced_for_statement_header_init','parser.py',723),
('enhanced_for_statement_header_init -> FOR ( modifiers type NAME dims_opt','enhanced_for_statement_header_init',6,'p_enhanced_for_statement_header_init2','parser.py',727),
('statement_no_short_if -> statement_without_trailing_substatement','statement_no_short_if',1,'p_statement_no_short_if','parser.py',731),
('statement_no_short_if -> labeled_statement_no_short_if','statement_no_short_if',1,'p_statement_no_short_if','parser.py',732),
('statement_no_short_if -> if_then_else_statement_no_short_if','statement_no_short_if',1,'p_statement_no_short_if','parser.py',733),
('statement_no_short_if -> while_statement_no_short_if','statement_no_short_if',1,'p_statement_no_short_if','parser.py',734),
('statement_no_short_if -> for_statement_no_short_if','statement_no_short_if',1,'p_statement_no_short_if','parser.py',735),
('statement_no_short_if -> enhanced_for_statement_no_short_if','statement_no_short_if',1,'p_statement_no_short_if','parser.py',736),
('assert_statement -> ASSERT expression ;','assert_statement',3,'p_assert_statement','parser.py',740),
('assert_statement -> ASSERT expression : expression ;','assert_statement',5,'p_assert_statement','parser.py',741),
('empty_statement -> ;','empty_statement',1,'p_empty_statement','parser.py',748),
('switch_statement -> SWITCH ( expression ) switch_block','switch_statement',5,'p_switch_statement','parser.py',752),
('switch_block -> { }','switch_block',2,'p_switch_block','parser.py',756),
('switch_block -> { switch_block_statements }','switch_block',3,'p_switch_block2','parser.py',760),
('switch_block -> { switch_labels }','switch_block',3,'p_switch_block3','parser.py',764),
('switch_block -> { switch_block_statements switch_labels }','switch_block',4,'p_switch_block4','parser.py',768),
('switch_block_statements -> switch_block_statement','switch_block_statements',1,'p_switch_block_statements','parser.py',772),
('switch_block_statements -> switch_block_statements switch_block_statement','switch_block_statements',2,'p_switch_block_statements','parser.py',773),
('switch_block_statement -> switch_labels block_statements','switch_block_statement',2,'p_switch_block_statement','parser.py',780),
('switch_labels -> switch_label','switch_labels',1,'p_switch_labels','parser.py',784),
('switch_labels -> switch_labels switch_label','switch_labels',2,'p_switch_labels','parser.py',785),
('switch_label -> CASE constant_expression :','switch_label',3,'p_switch_label','parser.py',792),
('switch_label -> DEFAULT :','switch_label',2,'p_switch_label','parser.py',793),
('constant_expression -> expression','constant_expression',1,'p_constant_expression','parser.py',800),
('do_statement -> DO statement WHILE ( expression ) ;','do_statement',7,'p_do_statement','parser.py',804),
('break_statement -> BREAK ;','break_statement',2,'p_break_statement','parser.py',808),
('break_statement -> BREAK NAME ;','break_statement',3,'p_break_statement','parser.py',809),
('continue_statement -> CONTINUE ;','continue_statement',2,'p_continue_statement','parser.py',816),
('continue_statement -> CONTINUE NAME ;','continue_statement',3,'p_continue_statement','parser.py',817),
('return_statement -> RETURN expression_opt ;','return_statement',3,'p_return_statement','parser.py',824),
('synchronized_statement -> SYNCHRONIZED ( expression ) block','synchronized_statement',5,'p_synchronized_statement','parser.py',828),
('throw_statement -> THROW expression ;','throw_statement',3,'p_throw_statement','parser.py',832),
('try_statement -> TRY try_block catches','try_statement',3,'p_try_statement','parser.py',836),
('try_statement -> TRY try_block catches_opt finally','try_statement',4,'p_try_statement','parser.py',837),
('try_block -> block','try_block',1,'p_try_block','parser.py',844),
('catches -> catch_clause','catches',1,'p_catches','parser.py',848),
('catches -> catches catch_clause','catches',2,'p_catches','parser.py',849),
('catches_opt -> catches','catches_opt',1,'p_catches_opt','parser.py',856),
('catches_opt -> empty','catches_opt',1,'p_catches_opt2','parser.py',860),
('catch_clause -> CATCH ( catch_formal_parameter ) block','catch_clause',5,'p_catch_clause','parser.py',864),
('catch_formal_parameter -> modifiers_opt catch_type variable_declarator_id','catch_formal_parameter',3,'p_catch_formal_parameter','parser.py',868),
('catch_type -> union_type','catch_type',1,'p_catch_type','parser.py',872),
('union_type -> type','union_type',1,'p_union_type','parser.py',876),
('union_type -> union_type | type','union_type',3,'p_union_type','parser.py',877),
('try_statement_with_resources -> TRY resource_specification try_block catches_opt','try_statement_with_resources',4,'p_try_statement_with_resources','parser.py',884),
('try_statement_with_resources -> TRY resource_specification try_block catches_opt finally','try_statement_with_resources',5,'p_try_statement_with_resources','parser.py',885),
('resource_specification -> ( resources semi_opt )','resource_specification',4,'p_resource_specification','parser.py',892),
('semi_opt -> ;','semi_opt',1,'p_semi_opt','parser.py',896),
('semi_opt -> empty','semi_opt',1,'p_semi_opt','parser.py',897),
('resources -> resource','resources',1,'p_resources','parser.py',901),
('resources -> resources trailing_semicolon resource','resources',3,'p_resources','parser.py',902),
('trailing_semicolon -> ;','trailing_semicolon',1,'p_trailing_semicolon','parser.py',909),
('resource -> type variable_declarator_id = variable_initializer','resource',4,'p_resource','parser.py',913),
('resource -> modifiers type variable_declarator_id = variable_initializer','resource',5,'p_resource2','parser.py',917),
('finally -> FINALLY block','finally',2,'p_finally','parser.py',921),
('explicit_constructor_invocation -> THIS ( argument_list_opt ) ;','explicit_constructor_invocation',5,'p_explicit_constructor_invocation','parser.py',925),
('explicit_constructor_invocation -> SUPER ( argument_list_opt ) ;','explicit_constructor_invocation',5,'p_explicit_constructor_invocation','parser.py',926),
('explicit_constructor_invocation -> type_arguments SUPER ( argument_list_opt ) ;','explicit_constructor_invocation',6,'p_explicit_constructor_invocation2','parser.py',930),
('explicit_constructor_invocation -> type_arguments THIS ( argument_list_opt ) ;','explicit_constructor_invocation',6,'p_explicit_constructor_invocation2','parser.py',931),
('explicit_constructor_invocation -> primary . SUPER ( argument_list_opt ) ;','explicit_constructor_invocation',7,'p_explicit_constructor_invocation3','parser.py',935),
('explicit_constructor_invocation -> name . SUPER ( argument_list_opt ) ;','explicit_constructor_invocation',7,'p_explicit_constructor_invocation3','parser.py',936),
('explicit_constructor_invocation -> primary . THIS ( argument_list_opt ) ;','explicit_constructor_invocation',7,'p_explicit_constructor_invocation3','parser.py',937),
('explicit_constructor_invocation -> name . THIS ( argument_list_opt ) ;','explicit_constructor_invocation',7,'p_explicit_constructor_invocation3','parser.py',938),
('explicit_constructor_invocation -> primary . type_arguments SUPER ( argument_list_opt ) ;','explicit_constructor_invocation',8,'p_explicit_constructor_invocation4','parser.py',942),
('explicit_constructor_invocation -> name . type_arguments SUPER ( argument_list_opt ) ;','explicit_constructor_invocation',8,'p_explicit_constructor_invocation4','parser.py',943),
('explicit_constructor_invocation -> primary . type_arguments THIS ( argument_list_opt ) ;','explicit_constructor_invocation',8,'p_explicit_constructor_invocation4','parser.py',944),
('explicit_constructor_invocation -> name . type_arguments THIS ( argument_list_opt ) ;','explicit_constructor_invocation',8,'p_explicit_constructor_invocation4','parser.py',945),
('class_instance_creation_expression -> NEW type_arguments class_type ( argument_list_opt ) class_body_opt','class_instance_creation_expression',7,'p_class_instance_creation_expression','parser.py',949),
('class_instance_creation_expression -> NEW class_type ( argument_list_opt ) class_body_opt','class_instance_creation_expression',6,'p_class_instance_creation_expression2','parser.py',953),
('class_instance_creation_expression -> primary . NEW type_arguments class_type ( argument_list_opt ) class_body_opt','class_instance_creation_expression',9,'p_class_instance_creation_expression3','parser.py',957),
('class_instance_creation_expression -> primary . NEW class_type ( argument_list_opt ) class_body_opt','class_instance_creation_expression',8,'p_class_instance_creation_expression4','parser.py',961),
('class_instance_creation_expression -> class_instance_creation_expression_name NEW class_type ( argument_list_opt ) class_body_opt','class_instance_creation_expression',7,'p_class_instance_creation_expression5','parser.py',965),
('class_instance_creation_expression -> class_instance_creation_expression_name NEW type_arguments class_type ( argument_list_opt ) class_body_opt','class_instance_creation_expression',8,'p_class_instance_creation_expression6','parser.py',969),
('class_instance_creation_expression_name -> name .','class_instance_creation_expression_name',2,'p_class_instance_creation_expression_name','parser.py',973),
('class_body_opt -> class_body','class_body_opt',1,'p_class_body_opt','parser.py',977),
('class_body_opt -> empty','class_body_opt',1,'p_class_body_opt','parser.py',978),
('field_access -> primary . NAME','field_access',3,'p_field_access','parser.py',982),
('field_access -> SUPER . NAME','field_access',3,'p_field_access','parser.py',983),
('array_access -> name [ expression ]','array_access',4,'p_array_access','parser.py',987),
('array_access -> primary_no_new_array [ expression ]','array_access',4,'p_array_access','parser.py',988),
('array_access -> array_creation_with_array_initializer [ expression ]','array_access',4,'p_array_access','parser.py',989),
('array_creation_with_array_initializer -> NEW primitive_type dim_with_or_without_exprs array_initializer','array_creation_with_array_initializer',4,'p_array_creation_with_array_initializer','parser.py',993),
('array_creation_with_array_initializer -> NEW class_or_interface_type dim_with_or_without_exprs array_initializer','array_creation_with_array_initializer',4,'p_array_creation_with_array_initializer','parser.py',994),
('dim_with_or_without_exprs -> dim_with_or_without_expr','dim_with_or_without_exprs',1,'p_dim_with_or_without_exprs','parser.py',998),
('dim_with_or_without_exprs -> dim_with_or_without_exprs dim_with_or_without_expr','dim_with_or_without_exprs',2,'p_dim_with_or_without_exprs','parser.py',999),
('dim_with_or_without_expr -> [ expression ]','dim_with_or_without_expr',3,'p_dim_with_or_without_expr','parser.py',1006),
('dim_with_or_without_expr -> [ ]','dim_with_or_without_expr',2,'p_dim_with_or_without_expr','parser.py',1007),
('array_creation_without_array_initializer -> NEW primitive_type dim_with_or_without_exprs','array_creation_without_array_initializer',3,'p_array_creation_without_array_initializer','parser.py',1014),
('array_creation_without_array_initializer -> NEW class_or_interface_type dim_with_or_without_exprs','array_creation_without_array_initializer',3,'p_array_creation_without_array_initializer','parser.py',1015),
('name -> simple_name','name',1,'p_name','parser.py',1021),
('name -> qualified_name','name',1,'p_name','parser.py',1022),
('simple_name -> NAME','simple_name',1,'p_simple_name','parser.py',1026),
('qualified_name -> name . simple_name','qualified_name',3,'p_qualified_name','parser.py',1030),
('literal -> NUM','literal',1,'p_literal','parser.py',1037),
('literal -> CHAR_LITERAL','literal',1,'p_literal','parser.py',1038),
('literal -> STRING_LITERAL','literal',1,'p_literal','parser.py',1039),
('literal -> TRUE','literal',1,'p_literal','parser.py',1040),
('literal -> FALSE','literal',1,'p_literal','parser.py',1041),
('literal -> NULL','literal',1,'p_literal','parser.py',1042),
('modifiers_opt -> modifiers','modifiers_opt',1,'p_modifiers_opt','parser.py',1048),
('modifiers_opt -> empty','modifiers_opt',1,'p_modifiers_opt2','parser.py',1052),
('modifiers -> modifier','modifiers',1,'p_modifiers','parser.py',1056),
('modifiers -> modifiers modifier','modifiers',2,'p_modifiers','parser.py',1057),
('modifier -> PUBLIC','modifier',1,'p_modifier','parser.py',1064),
('modifier -> PROTECTED','modifier',1,'p_modifier','parser.py',1065),
('modifier -> PRIVATE','modifier',1,'p_modifier','parser.py',1066),
('modifier -> STATIC','modifier',1,'p_modifier','parser.py',1067),
('modifier -> ABSTRACT','modifier',1,'p_modifier','parser.py',1068),
('modifier -> FINAL','modifier',1,'p_modifier','parser.py',1069),
('modifier -> NATIVE','modifier',1,'p_modifier','parser.py',1070),
('modifier -> SYNCHRONIZED','modifier',1,'p_modifier','parser.py',1071),
('modifier -> TRANSIENT','modifier',1,'p_modifier','parser.py',1072),
('modifier -> VOLATILE','modifier',1,'p_modifier','parser.py',1073),
('modifier -> STRICTFP','modifier',1,'p_modifier','parser.py',1074),
('modifier -> annotation','modifier',1,'p_modifier','parser.py',1075),
('type -> primitive_type','type',1,'p_type','parser.py',1079),
('type -> reference_type','type',1,'p_type','parser.py',1080),
('primitive_type -> BOOLEAN','primitive_type',1,'p_primitive_type','parser.py',1084),
('primitive_type -> VOID','primitive_type',1,'p_primitive_type','parser.py',1085),
('primitive_type -> BYTE','primitive_type',1,'p_primitive_type','parser.py',1086),
('primitive_type -> SHORT','primitive_type',1,'p_primitive_type','parser.py',1087),
('primitive_type -> INT','primitive_type',1,'p_primitive_type','parser.py',1088),
('primitive_type -> LONG','primitive_type',1,'p_primitive_type','parser.py',1089),
('primitive_type -> CHAR','primitive_type',1,'p_primitive_type','parser.py',1090),
('primitive_type -> FLOAT','primitive_type',1,'p_primitive_type','parser.py',1091),
('primitive_type -> DOUBLE','primitive_type',1,'p_primitive_type','parser.py',1092),
('reference_type -> class_or_interface_type','reference_type',1,'p_reference_type','parser.py',1096),
('reference_type -> array_type','reference_type',1,'p_reference_type','parser.py',1097),
('class_or_interface_type -> class_or_interface','class_or_interface_type',1,'p_class_or_interface_type','parser.py',1101),
('class_or_interface_type -> generic_type','class_or_interface_type',1,'p_class_or_interface_type','parser.py',1102),
('class_type -> class_or_interface_type','class_type',1,'p_class_type','parser.py',1106),
('class_or_interface -> name','class_or_interface',1,'p_class_or_interface','parser.py',1110),
('class_or_interface -> generic_type . name','class_or_interface',3,'p_class_or_interface','parser.py',1111),
('generic_type -> class_or_interface type_arguments','generic_type',2,'p_generic_type','parser.py',1118),
('generic_type -> class_or_interface < >','generic_type',3,'p_generic_type2','parser.py',1123),
('array_type -> primitive_type dims','array_type',2,'p_array_type','parser.py',1138),
('array_type -> name dims','array_type',2,'p_array_type','parser.py',1139),
('array_type -> generic_type dims','array_type',2,'p_array_type2','parser.py',1143),
('array_type -> generic_type . name dims','array_type',4,'p_array_type3','parser.py',1148),
('type_arguments -> < type_argument_list1','type_arguments',2,'p_type_arguments','parser.py',1152),
('type_argument_list1 -> type_argument1','type_argument_list1',1,'p_type_argument_list1','parser.py',1156),
('type_argument_list1 -> type_argument_list , type_argument1','type_argument_list1',3,'p_type_argument_list1','parser.py',1157),
('type_argument_list -> type_argument','type_argument_list',1,'p_type_argument_list','parser.py',1164),
('type_argument_list -> type_argument_list , type_argument','type_argument_list',3,'p_type_argument_list','parser.py',1165),
('type_argument -> reference_type','type_argument',1,'p_type_argument','parser.py',1172),
('type_argument -> wildcard','type_argument',1,'p_type_argument','parser.py',1173),
('type_argument1 -> reference_type1','type_argument1',1,'p_type_argument1','parser.py',1177),
('type_argument1 -> wildcard1','type_argument1',1,'p_type_argument1','parser.py',1178),
('reference_type1 -> reference_type >','reference_type1',2,'p_reference_type1','parser.py',1182),
('reference_type1 -> class_or_interface < type_argument_list2','reference_type1',3,'p_reference_type1','parser.py',1183),
('type_argument_list2 -> type_argument2','type_argument_list2',1,'p_type_argument_list2','parser.py',1191),
('type_argument_list2 -> type_argument_list , type_argument2','type_argument_list2',3,'p_type_argument_list2','parser.py',1192),
('type_argument2 -> reference_type2','type_argument2',1,'p_type_argument2','parser.py',1199),
('type_argument2 -> wildcard2','type_argument2',1,'p_type_argument2','parser.py',1200),
('reference_type2 -> reference_type RSHIFT','reference_type2',2,'p_reference_type2','parser.py',1204),
('reference_type2 -> class_or_interface < type_argument_list3','reference_type2',3,'p_reference_type2','parser.py',1205),
('type_argument_list3 -> type_argument3','type_argument_list3',1,'p_type_argument_list3','parser.py',1213),
('type_argument_list3 -> type_argument_list , type_argument3','type_argument_list3',3,'p_type_argument_list3','parser.py',1214),
('type_argument3 -> reference_type3','type_argument3',1,'p_type_argument3','parser.py',1221),
('type_argument3 -> wildcard3','type_argument3',1,'p_type_argument3','parser.py',1222),
('reference_type3 -> reference_type RRSHIFT','reference_type3',2,'p_reference_type3','parser.py',1226),
('wildcard -> ?','wildcard',1,'p_wildcard','parser.py',1230),
('wildcard -> ? wildcard_bounds','wildcard',2,'p_wildcard','parser.py',1231),
('wildcard_bounds -> EXTENDS reference_type','wildcard_bounds',2,'p_wildcard_bounds','parser.py',1238),
('wildcard_bounds -> SUPER reference_type','wildcard_bounds',2,'p_wildcard_bounds','parser.py',1239),
('wildcard1 -> ? >','wildcard1',2,'p_wildcard1','parser.py',1246),
('wildcard1 -> ? wildcard_bounds1','wildcard1',2,'p_wildcard1','parser.py',1247),
('wildcard_bounds1 -> EXTENDS reference_type1','wildcard_bounds1',2,'p_wildcard_bounds1','parser.py',1254),
('wildcard_bounds1 -> SUPER reference_type1','wildcard_bounds1',2,'p_wildcard_bounds1','parser.py',1255),
('wildcard2 -> ? RSHIFT','wildcard2',2,'p_wildcard2','parser.py',1262),
('wildcard2 -> ? wildcard_bounds2','wildcard2',2,'p_wildcard2','parser.py',1263),
('wildcard_bounds2 -> EXTENDS reference_type2','wildcard_bounds2',2,'p_wildcard_bounds2','parser.py',1270),
('wildcard_bounds2 -> SUPER reference_type2','wildcard_bounds2',2,'p_wildcard_bounds2','parser.py',1271),
('wildcard3 -> ? RRSHIFT','wildcard3',2,'p_wildcard3','parser.py',1278),
('wildcard3 -> ? wildcard_bounds3','wildcard3',2,'p_wildcard3','parser.py',1279),
('wildcard_bounds3 -> EXTENDS reference_type3','wildcard_bounds3',2,'p_wildcard_bounds3','parser.py',1286),
('wildcard_bounds3 -> SUPER reference_type3','wildcard_bounds3',2,'p_wildcard_bounds3','parser.py',1287),
('type_parameter_header -> NAME','type_parameter_header',1,'p_type_parameter_header','parser.py',1294),
('type_parameters -> < type_parameter_list1','type_parameters',2,'p_type_parameters','parser.py',1298),
('type_parameter_list -> type_parameter','type_parameter_list',1,'p_type_parameter_list','parser.py',1302),
('type_parameter_list -> type_parameter_list , type_parameter','type_parameter_list',3,'p_type_parameter_list','parser.py',1303),
('type_parameter -> type_parameter_header','type_parameter',1,'p_type_parameter','parser.py',1310),
('type_parameter -> type_parameter_header EXTENDS reference_type','type_parameter',3,'p_type_parameter','parser.py',1311),
('type_parameter -> type_parameter_header EXTENDS reference_type additional_bound_list','type_parameter',4,'p_type_parameter','parser.py',1312),
('additional_bound_list -> additional_bound','additional_bound_list',1,'p_additional_bound_list','parser.py',1321),
('additional_bound_list -> additional_bound_list additional_bound','additional_bound_list',2,'p_additional_bound_list','parser.py',1322),
('additional_bound -> & reference_type','additional_bound',2,'p_additional_bound','parser.py',1329),
('type_parameter_list1 -> type_parameter1','type_parameter_list1',1,'p_type_parameter_list1','parser.py',1333),
('type_parameter_list1 -> type_parameter_list , type_parameter1','type_parameter_list1',3,'p_type_parameter_list1','parser.py',1334),
('type_parameter1 -> type_parameter_header >','type_parameter1',2,'p_type_parameter1','parser.py',1341),
('type_parameter1 -> type_parameter_header EXTENDS reference_type1','type_parameter1',3,'p_type_parameter1','parser.py',1342),
('type_parameter1 -> type_parameter_header EXTENDS reference_type additional_bound_list1','type_parameter1',4,'p_type_parameter1','parser.py',1343),
('additional_bound_list1 -> additional_bound1','additional_bound_list1',1,'p_additional_bound_list1','parser.py',1352),
('additional_bound_list1 -> additional_bound_list additional_bound1','additional_bound_list1',2,'p_additional_bound_list1','parser.py',1353),
('additional_bound1 -> & reference_type1','additional_bound1',2,'p_additional_bound1','parser.py',1360),
('type_declaration -> class_declaration','type_declaration',1,'p_type_declaration','parser.py',1366),
('type_declaration -> interface_declaration','type_declaration',1,'p_type_declaration','parser.py',1367),
('type_declaration -> enum_declaration','type_declaration',1,'p_type_declaration','parser.py',1368),
('type_declaration -> annotation_type_declaration','type_declaration',1,'p_type_declaration','parser.py',1369),
('type_declaration -> ;','type_declaration',1,'p_type_declaration2','parser.py',1373),
('class_declaration -> class_header class_body','class_declaration',2,'p_class_declaration','parser.py',1377),
('class_header -> class_header_name class_header_extends_opt class_header_implements_opt','class_header',3,'p_class_header','parser.py',1383),
('class_header_name -> class_header_name1 type_parameters','class_header_name',2,'p_class_header_name','parser.py',1389),
('class_header_name -> class_header_name1','class_header_name',1,'p_class_header_name','parser.py',1390),
('class_header_name1 -> modifiers_opt CLASS NAME','class_header_name1',3,'p_class_header_name1','parser.py',1398),
('class_header_extends_opt -> class_header_extends','class_header_extends_opt',1,'p_class_header_extends_opt','parser.py',1402),
('class_header_extends_opt -> empty','class_header_extends_opt',1,'p_class_header_extends_opt','parser.py',1403),
('class_header_extends -> EXTENDS class_type','class_header_extends',2,'p_class_header_extends','parser.py',1407),
('class_header_implements_opt -> class_header_implements','class_header_implements_opt',1,'p_class_header_implements_opt','parser.py',1411),
('class_header_implements_opt -> empty','class_header_implements_opt',1,'p_class_header_implements_opt','parser.py',1412),
('class_header_implements -> IMPLEMENTS interface_type_list','class_header_implements',2,'p_class_header_implements','parser.py',1416),
('interface_type_list -> interface_type','interface_type_list',1,'p_interface_type_list','parser.py',1420),
('interface_type_list -> interface_type_list , interface_type','interface_type_list',3,'p_interface_type_list','parser.py',1421),
('interface_type -> class_or_interface_type','interface_type',1,'p_interface_type','parser.py',1428),
('class_body -> { class_body_declarations_opt }','class_body',3,'p_class_body','parser.py',1432),
('class_body_declarations_opt -> class_body_declarations','class_body_declarations_opt',1,'p_class_body_declarations_opt','parser.py',1436),
('class_body_declarations_opt -> empty','class_body_declarations_opt',1,'p_class_body_declarations_opt2','parser.py',1440),
('class_body_declarations -> class_body_declaration','class_body_declarations',1,'p_class_body_declarations','parser.py',1444),
('class_body_declarations -> class_body_declarations class_body_declaration','class_body_declarations',2,'p_class_body_declarations','parser.py',1445),
('class_body_declaration -> class_member_declaration','class_body_declaration',1,'p_class_body_declaration','parser.py',1452),
('class_body_declaration -> static_initializer','class_body_declaration',1,'p_class_body_declaration','parser.py',1453),
('class_body_declaration -> constructor_declaration','class_body_declaration',1,'p_class_body_declaration','parser.py',1454),
('class_body_declaration -> block','class_body_declaration',1,'p_class_body_declaration2','parser.py',1458),
('class_member_declaration -> field_declaration','class_member_declaration',1,'p_class_member_declaration','parser.py',1462),
('class_member_declaration -> class_declaration','class_member_declaration',1,'p_class_member_declaration','parser.py',1463),
('class_member_declaration -> method_declaration','class_member_declaration',1,'p_class_member_declaration','parser.py',1464),
('class_member_declaration -> interface_declaration','class_member_declaration',1,'p_class_member_declaration','parser.py',1465),
('class_member_declaration -> enum_declaration','class_member_declaration',1,'p_class_member_declaration','parser.py',1466),
('class_member_declaration -> annotation_type_declaration','class_member_declaration',1,'p_class_member_declaration','parser.py',1467),
('class_member_declaration -> ;','class_member_declaration',1,'p_class_member_declaration2','parser.py',1471),
('field_declaration -> modifiers_opt type variable_declarators ;','field_declaration',4,'p_field_declaration','parser.py',1475),
('static_initializer -> STATIC block','static_initializer',2,'p_static_initializer','parser.py',1479),
('constructor_declaration -> constructor_header method_body','constructor_declaration',2,'p_constructor_declaration','parser.py',1483),
('constructor_header -> constructor_header_name formal_parameter_list_opt ) method_header_throws_clause_opt','constructor_header',4,'p_constructor_header','parser.py',1489),
('constructor_header_name -> modifiers_opt type_parameters NAME (','constructor_header_name',4,'p_constructor_header_name','parser.py',1495),
('constructor_header_name -> modifiers_opt NAME (','constructor_header_name',3,'p_constructor_header_name','parser.py',1496),
('formal_parameter_list_opt -> formal_parameter_list','formal_parameter_list_opt',1,'p_formal_parameter_list_opt','parser.py',1503),
('formal_parameter_list_opt -> empty','formal_parameter_list_opt',1,'p_formal_parameter_list_opt2','parser.py',1507),
('formal_parameter_list -> formal_parameter','formal_parameter_list',1,'p_formal_parameter_list','parser.py',1511),
('formal_parameter_list -> formal_parameter_list , formal_parameter','formal_parameter_list',3,'p_formal_parameter_list','parser.py',1512),
('formal_parameter -> modifiers_opt type variable_declarator_id','formal_parameter',3,'p_formal_parameter','parser.py',1519),
('formal_parameter -> modifiers_opt type ELLIPSIS variable_declarator_id','formal_parameter',4,'p_formal_parameter','parser.py',1520),
('method_header_throws_clause_opt -> method_header_throws_clause','method_header_throws_clause_opt',1,'p_method_header_throws_clause_opt','parser.py',1527),
('method_header_throws_clause_opt -> empty','method_header_throws_clause_opt',1,'p_method_header_throws_clause_opt','parser.py',1528),
('method_header_throws_clause -> THROWS class_type_list','method_header_throws_clause',2,'p_method_header_throws_clause','parser.py',1532),
('class_type_list -> class_type_elt','class_type_list',1,'p_class_type_list','parser.py',1536),
('class_type_list -> class_type_list , class_type_elt','class_type_list',3,'p_class_type_list','parser.py',1537),
('class_type_elt -> class_type','class_type_elt',1,'p_class_type_elt','parser.py',1544),
('method_body -> { block_statements_opt }','method_body',3,'p_method_body','parser.py',1548),
('method_declaration -> abstract_method_declaration','method_declaration',1,'p_method_declaration','parser.py',1553),
('method_declaration -> method_header method_body','method_declaration',2,'p_method_declaration','parser.py',1554),
('abstract_method_declaration -> method_header ;','abstract_method_declaration',2,'p_abstract_method_declaration','parser.py',1564),
('method_header -> method_header_name formal_parameter_list_opt ) method_header_extended_dims method_header_throws_clause_opt','method_header',5,'p_method_header','parser.py',1571),
('method_header_name -> modifiers_opt type_parameters type NAME (','method_header_name',5,'p_method_header_name','parser.py',1578),
('method_header_name -> modifiers_opt type NAME (','method_header_name',4,'p_method_header_name','parser.py',1579),
('method_header_extended_dims -> dims_opt','method_header_extended_dims',1,'p_method_header_extended_dims','parser.py',1586),
('interface_declaration -> interface_header interface_body','interface_declaration',2,'p_interface_declaration','parser.py',1590),
('interface_header -> interface_header_name interface_header_extends_opt','interface_header',2,'p_interface_header','parser.py',1597),
('interface_header_name -> interface_header_name1 type_parameters','interface_header_name',2,'p_interface_header_name','parser.py',1602),
('interface_header_name -> interface_header_name1','interface_header_name',1,'p_interface_header_name','parser.py',1603),
('interface_header_name1 -> modifiers_opt INTERFACE NAME','interface_header_name1',3,'p_interface_header_name1','parser.py',1611),
('interface_header_extends_opt -> interface_header_extends','interface_header_extends_opt',1,'p_interface_header_extends_opt','parser.py',1615),
('interface_header_extends_opt -> empty','interface_header_extends_opt',1,'p_interface_header_extends_opt2','parser.py',1619),
('interface_header_extends -> EXTENDS interface_type_list','interface_header_extends',2,'p_interface_header_extends','parser.py',1623),
('interface_body -> { interface_member_declarations_opt }','interface_body',3,'p_interface_body','parser.py',1627),
('interface_member_declarations_opt -> interface_member_declarations','interface_member_declarations_opt',1,'p_interface_member_declarations_opt','parser.py',1631),
('interface_member_declarations_opt -> empty','interface_member_declarations_opt',1,'p_interface_member_declarations_opt2','parser.py',1635),
('interface_member_declarations -> interface_member_declaration','interface_member_declarations',1,'p_interface_member_declarations','parser.py',1639),
('interface_member_declarations -> interface_member_declarations interface_member_declaration','interface_member_declarations',2,'p_interface_member_declarations','parser.py',1640),
('interface_member_declaration -> constant_declaration','interface_member_declaration',1,'p_interface_member_declaration','parser.py',1647),
('interface_member_declaration -> abstract_method_declaration','interface_member_declaration',1,'p_interface_member_declaration','parser.py',1648),
('interface_member_declaration -> class_declaration','interface_member_declaration',1,'p_interface_member_declaration','parser.py',1649),
('interface_member_declaration -> interface_declaration','interface_member_declaration',1,'p_interface_member_declaration','parser.py',1650),
('interface_member_declaration -> enum_declaration','interface_member_declaration',1,'p_interface_member_declaration','parser.py',1651),
('interface_member_declaration -> annotation_type_declaration','interface_member_declaration',1,'p_interface_member_declaration','parser.py',1652),
('interface_member_declaration -> ;','interface_member_declaration',1,'p_interface_member_declaration2','parser.py',1656),
('constant_declaration -> field_declaration','constant_declaration',1,'p_constant_declaration','parser.py',1660),
('enum_declaration -> enum_header enum_body','enum_declaration',2,'p_enum_declaration','parser.py',1664),
('enum_header -> enum_header_name class_header_implements_opt','enum_header',2,'p_enum_header','parser.py',1670),
('enum_header_name -> modifiers_opt ENUM NAME','enum_header_name',3,'p_enum_header_name','parser.py',1675),
('enum_header_name -> modifiers_opt ENUM NAME type_parameters','enum_header_name',4,'p_enum_header_name','parser.py',1676),
('enum_body -> { enum_body_declarations_opt }','enum_body',3,'p_enum_body','parser.py',1683),
('enum_body -> { , enum_body_declarations_opt }','enum_body',4,'p_enum_body2','parser.py',1687),
('enum_body -> { enum_constants , enum_body_declarations_opt }','enum_body',5,'p_enum_body3','parser.py',1691),
('enum_body -> { enum_constants enum_body_declarations_opt }','enum_body',4,'p_enum_body4','parser.py',1695),
('enum_constants -> enum_constant','enum_constants',1,'p_enum_constants','parser.py',1699),
('enum_constants -> enum_constants , enum_constant','enum_constants',3,'p_enum_constants','parser.py',1700),
('enum_constant -> enum_constant_header class_body','enum_constant',2,'p_enum_constant','parser.py',1707),
('enum_constant -> enum_constant_header','enum_constant',1,'p_enum_constant','parser.py',1708),
('enum_constant_header -> enum_constant_header_name arguments_opt','enum_constant_header',2,'p_enum_constant_header','parser.py',1715),
('enum_constant_header_name -> modifiers_opt NAME','enum_constant_header_name',2,'p_enum_constant_header_name','parser.py',1720),
('arguments_opt -> arguments','arguments_opt',1,'p_arguments_opt','parser.py',1724),
('arguments_opt -> empty','arguments_opt',1,'p_arguments_opt2','parser.py',1728),
('arguments -> ( argument_list_opt )','arguments',3,'p_arguments','parser.py',1732),
('argument_list_opt -> argument_list','argument_list_opt',1,'p_argument_list_opt','parser.py',1736),
('argument_list_opt -> empty','argument_list_opt',1,'p_argument_list_opt2','parser.py',1740),
('argument_list -> expression','argument_list',1,'p_argument_list','parser.py',1744),
('argument_list -> argument_list , expression','argument_list',3,'p_argument_list','parser.py',1745),
('enum_body_declarations_opt -> enum_declarations','enum_body_declarations_opt',1,'p_enum_body_declarations_opt','parser.py',1752),
('enum_body_declarations_opt -> empty','enum_body_declarations_opt',1,'p_enum_body_declarations_opt2','parser.py',1756),
('enum_declarations -> ; class_body_declarations_opt','enum_declarations',2,'p_enum_body_declarations','parser.py',1760),
('annotation_type_declaration -> annotation_type_declaration_header annotation_type_body','annotation_type_declaration',2,'p_annotation_type_declaration','parser.py',1764),
('annotation_type_declaration_header -> annotation_type_declaration_header_name class_header_extends_opt class_header_implements_opt','annotation_type_declaration_header',3,'p_annotation_type_declaration_header','parser.py',1771),
('annotation_type_declaration_header_name -> modifiers @ INTERFACE NAME','annotation_type_declaration_header_name',4,'p_annotation_type_declaration_header_name','parser.py',1777),
('annotation_type_declaration_header_name -> modifiers @ INTERFACE NAME type_parameters','annotation_type_declaration_header_name',5,'p_annotation_type_declaration_header_name2','parser.py',1781),
('annotation_type_declaration_header_name -> @ INTERFACE NAME type_parameters','annotation_type_declaration_header_name',4,'p_annotation_type_declaration_header_name3','parser.py',1785),
('annotation_type_declaration_header_name -> @ INTERFACE NAME','annotation_type_declaration_header_name',3,'p_annotation_type_declaration_header_name4','parser.py',1789),
('annotation_type_body -> { annotation_type_member_declarations_opt }','annotation_type_body',3,'p_annotation_type_body','parser.py',1793),
('annotation_type_member_declarations_opt -> annotation_type_member_declarations','annotation_type_member_declarations_opt',1,'p_annotation_type_member_declarations_opt','parser.py',1797),
('annotation_type_member_declarations_opt -> empty','annotation_type_member_declarations_opt',1,'p_annotation_type_member_declarations_opt2','parser.py',1801),
('annotation_type_member_declarations -> annotation_type_member_declaration','annotation_type_member_declarations',1,'p_annotation_type_member_declarations','parser.py',1805),
('annotation_type_member_declarations -> annotation_type_member_declarations annotation_type_member_declaration','annotation_type_member_declarations',2,'p_annotation_type_member_declarations','parser.py',1806),
('annotation_type_member_declaration -> annotation_method_header ;','annotation_type_member_declaration',2,'p_annotation_type_member_declaration','parser.py',1813),
('annotation_type_member_declaration -> constant_declaration','annotation_type_member_declaration',1,'p_annotation_type_member_declaration','parser.py',1814),
('annotation_type_member_declaration -> constructor_declaration','annotation_type_member_declaration',1,'p_annotation_type_member_declaration','parser.py',1815),
('annotation_type_member_declaration -> type_declaration','annotation_type_member_declaration',1,'p_annotation_type_member_declaration','parser.py',1816),
('annotation_method_header -> annotation_method_header_name formal_parameter_list_opt ) method_header_extended_dims annotation_method_header_default_value_opt','annotation_method_header',5,'p_annotation_method_header','parser.py',1820),
('annotation_method_header_name -> modifiers_opt type_parameters type NAME (','annotation_method_header_name',5,'p_annotation_method_header_name','parser.py',1827),
('annotation_method_header_name -> modifiers_opt type NAME (','annotation_method_header_name',4,'p_annotation_method_header_name','parser.py',1828),
('annotation_method_header_default_value_opt -> default_value','annotation_method_header_default_value_opt',1,'p_annotation_method_header_default_value_opt','parser.py',1835),
('annotation_method_header_default_value_opt -> empty','annotation_method_header_default_value_opt',1,'p_annotation_method_header_default_value_opt','parser.py',1836),
('default_value -> DEFAULT member_value','default_value',2,'p_default_value','parser.py',1840),
('member_value -> conditional_expression_not_name','member_value',1,'p_member_value','parser.py',1844),
('member_value -> name','member_value',1,'p_member_value','parser.py',1845),
('member_value -> annotation','member_value',1,'p_member_value','parser.py',1846),
('member_value -> member_value_array_initializer','member_value',1,'p_member_value','parser.py',1847),
('member_value_array_initializer -> { member_values , }','member_value_array_initializer',4,'p_member_value_array_initializer','parser.py',1851),
('member_value_array_initializer -> { member_values }','member_value_array_initializer',3,'p_member_value_array_initializer','parser.py',1852),
('member_value_array_initializer -> { , }','member_value_array_initializer',3,'p_member_value_array_initializer2','parser.py',1856),
('member_value_array_initializer -> { }','member_value_array_initializer',2,'p_member_value_array_initializer2','parser.py',1857),
('member_values -> member_value','member_values',1,'p_member_values','parser.py',1861),
('member_values -> member_values , member_value','member_values',3,'p_member_values','parser.py',1862),
('annotation -> normal_annotation','annotation',1,'p_annotation','parser.py',1869),
('annotation -> marker_annotation','annotation',1,'p_annotation','parser.py',1870),
('annotation -> single_member_annotation','annotation',1,'p_annotation','parser.py',1871),
('normal_annotation -> annotation_name ( member_value_pairs_opt )','normal_annotation',4,'p_normal_annotation','parser.py',1875),
('annotation_name -> @ name','annotation_name',2,'p_annotation_name','parser.py',1879),
('member_value_pairs_opt -> member_value_pairs','member_value_pairs_opt',1,'p_member_value_pairs_opt','parser.py',1883),
('member_value_pairs_opt -> empty','member_value_pairs_opt',1,'p_member_value_pairs_opt2','parser.py',1887),
('member_value_pairs -> member_value_pair','member_value_pairs',1,'p_member_value_pairs','parser.py',1891),
('member_value_pairs -> member_value_pairs , member_value_pair','member_value_pairs',3,'p_member_value_pairs','parser.py',1892),
('member_value_pair -> simple_name = member_value','member_value_pair',3,'p_member_value_pair','parser.py',1899),
('marker_annotation -> annotation_name','marker_annotation',1,'p_marker_annotation','parser.py',1903),
('single_member_annotation -> annotation_name ( single_member_annotation_member_value )','single_member_annotation',4,'p_single_member_annotation','parser.py',1907),
('single_member_annotation_member_value -> member_value','single_member_annotation_member_value',1,'p_single_member_annotation_member_value','parser.py',1911),
('compilation_unit -> package_declaration','compilation_unit',1,'p_compilation_unit','parser.py',1917),
('compilation_unit -> package_declaration import_declarations','compilation_unit',2,'p_compilation_unit2','parser.py',1921),
('compilation_unit -> package_declaration import_declarations type_declarations','compilation_unit',3,'p_compilation_unit3','parser.py',1925),
('compilation_unit -> package_declaration type_declarations','compilation_unit',2,'p_compilation_unit4','parser.py',1929),
('compilation_unit -> import_declarations','compilation_unit',1,'p_compilation_unit5','parser.py',1933),
('compilation_unit -> type_declarations','compilation_unit',1,'p_compilation_unit6','parser.py',1937),
('compilation_unit -> import_declarations type_declarations','compilation_unit',2,'p_compilation_unit7','parser.py',1941),
('compilation_unit -> empty','compilation_unit',1,'p_compilation_unit8','parser.py',1945),
('package_declaration -> package_declaration_name ;','package_declaration',2,'p_package_declaration','parser.py',1949),
('package_declaration_name -> modifiers PACKAGE name','package_declaration_name',3,'p_package_declaration_name','parser.py',1956),
('package_declaration_name -> PACKAGE name','package_declaration_name',2,'p_package_declaration_name','parser.py',1957),
('import_declarations -> import_declaration','import_declarations',1,'p_import_declarations','parser.py',1964),
('import_declarations -> import_declarations import_declaration','import_declarations',2,'p_import_declarations','parser.py',1965),
('import_declaration -> single_type_import_declaration','import_declaration',1,'p_import_declaration','parser.py',1972),
('import_declaration -> type_import_on_demand_declaration','import_declaration',1,'p_import_declaration','parser.py',1973),
('import_declaration -> single_static_import_declaration','import_declaration',1,'p_import_declaration','parser.py',1974),
('import_declaration -> static_import_on_demand_declaration','import_declaration',1,'p_import_declaration','parser.py',1975),
('single_type_import_declaration -> IMPORT name ;','single_type_import_declaration',3,'p_single_type_import_declaration','parser.py',1979),
('type_import_on_demand_declaration -> IMPORT name . * ;','type_import_on_demand_declaration',5,'p_type_import_on_demand_declaration','parser.py',1983),
('single_static_import_declaration -> IMPORT STATIC name ;','single_static_import_declaration',4,'p_single_static_import_declaration','parser.py',1987),
('static_import_on_demand_declaration -> IMPORT STATIC name . * ;','static_import_on_demand_declaration',6,'p_static_import_on_demand_declaration','parser.py',1991),
('type_declarations -> type_declaration','type_declarations',1,'p_type_declarations','parser.py',1995),
('type_declarations -> type_declarations type_declaration','type_declarations',2,'p_type_declarations','parser.py',1996),
('goal -> PLUSPLUS compilation_unit','goal',2,'p_goal_compilation_unit','parser.py',2007),
('goal -> MINUSMINUS expression','goal',2,'p_goal_expression','parser.py',2011),
('goal -> * block_statement','goal',2,'p_goal_statement','parser.py',2015),
('empty -> <empty>','empty',0,'p_empty','parser.py',2022),
]
| 511.845329 | 192,018 | 0.713683 | 70,533 | 334,235 | 3.302539 | 0.023422 | 0.021396 | 0.018172 | 0.007521 | 0.784033 | 0.731912 | 0.687857 | 0.656612 | 0.622646 | 0.594961 | 0 | 0.525447 | 0.011974 | 334,235 | 652 | 192,019 | 512.630368 | 0.179928 | 0.000186 | 0 | 0.00311 | 1 | 0 | 0.206964 | 0.102319 | 0.001555 | 0 | 0 | 0 | 0.007776 | 1 | 0 | false | 0 | 0.024883 | 0 | 0.024883 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
4a066d1b07120900c17d99f34da0959f93693453 | 6,363 | py | Python | config/sentencepiece_model_loc.py | project-anuvaad/OpenNMT-py | 267d097b9e90d59709fe1c26ea8b8e2c43c755c9 | [
"MIT"
] | null | null | null | config/sentencepiece_model_loc.py | project-anuvaad/OpenNMT-py | 267d097b9e90d59709fe1c26ea8b8e2c43c755c9 | [
"MIT"
] | 29 | 2019-07-18T10:21:57.000Z | 2019-10-24T11:41:59.000Z | config/sentencepiece_model_loc.py | project-anuvaad/OpenNMT-py | 267d097b9e90d59709fe1c26ea8b8e2c43c755c9 | [
"MIT"
] | null | null | null | english_hindi = {
"ENG_220519": "model/sentencepiece_models/en-220519.model",
"HIN_220519": "model/sentencepiece_models/hi-220519.model",
"ENG_EXP_1": "model/sentencepiece_models/en_exp-1-2019-10-01-15k.model",
"HIN_EXP_1": "model/sentencepiece_models/hi_exp-1-2019-10-01-15k.model",
"ENG_EXP_10": "model/sentencepiece_models/en_exp-10-2019-10-25-24k.model",
"HIN_EXP_10": "model/sentencepiece_models/hi_exp-10-2019-10-25-24k.model",
"ENG_EXP_12": "model/sentencepiece_models/en_exp-12-2019-10-29-24k.model",
"HIN_EXP_12": "model/sentencepiece_models/hi_exp-12-2019-10-29-24k.model",
"ENG_EXP_5.4": "model/sentencepiece_models/en_exp-5.4-2019-10-29-24k.model",
"HIN_EXP_5.4": "model/sentencepiece_models/hi_exp-5.4-2019-10-29-24k.model",
"ENG_EXP_5.6": "model/sentencepiece_models/en_exp-5.6-2019-12-09-24k.model",
"HIN_EXP_5.6": "model/sentencepiece_models/hi_exp-5.6-2019-12-09-24k.model",
"ENG_EXP_13": "model/sentencepiece_models/en_en-hi-exp-13-2020-03-09-24k.model",
"HIN_EXP_13": "model/sentencepiece_models/hi_en-hi-exp-13-2020-03-09-24k.model",
}
english_tamil = {
"ENG_230919": "model/sentencepiece_models/enTa-2019-09-23-10k.model",
"TAM_230919": "model/sentencepiece_models/tamil-2019-09-23-10k.model",
"ENG_090120": "model/sentencepiece_models/enTa-2020-01-09-24k.model",
"TAM_090120": "model/sentencepiece_models/tamil-2020-01-09-24k.model",
"ENG_080220": "model/sentencepiece_models/enTa-eng-tam-2020-02-08-24k.model",
"TAM_080220": "model/sentencepiece_models/tamil-eng-tam-2020-02-08-24k.model",
"ENG_100220": "model/sentencepiece_models/enTa-ta-to-en-2-2020-02-10-24k.model",
"TAM_100220": "model/sentencepiece_models/tamil-ta-to-en-2-2020-02-10-24k.model",
"ENG_280220": "model/sentencepiece_models/enTa-ta-to-en-3-2020-02-28-24k.model",
"TAM_280220": "model/sentencepiece_models/tamil-ta-to-en-3-2020-02-28-24k.model",
"ENG_060320": "model/sentencepiece_models/enTa-ta-en-1.1-2020-03-06-24k.model",
"TAM_060320": "model/sentencepiece_models/tamil-ta-en-1.1-2020-03-06-24k.model",
}
english_gujarati = {
"ENG_100919": "model/sentencepiece_models/en-2019-09-10-10k.model",
"GUJ_100919": "model/sentencepiece_models/guj-2019-09-10-10k.model",
"ENG_140220": "model/sentencepiece_models/enGuj-en-to-guj-2-2020-02-14-24k.model",
"GUJ_140220": "model/sentencepiece_models/gujarati-en-to-guj-2-2020-02-14-24k.model",
}
english_bengali = {
"ENG_120919": "model/sentencepiece_models/en-2019-09-12-10k.model",
"BENG_120919": "model/sentencepiece_models/beng-2019-09-12-10k.model",
"ENG_180220": "model/sentencepiece_models/enBeng-en-to-beng-2-2020-02-18-24k.model",
"BENG_180220": "model/sentencepiece_models/bengali-en-to-beng-2-2020-02-18-24k.model",
"ENG_281220": "model/sentencepiece_models/enBeng-en-to-bn-3.2-2020-12-28-24k.model",
"BENG_281220": "model/sentencepiece_models/bengali-en-to-bn-3.2-2020-12-28-24k.model",
"ENG_281220_2.2": "model/sentencepiece_models/enBeng-bn-to-en-2.2-2020-12-28-24k.model",
"BENG_281220_2.2": "model/sentencepiece_models/bengali-bn-to-en-2.2-2020-12-28-24k.model",
"ENG_EN_to_BN_4": "model/sentencepiece_models/enBeng-en-to-bn-4-2021-01-19-24k.model",
"BENG_EN_to_BN_4": "model/sentencepiece_models/bengali-en-to-bn-4-2021-01-19-24k.model",
"ENG_BN_to_EN_3": "model/sentencepiece_models/enBeng-bn-to-en-3-2021-01-19-24k.model",
"BENG_BN_to_EN_3": "model/sentencepiece_models/bengali-bn-to-en-3-2021-01-19-24k.model"
}
english_marathi = {
"ENG_140919": "model/sentencepiece_models/enMr-2019-09-14-10k.model",
"MARATHI_140919": "model/sentencepiece_models/marathi-2019-09-14-10k.model",
"ENG_071119": "model/sentencepiece_models/enMr_exp-2-2019-11-07-24k.model",
"MARATHI_071119": "model/sentencepiece_models/marathi_exp-2-2019-11-07-24k.model",
"ENG_270120": "model/sentencepiece_models/enMr-mr-en-1.2-2020-01-27-24k.model",
"MARATHI_270120": "model/sentencepiece_models/marathi-mr-en-1.2-2020-01-27-24k.model",
"ENG_060220": "model/sentencepiece_models/enMr-en-mr-3-2020-02-06-24k.model",
"MARATHI_060220": "model/sentencepiece_models/marathi-en-mr-3-2020-02-06-24k.model",
"ENG_280220": "model/sentencepiece_models/enMr-mr-to-en-2-2020-02-28-24k.model",
"MARATHI_280220": "model/sentencepiece_models/marathi-mr-to-en-2-2020-02-28-24k.model",
}
english_kannada = {
"ENG_200919": "model/sentencepiece_models/enKn-2019-09-20-10k.model",
"KANNADA_200919": "model/sentencepiece_models/kannada-2019-09-20-10k.model",
"ENG_100220": "model/sentencepiece_models/enKann-en-to-kn-2-2020-02-10-24k.model",
"KANNADA_100220": "model/sentencepiece_models/kannada-en-to-kn-2-2020-02-10-24k.model",
}
english_telugu = {
"ENG_200919": "model/sentencepiece_models/enTe-2019-09-20-10k.model",
"TELGU_200919": "model/sentencepiece_models/telgu-2019-09-20-10k.model",
"ENG_120220": "model/sentencepiece_models/enTelg-en-to-tel-2-2020-02-12-24k.model",
"TELUGU_120220": "model/sentencepiece_models/telugu-en-to-tel-2-2020-02-12-24k.model",
}
english_malayalam = {
"ENG_200919": "model/sentencepiece_models/enMl-2019-09-20-10k.model",
"MALAYALAM_200919": "model/sentencepiece_models/malayalam-2019-09-20-10k.model",
"ENG_210220": "model/sentencepiece_models/enMalay-en-to-maly-2-2020-02-21-24k.model",
"MALAYALAM_210220": "model/sentencepiece_models/malayalam-en-to-maly-2-2020-02-21-24k.model"
}
english_punjabi = {
"ENG_200919": "model/sentencepiece_models/enPu-2019-09-20-10k.model",
"PUNJABI_200919": "model/sentencepiece_models/punjabi-2019-09-20-10k.model",
"ENG_160220": "model/sentencepiece_models/enPun-en-to-pun-2-2020-02-16-24k.model",
"PUNJABI_160220": "model/sentencepiece_models/punjabi-en-to-pun-2-2020-02-16-24k.model"
}
hindi_english = {
"HINDI_280619": "model/sentencepiece_models/hi-28062019-10k.model",
"ENGLISH_280619": "model/sentencepiece_models/en-28062019-10k.model",
"HIN_EXP_1_291019":"model/sentencepiece_models/hi_exp_h-1-2019-10-29-24k.model",
"ENG_EXP_1_291019":"model/sentencepiece_models/en_exp_h-1-2019-10-29-24k.model",
"HIN_EXP_2_050520":"model/sentencepiece_models/hi_hi-en-exp-2-2020-05-05-24k.model",
"ENG_EXP_2_050520":"model/sentencepiece_models/en_hi-en-exp-2-2020-05-05-24k.model",
} | 60.6 | 96 | 0.741788 | 1,048 | 6,363 | 4.301527 | 0.097328 | 0.295475 | 0.393966 | 0.06921 | 0.646628 | 0.481588 | 0.370453 | 0.226264 | 0.177906 | 0.021295 | 0 | 0.201397 | 0.077636 | 6,363 | 105 | 97 | 60.6 | 0.566706 | 0 | 0 | 0 | 0 | 0.382979 | 0.825267 | 0.690918 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
c5a80b0cb55a7cc611f1202d213dc5e612bfe7c0 | 101 | py | Python | daiquiri/jobs/exceptions.py | agy-why/daiquiri | 4d3e2ce51e202d5a8f1df404a0094a4e018dcb4d | [
"Apache-2.0"
] | 14 | 2018-12-23T18:35:02.000Z | 2021-12-15T04:55:12.000Z | daiquiri/jobs/exceptions.py | agy-why/daiquiri | 4d3e2ce51e202d5a8f1df404a0094a4e018dcb4d | [
"Apache-2.0"
] | 40 | 2018-12-20T12:44:05.000Z | 2022-03-21T11:35:20.000Z | daiquiri/jobs/exceptions.py | agy-why/daiquiri | 4d3e2ce51e202d5a8f1df404a0094a4e018dcb4d | [
"Apache-2.0"
] | 5 | 2019-05-16T08:03:35.000Z | 2021-08-23T20:03:11.000Z | from daiquiri.core.exceptions import DaiquiriException
class JobError(DaiquiriException):
pass
| 16.833333 | 54 | 0.821782 | 10 | 101 | 8.3 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.128713 | 101 | 5 | 55 | 20.2 | 0.943182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.333333 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 6 |
6806d16f45c843de89aed8535929fe103c352ef0 | 151 | py | Python | pages/themes/beginners/Appendix/pandas_join/db_utils.py | ProgressBG-Python-Course/ProgressBG-VC2-Python | 03b892a42ee1fad3d4f97e328e06a4b1573fd356 | [
"MIT"
] | null | null | null | pages/themes/beginners/Appendix/pandas_join/db_utils.py | ProgressBG-Python-Course/ProgressBG-VC2-Python | 03b892a42ee1fad3d4f97e328e06a4b1573fd356 | [
"MIT"
] | null | null | null | pages/themes/beginners/Appendix/pandas_join/db_utils.py | ProgressBG-Python-Course/ProgressBG-VC2-Python | 03b892a42ee1fad3d4f97e328e06a4b1573fd356 | [
"MIT"
] | null | null | null | import os
import sqlite3
DEFAULT_PATH = 'db/default.sqlite3')
def db_connect(db_path=DEFAULT_PATH):
con = sqlite3.connect(db_path)
return con | 18.875 | 37 | 0.754967 | 23 | 151 | 4.73913 | 0.434783 | 0.201835 | 0.238532 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023438 | 0.152318 | 151 | 8 | 38 | 18.875 | 0.828125 | 0 | 0 | 0 | 0 | 0 | 0.118421 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.333333 | null | null | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
a84c50e42ee754e6484106e03c70224669167fd0 | 202,484 | py | Python | tests/epyccel/recognised_functions/test_numpy_funcs.py | dina-fouad/pyccel | f4d919e673b400442b9c7b81212b6fbef749c7b7 | [
"MIT"
] | 206 | 2018-06-28T00:28:47.000Z | 2022-03-29T05:17:03.000Z | tests/epyccel/recognised_functions/test_numpy_funcs.py | dina-fouad/pyccel | f4d919e673b400442b9c7b81212b6fbef749c7b7 | [
"MIT"
] | 670 | 2018-07-23T11:02:24.000Z | 2022-03-30T07:28:05.000Z | tests/epyccel/recognised_functions/test_numpy_funcs.py | dina-fouad/pyccel | f4d919e673b400442b9c7b81212b6fbef749c7b7 | [
"MIT"
] | 19 | 2019-09-19T06:01:00.000Z | 2022-03-29T05:17:06.000Z | # pylint: disable=missing-function-docstring, missing-module-docstring
import sys
import pytest
from numpy.random import rand, randint, uniform
from numpy import isclose, iinfo, finfo
import numpy as np
from pyccel.decorators import types
from pyccel.epyccel import epyccel
min_int8 = iinfo('int8').min
max_int8 = iinfo('int8').max
min_int16 = iinfo('int16').min
max_int16 = iinfo('int16').max
min_int = iinfo('int').min
max_int = iinfo('int').max
min_int32 = iinfo('int32').min
max_int32 = iinfo('int32').max
min_int64 = iinfo('int64').min
max_int64 = iinfo('int64').max
min_float = finfo('float').min
max_float = finfo('float').max
min_float32 = finfo('float32').min
max_float32 = finfo('float32').max
min_float64 = finfo('float64').min
max_float64 = finfo('float64').max
# Functions still to be tested:
# array
# # ...
# diag
# cross
# # ---
# Relative and absolute tolerances for array comparisons in the form
# numpy.isclose(a, b, rtol, atol). Windows has larger round-off errors.
if sys.platform == 'win32':
RTOL = 1e-13
ATOL = 1e-14
else:
RTOL = 2e-14
ATOL = 1e-15
RTOL32 = 1e-5
ATOL32 = 1e-6
def matching_types(pyccel_result, python_result):
""" Returns True if the types match, False otherwise
"""
if type(pyccel_result) is type(python_result):
return True
if isinstance(pyccel_result, np.generic):
return isinstance(pyccel_result.item(), type(python_result))
else:
#TODO: Remove when #735 is fixed
return isinstance(python_result, np.generic) and isinstance(pyccel_result, (type(python_result.item()), type(python_result)))
#-------------------------------- Fabs function ------------------------------#
def test_fabs_call_r(language):
@types('real')
def fabs_call_r(x):
from numpy import fabs
return fabs(x)
f1 = epyccel(fabs_call_r, language = language)
x = uniform(high=1e6)
assert(isclose(f1(x), fabs_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), fabs_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), fabs_call_r(x))
def test_fabs_call_i(language):
@types('int')
def fabs_call_i(x):
from numpy import fabs
return fabs(x)
f1 = epyccel(fabs_call_i, language = language)
x = randint(1e6)
assert(isclose(f1(x), fabs_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), fabs_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), fabs_call_i(x))
def test_fabs_phrase_r_r(language):
@types('real','real')
def fabs_phrase_r_r(x,y):
from numpy import fabs
a = fabs(x)*fabs(y)
return a
f2 = epyccel(fabs_phrase_r_r, language = language)
x = uniform(high=1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), fabs_phrase_r_r(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), fabs_phrase_r_r(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), fabs_phrase_r_r(x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), fabs_phrase_r_r(-x,y), rtol=RTOL, atol=ATOL))
def test_fabs_phrase_i_i(language):
@types('int','int')
def fabs_phrase_i_i(x,y):
from numpy import fabs
a = fabs(x)*fabs(y)
return a
f2 = epyccel(fabs_phrase_i_i, language = language)
x = randint(1e6)
y = randint(1e6)
assert(isclose(f2(x,y), fabs_phrase_i_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), fabs_phrase_i_i(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), fabs_phrase_i_i(x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), fabs_phrase_i_i(-x,y), rtol=RTOL, atol=ATOL))
def test_fabs_phrase_r_i(language):
@types('real','int')
def fabs_phrase_r_i(x,y):
from numpy import fabs
a = fabs(x)*fabs(y)
return a
f2 = epyccel(fabs_phrase_r_i, language = language)
x = uniform(high=1e6)
y = randint(1e6)
assert(isclose(f2(x,y), fabs_phrase_r_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), fabs_phrase_r_i(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), fabs_phrase_r_i(x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), fabs_phrase_r_i(-x,y), rtol=RTOL, atol=ATOL))
def test_fabs_phrase_i_r(language):
@types('int','real')
def fabs_phrase_r_i(x,y):
from numpy import fabs
a = fabs(x)*fabs(y)
return a
f2 = epyccel(fabs_phrase_r_i, language = language)
x = randint(1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), fabs_phrase_r_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), fabs_phrase_r_i(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), fabs_phrase_r_i(x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), fabs_phrase_r_i(-x,y), rtol=RTOL, atol=ATOL))
#------------------------------ absolute function ----------------------------#
def test_absolute_call_r(language):
@types('real')
def absolute_call_r(x):
from numpy import absolute
return absolute(x)
f1 = epyccel(absolute_call_r, language = language)
x = uniform(high=1e6)
assert(isclose(f1(x), absolute_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), absolute_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), absolute_call_r(x))
def test_absolute_call_i(language):
@types('int')
def absolute_call_i(x):
from numpy import absolute
return absolute(x)
f1 = epyccel(absolute_call_i, language = language)
x = randint(1e6)
assert(isclose(f1(x), absolute_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), absolute_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), absolute_call_i(x))
def test_absolute_phrase_r_r(language):
@types('real','real')
def absolute_phrase_r_r(x,y):
from numpy import absolute
a = absolute(x)*absolute(y)
return a
f2 = epyccel(absolute_phrase_r_r, language = language)
x = uniform(high=1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), absolute_phrase_r_r(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), absolute_phrase_r_r(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), absolute_phrase_r_r(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), absolute_phrase_r_r(x,-y), rtol=RTOL, atol=ATOL))
def test_absolute_phrase_i_r(language):
@types('int','real')
def absolute_phrase_i_r(x,y):
from numpy import absolute
a = absolute(x)*absolute(y)
return a
f2 = epyccel(absolute_phrase_i_r, language = language)
x = randint(1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), absolute_phrase_i_r(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), absolute_phrase_i_r(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), absolute_phrase_i_r(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), absolute_phrase_i_r(x,-y), rtol=RTOL, atol=ATOL))
def test_absolute_phrase_r_i(language):
@types('real','int')
def absolute_phrase_r_i(x,y):
from numpy import absolute
a = absolute(x)*absolute(y)
return a
f2 = epyccel(absolute_phrase_r_i, language = language)
x = uniform(high=1e6)
y = randint(1e6)
assert(isclose(f2(x,y), absolute_phrase_r_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), absolute_phrase_r_i(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), absolute_phrase_r_i(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), absolute_phrase_r_i(x,-y), rtol=RTOL, atol=ATOL))
#--------------------------------- sin function ------------------------------#
def test_sin_call_r(language):
@types('real')
def sin_call_r(x):
from numpy import sin
return sin(x)
f1 = epyccel(sin_call_r, language = language)
x = uniform(high=1e6)
assert(isclose(f1(x), sin_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), sin_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), sin_call_r(x))
def test_sin_call_i(language):
@types('int')
def sin_call_i(x):
from numpy import sin
return sin(x)
f1 = epyccel(sin_call_i, language = language)
x = randint(1e6)
assert(isclose(f1(x), sin_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), sin_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), sin_call_i(x))
def test_sin_phrase_r_r(language):
@types('real','real')
def sin_phrase_r_r(x,y):
from numpy import sin
a = sin(x)+sin(y)
return a
f2 = epyccel(sin_phrase_r_r, language = language)
x = uniform(high=1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), sin_phrase_r_r(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), sin_phrase_r_r(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), sin_phrase_r_r(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), sin_phrase_r_r(x,-y), rtol=RTOL, atol=ATOL))
def test_sin_phrase_i_i(language):
@types('int','int')
def sin_phrase_i_i(x,y):
from numpy import sin
a = sin(x)+sin(y)
return a
f2 = epyccel(sin_phrase_i_i, language = language)
x = randint(1e6)
y = randint(1e6)
assert(isclose(f2(x,y), sin_phrase_i_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), sin_phrase_i_i(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), sin_phrase_i_i(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), sin_phrase_i_i(x,-y), rtol=RTOL, atol=ATOL))
def test_sin_phrase_i_r(language):
@types('int','real')
def sin_phrase_i_r(x,y):
from numpy import sin
a = sin(x)+sin(y)
return a
f2 = epyccel(sin_phrase_i_r, language = language)
x = randint(1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), sin_phrase_i_r(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), sin_phrase_i_r(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), sin_phrase_i_r(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), sin_phrase_i_r(x,-y), rtol=RTOL, atol=ATOL))
def test_sin_phrase_r_i(language):
@types('real','int')
def sin_phrase_r_i(x,y):
from numpy import sin
a = sin(x)+sin(y)
return a
f2 = epyccel(sin_phrase_r_i, language = language)
x = uniform(high=1e6)
y = randint(1e6)
assert(isclose(f2(x,y), sin_phrase_r_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), sin_phrase_r_i(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), sin_phrase_r_i(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), sin_phrase_r_i(x,-y), rtol=RTOL, atol=ATOL))
#--------------------------------- cos function ------------------------------#
def test_cos_call_i(language):
@types('int')
def cos_call_i(x):
from numpy import cos
return cos(x)
f1 = epyccel(cos_call_i, language = language)
x = randint(1e6)
assert(isclose(f1(x), cos_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), cos_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), cos_call_i(x))
def test_cos_call_r(language):
@types('real')
def cos_call_r(x):
from numpy import cos
return cos(x)
f1 = epyccel(cos_call_r, language = language)
x = uniform(high=1e6)
assert(isclose(f1(x), cos_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), cos_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), cos_call_r(x))
def test_cos_phrase_i_i(language):
@types('int','int')
def cos_phrase_i_i(x,y):
from numpy import cos
a = cos(x)+cos(y)
return a
f2 = epyccel(cos_phrase_i_i, language = language)
x = randint(1e6)
y = randint(1e6)
assert(isclose(f2(x,y), cos_phrase_i_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), cos_phrase_i_i(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), cos_phrase_i_i(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), cos_phrase_i_i(x,-y), rtol=RTOL, atol=ATOL))
def test_cos_phrase_r_r(language):
@types('real','real')
def cos_phrase_r_r(x,y):
from numpy import cos
a = cos(x)+cos(y)
return a
f2 = epyccel(cos_phrase_r_r, language = language)
x = uniform(high=1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), cos_phrase_r_r(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), cos_phrase_r_r(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), cos_phrase_r_r(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), cos_phrase_r_r(x,-y), rtol=RTOL, atol=ATOL))
def test_cos_phrase_i_r(language):
@types('int','real')
def cos_phrase_i_r(x,y):
from numpy import cos
a = cos(x)+cos(y)
return a
f2 = epyccel(cos_phrase_i_r, language = language)
x = randint(1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), cos_phrase_i_r(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), cos_phrase_i_r(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), cos_phrase_i_r(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), cos_phrase_i_r(x,-y), rtol=RTOL, atol=ATOL))
def test_cos_phrase_r_i(language):
@types('real','int')
def cos_phrase_r_i(x,y):
from numpy import cos
a = cos(x)+cos(y)
return a
f2 = epyccel(cos_phrase_r_i, language = language)
x = uniform(high=1e6)
y = randint(1e6)
assert(isclose(f2(x,y), cos_phrase_r_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), cos_phrase_r_i(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), cos_phrase_r_i(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), cos_phrase_r_i(x,-y), rtol=RTOL, atol=ATOL))
#--------------------------------- tan function ------------------------------#
def test_tan_call_i(language):
@types('int')
def tan_call_i(x):
from numpy import tan
return tan(x)
f1 = epyccel(tan_call_i, language = language)
x = randint(1e6)
assert(isclose(f1(x), tan_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), tan_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), tan_call_i(x))
def test_tan_call_r(language):
@types('real')
def tan_call_r(x):
from numpy import tan
return tan(x)
f1 = epyccel(tan_call_r, language = language)
x = uniform(high=1e6)
assert(isclose(f1(x), tan_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), tan_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), tan_call_r(x))
def test_tan_phrase_i_i(language):
@types('int','int')
def tan_phrase_i_i(x,y):
from numpy import tan
a = tan(x)+tan(y)
return a
f2 = epyccel(tan_phrase_i_i, language = language)
x = randint(1e6)
y = randint(1e6)
assert(isclose(f2(x,y), tan_phrase_i_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), tan_phrase_i_i(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), tan_phrase_i_i(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), tan_phrase_i_i(x,-y), rtol=RTOL, atol=ATOL))
def test_tan_phrase_r_r(language):
@types('real','real')
def tan_phrase_r_r(x,y):
from numpy import tan
a = tan(x)+tan(y)
return a
f2 = epyccel(tan_phrase_r_r, language = language)
x = uniform(high=1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), tan_phrase_r_r(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), tan_phrase_r_r(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), tan_phrase_r_r(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), tan_phrase_r_r(x,-y), rtol=RTOL, atol=ATOL))
def test_tan_phrase_i_r(language):
@types('int','real')
def tan_phrase_i_r(x,y):
from numpy import tan
a = tan(x)+tan(y)
return a
f2 = epyccel(tan_phrase_i_r, language = language)
x = randint(1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), tan_phrase_i_r(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), tan_phrase_i_r(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), tan_phrase_i_r(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), tan_phrase_i_r(x,-y), rtol=RTOL, atol=ATOL))
def test_tan_phrase_r_i(language):
@types('real','int')
def tan_phrase_r_i(x,y):
from numpy import tan
a = tan(x)+tan(y)
return a
f2 = epyccel(tan_phrase_r_i, language = language)
x = uniform(high=1e6)
y = randint(1e6)
assert(isclose(f2(x,y), tan_phrase_r_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), tan_phrase_r_i(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), tan_phrase_r_i(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), tan_phrase_r_i(x,-y), rtol=RTOL, atol=ATOL))
#--------------------------------- exp function ------------------------------#
def test_exp_call_i(language):
@types('int')
def exp_call_i(x):
from numpy import exp
return exp(x)
f1 = epyccel(exp_call_i, language = language)
x = randint(1e2)
assert(isclose(f1(x), exp_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), exp_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), exp_call_i(x))
def test_exp_call_r(language):
@types('real')
def exp_call_r(x):
from numpy import exp
return exp(x)
f1 = epyccel(exp_call_r, language = language)
x = uniform(high=1e2)
assert(isclose(f1(x), exp_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), exp_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), exp_call_r(x))
def test_exp_phrase_i_i(language):
@types('int','int')
def exp_phrase_i_i(x,y):
from numpy import exp
a = exp(x)+exp(y)
return a
f2 = epyccel(exp_phrase_i_i, language = language)
x = randint(1e2)
y = randint(1e2)
assert(isclose(f2(x,y), exp_phrase_i_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), exp_phrase_i_i(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), exp_phrase_i_i(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), exp_phrase_i_i(x,-y), rtol=RTOL, atol=ATOL))
def test_exp_phrase_r_r(language):
@types('real','real')
def exp_phrase_r_r(x,y):
from numpy import exp
a = exp(x)+exp(y)
return a
f2 = epyccel(exp_phrase_r_r, language = language)
x = uniform(high=1e2)
y = uniform(high=1e2)
assert(isclose(f2(x,y), exp_phrase_r_r(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), exp_phrase_r_r(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), exp_phrase_r_r(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), exp_phrase_r_r(x,-y), rtol=RTOL, atol=ATOL))
def test_exp_phrase_i_r(language):
@types('int','real')
def exp_phrase_i_r(x,y):
from numpy import exp
a = exp(x)+exp(y)
return a
f2 = epyccel(exp_phrase_i_r, language = language)
x = randint(1e2)
y = uniform(high=1e2)
assert(isclose(f2(x,y), exp_phrase_i_r(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), exp_phrase_i_r(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), exp_phrase_i_r(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), exp_phrase_i_r(x,-y), rtol=RTOL, atol=ATOL))
def test_exp_phrase_r_i(language):
@types('real','int')
def exp_phrase_r_i(x,y):
from numpy import exp
a = exp(x)+exp(y)
return a
f2 = epyccel(exp_phrase_r_i, language = language)
x = uniform(high=1e2)
y = randint(1e2)
assert(isclose(f2(x,y), exp_phrase_r_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,y), exp_phrase_r_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,y), exp_phrase_r_i(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), exp_phrase_r_i(x,-y), rtol=RTOL, atol=ATOL))
#--------------------------------- log function ------------------------------#
def test_log_call_i(language):
@types('int')
def log_call_i(x):
from numpy import log
return log(x)
f1 = epyccel(log_call_i, language = language)
x = randint(low=sys.float_info.min, high=1e6)
assert(isclose(f1(x), log_call_i(x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), log_call_i(x))
def test_log_call_r(language):
@types('real')
def log_call_r(x):
from numpy import log
return log(x)
f1 = epyccel(log_call_r, language = language)
x = uniform(low=sys.float_info.min, high=max_float)
assert(isclose(f1(x), log_call_r(x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), log_call_r(x))
def test_log_phrase(language):
@types('real','real')
def log_phrase(x,y):
from numpy import log
a = log(x)+log(y)
return a
f2 = epyccel(log_phrase, language = language)
x = uniform(low=sys.float_info.min, high=1e6)
y = uniform(low=sys.float_info.min, high=1e6)
assert(isclose(f2(x,y), log_phrase(x,y), rtol=RTOL, atol=ATOL))
#----------------------------- arcsin function -------------------------------#
def test_arcsin_call_i(language):
@types('int')
def arcsin_call_i(x):
from numpy import arcsin
return arcsin(x)
f1 = epyccel(arcsin_call_i, language = language)
x = randint(2)
assert(isclose(f1(x), arcsin_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), arcsin_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), arcsin_call_i(x))
def test_arcsin_call_r(language):
@types('real')
def arcsin_call_r(x):
from numpy import arcsin
return arcsin(x)
f1 = epyccel(arcsin_call_r, language = language)
x = rand()
assert(isclose(f1(x), arcsin_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), arcsin_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), arcsin_call_r(x))
def test_arcsin_phrase(language):
@types('real','real')
def arcsin_phrase(x,y):
from numpy import arcsin
a = arcsin(x)+arcsin(y)
return a
f2 = epyccel(arcsin_phrase, language = language)
x = rand()
y = rand()
assert(isclose(f2(x,y), arcsin_phrase(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), arcsin_phrase(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), arcsin_phrase(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), arcsin_phrase(x,-y), rtol=RTOL, atol=ATOL))
#----------------------------- arccos function -------------------------------#
def test_arccos_call_i(language):
@types('int')
def arccos_call_i(x):
from numpy import arccos
return arccos(x)
f1 = epyccel(arccos_call_i, language = language)
x = randint(2)
assert(isclose(f1(x), arccos_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), arccos_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), arccos_call_i(x))
def test_arccos_call_r(language):
@types('real')
def arccos_call_r(x):
from numpy import arccos
return arccos(x)
f1 = epyccel(arccos_call_r, language = language)
x = rand()
assert(isclose(f1(x), arccos_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), arccos_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), arccos_call_r(x))
def test_arccos_phrase(language):
@types('real','real')
def arccos_phrase(x,y):
from numpy import arccos
a = arccos(x)+arccos(y)
return a
f2 = epyccel(arccos_phrase, language = language)
x = rand()
y = rand()
assert(isclose(f2(x,y), arccos_phrase(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), arccos_phrase(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), arccos_phrase(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), arccos_phrase(x,-y), rtol=RTOL, atol=ATOL))
#----------------------------- arctan function -------------------------------#
def test_arctan_call_i(language):
@types('int')
def arctan_call_i(x):
from numpy import arctan
return arctan(x)
f1 = epyccel(arctan_call_i, language = language)
x = randint(1e6)
assert(isclose(f1(x), arctan_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), arctan_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), arctan_call_i(x))
def test_arctan_call_r(language):
@types('real')
def arctan_call_r(x):
from numpy import arctan
return arctan(x)
f1 = epyccel(arctan_call_r, language = language)
x = uniform(high=1e6)
assert(isclose(f1(x), arctan_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), arctan_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), arctan_call_r(x))
def test_arctan_phrase(language):
@types('real','real')
def arctan_phrase(x,y):
from numpy import arctan
a = arctan(x)+arctan(y)
return a
f2 = epyccel(arctan_phrase, language = language)
x = uniform(high=1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), arctan_phrase(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), arctan_phrase(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), arctan_phrase(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), arctan_phrase(x,-y), rtol=RTOL, atol=ATOL))
#------------------------------- sinh function -------------------------------#
def test_sinh_call_i(language):
@types('int')
def sinh_call_i(x):
from numpy import sinh
return sinh(x)
f1 = epyccel(sinh_call_i, language = language)
x = randint(100)
assert(isclose(f1(x), sinh_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), sinh_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), sinh_call_i(x))
def test_sinh_call_r(language):
@types('real')
def sinh_call_r(x):
from numpy import sinh
return sinh(x)
f1 = epyccel(sinh_call_r, language = language)
x = uniform(high=1e2)
assert(isclose(f1(x), sinh_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), sinh_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), sinh_call_r(x))
def test_sinh_phrase(language):
@types('real','real')
def sinh_phrase(x,y):
from numpy import sinh
a = sinh(x)+sinh(y)
return a
f2 = epyccel(sinh_phrase, language = language)
x = uniform(high=1e2)
y = uniform(high=1e2)
assert(isclose(f2(x,y), sinh_phrase(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), sinh_phrase(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), sinh_phrase(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), sinh_phrase(x,-y), rtol=RTOL, atol=ATOL))
#------------------------------- sinh function -------------------------------#
def test_cosh_call_i(language):
@types('int')
def cosh_call_i(x):
from numpy import cosh
return cosh(x)
f1 = epyccel(cosh_call_i, language = language)
x = randint(100)
assert(isclose(f1(x), cosh_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), cosh_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), cosh_call_i(x))
def test_cosh_call_r(language):
@types('real')
def cosh_call_r(x):
from numpy import cosh
return cosh(x)
f1 = epyccel(cosh_call_r, language = language)
x = uniform(high=1e2)
assert(isclose(f1(x), cosh_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), cosh_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), cosh_call_r(x))
def test_cosh_phrase(language):
@types('real','real')
def cosh_phrase(x,y):
from numpy import cosh
a = cosh(x)+cosh(y)
return a
f2 = epyccel(cosh_phrase, language = language)
x = uniform(high=1e2)
y = uniform(high=1e2)
assert(isclose(f2(x,y), cosh_phrase(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), cosh_phrase(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), cosh_phrase(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), cosh_phrase(x,-y), rtol=RTOL, atol=ATOL))
#------------------------------- sinh function -------------------------------#
def test_tanh_call_i(language):
@types('int')
def tanh_call_i(x):
from numpy import tanh
return tanh(x)
f1 = epyccel(tanh_call_i, language = language)
x = randint(100)
assert(isclose(f1(x), tanh_call_i(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), tanh_call_i(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), tanh_call_i(x))
def test_tanh_call_r(language):
@types('real')
def tanh_call_r(x):
from numpy import tanh
return tanh(x)
f1 = epyccel(tanh_call_r, language = language)
x = uniform(high=1e2)
assert(isclose(f1(x), tanh_call_r(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), tanh_call_r(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), tanh_call_r(x))
def test_tanh_phrase(language):
@types('real','real')
def tanh_phrase(x,y):
from numpy import tanh
a = tanh(x)+tanh(y)
return a
f2 = epyccel(tanh_phrase, language = language)
x = uniform(high=1e2)
y = uniform(high=1e2)
assert(isclose(f2(x,y), tanh_phrase(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), tanh_phrase(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), tanh_phrase(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), tanh_phrase(x,-y), rtol=RTOL, atol=ATOL))
#------------------------------ arctan2 function -----------------------------#
def test_arctan2_call_i_i(language):
@types('int','int')
def arctan2_call(x,y):
from numpy import arctan2
return arctan2(x,y)
f1 = epyccel(arctan2_call, language = language)
x = randint(100)
y = randint(100)
assert(isclose(f1(x,y), arctan2_call(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x,-y), arctan2_call(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x,y), arctan2_call(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(x,-y), arctan2_call(x,-y), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x, y), arctan2_call(x, y))
def test_arctan2_call_i_r(language):
@types('int','real')
def arctan2_call(x,y):
from numpy import arctan2
return arctan2(x,y)
f1 = epyccel(arctan2_call, language = language)
x = randint(100)
y = uniform(high=1e2)
assert(isclose(f1(x,y), arctan2_call(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x,-y), arctan2_call(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x,y), arctan2_call(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(x,-y), arctan2_call(x,-y), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x, y), arctan2_call(x, y))
def test_arctan2_call_r_i(language):
@types('real','int')
def arctan2_call(x,y):
from numpy import arctan2
return arctan2(x,y)
f1 = epyccel(arctan2_call, language = language)
x = uniform(high=1e2)
y = randint(100)
assert(isclose(f1(x,y), arctan2_call(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x,-y), arctan2_call(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x,y), arctan2_call(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(x,-y), arctan2_call(x,-y), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x, y), arctan2_call(x, y))
def test_arctan2_call_r_r(language):
@types('real','real')
def arctan2_call(x,y):
from numpy import arctan2
return arctan2(x,y)
f1 = epyccel(arctan2_call, language = language)
x = uniform(high=1e2)
y = uniform(high=1e2)
assert(isclose(f1(x,y), arctan2_call(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x,-y), arctan2_call(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x,y), arctan2_call(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f1(x,-y), arctan2_call(x,-y), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x, y), arctan2_call(x, y))
def test_arctan2_phrase(language):
@types('real','real','real')
def arctan2_phrase(x,y,z):
from numpy import arctan2
a = arctan2(x,y)+arctan2(x,z)
return a
f2 = epyccel(arctan2_phrase, language = language)
x = uniform(high=1e2)
y = uniform(high=1e2)
z = uniform(high=1e2)
assert(isclose(f2(x,y,z), arctan2_phrase(x,y,z), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y,z), arctan2_phrase(-x,y,z), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y,z), arctan2_phrase(-x,-y,z), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y,-z), arctan2_phrase(-x,y,-z), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y,z), arctan2_phrase(x,-y,z), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y,-z), arctan2_phrase(x,-y,-z), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,y,-z), arctan2_phrase(x,y,-z), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y,-z), arctan2_phrase(-x,-y,-z), rtol=RTOL, atol=ATOL))
#-------------------------------- sqrt function ------------------------------#
def test_sqrt_call(language):
@types('real')
def sqrt_call(x):
from numpy import sqrt
return sqrt(x)
f1 = epyccel(sqrt_call, language = language)
x = rand()
assert(isclose(f1(x), sqrt_call(x), rtol=RTOL, atol=ATOL))
def test_sqrt_phrase(language):
@types('real','real')
def sqrt_phrase(x,y):
from numpy import sqrt
a = sqrt(x)*sqrt(y)
return a
f2 = epyccel(sqrt_phrase, language = language)
x = rand()
y = rand()
assert(isclose(f2(x,y), sqrt_phrase(x,y), rtol=RTOL, atol=ATOL))
def test_sqrt_return_type_r(language):
@types('real')
def sqrt_return_type_real(x):
from numpy import sqrt
a = sqrt(x)
return a
f1 = epyccel(sqrt_return_type_real, language = language)
x = rand()
assert(isclose(f1(x), sqrt_return_type_real(x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), sqrt_return_type_real(x))
def test_sqrt_return_type_c(language):
@types('complex')
def sqrt_return_type_comp(x):
from numpy import sqrt
a = sqrt(x)
return a
f1 = epyccel(sqrt_return_type_comp, language = language)
x = rand() + 1j * rand()
assert(isclose(f1(x), sqrt_return_type_comp(x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), sqrt_return_type_comp(x))
#-------------------------------- floor function -----------------------------#
def test_floor_call_i(language):
@types('int')
def floor_call(x):
from numpy import floor
return floor(x)
f1 = epyccel(floor_call, language = language)
x = randint(1e6)
assert(isclose(f1(x), floor_call(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), floor_call(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), floor_call(x))
def test_floor_call_r(language):
@types('real')
def floor_call(x):
from numpy import floor
return floor(x)
f1 = epyccel(floor_call, language = language)
x = uniform(high=1e6)
assert(isclose(f1(x), floor_call(x), rtol=RTOL, atol=ATOL))
assert(isclose(f1(-x), floor_call(-x), rtol=RTOL, atol=ATOL))
assert matching_types(f1(x), floor_call(x))
def test_floor_phrase(language):
@types('real','real')
def floor_phrase(x,y):
from numpy import floor
a = floor(x)*floor(y)
return a
f2 = epyccel(floor_phrase, language = language)
x = uniform(high=1e6)
y = uniform(high=1e6)
assert(isclose(f2(x,y), floor_phrase(x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,-y), floor_phrase(-x,-y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(-x,y), floor_phrase(-x,y), rtol=RTOL, atol=ATOL))
assert(isclose(f2(x,-y), floor_phrase(x,-y), rtol=RTOL, atol=ATOL))
def test_shape_indexed(language):
@types('int[:]')
def test_shape_1d(f):
from numpy import shape
return shape(f)[0]
@types('int[:,:]')
def test_shape_2d(f):
from numpy import shape
a = shape(f)
return a[0], a[1]
from numpy import empty
f1 = epyccel(test_shape_1d, language = language)
f2 = epyccel(test_shape_2d, language = language)
n1 = randint(20)
n2 = randint(20)
n3 = randint(20)
x1 = empty(n1,dtype = int)
x2 = empty((n2,n3), dtype = int)
assert(f1(x1) == test_shape_1d(x1))
assert(f2(x2) == test_shape_2d(x2))
def test_shape_property(language):
@types('int[:]')
def test_shape_1d(f):
return f.shape[0]
@types('int[:,:]')
def test_shape_2d(f):
a = f.shape
return a[0], a[1]
from numpy import empty
f1 = epyccel(test_shape_1d, language = language)
f2 = epyccel(test_shape_2d, language = language)
n1 = randint(20)
n2 = randint(20)
n3 = randint(20)
x1 = empty(n1,dtype = int)
x2 = empty((n2,n3), dtype = int)
assert(f1(x1) == test_shape_1d(x1))
assert(all(isclose(f2(x2), test_shape_2d(x2))))
def test_shape_tuple_output(language):
@types('int[:]')
def test_shape_1d(f):
from numpy import shape
s = shape(f)
return s[0]
@types('int[:]')
def test_shape_1d_tuple(f):
from numpy import shape
s, = shape(f)
return s
@types('int[:,:]')
def test_shape_2d(f):
from numpy import shape
a, b = shape(f)
return a, b
from numpy import empty
n1 = randint(20)
n2 = randint(20)
n3 = randint(20)
x1 = empty(n1,dtype = int)
x2 = empty((n2,n3), dtype = int)
f1 = epyccel(test_shape_1d, language = language)
assert(f1(x1) == test_shape_1d(x1))
f1_t = epyccel(test_shape_1d_tuple, language = language)
assert(f1_t(x1) == test_shape_1d_tuple(x1))
f2 = epyccel(test_shape_2d, language = language)
assert(f2(x2) == test_shape_2d(x2))
def test_shape_real(language):
@types('real[:]')
def test_shape_1d(f):
from numpy import shape
b = shape(f)
return b[0]
@types('real[:,:]')
def test_shape_2d(f):
from numpy import shape
a = shape(f)
return a[0], a[1]
from numpy import empty
f1 = epyccel(test_shape_1d, language = language)
f2 = epyccel(test_shape_2d, language = language)
n1 = randint(20)
n2 = randint(20)
n3 = randint(20)
x1 = empty(n1,dtype = float)
x2 = empty((n2,n3), dtype = float)
assert(f1(x1) == test_shape_1d(x1))
assert(f2(x2) == test_shape_2d(x2))
def test_shape_int(language):
@types('int[:]')
def test_shape_1d(f):
from numpy import shape
b = shape(f)
return b[0]
@types('int[:,:]')
def test_shape_2d(f):
from numpy import shape
a = shape(f)
return a[0], a[1]
f1 = epyccel(test_shape_1d, language = language)
f2 = epyccel(test_shape_2d, language = language)
from numpy import empty
n1 = randint(20)
n2 = randint(20)
n3 = randint(20)
x1 = empty(n1,dtype = int)
x2 = empty((n2,n3), dtype = int)
assert(f1(x1) == test_shape_1d(x1))
assert(f2(x2) == test_shape_2d(x2))
def test_shape_bool(language):
@types('bool[:]')
def test_shape_1d(f):
from numpy import shape
b = shape(f)
return b[0]
@types('bool[:,:]')
def test_shape_2d(f):
from numpy import shape
a = shape(f)
return a[0], a[1]
from numpy import empty
f1 = epyccel(test_shape_1d, language = language)
f2 = epyccel(test_shape_2d, language = language)
n1 = randint(20)
n2 = randint(20)
n3 = randint(20)
x1 = empty(n1,dtype = bool)
x2 = empty((n2,n3), dtype = bool)
assert(f1(x1) == test_shape_1d(x1))
assert(f2(x2) == test_shape_2d(x2))
def test_full_basic_int(language):
@types('int')
def create_full_shape_1d(n):
from numpy import full, shape
a = full(n,4)
s = shape(a)
return len(s),s[0]
@types('int')
def create_full_shape_2d(n):
from numpy import full, shape
a = full((n,n),4)
s = shape(a)
return len(s),s[0], s[1]
@types('int')
def create_full_val(val):
from numpy import full
a = full(3,val)
return a[0],a[1],a[2]
@types('int')
def create_full_arg_names(val):
from numpy import full
a = full(fill_value = val, shape = (2,3))
return a[0,0],a[0,1],a[0,2],a[1,0],a[1,1],a[1,2]
size = randint(10)
f_shape_1d = epyccel(create_full_shape_1d, language = language)
assert(f_shape_1d(size) == create_full_shape_1d(size))
f_shape_2d = epyccel(create_full_shape_2d, language = language)
assert(f_shape_2d(size) == create_full_shape_2d(size))
f_val = epyccel(create_full_val, language = language)
assert(f_val(size) == create_full_val(size))
assert matching_types(f_val(size)[0], create_full_val(size)[0])
f_arg_names = epyccel(create_full_arg_names, language = language)
assert(f_arg_names(size) == create_full_arg_names(size))
assert matching_types(f_arg_names(size)[0], create_full_arg_names(size)[0])
def test_full_basic_real(language):
@types('int')
def create_full_shape_1d(n):
from numpy import full, shape
a = full(n,4)
s = shape(a)
return len(s),s[0]
@types('int')
def create_full_shape_2d(n):
from numpy import full, shape
a = full((n,n),4)
s = shape(a)
return len(s),s[0], s[1]
@types('real')
def create_full_val(val):
from numpy import full
a = full(3,val)
return a[0],a[1],a[2]
@types('real')
def create_full_arg_names(val):
from numpy import full
a = full(fill_value = val, shape = (2,3))
return a[0,0],a[0,1],a[0,2],a[1,0],a[1,1],a[1,2]
size = randint(10)
val = rand()*5
f_shape_1d = epyccel(create_full_shape_1d, language = language)
assert(f_shape_1d(size) == create_full_shape_1d(size))
f_shape_2d = epyccel(create_full_shape_2d, language = language)
assert(f_shape_2d(size) == create_full_shape_2d(size))
f_val = epyccel(create_full_val, language = language)
assert(f_val(val) == create_full_val(val))
assert matching_types(f_val(val)[0], create_full_val(val)[0])
f_arg_names = epyccel(create_full_arg_names, language = language)
assert(f_arg_names(val) == create_full_arg_names(val))
assert matching_types(f_arg_names(val)[0], create_full_arg_names(val)[0])
def test_full_basic_bool(language):
@types('int')
def create_full_shape_1d(n):
from numpy import full, shape
a = full(n,4)
s = shape(a)
return len(s),s[0]
@types('int')
def create_full_shape_2d(n):
from numpy import full, shape
a = full((n,n),4)
s = shape(a)
return len(s),s[0], s[1]
@types('bool')
def create_full_val(val):
from numpy import full
a = full(3,val)
return a[0],a[1],a[2]
@types('bool')
def create_full_arg_names(val):
from numpy import full
a = full(fill_value = val, shape = (2,3))
return a[0,0],a[0,1],a[0,2],a[1,0],a[1,1],a[1,2]
size = randint(10)
val = bool(randint(2))
f_shape_1d = epyccel(create_full_shape_1d, language = language)
assert(f_shape_1d(size) == create_full_shape_1d(size))
f_shape_2d = epyccel(create_full_shape_2d, language = language)
assert(f_shape_2d(size) == create_full_shape_2d(size))
f_val = epyccel(create_full_val, language = language)
assert(f_val(val) == create_full_val(val))
assert matching_types(f_val(val)[0], create_full_val(val)[0])
f_arg_names = epyccel(create_full_arg_names, language = language)
assert(f_arg_names(val) == create_full_arg_names(val))
assert matching_types(f_arg_names(val)[0], create_full_arg_names(val)[0])
def test_full_order(language):
@types('int','int')
def create_full_shape_C(n,m):
from numpy import full, shape
a = full((n,m),4, order = 'C')
s = shape(a)
return len(s),s[0], s[1]
@types('int','int')
def create_full_shape_F(n,m):
from numpy import full, shape
a = full((n,m),4, order = 'F')
s = shape(a)
return len(s),s[0], s[1]
size_1 = randint(10)
size_2 = randint(10)
f_shape_C = epyccel(create_full_shape_C, language = language)
assert(f_shape_C(size_1,size_2) == create_full_shape_C(size_1,size_2))
f_shape_F = epyccel(create_full_shape_F, language = language)
assert(f_shape_F(size_1,size_2) == create_full_shape_F(size_1,size_2))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_full_dtype(language):
@types('int')
def create_full_val_int_int(val):
from numpy import full
a = full(3,val,int)
return a[0]
@types('int')
def create_full_val_int_float(val):
from numpy import full
a = full(3,val,float)
return a[0]
@types('int')
def create_full_val_int_complex(val):
from numpy import full
a = full(3,val,complex)
return a[0]
@types('real')
def create_full_val_real_int32(val):
from numpy import full, int32
a = full(3,val,int32)
return a[0]
@types('real')
def create_full_val_real_float32(val):
from numpy import full, float32
a = full(3,val,float32)
return a[0]
@types('real')
def create_full_val_real_float64(val):
from numpy import full, float64
a = full(3,val,float64)
return a[0]
@types('real')
def create_full_val_real_complex64(val):
from numpy import full, complex64
a = full(3,val,complex64)
return a[0]
@types('real')
def create_full_val_real_complex128(val):
from numpy import full, complex128
a = full(3,val,complex128)
return a[0]
val_int = randint(100)
val_float = rand()*100
f_int_int = epyccel(create_full_val_int_int, language = language)
assert( f_int_int(val_int) == create_full_val_int_int(val_int))
assert matching_types(f_int_int(val_int), create_full_val_int_int(val_int))
f_int_float = epyccel(create_full_val_int_float, language = language)
assert(isclose( f_int_float(val_int) , create_full_val_int_float(val_int), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_float(val_int), create_full_val_int_float(val_int))
f_int_complex = epyccel(create_full_val_int_complex, language = language)
assert(isclose( f_int_complex(val_int) , create_full_val_int_complex(val_int), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_complex(val_int), create_full_val_int_complex(val_int))
f_real_int32 = epyccel(create_full_val_real_int32, language = language)
assert( f_real_int32(val_float) == create_full_val_real_int32(val_float))
assert matching_types(f_real_int32(val_float), create_full_val_real_int32(val_float))
f_real_float32 = epyccel(create_full_val_real_float32, language = language)
assert(isclose( f_real_float32(val_float) , create_full_val_real_float32(val_float), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float32(val_float), create_full_val_real_float32(val_float))
f_real_float64 = epyccel(create_full_val_real_float64, language = language)
assert(isclose( f_real_float64(val_float) , create_full_val_real_float64(val_float), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float64(val_float), create_full_val_real_float64(val_float))
f_real_complex64 = epyccel(create_full_val_real_complex64, language = language)
assert(isclose( f_real_complex64(val_float) , create_full_val_real_complex64(val_float), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex64(val_float), create_full_val_real_complex64(val_float))
f_real_complex128 = epyccel(create_full_val_real_complex128, language = language)
assert(isclose( f_real_complex128(val_float) , create_full_val_real_complex128(val_float), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex128(val_float), create_full_val_real_complex128(val_float))
def test_full_combined_args(language):
def create_full_1_shape():
from numpy import full, shape
a = full((2,1),4.0,int,'F')
s = shape(a)
return len(s),s[0],s[1]
def create_full_1_val():
from numpy import full
a = full((2,1),4.0,int,'F')
return a[0,0]
def create_full_2_shape():
from numpy import full, shape
a = full((4,2),dtype=float,fill_value=1)
s = shape(a)
return len(s),s[0],s[1]
def create_full_2_val():
from numpy import full
a = full((4,2),dtype=float,fill_value=1)
return a[0,0]
def create_full_3_shape():
from numpy import full, shape
a = full(order = 'F', shape = (4,2),dtype=complex,fill_value=1)
s = shape(a)
return len(s),s[0],s[1]
def create_full_3_val():
from numpy import full
a = full(order = 'F', shape = (4,2),dtype=complex,fill_value=1)
return a[0,0]
f1_shape = epyccel(create_full_1_shape, language = language)
f1_val = epyccel(create_full_1_val, language = language)
assert(f1_shape() == create_full_1_shape())
assert(f1_val() == create_full_1_val() )
assert matching_types(f1_val(), create_full_1_val())
f2_shape = epyccel(create_full_2_shape, language = language)
f2_val = epyccel(create_full_2_val, language = language)
assert(f2_shape() == create_full_2_shape() )
assert(isclose(f2_val() , create_full_2_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f2_val(), create_full_2_val())
f3_shape = epyccel(create_full_3_shape, language = language)
f3_val = epyccel(create_full_3_val, language = language)
assert( f3_shape() == create_full_3_shape() )
assert(isclose( f3_val() , create_full_3_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f3_val(), create_full_3_val())
def test_empty_basic(language):
@types('int')
def create_empty_shape_1d(n):
from numpy import empty, shape
a = empty(n)
s = shape(a)
return len(s),s[0]
@types('int')
def create_empty_shape_2d(n):
from numpy import empty, shape
a = empty((n,n))
s = shape(a)
return len(s),s[0], s[1]
size = randint(10)
f_shape_1d = epyccel(create_empty_shape_1d, language = language)
assert( f_shape_1d(size) == create_empty_shape_1d(size))
f_shape_2d = epyccel(create_empty_shape_2d, language = language)
assert( f_shape_2d(size) == create_empty_shape_2d(size))
def test_empty_order(language):
@types('int','int')
def create_empty_shape_C(n,m):
from numpy import empty, shape
a = empty((n,m), order = 'C')
s = shape(a)
return len(s),s[0], s[1]
@types('int','int')
def create_empty_shape_F(n,m):
from numpy import empty, shape
a = empty((n,m), order = 'F')
s = shape(a)
return len(s),s[0], s[1]
size_1 = randint(10)
size_2 = randint(10)
f_shape_C = epyccel(create_empty_shape_C, language = language)
assert( f_shape_C(size_1,size_2) == create_empty_shape_C(size_1,size_2))
f_shape_F = epyccel(create_empty_shape_F, language = language)
assert( f_shape_F(size_1,size_2) == create_empty_shape_F(size_1,size_2))
def test_empty_dtype(language):
def create_empty_val_int():
from numpy import empty
a = empty(3,int)
return a[0]
def create_empty_val_float():
from numpy import empty
a = empty(3,float)
return a[0]
def create_empty_val_complex():
from numpy import empty
a = empty(3,complex)
return a[0]
def create_empty_val_int32():
from numpy import empty, int32
a = empty(3,int32)
return a[0]
def create_empty_val_float32():
from numpy import empty, float32
a = empty(3,float32)
return a[0]
def create_empty_val_float64():
from numpy import empty, float64
a = empty(3,float64)
return a[0]
def create_empty_val_complex64():
from numpy import empty, complex64
a = empty(3,complex64)
return a[0]
def create_empty_val_complex128():
from numpy import empty, complex128
a = empty(3,complex128)
return a[0]
f_int_int = epyccel(create_empty_val_int, language = language)
assert matching_types(f_int_int(), create_empty_val_int())
f_int_float = epyccel(create_empty_val_float, language = language)
assert matching_types(f_int_float(), create_empty_val_float())
f_int_complex = epyccel(create_empty_val_complex, language = language)
assert matching_types(f_int_complex(), create_empty_val_complex())
f_real_int32 = epyccel(create_empty_val_int32, language = language)
assert matching_types(f_real_int32(), create_empty_val_int32())
f_real_float32 = epyccel(create_empty_val_float32, language = language)
assert matching_types(f_real_float32(), create_empty_val_float32())
f_real_float64 = epyccel(create_empty_val_float64, language = language)
assert matching_types(f_real_float64(), create_empty_val_float64())
f_real_complex64 = epyccel(create_empty_val_complex64, language = language)
assert matching_types(f_real_complex64(), create_empty_val_complex64())
f_real_complex128 = epyccel(create_empty_val_complex128, language = language)
assert matching_types(f_real_complex128(), create_empty_val_complex128())
def test_empty_combined_args(language):
def create_empty_1_shape():
from numpy import empty, shape
a = empty((2,1),int,'F')
s = shape(a)
return len(s),s[0],s[1]
def create_empty_1_val():
from numpy import empty
a = empty((2,1),int,'F')
return a[0,0]
def create_empty_2_shape():
from numpy import empty, shape
a = empty((4,2),dtype=float)
s = shape(a)
return len(s),s[0],s[1]
def create_empty_2_val():
from numpy import empty
a = empty((4,2),dtype=float)
return a[0,0]
def create_empty_3_shape():
from numpy import empty, shape
a = empty(order = 'F', shape = (4,2),dtype=complex)
s = shape(a)
return len(s),s[0],s[1]
def create_empty_3_val():
from numpy import empty
a = empty(order = 'F', shape = (4,2),dtype=complex)
return a[0,0]
f1_shape = epyccel(create_empty_1_shape, language = language)
f1_val = epyccel(create_empty_1_val, language = language)
assert( f1_shape() == create_empty_1_shape() )
assert matching_types(f1_val(), create_empty_1_val())
f2_shape = epyccel(create_empty_2_shape, language = language)
f2_val = epyccel(create_empty_2_val, language = language)
assert(all(isclose( f2_shape(), create_empty_2_shape() )))
assert matching_types(f2_val(), create_empty_2_val())
f3_shape = epyccel(create_empty_3_shape, language = language)
f3_val = epyccel(create_empty_3_val, language = language)
assert(all(isclose( f3_shape(), create_empty_3_shape() )))
assert matching_types(f3_val(), create_empty_3_val())
def test_ones_basic(language):
@types('int')
def create_ones_shape_1d(n):
from numpy import ones, shape
a = ones(n)
s = shape(a)
return len(s),s[0]
@types('int')
def create_ones_shape_2d(n):
from numpy import ones, shape
a = ones((n,n))
s = shape(a)
return len(s),s[0], s[1]
size = randint(10)
f_shape_1d = epyccel(create_ones_shape_1d, language = language)
assert( f_shape_1d(size) == create_ones_shape_1d(size))
f_shape_2d = epyccel(create_ones_shape_2d, language = language)
assert( f_shape_2d(size) == create_ones_shape_2d(size))
def test_ones_order(language):
@types('int','int')
def create_ones_shape_C(n,m):
from numpy import ones, shape
a = ones((n,m), order = 'C')
s = shape(a)
return len(s),s[0], s[1]
@types('int','int')
def create_ones_shape_F(n,m):
from numpy import ones, shape
a = ones((n,m), order = 'F')
s = shape(a)
return len(s),s[0], s[1]
size_1 = randint(10)
size_2 = randint(10)
f_shape_C = epyccel(create_ones_shape_C, language = language)
assert( f_shape_C(size_1,size_2) == create_ones_shape_C(size_1,size_2))
f_shape_F = epyccel(create_ones_shape_F, language = language)
assert( f_shape_F(size_1,size_2) == create_ones_shape_F(size_1,size_2))
def test_ones_dtype(language):
def create_ones_val_int():
from numpy import ones
a = ones(3,int)
return a[0]
def create_ones_val_float():
from numpy import ones
a = ones(3,float)
return a[0]
def create_ones_val_complex():
from numpy import ones
a = ones(3,complex)
return a[0]
def create_ones_val_int32():
from numpy import ones, int32
a = ones(3,int32)
return a[0]
def create_ones_val_float32():
from numpy import ones, float32
a = ones(3,float32)
return a[0]
def create_ones_val_float64():
from numpy import ones, float64
a = ones(3,float64)
return a[0]
def create_ones_val_complex64():
from numpy import ones, complex64
a = ones(3,complex64)
return a[0]
def create_ones_val_complex128():
from numpy import ones, complex128
a = ones(3,complex128)
return a[0]
f_int_int = epyccel(create_ones_val_int, language = language)
assert( f_int_int() == create_ones_val_int())
assert matching_types(f_int_int(), create_ones_val_int())
f_int_float = epyccel(create_ones_val_float, language = language)
assert(isclose( f_int_float() , create_ones_val_float(), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_float(), create_ones_val_float())
f_int_complex = epyccel(create_ones_val_complex, language = language)
assert(isclose( f_int_complex() , create_ones_val_complex(), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_complex(), create_ones_val_complex())
f_real_int32 = epyccel(create_ones_val_int32, language = language)
assert( f_real_int32() == create_ones_val_int32())
assert matching_types(f_real_int32(), create_ones_val_int32())
f_real_float32 = epyccel(create_ones_val_float32, language = language)
assert(isclose( f_real_float32() , create_ones_val_float32(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float32(), create_ones_val_float32())
f_real_float64 = epyccel(create_ones_val_float64, language = language)
assert(isclose( f_real_float64() , create_ones_val_float64(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float64(), create_ones_val_float64())
f_real_complex64 = epyccel(create_ones_val_complex64, language = language)
assert(isclose( f_real_complex64() , create_ones_val_complex64(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex64(), create_ones_val_complex64())
f_real_complex128 = epyccel(create_ones_val_complex128, language = language)
assert(isclose( f_real_complex128() , create_ones_val_complex128(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex128(), create_ones_val_complex128())
def test_ones_combined_args(language):
def create_ones_1_shape():
from numpy import ones, shape
a = ones((2,1),int,'F')
s = shape(a)
return len(s),s[0],s[1]
def create_ones_1_val():
from numpy import ones
a = ones((2,1),int,'F')
return a[0,0]
def create_ones_2_shape():
from numpy import ones, shape
a = ones((4,2),dtype=float)
s = shape(a)
return len(s),s[0],s[1]
def create_ones_2_val():
from numpy import ones
a = ones((4,2),dtype=float)
return a[0,0]
def create_ones_3_shape():
from numpy import ones, shape
a = ones(order = 'F', shape = (4,2),dtype=complex)
s = shape(a)
return len(s),s[0],s[1]
def create_ones_3_val():
from numpy import ones
a = ones(order = 'F', shape = (4,2),dtype=complex)
return a[0,0]
f1_shape = epyccel(create_ones_1_shape, language = language)
f1_val = epyccel(create_ones_1_val, language = language)
assert( f1_shape() == create_ones_1_shape() )
assert( f1_val() == create_ones_1_val() )
assert matching_types(f1_val(), create_ones_1_val())
f2_shape = epyccel(create_ones_2_shape, language = language)
f2_val = epyccel(create_ones_2_val, language = language)
assert( f2_shape() == create_ones_2_shape() )
assert(isclose( f2_val() , create_ones_2_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f2_val(), create_ones_2_val())
f3_shape = epyccel(create_ones_3_shape, language = language)
f3_val = epyccel(create_ones_3_val, language = language)
assert( f3_shape() == create_ones_3_shape() )
assert(isclose( f3_val() , create_ones_3_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f3_val(), create_ones_3_val())
def test_zeros_basic(language):
@types('int')
def create_zeros_shape_1d(n):
from numpy import zeros, shape
a = zeros(n)
s = shape(a)
return len(s),s[0]
@types('int')
def create_zeros_shape_2d(n):
from numpy import zeros, shape
a = zeros((n,n))
s = shape(a)
return len(s),s[0], s[1]
size = randint(10)
f_shape_1d = epyccel(create_zeros_shape_1d, language = language)
assert( f_shape_1d(size) == create_zeros_shape_1d(size))
f_shape_2d = epyccel(create_zeros_shape_2d, language = language)
assert( f_shape_2d(size) == create_zeros_shape_2d(size))
def test_zeros_order(language):
@types('int','int')
def create_zeros_shape_C(n,m):
from numpy import zeros, shape
a = zeros((n,m), order = 'C')
s = shape(a)
return len(s),s[0], s[1]
@types('int','int')
def create_zeros_shape_F(n,m):
from numpy import zeros, shape
a = zeros((n,m), order = 'F')
s = shape(a)
return len(s),s[0], s[1]
size_1 = randint(10)
size_2 = randint(10)
f_shape_C = epyccel(create_zeros_shape_C, language = language)
assert( f_shape_C(size_1,size_2) == create_zeros_shape_C(size_1,size_2))
f_shape_F = epyccel(create_zeros_shape_F, language = language)
assert( f_shape_F(size_1,size_2) == create_zeros_shape_F(size_1,size_2))
def test_zeros_dtype(language):
def create_zeros_val_int():
from numpy import zeros
a = zeros(3,int)
return a[0]
def create_zeros_val_float():
from numpy import zeros
a = zeros(3,float)
return a[0]
def create_zeros_val_complex():
from numpy import zeros
a = zeros(3,complex)
return a[0]
def create_zeros_val_int32():
from numpy import zeros, int32
a = zeros(3,int32)
return a[0]
def create_zeros_val_float32():
from numpy import zeros, float32
a = zeros(3,float32)
return a[0]
def create_zeros_val_float64():
from numpy import zeros, float64
a = zeros(3,float64)
return a[0]
def create_zeros_val_complex64():
from numpy import zeros, complex64
a = zeros(3,complex64)
return a[0]
def create_zeros_val_complex128():
from numpy import zeros, complex128
a = zeros(3,complex128)
return a[0]
f_int_int = epyccel(create_zeros_val_int, language = language)
assert( f_int_int() == create_zeros_val_int())
assert matching_types(f_int_int(), create_zeros_val_int())
f_int_float = epyccel(create_zeros_val_float, language = language)
assert(isclose( f_int_float() , create_zeros_val_float(), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_float(), create_zeros_val_float())
f_int_complex = epyccel(create_zeros_val_complex, language = language)
assert(isclose( f_int_complex() , create_zeros_val_complex(), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_complex(), create_zeros_val_complex())
f_real_int32 = epyccel(create_zeros_val_int32, language = language)
assert( f_real_int32() == create_zeros_val_int32())
assert matching_types(f_real_int32(), create_zeros_val_int32())
f_real_float32 = epyccel(create_zeros_val_float32, language = language)
assert(isclose( f_real_float32() , create_zeros_val_float32(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float32(), create_zeros_val_float32())
f_real_float64 = epyccel(create_zeros_val_float64, language = language)
assert(isclose( f_real_float64() , create_zeros_val_float64(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float64(), create_zeros_val_float64())
f_real_complex64 = epyccel(create_zeros_val_complex64, language = language)
assert(isclose( f_real_complex64() , create_zeros_val_complex64(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex64(), create_zeros_val_complex64())
f_real_complex128 = epyccel(create_zeros_val_complex128, language = language)
assert(isclose( f_real_complex128() , create_zeros_val_complex128(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex128(), create_zeros_val_complex128())
def test_zeros_combined_args(language):
def create_zeros_1_shape():
from numpy import zeros, shape
a = zeros((2,1),int,'F')
s = shape(a)
return len(s),s[0],s[1]
def create_zeros_1_val():
from numpy import zeros
a = zeros((2,1),int,'F')
return a[0,0]
def create_zeros_2_shape():
from numpy import zeros, shape
a = zeros((4,2),dtype=float)
s = shape(a)
return len(s),s[0],s[1]
def create_zeros_2_val():
from numpy import zeros
a = zeros((4,2),dtype=float)
return a[0,0]
def create_zeros_3_shape():
from numpy import zeros, shape
a = zeros(order = 'F', shape = (4,2),dtype=complex)
s = shape(a)
return len(s),s[0],s[1]
def create_zeros_3_val():
from numpy import zeros
a = zeros(order = 'F', shape = (4,2),dtype=complex)
return a[0,0]
f1_shape = epyccel(create_zeros_1_shape, language = language)
f1_val = epyccel(create_zeros_1_val, language = language)
assert( f1_shape() == create_zeros_1_shape() )
assert( f1_val() == create_zeros_1_val() )
assert matching_types(f1_val(), create_zeros_1_val())
f2_shape = epyccel(create_zeros_2_shape, language = language)
f2_val = epyccel(create_zeros_2_val, language = language)
assert( f2_shape() == create_zeros_2_shape() )
assert(isclose( f2_val() , create_zeros_2_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f2_val(), create_zeros_2_val())
f3_shape = epyccel(create_zeros_3_shape, language = language)
f3_val = epyccel(create_zeros_3_val, language = language)
assert( f3_shape() == create_zeros_3_shape() )
assert(isclose( f3_val() , create_zeros_3_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f3_val(), create_zeros_3_val())
def test_array(language):
def create_array_list_val():
from numpy import array
a = array([[1,2,3],[4,5,6]])
return a[0,0]
def create_array_list_shape():
from numpy import array, shape
a = array([[1,2,3],[4,5,6]])
s = shape(a)
return len(s), s[0], s[1]
def create_array_tuple_val():
from numpy import array
a = array(((1,2,3),(4,5,6)))
return a[0,0]
def create_array_tuple_shape():
from numpy import array, shape
a = array(((1,2,3),(4,5,6)))
s = shape(a)
return len(s), s[0], s[1]
f1_shape = epyccel(create_array_list_shape, language = language)
f1_val = epyccel(create_array_list_val, language = language)
assert(f1_shape() == create_array_list_shape())
assert(f1_val() == create_array_list_val())
assert matching_types(f1_val(), create_array_list_val())
f2_shape = epyccel(create_array_tuple_shape, language = language)
f2_val = epyccel(create_array_tuple_val, language = language)
assert(f2_shape() == create_array_tuple_shape())
assert(f2_val() == create_array_tuple_val())
assert matching_types(f2_val(), create_array_tuple_val())
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="rand not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_rand_basic(language):
def create_val():
from numpy.random import rand # pylint: disable=reimported
return rand()
f1 = epyccel(create_val, language = language)
y = [f1() for i in range(10)]
assert(all([yi < 1 for yi in y]))
assert(all([yi >= 0 for yi in y]))
assert(all([isinstance(yi,float) for yi in y]))
assert(len(set(y))>1)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="rand not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_rand_args(language):
@types('int')
def create_array_size_1d(n):
from numpy.random import rand # pylint: disable=reimported
from numpy import shape
a = rand(n)
return shape(a)[0]
@types('int','int')
def create_array_size_2d(n,m):
from numpy.random import rand # pylint: disable=reimported
from numpy import shape
a = rand(n,m)
return shape(a)[0], shape(a)[1]
@types('int','int','int')
def create_array_size_3d(n,m,p):
from numpy.random import rand # pylint: disable=reimported
from numpy import shape
a = rand(n,m,p)
return shape(a)[0], shape(a)[1], shape(a)[2]
def create_array_vals_1d():
from numpy.random import rand # pylint: disable=reimported
a = rand(4)
return a[0], a[1], a[2], a[3]
def create_array_vals_2d():
from numpy.random import rand # pylint: disable=reimported
a = rand(2,2)
return a[0,0], a[0,1], a[1,0], a[1,1]
n = randint(10)
m = randint(10)
p = randint(5)
f_1d = epyccel(create_array_size_1d, language = language)
assert( f_1d(n) == create_array_size_1d(n) )
f_2d = epyccel(create_array_size_2d, language = language)
assert( f_2d(n, m) == create_array_size_2d(n, m) )
f_3d = epyccel(create_array_size_3d, language = language)
assert( f_3d(n, m, p) == create_array_size_3d(n, m, p))
g_1d = epyccel(create_array_vals_1d, language = language)
y = g_1d()
assert(all([yi < 1 for yi in y]))
assert(all([yi >= 0 for yi in y]))
assert(all([isinstance(yi,float) for yi in y]))
assert(len(set(y))>1)
g_2d = epyccel(create_array_vals_2d, language = language)
y = g_2d()
assert(all([yi < 1 for yi in y]))
assert(all([yi >= 0 for yi in y]))
assert(all([isinstance(yi,float) for yi in y]))
assert(len(set(y))>1)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="rand not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_rand_expr(language):
def create_val():
from numpy.random import rand # pylint: disable=reimported
x = 2*rand()
return x
f1 = epyccel(create_val, language = language)
y = [f1() for i in range(10)]
assert(all([yi < 2 for yi in y]))
assert(all([yi >= 0 for yi in y]))
assert(all([isinstance(yi,float) for yi in y]))
assert(len(set(y))>1)
@pytest.mark.xfail(reason="a is not allocated")
def test_rand_expr_array(language):
def create_array_vals_2d():
from numpy.random import rand # pylint: disable=reimported
a = rand(2,2)*0.5 + 3
return a[0,0], a[0,1], a[1,0], a[1,1]
f2 = epyccel(create_array_vals_2d, language = language)
y = f2()
assert(all([yi < 3.5 for yi in y]))
assert(all([yi >= 3 for yi in y]))
assert(all([isinstance(yi,float) for yi in y]))
assert(len(set(y))>1)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="randint not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_randint_basic(language):
def create_rand():
from numpy.random import randint # pylint: disable=reimported
return randint(-10, 10)
@types('int')
def create_val(high):
from numpy.random import randint # pylint: disable=reimported
return randint(high)
@types('int','int')
def create_val_low(low, high):
from numpy.random import randint # pylint: disable=reimported
return randint(low, high)
f0 = epyccel(create_rand, language = language)
y = [f0() for i in range(10)]
assert(all([yi < 10 for yi in y]))
assert(all([yi >= -10 for yi in y]))
assert(all([isinstance(yi,int) for yi in y]))
assert(len(set(y))>1)
f1 = epyccel(create_val, language = language)
y = [f1(100) for i in range(10)]
assert(all([yi < 100 for yi in y]))
assert(all([yi >= 0 for yi in y]))
assert(all([isinstance(yi,int) for yi in y]))
assert(len(set(y))>1)
f2 = epyccel(create_val_low, language = language)
y = [f2(25, 100) for i in range(10)]
assert(all([yi < 100 for yi in y]))
assert(all([yi >= 25 for yi in y]))
assert(all([isinstance(yi,int) for yi in y]))
assert(len(set(y))>1)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="randint not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_randint_expr(language):
@types('int')
def create_val(high):
from numpy.random import randint # pylint: disable=reimported
x = 2*randint(high)
return x
@types('int','int')
def create_val_low(low, high):
from numpy.random import randint # pylint: disable=reimported
x = 2*randint(low, high)
return x
f1 = epyccel(create_val, language = language)
y = [f1(27) for i in range(10)]
assert(all([yi < 54 for yi in y]))
assert(all([yi >= 0 for yi in y]))
assert(all([isinstance(yi,int) for yi in y]))
assert(len(set(y))>1)
f2 = epyccel(create_val_low, language = language)
y = [f2(21,46) for i in range(10)]
assert(all([yi < 92 for yi in y]))
assert(all([yi >= 42 for yi in y]))
assert(all([isinstance(yi,int) for yi in y]))
assert(len(set(y))>1)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="sum not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_sum_int(language):
@types('int[:]')
def sum_call(x):
from numpy import sum as np_sum
return np_sum(x)
f1 = epyccel(sum_call, language = language)
x = randint(99,size=10)
assert(f1(x) == sum_call(x))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="sum not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_sum_real(language):
@types('real[:]')
def sum_call(x):
from numpy import sum as np_sum
return np_sum(x)
f1 = epyccel(sum_call, language = language)
x = rand(10)
assert(isclose(f1(x), sum_call(x), rtol=RTOL, atol=ATOL))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="sum not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_sum_phrase(language):
@types('real[:]','real[:]')
def sum_phrase(x,y):
from numpy import sum as np_sum
a = np_sum(x)*np_sum(y)
return a
f2 = epyccel(sum_phrase, language = language)
x = rand(10)
y = rand(15)
assert(isclose(f2(x,y), sum_phrase(x,y), rtol=RTOL, atol=ATOL))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="sum not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_sum_property(language):
@types('int[:]')
def sum_call(x):
return x.sum()
f1 = epyccel(sum_call, language = language)
x = randint(99,size=10)
assert(f1(x) == sum_call(x))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="amin not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_min_int(language):
@types('int[:]')
def min_call(x):
from numpy import amin
return amin(x)
f1 = epyccel(min_call, language = language)
x = randint(99,size=10)
assert(f1(x) == min_call(x))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="amin not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_min_real(language):
@types('real[:]')
def min_call(x):
from numpy import amin
return amin(x)
f1 = epyccel(min_call, language = language)
x = rand(10)
assert(isclose(f1(x), min_call(x), rtol=RTOL, atol=ATOL))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="amin not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_min_phrase(language):
@types('real[:]','real[:]')
def min_phrase(x,y):
from numpy import amin
a = amin(x)*amin(y)
return a
f2 = epyccel(min_phrase, language = language)
x = rand(10)
y = rand(15)
assert(isclose(f2(x,y), min_phrase(x,y), rtol=RTOL, atol=ATOL))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="amin not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_min_property(language):
@types('int[:]')
def min_call(x):
return x.min()
f1 = epyccel(min_call, language = language)
x = randint(99,size=10)
assert(f1(x) == min_call(x))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="amax not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_max_int(language):
@types('int[:]')
def max_call(x):
from numpy import amax
return amax(x)
f1 = epyccel(max_call, language = language)
x = randint(99,size=10)
assert(f1(x) == max_call(x))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="amax not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_max_real(language):
@types('real[:]')
def max_call(x):
from numpy import amax
return amax(x)
f1 = epyccel(max_call, language = language)
x = rand(10)
assert(isclose(f1(x), max_call(x), rtol=RTOL, atol=ATOL))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="amax not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_max_phrase(language):
@types('real[:]','real[:]')
def max_phrase(x,y):
from numpy import amax
a = amax(x)*amax(y)
return a
f2 = epyccel(max_phrase, language = language)
x = rand(10)
y = rand(15)
assert(isclose(f2(x,y), max_phrase(x,y), rtol=RTOL, atol=ATOL))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="amax not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_max_property(language):
@types('int[:]')
def max_call(x):
return x.max()
f1 = epyccel(max_call, language = language)
x = randint(99,size=10)
assert(f1(x) == max_call(x))
def test_full_like_basic_int(language):
@types('int')
def create_full_like_shape_1d(n):
from numpy import full_like, shape, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr, n, int, 'F')
s = shape(a)
return len(s),s[0]
@types('int')
def create_full_like_shape_2d(n):
from numpy import full_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr, n, int , 'F')
s = shape(a)
return len(s),s[0], s[1]
@types('int')
def create_full_like_val(val):
from numpy import full_like, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr, val, int, 'F')
return a[0],a[1],a[2]
@types('int')
def create_full_like_arg_names(val):
from numpy import full_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr, val, int, 'F', shape = (2,3))
return a[0,0],a[0,1],a[0,2],a[1,0],a[1,1],a[1,2]
size = randint(10)
f_shape_1d = epyccel(create_full_like_shape_1d, language = language)
assert(f_shape_1d(size) == create_full_like_shape_1d(size))
f_shape_2d = epyccel(create_full_like_shape_2d, language = language)
assert(f_shape_2d(size) == create_full_like_shape_2d(size))
f_val = epyccel(create_full_like_val, language = language)
assert(f_val(size) == create_full_like_val(size))
assert matching_types(f_val(size)[0], create_full_like_val(size)[0])
f_arg_names = epyccel(create_full_like_arg_names, language = language)
assert(f_arg_names(size) == create_full_like_arg_names(size))
assert matching_types(f_arg_names(size)[0], create_full_like_arg_names(size)[0])
def test_full_like_basic_real(language):
@types('real')
def create_full_like_shape_1d(n):
from numpy import full_like, shape, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr, n, float, 'F')
s = shape(a)
return len(s),s[0]
@types('real')
def create_full_like_shape_2d(n):
from numpy import full_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr, n, float, 'F')
s = shape(a)
return len(s),s[0], s[1]
@types('real')
def create_full_like_val(val):
from numpy import full_like, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr, val, float, 'F')
return a[0],a[1],a[2]
@types('real')
def create_full_like_arg_names(val):
from numpy import full_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr, val, float, 'F', shape = (2,3))
return a[0,0],a[0,1],a[0,2],a[1,0],a[1,1],a[1,2]
size = uniform(10)
val = rand()*5
f_shape_1d = epyccel(create_full_like_shape_1d, language = language)
assert(f_shape_1d(size) == create_full_like_shape_1d(size))
f_shape_2d = epyccel(create_full_like_shape_2d, language = language)
assert(f_shape_2d(size) == create_full_like_shape_2d(size))
f_val = epyccel(create_full_like_val, language = language)
assert(f_val(val) == create_full_like_val(val))
assert matching_types(f_val(val)[0], create_full_like_val(val)[0])
f_arg_names = epyccel(create_full_like_arg_names, language = language)
assert(f_arg_names(val) == create_full_like_arg_names(val))
assert matching_types(f_arg_names(val)[0], create_full_like_arg_names(val)[0])
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="Tuples not implemented"),
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_full_like_basic_bool(language):
@types('int')
def create_full_like_shape_1d(n):
from numpy import full_like, shape, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr, n, int, 'F')
s = shape(a)
return len(s),s[0]
@types('int')
def create_full_like_shape_2d(n):
from numpy import full_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr, n, int, 'F')
s = shape(a)
return len(s),s[0], s[1]
@types('bool')
def create_full_like_val(val):
from numpy import full_like, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr , 3, bool, 'F')
return a[0],a[1],a[2]
@types('bool')
def create_full_like_arg_names(val):
from numpy import full_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr ,fill_value = val, dtype=bool, shape = (2,3))
return a[0,0],a[0,1],a[0,2],a[1,0],a[1,1],a[1,2]
size = randint(10)
val = bool(randint(2))
f_shape_1d = epyccel(create_full_like_shape_1d, language = language)
assert(f_shape_1d(size) == create_full_like_shape_1d(size))
f_shape_2d = epyccel(create_full_like_shape_2d, language = language)
assert(f_shape_2d(size) == create_full_like_shape_2d(size))
f_val = epyccel(create_full_like_val, language = language)
assert(f_val(val) == create_full_like_val(val))
assert matching_types(f_val(val)[0], create_full_like_val(val)[0])
f_arg_names = epyccel(create_full_like_arg_names, language = language)
assert(f_arg_names(val) == create_full_like_arg_names(val))
assert matching_types(f_arg_names(val)[0], create_full_like_arg_names(val)[0])
def test_full_like_order(language):
@types('int')
def create_full_like_shape_C(n):
from numpy import full_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr,4, order = 'C')
s = shape(a)
return len(s),s[0], s[1]
@types('int')
def create_full_like_shape_F(n):
from numpy import full_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr,4, order = 'F')
s = shape(a)
return len(s),s[0], s[1]
size = randint(10)
f_shape_C = epyccel(create_full_like_shape_C, language = language)
assert(f_shape_C(size) == create_full_like_shape_C(size))
f_shape_F = epyccel(create_full_like_shape_F, language = language)
assert(f_shape_F(size) == create_full_like_shape_F(size))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.c]
),
pytest.param("python", marks = pytest.mark.python)
)
)
def test_full_like_dtype(language):
@types('int')
def create_full_like_val_int_int(val):
from numpy import full_like, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr,val,int)
return a[0]
@types('int')
def create_full_like_val_int_float(val):
from numpy import full_like, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr,val,float)
return a[0]
@types('int')
def create_full_like_val_int_complex(val):
from numpy import full_like, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr,val,complex)
return a[0]
@types('real')
def create_full_like_val_real_int32(val):
from numpy import full_like, int32, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr,val,int32)
return a[0]
@types('real')
def create_full_like_val_real_float32(val):
from numpy import full_like, float32, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr,val,float32)
return a[0]
@types('real')
def create_full_like_val_real_float64(val):
from numpy import full_like, float64, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr,val,float64)
return a[0]
@types('real')
def create_full_like_val_real_complex64(val):
from numpy import full_like, complex64, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr,val,complex64)
return a[0]
@types('real')
def create_full_like_val_real_complex128(val):
from numpy import full_like, complex128, array
arr = array([5, 1, 8, 0, 9])
a = full_like(arr,val,complex128)
return a[0]
val_int = randint(100)
val_float = rand()*100
f_int_int = epyccel(create_full_like_val_int_int, language = language)
assert( f_int_int(val_int) == create_full_like_val_int_int(val_int))
assert matching_types(f_int_int(val_int), create_full_like_val_int_int(val_int))
f_int_float = epyccel(create_full_like_val_int_float, language = language)
assert(isclose( f_int_float(val_int) , create_full_like_val_int_float(val_int), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_float(val_int), create_full_like_val_int_float(val_int))
f_int_complex = epyccel(create_full_like_val_int_complex, language = language)
assert(isclose( f_int_complex(val_int) , create_full_like_val_int_complex(val_int), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_complex(val_int), create_full_like_val_int_complex(val_int))
f_real_int32 = epyccel(create_full_like_val_real_int32, language = language)
assert( f_real_int32(val_float) == create_full_like_val_real_int32(val_float))
assert matching_types(f_real_int32(val_float), create_full_like_val_real_int32(val_float))
f_real_float32 = epyccel(create_full_like_val_real_float32, language = language)
assert(isclose( f_real_float32(val_float) , create_full_like_val_real_float32(val_float), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float32(val_float), create_full_like_val_real_float32(val_float))
f_real_float64 = epyccel(create_full_like_val_real_float64, language = language)
assert(isclose( f_real_float64(val_float) , create_full_like_val_real_float64(val_float), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float64(val_float), create_full_like_val_real_float64(val_float))
f_real_complex64 = epyccel(create_full_like_val_real_complex64, language = language)
assert(isclose( f_real_complex64(val_float) , create_full_like_val_real_complex64(val_float), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex64(val_float), create_full_like_val_real_complex64(val_float))
f_real_complex128 = epyccel(create_full_like_val_real_complex128, language = language)
assert(isclose( f_real_complex128(val_float) , create_full_like_val_real_complex128(val_float), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex128(val_float), create_full_like_val_real_complex128(val_float))
def test_full_like_combined_args(language):
def create_full_like_1_shape():
from numpy import full_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr,5,int,'F')
s = shape(a)
return len(s),s[0],s[1]
def create_full_like_1_val():
from numpy import full_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr, 4.0, int,'F')
return a[0,0]
def create_full_like_2_shape():
from numpy import full_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr,dtype=float,fill_value=1)
s = shape(a)
return len(s),s[0],s[1]
def create_full_like_2_val():
from numpy import full_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr,dtype=float,fill_value=1)
return a[0,0]
def create_full_like_3_shape():
from numpy import full_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr,order = 'F', shape = (4,2),dtype=complex,fill_value=1)
s = shape(a)
return len(s),s[0],s[1]
def create_full_like_3_val():
from numpy import full_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = full_like(arr,order = 'F', shape = (4,2),dtype=complex,fill_value=1)
return a[0,0]
f1_shape = epyccel(create_full_like_1_shape, language = language)
f1_val = epyccel(create_full_like_1_val, language = language)
assert(f1_shape() == create_full_like_1_shape())
assert(f1_val() == create_full_like_1_val() )
assert matching_types(f1_val(), create_full_like_1_val())
f2_shape = epyccel(create_full_like_2_shape, language = language)
f2_val = epyccel(create_full_like_2_val, language = language)
assert(f2_shape() == create_full_like_2_shape() )
assert(isclose(f2_val() , create_full_like_2_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f2_val(), create_full_like_2_val())
f3_shape = epyccel(create_full_like_3_shape, language = language)
f3_val = epyccel(create_full_like_3_val, language = language)
assert( f3_shape() == create_full_like_3_shape() )
assert(isclose( f3_val() , create_full_like_3_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f3_val(), create_full_like_3_val())
def test_empty_like_basic(language):
@types('int')
def create_empty_like_shape_1d(n):
from numpy import empty_like, shape, array
arr = array([5, 1, 8, 0, 9])
a = empty_like(arr,int)
s = shape(a)
return len(s),s[0]
@types('int')
def create_empty_like_shape_2d(n):
from numpy import empty_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = empty_like(arr,int)
s = shape(a)
return len(s),s[0], s[1]
size = randint(10)
f_shape_1d = epyccel(create_empty_like_shape_1d, language = language)
assert( f_shape_1d(size) == create_empty_like_shape_1d(size))
f_shape_2d = epyccel(create_empty_like_shape_2d, language = language)
assert( f_shape_2d(size) == create_empty_like_shape_2d(size))
def test_empty_like_order(language):
@types('int','int')
def create_empty_like_shape_C(n,m):
from numpy import empty_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = empty_like(arr, int, order = 'C')
s = shape(a)
return len(s),s[0], s[1]
@types('int', 'int')
def create_empty_like_shape_F(n,m):
from numpy import empty_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = empty_like(arr, int, order = 'F')
s = shape(a)
return len(s),s[0], s[1]
size_1 = randint(10)
size_2 = randint(10)
f_shape_C = epyccel(create_empty_like_shape_C, language = language)
assert( f_shape_C(size_1,size_2) == create_empty_like_shape_C(size_1,size_2))
f_shape_F = epyccel(create_empty_like_shape_F, language = language)
assert( f_shape_F(size_1,size_2) == create_empty_like_shape_F(size_1,size_2))
def test_empty_like_dtype(language):
def create_empty_like_val_int():
from numpy import empty_like, array
arr = array([5, 1, 8, 0, 9])
a = empty_like(arr, int)
return a[0]
def create_empty_like_val_float():
from numpy import empty_like, array
arr = array([5, 1, 8, 0, 9])
a = empty_like(arr, dtype=float)
return a[0]
def create_empty_like_val_complex():
from numpy import empty_like, array
arr = array([5, 1, 8, 0, 9])
a = empty_like(arr, dtype=complex)
return a[0]
def create_empty_like_val_int32():
from numpy import empty_like, int32, array
arr = array([5, 1, 8, 0, 9])
a = empty_like(arr, dtype=int32)
return a[0]
def create_empty_like_val_float32():
from numpy import empty_like, float32, array
arr = array([5, 1, 8, 0, 9])
a = empty_like(arr, dtype=float32)
return a[0]
def create_empty_like_val_float64():
from numpy import empty_like, float64, array
arr = array([5, 1, 8, 0, 9])
a = empty_like(arr,dtype=float64)
return a[0]
def create_empty_like_val_complex64():
from numpy import empty_like, complex64, array
arr = array([5, 1, 8, 0, 9])
a = empty_like(arr,dtype=complex64)
return a[0]
def create_empty_like_val_complex128():
from numpy import empty_like, complex128, array
arr = array([5, 1, 8, 0, 9])
a = empty_like(arr,dtype=complex128)
return a[0]
f_int_int = epyccel(create_empty_like_val_int, language = language)
assert matching_types(f_int_int(), create_empty_like_val_int())
f_int_float = epyccel(create_empty_like_val_float, language = language)
assert matching_types(f_int_float(), create_empty_like_val_float())
f_int_complex = epyccel(create_empty_like_val_complex, language = language)
assert matching_types(f_int_complex(), create_empty_like_val_complex())
f_real_int32 = epyccel(create_empty_like_val_int32, language = language)
assert matching_types(f_real_int32(), create_empty_like_val_int32())
f_real_float32 = epyccel(create_empty_like_val_float32, language = language)
assert matching_types(f_real_float32(), create_empty_like_val_float32())
f_real_float64 = epyccel(create_empty_like_val_float64, language = language)
assert matching_types(f_real_float64(), create_empty_like_val_float64())
f_real_complex64 = epyccel(create_empty_like_val_complex64, language = language)
assert matching_types(f_real_complex64(), create_empty_like_val_complex64())
f_real_complex128 = epyccel(create_empty_like_val_complex128, language = language)
assert matching_types(f_real_complex128(), create_empty_like_val_complex128())
def test_empty_like_combined_args(language):
def create_empty_like_1_shape():
from numpy import empty_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = empty_like(arr,dtype=int,order='F')
s = shape(a)
return len(s),s[0],s[1]
def create_empty_like_1_val():
from numpy import empty_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = empty_like(arr, dtype=int,order='F')
return a[0,0]
def create_empty_like_2_shape():
from numpy import empty_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = empty_like(arr, dtype=float)
s = shape(a)
return len(s),s[0],s[1]
def create_empty_like_2_val():
from numpy import empty_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = empty_like(arr, dtype=float)
return a[0,0]
def create_empty_like_3_shape():
from numpy import empty_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = empty_like(arr,shape = (4,2), order = 'F',dtype=complex)
s = shape(a)
return len(s),s[0],s[1]
def create_empty_like_3_val():
from numpy import empty_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = empty_like(arr, shape = (4,2),order = 'F',dtype=complex)
return a[0,0]
f1_shape = epyccel(create_empty_like_1_shape, language = language)
f1_val = epyccel(create_empty_like_1_val, language = language)
assert( f1_shape() == create_empty_like_1_shape() )
assert matching_types(f1_val(), create_empty_like_1_val())
f2_shape = epyccel(create_empty_like_2_shape, language = language)
f2_val = epyccel(create_empty_like_2_val, language = language)
assert(all(isclose( f2_shape(), create_empty_like_2_shape() )))
assert matching_types(f2_val(), create_empty_like_2_val())
f3_shape = epyccel(create_empty_like_3_shape, language = language)
f3_val = epyccel(create_empty_like_3_val, language = language)
assert(all(isclose( f3_shape(), create_empty_like_3_shape() )))
assert matching_types(f3_val(), create_empty_like_3_val())
def test_ones_like_basic(language):
@types('int')
def create_ones_like_shape_1d(n):
from numpy import ones_like, shape, array
arr = array([5, 1, 8, 0, 9])
a = ones_like(arr)
s = shape(a)
return len(s),s[0]
@types('int')
def create_ones_like_shape_2d(n):
from numpy import ones_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = ones_like(arr)
s = shape(a)
return len(s),s[0], s[1]
size = randint(10)
f_shape_1d = epyccel(create_ones_like_shape_1d, language = language)
assert( f_shape_1d(size) == create_ones_like_shape_1d(size))
f_shape_2d = epyccel(create_ones_like_shape_2d, language = language)
assert( f_shape_2d(size) == create_ones_like_shape_2d(size))
def test_ones_like_order(language):
@types('int','int')
def create_ones_like_shape_C(n,m):
from numpy import ones_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = ones_like(arr, order = 'C')
s = shape(a)
return len(s),s[0], s[1]
@types('int','int')
def create_ones_like_shape_F(n,m):
from numpy import ones_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = ones_like(arr, order = 'F')
s = shape(a)
return len(s),s[0], s[1]
size_1 = randint(10)
size_2 = randint(10)
f_shape_C = epyccel(create_ones_like_shape_C, language = language)
assert( f_shape_C(size_1,size_2) == create_ones_like_shape_C(size_1,size_2))
f_shape_F = epyccel(create_ones_like_shape_F, language = language)
assert( f_shape_F(size_1,size_2) == create_ones_like_shape_F(size_1,size_2))
def test_ones_like_dtype(language):
def create_ones_like_val_int():
from numpy import ones_like, array
arr = array([5, 1, 8, 0, 9])
a = ones_like(arr, int)
return a[0]
def create_ones_like_val_float():
from numpy import ones_like, array
arr = array([5, 1, 8, 0, 9])
a = ones_like(arr,float)
return a[0]
def create_ones_like_val_complex():
from numpy import ones_like, array
arr = array([5, 1, 8, 0, 9])
a = ones_like(arr, complex)
return a[0]
def create_ones_like_val_int32():
from numpy import ones_like, int32, array
arr = array([5, 1, 8, 0, 9])
a = ones_like(arr,int32)
return a[0]
def create_ones_like_val_float32():
from numpy import ones_like, float32, array
arr = array([5, 1, 8, 0, 9])
a = ones_like(arr, float32)
return a[0]
def create_ones_like_val_float64():
from numpy import ones_like, float64, array
arr = array([5, 1, 8, 0, 9])
a = ones_like(arr, float64)
return a[0]
def create_ones_like_val_complex64():
from numpy import ones_like, complex64, array
arr = array([5, 1, 8, 0, 9])
a = ones_like(arr, complex64)
return a[0]
def create_ones_like_val_complex128():
from numpy import ones_like, complex128, array
arr = array([5, 1, 8, 0, 9])
a = ones_like(arr, complex128)
return a[0]
f_int_int = epyccel(create_ones_like_val_int, language = language)
assert( f_int_int() == create_ones_like_val_int())
assert matching_types(f_int_int(), create_ones_like_val_int())
f_int_float = epyccel(create_ones_like_val_float, language = language)
assert(isclose( f_int_float() , create_ones_like_val_float(), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_float(), create_ones_like_val_float())
f_int_complex = epyccel(create_ones_like_val_complex, language = language)
assert(isclose( f_int_complex() , create_ones_like_val_complex(), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_complex(), create_ones_like_val_complex())
f_real_int32 = epyccel(create_ones_like_val_int32, language = language)
assert( f_real_int32() == create_ones_like_val_int32())
assert matching_types(f_real_int32(), create_ones_like_val_int32())
f_real_float32 = epyccel(create_ones_like_val_float32, language = language)
assert(isclose( f_real_float32() , create_ones_like_val_float32(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float32(), create_ones_like_val_float32())
f_real_float64 = epyccel(create_ones_like_val_float64, language = language)
assert(isclose( f_real_float64() , create_ones_like_val_float64(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float64(), create_ones_like_val_float64())
f_real_complex64 = epyccel(create_ones_like_val_complex64, language = language)
assert(isclose( f_real_complex64() , create_ones_like_val_complex64(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex64(), create_ones_like_val_complex64())
f_real_complex128 = epyccel(create_ones_like_val_complex128, language = language)
assert(isclose( f_real_complex128() , create_ones_like_val_complex128(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex128(), create_ones_like_val_complex128())
def test_ones_like_combined_args(language):
def create_ones_like_1_shape():
from numpy import ones_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = ones_like(arr,int,'F')
s = shape(a)
return len(s),s[0],s[1]
def create_ones_like_1_val():
from numpy import ones_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = ones_like(arr,int,'F')
return a[0,0]
def create_ones_like_2_shape():
from numpy import ones_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = ones_like(arr,dtype=float)
s = shape(a)
return len(s),s[0],s[1]
def create_ones_like_2_val():
from numpy import ones_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = ones_like(arr,dtype=float)
return a[0,0]
def create_ones_like_3_shape():
from numpy import ones_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = ones_like(arr,shape = (4,2),order = 'F',dtype=complex)
s = shape(a)
return len(s),s[0],s[1]
def create_ones_like_3_val():
from numpy import ones_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = ones_like(arr,shape = (4,2),order = 'F',dtype=complex)
return a[0,0]
f1_shape = epyccel(create_ones_like_1_shape, language = language)
f1_val = epyccel(create_ones_like_1_val, language = language)
assert( f1_shape() == create_ones_like_1_shape() )
assert( f1_val() == create_ones_like_1_val() )
assert matching_types(f1_val(), create_ones_like_1_val())
f2_shape = epyccel(create_ones_like_2_shape, language = language)
f2_val = epyccel(create_ones_like_2_val, language = language)
assert( f2_shape() == create_ones_like_2_shape() )
assert(isclose( f2_val() , create_ones_like_2_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f2_val(), create_ones_like_2_val())
f3_shape = epyccel(create_ones_like_3_shape, language = language)
f3_val = epyccel(create_ones_like_3_val, language = language)
assert( f3_shape() == create_ones_like_3_shape() )
assert(isclose( f3_val() , create_ones_like_3_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f3_val(), create_ones_like_3_val())
def test_zeros_like_basic(language):
@types('int')
def create_zeros_like_shape_1d(n):
from numpy import zeros_like, shape, array
arr = array([5, 1, 8, 0, 9])
a = zeros_like(arr, int)
s = shape(a)
return len(s),s[0]
@types('int')
def create_zeros_like_shape_2d(n):
from numpy import zeros_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = zeros_like(arr,int)
s = shape(a)
return len(s),s[0], s[1]
size = randint(10)
f_shape_1d = epyccel(create_zeros_like_shape_1d, language = language)
assert( f_shape_1d(size) == create_zeros_like_shape_1d(size))
f_shape_2d = epyccel(create_zeros_like_shape_2d, language = language)
assert( f_shape_2d(size) == create_zeros_like_shape_2d(size))
def test_zeros_like_order(language):
@types('int','int')
def create_zeros_like_shape_C(n,m):
from numpy import zeros_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = zeros_like(arr, order = 'C')
s = shape(a)
return len(s),s[0], s[1]
@types('int','int')
def create_zeros_like_shape_F(n,m):
from numpy import zeros_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = zeros_like(arr, order = 'F')
s = shape(a)
return len(s),s[0], s[1]
size_1 = randint(10)
size_2 = randint(10)
f_shape_C = epyccel(create_zeros_like_shape_C, language = language)
assert( f_shape_C(size_1,size_2) == create_zeros_like_shape_C(size_1,size_2))
f_shape_F = epyccel(create_zeros_like_shape_F, language = language)
assert( f_shape_F(size_1,size_2) == create_zeros_like_shape_F(size_1,size_2))
def test_zeros_like_dtype(language):
def create_zeros_like_val_int():
from numpy import zeros_like, array
arr = array([5, 1, 8, 0, 9])
a = zeros_like(arr,int)
return a[0]
def create_zeros_like_val_float():
from numpy import zeros_like, array
arr = array([5, 1, 8, 0, 9])
a = zeros_like(arr,float)
return a[0]
def create_zeros_like_val_complex():
from numpy import zeros_like, array
arr = array([5, 1, 8, 0, 9])
a = zeros_like(arr,complex)
return a[0]
def create_zeros_like_val_int32():
from numpy import zeros_like, int32, array
arr = array([5, 1, 8, 0, 9])
a = zeros_like(arr,int32)
return a[0]
def create_zeros_like_val_float32():
from numpy import zeros_like, float32, array
arr = array([5, 1, 8, 0, 9])
a = zeros_like(arr,float32)
return a[0]
def create_zeros_like_val_float64():
from numpy import zeros_like, float64, array
arr = array([5, 1, 8, 0, 9])
a = zeros_like(arr,float64)
return a[0]
def create_zeros_like_val_complex64():
from numpy import zeros_like, complex64, array
arr = array([5, 1, 8, 0, 9])
a = zeros_like(arr,complex64)
return a[0]
def create_zeros_like_val_complex128():
from numpy import zeros_like, complex128, array
arr = array([5, 1, 8, 0, 9])
a = zeros_like(arr,complex128)
return a[0]
f_int_int = epyccel(create_zeros_like_val_int, language = language)
assert( f_int_int() == create_zeros_like_val_int())
assert matching_types(f_int_int(), create_zeros_like_val_int())
f_int_float = epyccel(create_zeros_like_val_float, language = language)
assert(isclose( f_int_float() , create_zeros_like_val_float(), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_float(), create_zeros_like_val_float())
f_int_complex = epyccel(create_zeros_like_val_complex, language = language)
assert(isclose( f_int_complex() , create_zeros_like_val_complex(), rtol=RTOL, atol=ATOL))
assert matching_types(f_int_complex(), create_zeros_like_val_complex())
f_real_int32 = epyccel(create_zeros_like_val_int32, language = language)
assert( f_real_int32() == create_zeros_like_val_int32())
assert matching_types(f_real_int32(), create_zeros_like_val_int32())
f_real_float32 = epyccel(create_zeros_like_val_float32, language = language)
assert(isclose( f_real_float32() , create_zeros_like_val_float32(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float32(), create_zeros_like_val_float32())
f_real_float64 = epyccel(create_zeros_like_val_float64, language = language)
assert(isclose( f_real_float64() , create_zeros_like_val_float64(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_float64(), create_zeros_like_val_float64())
f_real_complex64 = epyccel(create_zeros_like_val_complex64, language = language)
assert(isclose( f_real_complex64() , create_zeros_like_val_complex64(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex64(), create_zeros_like_val_complex64())
f_real_complex128 = epyccel(create_zeros_like_val_complex128, language = language)
assert(isclose( f_real_complex128() , create_zeros_like_val_complex128(), rtol=RTOL, atol=ATOL))
assert matching_types(f_real_complex128(), create_zeros_like_val_complex128())
def test_zeros_like_combined_args(language):
def create_zeros_like_1_shape():
from numpy import zeros_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = zeros_like(arr,int,'F')
s = shape(a)
return len(s),s[0],s[1]
def create_zeros_like_1_val():
from numpy import zeros_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = zeros_like(arr, int,'F')
return a[0,0]
def create_zeros_like_2_shape():
from numpy import zeros_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = zeros_like(arr, dtype=float)
s = shape(a)
return len(s),s[0],s[1]
def create_zeros_like_2_val():
from numpy import zeros_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = zeros_like(arr, dtype=float)
return a[0,0]
def create_zeros_like_3_shape():
from numpy import zeros_like, shape, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = zeros_like(arr, shape = (4,2), order = 'F',dtype=complex)
s = shape(a)
return len(s),s[0],s[1]
def create_zeros_like_3_val():
from numpy import zeros_like, array
arr = array([[5, 1, 8, 0, 9], [5, 1, 8, 0, 9]])
a = zeros_like(arr, shape = (4,2), order = 'F',dtype=complex)
return a[0,0]
f1_shape = epyccel(create_zeros_like_1_shape, language = language)
f1_val = epyccel(create_zeros_like_1_val, language = language)
assert( f1_shape() == create_zeros_like_1_shape() )
assert( f1_val() == create_zeros_like_1_val() )
assert matching_types(f1_val(), create_zeros_like_1_val())
f2_shape = epyccel(create_zeros_like_2_shape, language = language)
f2_val = epyccel(create_zeros_like_2_val, language = language)
assert( f2_shape() == create_zeros_like_2_shape() )
assert(isclose( f2_val() , create_zeros_like_2_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f2_val(), create_zeros_like_2_val())
f3_shape = epyccel(create_zeros_like_3_shape, language = language)
f3_val = epyccel(create_zeros_like_3_val, language = language)
assert( f3_shape() == create_zeros_like_3_shape() )
assert(isclose( f3_val() , create_zeros_like_3_val() , rtol=RTOL, atol=ATOL))
assert matching_types(f3_val(), create_zeros_like_3_val())
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = pytest.mark.c),
pytest.param("python", marks = [
pytest.mark.skip(reason=("real handles types in __new__ so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
def test_numpy_real_scalar(language):
@types('bool')
@types('int')
@types('int8')
@types('int16')
@types('int32')
@types('int64')
@types('float')
@types('float32')
@types('float64')
@types('complex64')
@types('complex128')
def get_real(a):
from numpy import real
b = real(a)
return b
integer8 = randint(min_int8, max_int8, dtype=np.int8)
integer16 = randint(min_int16, max_int16, dtype=np.int16)
integer = randint(min_int, max_int, dtype=int)
integer32 = randint(min_int32, max_int32, dtype=np.int32)
integer64 = randint(min_int64, max_int64, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2)
fl32 = uniform(min_float32 / 2, max_float32 / 2)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2)
cmplx128_from_float32 = uniform(low=min_float32 / 2, high=max_float32 / 2) + uniform(low=min_float32 / 2, high=max_float32 / 2) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 2, high=max_float64 / 2) + uniform(low=min_float64 / 2, high=max_float64 / 2) * 1j
epyccel_func = epyccel(get_real, language=language)
f_bl_true_output = epyccel_func(True)
test_bool_true_output = get_real(True)
f_bl_false_output = epyccel_func(False)
test_bool_false_output = get_real(False)
assert f_bl_true_output == test_bool_true_output
assert f_bl_false_output == test_bool_false_output
assert matching_types(f_bl_true_output, test_bool_true_output)
assert matching_types(f_bl_false_output, test_bool_false_output)
f_integer_output = epyccel_func(integer)
test_int_output = get_real(integer)
assert f_integer_output == test_int_output
assert matching_types(f_integer_output, test_int_output)
f_integer8_output = epyccel_func(integer8)
test_int8_output = get_real(integer8)
assert f_integer8_output == test_int8_output
assert matching_types(f_integer8_output, test_int8_output)
f_integer16_output = epyccel_func(integer16)
test_int16_output = get_real(integer16)
assert f_integer16_output == test_int16_output
assert matching_types(f_integer16_output, test_int16_output)
f_integer32_output = epyccel_func(integer32)
test_int32_output = get_real(integer32)
assert f_integer32_output == test_int32_output
assert matching_types(f_integer32_output, test_int32_output)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
f_integer64_output = epyccel_func(integer64)
test_int64_output = get_real(integer64)
assert f_integer64_output == test_int64_output
assert matching_types(f_integer64_output, test_int64_output)
f_fl_output = epyccel_func(fl)
test_float_output = get_real(fl)
assert f_fl_output == test_float_output
assert matching_types(f_fl_output, test_float_output)
f_fl32_output = epyccel_func(fl32)
test_float32_output = get_real(fl32)
assert f_fl32_output == test_float32_output
assert matching_types(f_fl32_output, test_float32_output)
f_fl64_output = epyccel_func(fl64)
test_float64_output = get_real(fl64)
assert f_fl64_output == test_float64_output
assert matching_types(f_fl64_output, test_float64_output)
f_complex64_output = epyccel_func(cmplx64)
test_complex64_output = get_real(cmplx64)
assert f_complex64_output == test_complex64_output
assert matching_types(f_complex64_output, test_complex64_output)
f_complex128_output = epyccel_func(cmplx128)
test_complex128_output = get_real(cmplx128)
assert f_complex128_output == test_complex128_output
assert matching_types(f_complex64_output, test_complex64_output)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="See https://github.com/pyccel/pyccel/issues/794."),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.skip(reason=("real handles types in __new__ so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
def test_numpy_real_array_like_1d(language):
@types('bool[:]')
@types('int[:]')
@types('int8[:]')
@types('int16[:]')
@types('int32[:]')
@types('int64[:]')
@types('float[:]')
@types('float32[:]')
@types('float64[:]')
@types('complex64[:]')
@types('complex128[:]')
def get_real(arr):
from numpy import real, shape
a = real(arr)
s = shape(a)
return len(s), s[0], a[0]
size = 5
bl = randint(0, 1, size = size, dtype= bool)
integer8 = randint(min_int8, max_int8, size = size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size = size, dtype=np.int16)
integer = randint(min_int, max_int, size = size, dtype=int)
integer32 = randint(min_int32, max_int32, size = size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size = size, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2, size = size)
fl32 = uniform(min_float32 / 2, max_float32 / 2, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2, size = size)
cmplx128_from_float32 = uniform(low=min_float32 / 2, high=max_float32 / 2, size = size) + uniform(low=min_float32 / 2, high=max_float32 / 2, size = size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 2, high=max_float64 / 2, size = size) + uniform(low=min_float64 / 2, high=max_float64 / 2, size = size) * 1j
epyccel_func = epyccel(get_real, language=language)
assert epyccel_func(bl) == get_real(bl)
assert epyccel_func(integer8) == get_real(integer8)
assert epyccel_func(integer16) == get_real(integer16)
assert epyccel_func(integer) == get_real(integer)
assert epyccel_func(integer32) == get_real(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_real(integer64)
assert epyccel_func(fl) == get_real(fl)
assert epyccel_func(fl32) == get_real(fl32)
assert epyccel_func(fl64) == get_real(fl64)
assert epyccel_func(cmplx64) == get_real(cmplx64)
assert epyccel_func(cmplx128) == get_real(cmplx128)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = [
pytest.mark.skip(reason="See https://github.com/pyccel/pyccel/issues/794."),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.skip(reason=("real handles types in __new__ so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
def test_numpy_real_array_like_2d(language):
@types('bool[:,:]')
@types('int[:,:]')
@types('int8[:,:]')
@types('int16[:,:]')
@types('int32[:,:]')
@types('int64[:,:]')
@types('float[:,:]')
@types('float32[:,:]')
@types('float64[:,:]')
@types('complex64[:,:]')
@types('complex128[:,:]')
def get_real(arr):
from numpy import real, shape
a = real(arr)
s = shape(a)
return len(s), s[0], s[1], a[0,1], a[1,0]
size = (2, 5)
bl = randint(0, 1, size = size, dtype= bool)
integer8 = randint(min_int8, max_int8, size = size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size = size, dtype=np.int16)
integer = randint(min_int, max_int, size = size, dtype=int)
integer32 = randint(min_int32, max_int32, size = size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size = size, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2, size = size)
fl32 = uniform(min_float32 / 2, max_float32 / 2, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2, size=size)
cmplx128_from_float32 = uniform(low=min_float32 / 2, high=max_float32 / 2, size = size) + uniform(low=min_float32 / 2, high=max_float32 / 2, size = size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 2, high=max_float64 / 2, size = size) + uniform(low=min_float64 / 2, high=max_float64 / 2, size = size) * 1j
epyccel_func = epyccel(get_real, language=language)
assert epyccel_func(bl) == get_real(bl)
assert epyccel_func(integer8) == get_real(integer8)
assert epyccel_func(integer16) == get_real(integer16)
assert epyccel_func(integer) == get_real(integer)
assert epyccel_func(integer32) == get_real(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_real(integer64)
assert epyccel_func(fl) == get_real(fl)
assert epyccel_func(fl32) == get_real(fl32)
assert epyccel_func(fl64) == get_real(fl64)
assert epyccel_func(cmplx64) == get_real(cmplx64)
assert epyccel_func(cmplx128) == get_real(cmplx128)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = pytest.mark.c),
pytest.param("python", marks = [
pytest.mark.skip(reason=("imag handles types in __new__ so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
def test_numpy_imag_scalar(language):
@types('bool')
@types('int')
@types('int8')
@types('int16')
@types('int32')
@types('int64')
@types('float')
@types('float32')
@types('float64')
@types('complex64')
@types('complex128')
def get_imag(a):
from numpy import imag
b = imag(a)
return b
integer8 = randint(min_int8, max_int8, dtype=np.int8)
integer16 = randint(min_int16, max_int16, dtype=np.int16)
integer = randint(min_int, max_int, dtype=int)
integer32 = randint(min_int32, max_int32, dtype=np.int32)
integer64 = randint(min_int64, max_int64, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2)
fl32 = uniform(min_float32 / 2, max_float32 / 2)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2)
cmplx128_from_float32 = uniform(low=min_float32 / 2, high=max_float32 / 2) + uniform(low=min_float32 / 2, high=max_float32 / 2) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 2, high=max_float64 / 2) + uniform(low=min_float64 / 2, high=max_float64 / 2) * 1j
epyccel_func = epyccel(get_imag, language=language)
f_bl_true_output = epyccel_func(True)
test_bool_true_output = get_imag(True)
f_bl_false_output = epyccel_func(False)
test_bool_false_output = get_imag(False)
assert f_bl_true_output == test_bool_true_output
assert f_bl_false_output == test_bool_false_output
assert matching_types(f_bl_true_output, test_bool_true_output)
assert matching_types(f_bl_false_output, test_bool_false_output)
f_integer_output = epyccel_func(integer)
test_int_output = get_imag(integer)
assert f_integer_output == test_int_output
assert matching_types(f_integer_output, test_int_output)
f_integer8_output = epyccel_func(integer8)
test_int8_output = get_imag(integer8)
assert f_integer8_output == test_int8_output
assert matching_types(f_integer8_output, test_int8_output)
f_integer16_output = epyccel_func(integer16)
test_int16_output = get_imag(integer16)
assert f_integer16_output == test_int16_output
assert matching_types(f_integer16_output, test_int16_output)
f_integer32_output = epyccel_func(integer32)
test_int32_output = get_imag(integer32)
assert f_integer32_output == test_int32_output
assert matching_types(f_integer32_output, test_int32_output)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
f_integer64_output = epyccel_func(integer64)
test_int64_output = get_imag(integer64)
assert f_integer64_output == test_int64_output
assert matching_types(f_integer64_output, test_int64_output)
f_fl_output = epyccel_func(fl)
test_float_output = get_imag(fl)
assert f_fl_output == test_float_output
assert matching_types(f_fl_output, test_float_output)
f_fl32_output = epyccel_func(fl32)
test_float32_output = get_imag(fl32)
assert f_fl32_output == test_float32_output
assert matching_types(f_fl32_output, test_float32_output)
f_fl64_output = epyccel_func(fl64)
test_float64_output = get_imag(fl64)
assert f_fl64_output == test_float64_output
assert matching_types(f_fl64_output, test_float64_output)
f_complex64_output = epyccel_func(cmplx64)
test_complex64_output = get_imag(cmplx64)
assert f_complex64_output == test_complex64_output
assert matching_types(f_complex64_output, test_complex64_output)
f_complex128_output = epyccel_func(cmplx128)
test_complex128_output = get_imag(cmplx128)
assert f_complex128_output == test_complex128_output
assert matching_types(f_complex64_output, test_complex64_output)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = pytest.mark.c),
pytest.param("python", marks = [
pytest.mark.skip(reason=("imag handles types in __new__ so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
def test_numpy_imag_array_like_1d(language):
@types('bool[:]')
@types('int[:]')
@types('int8[:]')
@types('int16[:]')
@types('int32[:]')
@types('int64[:]')
@types('float[:]')
@types('float32[:]')
@types('float64[:]')
@types('complex64[:]')
@types('complex128[:]')
def get_imag(arr):
from numpy import imag, shape
a = imag(arr)
s = shape(a)
return len(s), s[0], a[0]
size = 5
bl = randint(0, 1, size = size, dtype= bool)
integer8 = randint(min_int8, max_int8, size = size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size = size, dtype=np.int16)
integer = randint(min_int, max_int, size = size, dtype=int)
integer32 = randint(min_int32, max_int32, size = size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size = size, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2, size = size)
fl32 = uniform(min_float32 / 2, max_float32 / 2, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2, size=size)
cmplx128_from_float32 = uniform(low=min_float32 / 2, high=max_float32 / 2, size = size) + uniform(low=min_float32 / 2, high=max_float32 / 2, size = size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 2, high=max_float64 / 2, size = size) + uniform(low=min_float64 / 2, high=max_float64 / 2, size = size) * 1j
epyccel_func = epyccel(get_imag, language=language)
assert epyccel_func(bl) == get_imag(bl)
assert epyccel_func(integer8) == get_imag(integer8)
assert epyccel_func(integer16) == get_imag(integer16)
assert epyccel_func(integer) == get_imag(integer)
assert epyccel_func(integer32) == get_imag(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_imag(integer64)
assert epyccel_func(fl) == get_imag(fl)
assert epyccel_func(fl32) == get_imag(fl32)
assert epyccel_func(fl64) == get_imag(fl64)
assert epyccel_func(cmplx64) == get_imag(cmplx64)
assert epyccel_func(cmplx128) == get_imag(cmplx128)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = pytest.mark.c),
pytest.param("python", marks = [
pytest.mark.skip(reason=("imag handles types in __new__ so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
def test_numpy_imag_array_like_2d(language):
@types('bool[:,:]')
@types('int[:,:]')
@types('int8[:,:]')
@types('int16[:,:]')
@types('int32[:,:]')
@types('int64[:,:]')
@types('float[:,:]')
@types('float32[:,:]')
@types('float64[:,:]')
@types('complex64[:,:]')
@types('complex128[:,:]')
def get_imag(arr):
from numpy import imag, shape
a = imag(arr)
s = shape(a)
return len(s), s[0], s[1], a[0,1], a[1,0]
size = (2, 5)
bl = randint(0, 1, size = size, dtype= bool)
integer8 = randint(min_int8, max_int8, size = size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size = size, dtype=np.int16)
integer = randint(min_int, max_int, size = size, dtype=int)
integer32 = randint(min_int32, max_int32, size = size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size = size, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2, size = size)
fl32 = uniform(min_float32 / 2, max_float32 / 2, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2, size=size)
cmplx128_from_float32 = uniform(low=min_float32 / 2, high=max_float32 / 2, size = size) + uniform(low=min_float32 / 2, high=max_float32 / 2, size = size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 2, high=max_float64 / 2, size = size) + uniform(low=min_float64 / 2, high=max_float64 / 2, size = size) * 1j
epyccel_func = epyccel(get_imag, language=language)
assert epyccel_func(bl) == get_imag(bl)
assert epyccel_func(integer8) == get_imag(integer8)
assert epyccel_func(integer16) == get_imag(integer16)
assert epyccel_func(integer) == get_imag(integer)
assert epyccel_func(integer32) == get_imag(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_imag(integer64)
assert epyccel_func(fl) == get_imag(fl)
assert epyccel_func(fl32) == get_imag(fl32)
assert epyccel_func(fl64) == get_imag(fl64)
assert epyccel_func(cmplx64) == get_imag(cmplx64)
assert epyccel_func(cmplx128) == get_imag(cmplx128)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = pytest.mark.fortran),
pytest.param("c", marks = pytest.mark.c),
pytest.param("python", marks = [
pytest.mark.skip(reason=("mod has special treatment for bool so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
# Not all the arguments supported
def test_numpy_mod_scalar(language):
@types('bool')
@types('int')
@types('int8')
@types('int16')
@types('int32')
@types('int64')
@types('float')
@types('float32')
@types('float64')
def get_mod(a):
from numpy import mod
b = mod(a, a)
return b
epyccel_func = epyccel(get_mod, language=language)
f_bl_true_output = epyccel_func(True)
test_bool_true_output = get_mod(True)
assert f_bl_true_output == test_bool_true_output
assert matching_types(f_bl_true_output, test_bool_true_output)
def test_int(min_int, max_int, dtype):
integer = randint(min_int, max_int, dtype=dtype) or 1
f_integer_output = epyccel_func(integer)
test_int_output = get_mod(integer)
assert f_integer_output == test_int_output
assert matching_types(f_integer_output, test_int_output)
test_int(min_int8 , max_int8 , np.int8)
test_int(min_int16, max_int16, np.int16)
test_int(min_int , max_int , int)
test_int(min_int32, max_int32, np.int32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
test_int(min_int64, max_int64, np.int64)
fl = uniform(min_float / 2, max_float / 2)
fl32 = uniform(min_float32 / 2, max_float32 / 2)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2)
f_fl_output = epyccel_func(fl)
test_float_output = get_mod(fl)
assert f_fl_output == test_float_output
assert matching_types(f_fl_output, test_float_output)
f_fl32_output = epyccel_func(fl32)
test_float32_output = get_mod(fl32)
assert f_fl32_output == test_float32_output
assert matching_types(f_fl32_output, test_float32_output)
f_fl64_output = epyccel_func(fl64)
test_float64_output = get_mod(fl64)
assert f_fl64_output == test_float64_output
assert matching_types(f_fl64_output, test_float64_output)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = pytest.mark.c),
pytest.param("python", marks = [
pytest.mark.skip(reason=("mod has special treatment for bool so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
def test_numpy_mod_array_like_1d(language):
@types('bool[:]')
@types('int[:]')
@types('int8[:]')
@types('int16[:]')
@types('int32[:]')
@types('int64[:]')
@types('float[:]')
@types('float32[:]')
@types('float64[:]')
def get_mod(arr):
from numpy import mod, shape
a = mod(arr, arr)
s = shape(a)
return len(s), s[0], a[0]
size = 5
epyccel_func = epyccel(get_mod, language=language)
bl = np.full(size, True, dtype= bool)
assert epyccel_func(bl) == get_mod(bl)
def test_int(min_int, max_int, dtype):
integer = randint(min_int, max_int-1, size=size, dtype=dtype)
integer = np.where(integer==0, 1, integer)
assert epyccel_func(integer) == get_mod(integer)
test_int(min_int8 , max_int8 , np.int8)
test_int(min_int16, max_int16, np.int16)
test_int(min_int , max_int , int)
test_int(min_int32, max_int32, np.int32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
test_int(min_int64, max_int64, np.int64)
fl = uniform(min_float / 2, max_float / 2, size = size)
fl32 = uniform(min_float32 / 2, max_float32 / 2, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2, size = size)
assert epyccel_func(fl) == get_mod(fl)
assert epyccel_func(fl32) == get_mod(fl32)
assert epyccel_func(fl64) == get_mod(fl64)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = pytest.mark.c),
pytest.param("python", marks = [
pytest.mark.skip(reason=("mod has special treatment for bool so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
def test_numpy_mod_array_like_2d(language):
@types('bool[:,:]')
@types('int[:,:]')
@types('int8[:,:]')
@types('int16[:,:]')
@types('int32[:,:]')
@types('int64[:,:]')
@types('float[:,:]')
@types('float32[:,:]')
@types('float64[:,:]')
def get_mod(arr):
from numpy import mod, shape
a = mod(arr, arr)
s = shape(a)
return len(s), s[0], s[1], a[0,1], a[1,0]
size = (2, 5)
epyccel_func = epyccel(get_mod, language=language)
bl = np.full(size, True, dtype= bool)
assert epyccel_func(bl) == get_mod(bl)
def test_int(min_int, max_int, dtype):
integer = randint(min_int, max_int-1, size=size, dtype=dtype)
integer = np.where(integer==0, 1, integer)
assert epyccel_func(integer) == get_mod(integer)
test_int(min_int8 , max_int8 , np.int8)
test_int(min_int16, max_int16, np.int16)
test_int(min_int , max_int , int)
test_int(min_int32, max_int32, np.int32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
test_int(min_int64, max_int64, np.int64)
fl = uniform(min_float / 2, max_float / 2, size = size)
fl32 = uniform(min_float32 / 2, max_float32 / 2, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2, size = size)
assert epyccel_func(fl) == get_mod(fl)
assert epyccel_func(fl32) == get_mod(fl32)
assert epyccel_func(fl64) == get_mod(fl64)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Needs a C printer see https://github.com/pyccel/pyccel/issues/791"),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.skip(reason=("prod handles types in __new__ so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
# Not all arguments are supported
def test_numpy_prod_scalar(language):
@types('bool')
@types('int')
@types('int8')
@types('int16')
@types('int32')
@types('int64')
@types('float')
@types('float32')
@types('float64')
@types('complex64')
@types('complex128')
def get_prod(a):
from numpy import prod
b = prod(a)
return b
integer8 = randint(min_int8, max_int8, dtype=np.int8)
integer16 = randint(min_int16, max_int16, dtype=np.int16)
integer = randint(min_int, max_int, dtype=int)
integer32 = randint(min_int32, max_int32, dtype=np.int32)
integer64 = randint(min_int64, max_int64, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2)
fl32 = uniform(min_float32 / 2, max_float32 / 2)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2)
cmplx128_from_float32 = uniform(low=min_float32 / 2, high=max_float32 / 2) + uniform(low=min_float32 / 2, high=max_float32 / 2) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 2, high=max_float64 / 2) + uniform(low=min_float64 / 2, high=max_float64 / 2) * 1j
epyccel_func = epyccel(get_prod, language=language)
f_bl_true_output = epyccel_func(True)
test_bool_true_output = get_prod(True)
f_bl_false_output = epyccel_func(False)
test_bool_false_output = get_prod(False)
assert f_bl_true_output == test_bool_true_output
assert f_bl_false_output == test_bool_false_output
assert matching_types(f_bl_true_output, test_bool_true_output)
assert matching_types(f_bl_false_output, test_bool_false_output)
f_integer_output = epyccel_func(integer)
test_int_output = get_prod(integer)
assert f_integer_output == test_int_output
assert matching_types(f_integer_output, test_int_output)
f_integer8_output = epyccel_func(integer8)
test_int8_output = get_prod(integer8)
assert f_integer8_output == test_int8_output
assert matching_types(f_integer8_output, test_int8_output)
f_integer16_output = epyccel_func(integer16)
test_int16_output = get_prod(integer16)
assert f_integer16_output == test_int16_output
assert matching_types(f_integer16_output, test_int16_output)
f_integer32_output = epyccel_func(integer32)
test_int32_output = get_prod(integer32)
assert f_integer32_output == test_int32_output
assert matching_types(f_integer32_output, test_int32_output)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
f_integer64_output = epyccel_func(integer64)
test_int64_output = get_prod(integer64)
assert f_integer64_output == test_int64_output
assert matching_types(f_integer64_output, test_int64_output)
f_fl_output = epyccel_func(fl)
test_float_output = get_prod(fl)
assert f_fl_output == test_float_output
assert matching_types(f_fl_output, test_float_output)
f_fl32_output = epyccel_func(fl32)
test_float32_output = get_prod(fl32)
assert f_fl32_output == test_float32_output
assert matching_types(f_fl32_output, test_float32_output)
f_fl64_output = epyccel_func(fl64)
test_float64_output = get_prod(fl64)
assert f_fl64_output == test_float64_output
assert matching_types(f_fl64_output, test_float64_output)
f_complex64_output = get_prod(cmplx64)
test_complex64_output = get_prod(cmplx64)
assert f_complex64_output == test_complex64_output
assert matching_types(f_complex64_output, test_complex64_output)
f_complex128_output = get_prod(cmplx128)
test_complex128_output = get_prod(cmplx128)
assert f_complex128_output == test_complex128_output
assert matching_types(f_complex64_output, test_complex64_output)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Needs a C printer see https://github.com/pyccel/pyccel/issues/791"),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.skip(reason=("prod handles types in __new__ so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
def test_numpy_prod_array_like_1d(language):
@types('bool[:]')
@types('int[:]')
@types('int8[:]')
@types('int16[:]')
@types('int32[:]')
@types('int64[:]')
@types('float[:]')
@types('float32[:]')
@types('float64[:]')
@types('complex64[:]')
@types('complex128[:]')
def get_prod(arr):
from numpy import prod
a = prod(arr)
return a
size = 5
bl = randint(0, 1, size = size, dtype= bool)
integer8 = randint(min_int8, max_int8, size = size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size = size, dtype=np.int16)
integer = randint(min_int, max_int, size = size, dtype=int)
integer32 = randint(min_int32, max_int32, size = size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size = size, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2, size = size)
fl32 = uniform(min_float32 / 2, max_float32 / 2, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2, size=size)
cmplx128_from_float32 = uniform(low=-((-min_float32) ** (1/5)), high=(max_float32 ** (1/5)), size = size) + uniform(low=-((-min_float32) ** (1/5)), high=(max_float32 ** (1/5)), size = size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=-((-min_float64) ** (1/5)), high=(max_float64 ** (1/5)), size = size) + uniform(low=-((-min_float64) ** (1/5)), high=(max_float64 ** (1/5)), size = size) * 1j
epyccel_func = epyccel(get_prod, language=language)
assert epyccel_func(bl) == get_prod(bl)
assert epyccel_func(integer8) == get_prod(integer8)
assert epyccel_func(integer16) == get_prod(integer16)
assert epyccel_func(integer) == get_prod(integer)
assert epyccel_func(integer32) == get_prod(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_prod(integer64)
assert epyccel_func(fl) == get_prod(fl)
assert epyccel_func(fl32) == get_prod(fl32)
assert epyccel_func(fl64) == get_prod(fl64)
assert (epyccel_func(cmplx64) == get_prod(cmplx64))
assert (epyccel_func(cmplx128) == get_prod(cmplx128))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Needs a C printer see https://github.com/pyccel/pyccel/issues/791"),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.skip(reason=("prod handles types in __new__ so it "
"cannot be used in a translated interface in python")),
pytest.mark.python]
)
)
)
def test_numpy_prod_array_like_2d(language):
@types('bool[:,:]')
@types('int[:,:]')
@types('int8[:,:]')
@types('int16[:,:]')
@types('int32[:,:]')
@types('int64[:,:]')
@types('float[:,:]')
@types('float32[:,:]')
@types('float64[:,:]')
@types('complex64[:,:]')
@types('complex128[:,:]')
def get_prod(arr):
from numpy import prod
a = prod(arr)
return a
size = (2, 5)
bl = randint(0, 1, size = size, dtype= bool)
integer8 = randint(min_int8, max_int8, size = size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size = size, dtype=np.int16)
integer = randint(min_int, max_int, size = size, dtype=int)
integer32 = randint(min_int32, max_int32, size = size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size = size, dtype=np.int64)
fl = uniform(min_float / 10, max_float / 10, size = size)
fl32 = uniform(min_float32 / 10, max_float32 / 10, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 10, max_float64 / 10, size=size)
cmplx128_from_float32 = uniform(low=-((-min_float32) ** (1/10)), high=(max_float32 ** (1/10)), size = size) + uniform(low=-((-min_float32) ** (1/10)), high=(max_float32 ** (1/10)), size = size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=-((-min_float64) ** (1/10)), high=(max_float64 ** (1/10)), size = size) + uniform(low=-((-min_float64) ** (1/10)), high=(max_float64 ** (1/10)), size = size) * 1j
epyccel_func = epyccel(get_prod, language=language)
assert epyccel_func(bl) == get_prod(bl)
assert epyccel_func(integer8) == get_prod(integer8)
assert epyccel_func(integer16) == get_prod(integer16)
assert epyccel_func(integer) == get_prod(integer)
assert epyccel_func(integer32) == get_prod(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_prod(integer64)
assert epyccel_func(fl) == get_prod(fl)
assert epyccel_func(fl32) == get_prod(fl32)
assert epyccel_func(fl64) == get_prod(fl64)
assert (epyccel_func(cmplx64) == get_prod(cmplx64))
assert (epyccel_func(cmplx128) == get_prod(cmplx128))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Still under maintenance, See #769"),
pytest.mark.c]
),
pytest.param("python", marks = [pytest.mark.python])
)
)
def test_numpy_norm_scalar(language):
@types('bool')
@types('int')
@types('int8')
@types('int16')
@types('int32')
@types('int64')
@types('float')
@types('float32')
@types('float64')
@types('complex64')
@types('complex128')
def get_norm(a):
from numpy.linalg import norm
b = norm(a)
return b
integer8 = randint(min_int8, max_int8, dtype=np.int8)
integer16 = randint(min_int16, max_int16, dtype=np.int16)
integer = randint(min_int, max_int, dtype=int)
integer32 = randint(min_int32, max_int32, dtype=np.int32)
integer64 = randint(min_int64, max_int64, dtype=np.int64)
fl = uniform(low=-(abs(min_float)**(1/2)), high=abs(max_float)**(1/2))
fl32 = uniform(low=-(abs(min_float32)**(1/2)), high=abs(max_float32)**(1/2))
fl32 = np.float32(fl32)
fl64 = uniform(low=-(abs(min_float64)**(1/2)), high=abs(max_float64)**(1/2))
cmplx128_from_float32 = uniform(low=-((abs(min_float32) / 2)**(1/2)), high=((abs(max_float32) / 2)**(1/2))) + \
uniform(low=-((abs(max_float32) / 2)**(1/2)), high=((abs(max_float32) / 2)**(1/2))) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=-((abs(min_float32) / 2)**(1/2)), high=(abs(max_float64) / 2)**(1/2)) + \
uniform(low=-((abs(min_float64) / 2)**(1/2)), high=(abs(max_float64) / 2)**(1/2)) * 1j
epyccel_func = epyccel(get_norm, language=language)
f_bl_true_output = epyccel_func(True)
test_bool_true_output = get_norm(True)
f_bl_false_output = epyccel_func(False)
test_bool_false_output = get_norm(False)
assert f_bl_true_output == test_bool_true_output
assert f_bl_false_output == test_bool_false_output
assert matching_types(f_bl_false_output, test_bool_false_output)
assert matching_types(f_bl_true_output, test_bool_true_output)
f_integer_output = epyccel_func(integer)
test_int_output = get_norm(integer)
assert np.isclose(f_integer_output, test_int_output, rtol=RTOL, atol=ATOL)
assert matching_types(f_integer_output, test_int_output)
f_integer8_output = epyccel_func(integer8)
test_int8_output = get_norm(integer8)
assert np.isclose(f_integer8_output, test_int8_output, rtol=RTOL, atol=ATOL)
assert matching_types(f_integer8_output, test_int8_output)
f_integer16_output = epyccel_func(integer16)
test_int16_output = get_norm(integer16)
assert np.isclose(f_integer16_output, test_int16_output, rtol=RTOL, atol=ATOL)
assert matching_types(f_integer16_output, test_int16_output)
f_integer32_output = epyccel_func(integer32)
test_int32_output = get_norm(integer32)
assert np.isclose(f_integer32_output, test_int32_output, rtol=RTOL, atol=ATOL)
assert matching_types(f_integer32_output, test_int32_output)
f_integer64_output = epyccel_func(integer64)
test_int64_output = get_norm(integer64)
assert np.isclose(f_integer64_output, test_int64_output, rtol=RTOL, atol=ATOL)
assert matching_types(f_integer64_output, test_int64_output)
f_fl_output = epyccel_func(fl)
test_float_output = get_norm(fl)
assert np.isclose(f_fl_output, test_float_output, rtol=RTOL, atol=ATOL)
assert matching_types(f_fl_output, test_float_output)
f_fl32_output = epyccel_func(fl32)
test_float32_output = get_norm(fl32)
assert np.isclose(f_fl32_output, test_float32_output, rtol=RTOL32, atol=ATOL32)
assert matching_types(f_fl32_output, test_float32_output)
f_fl64_output = epyccel_func(fl64)
test_float64_output = get_norm(fl64)
assert np.isclose(f_fl64_output, test_float64_output, rtol=RTOL, atol=ATOL)
assert matching_types(f_fl64_output, test_float64_output)
f_complex64_output = epyccel_func(cmplx64)
test_complex64_output = get_norm(cmplx64)
assert np.isclose(f_complex64_output, test_complex64_output, rtol=RTOL32, atol=ATOL32)
assert matching_types(f_complex64_output, test_complex64_output)
f_complex128_output = epyccel_func(cmplx128)
test_complex128_output = get_norm(cmplx128)
assert np.isclose(f_complex128_output, test_complex128_output, rtol=RTOL, atol=ATOL)
assert matching_types(f_complex128_output, test_complex128_output)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Still under maintenance, See #769"),
pytest.mark.c]
),
pytest.param("python", marks = [pytest.mark.python])
)
)
def test_numpy_norm_array_like_1d(language):
@types('bool[:]')
@types('int[:]')
@types('int8[:]')
@types('int16[:]')
@types('int32[:]')
@types('int64[:]')
@types('float[:]')
@types('float32[:]')
@types('float64[:]')
@types('complex64[:]')
@types('complex128[:]')
def get_norm(arr):
from numpy.linalg import norm
a = norm(arr)
return a
size = 5
bl = randint(0, 1, size=size, dtype= bool)
integer8 = randint(min_int8, max_int8, size=size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size=size, dtype=np.int16)
integer = randint(min_int, max_int, size=size, dtype=int)
integer32 = randint(min_int32, max_int32, size=size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size=size, dtype=np.int64)
fl = uniform(low=-((abs(min_float) / size)**(1/2)), high=(abs(max_float) / size)**(1/2), size=size)
fl32 = uniform(low=-((abs(min_float32) / size)**(1/2)), high=(abs(max_float32) / size)**(1/2), size=size)
fl32 = np.float32(fl32)
fl64 = uniform(low=-((abs(min_float64) / size)**(1/2)), high=(abs(max_float64) / size)**(1/2), size=size)
cmplx128_from_float32 = uniform(low=-((abs(min_float32) / (size * 2))**(1/2)), high=(abs(max_float32) / (size * 2))**(1/2), size=size) + \
uniform(low=-((abs(min_float32) / (size * 2))**(1/2)), high=(abs(max_float32) / (size * 2))**(1/2), size=size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=-((abs(min_float64) / (size * 2))**(1/2)), high=(abs(max_float64) / (size * 2))**(1/2), size=size) + \
uniform(low=-((abs(min_float64) / (size * 2))**(1/2)), high=(abs(max_float64) / (size * 2))**(1/2), size=size) * 1j
epyccel_func = epyccel(get_norm, language=language)
assert np.isclose(epyccel_func(bl), get_norm(bl), rtol=RTOL, atol=ATOL)
assert np.isclose(epyccel_func(integer8), get_norm(integer8), rtol=RTOL, atol=ATOL)
assert np.isclose(epyccel_func(integer16), get_norm(integer16), rtol=RTOL, atol=ATOL)
assert np.isclose(epyccel_func(integer), get_norm(integer), rtol=RTOL, atol=ATOL)
assert np.isclose(epyccel_func(integer32), get_norm(integer32), rtol=RTOL, atol=ATOL)
assert np.isclose(epyccel_func(integer64), get_norm(integer64), rtol=RTOL, atol=ATOL)
assert np.isclose(epyccel_func(fl), get_norm(fl), rtol=RTOL, atol=ATOL)
assert np.isclose(epyccel_func(fl32), get_norm(fl32), rtol=RTOL32, atol=ATOL32)
assert np.isclose(epyccel_func(fl64), get_norm(fl64), rtol=RTOL, atol=ATOL)
assert np.isclose(epyccel_func(cmplx64), get_norm(cmplx64), rtol=RTOL32, atol=ATOL32)
assert np.isclose(epyccel_func(cmplx128), get_norm(cmplx128), rtol=RTOL, atol=ATOL)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Still under maintenance, See #769"),
pytest.mark.c]
),
pytest.param("python", marks = [pytest.mark.python])
)
)
def test_numpy_norm_array_like_2d(language):
@types('bool[:,:]')
@types('int[:,:]')
@types('int8[:,:]')
@types('int16[:,:]')
@types('int32[:,:]')
@types('int64[:,:]')
@types('float[:,:]')
@types('float32[:,:]')
@types('float64[:,:]')
@types('complex64[:,:]')
@types('complex128[:,:]')
def get_norm(arr):
from numpy.linalg import norm
from numpy import shape
a = norm(arr)
return a
size = (2, 5)
bl = randint(0, 1, size=size, dtype= bool)
integer8 = randint(min_int8, max_int8, size=size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size=size, dtype=np.int16)
integer = randint(min_int, max_int, size=size, dtype=int)
integer32 = randint(min_int32, max_int32, size=size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size=size, dtype=np.int64)
fl = uniform(low=-((abs(min_float) / (size[0] * size[1]))**(1/2)), high=(abs(max_float) / (size[0] * size[1]))**(1/2), size=size)
fl32 = uniform(low=-((abs(min_float32) / (size[0] * size[1]))**(1/2)), high=(abs(max_float32) / (size[0] * size[1]))**(1/2), size=size)
fl32 = np.float32(fl32)
fl64 = uniform(low=-((abs(min_float64) / (size[0] * size[1]))**(1/2)), high=(abs(max_float64) / (size[0] * size[1]))**(1/2), size=size)
cmplx128_from_float32 = uniform(low=-((abs(min_float32) / (size[0] * size[1] * 2))**(1/2)), high=(abs(max_float32) / (size[0] * size[1] * 2))**(1/2), size=size) + \
uniform(low=-((abs(min_float32) / (size[0] * size[1] * 2))**(1/2)), high=(abs(max_float32) / (size[0] * size[1] * 2))**(1/2), size=size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=-((abs(min_float64) / (size[0] * size[1] * 2))**(1/2)), high=(abs(max_float64) / (size[0] * size[1] * 2))**(1/2), size=size) + \
uniform(low=-((abs(min_float64) / (size[0] * size[1] * 2))**(1/2)), high=(abs(max_float64) / (size[0] * size[1] * 2))**(1/2), size=size) * 1j
epyccel_func = epyccel(get_norm, language=language)
assert np.allclose(epyccel_func(bl), get_norm(bl), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer8), get_norm(integer8), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer16), get_norm(integer16), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer), get_norm(integer), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer32), get_norm(integer32), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer64), get_norm(integer64), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(fl), get_norm(fl), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(fl32), get_norm(fl32), rtol=RTOL32, atol=ATOL32)
assert np.allclose(epyccel_func(fl64), get_norm(fl64), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(cmplx64), get_norm(cmplx64), rtol=RTOL32, atol=ATOL32)
assert np.allclose(epyccel_func(cmplx128), get_norm(cmplx128), rtol=RTOL, atol=ATOL)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Still under maintenance, See #769"),
pytest.mark.c]
),
pytest.param("python", marks = [pytest.mark.python])
)
)
def test_numpy_norm_array_like_2d_fortran_order(language):
@types('bool[:,:](order=F)')
@types('int[:,:](order=F)')
@types('int8[:,:](order=F)')
@types('int16[:,:](order=F)')
@types('int32[:,:](order=F)')
@types('int64[:,:](order=F)')
@types('float[:,:](order=F)')
@types('float32[:,:](order=F)')
@types('float64[:,:](order=F)')
@types('complex64[:,:](order=F)')
@types('complex128[:,:](order=F)')
def get_norm(arr):
from numpy.linalg import norm
from numpy import shape
a = norm(arr, axis=0)
b = norm(arr, axis=1)
sa = shape(a)
sb = shape(b)
return len(sb), sb[0],len(sa), sa[0], a[0], b[0]
size = (2, 5)
bl = randint(0, 1, size=size, dtype= bool)
integer8 = randint(min_int8, max_int8, size=size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size=size, dtype=np.int16)
integer = randint(min_int, max_int, size=size, dtype=int)
integer32 = randint(min_int32, max_int32, size=size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size=size, dtype=np.int64)
fl = uniform(low=-((abs(min_float) / (size[0] * size[1]))**(1/2)), high=(abs(max_float) / (size[0] * size[1]))**(1/2), size=size)
fl32 = uniform(low=-((abs(min_float32) / (size[0] * size[1]))**(1/2)), high=(abs(max_float32) / (size[0] * size[1]))**(1/2), size=size)
fl32 = np.float32(fl32)
fl64 = uniform(low=-((abs(min_float64) / (size[0] * size[1]))**(1/2)), high=(abs(max_float64) / (size[0] * size[1]))**(1/2), size=size)
cmplx128_from_float32 = uniform(low=-((abs(min_float32) / (size[0] * size[1] * 2))**(1/2)), high=(abs(max_float32) / (size[0] * size[1] * 2))**(1/2), size=size) + \
uniform(low=-((abs(min_float32) / (size[0] * size[1] * 2))**(1/2)), high=(abs(max_float32) / (size[0] * size[1] * 2))**(1/2), size=size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=-((abs(min_float64) / (size[0] * size[1] * 2))**(1/2)), high=(abs(max_float64) / (size[0] * size[1] * 2))**(1/2), size=size) + \
uniform(low=-((abs(min_float64) / (size[0] * size[1] * 2))**(1/2)), high=(abs(max_float64) / (size[0] * size[1] * 2))**(1/2), size=size) * 1j
epyccel_func = epyccel(get_norm, language=language)
#re-ordering to Fortran order
bl = np.ndarray(size, buffer=bl, order='F', dtype=bool)
integer8 = np.ndarray(size, buffer=integer8, order='F', dtype=np.int8)
integer16 = np.ndarray(size, buffer=integer16, order='F', dtype=np.int16)
integer = np.ndarray(size, buffer=integer, order='F', dtype=int)
integer32 = np.ndarray(size, buffer=integer32, order='F', dtype=np.int32)
integer64 = np.ndarray(size, buffer=integer64, order='F', dtype=np.int64)
fl = np.ndarray(size, buffer=fl, order='F', dtype=float)
fl32 = np.ndarray(size, buffer=fl32, order='F', dtype=np.float32)
fl64 = np.ndarray(size, buffer=fl64, order='F', dtype=np.float64)
cmplx64 = np.ndarray(size, buffer=cmplx64, order='F', dtype=np.complex64)
cmplx128 = np.ndarray(size, buffer=cmplx128, order='F', dtype=np.complex128)
assert np.allclose(epyccel_func(bl), get_norm(bl), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer8), get_norm(integer8), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer16), get_norm(integer16), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer), get_norm(integer), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer32), get_norm(integer32), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer64), get_norm(integer64), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(fl), get_norm(fl), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(fl32), get_norm(fl32), rtol=RTOL32, atol=ATOL32)
assert np.allclose(epyccel_func(fl64), get_norm(fl64), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(cmplx64), get_norm(cmplx64), rtol=RTOL32, atol=ATOL32)
assert np.allclose(epyccel_func(cmplx128), get_norm(cmplx128), rtol=RTOL, atol=ATOL)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Still under maintenance, See #769"),
pytest.mark.c]
),
pytest.param("python", marks = [pytest.mark.python])
)
)
def test_numpy_norm_array_like_3d(language):
@types('bool[:,:,:]')
@types('int[:,:,:]')
@types('int8[:,:,:]')
@types('int16[:,:,:]')
@types('int32[:,:,:]')
@types('int64[:,:,:]')
@types('float[:,:,:]')
@types('float32[:,:,:]')
@types('float64[:,:,:]')
@types('complex64[:,:,:]')
@types('complex128[:,:,:]')
def get_norm(arr):
from numpy.linalg import norm
a = norm(arr)
return a
size = (2, 5, 5)
bl = randint(0, 1, size=size, dtype= bool)
integer8 = randint(min_int8, max_int8, size=size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size=size, dtype=np.int16)
integer = randint(min_int, max_int, size=size, dtype=int)
integer32 = randint(min_int32, max_int32, size=size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size=size, dtype=np.int64)
fl = uniform(low=-((abs(min_float) / (size[0] * size[1] * size[2]))**(1/2)), high=(abs(max_float) / (size[0] * size[1] * size[2]))**(1/2), size=size)
fl32 = uniform(low=-((abs(min_float32) / (size[0] * size[1] * size[2]))**(1/2)), high=(abs(max_float32) / (size[0] * size[1] * size[2]))**(1/2), size=size)
fl32 = np.float32(fl32)
fl64 = uniform(low=-((abs(min_float64) / (size[0] * size[1] * size[2]))**(1/2)), high=(abs(max_float64) / (size[0] * size[1] * size[2]))**(1/2), size=size)
cmplx128_from_float32 = uniform(low=-((abs(min_float32) / (size[0] * size[1] * size[2] * 2))**(1/2)), high=(abs(max_float32) / (size[0] * size[1] * size[2] * 2))**(1/2), size=size) + \
uniform(low=-((abs(min_float32) / (size[0] * size[1] * size[2] * 2))**(1/2)), high=(abs(max_float32) / (size[0] * size[1] * size[2] * 2))**(1/2), size=size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=-((abs(min_float64) / (size[0] * size[1] * size[2] * 2))**(1/2)), high=(abs(max_float64) / (size[0] * size[1] * size[2] * 2))**(1/2), size=size) + \
uniform(low=-((abs(min_float64) / (size[0] * size[1] * size[2] * 2))**(1/2)), high=(abs(max_float64) / (size[0] * size[1] * size[2] * 2))**(1/2), size=size) * 1j
epyccel_func = epyccel(get_norm, language=language)
assert np.allclose(epyccel_func(bl), get_norm(bl), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer8), get_norm(integer8), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer16), get_norm(integer16), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer), get_norm(integer), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer32), get_norm(integer32), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer64), get_norm(integer64), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(fl), get_norm(fl), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(fl32), get_norm(fl32), rtol=RTOL32, atol=ATOL32)
assert np.allclose(epyccel_func(fl64), get_norm(fl64), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(cmplx64), get_norm(cmplx64), rtol=RTOL32, atol=ATOL32)
assert np.allclose(epyccel_func(cmplx128), get_norm(cmplx128), rtol=RTOL, atol=ATOL)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Still under maintenance, See #769"),
pytest.mark.c]
),
pytest.param("python", marks = [pytest.mark.python])
)
)
def test_numpy_norm_array_like_3d_fortran_order(language):
@types('bool[:,:,:](order=F)')
@types('int[:,:,:](order=F)')
@types('int8[:,:,:](order=F)')
@types('int16[:,:,:](order=F)')
@types('int32[:,:,:](order=F)')
@types('int64[:,:,:](order=F)')
@types('float[:,:,:](order=F)')
@types('float32[:,:,:](order=F)')
@types('float64[:,:,:](order=F)')
@types('complex64[:,:,:](order=F)')
@types('complex128[:,:,:](order=F)')
def get_norm(arr):
from numpy.linalg import norm
from numpy import shape
a = norm(arr, axis=0)
b = norm(arr, axis=1)
c = norm(arr, axis=2)
sa = shape(a)
sb = shape(b)
sc = shape(c)
return len(sc), sc[0],len(sb), sb[0],len(sa), sa[0], a[0][0], b[0][0], c[0][0]
size = (2, 5, 5)
bl = randint(0, 1, size=size, dtype= bool)
integer8 = randint(min_int8, max_int8, size=size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size=size, dtype=np.int16)
integer = randint(min_int, max_int, size=size, dtype=int)
integer32 = randint(min_int32, max_int32, size=size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size=size, dtype=np.int64)
fl = uniform(low=-((abs(min_float) / (size[0] * size[1] * size[2]))**(1/2)), high=(abs(max_float) / (size[0] * size[1] * size[2]))**(1/2), size=size)
fl32 = uniform(low=-((abs(min_float32) / (size[0] * size[1] * size[2]))**(1/2)), high=(abs(max_float32) / (size[0] * size[1] * size[2]))**(1/2), size=size)
fl32 = np.float32(fl32)
fl64 = uniform(low=-((abs(min_float64) / (size[0] * size[1] * size[2]))**(1/2)), high=(abs(max_float64) / (size[0] * size[1] * size[2]))**(1/2), size=size)
cmplx128_from_float32 = uniform(low=-((abs(min_float32) / (size[0] * size[1] * size[2] * 2))**(1/2)), high=(abs(max_float32) / (size[0] * size[1] * size[2] * 2))**(1/2), size=size) + \
uniform(low=-((abs(min_float32) / (size[0] * size[1] * size[2] * 2))**(1/2)), high=(abs(max_float32) / (size[0] * size[1] * size[2] * 2))**(1/2), size=size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=-((abs(min_float64) / (size[0] * size[1] * size[2] * 2))**(1/2)), high=(abs(max_float64) / (size[0] * size[1] * size[2] * 2))**(1/2), size=size) + \
uniform(low=-((abs(min_float64) / (size[0] * size[1] * size[2] * 2))**(1/2)), high=(abs(max_float64) / (size[0] * size[1] * size[2] * 2))**(1/2), size=size) * 1j
epyccel_func = epyccel(get_norm, language=language)
#re-ordering to Fortran order
bl = np.ndarray(size, buffer=bl, order='F', dtype=bool)
integer8 = np.ndarray(size, buffer=integer8, order='F', dtype=np.int8)
integer16 = np.ndarray(size, buffer=integer16, order='F', dtype=np.int16)
integer = np.ndarray(size, buffer=integer, order='F', dtype=int)
integer32 = np.ndarray(size, buffer=integer32, order='F', dtype=np.int32)
integer64 = np.ndarray(size, buffer=integer64, order='F', dtype=np.int64)
fl = np.ndarray(size, buffer=fl, order='F', dtype=float)
fl32 = np.ndarray(size, buffer=fl32, order='F', dtype=np.float32)
fl64 = np.ndarray(size, buffer=fl64, order='F', dtype=np.float64)
cmplx64 = np.ndarray(size, buffer=cmplx64, order='F', dtype=np.complex64)
cmplx128 = np.ndarray(size, buffer=cmplx128, order='F', dtype=np.complex128)
assert np.allclose(epyccel_func(bl), get_norm(bl), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer8), get_norm(integer8), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer16), get_norm(integer16), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer), get_norm(integer), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer32), get_norm(integer32), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer64), get_norm(integer64), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(fl), get_norm(fl), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(fl32), get_norm(fl32), rtol=RTOL32, atol=ATOL32)
assert np.allclose(epyccel_func(fl64), get_norm(fl64), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(cmplx64), get_norm(cmplx64), rtol=RTOL32, atol=ATOL32)
assert np.allclose(epyccel_func(cmplx128), get_norm(cmplx128), rtol=RTOL, atol=ATOL)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Needs a C printer see https://github.com/pyccel/pyccel/issues/791"),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.python])
)
)
def test_numpy_matmul_array_like_1d(language):
@types('bool[:]')
@types('int[:]')
@types('int8[:]')
@types('int16[:]')
@types('int32[:]')
@types('int64[:]')
@types('float[:]')
@types('float32[:]')
@types('float64[:]')
@types('complex64[:]')
@types('complex128[:]')
def get_matmul(arr):
from numpy import matmul
a = matmul(arr, arr)
return a
size = 5
bl = randint(0, 1, size=size, dtype= bool)
integer8 = randint(min_int8, max_int8, size=size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size=size, dtype=np.int16)
integer = randint(min_int, max_int, size=size, dtype=int)
integer32 = randint(min_int32, max_int32, size=size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size=size, dtype=np.int64)
fl = uniform(-((max_float / size)**(1/2)), (max_float / size)**(1/2), size = size)
fl32 = uniform(-((max_float32 / size)**(1/2)), (max_float32 / size)**(1/2), size = size)
fl32 = np.float32(fl32)
fl64 = uniform(-((max_float64 / size)**(1/2)), (max_float64 / size)**(1/2), size = size)
cmplx128_from_float32 = uniform(low=-((max_float32 / (size * 2))**(1/2)), high=(max_float32 / (size * 2))**(1/2), size=size) + uniform(low=-((max_float32 / (size * 2))**(1/2)), high=(max_float32 / (size * 2))**(1/2), size=size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=-((max_float64 / (size * 2))**(1/2)), high=(max_float64 / (size * 2))**(1/2), size=size) + uniform(low=-((max_float64 / (size * 2))**(1/2)), high=(max_float64 / (size * 2))**(1/2), size=size) * 1j
epyccel_func = epyccel(get_matmul, language=language)
assert epyccel_func(bl) == get_matmul(bl)
assert epyccel_func(integer8) == get_matmul(integer8)
assert epyccel_func(integer16) == get_matmul(integer16)
assert epyccel_func(integer) == get_matmul(integer)
assert epyccel_func(integer32) == get_matmul(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_matmul(integer64)
assert isclose(epyccel_func(fl),get_matmul(fl), rtol=RTOL, atol=ATOL)
assert isclose(epyccel_func(fl32),get_matmul(fl32), rtol=RTOL32, atol=ATOL32)
assert isclose(epyccel_func(fl64),get_matmul(fl64), rtol=RTOL, atol=ATOL)
assert isclose(epyccel_func(cmplx64),get_matmul(cmplx64), rtol=RTOL32, atol=ATOL32)
assert isclose(epyccel_func(cmplx128),get_matmul(cmplx128), rtol=RTOL, atol=ATOL)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Needs a C printer see https://github.com/pyccel/pyccel/issues/791"),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.python],
)
)
)
def test_numpy_matmul_array_like_2x2d(language):
@types('bool[:,:]')
@types('int[:,:]')
@types('int8[:,:]')
@types('int16[:,:]')
@types('int32[:,:]')
@types('int64[:,:]')
@types('float[:,:]')
@types('float32[:,:]')
@types('float64[:,:]')
@types('complex64[:,:]')
@types('complex128[:,:]')
def get_matmul(arr):
from numpy import matmul, shape
a = matmul(arr, arr)
s = shape(a)
return len(s) , s[0] , s[1] , a[0,1] , a[1,0]
size = (2, 2)
bl = randint(0, 1, size=size, dtype= bool)
integer8 = randint(min_int8, max_int8, size=size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size=size, dtype=np.int16)
integer = randint(min_int, max_int, size=size, dtype=int)
integer32 = randint(min_int32, max_int32, size=size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size=size, dtype=np.int64)
fl = uniform(-((abs(min_float) / size[0])**(1/2)), (abs(max_float) / size[0])**(1/2), size = size)
fl32 = uniform(-((abs(min_float32) / size[0])**(1/2)), (abs(max_float32) / size[0])**(1/2), size = size)
fl32 = np.float32(fl32)
fl64 = uniform(-((abs(min_float64) / size[0])**(1/2)), (abs(max_float64) / size[0])**(1/2), size = size)
cmplx128_from_float32 = uniform(low=-((abs(min_int) / size[0] * 2)**(1/2)), high=(max_int / size[0] * 2)**(1/2), size=size) + uniform(low=-((abs(min_int) / size[0] * 2)**(1/2)), high=(max_int / size[0] * 2)**(1/2), size=size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=-((abs(min_int) / size[0] * 2)**(1/2)), high=(max_int / size[0] * 2)**(1/2), size=size) + uniform(low=-((abs(min_int) / size[0] * 2)**(1/2)), high=(max_int / size[0] * 2)**(1/2), size=size) * 1j
epyccel_func = epyccel(get_matmul, language=language)
assert np.allclose(epyccel_func(bl), get_matmul(bl), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer8), get_matmul(integer8), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer16), get_matmul(integer16), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer), get_matmul(integer), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(integer32), get_matmul(integer32), rtol=RTOL, atol=ATOL)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert np.allclose(epyccel_func(integer64), get_matmul(integer64), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(fl), get_matmul(fl), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(fl32), get_matmul(fl32), rtol=RTOL32, atol=ATOL32)
assert np.allclose(epyccel_func(fl64), get_matmul(fl64), rtol=RTOL, atol=ATOL)
assert np.allclose(epyccel_func(cmplx64), get_matmul(cmplx64), rtol=RTOL32, atol=ATOL32)
assert np.allclose(epyccel_func(cmplx128), get_matmul(cmplx128), rtol=RTOL, atol=ATOL)
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran,
pytest.mark.skip(reason="Still under maintenance, See #770")]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Needs a C printer see https://github.com/pyccel/pyccel/issues/791"),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.python,
pytest.mark.skip(reason="Outdated Python printer")]
)
)
)
def test_numpy_where_array_like_1d_with_condition(language):
@types('bool[:]')
@types('int[:]')
@types('int8[:]')
@types('int16[:]')
@types('int32[:]')
@types('int64[:]')
@types('float[:]')
@types('float32[:]')
@types('float64[:]')
@types('complex64[:]')
@types('complex128[:]')
def get_chosen_elements(arr):
from numpy import where, shape
a = where(arr > 5, arr, arr*2)
s = shape(a)
return len(s), s[0], a[1], a[0]
size = 5
bl = randint(0, 1, size=size, dtype= bool)
integer8 = randint(min_int8, max_int8, size=size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size=size, dtype=np.int16)
integer = randint(min_int, max_int, size=size, dtype=int)
integer32 = randint(min_int32, max_int32, size=size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size=size, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2, size = size)
fl32 = uniform(min_float32 / 2, max_float32 / 2, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2, size = size)
cmplx128_from_float32 = uniform(low=min_float32 / 2, high=max_float32 / 2, size=size) + uniform(low=min_float32 / 2, high=max_float32 / 2, size=size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 2, high=max_float64 / 2, size=size) + uniform(low=min_float64 / 2, high=max_float64 / 2, size=size) * 1j
epyccel_func = epyccel(get_chosen_elements, language=language)
assert epyccel_func(bl) == get_chosen_elements(bl)
assert epyccel_func(integer8) == get_chosen_elements(integer8)
assert epyccel_func(integer16) == get_chosen_elements(integer16)
assert epyccel_func(integer) == get_chosen_elements(integer)
assert epyccel_func(integer32) == get_chosen_elements(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_chosen_elements(integer64)
assert epyccel_func(fl) == get_chosen_elements(fl)
assert epyccel_func(fl32) == get_chosen_elements(fl32)
assert epyccel_func(fl64) == get_chosen_elements(fl64)
assert (epyccel_func(cmplx64) == get_chosen_elements(cmplx64))
assert (epyccel_func(cmplx128) == get_chosen_elements(cmplx128))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran,
pytest.mark.skip(reason="Still under maintenance, See #770")]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Needs a C printer see https://github.com/pyccel/pyccel/issues/791"),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.python,
pytest.mark.skip(reason="Outdated Python printer")]
)
)
)
def test_numpy_where_array_like_2d_with_condition(language):
@types('bool[:,:]')
@types('int[:,:]')
@types('int8[:,:]')
@types('int16[:,:]')
@types('int32[:,:]')
@types('int64[:,:]')
@types('float[:,:]')
@types('float32[:,:]')
@types('float64[:,:]')
@types('complex64[:,:]')
@types('complex128[:,:]')
def get_chosen_elements(arr):
from numpy import where, shape
a = where(arr%2, arr, arr+1)
s = shape(a)
return len(s), s[0], a[0,0], a[0,1], a[1,0], a[1,1]
size = (2, 5)
bl = randint(0, 1, size=size, dtype= bool)
integer8 = randint(min_int8, max_int8, size=size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size=size, dtype=np.int16)
integer = randint(min_int, max_int, size=size, dtype=int)
integer32 = randint(min_int32, max_int32, size=size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size=size, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2, size = size)
fl32 = uniform(min_float32 / 2, max_float32 / 2, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2, size = size)
cmplx128_from_float32 = uniform(low=min_float32 / 2, high=max_float32 / 2, size=size) + uniform(low=min_float32 / 2, high=max_float32 / 2, size=size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 2, high=max_float64 / 2, size=size) + uniform(low=min_float64 / 2, high=max_float64 / 2, size=size) * 1j
epyccel_func = epyccel(get_chosen_elements, language=language)
assert epyccel_func(bl) == get_chosen_elements(bl)
assert epyccel_func(integer8) == get_chosen_elements(integer8)
assert epyccel_func(integer16) == get_chosen_elements(integer16)
assert epyccel_func(integer) == get_chosen_elements(integer)
assert epyccel_func(integer32) == get_chosen_elements(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_chosen_elements(integer64)
assert epyccel_func(fl) == get_chosen_elements(fl)
assert epyccel_func(fl32) == get_chosen_elements(fl32)
assert epyccel_func(fl64) == get_chosen_elements(fl64)
assert (epyccel_func(cmplx64) == get_chosen_elements(cmplx64))
assert (epyccel_func(cmplx128) == get_chosen_elements(cmplx128))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran,
pytest.mark.skip(reason="Still under maintenance, See #771")]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Needs a C printer see https://github.com/pyccel/pyccel/issues/791"),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.python]
)
)
)
def test_numpy_linspace_scalar(language):
@types('bool')
@types('int')
@types('int8')
@types('int16')
@types('int32')
@types('int64')
@types('float')
@types('float32')
@types('float64')
@types('complex64')
@types('complex128')
def get_linspace(start):
from numpy import linspace, shape
stop = start + 7
numberOfSamplesToGenerate = 7
b = linspace(start, stop, numberOfSamplesToGenerate)
s = shape(b)
return len(s), s[0], b[0], b[5]
integer8 = randint(min_int8, max_int8, dtype=np.int8)
integer16 = randint(min_int16, max_int16, dtype=np.int16)
integer = randint(min_int, max_int, dtype=int)
integer32 = randint(min_int32, max_int32, dtype=np.int32)
integer64 = randint(min_int64, max_int64, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2)
fl32 = uniform(min_float32 / 2, max_float32 / 2)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2)
cmplx128_from_float32 = uniform(low=min_float32 / 2, high=max_float32 / 2) + uniform(low=min_float32 / 2, high=max_float32 / 2) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 2, high=max_float64 / 2) + uniform(low=min_float64 / 2, high=max_float64 / 2) * 1j
epyccel_func = epyccel(get_linspace, language=language)
assert epyccel_func(True) == get_linspace(True)
assert epyccel_func(False) == get_linspace(False)
assert epyccel_func(integer8) == get_linspace(integer8)
assert epyccel_func(integer16) == get_linspace(integer16)
assert epyccel_func(integer) == get_linspace(integer)
assert epyccel_func(integer32) == get_linspace(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_linspace(integer64)
assert epyccel_func(fl) == get_linspace(fl)
assert epyccel_func(fl32) == get_linspace(fl32)
assert epyccel_func(fl64) == get_linspace(fl64)
assert (epyccel_func(cmplx64) == get_linspace(cmplx64))
assert (epyccel_func(cmplx128) == get_linspace(cmplx128))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran,
pytest.mark.skip(reason="Still under maintenance, See #771")]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Needs a C printer see https://github.com/pyccel/pyccel/issues/791"),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.python]
)
)
)
def test_numpy_linspace_array_like_1d(language):
@types('bool[:]')
@types('int[:]')
@types('int8[:]')
@types('int16[:]')
@types('int32[:]')
@types('int64[:]')
@types('float[:]')
@types('float32[:]')
@types('float64[:]')
@types('complex64[:]')
@types('complex128[:]')
def get_linspace(arr):
from numpy import linspace, shape, ones
numberOfSamplesToGenerate = 7
start = ones(5)
stop = arr
a = linspace(start, stop, numberOfSamplesToGenerate)
s = shape(a)
return len(s), s[0], s[1], a[0,0], a[0,4], a[1,0], a[1,4]
size = 5
bl = randint(0, 1, size=size, dtype= bool)
integer8 = randint(min_int8, max_int8, size=size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size=size, dtype=np.int16)
integer = randint(min_int, max_int, size=size, dtype=int)
integer32 = randint(min_int32, max_int32, size=size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size=size, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2, size = size)
fl32 = uniform(min_float32 / 2, max_float32 / 2, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_int64, max_int, size = size)
cmplx128_from_float32 = uniform(low=min_float32 / 10, high=max_float32 / 10, size=size) + uniform(low=min_float32 / 10, high=max_float32 / 10, size=size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 10, high=max_float64 / 10, size=size) + uniform(low=min_float64 / 10, high=max_float64 / 10, size=size) * 1j
epyccel_func = epyccel(get_linspace, language=language)
assert epyccel_func(bl) == get_linspace(bl)
assert epyccel_func(integer8) == get_linspace(integer8)
assert epyccel_func(integer16) == get_linspace(integer16)
assert epyccel_func(integer) == get_linspace(integer)
assert epyccel_func(integer32) == get_linspace(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_linspace(integer64)
assert epyccel_func(fl) == get_linspace(fl)
assert epyccel_func(fl32) == get_linspace(fl32)
assert epyccel_func(fl64) == get_linspace(fl64)
assert (epyccel_func(cmplx64) == get_linspace(cmplx64))
assert (epyccel_func(cmplx128) == get_linspace(cmplx128))
@pytest.mark.parametrize( 'language', (
pytest.param("fortran", marks = [pytest.mark.fortran,
pytest.mark.skip(reason="Still under maintenance, See #771")]),
pytest.param("c", marks = [
pytest.mark.skip(reason="Needs a C printer see https://github.com/pyccel/pyccel/issues/791"),
pytest.mark.c]
),
pytest.param("python", marks = [
pytest.mark.python]
)
)
)
def test_numpy_linspace_array_like_2d(language):
@types('bool[:,:]')
@types('int[:,:]')
@types('int8[:,:]')
@types('int16[:,:]')
@types('int32[:,:]')
@types('int64[:,:]')
@types('float[:,:]')
@types('float32[:,:]')
@types('float64[:,:]')
@types('complex64[:,:]')
@types('complex128[:,:]')
def get_linspace(arr):
from numpy import linspace, shape, ones
numberOfSamplesToGenerate = 7
start = ones((2,5))
stop = arr
a = linspace(start, stop, numberOfSamplesToGenerate)
s = shape(a)
return len(s), s[0], s[1], s[2], a[0, 0, 0], a[0, 1, 0], a[1, 0, 0], a[1, 1, 0], \
a[0, 0, 4], a[0, 1, 4], a[1, 0, 4], a[1, 1, 4]
size = (2, 5)
bl = randint(0, 1, size=size, dtype= bool)
integer8 = randint(min_int8, max_int8, size=size, dtype=np.int8)
integer16 = randint(min_int16, max_int16, size=size, dtype=np.int16)
integer = randint(min_int, max_int, size=size, dtype=int)
integer32 = randint(min_int32, max_int32, size=size, dtype=np.int32)
integer64 = randint(min_int64, max_int64, size=size, dtype=np.int64)
fl = uniform(min_float / 2, max_float / 2, size = size)
fl32 = uniform(min_float32 / 2, max_float32 / 2, size = size)
fl32 = np.float32(fl32)
fl64 = uniform(min_float64 / 2, max_float64 / 2, size = size)
cmplx128_from_float32 = uniform(low=min_float32 / 2, high=max_float32 / 2, size=size) + uniform(low=min_float32 / 2, high=max_float32 / 2, size=size) * 1j
# the result of the last operation is a Python complex type which has 8 bytes in the alignment,
# that's why we need to convert it to a numpy.complex64 the needed type.
cmplx64 = np.complex64(cmplx128_from_float32)
cmplx128 = uniform(low=min_float64 / 2, high=max_float64 / 2, size=size) + uniform(low=min_float64 / 2, high=max_float64 / 2, size=size) * 1j
epyccel_func = epyccel(get_linspace, language=language)
assert epyccel_func(bl) == get_linspace(bl)
assert epyccel_func(integer8) == get_linspace(integer8)
assert epyccel_func(integer16) == get_linspace(integer16)
assert epyccel_func(integer) == get_linspace(integer)
assert epyccel_func(integer32) == get_linspace(integer32)
# the if block should be removed after resolving (https://github.com/pyccel/pyccel/issues/735).
if sys.platform != 'win32':
assert epyccel_func(integer64) == get_linspace(integer64)
assert epyccel_func(fl) == get_linspace(fl)
assert epyccel_func(fl32) == get_linspace(fl32)
assert epyccel_func(fl64) == get_linspace(fl64)
assert (epyccel_func(cmplx64) == get_linspace(cmplx64))
assert (epyccel_func(cmplx128) == get_linspace(cmplx128))
| 39.097123 | 236 | 0.642357 | 30,088 | 202,484 | 4.09562 | 0.01007 | 0.005697 | 0.031356 | 0.041808 | 0.967475 | 0.952357 | 0.918753 | 0.891267 | 0.848315 | 0.815328 | 0 | 0.050952 | 0.211207 | 202,484 | 5,178 | 237 | 39.104674 | 0.720589 | 0.036946 | 0 | 0.631727 | 0 | 0 | 0.037753 | 0.001386 | 0 | 0 | 0 | 0.000193 | 0.203088 | 1 | 0.106926 | false | 0 | 0.073234 | 0.000936 | 0.250819 | 0.002808 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
a89488168bd56616a02730b6247b98f035d89e46 | 26 | py | Python | __init__.py | FellowHashbrown/PyQM | 3154be1ccda6a6f11481f5f777b3465f491762b4 | [
"MIT"
] | null | null | null | __init__.py | FellowHashbrown/PyQM | 3154be1ccda6a6f11481f5f777b3465f491762b4 | [
"MIT"
] | null | null | null | __init__.py | FellowHashbrown/PyQM | 3154be1ccda6a6f11481f5f777b3465f491762b4 | [
"MIT"
] | null | null | null | from qm import Minterm, QM | 26 | 26 | 0.807692 | 5 | 26 | 4.2 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 26 | 1 | 26 | 26 | 0.954545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
a8b69e48e5e64fa478e412b0b6dc0f2d71868087 | 141 | py | Python | bestiary/context_processors.py | Itori/swarfarm | 7192e2d8bca093b4254023bbec42b6a2b1887547 | [
"Apache-2.0"
] | 66 | 2017-09-11T04:46:00.000Z | 2021-03-13T00:02:42.000Z | bestiary/context_processors.py | Itori/swarfarm | 7192e2d8bca093b4254023bbec42b6a2b1887547 | [
"Apache-2.0"
] | 133 | 2017-09-24T21:28:59.000Z | 2021-04-02T10:35:31.000Z | bestiary/context_processors.py | Itori/swarfarm | 7192e2d8bca093b4254023bbec42b6a2b1887547 | [
"Apache-2.0"
] | 28 | 2017-08-30T19:04:32.000Z | 2020-11-16T04:09:00.000Z | from .forms import BestiaryQuickSearchForm
def quick_search_form(request):
return {'bestiary_quick_search': BestiaryQuickSearchForm()}
| 23.5 | 63 | 0.815603 | 14 | 141 | 7.928571 | 0.785714 | 0.198198 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.106383 | 141 | 5 | 64 | 28.2 | 0.880952 | 0 | 0 | 0 | 0 | 0 | 0.148936 | 0.148936 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0.333333 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 6 |
a8d52fb2b4386b22b4efc12fed0d8017ec23d107 | 5,716 | py | Python | trilateration/compute/test_toa.py | robinroyer/trilateration | 9a8d1388f6ba03f72537defbddb3e984826a640e | [
"Apache-2.0"
] | 3 | 2018-12-18T00:15:12.000Z | 2020-11-02T02:44:22.000Z | trilateration/compute/test_toa.py | robinroyer/trilateration | 9a8d1388f6ba03f72537defbddb3e984826a640e | [
"Apache-2.0"
] | 2 | 2020-11-02T02:44:17.000Z | 2020-11-23T05:05:45.000Z | trilateration/compute/test_toa.py | robinroyer/trilateration | 9a8d1388f6ba03f72537defbddb3e984826a640e | [
"Apache-2.0"
] | 3 | 2019-05-06T04:49:16.000Z | 2021-09-12T11:59:39.000Z | import unittest
import time
import datetime
from toa import toa
from ..model.point import point
from ..model.uplink import uplink
from ..model.gateway import gateway
from ..utils.utils import SPEED_OF_LIGHT
from ..model.projection import projection
class Test_toa(unittest.TestCase):
# =============================================== OBJECT UNIT TEST
def test_trilateration_creation(self):
g1 = gateway(48.84, 2.26)
g2 = gateway(48.84, 2.30)
g3 = gateway(48.80, 2.30)
u1 = uplink(g1, datetime.datetime.now(), int(time.time() * 1000000000))
u2 = uplink(g2, datetime.datetime.now(), int(time.time() * 1000000000))
u3 = uplink(g3, datetime.datetime.now(), int(time.time() * 1000000000))
solver = toa([u1, u2, u3])
self.assertEqual(solver._level, 3)
self.assertEqual(solver._uplinks, [u1, u2, u3])
# =============================================== FUNCTIONNAL TEST
def test_trilateration_compute_random(self):
g1 = gateway(48.84, 2.26)
g2 = gateway(48.84, 2.30)
g3 = gateway(48.80, 2.30)
u1 = uplink(g1, datetime.datetime.now(), int(time.time() * 1000000000))
u2 = uplink(g2, datetime.datetime.now(), int(time.time() * 1000000000))
u3 = uplink(g3, datetime.datetime.now(), int(time.time() * 1000000000))
solver = toa([u1, u2, u3])
# user of delta because of 2 occurences of times are different
self.assertAlmostEqual(solver.geolocalized_device.lat, 48.808139705595316, delta=1.0)
self.assertAlmostEqual(solver.geolocalized_device.lon, 2.308668, delta=1.0)
def test_trilateration_compute_random(self):
g1 = gateway(48.84, 2.26)
g2 = gateway(48.84, 2.30)
g3 = gateway(48.80, 2.30)
u1 = uplink(g1, datetime.datetime.now(), 1495456868630584064)
u2 = uplink(g2, datetime.datetime.now(), 1495456868630585856)
u3 = uplink(g3, datetime.datetime.now(), 1495456868630585856)
solver = toa([u1, u2, u3])
# user of delta because of 2 occurences of times are different
self.assertAlmostEqual(solver.geolocalized_device.lat, 48.819999, delta=.000001)
self.assertAlmostEqual(solver.geolocalized_device.lon, 2.286716, delta=.000001)
def test_same_time(self):
g1 = gateway(48.84, 2.26)
g2 = gateway(48.84, 2.30)
g3 = gateway(48.80, 2.30)
t = int(time.time() * 1000000000)
u1 = uplink(g1, datetime.datetime.now(), t)
u2 = uplink(g2, datetime.datetime.now(), t)
u3 = uplink(g3, datetime.datetime.now(), int(time.time() * 1000000000))
solver = toa([u1, u2, u3])
self.assertFalse(solver.is_resolved)
def test_same_gateway(self):
g1 = gateway(48.84, 2.26)
g2 = gateway(48.84, 2.30)
g3 = gateway(48.84, 2.30)
u1 = uplink(g1, datetime.datetime.now(), int(time.time() * 1000000000))
u2 = uplink(g2, datetime.datetime.now(), int(time.time() * 1000000000))
u3 = uplink(g3, datetime.datetime.now(), int(time.time() * 1000000000))
solver = toa([u1, u2, u3])
self.assertFalse(solver.is_resolved)
def test_same_uplink(self):
g1 = gateway(48.84, 2.26)
g2 = gateway(48.84, 2.30)
g3 = gateway(48.84, 2.30)
t = int(time.time() * 1000000000)
u1 = uplink(g1, datetime.datetime.now(), int(time.time() * 1000000000))
u2 = uplink(g2, datetime.datetime.now(), t)
u3 = uplink(g3, datetime.datetime.now(), t)
solver = toa([u1, u2, u3])
self.assertFalse(solver.is_resolved)
# =============================================== ERROR CHECKING
def test_only_one_uplink(self):
g1 = gateway(48.84, 2.26)
u1 = uplink(g1, datetime.datetime.now(), int(time.time() * 1000000000))
self.assertRaises(ValueError, lambda: toa([u1]))
def test_only_two_uplinks(self):
g1 = gateway(48.84, 2.26)
g2 = gateway(48.84, 2.30)
u1 = uplink(g1, datetime.datetime.now(), int(time.time() * 1000000000))
u2 = uplink(g2, datetime.datetime.now(), int(time.time() * 1000000000))
self.assertRaises(ValueError, lambda: toa([u1, u2]))
def test_four_gateways(self):
g1 = gateway(48.84, 2.26)
g2 = gateway(48.84, 2.30)
g3 = gateway(48.80, 2.30)
g4 = gateway(48.80, 2.22)
u1 = uplink(g1, datetime.datetime.now(), int(time.time() * 1000000000))
u2 = uplink(g2, datetime.datetime.now(), int(time.time() * 1000000000))
u3 = uplink(g3, datetime.datetime.now(), int(time.time() * 1000000000))
u4 = uplink(g4, datetime.datetime.now(), int(time.time() * 1000000000))
self.assertRaises(ValueError, lambda: toa([u1, u2, u3, u4]))
def test_incorrect_param_type(self):
g1 = gateway(48.84, 2.26)
g2 = gateway(48.84, 2.30)
u1 = uplink(g1, datetime.datetime.now(), int(time.time() * 1000000000))
u2 = uplink(g2, datetime.datetime.now(), int(time.time() * 1000000000))
self.assertRaises(ValueError, lambda: toa([u1, u2, .0]))
def test_incorrect_projection(self):
g1 = gateway(48.84, 2.26)
g2 = gateway(48.84, 2.30)
g3 = gateway(48.80, 2.30)
u1 = uplink(g1, datetime.datetime.now(), int(time.time() * 1000000000))
u2 = uplink(g2, datetime.datetime.now(), int(time.time() * 1000000000))
u3 = uplink(g3, datetime.datetime.now(), int(time.time() * 1000000000))
solver = toa([u1, u2, u3])
projection_system = 42
self.assertRaises(ValueError, lambda: toa([u1, u2, u3], projection_system))
if __name__ == '__main__':
unittest.main() | 38.362416 | 93 | 0.601819 | 752 | 5,716 | 4.509309 | 0.125 | 0.079623 | 0.168092 | 0.154822 | 0.803893 | 0.803893 | 0.777352 | 0.748452 | 0.726334 | 0.726334 | 0 | 0.159312 | 0.226907 | 5,716 | 149 | 94 | 38.362416 | 0.608056 | 0.054934 | 0 | 0.626168 | 0 | 0 | 0.001482 | 0 | 0 | 0 | 0 | 0 | 0.130841 | 1 | 0.102804 | false | 0 | 0.084112 | 0 | 0.196262 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
763786ea1956e6697f7f2906f86a6ae0f1f0fba2 | 41 | py | Python | library_checkout/tests/__init__.py | jhonaelramos/Odoo-14-Development-Essentials | 52d1317c67b629233f5e246105d452018ae01700 | [
"MIT"
] | 121 | 2018-08-30T10:33:32.000Z | 2021-11-08T13:13:43.000Z | library_checkout/tests/__init__.py | jhonaelramos/Odoo-14-Development-Essentials | 52d1317c67b629233f5e246105d452018ae01700 | [
"MIT"
] | 2 | 2019-04-18T11:47:58.000Z | 2019-06-21T11:28:21.000Z | library_checkout/tests/__init__.py | jhonaelramos/Odoo-14-Development-Essentials | 52d1317c67b629233f5e246105d452018ae01700 | [
"MIT"
] | 152 | 2018-11-03T14:07:06.000Z | 2022-03-05T17:38:36.000Z | from . import test_checkout_mass_message
| 20.5 | 40 | 0.878049 | 6 | 41 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097561 | 41 | 1 | 41 | 41 | 0.891892 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
7642b6392d3c7168e6037ff7fec235166ef7ac68 | 2,556 | py | Python | lib/gamtools/tests/test_matrix.py | nroberts67/gamtools-dev | 55ff357e2a6b2a5bfa17a9265b550c7193f1f7aa | [
"Apache-2.0"
] | 8 | 2017-03-09T11:35:36.000Z | 2021-03-17T02:57:24.000Z | lib/gamtools/tests/test_matrix.py | nroberts67/gamtools-dev | 55ff357e2a6b2a5bfa17a9265b550c7193f1f7aa | [
"Apache-2.0"
] | 20 | 2017-03-16T01:49:46.000Z | 2021-12-03T20:16:08.000Z | lib/gamtools/tests/test_matrix.py | nroberts67/gamtools-dev | 55ff357e2a6b2a5bfa17a9265b550c7193f1f7aa | [
"Apache-2.0"
] | 13 | 2019-03-14T15:29:36.000Z | 2019-06-04T14:43:58.000Z | import io
import pytest
import numpy as np
from gamtools import matrix
@pytest.fixture
def small_matrix():
return io.StringIO(
u""" chr1:0-1000 chr1:1000-2000 chr1:2000-3000 chr1:3000-4000
chr1:0-1000 1 2 3 4
chr1:1000-2000 5 6 7 8
chr1:2000-3000 9 10 11 12
chr1:3000-4000 13 14 15 16
""")
@pytest.fixture
def trans_matrix():
return io.StringIO(
u""" chr2:0-1000 chr2:1000-2000 chr2:2000-3000 chr2:3000-4000
chr1:0-1000 1 2 3 4
chr1:1000-2000 5 6 7 8
chr1:2000-3000 9 10 11 12
chr1:3000-4000 13 14 15 16
""")
def test_matrix_object_subregion(small_matrix):
matrix_obj = matrix.read_txt(small_matrix)
loc_string = 'chr1:2000-4000'
(w1, w2), subregion = matrix.region_from_locations(matrix_obj, loc_string)
np.testing.assert_array_equal(subregion,
np.array([[11,12],[15,16]]))
def test_matrix_object_offcentre_region(small_matrix):
matrix_obj = matrix.read_txt(small_matrix)
loc_string1 = 'chr1:2000-4000'
loc_string2 = 'chr1:0-2000'
(w1, w2), subregion = matrix.region_from_locations(matrix_obj, loc_string1, loc_string2)
np.testing.assert_array_equal(subregion,
np.array([[9,10],[13,14]]))
def test_trans_matrix_object_offcentre_region(trans_matrix):
matrix_obj = matrix.read_txt(trans_matrix)
loc_string1 = 'chr1:2000-4000'
loc_string2 = 'chr2:0-2000'
(w1, w2), subregion = matrix.region_from_locations(matrix_obj, loc_string1, loc_string2)
np.testing.assert_array_equal(subregion,
np.array([[9,10],[13,14]]))
def test_matrix_file_subregion(small_matrix):
loc_string = 'chr1:2000-4000'
(w1, w2), subregion = matrix.open_region_from_locations(
small_matrix, loc_string, file_type='txt')
np.testing.assert_array_equal(subregion,
np.array([[11,12],[15,16]]))
def test_matrix_file_offcentre_region(small_matrix):
loc_string1 = 'chr1:2000-4000'
loc_string2 = 'chr1:0-2000'
(w1, w2), subregion = matrix.open_region_from_locations(
small_matrix, loc_string1, loc_string2, file_type='txt')
np.testing.assert_array_equal(subregion,
np.array([[9,10],[13,14]]))
def test_trans_matrix_file_offcentre_region(trans_matrix):
loc_string1 = 'chr1:2000-4000'
loc_string2 = 'chr2:0-2000'
(w1, w2), subregion = matrix.open_region_from_locations(
trans_matrix, loc_string1, loc_string2, file_type='txt')
np.testing.assert_array_equal(subregion,
np.array([[9,10],[13,14]]))
| 26.625 | 92 | 0.687793 | 387 | 2,556 | 4.29199 | 0.157623 | 0.059603 | 0.050572 | 0.068633 | 0.819988 | 0.792294 | 0.760385 | 0.760385 | 0.760385 | 0.760385 | 0 | 0.158454 | 0.190141 | 2,556 | 95 | 93 | 26.905263 | 0.643961 | 0 | 0 | 0.673077 | 0 | 0 | 0.06127 | 0 | 0 | 0 | 0 | 0 | 0.115385 | 1 | 0.153846 | false | 0 | 0.076923 | 0.038462 | 0.269231 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
769aba26879f557a8354b722445e3bcedafb71af | 12,039 | py | Python | starterlite/simulation/FourierSpace.py | gjsun/starterlite | 4838c0b9837e0012157596984f9e39ed52f9c86c | [
"MIT"
] | null | null | null | starterlite/simulation/FourierSpace.py | gjsun/starterlite | 4838c0b9837e0012157596984f9e39ed52f9c86c | [
"MIT"
] | null | null | null | starterlite/simulation/FourierSpace.py | gjsun/starterlite | 4838c0b9837e0012157596984f9e39ed52f9c86c | [
"MIT"
] | null | null | null | import numpy as np
import os
from ..analysis import Sensitivity
from ..physics import Cosmology
from ..physics.Constants import c, cm_per_mpc
from ..util.ParameterFile import ParameterFile
class FourierSpace(object):
def __init__(self, **kwargs):
self.pf = ParameterFile(**kwargs)
def RealToFourier(self, f, x, y, z=None):
"""
Return the fourier transform of a 2D or 3D real-space function
----------------------------------------
:param f: target function defined in real space; {2d or 3d arr}
:param x: 1st-dimension samples of real space; {1d arr}
:param y: 2nd-dimension samples of real space; {1d arr}
:param z: (optional) 3rd-dimension samples of real space; {1d arr}
:return: F.T. of target function, and k space samples; {tuple}
"""
if np.ndim(f) == 2:
if not (self.EvenlySpaced(x) and self.EvenlySpaced(y)):
raise ValueError('Must supply evenly spaced sample grids in real space!')
dx = x[1] - x[0]
dy = y[1] - y[0]
ft = np.fft.rfftn(f.T).T
ft *= dx * dy # Normalize (convert DFT to continuous FT)
# Note that here (in 1D) we multiply ft by dx, and for the PS we further divide by Lx.
# This is essentially dividing by Nx!!!
kx = 2 * np.pi * np.fft.rfftfreq(x.size, d=dx)
ky = 2 * np.pi * np.fft.fftfreq(y.size, d=dy)
return ft, kx, ky
elif np.ndim(f) == 3:
if not (self.EvenlySpaced(x) and self.EvenlySpaced(y) and self.EvenlySpaced(z)):
raise ValueError('Must supply evenly spaced sample grids in real space!')
dx = x[1] - x[0]
dy = y[1] - y[0]
dz = z[1] - z[0]
ft = np.fft.rfftn(f.T).T
ft *= dx * dy * dz # Normalize (convert DFT to continuous FT)
kx = 2 * np.pi * np.fft.rfftfreq(x.size, d=dx)
ky = 2 * np.pi * np.fft.fftfreq(y.size, d=dy)
kz = 2 * np.pi * np.fft.fftfreq(z.size, d=dz)
return ft, kx, ky, kz
else:
raise NotImplementedError('Only 2d and 3d real spaces are supported!')
def RealToAutoPS(self, f, x, y, z=None):
"""
Return the power spectrum (that describes the fluctuations) of a real-space function
----------------------------------------
:param f: target function defined in real space; {2d or 3d arr}
:param x: 1st-dimension samples of real space; {1d arr}
:param y: 2nd-dimension samples of real space; {1d arr}
:param z: (optional) 3rd-dimension samples of real space; {1d arr}
:return: power spectrum of target function, and k space samples; {tuple}
"""
if np.ndim(f) == 2:
ft, kx, ky = self.RealToFourier(f, x, y)
vol = abs((x[-1] - x[0]) * (y[-1] - y[0]))
# power spectrum = |F.T.(f)|^2 / V
ps = abs(ft)**2 / vol
return ps, kx, ky
elif np.ndim(f) == 3:
ft, kx, ky, kz = self.RealToFourier(f, x, y, z)
vol = abs((x[-1] - x[0]) * (y[-1] - y[0]) * (z[-1] - z[0]))
# power spectrum = |F.T.(f)|^2 / V
ps = abs(ft)**2 / vol
return ps, kx, ky, kz
else:
raise NotImplementedError('Only 2d and 3d real spaces are supported!')
def RealToCrossPS(self, f1, f2, x, y, z=None):
"""
Return the power spectrum (that describes the fluctuations) of a real-space function
----------------------------------------
:param f1: 1st target function defined in real space; {2d or 3d arr}
:param f2: 2nd target function defined in real space; {2d or 3d arr}
:param x: 1st-dimension samples of real space; {1d arr}
:param y: 2nd-dimension samples of real space; {1d arr}
:param z: (optional) 3rd-dimension samples of real space; {1d arr}
:return: power spectrum of target function, and k space samples; {tuple}
"""
if (np.ndim(f1) == 2) and (np.ndim(f2) == 2):
f1t, kx, ky = self.RealToFourier(f1, x, y)
f2t = self.RealToFourier(f2, x, y)[0]
vol = abs((x[-1] - x[0]) * (y[-1] - y[0]))
# power spectrum = |F.T.(f)|^2 / V
ps = abs(f1t*f2t) / vol
return ps, kx, ky
elif (np.ndim(f1) == 3) and (np.ndim(f2) == 3):
f1t, kx, ky, kz = self.RealToFourier(f1, x, y, z)
f2t = self.RealToFourier(f2, x, y, z)[0]
vol = abs((x[-1] - x[0]) * (y[-1] - y[0]) * (z[-1] - z[0]))
# power spectrum = |F.T.(f)|^2 / V
ps = abs(f1t*f2t) / vol
return ps, kx, ky, kz
else:
raise NotImplementedError('Only 2d and 3d real spaces are supported!')
def CartesianToRadialBins(self, x, y, z=None, bins=None, log=False):
"""
Convert Cartesian binning into radial binning
----------------------------------------
:param x: 1st-dimension samples of Cartesian grid; {1d arr}
:param y: 2nd-dimension samples of Cartesian grid; {1d arr}
:param z: (optional) 3rd-dimension samples of Cartesian grid; {1d arr}
:param bins: number of radial bins, if None, set according to dr = max(dx, dy, dz); {int or None}
:return: radial bin edges; {1d arr}
"""
if z is None:
rmin = 0.
rmax = max(np.amax(np.abs(x)), np.amax(np.abs(y)))
if bins == None:
dr = max(
[np.min(np.abs(q[q != 0])) for q in (x, y)]) # Smallest nonzero, absolute x,y,z coordinate value
bins = int(np.ceil((rmax - rmin) / dr))
if log:
_rmin = min(np.min(np.abs(x)), np.min(np.abs(y)))
if _rmin == 0.:
_rmin = min(np.partition(np.abs(x), 2)[1], np.partition(np.abs(y), 2)[1])
_rmin = _rmin / 1.01
rsphbins = np.logspace(np.log10(_rmin), np.log10(bins * dr), bins + 1)
else:
rsphbins = np.linspace(0, bins * dr, bins + 1)
else:
if log:
_rmin = min(np.min(np.abs(x)), np.min(np.abs(y)))
if _rmin == 0.:
_rmin = min(np.partition(np.abs(x), 2)[1], np.partition(np.abs(y), 2)[1])
_rmin = _rmin / 1.01
rsphbins = np.logspace(np.log10(_rmin), np.log10(rmax), bins + 1)
else:
rsphbins = np.linspace(rmin, rmax, bins + 1)
else:
rmin = 0.
# rmax = max(np.amax(np.abs(x)), np.amax(np.abs(y)))
rmax = np.sqrt(np.amax(np.abs(x))**2 + np.amax(np.abs(y))**2 + np.amax(np.abs(z))**2)
if bins == None:
dr = max([np.min(np.abs(q[q != 0])) for q in (x, y, z)]) # Smallest nonzero, absolute x,y,z coordinate value
bins = int(np.ceil((rmax - rmin) / dr))
_rmin = min(np.min(np.abs(x)), np.min(np.abs(y)), np.min(np.abs(z)))
if _rmin == 0.:
_rmin = min(np.partition(np.abs(x), 2)[1], np.partition(np.abs(y), 2)[1], np.partition(np.abs(z), 2)[1])
_rmin /= 0.5
if log:
rsphbins = np.logspace(np.log10(_rmin), np.log10(bins * dr), bins + 1)
else:
rsphbins = np.linspace(_rmin, bins * dr, bins + 1)
else:
_rmin = min(np.min(np.abs(x)), np.min(np.abs(y)), np.min(np.abs(z)))
if _rmin == 0.:
_rmin = min(np.partition(np.abs(x), 2)[1], np.partition(np.abs(y), 2)[1], np.partition(np.abs(z), 2)[1])
_rmin /= 0.5
if log:
rsphbins = np.logspace(np.log10(_rmin), np.log10(rmax), bins + 1)
else:
rsphbins = np.linspace(_rmin, rmax, bins + 1)
return rsphbins
def AverageAutoPS(self, f, x, y, z, bins=None, log=False, avg_type='sph'):
"""
Return the averaged (as specified) auto power spectrum
----------------------------------------
:param f: target function defined in real space; {2d or 3d arr}
:param x: 1st-dimension samples of real space; {1d arr}
:param y: 2nd-dimension samples of real space; {1d arr}
:param z: (optional) 3rd-dimension samples of real space; {1d arr}
:param avg_type: ; {str}
:return:
"""
if avg_type == 'sph':
if np.ndim(f) == 2:
pxyz, kx, ky = self.RealToAutoPS(f, x, y)
ksphbins = self.CartesianToRadialBins(kx, ky, bins=bins, log=log)
# 3d grid of r (distance from origin), note ORDER!
rr = np.sqrt(sum(kk**2 for kk in np.meshgrid(kx, ky, indexing='ij')))
# selection for r>0 (do not include origin)
gt0 = np.where(rr > 0)
# average within individual bins
psph = np.histogram(rr[gt0], bins=ksphbins, weights=pxyz[gt0])[0] / np.histogram(rr[gt0], bins=ksphbins)[0]
ksph = (ksphbins[0:-1] + ksphbins[1::])/2.
return ksph, psph
elif np.ndim(f) == 3:
pxyz, kx, ky, kz = self.RealToAutoPS(f, x, y, z)
ksphbins = self.CartesianToRadialBins(kx, ky, kz, bins=bins, log=log)
# 3d grid of r (distance from origin), note ORDER!
rr = np.sqrt(sum(kk**2 for kk in np.meshgrid(kx, ky, kz, indexing='ij')))
# selection for r>0 (do not include origin)
gt0 = np.where(rr > 0)
# average within individual bins
psph = np.histogram(rr[gt0], bins=ksphbins, weights=pxyz[gt0])[0] / np.histogram(rr[gt0], bins=ksphbins)[0]
ksph = (ksphbins[0:-1] + ksphbins[1::])/2.
return ksph, psph
else:
raise NotImplementedError('help!')
else:
raise NotImplementedError('help!')
def AverageCrossPS(self, f1, f2, x, y, z, bins=None, log=False, avg_type='sph'):
"""
Return the averaged (as specified) cross power spectrum
----------------------------------------
:param f1: 1st target function defined in real space; {2d or 3d arr}
:param f2: 2nd target function defined in real space; {2d or 3d arr}
:param x: 1st-dimension samples of real space; {1d arr}
:param y: 2nd-dimension samples of real space; {1d arr}
:param z: (optional) 3rd-dimension samples of real space; {1d arr}
:param avg_type: ; {str}
:return:
"""
if avg_type == 'sph':
pxyz, kx, ky, kz = self.RealToCrossPS(f1, f2, x, y, z)
ksphbins = self.CartesianToRadialBins(kx, ky, kz, bins=bins, log=log)
rr = np.sqrt(sum(kk ** 2 for kk in np.meshgrid(kx, ky, kz,
indexing='ij'))) # 3d grid of r (distance from origin), note ORDER!
gt0 = np.where(rr > 0) # selection for r>0 (do not include origin)
# average within individual bins
psph = np.histogram(rr[gt0], bins=ksphbins, weights=pxyz[gt0])[0] / \
np.histogram(rr[gt0], bins=ksphbins)[0]
ksph = (ksphbins[0:-1] + ksphbins[1::]) / 2.
return ksph, psph
else:
raise NotImplementedError('help!')
# ---------------- helpers ---------------- #
def EvenlySpaced(self, a):
"""
Determine whether an array is evenly spaced
----------------------------------------
:param a: input array; {1d arr}
:return: evenly spaced or not; {boolean}
"""
return np.allclose((a[1:] - a[:-1]), (a[1] - a[0]))
def BinMidpoints(self, bin_edges):
return 0.5*(bin_edges[:-1] + bin_edges[1:]) | 48.156 | 127 | 0.502949 | 1,653 | 12,039 | 3.639443 | 0.127042 | 0.024102 | 0.053856 | 0.054854 | 0.833278 | 0.781915 | 0.755984 | 0.752327 | 0.722906 | 0.69631 | 0 | 0.032569 | 0.336905 | 12,039 | 250 | 128 | 48.156 | 0.721032 | 0.303929 | 0 | 0.626667 | 0 | 0 | 0.033363 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.06 | false | 0 | 0.04 | 0.006667 | 0.186667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
76c083f0552170d1f957cb8d9d7cd51dcef419d9 | 190 | py | Python | CH40208/good_practice/my_module.py | pythoninchemistry/ch40208 | 0d978f048644825fae7113d7bd65da709c6fef09 | [
"CC-BY-4.0"
] | null | null | null | CH40208/good_practice/my_module.py | pythoninchemistry/ch40208 | 0d978f048644825fae7113d7bd65da709c6fef09 | [
"CC-BY-4.0"
] | 84 | 2019-06-21T06:32:55.000Z | 2021-06-22T12:11:01.000Z | CH40208/good_practice/my_module.py | pythoninchemistry/ch40208 | 0d978f048644825fae7113d7bd65da709c6fef09 | [
"CC-BY-4.0"
] | 6 | 2019-06-21T06:58:29.000Z | 2021-11-02T14:01:48.000Z | def hello_world(name):
"""
This is a simple, Hello World function.
Args:
name (str): A name to concatentate to the print.
"""
print(f"Hello World {name}!") | 23.75 | 56 | 0.573684 | 26 | 190 | 4.153846 | 0.615385 | 0.277778 | 0.259259 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.305263 | 190 | 8 | 57 | 23.75 | 0.818182 | 0.526316 | 0 | 0 | 0 | 0 | 0.301587 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 0.5 | 0.5 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 6 |
4f2ca49cb3210d5b4e1f0700f99a7cfd8e12683e | 148,278 | py | Python | gaze_data_analyzer.py | Toonwire/infancy_eye_tracking | 7b96a9d832f60f83fd5098ada2117ab1d0f56fed | [
"MIT"
] | null | null | null | gaze_data_analyzer.py | Toonwire/infancy_eye_tracking | 7b96a9d832f60f83fd5098ada2117ab1d0f56fed | [
"MIT"
] | null | null | null | gaze_data_analyzer.py | Toonwire/infancy_eye_tracking | 7b96a9d832f60f83fd5098ada2117ab1d0f56fed | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 20 14:05:05 2019
@author: s144451
"""
import matplotlib.pyplot as plt
import pandas as pd
import math
import random
import sys
import data_correction as dc
import dbscan
import numpy as np
class GazeDataAnalyzer:
plt.rcParams.update({'font.size': 14})
show_graphs_bool = True
show_rms_pixel_bool = False
show_rms_degree_bool = False
show_filtering = False
show_filtering_text = False
show_accuracy_precision_bool = True
to_closest_target = False
regression_poly_degree = 2
def read_data(self, filename, remove_nan_values = True):
# read config csv file
data_frame = pd.read_csv(filename, delimiter=";")
if remove_nan_values:
# check for corrupted/missing data in data frames
data_frame = data_frame[(data_frame['left_gaze_point_on_display_area'] != '(nan, nan)')]
data_frame = data_frame[(data_frame['right_gaze_point_on_display_area'] != '(nan, nan)')]
data_frame = data_frame[(data_frame['left_gaze_point_validity'] != 0)]
data_frame = data_frame[(data_frame['right_gaze_point_validity'] != 0)]
# note number of data rows in csv file
self.N = len(data_frame)
# fetch gaze points from data
gaze_data_left = np.transpose(np.array([eval(coord) if coord != "(nan, nan)" else (-1,-1) for coord in data_frame['left_gaze_point_on_display_area']]))
gaze_data_right = np.transpose(np.array([eval(coord) if coord != "(nan, nan)" else (-1,-1) for coord in data_frame['right_gaze_point_on_display_area']]))
target_points = np.transpose(np.array([eval(coord) if coord != "(nan, nan)" else (-1,-1) for coord in data_frame['current_target_point_on_display_area']]))
return (gaze_data_left, gaze_data_right, target_points)
def filtering_setup(self, gaze_data_left_temp, gaze_data_right_temp, target_points_temp, filtering_method = None, remove_outliers = True):
gaze_data_left = []
gaze_data_right = []
target_points = []
if len(gaze_data_left_temp) > 0 and len(gaze_data_right_temp) > 0 and self.show_filtering:
self.plot_scatter(gaze_data_left_temp, gaze_data_right_temp, target_points_temp, title_string="BEFORE filtering")
self.plot_scatter_avg(gaze_data_left_temp, gaze_data_right_temp, target_points_temp, title_string="BEFORE filtering AVG")
if filtering_method == "dbscan_fixation" or filtering_method == "dbscan_pursuit":
gaze_data_temp = np.mean(np.array([gaze_data_left_temp, gaze_data_right_temp]), axis=0)
db_scan = dbscan.DBScan()
dist_to_neighbor = 0.05
min_size_of_cluster = 10
if filtering_method == "dbscan_fixation":
dist_to_neighbor = 0.01
min_size_of_cluster = 10
clusters = db_scan.run_linear(gaze_data_temp.T, dist_to_neighbor, min_size_of_cluster)
# if self.show_graphs_bool:
# colours = ['black', 'red', 'blue', 'cyan', 'yellow', 'purple', 'green']
# colors = [colours[int(clusters[key]) % len(colours)] for key in clusters.keys()]
# plt.scatter(*zip(*clusters.keys()),c=colors)
# plt.title("DBScan", y=1.08)
# plt.gca().xaxis.tick_top()
# plt.xlim(0,1)
# plt.ylim(1,0)
# plt.show()
gaze_data_left_x = []
gaze_data_left_y = []
gaze_data_right_x = []
gaze_data_right_y = []
target_points_x = []
target_points_y = []
for i in range(self.N):
if i < 40:
continue;
# if i < 40 and filtering_method == "dbscan_fixation":
# continue;
current_target = target_points_temp[:,i]
p = (gaze_data_temp[0, i], gaze_data_temp[1, i])
if p not in clusters:
continue;
# current_cluster = clusters[p]
# Check if current target is a new target, and if the future target is a new target
dif_new_target_past = 50
is_past_new_target = False
if (i - dif_new_target_past >= 0):
is_past_new_target = not np.array_equal(current_target, target_points_temp[:,i-dif_new_target_past])
dif_new_target_future = 10
is_future_new_target = False
if (i + dif_new_target_future < self.N):
is_future_new_target = not np.array_equal(current_target, target_points_temp[:,i+dif_new_target_future])
# For fixation filtering
# A gaze point in a cluster has to be filtered away
# If the current target point has changed but the gaze point has not, the gaze point can still be in the old cluster, for the old target point
# This gaze point should be filtered away, since it has a large visual angle error
# If the current target is different from the previous target, but the previous target is the same as the target before that, a change has been noted
if clusters[p] == 0 or (filtering_method == "dbscan_fixation" and (is_past_new_target or is_future_new_target)):
del clusters[p]
else:
gaze_data_left_x.append(gaze_data_left_temp[0,i])
gaze_data_left_y.append(gaze_data_left_temp[1,i])
gaze_data_right_x.append(gaze_data_right_temp[0,i])
gaze_data_right_y.append(gaze_data_right_temp[1,i])
target_points_x.append(target_points_temp[0,i])
target_points_y.append(target_points_temp[1,i])
# if self.show_graphs_bool:
# colours = ['black', 'red', 'blue', 'cyan', 'yellow', 'purple', 'green']
# colors = [colours[int(clusters[key]) % len(colours)] for key in clusters.keys()]
# plt.scatter(*zip(*clusters.keys()),c=colors)
# plt.title("DBScan", y=1.08)
# plt.gca().xaxis.tick_top()
# plt.xlim(0,1)
# plt.ylim(1,0)
# plt.show()
gaze_data_left = np.array([gaze_data_left_x, gaze_data_left_y])
gaze_data_right = np.array([gaze_data_right_x, gaze_data_right_y])
target_points = np.array([target_points_x, target_points_y])
if self.show_filtering:
self.plot_scatter(gaze_data_left, gaze_data_right, target_points, title_string="AFTER dbscan filter")
self.plot_scatter_avg(gaze_data_left, gaze_data_right, target_points, title_string="AFTER dbscan AVG")
else:
gaze_data_left = gaze_data_left_temp
gaze_data_right = gaze_data_right_temp
target_points = target_points_temp
self.N = len(target_points[0,:])
return (gaze_data_left, gaze_data_right, target_points)
def filtering(self, gaze_data_left_temp, gaze_data_right_temp, target_points_temp, filtering_method = None, remove_outliers = True):
colours = ['black', 'red', 'blue', 'cyan', 'yellow', 'purple', 'green', 'brown', 'darkgrey', 'orange', 'mediumspringgreen', 'cadetblue', 'fuchsia', 'crimson']
gaze_data_left = []
gaze_data_right = []
target_points = []
before = len(target_points_temp[0,:])
if len(gaze_data_left_temp) > 0 and len(gaze_data_right_temp) > 0 and self.show_filtering:
self.plot_scatter(gaze_data_left_temp, gaze_data_right_temp, target_points_temp, title_string="BEFORE filtering")
self.plot_scatter_avg(gaze_data_left_temp, gaze_data_right_temp, target_points_temp, title_string="BEFORE filtering AVG")
if filtering_method == "dbscan_fixation" or filtering_method == "dbscan_pursuit":
gaze_data_temp = np.mean(np.array([gaze_data_left_temp, gaze_data_right_temp]), axis=0)
db_scan = dbscan.DBScan()
dist_to_neighbor = 0.02
min_size_of_cluster = 10
if filtering_method == "dbscan_fixation":
dist_to_neighbor = 0.01
min_size_of_cluster = 10
clusters = db_scan.run_linear(gaze_data_temp.T, dist_to_neighbor, min_size_of_cluster)
if self.show_filtering:
colors = [colours[int(clusters[key]) % len(colours)] for key in clusters.keys()]
plt.scatter(*zip(*clusters.keys()),c=colors)
plt.title("DBScan", y=1.08)
plt.gca().xaxis.tick_top()
plt.xlim(0,1)
plt.ylim(1,0)
plt.show()
gaze_data_left_x = []
gaze_data_left_y = []
gaze_data_right_x = []
gaze_data_right_y = []
target_points_x = []
target_points_y = []
removed_gaze = 0
for i in range(self.N):
# standard for infants 45
# noel/gudrun tri 2p = 60
# control 1 default = 45
if i < 45 and filtering_method == "dbscan_pursuit":
continue;
# standard for infants 45
# standard for control 31
# noel/gudrun 2p, 5p = 70
# control 1 default = 45
if i < 45 and filtering_method == "dbscan_fixation":
continue;
current_target = target_points_temp[:,i]
p = (gaze_data_temp[0, i], gaze_data_temp[1, i])
if p not in clusters:
continue;
# current_cluster = clusters[p]
# Check if current target is a new target, and if the future target is a new target
# standard 10
# noel/gudrun 2p, 5p = 55
# chrille1 default = 35
# control 1 default = 40
dif_new_target_past = 40
is_past_new_target = False
if (i - dif_new_target_past >= 0):
is_past_new_target = not np.array_equal(current_target, target_points_temp[:,i-dif_new_target_past])
dif_new_target_future = 10
is_future_new_target = False
if (i + dif_new_target_future < self.N):
is_future_new_target = not np.array_equal(current_target, target_points_temp[:,i+dif_new_target_future])
# For fixation filtering
# A gaze point in a cluster has to be filtered away
# If the current target point has changed but the gaze point has not, the gaze point can still be in the old cluster, for the old target point
# This gaze point should be filtered away, since it has a large visual angle error
# If the current target is different from the previous target, but the previous target is the same as the target before that, a change has been noted
if clusters[p] == 0 or (filtering_method == "dbscan_fixation" and (is_past_new_target or is_future_new_target)):
del clusters[p]
removed_gaze = removed_gaze + 1
else:
gaze_data_left_x.append(gaze_data_left_temp[0,i])
gaze_data_left_y.append(gaze_data_left_temp[1,i])
gaze_data_right_x.append(gaze_data_right_temp[0,i])
gaze_data_right_y.append(gaze_data_right_temp[1,i])
target_points_x.append(target_points_temp[0,i])
target_points_y.append(target_points_temp[1,i])
if self.show_filtering:
colors = [colours[int(clusters[key]) % len(colours)] for key in clusters.keys()]
plt.scatter(*zip(*clusters.keys()),c=colors)
plt.title("DBScan", y=1.08)
plt.gca().xaxis.tick_top()
plt.xlim(0,1)
plt.ylim(1,0)
plt.show()
gaze_data_left = np.array([gaze_data_left_x, gaze_data_left_y])
gaze_data_right = np.array([gaze_data_right_x, gaze_data_right_y])
target_points = np.array([target_points_x, target_points_y])
if len(gaze_data_left) > 0 and len(gaze_data_right) > 0 and self.show_filtering:
self.plot_scatter(gaze_data_left, gaze_data_right, target_points, title_string="AFTER dbscan filter")
self.plot_scatter_avg(gaze_data_left, gaze_data_right, target_points, title_string="AFTER dbscan AVG")
# Remove all points after a shift of target for a half second (45 measures)
elif filtering_method == "threshold_time_fixation":
prev_target = np.array([0.0, 0.0])
wait = 0
gaze_data_left_x = []
gaze_data_left_y = []
gaze_data_right_x = []
gaze_data_right_y = []
target_points_x = []
target_points_y = []
for i in range(self.N):
current_target = target_points_temp[:,i]
if np.array_equal(current_target, prev_target):
wait += 1
if (wait > 45):
gaze_data_left_x.append(gaze_data_left_temp[0,i])
gaze_data_left_y.append(gaze_data_left_temp[1,i])
gaze_data_right_x.append(gaze_data_right_temp[0,i])
gaze_data_right_y.append(gaze_data_right_temp[1,i])
target_points_x.append(current_target[0])
target_points_y.append(current_target[1])
else:
wait = 0
prev_target = current_target
gaze_data_left = np.array([gaze_data_left_x, gaze_data_left_y])
gaze_data_right = np.array([gaze_data_right_x, gaze_data_right_y])
target_points = np.array([target_points_x, target_points_y])
if len(gaze_data_left) > 0 and len(gaze_data_right) > 0 and self.show_filtering:
self.plot_scatter(gaze_data_left, gaze_data_right, target_points, title_string="AFTER treshold filter")
self.plot_scatter_avg(gaze_data_left, gaze_data_right, target_points, title_string="AFTER treshold AVG")
# Remove all points in the first half second (45 measures)
elif filtering_method == "threshold_time_pursuit":
wait = 0
gaze_data_left_x = []
gaze_data_left_y = []
gaze_data_right_x = []
gaze_data_right_y = []
target_points_x = []
target_points_y = []
for i in range(self.N):
wait += 1
if (wait > 20):
gaze_data_left_x.append(gaze_data_left_temp[0,i])
gaze_data_left_y.append(gaze_data_left_temp[1,i])
gaze_data_right_x.append(gaze_data_right_temp[0,i])
gaze_data_right_y.append(gaze_data_right_temp[1,i])
target_points_x.append(target_points_temp[0,i])
target_points_y.append(target_points_temp[1,i])
gaze_data_left = np.array([gaze_data_left_x, gaze_data_left_y])
gaze_data_right = np.array([gaze_data_right_x, gaze_data_right_y])
target_points = np.array([target_points_x, target_points_y])
if self.show_filtering:
self.plot_scatter(gaze_data_left, gaze_data_right, target_points, title_string="AFTER treshold filter")
self.plot_scatter_avg(gaze_data_left, gaze_data_right, target_points, title_string="AFTER treshold AVG")
# Do nothing for filter out outliers
elif filtering_method == None:
gaze_data_left = gaze_data_left_temp
gaze_data_right = gaze_data_right_temp
target_points = target_points_temp
if self.show_filtering_text:
print("After Grace")
print(str(before) + " - > " + str(before - removed_gaze))
print("After DBSCAN")
print(str(before - removed_gaze) + " - > " + str(len(target_points[0,:])))
before_outlier = len(target_points[0,:])
if remove_outliers:
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
pixel_left = [[],[]]
pixel_right = [[],[]]
for left, right in zip(pixel_err_left,pixel_err_right):
pixel_left[0].append(left[0])
pixel_left[1].append(left[1])
pixel_right[0].append(right[0])
pixel_right[1].append(right[1])
pixel_err_left = np.array(pixel_left)
pixel_err_right = np.array(pixel_right)
#
# m = 1.5
#
# indices_left_x = [i for i, x in enumerate(pixel_err_left[0,:]) if abs(x - np.mean(pixel_err_left[0,:])) < m * np.std(pixel_err_left[0,:])]
# indices_left_y = [i for i, y in enumerate(pixel_err_left[1,:]) if abs(y - np.mean(pixel_err_left[1,:])) < m * np.std(pixel_err_left[1,:])]
#
# indices_right_x = [i for i, x in enumerate(pixel_err_right[0,:]) if abs(x - np.mean(pixel_err_right[0,:])) < m * np.std(pixel_err_right[0,:])]
# indices_right_y = [i for i, y in enumerate(pixel_err_right[1,:]) if abs(y - np.mean(pixel_err_right[1,:])) < m * np.std(pixel_err_right[1,:])]
#
# indices = list(set(indices_left_x) & set(indices_left_y) & set(indices_right_x) & set(indices_right_y))
#
# gaze_data_left = gaze_data_left[:,indices]
# gaze_data_right = gaze_data_right[:,indices]
# target_points = target_points[:,indices]
#
# if self.show_filtering:
# self.plot_scatter(gaze_data_left, gaze_data_right, target_points, title_string="AFTER outlier filter")
# self.plot_scatter_avg(gaze_data_left, gaze_data_right, target_points, title_string="AFTER outlier AVG")
errors = []
for left,right in zip(pixel_err_left.T, pixel_err_right.T):
errors.append(left[0]+left[1]+right[0]+right[1])
indices_to_remove = []
indices = np.array(range(len(errors)))
errors = np.array(errors)
#gudrun 5p linear = 0.17
#gudrun 5p spi = 0.07
#noel 5p linear = 0.08
remove_percent = 0.10
for i in range(int(len(errors)*remove_percent)):
index = np.where(errors == np.amax(errors))[0][0]
# print(np.amax(errors))
# print(errors[index])
# print(index)
# print("")
errors[index] = -1
indices_to_remove.append(index)
indices = np.delete(indices, indices_to_remove)
# print(errors[indices_to_remove])
gaze_data_left = gaze_data_left[:,indices]
gaze_data_right = gaze_data_right[:,indices]
target_points = target_points[:,indices]
if self.show_filtering_text:
print("After Outlier")
print(str(before_outlier) + " - > " + str(len(target_points[0,:])))
print((float(before_outlier)-float(len(target_points[0,:])))/float(before)*100.0)
self.N = len(target_points[0,:])
return (gaze_data_left, gaze_data_right, target_points)
def center_by_cluster(self, gaze_data_left, gaze_data_right):
return (self.data_correction.adjust_by_cluster_center(gaze_data_left), self.data_correction.adjust_by_cluster_center(gaze_data_right))
def animate(self, training_filename):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename, remove_nan_values = False)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
# gaze_data_left_corrected = gaze_data_left
# gaze_data_right_corrected = gaze_data_right
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected)
# set up the transformation matrices
def setup(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
# filter gaze points, remove outliers
# then redefine target as those closest to gaze points
if self.to_closest_target:
target_points = self.find_closest_target(target_points, gaze_data_left, gaze_data_right)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.calibrate_left_eye(gaze_data_left)
self.data_correction.calibrate_right_eye(gaze_data_right)
def analyze(self, training_filename, filtering_method = None, output = "points", remove_outliers=True, mean_cluster_replacement=False):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
if len(gaze_data_left) == 0 and len(gaze_data_right) == 0:
return None
if self.to_closest_target:
target_points = self.find_closest_target(target_points, gaze_data_left, gaze_data_right)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
# MEAN OF CLUSTERING ON/OFF
# gaze_data_left_corrected, gaze_data_right_corrected = self.center_by_cluster(gaze_data_left, gaze_data_right)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
# gaze_data_left_corrected = gaze_data_left
# gaze_data_right_corrected = gaze_data_right
# MEAN OF CLUSTERING ON/OFF
# if mean_cluster_replacement == True:
# gaze_data_left_corrected, gaze_data_right_corrected = self.center_by_cluster(gaze_data_left_corrected, gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected, angle_avg, angle_avg_corrected = self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# formula proof accuracy (angular offset) calc
# angle_left, angle_right, angle_avg = self.compute_angular_offset(gaze_data_left, gaze_data_right, target_points)
# angle_left_corrected, angle_right_corrected, angle_avg_corrected = self.compute_angular_offset(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
#
# accuracy_raw = np.mean(angle_avg)
# accuracy_corrected = np.mean(angle_avg_corrected)
#
# print("")
# print("############################################")
# print("Accuracy: "+u"\u03B8"+ "_offset")
# print("Accuracy (raw)\t\t" + str(accuracy_raw))
# print("Accuracy (corrected)\t" + str(accuracy_corrected))
# print("-----------")
# print("Change\t\t\t" + str((accuracy_raw - accuracy_corrected) / max(accuracy_raw, accuracy_corrected) * 100) + " %")
# print("############################################")
#
#
# # formula proof precision calc
# precision_avg = (np.mean([theta**2 for theta in angle_avg]))**0.5
# precision_avg_corrected = (np.mean([theta**2 for theta in angle_avg_corrected]))**0.5
#
# print("")
# print("############################################")
# print("Precision: RMS("+u"\u03B8" + ")")
# print("Precision (raw)\t\t" + str(precision_avg))
# print("Precision (corrected)\t" + str(precision_avg_corrected))
# print("-----------")
# print("Change\t\t\t" + str((precision_avg - precision_avg_corrected) / max(precision_avg, precision_avg_corrected) * 100) + " %")
# print("############################################")
if output == "values":
return (angle_avg, angle_avg_corrected)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_coef(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
# filter gaze points, remove outliers
# then redefine target as those closest to gaze points
if self.to_closest_target:
target_points = self.find_closest_target(target_points, gaze_data_left, gaze_data_right)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.calibrate_left_eye_coef(gaze_data_left)
self.data_correction.calibrate_right_eye_coef(gaze_data_right)
def analyze_coef(self, training_filename, filtering_method = None, output = "points", remove_outliers=True, mean_cluster_replacement=False):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
if len(gaze_data_left) == 0 and len(gaze_data_right) == 0:
return None
if self.to_closest_target:
target_points = self.find_closest_target(target_points, gaze_data_left, gaze_data_right)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
# MEAN OF CLUSTERING ON/OFF
# gaze_data_left_corrected, gaze_data_right_corrected = self.center_by_cluster(gaze_data_left, gaze_data_right)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.adjust_left_eye_coef(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye_coef(gaze_data_right)
# gaze_data_left_corrected = gaze_data_left
# gaze_data_right_corrected = gaze_data_right
# MEAN OF CLUSTERING ON/OFF
# if mean_cluster_replacement == True:
# gaze_data_left_corrected, gaze_data_right_corrected = self.center_by_cluster(gaze_data_left_corrected, gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected, angle_avg, angle_avg_corrected = self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# formula proof accuracy (angular offset) calc
# angle_left, angle_right, angle_avg = self.compute_angular_offset(gaze_data_left, gaze_data_right, target_points)
# angle_left_corrected, angle_right_corrected, angle_avg_corrected = self.compute_angular_offset(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
#
# accuracy_raw = np.mean(angle_avg)
# accuracy_corrected = np.mean(angle_avg_corrected)
#
# print("")
# print("############################################")
# print("Accuracy: "+u"\u03B8"+ "_offset")
# print("Accuracy (raw)\t\t" + str(accuracy_raw))
# print("Accuracy (corrected)\t" + str(accuracy_corrected))
# print("-----------")
# print("Change\t\t\t" + str((accuracy_raw - accuracy_corrected) / max(accuracy_raw, accuracy_corrected) * 100) + " %")
# print("############################################")
#
#
# # formula proof precision calc
# precision_avg = (np.mean([theta**2 for theta in angle_avg]))**0.5
# precision_avg_corrected = (np.mean([theta**2 for theta in angle_avg_corrected]))**0.5
#
# print("")
# print("############################################")
# print("Precision: RMS("+u"\u03B8" + ")")
# print("Precision (raw)\t\t" + str(precision_avg))
# print("Precision (corrected)\t" + str(precision_avg_corrected))
# print("-----------")
# print("Change\t\t\t" + str((precision_avg - precision_avg_corrected) / max(precision_avg, precision_avg_corrected) * 100) + " %")
# print("############################################")
if output == "values":
return (angle_avg, angle_avg_corrected)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
def getTransformationLeft(self):
return self.data_correction.transformation_matrix_left_eye
def getTransformationRight(self):
return self.data_correction.transformation_matrix_right_eye
def shuffle(self, gaze_data_left, gaze_data_right, target_points):
shuffle_indices = random.sample(range(self.N), self.N)
shuffled_gaze_data_left = [[],[]]
shuffled_gaze_data_right = [[],[]]
shuffled_target_points = [[],[]]
for i in shuffle_indices:
shuffled_gaze_data_left[0].append(gaze_data_left[0,i])
shuffled_gaze_data_left[1].append(gaze_data_left[1,i])
shuffled_gaze_data_right[0].append(gaze_data_right[0,i])
shuffled_gaze_data_right[1].append(gaze_data_right[1,i])
shuffled_target_points[0].append(target_points[0,i])
shuffled_target_points[1].append(target_points[1,i])
return (np.array(shuffled_gaze_data_left), np.array(shuffled_gaze_data_right), np.array(shuffled_target_points))
def cross_validation(self, config_file, training_filename, filtering_method = None, output = "points", k = 4):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
# Read data
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = True)
gaze_data_left, gaze_data_right, target_points = self.shuffle(gaze_data_left, gaze_data_right, target_points)
test_size = self.N / k
best_k_fold = 0
best_optimize = 0
for i in range(k):
print("")
print("")
print("CROSS VALIDATION: " + str(i + 1) + "/" + str(k))
print("")
indices = np.array(range(1, self.N))
training_indices = indices[i*test_size:(i+1)*test_size]
test_indices = np.array([j for j in indices if j not in training_indices])
training_set_left = gaze_data_left[:,training_indices]
test_set_left = gaze_data_left[:,test_indices]
training_set_right = gaze_data_right[:,training_indices]
test_set_right = gaze_data_right[:,test_indices]
training_set_target = target_points[:,training_indices]
test_set_target = target_points[:,test_indices]
self.data_correction = dc.DataCorrection(training_set_target, self.screen_width_px, self.screen_height_px)
self.data_correction.calibrate_left_eye(training_set_left)
self.data_correction.calibrate_right_eye(training_set_right)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.adjust_left_eye(test_set_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(test_set_right)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(test_set_left, test_set_right, gaze_data_left_corrected, gaze_data_right_corrected, test_set_target)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(test_set_left, test_set_right, test_set_target)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, test_set_target)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
if rmse_deg_imp > best_optimize:
best_optimize = rmse_deg_imp
best_k_fold = i
print("")
print("Best k fold, " + str(best_k_fold + 1))
print("With a given optimization of " + str(best_optimize))
print("")
indices = np.array(range(1, self.N))
training_indices = indices[best_k_fold*test_size:(best_k_fold+1)*test_size]
test_indices = np.array([j for j in indices if j not in training_indices])
training_set_left = gaze_data_left[:,training_indices]
test_set_left = gaze_data_left[:,test_indices]
training_set_right = gaze_data_right[:,training_indices]
test_set_right = gaze_data_right[:,test_indices]
training_set_target = target_points[:,training_indices]
test_set_target = target_points[:,test_indices]
self.data_correction = dc.DataCorrection(training_set_target, self.screen_width_px, self.screen_height_px)
self.data_correction.calibrate_left_eye(training_set_left)
self.data_correction.calibrate_right_eye(training_set_right)
# set up the transformation matrices
def setup_poly(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.calibrate_left_eye_poly(gaze_data_left)
self.data_correction.calibrate_right_eye_poly(gaze_data_right)
def analyze_poly(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
### error analysis - raw
# self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.adjust_left_eye_poly(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye_poly(gaze_data_right)
#gaze_data_left_corrected, gaze_data_right_corrected = self.center_by_cluster(gaze_data_left_corrected, gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
# self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
if output == "values":
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_regression(self, config_file, cal_filename, filtering_method = None, poly_degree=2):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.regression_poly_degree = poly_degree
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.calibrate_eyes_regression(gaze_data_left, gaze_data_right, degree=poly_degree)
def analyze_regression(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.adjust_left_eye_regression(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye_regression(gaze_data_right)
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
m = max(gaze_data_right[0,:])
maxindex = [i for i, j in enumerate(gaze_data_right[0,:]) if j == m]
# print("Before Correction:\t" + str((gaze_data_right[0,maxindex]*self.screen_width_px, self.screen_height_px - gaze_data_right[1,maxindex]*self.screen_height_px)))
# print("After Correction:\t" + str((gaze_data_right_corrected[0,maxindex]*self.screen_width_px, self.screen_height_px - gaze_data_right_corrected[1,maxindex]*self.screen_height_px)))
# print(self.data_correction.poly_right_x)
# print(self.data_correction.poly_right_y)
# print(self.data_correction.poly_right_x(gaze_data_right[0,maxindex])*self.screen_height_px)
# print(self.data_correction.poly_right_y(gaze_data_right[1,maxindex])*self.screen_width_px)
# print("")
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
if output == "values":
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_seb(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.calibrate_left_eye_seb(gaze_data_left)
self.data_correction.calibrate_right_eye_seb(gaze_data_right)
# gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
# gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
#
# self.data_correction.calibrate_left_eye_seb(gaze_data_left_corrected)
# self.data_correction.calibrate_right_eye_seb(gaze_data_right_corrected)
def analyze_seb(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.adjust_left_eye_seb_2(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye_seb_2(gaze_data_right)
#gaze_data_left_corrected_2 = self.data_correction.adjust_left_eye_seb_2(gaze_data_left_corrected)
#gaze_data_right_corrected_2 = self.data_correction.adjust_right_eye_seb_2(gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# self.analyze_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
if output == "values":
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_translate(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.affine_left_eye(gaze_data_left)
self.data_correction.affine_right_eye(gaze_data_right)
def analyze_translate(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.affine_adjust_left_eye(gaze_data_left)
gaze_data_right_corrected = self.data_correction.affine_adjust_right_eye(gaze_data_right)
#gaze_data_left_corrected_2 = self.data_correction.adjust_left_eye_seb_2(gaze_data_left_corrected)
#gaze_data_right_corrected_2 = self.data_correction.adjust_right_eye_seb_2(gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# self.analyze_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
if output == "values":
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_translate_mix(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.affine_calibrate_left_eye_seb(gaze_data_left)
self.data_correction.affine_calibrate_right_eye_seb(gaze_data_right)
def analyze_translate_mix(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.affine_adjust_left_eye_seb_2(gaze_data_left)
gaze_data_right_corrected = self.data_correction.affine_adjust_right_eye_seb_2(gaze_data_right)
#gaze_data_left_corrected_2 = self.data_correction.adjust_left_eye_seb_2(gaze_data_left_corrected)
#gaze_data_right_corrected_2 = self.data_correction.adjust_right_eye_seb_2(gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# self.analyze_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
if output == "values":
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_affine2(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
if self.to_closest_target:
target_points = self.find_closest_target(target_points, gaze_data_left, gaze_data_right)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.affine_left_eye2(gaze_data_left)
self.data_correction.affine_right_eye2(gaze_data_right)
# gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
# gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
#
# self.data_correction.affine_left_eye(gaze_data_left_corrected)
# self.data_correction.affine_right_eye(gaze_data_right_corrected)
# gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
# gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
#
# self.data_correction.calibrate_left_eye_seb(gaze_data_left_corrected)
# self.data_correction.calibrate_right_eye_seb(gaze_data_right_corrected)
def analyze_affine2(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
if self.to_closest_target:
target_points = self.find_closest_target(target_points, gaze_data_left, gaze_data_right)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.affine_adjust_left_eye2(gaze_data_left)
gaze_data_right_corrected = self.data_correction.affine_adjust_right_eye2(gaze_data_right)
# gaze_data_left_corrected, gaze_data_right_corrected = self.center_by_cluster(gaze_data_left_corrected, gaze_data_right_corrected)
#gaze_data_left_corrected_2 = self.data_correction.adjust_left_eye_seb_2(gaze_data_left_corrected)
#gaze_data_right_corrected_2 = self.data_correction.adjust_right_eye_seb_2(gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# self.analyze_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
# rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
# rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected, angle_avg, angle_avg_corrected = self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
if output == "values":
return (angle_avg, angle_avg_corrected)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_affine_mix(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.affine_left_eye2_mix(gaze_data_left)
self.data_correction.affine_right_eye2_mix(gaze_data_right)
# gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
# gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
#
# self.data_correction.affine_left_eye(gaze_data_left_corrected)
# self.data_correction.affine_right_eye(gaze_data_right_corrected)
# gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
# gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
#
# self.data_correction.calibrate_left_eye_seb(gaze_data_left_corrected)
# self.data_correction.calibrate_right_eye_seb(gaze_data_right_corrected)
def analyze_affine_mix(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.affine_adjust_left_eye2_mix(gaze_data_left)
gaze_data_right_corrected = self.data_correction.affine_adjust_right_eye2_mix(gaze_data_right)
#gaze_data_left_corrected_2 = self.data_correction.adjust_left_eye_seb_2(gaze_data_left_corrected)
#gaze_data_right_corrected_2 = self.data_correction.adjust_right_eye_seb_2(gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# self.analyze_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
if output == "values":
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_affine(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.affine_left_eye(gaze_data_left)
self.data_correction.affine_right_eye(gaze_data_right)
gaze_data_left_corrected = self.data_correction.affine_adjust_left_eye(gaze_data_left)
gaze_data_right_corrected = self.data_correction.affine_adjust_right_eye(gaze_data_right)
self.data_correction.calibrate_left_eye(gaze_data_left_corrected)
self.data_correction.calibrate_right_eye(gaze_data_right_corrected)
# gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
# gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
#
# self.data_correction.calibrate_left_eye_seb(gaze_data_left_corrected)
# self.data_correction.calibrate_right_eye_seb(gaze_data_right_corrected)
def analyze_affine(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
affine_gaze_data_left_corrected = self.data_correction.affine_adjust_left_eye(gaze_data_left)
affine_gaze_data_right_corrected = self.data_correction.affine_adjust_right_eye(gaze_data_right)
gaze_data_left_corrected = self.data_correction.adjust_left_eye(affine_gaze_data_left_corrected)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(affine_gaze_data_right_corrected)
#gaze_data_left_corrected_2 = self.data_correction.adjust_left_eye_seb_2(gaze_data_left_corrected)
#gaze_data_right_corrected_2 = self.data_correction.adjust_right_eye_seb_2(gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# self.analyze_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
if output == "values":
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_affine_weighted(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.affine_calibrate_left_eye_seb(gaze_data_left)
self.data_correction.affine_calibrate_right_eye_seb(gaze_data_right)
gaze_data_left_corrected = self.data_correction.affine_adjust_left_eye_seb_2(gaze_data_left)
gaze_data_right_corrected = self.data_correction.affine_adjust_right_eye_seb_2(gaze_data_right)
self.data_correction.calibrate_left_eye(gaze_data_left_corrected)
self.data_correction.calibrate_right_eye(gaze_data_right_corrected)
#
# gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
# gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
#
# self.data_correction.calibrate_left_eye_seb(gaze_data_left_corrected)
# self.data_correction.calibrate_right_eye_seb(gaze_data_right_corrected)
def analyze_affine_weighted(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.affine_adjust_left_eye_seb_2(gaze_data_left)
gaze_data_right_corrected = self.data_correction.affine_adjust_right_eye_seb_2(gaze_data_right)
gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left_corrected)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right_corrected)
#gaze_data_left_corrected_2 = self.data_correction.adjust_left_eye_seb_2(gaze_data_left_corrected)
#gaze_data_right_corrected_2 = self.data_correction.adjust_right_eye_seb_2(gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# self.analyze_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
if output == "values":
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_affine_revert(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.calibrate_left_eye(gaze_data_left)
self.data_correction.calibrate_right_eye(gaze_data_right)
gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
self.data_correction.affine_left_eye(gaze_data_left_corrected)
self.data_correction.affine_right_eye(gaze_data_right_corrected)
# gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
# gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
#
# self.data_correction.calibrate_left_eye_seb(gaze_data_left_corrected)
# self.data_correction.calibrate_right_eye_seb(gaze_data_right_corrected)
def analyze_affine_revert(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
gaze_data_left_corrected = self.data_correction.affine_adjust_left_eye(gaze_data_left_corrected)
gaze_data_right_corrected = self.data_correction.affine_adjust_right_eye(gaze_data_right_corrected)
#gaze_data_left_corrected_2 = self.data_correction.adjust_left_eye_seb_2(gaze_data_left_corrected)
#gaze_data_right_corrected_2 = self.data_correction.adjust_right_eye_seb_2(gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# self.analyze_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
if output == "values":
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_affine_revert_weighted(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.calibrate_left_eye(gaze_data_left)
self.data_correction.calibrate_right_eye(gaze_data_right)
gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
self.data_correction.affine_calibrate_left_eye_seb(gaze_data_left_corrected)
self.data_correction.affine_calibrate_right_eye_seb(gaze_data_right_corrected)
# gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
# gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
#
# self.data_correction.calibrate_left_eye_seb(gaze_data_left_corrected)
# self.data_correction.calibrate_right_eye_seb(gaze_data_right_corrected)
def analyze_affine_revert_weighted(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
gaze_data_left_corrected = self.data_correction.affine_adjust_left_eye_seb_2(gaze_data_left_corrected)
gaze_data_right_corrected = self.data_correction.affine_adjust_right_eye_seb_2(gaze_data_right_corrected)
#gaze_data_left_corrected_2 = self.data_correction.adjust_left_eye_seb_2(gaze_data_left_corrected)
#gaze_data_right_corrected_2 = self.data_correction.adjust_right_eye_seb_2(gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# self.analyze_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
if output == "values":
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_affine_poly(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.calibrate_eyes_regression(gaze_data_left, gaze_data_right)
gaze_data_left_corrected = self.data_correction.adjust_left_eye_regression(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye_regression(gaze_data_right)
self.data_correction.calibrate_left_eye(gaze_data_left_corrected)
self.data_correction.calibrate_right_eye(gaze_data_right_corrected)
# gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
# gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
#
# self.data_correction.calibrate_left_eye_seb(gaze_data_left_corrected)
# self.data_correction.calibrate_right_eye_seb(gaze_data_right_corrected)
def analyze_affine_poly(self, training_filename, filtering_method = None, output = "points", remove_outliers=True):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = remove_outliers)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
affine_gaze_data_left_corrected = self.data_correction.adjust_left_eye_regression(gaze_data_left)
affine_gaze_data_right_corrected = self.data_correction.adjust_right_eye_regression(gaze_data_right)
gaze_data_left_corrected = self.data_correction.adjust_left_eye(affine_gaze_data_left_corrected)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(affine_gaze_data_right_corrected)
#gaze_data_left_corrected_2 = self.data_correction.adjust_left_eye_seb_2(gaze_data_left_corrected)
#gaze_data_right_corrected_2 = self.data_correction.adjust_right_eye_seb_2(gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# self.analyze_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
rmse_raw, rmse_cor, rmse_imp = self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
# pixel_err_left, pixel_err_right = self.compute_pixel_errors_to_closest_target(gaze_data_left, gaze_data_right, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
rmse_deg_raw, rmse_deg_cor, rmse_deg_imp = self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
if output == "values":
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
# set up the transformation matrices
def setup_two_layer(self, config_file, cal_filename, filtering_method = None):
# read config csv file
data_frame = pd.read_csv(config_file, delimiter=";")
# read global config variables in
self.screen_width_px = data_frame['Screen width (px)'][0]
self.screen_height_px = data_frame['Screen height (px)'][0]
self.screen_size_diag_inches = data_frame['Screen size (inches)'][0]
self.dist_to_screen_cm = data_frame['Distance to screen (cm)'][0]
self.ppcm = math.sqrt(self.screen_width_px**2 + self.screen_height_px**2) / (self.screen_size_diag_inches*2.54)
gaze_data_left, gaze_data_right, target_points = self.read_data(cal_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering_setup(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = False)
self.data_correction = dc.DataCorrection(target_points, self.screen_width_px, self.screen_height_px)
self.data_correction.calibrate_left_eye(gaze_data_left)
self.data_correction.calibrate_right_eye(gaze_data_right)
gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
self.data_correction.calibrate_left_eye_poly(gaze_data_left_corrected)
self.data_correction.calibrate_right_eye_poly(gaze_data_right_corrected)
def analyze_two_layer(self, training_filename, filtering_method = None):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename)
gaze_data_left, gaze_data_right, target_points = self.filtering(gaze_data_left, gaze_data_right, target_points, filtering_method, remove_outliers = True)
### error analysis - raw
self.analyze_errors(gaze_data_left, gaze_data_right, target_points)
#------ correct raw data ------#
gaze_data_left_corrected = self.data_correction.adjust_left_eye(gaze_data_left)
gaze_data_right_corrected = self.data_correction.adjust_right_eye(gaze_data_right)
gaze_data_left_corrected_2 = self.data_correction.adjust_left_eye_poly(gaze_data_left_corrected)
gaze_data_right_corrected_2 = self.data_correction.adjust_right_eye_poly(gaze_data_right_corrected)
#------------------------------#
### error analysis - corrected
self.analyze_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
self.analyze_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
### error analysis - corrected
# fixations_filtered_left, filtered_targets = self.reject_outliers(gaze_data_left_corrected, target_points)
# fixations_filtered_right, filtered_targets = self.reject_outliers(gaze_data_right_corrected, target_points)
# self.analyze_errors(fixations_filtered_left, fixations_filtered_right, target_points)
# RMSE values for raw and corrected data (averaged btween left- and right fixations)
self.show_rms_pixel(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
self.show_accuracy_precision(gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points)
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
pixel_err_left_corrected, pixel_err_right_corrected = self.compute_pixel_errors(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
angle_err_left_corrected, angle_err_right_corrected = self.compute_visual_angle_error(pixel_err_left_corrected, pixel_err_right_corrected)
pixel_err_left_corrected_2, pixel_err_right_corrected_2 = self.compute_pixel_errors(gaze_data_left_corrected_2, gaze_data_right_corrected_2, target_points)
angle_err_left_corrected_2, angle_err_right_corrected_2 = self.compute_visual_angle_error(pixel_err_left_corrected_2, pixel_err_right_corrected_2)
rmse_deg_raw = (self.rmse_deg(angle_err_left) + self.rmse_deg(angle_err_right)) / 2
rmse_deg_cor = (self.rmse_deg(angle_err_left_corrected) + self.rmse_deg(angle_err_right_corrected)) / 2
rmse_deg_cor_2 = (self.rmse_deg(angle_err_left_corrected_2) + self.rmse_deg(angle_err_right_corrected_2)) / 2
print("RMS error raw (deg of visual angle):\t\t" + str(rmse_deg_raw))
print("RMS error corrected (deg of visual angle):\t" + str(rmse_deg_cor))
print("RMS error corrected 2 (deg of visual angle):\t" + str(rmse_deg_cor_2))
print("Change:\t\t\t" + str((rmse_deg_raw - rmse_deg_cor) / max(rmse_deg_raw, rmse_deg_cor) * 100) + " %")
print("Change 2:\t\t\t" + str((rmse_deg_raw - rmse_deg_cor_2) / max(rmse_deg_raw, rmse_deg_cor_2) * 100) + " %")
# self.show_rms_degree(angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
return (target_points, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected)
def show_rms_pixel(self, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points):
rmse_raw = (self.rmse(gaze_data_left, target_points) + self.rmse(gaze_data_right, target_points)) / 2
rmse_cor = (self.rmse(gaze_data_left_corrected, target_points) + self.rmse(gaze_data_right_corrected, target_points)) / 2
rmse_imp = (rmse_raw - rmse_cor) / max(rmse_raw, rmse_cor) * 100
if self.show_rms_pixel_bool:
print("RMS error raw:\t\t" + str(rmse_raw))
print("RMS error corrected:\t" + str(rmse_cor))
print("Change:\t\t\t" + str(rmse_imp) + " %")
return (rmse_raw, rmse_cor, rmse_imp)
def show_rms_degree(self, angle_err_left, angle_err_right, angle_err_left_corrected, angle_err_right_corrected):
rmse_deg_raw = (self.rmse_deg(angle_err_left) + self.rmse_deg(angle_err_right)) / 2
rmse_deg_cor = (self.rmse_deg(angle_err_left_corrected) + self.rmse_deg(angle_err_right_corrected)) / 2
rmse_deg_imp = (rmse_deg_raw - rmse_deg_cor) / max(rmse_deg_raw, rmse_deg_cor) * 100
if self.show_rms_degree_bool:
print("RMS error raw (deg of visual angle):\t\t" + str(rmse_deg_raw))
print("RMS error corrected (deg of visual angle):\t" + str(rmse_deg_cor))
print("Change:\t\t\t" + str(rmse_deg_imp) + " %")
return (rmse_deg_raw, rmse_deg_cor, rmse_deg_imp)
def show_accuracy_precision(self, gaze_data_left, gaze_data_right, gaze_data_left_corrected, gaze_data_right_corrected, target_points):
# formula proof accuracy (angular offset) calc
angle_left, angle_right, angle_avg = self.compute_angular_offset(gaze_data_left, gaze_data_right, target_points)
angle_left_corrected, angle_right_corrected, angle_avg_corrected = self.compute_angular_offset(gaze_data_left_corrected, gaze_data_right_corrected, target_points)
accuracy_raw = np.mean(angle_avg)
accuracy_corrected = np.mean(angle_avg_corrected)
# formula proof precision calc
precision_avg = (np.mean([theta**2 for theta in angle_avg]))**0.5
precision_avg_corrected = (np.mean([theta**2 for theta in angle_avg_corrected]))**0.5
if self.show_accuracy_precision_bool:
print("")
print("############################################")
print("Accuracy: "+u"\u03B8"+ "_offset")
print("Accuracy (raw)\t\t" + str(accuracy_raw))
print("Accuracy (corrected)\t" + str(accuracy_corrected))
print("-----------")
print("Change\t\t\t" + str((accuracy_raw - accuracy_corrected) / max(accuracy_raw, accuracy_corrected) * 100) + " %")
print("############################################")
# print("")
# print("############################################")
# print("Precision: RMS("+u"\u03B8" + ")")
# print("Precision (raw)\t\t" + str(precision_avg))
# print("Precision (corrected)\t" + str(precision_avg_corrected))
# print("-----------")
# print("Change\t\t\t" + str((precision_avg - precision_avg_corrected) / max(precision_avg, precision_avg_corrected) * 100) + " %")
# print("############################################")
return angle_left, angle_right, angle_left_corrected, angle_right_corrected, angle_avg, angle_avg_corrected
def rmse(self, fixations, targets):
return np.sqrt(((fixations - targets) ** 2).mean())
# fixations_filtered, filtered_targets = self.reject_outliers(fixations, targets)
# return np.sqrt(((fixations_filtered - filtered_targets) ** 2).mean())
def rmse_deg(self, degrees):
return np.sqrt((degrees ** 2).mean())
# degrees_filtered = degrees[abs(degrees - np.mean(degrees)) < 2 * np.std(degrees)]
# return np.sqrt((degrees_filtered ** 2).mean())
def reject_outliers(self, data, targets, m=1.5):
filtered_x = [x if abs(x - np.mean(data[0,:])) < m * np.std(data[0,:]) else sys.maxint for x in data[0,:]]
filtered_y = [y if abs(y - np.mean(data[1,:])) < m * np.std(data[1,:]) else sys.maxint for y in data[1,:]]
filtered_data = [[],[]]
filtered_targets = [[],[]]
for x,y,tx,ty in zip(filtered_x, filtered_y, targets[0,:], targets[1,:]):
if x != sys.maxint and y != sys.maxint:
filtered_data[0].append(x)
filtered_data[1].append(y)
filtered_targets[0].append(tx)
filtered_targets[1].append(ty)
return (np.array(filtered_data), np.array(filtered_targets))
def reject_outliers_no_targets(self, data, m=1.5):
return [x if abs(x - np.mean(data)) < m * np.std(data) else -1 for x in data]
def reject_outliers_gaze_only(self, data, m=1.5):
filtered_x = [x if abs(x - np.mean(data[0,:])) < m * np.std(data[0,:]) else sys.maxint for x in data[0,:]]
filtered_y = [y if abs(y - np.mean(data[1,:])) < m * np.std(data[1,:]) else sys.maxint for y in data[1,:]]
filtered_data = [[],[]]
for x,y in zip(filtered_x, filtered_y):
if x != sys.maxint and y != sys.maxint:
filtered_data[0].append(x)
filtered_data[1].append(y)
return np.array(filtered_data)
def find_closest_target(self, target_points, gaze_data_left, gaze_data_right):
closest_target_points_x = []
closest_target_points_y = []
for i, (left_x, left_y, right_x, right_y) in enumerate(zip(gaze_data_left[0,:], gaze_data_left[1,:], gaze_data_right[0,:], gaze_data_right[1,:])):
min_euclid = 2
closest_target_x = 1
closest_target_y = 1
for j, (tar_x, tar_y) in enumerate(zip(target_points[0,:], target_points[1,:])):
dist_left_x = abs(left_x - tar_x)
dist_left_y = abs(left_y - tar_y)
dist_right_x = abs(right_x - tar_x)
dist_right_y = abs(right_y - tar_y)
euclid_left = self.euclid_dist(dist_left_x, dist_left_y)
euclid_right = self.euclid_dist(dist_right_x, dist_right_y)
if euclid_left + euclid_right < min_euclid:
min_euclid = euclid_left + euclid_right
closest_target_x = tar_x
closest_target_y = tar_y
closest_target_points_x.append(closest_target_x)
closest_target_points_y.append(closest_target_y)
return np.array([closest_target_points_x, closest_target_points_y])
def analyze_errors(self, gaze_data_left, gaze_data_right, target_points):
if self.show_graphs_bool:
# compute pixel deviations from fixation to target
pixel_err_left, pixel_err_right = self.compute_pixel_errors(gaze_data_left, gaze_data_right, target_points)
# compute euclidean pixel distance from fixation to target (NORMALIZED)
pixel_dist_err_left = [self.euclid_dist(err[0], err[1]) for err in pixel_err_left]
pixel_dist_err_right = [self.euclid_dist(err[0], err[1]) for err in pixel_err_right]
# compute how much visual angle error the pixel errors correspond to
# angle_err_left, angle_err_right = self.compute_visual_angle_error(pixel_err_left, pixel_err_right)
angle_err_left, angle_err_right, angle_err_avg = self.compute_angular_offset(gaze_data_left, gaze_data_right, target_points)
#Scatter plot for fixations
self.plot_scatter(gaze_data_left, gaze_data_right, target_points, title_string="")
# self.plot_pixel_errors(pixel_dist_err_left, pixel_dist_err_right, title_string="Pixel distance error")
self.plot_pixel_errors(pixel_dist_err_left, pixel_dist_err_right, title_string="")
self.plot_angle_errors(angle_err_left, angle_err_right, title_string="Visual angle error")
# self.plot_gaze_points_in_pixels(gaze_data_left, gaze_data_right, target_points, title_string="Gaze data on screen", poly_degree=self.regression_poly_degree)
def euclid_dist(self, a, b):
return (a**2 + b**2) ** 0.5
def compute_pixel_errors_to_closest_target(self, gaze_data_left, gaze_data_right, target_points):
pixel_err_left = []
pixel_err_right = []
diff = []
for i, (left_x, left_y, right_x, right_y) in enumerate(zip(gaze_data_left[0,:], gaze_data_left[1,:], gaze_data_right[0,:], gaze_data_right[1,:])):
min_euclid = 2
min_left_x = 1
min_left_y = 1
min_right_x = 1
min_right_y = 1
min_j = 0
for j, (tar_x, tar_y) in enumerate(zip(target_points[0,:], target_points[1,:])):
dist_left_x = abs(left_x - tar_x)
dist_left_y = abs(left_y - tar_y)
dist_right_x = abs(right_x - tar_x)
dist_right_y = abs(right_y - tar_y)
euclid_left = self.euclid_dist(dist_left_x, dist_left_y)
euclid_right = self.euclid_dist(dist_right_x, dist_right_y)
if euclid_left + euclid_right < min_euclid:
min_euclid = euclid_left + euclid_right
min_left_x = dist_left_x
min_left_y = dist_left_y
min_right_x = dist_right_x
min_right_y = dist_right_y
min_j = j
pixel_err_left.append((min_left_x, min_left_y))
pixel_err_right.append((min_right_x, min_right_y))
diff.append(i - min_j)
print("")
print("Latency for eye to target: " + str(np.mean(diff)))
print("")
return (pixel_err_left, pixel_err_right)
def compute_pixel_errors(self, gaze_data_left, gaze_data_right, target_points):
pixel_err_left = [(abs(fix_x-tar_x), abs(fix_y-tar_y)) for fix_x, fix_y, tar_x, tar_y in zip(gaze_data_left[0,:], gaze_data_left[1,:], target_points[0,:], target_points[1,:])]
pixel_err_right = [(abs(fix_x-tar_x), abs(fix_y-tar_y)) for fix_x, fix_y, tar_x, tar_y in zip(gaze_data_right[0,:], gaze_data_right[1,:], target_points[0,:], target_points[1,:])]
return (pixel_err_left, pixel_err_right)
def compute_pixel_errors_as_on_screen(self, gaze_data_left, gaze_data_right, target_points):
pixel_err_left = [(fix_x-tar_x, fix_y-tar_y) for fix_x, fix_y, tar_x, tar_y in zip(gaze_data_left[0,:], gaze_data_left[1,:], target_points[0,:], target_points[1,:])]
pixel_err_right = [(fix_x-tar_x, fix_y-tar_y) for fix_x, fix_y, tar_x, tar_y in zip(gaze_data_right[0,:], gaze_data_right[1,:], target_points[0,:], target_points[1,:])]
return (pixel_err_left, pixel_err_right)
def compute_visual_angle_error(self, pixel_err_left_norm, pixel_err_right_norm):
visual_angle_err_left = []
visual_angle_err_right = []
for err_left_norm, err_right_norm in zip(pixel_err_left_norm, pixel_err_right_norm):
# convert normalized coordinates to pixel coordinates (as on screen)
px_err_left_x = err_left_norm[0] * self.screen_width_px
px_err_left_y = err_left_norm[1] * self.screen_height_px
px_err_right_x = err_right_norm[0] * self.screen_width_px
px_err_right_y = err_right_norm[1] * self.screen_height_px
# calculate distance from target to fixation of left eye in pixels on screen
px_err_left = self.euclid_dist(px_err_left_x, px_err_left_y)
px_err_right = self.euclid_dist(px_err_right_x, px_err_right_y)
# calculate visual angle error from pixel error
visual_angle_err_left_degrees = math.atan(px_err_left/(self.dist_to_screen_cm * self.ppcm)) * 180 / math.pi
visual_angle_err_right_degrees = math.atan(px_err_right/(self.dist_to_screen_cm * self.ppcm)) * 180 / math.pi
visual_angle_err_left.append(visual_angle_err_left_degrees)
visual_angle_err_right.append(visual_angle_err_right_degrees)
return (np.array(visual_angle_err_left), np.array(visual_angle_err_right))
def compute_angular_offset(self, gaze_data_left, gaze_data_right, target_points):
visual_angle_left = []
visual_angle_right = []
visual_angle_avg = []
for gazepoint_left_x, gazepoint_left_y, gazepoint_right_x, gazepoint_right_y, targetpoint_x, targetpoint_y in zip(gaze_data_left[0,:], gaze_data_left[1,:], gaze_data_right[0,:], gaze_data_right[1,:], target_points[0,:], target_points[1,:]):
# convert normalized coordinates to pixel coordinates (as on screen)
gazepoint_left_x *= self.screen_width_px
gazepoint_left_y *= self.screen_height_px
gazepoint_right_x *= self.screen_width_px
gazepoint_right_y *= self.screen_height_px
targetpoint_x *= self.screen_width_px
targetpoint_y *= self.screen_height_px
theta_left = math.atan(((abs(targetpoint_x-gazepoint_left_x)**2 + abs(targetpoint_y-gazepoint_left_y)**2))**0.5/(self.dist_to_screen_cm*self.ppcm)) * 180 / np.pi
theta_right = math.atan(((abs(targetpoint_x-gazepoint_right_x)**2 + abs(targetpoint_y-gazepoint_right_y)**2))**0.5/(self.dist_to_screen_cm*self.ppcm)) * 180 / np.pi
theta_avg = (theta_left + theta_right) / 2
visual_angle_left.append(theta_left)
visual_angle_right.append(theta_right)
visual_angle_avg.append(theta_avg)
# print("AVG ANGULAR OFFSET: " + str(np.mean(visual_angle_avg)))
return visual_angle_left, visual_angle_right, visual_angle_avg
def compute_precision(self, gaze_data_left, gaze_data_right, target_points):
precision_left = []
precision_right = []
precision_avg = []
for gazepoint_left_x, gazepoint_left_y, gazepoint_right_x, gazepoint_right_y, targetpoint_x, targetpoint_y in zip(gaze_data_left[0,:], gaze_data_left[1,:], gaze_data_right[0,:], gaze_data_right[1,:], target_points[0,:], target_points[1,:]):
# convert normalized coordinates to pixel coordinates (as on screen)
gazepoint_left_x *= self.screen_width_px
gazepoint_left_y *= self.screen_height_px
gazepoint_right_x *= self.screen_width_px
gazepoint_right_y *= self.screen_height_px
targetpoint_x *= self.screen_width_px
targetpoint_y *= self.screen_height_px
theta_left = math.atan(((abs(targetpoint_x-gazepoint_left_x)**2 + abs(targetpoint_y-gazepoint_left_y)**2))**0.5/(self.dist_to_screen_cm*self.ppcm)) * 180 / np.pi
theta_right = math.atan(((abs(targetpoint_x-gazepoint_right_x)**2 + abs(targetpoint_y-gazepoint_right_y)**2))**0.5/(self.dist_to_screen_cm*self.ppcm)) * 180 / np.pi
theta_avg = (theta_left + theta_right) / 2
visual_angle_left.append(theta_left)
visual_angle_right.append(theta_right)
visual_angle_avg.append(theta_avg)
return visual_angle_left, visual_angle_right
def plot_scatter(self, gaze_data_left, gaze_data_right, targets, title_string="", show=True):
x_left = gaze_data_left[0,:]
y_left = gaze_data_left[1,:]
x_right = gaze_data_right[0,:]
y_right = gaze_data_right[1,:]
x_targets = targets[0,:]
y_targets = targets[1,:]
fig = plt.figure()
ax = fig.gca()
# stimuli1 = plt.Circle((0.25,0.25), 0.0375, fill=True, color='#1f77b4', linewidth=3, label="stimuli")
# stimuli2 = plt.Circle((0.25,0.75), 0.0375, fill=True, color='#1f77b4', linewidth=3, label="stimuli")
# stimuli3 = plt.Circle((0.75,0.25), 0.0375, fill=True, color='#1f77b4', linewidth=3, label="stimuli")
# stimuli4 = plt.Circle((0.75,0.75), 0.0375, fill=True, color='#1f77b4', linewidth=3, label="stimuli")
# stimuli5 = plt.Circle((0.5,0.5), 0.0375, fill=True, color='#1f77b4', linewidth=3, label="stimuli")
# ax.add_artist(stimuli1)
# ax.add_artist(stimuli2)
# ax.add_artist(stimuli3)
# ax.add_artist(stimuli4)
# ax.add_artist(stimuli5)
scatter_left = plt.scatter(x_left, y_left, marker='x', color='red',zorder=2)
scatter_right = plt.scatter(x_right, y_right, marker='x', color='green',zorder=2)
scatter_target = plt.scatter(x_targets, y_targets, marker='o', color='black',zorder=2)
plt.legend((scatter_left, scatter_right),("left eye", "right eye"))
ax.legend((scatter_left, scatter_right, scatter_target),
("left eye", "right eye", "target points"), loc=0)
ax.set_title(title_string, y=1.08)
ax.xaxis.tick_top()
ax.set_xlim(0,1)
ax.set_ylim(1,0)
# plt.xlim(0.65,0.9)
# plt.ylim(0.7,0.8)
if (show == True):
plt.show()
def plot_scatter_avg(self, gaze_data_left, gaze_data_right, targets, title_string=""):
gaze_data_avg = np.mean(np.array([gaze_data_left, gaze_data_right]), axis=0)
scatter_avg = plt.scatter(gaze_data_avg[0,:], gaze_data_avg[1,:], marker='x', color='blue')
scatter_target = plt.scatter(targets[0,:], targets[1,:], marker='^', color='black')
plt.legend((scatter_avg, scatter_target),
("avg eye", "target points"))
plt.title(title_string, y=1.08)
plt.gca().xaxis.tick_top()
plt.xlim(0,1)
plt.ylim(1,0)
plt.show()
def plot_angle_errors(self, err_left, err_right, title_string=""):
self.plot_pixel_errors(err_left, err_right, title_string, y_max=6)
def plot_pixel_errors(self, err_left, err_right, title_string="", y_max=1):
plot_left, = plt.plot(range(0,self.N), err_left, color='red', label="left eye")
plot_right, = plt.plot(range(0,self.N), err_right, color='green', label="right eye")
plt.legend(handles=[plot_left, plot_right])
plt.xlabel("Observation")
plt.ylabel("Normalized pixel error")
plt.title(title_string)
plt.ylim(0,y_max)
plt.show()
def plot_gaze_points_in_pixels(self, gaze_data_left, gaze_data_right, target_points, title_string="", poly_degree=2):
# the gaze data recorded is normalized
# flip y-coordinates to turn recording coordinate system (origo in top-left) into screen coordinate system (origo in bottom-left)
px_left_x = gaze_data_left[0,:] * self.screen_width_px
px_left_y = self.screen_height_px - gaze_data_left[1,:] * self.screen_height_px
px_right_x = gaze_data_right[0,:] * self.screen_width_px
px_right_y = self.screen_height_px - gaze_data_right[1,:] * self.screen_height_px
px_target_x = target_points[0,:] * self.screen_width_px
px_target_y = self.screen_height_px - target_points[1,:] * self.screen_height_px
gaze_data_avg = np.mean(np.array([gaze_data_left, gaze_data_right]), axis=0)
px_gaze_avg_x = gaze_data_avg[0,:] * self.screen_width_px
px_gaze_avg_y = self.screen_height_px - gaze_data_avg[1,:] * self.screen_height_px
# px_left = np.array([px_left_x, px_left_y])
# px_right = np.array([px_right_x, px_right_y])
# px_avg = (px_left + px_right)/2
fig = plt.figure(1, figsize=(18,12))
subplot_gaze_pixels = fig.add_subplot(2,2,2)
subplot_vertical_err = fig.add_subplot(2,2,4)
subplot_horizontal_err = fig.add_subplot(2,2,1)
## PLOT LEFT EYE AND TARGETS
# scatter_left = plt.scatter(px_left_x, px_left_y, marker='x', color="red")
# scatter_targets = plt.scatter(px_target_x, px_target_y, marker='o', color="black")
# # plot lines from targets to gaze points
## for i in range(len(px_target_x)):
## plt.plot([px_target_x[i], px_left_x[i]],[px_target_y[i], px_left_y[i]], 'k-')
# plt.xlim(0,self.screen_width_px)
# plt.ylim(0,self.screen_height_px)
# plt.title("Left eye gaze data as on screen")
# plt.xlabel("Screen width (pixels)")
# plt.ylabel("Screen height (pixels)")
# plt.legend((scatter_left, scatter_targets),
# ("left eye", "target points"))
# plt.show()
## PLOT RIGHT EYE AND TARGETS
scatter_right = subplot_gaze_pixels.scatter(px_right_x, px_right_y, marker='x', color="green")
scatter_targets = subplot_gaze_pixels.scatter(px_target_x, px_target_y, marker='o', color="black")
# plot lines from targets to gaze points
# for i in range(len(px_target_x)):
# plt.plot([px_target_x[i], px_left_x[i]],[px_target_y[i], px_left_y[i]], 'k-')
subplot_gaze_pixels.set_xlim(0,self.screen_width_px)
subplot_gaze_pixels.set_ylim(0,self.screen_height_px)
# subplot_gaze_pixels.set_title("Right eye gaze data as on screen")
subplot_gaze_pixels.set_xlabel("Screen width (pixels)", fontsize=18)
subplot_gaze_pixels.set_ylabel("Screen height (pixels)", fontsize=18)
subplot_gaze_pixels.legend((scatter_right, scatter_targets),
("right eye", "target points"))
## plt.show()
subplot_gaze_pixels.tick_params(axis='both', which='major', labelsize=14)
# scatter_avg = subplot_gaze_pixels.scatter(px_gaze_avg_x, px_gaze_avg_y, marker='x')
# scatter_targets = subplot_gaze_pixels.scatter(px_target_x, px_target_y, marker='o', color="black")
#
# subplot_gaze_pixels.set_xlim(0,self.screen_width_px)
# subplot_gaze_pixels.set_ylim(0,self.screen_height_px)
## subplot_gaze_pixels.set_title("Avg eye gaze data as on screen")
# subplot_gaze_pixels.set_xlabel("Screen width (pixels)")
# subplot_gaze_pixels.set_ylabel("Screen height (pixels)")
# subplot_gaze_pixels.legend((scatter_avg, scatter_targets), ("Gaze points (avg)", "target points"))
## CAlCULATE VERTICAL ERRORS AS GAZE VARIES HORIZONTALLY
# convert normalized coordinates to pixel coordinates (as on screen)
pixel_err_left, pixel_err_right = self.compute_pixel_errors_as_on_screen(gaze_data_left, gaze_data_right, target_points)
px_err_left_x = []
px_err_left_y = []
px_err_right_x = []
px_err_right_y = []
for err_left_norm, err_right_norm in zip(pixel_err_left, pixel_err_right):
px_err_left_x.append(err_left_norm[0] * self.screen_width_px)
px_err_left_y.append(err_left_norm[1] * self.screen_height_px)
px_err_right_x.append(err_right_norm[0] * self.screen_width_px)
px_err_right_y.append(err_right_norm[1] * self.screen_height_px)
px_err_avg_x = np.mean(np.array([px_err_left_x, px_err_right_x]), axis=0)
px_err_avg_y = np.mean(np.array([px_err_left_y, px_err_right_y]), axis=0)
# px_err_left_x, px_left_y = self.data_correction.reject_outliers(px_err_left_x, px_left_y)
# px_err_left_y, px_left_x = self.data_correction.reject_outliers(px_err_left_y, px_left_x)
# px_err_right_x, px_right_y = self.data_correction.reject_outliers(px_err_right_x, px_right_y)
# px_err_right_y, px_right_x = self.data_correction.reject_outliers(px_err_right_y, px_right_x)
# fit a qudratic line for the vertical errors
# poly_left_x = np.poly1d(np.polyfit(px_left_x, px_err_left_y, 2))
# poly_left_y = np.poly1d(np.polyfit(px_left_y, px_err_left_x, 2))
# poly_right_x = np.poly1d(np.polyfit(px_right_x, px_err_right_y, 2))
# poly_right_y = np.poly1d(np.polyfit(px_right_y, px_err_right_x, 2))
poly_left_x = np.poly1d(np.polyfit(px_left_x, px_err_left_y, poly_degree))
poly_left_y = np.poly1d(np.polyfit(px_left_y, px_err_left_x, poly_degree))
poly_right_x = np.poly1d(np.polyfit(px_right_x, px_err_right_y, poly_degree))
poly_right_y = np.poly1d(np.polyfit(px_right_y, px_err_right_x, poly_degree))
#
# poly_right_x, det_right_x = self.polyfit(px_right_x, px_err_right_y, poly_degree)
# poly_right_y, det_right_y = self.polyfit(px_right_y, px_err_right_x, poly_degree)
poly_avg_x = np.poly1d(np.polyfit(px_gaze_avg_x, px_err_avg_y, poly_degree))
poly_avg_y = np.poly1d(np.polyfit(px_gaze_avg_y, px_err_avg_x, poly_degree))
# calculate new x's and y's
# line_y_left_x = poly_left_x(px_left_x)
# line_y_left_y = poly_left_y(px_left_y)
# line_y_right_x = poly_right_x(px_right_x)
# line_y_right_y = poly_right_y(px_right_y)
#
# subplot_vertical_err.scatter(px_right_x, [-a for a in px_err_right_y])
# px_right_x_sorted = np.sort(px_right_x)
# subplot_vertical_err.plot(px_right_x_sorted, -poly_right_x(px_right_x_sorted), color="orange")
## subplot_vertical_err.set_title("Right eye vertical error as gaze varies horizontally")
# subplot_vertical_err.set_xlabel("Screen width (pixels)")
# subplot_vertical_err.set_ylabel("Vertical error (pixels)")
# subplot_vertical_err.set_xlim(0, self.screen_width_px)
#
#
#
# subplot_horizontal_err.scatter(px_err_right_x, px_right_y)
# px_right_y_sorted = np.sort(px_right_y)
# subplot_horizontal_err.plot(poly_right_y(px_right_y_sorted), px_right_y_sorted, color="orange")
## subplot_horizontal_err.set_title("Right eye horizontal error as gaze varies vertically")
# subplot_horizontal_err.set_xlabel("Horizontal error (pixels)")
# subplot_horizontal_err.set_ylabel("Screen height (pixels)")
# subplot_horizontal_err.set_ylim(0,self.screen_height_px)
##
# plt.show()
fitname = "linear" if poly_degree == 1 else "quadratic" if poly_degree == 2 else "cubic" if poly_degree == 3 else "quartic" if poly_degree == 4 else "quintic" if poly_degree == 5 else "sextic" if poly_degree == 6 else "7+"
subplot_vertical_err.scatter(px_right_x, [-a for a in px_err_right_y])
gaze_data_right_x = np.sort(gaze_data_right[0,:])
subplot_vertical_err.plot(gaze_data_right_x*self.screen_width_px, self.data_correction.poly_right_x(gaze_data_right_x)*self.screen_height_px, color="orange", linewidth=3.0)
# subplot_vertical_err.set_title("Right eye vertical error as gaze varies horizontally")
subplot_vertical_err.set_xlabel("Screen width (pixels)", fontsize=18)
subplot_vertical_err.set_ylabel("Vertical error (pixels)", fontsize=18)
subplot_vertical_err.set_xlim(0, self.screen_width_px)
subplot_vertical_err.set_ylim(-40, 100)
subplot_vertical_err.tick_params(axis='both', which='major', labelsize=14)
subplot_vertical_err.legend([fitname + " fit","gaze error (right eye)"])
subplot_horizontal_err.scatter(px_err_right_x, px_right_y)
gaze_data_right_y = np.sort(gaze_data_right[1,:])
subplot_horizontal_err.plot(self.data_correction.poly_right_y(gaze_data_right_y)*self.screen_width_px, gaze_data_right_y*self.screen_height_px, color="orange", linewidth=3.0)
# subplot_horizontal_err.set_title("Right eye horizontal error as gaze varies vertically")
subplot_horizontal_err.set_xlabel("Horizontal error (pixels)", fontsize=18)
subplot_horizontal_err.set_ylabel("Screen height (pixels)", fontsize=18)
subplot_horizontal_err.set_ylim(0,self.screen_height_px)
subplot_horizontal_err.tick_params(axis='both', which='major', labelsize=14)
subplot_vertical_err.legend([fitname + " fit","gaze error (right eye)"])
#
plt.show()
# subplot_vertical_err.scatter(px_gaze_avg_x, [-e for e in px_err_avg_y])
# subplot_vertical_err.plot(px_gaze_avg_x, -poly_avg_x(px_gaze_avg_x), color="orange")
# subplot_vertical_err.set_xlabel("Screen width (pixels)")
# subplot_vertical_err.set_ylabel("Vertical error (pixels)")
# subplot_vertical_err.set_xlim(0, self.screen_width_px)
#
# subplot_horizontal_err.scatter(px_err_avg_x, px_gaze_avg_y)
# subplot_horizontal_err.plot(poly_avg_y(px_gaze_avg_y), px_gaze_avg_y, color="orange")
# subplot_horizontal_err.set_xlabel("Horizontal error (pixels)")
# subplot_horizontal_err.set_ylabel("Screen height (pixels)")
# subplot_horizontal_err.set_ylim(0,self.screen_height_px)
##
# plt.show()
# Polynomial Regression
def polyfit(self, x, y, degree):
coeffs = np.polyfit(x, y, degree)
# r-squared
p = np.poly1d(coeffs)
# fit values, and mean
yhat = p(x) # or [p(z) for z in x]
ybar = np.sum(y)/len(y) # or sum(y)/len(y)
ssreg = np.sum((yhat-ybar)**2) # or sum([ (yihat - ybar)**2 for yihat in yhat])
sstot = np.sum((y - ybar)**2) # or sum([ (yi - ybar)**2 for yi in y])
det = ssreg / sstot
return (p, det)
def pattern_recognition(self, training_filename, filtering_method = None, output = "points"):
gaze_data_left, gaze_data_right, target_points = self.read_data(training_filename, filtering_method)
n = len(target_points[0,:])
target_degrees = []
gaze_left_degrees = []
gaze_right_degrees = []
look_up = 5
for i in range(n):
start_index = i - look_up
end_index = i + look_up
if i < look_up:
start_index = 0
if i + 5 > n - 1:
end_index = n - 1
target_degree = []
gaze_left_degree = []
gaze_right_degree = []
while start_index < end_index:
target_degree.append(self.find_degree(target_points, start_index))
gaze_left_degree.append(self.find_degree(gaze_data_left, start_index))
gaze_right_degree.append(self.find_degree(gaze_data_right, start_index))
start_index += 1
target_degrees.append(np.average(target_degree))
gaze_left_degrees.append(np.average(gaze_left_degree))
gaze_right_degrees.append(np.average(gaze_right_degree))
correct_left = 0
correct_right = 0
error_left = 0
error_right = 0
for i in range(n):
if (target_degrees[i] > 0 and gaze_left_degrees[i] > 0) or (target_degrees[i] < 0 and gaze_left_degrees[i] < 0):
correct_left += 1
else:
error_left += 1
if (target_degrees[i] > 0 and gaze_right_degrees[i] > 0) or (target_degrees[i] < 0 and gaze_right_degrees[i] < 0):
correct_right += 1
else:
error_right += 1
print("Correct left: " + str(correct_left))
print("Correct right: " + str(correct_right))
print("Error left: " + str(error_left))
print("Error right: " + str(error_right))
def find_degree(self, points, index):
s = points[:,index]
e = points[:,index + 1]
radians = math.atan2(e[0] - s[0], e[1] - s[1])
degree = math.degrees(radians)
return degree
def get_pattern_eq(self, pathing, targets):
# (-0.5,-0.5), (0.3, 0.5), (0.5, -0.5), (0.0, 0.0)
equations = [];
count = 0
# filter target to turning pointpositions
positions = targets
if (pathing == "linear"): # iterate line segments
prevSlope = None
prevYInter = None
for i in range(len(positions)):
if i == len(positions)-1:
break
p = positions[i]
q = positions[i+1]
p_x = round(p[0], 5)
p_y = round(p[1], 5)
q_x = round(q[0], 5)
q_y = round(q[1], 5)
if p_x == q_x and p_y == q_y:
continue
slope = round((p_y-q_y)/(p_x-q_x), 5)
y_inter = round(slope * -p_x + p_y, 5)
slope_min = abs(slope * 0.95)
slope_max = abs(slope * 1.05)
if prevSlope < slope_min or slope_max < prevSlope:
prevSlope = abs(slope)
prevYInter = y_inter
count = 0
else:
count += 1
if count == 9:
equations.append((i-count, slope, y_inter))
elif pathing == "circle": # calc center and avg radius to determine circ eq
## find opposing points to make a diamter line
# targets = targets.T
# avg = np.mean(targets, axis=1)
# avg_r = np.array([((p[0]-avg[0])**2 + (p[1]-avg[1])**2)**0.5 for p in targets]).mean()
#
# best = targets[:,0]
# dist = ((best[0]-avg[0])**2 + (best[1]-avg[1])**2)**0.5
# for p in targets.T:
## _dist = ((p[0]-avg[0])**2 + (p[1]-avg[1])**2)**0.5
## print(_dist)
# if abs(((p[0]-avg[0])**2 + (p[1]-avg[1])**2)**0.5 - avg_r) < abs(dist - avg_r):
# best = p
# dist = ((best[0]-avg[0])**2 + (best[1]-avg[1])**2)**0.5
# equations.append((avg, best, dist))
# targets = targets.T
# diameters = []
# for i in range(len(targets)/2):
# p = targets[i]
# q = targets[(i+(len(targets)-1)/2)%len(targets)]
# d = ((p[0]-q[0])**2 + (p[1]-q[1])**2) ** 0.5
# diameters.append(d)
# r_avg = np.array(diameters).mean()/2
#
# best = None
# for i in range(len(targets)):
# p = targets[i]
# q = targets[(i+(len(targets)-1)/2)%len(targets)]
# r = ((p[0]-q[0])**2 + (p[1]-q[1])**2) ** 0.5 / 2
# if best == None:
# best = (r, p, q)
# elif abs(r_avg - r) < abs(r_avg - best[0]):
# best = (r, p, q)
#
## print(best)
# dx = (best[1][0]-best[2][0])/2
# dy = (best[1][1]-best[2][1])/2
# s = (best[2][0]+dx, best[2][1]+dy) # (x0,y0)
#
# a = best[0]
# b = abs(r_avg**2-a**2)**0.5
#
## a = (dx**2+dy**2)**0.5
## b = (best[0]**2-a**2)**0.5
#
# x3 = s[0] + b*dy/a
# y3 = s[1] - b*dx/a
## print((x3, y3))
# center_pos = (x3,y3)
# start_pos = best[1] # or best[2]
# radius = best[0]
## equations.append((center_pos, start_pos, radius))
#
# equations.append((center_pos, start_pos, radius))
# http://www.cs.bsu.edu/homepages/kjones/kjones/circles.pdf
n = len(targets)
sumx = sum([p[0] for p in targets])
sumxx = sum([p[0]**2 for p in targets])
sumy = sum([p[1] for p in targets])
sumyy = sum([p[1]**2 for p in targets])
d11 = n * sum([p[0] * p[1] for p in targets]) - sumx * sumy
d20 = n * sumxx - sumx * sumx
d02 = n * sumyy - sumy * sumy
d30 = n * sum([p[0]**3 for p in targets]) - sumxx * sumx
d03 = n * sum([p[1]**3 for p in targets]) - sumyy * sumy
d21 = n * sum([p[0]**2 * p[1] for p in targets]) - sumxx * sumy
d12 = n * sum([p[0] * p[1]**2 for p in targets]) - sumyy * sumx
x = ((d30 + d12) * d02 - (d03 + d21) * d11) / (2 * (d20 * d02 - d11 * d11))
y = ((d03 + d21) * d20 - (d30 + d12) * d11) / (2 * (d20 * d02 - d11 * d11))
c = (sumxx + sumyy - 2 * x * sumx - 2 * y * sumy) / n
r = (c + x**2 + y**2)**0.5
# pdfR = sum([((p[0]-x)**2+(p[1]-y)**2)**0.5/n for p in targets])
# print(pdfR)
equations.append(((x,y), r))
return equations
def best_fit(self, X, Y):
xbar = sum(X)/len(X)
ybar = sum(Y)/len(Y)
n = len(X) # or len(Y)
numer = float(sum([xi*yi for xi,yi in zip(X, Y)]) - n * xbar * ybar)
denum = float(sum([xi**2 for xi in X]) - n * xbar**2)
a = numer / denum
b = ybar - a * xbar
return a, b
def get_avg(self, data1, data2):
return np.mean(np.array([data1, data2]), axis=0)
def fetch_transformations(self):
left = self.data_correction.get_trans_matrix_left()
right = self.data_correction.get_trans_matrix_right()
return left, right
def plot_visual_angle_ring(self, center, angles_degrees):
fig, ax = plt.subplots()
plt.gca().xaxis.tick_top()
plt.xlim(0,1)
plt.ylim(1,0)
colors = ['#ff7f0e', 'purple', '#2ca02c', 'red', 'cyan', 'yellow', 'green', 'brown', 'darkgrey', 'orange', 'mediumspringgreen', 'cadetblue', 'fuchsia', 'crimson']
stimuli = plt.Circle(center, 0.0375, fill=True, color='#1f77b4', linewidth=3, label="stimuli")
ax.add_artist(stimuli)
angle_rings = [stimuli]
for i in range(len(angles_degrees)):
theta = angles_degrees[i]
r = self.dist_to_screen_cm*self.ppcm*math.tan(theta*math.pi/180)
# normalize r from pixels
r = r / self.screen_width_px
x = center[0] - r
angle_ring = plt.Circle(center, r, fill=False, color=colors[i%len(colors)], linewidth=2, label=r'$\theta$ = ' + str(theta) + r'$^\circ$')
ax.add_artist(angle_ring)
angle_rings.append(angle_ring)
ax.legend(handles=angle_rings)
plt.show()
def plot_exercises(self):
from psychopy_tobii_controller.tobii_wrapper import tobii_controller
controller = tobii_controller(1280, 1024)
fixation_positions = [(-0.5,-0.5), (0.5,-0.5), (-0.5, 0.5), (0.5, 0.5), (0.0, 0.0)]
xs = [t[0] for t in fixation_positions]
ys = [t[1] for t in fixation_positions]
plt.scatter(xs, ys)
plt.xlim(-1,1)
plt.ylim(-1,1)
plt.show()
pursuit_exercise_params = [("linear", [(-0.5,-0.5), (0.3, 0.5), (0.5, -0.5), (0.0, 0.0)]), ("circle", [(-0.7,0.0), (0.0, 0.0)]), ("spiral", [(-0.7,0.0), (0.0, 0.0)])]
for params in pursuit_exercise_params:
intermediate_positions = controller.calc_pursuit_route(params[0], params[1])
xs = [t[0] for t in intermediate_positions]
ys = [t[1] for t in intermediate_positions]
plt.scatter(xs, ys)
plt.xlim(-1,1)
plt.ylim(-1,1)
plt.show()
| 55.911765 | 256 | 0.670942 | 19,941 | 148,278 | 4.547666 | 0.027632 | 0.10542 | 0.085439 | 0.04852 | 0.888295 | 0.869063 | 0.850968 | 0.83811 | 0.818724 | 0.806319 | 0 | 0.011575 | 0.233818 | 148,278 | 2,652 | 257 | 55.911765 | 0.786652 | 0.257402 | 0 | 0.568966 | 0 | 0 | 0.032581 | 0.00316 | 0 | 0 | 0 | 0 | 0 | 1 | 0.054859 | false | 0 | 0.007053 | 0.00627 | 0.116771 | 0.032132 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
4f2e3f857fabf69a22b156628dafab280c6f1653 | 93 | py | Python | parsevasp/__init__.py | DropD/parsevasp | 05e2b04abd381e92b14d91218bdce2edb5529437 | [
"MIT"
] | null | null | null | parsevasp/__init__.py | DropD/parsevasp | 05e2b04abd381e92b14d91218bdce2edb5529437 | [
"MIT"
] | null | null | null | parsevasp/__init__.py | DropD/parsevasp | 05e2b04abd381e92b14d91218bdce2edb5529437 | [
"MIT"
] | 1 | 2018-07-19T09:17:31.000Z | 2018-07-19T09:17:31.000Z | import parsevasp.xml
import parsevasp.poscar
import parsevasp.incar
import parsevasp.kpoints
| 18.6 | 24 | 0.870968 | 12 | 93 | 6.75 | 0.5 | 0.740741 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086022 | 93 | 4 | 25 | 23.25 | 0.952941 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
4f563c306db2e201ab33e6325306edafb6c506c1 | 4,633 | py | Python | misc/deit_dentsity_refiner.py | Wightslayer/ViCCT | a2e3347cd8d505bb3b5119f67c750f29c018a9c4 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-22T16:38:08.000Z | 2022-03-22T16:38:08.000Z | misc/deit_dentsity_refiner.py | Wightslayer/ViCCT | a2e3347cd8d505bb3b5119f67c750f29c018a9c4 | [
"Apache-2.0",
"MIT"
] | null | null | null | misc/deit_dentsity_refiner.py | Wightslayer/ViCCT | a2e3347cd8d505bb3b5119f67c750f29c018a9c4 | [
"Apache-2.0",
"MIT"
] | null | null | null | # import torch
#
#
# def get_patches(img, crop_size):
# _, im_h, im_w = img.shape
#
# patches1 = []
# patches1_coords = []
# patches2 = []
# patches2_coords = []
# patches3 = []
# patches3_coords = []
# patches8 = []
# patches8_coords = []
#
# h_pivot = 8
# while h_pivot < im_h - 8:
#
# w_pivot = 8
# while w_pivot < im_w - 8:
# y1 = h_pivot if h_pivot + crop_size < im_h - 8 else im_h - crop_size - 8
# y2 = y1 + crop_size
# x1 = w_pivot if w_pivot + crop_size < im_w - 8 else im_w - crop_size - 8
# x2 = x1 + crop_size
# patches1.append(img[:, y1 - 8:y2 - 8, x1 - 8:x2 - 8])
# patches1_coords.append((y1 - 8, y2 - 8, x1 - 8, x2 - 8))
# patches2.append(img[:, y1 - 8:y2 - 8, x1 + 8:x2 + 8])
# patches2_coords.append((y1 - 8, y2 - 8, x1 + 8, x2 + 8))
# patches3.append(img[:, y1 + 8:y2 + 8, x1 - 8:x2 - 8])
# patches3_coords.append((y1 + 8, y2 + 8, x1 - 8, x2 - 8))
# patches8.append(img[:, y1 + 8:y2 + 8, x1 + 8:x2 + 8])
# patches8_coords.append((y1 + 8, y2 + 8, x1 + 8, x2 + 8))
# w_pivot += crop_size
# h_pivot += crop_size
#
# return (patches1, patches2, patches3, patches8), \
# (patches1_coords, patches2_coords, patches3_coords, patches8_coords)
#
#
# def refine_density(model, den, img):
# crop_size = model.crop_size
# mask = torch.zeros((crop_size, crop_size)) # Make a mask, we only want the centre 8 x 8 pixels per 32 x 32 block
# for h in range(crop_size):
# for w in range(crop_size):
# if 8 <= h % 32 < 12 and 8 <= w % 32 < 12:
# mask[h, w] = 1
#
# all_patches, all_patches_coords = get_patches(img, crop_size)
# for patches, patches_coords in zip(all_patches, all_patches_coords):
# patch_stack = torch.stack(patches).cuda()
#
# out_den, out_count = model(patch_stack)
# out_den = out_den.squeeze().cpu()
#
# for i in range(len(patches_coords)):
# y1, y2, x1, x2 = patches_coords[i]
# pred = out_den[i]
# den[y1:y2, x1:x2] = den[y1:y2, x1:x2] - mask * den[y1:y2, x1:x2] # Remove old value
# den[y1:y2, x1:x2] = den[y1:y2, x1:x2] + mask * pred # Insert new value
#
# return den
import torch
def get_patches(img, crop_size):
_, im_h, im_w = img.shape
patches1 = []
patches1_coords = []
patches2 = []
patches2_coords = []
patches3 = []
patches3_coords = []
patches8 = []
patches8_coords = []
h_pivot = 8
while h_pivot < im_h - 8:
w_pivot = 8
while w_pivot < im_w - 8:
y1 = h_pivot if h_pivot + crop_size < im_h - 8 else im_h - crop_size - 8
y2 = y1 + crop_size
x1 = w_pivot if w_pivot + crop_size < im_w - 8 else im_w - crop_size - 8
x2 = x1 + crop_size
patches1.append(img[:, y1 - 8:y2 - 8, x1 - 8:x2 - 8])
patches1_coords.append((y1 - 8, y2 - 8, x1 - 8, x2 - 8))
patches2.append(img[:, y1 - 8:y2 - 8, x1 + 8:x2 + 8])
patches2_coords.append((y1 - 8, y2 - 8, x1 + 8, x2 + 8))
patches3.append(img[:, y1 + 8:y2 + 8, x1 - 8:x2 - 8])
patches3_coords.append((y1 + 8, y2 + 8, x1 - 8, x2 - 8))
patches8.append(img[:, y1 + 8:y2 + 8, x1 + 8:x2 + 8])
patches8_coords.append((y1 + 8, y2 + 8, x1 + 8, x2 + 8))
w_pivot += crop_size
h_pivot += crop_size
return (patches1, patches2, patches3, patches8), \
(patches1_coords, patches2_coords, patches3_coords, patches8_coords)
def refine_density(model, den, img):
crop_size = model.crop_size
mask = torch.zeros((crop_size, crop_size)) # Make a mask, we only want the centre 8 x 8 pixels per 32 x 32 block
for h in range(crop_size):
for w in range(crop_size):
if 8 <= h % 32 < 24 and 8 <= w % 32 < 24:
mask[h, w] = 1
all_patches, all_patches_coords = get_patches(img, crop_size)
for patches, patches_coords in zip(all_patches, all_patches_coords):
patch_stack = torch.stack(patches).cuda()
out_den = model(patch_stack)
out_den = out_den.squeeze().cpu()
for i in range(len(patches_coords)):
y1, y2, x1, x2 = patches_coords[i]
pred = out_den[i]
den[y1:y2, x1:x2] = den[y1:y2, x1:x2] - mask * den[y1:y2, x1:x2] # Remove old value
den[y1:y2, x1:x2] = den[y1:y2, x1:x2] + mask * pred # Insert new value
return den | 37.064 | 119 | 0.542845 | 698 | 4,633 | 3.415473 | 0.100287 | 0.107383 | 0.033557 | 0.040268 | 0.987416 | 0.987416 | 0.987416 | 0.987416 | 0.987416 | 0.987416 | 0 | 0.09088 | 0.320743 | 4,633 | 125 | 120 | 37.064 | 0.666667 | 0.507662 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.040816 | false | 0 | 0.020408 | 0 | 0.102041 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
4f62e853f0aa02db0797360cbdbe472ecfb67451 | 169 | py | Python | fourbars/__init__.py | kant/4bars | 15661ab3e589404898f6adcb5a4f630a8027fb4b | [
"MIT"
] | null | null | null | fourbars/__init__.py | kant/4bars | 15661ab3e589404898f6adcb5a4f630a8027fb4b | [
"MIT"
] | null | null | null | fourbars/__init__.py | kant/4bars | 15661ab3e589404898f6adcb5a4f630a8027fb4b | [
"MIT"
] | null | null | null | #from .core.core import FourBars
#from .core.spawn import Cmd
#from .core.static import Static
#from .core.core_args import ParserCmd
#from .alive.alive import ALive
| 18.777778 | 38 | 0.775148 | 26 | 169 | 5 | 0.384615 | 0.246154 | 0.184615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136095 | 169 | 8 | 39 | 21.125 | 0.890411 | 0.923077 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
4f704fd50ca5fb5e2569bed9e1661da672bdc934 | 2,815 | py | Python | spotlight/tests/unique_test.py | eelkevdbos/spotlight | 429a32fd318b3110074884683bef7fe675740ee3 | [
"MIT"
] | null | null | null | spotlight/tests/unique_test.py | eelkevdbos/spotlight | 429a32fd318b3110074884683bef7fe675740ee3 | [
"MIT"
] | null | null | null | spotlight/tests/unique_test.py | eelkevdbos/spotlight | 429a32fd318b3110074884683bef7fe675740ee3 | [
"MIT"
] | null | null | null | from spotlight import errors as err
from spotlight.tests.validator_test import ValidatorTest
class UniqueTest(ValidatorTest):
def setUp(self):
self.field = "email"
self.unique_error = err.UNIQUE_ERROR.format(field=self.field)
def test_unique_rule_with_existing_email_expect_error(self):
rules = {
"email": "unique:user,email"
}
input_values = {
"email": "john.doe@example.com"
}
expected = self.unique_error
errors = self.validator_with_session.validate(input_values, rules)
errs = errors.get(self.field)
self.assertEqual(errs[0], expected)
def test_unique_rule_with_new_email_expect_no_error(self):
rules = {
"email": "unique:user,email"
}
input_values = {
"email": "john.doe2@example.com"
}
expected = None
errors = self.validator_with_session.validate(input_values, rules)
errs = errors.get(self.field)
self.assertEqual(errs, expected)
def test_unique_rule_with_new_email_and_ignore_expect_no_error(self):
rules = {
"email": "unique:user,email,id,1"
}
input_values = {
"email": "john.doe@example.com"
}
expected = None
errors = self.validator_with_session.validate(input_values, rules)
errs = errors.get(self.field)
self.assertEqual(errs, expected)
def test_unique_rule_with_new_email_and_ignore_and_where_expect_no_error(
self
):
rules = {
"email": "unique:user,email,id,1,site_id,1"
}
input_values = {
"email": "john.doe@example.com"
}
expected = None
errors = self.validator_with_session.validate(input_values, rules)
errs = errors.get(self.field)
self.assertEqual(errs, expected)
def test_unique_rule_with_existing_email_and_ignore_and_where_expect_error(
self
):
rules = {
"email": "unique:user,email,id,2,site_id,1"
}
input_values = {
"email": "john.doe@example.com"
}
expected = self.unique_error
errors = self.validator_with_session.validate(input_values, rules)
errs = errors.get(self.field)
self.assertEqual(errs[0], expected)
def test_unique_rule_with_existing_email_and_where_expect_error(
self
):
rules = {
"email": "unique:user,email,null,null,site_id,1"
}
input_values = {
"email": "john.doe@example.com"
}
expected = self.unique_error
errors = self.validator_with_session.validate(input_values, rules)
errs = errors.get(self.field)
self.assertEqual(errs[0], expected)
| 28.434343 | 79 | 0.611723 | 325 | 2,815 | 5.021538 | 0.156923 | 0.080882 | 0.047794 | 0.0625 | 0.879902 | 0.879902 | 0.871324 | 0.85049 | 0.840686 | 0.818015 | 0 | 0.004988 | 0.287744 | 2,815 | 98 | 80 | 28.72449 | 0.808978 | 0 | 0 | 0.628205 | 0 | 0 | 0.121847 | 0.051155 | 0 | 0 | 0 | 0 | 0.076923 | 1 | 0.089744 | false | 0 | 0.025641 | 0 | 0.128205 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
4f797e600fef2693cc54b56fdf29d7fd7c8bae37 | 25 | py | Python | owllook/database/redis/__init__.py | atiasn/novel | 14eed7856e7c01ecbdb3c1369bd945a22f566270 | [
"Apache-2.0"
] | 2,344 | 2017-05-05T00:16:05.000Z | 2022-03-31T15:46:06.000Z | owllook/database/redis/__init__.py | atiasn/novel | 14eed7856e7c01ecbdb3c1369bd945a22f566270 | [
"Apache-2.0"
] | 91 | 2017-05-27T12:43:14.000Z | 2022-03-20T04:51:35.000Z | owllook/database/redis/__init__.py | atiasn/novel | 14eed7856e7c01ecbdb3c1369bd945a22f566270 | [
"Apache-2.0"
] | 811 | 2017-05-05T03:01:25.000Z | 2022-03-22T02:09:37.000Z | from .redisbase import *
| 12.5 | 24 | 0.76 | 3 | 25 | 6.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16 | 25 | 1 | 25 | 25 | 0.904762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
4f90f2a8214b61a03b9d81c5deb99274c1c3f625 | 180 | py | Python | mlbriefcase/amazon/rekognition.py | Bhaskers-Blu-Org2/Briefcase | f551079b05d3f8494cdff6a0b393969def5a2443 | [
"MIT"
] | 2 | 2020-05-04T12:59:05.000Z | 2020-05-05T09:31:43.000Z | mlbriefcase/amazon/rekognition.py | Bhaskers-Blu-Org2/Briefcase | f551079b05d3f8494cdff6a0b393969def5a2443 | [
"MIT"
] | 4 | 2020-02-05T11:34:51.000Z | 2020-02-05T11:35:12.000Z | mlbriefcase/amazon/rekognition.py | microsoft/Briefcase | f551079b05d3f8494cdff6a0b393969def5a2443 | [
"MIT"
] | 5 | 2020-06-30T16:02:57.000Z | 2021-09-15T06:39:08.000Z | from .aws_boto3 import *
class rekognition(AwsBoto3):
def get_client_lazy(self, **kwargs):
return super().get_client_lazy('rekognition', region_name=self.region_name, **kwargs) | 36 | 87 | 0.777778 | 25 | 180 | 5.32 | 0.68 | 0.135338 | 0.195489 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012195 | 0.088889 | 180 | 5 | 87 | 36 | 0.79878 | 0 | 0 | 0 | 0 | 0 | 0.060773 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.25 | 1 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 6 |
96f084ea68f8c7c7fc0a705e53c1b8fcda05d9e6 | 63 | py | Python | pipelinemanager/__init__.py | fellipyaraujo/pipelinemanager | 231b4bf7994fc3998c392d55798893f87e309ab7 | [
"MIT"
] | null | null | null | pipelinemanager/__init__.py | fellipyaraujo/pipelinemanager | 231b4bf7994fc3998c392d55798893f87e309ab7 | [
"MIT"
] | null | null | null | pipelinemanager/__init__.py | fellipyaraujo/pipelinemanager | 231b4bf7994fc3998c392d55798893f87e309ab7 | [
"MIT"
] | null | null | null | from pipelinemanager.cachemanager import blobstoragecacherw
| 12.6 | 59 | 0.873016 | 5 | 63 | 11 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 63 | 4 | 60 | 15.75 | 0.982143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
8c016880e34379f0bb6ab70035efcdd3d1403300 | 55 | py | Python | HW00.py | starkworld/SSW-567 | f50ee0971769fe28882f9aeb3b3079751e90ffde | [
"Apache-2.0"
] | null | null | null | HW00.py | starkworld/SSW-567 | f50ee0971769fe28882f9aeb3b3079751e90ffde | [
"Apache-2.0"
] | null | null | null | HW00.py | starkworld/SSW-567 | f50ee0971769fe28882f9aeb3b3079751e90ffde | [
"Apache-2.0"
] | null | null | null | def first():
return 'Hello World!'
print(first()) | 11 | 25 | 0.618182 | 7 | 55 | 4.857143 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 55 | 5 | 26 | 11 | 0.772727 | 0 | 0 | 0 | 0 | 0 | 0.214286 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | true | 0 | 0 | 0.333333 | 0.666667 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.