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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c2216dfabed667146ea7fae27545990bbbd0639a | 24 | py | Python | bello/src/core/__init__.py | floscha/bello | 7d048a3e3b229fdb8b922935e8178df3cde91401 | [
"MIT"
] | null | null | null | bello/src/core/__init__.py | floscha/bello | 7d048a3e3b229fdb8b922935e8178df3cde91401 | [
"MIT"
] | 5 | 2017-11-17T22:14:04.000Z | 2017-11-19T13:10:55.000Z | bello/src/core/__init__.py | floscha/bello | 7d048a3e3b229fdb8b922935e8178df3cde91401 | [
"MIT"
] | null | null | null | from .bello import Bello | 24 | 24 | 0.833333 | 4 | 24 | 5 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 24 | 1 | 24 | 24 | 0.952381 | 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 |
c2352fe60b61dc66ece2476a3269f03afe125871 | 101 | py | Python | tests/utils/mock_requests.py | joowon-dm-snu/manta | 8beffa6432926bcdfceeb4c692bfb50466d03b2f | [
"MIT"
] | 1 | 2021-12-15T13:04:48.000Z | 2021-12-15T13:04:48.000Z | tests/utils/mock_requests.py | joowon-dm-snu/manta | 8beffa6432926bcdfceeb4c692bfb50466d03b2f | [
"MIT"
] | null | null | null | tests/utils/mock_requests.py | joowon-dm-snu/manta | 8beffa6432926bcdfceeb4c692bfb50466d03b2f | [
"MIT"
] | null | null | null | import requests
class ResponseMock(object):
pass
class RequestsMock(object):
pass
| 11.222222 | 28 | 0.673267 | 10 | 101 | 6.8 | 0.7 | 0.294118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.267327 | 101 | 8 | 29 | 12.625 | 0.918919 | 0 | 0 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.4 | 0.2 | 0 | 0.6 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 6 |
dff2f9ef46bc063cc7fcf8c18ed0282675a3aed4 | 50 | py | Python | gsplines/piecewisefunction/__init__.py | rafaelrojasmiliani/gsplines | 663b10f6d53b498a1e892d9eb32a345153de36d2 | [
"MIT"
] | 3 | 2021-08-28T01:42:40.000Z | 2021-12-02T22:39:45.000Z | gsplines/piecewisefunction/__init__.py | rafaelrojasmiliani/gsplines | 663b10f6d53b498a1e892d9eb32a345153de36d2 | [
"MIT"
] | null | null | null | gsplines/piecewisefunction/__init__.py | rafaelrojasmiliani/gsplines | 663b10f6d53b498a1e892d9eb32a345153de36d2 | [
"MIT"
] | null | null | null | from .piecewisefunction import cPiecewiseFunction
| 25 | 49 | 0.9 | 4 | 50 | 11.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.08 | 50 | 1 | 50 | 50 | 0.978261 | 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 |
5f28d397ea250304155563a2f6fe21fe5fb34d7b | 1,291 | py | Python | config/data_paths.py | DerekGloudemans/detrac-lbt | 097222912e476bf7864646bdc55adc7742342f2a | [
"MIT"
] | 2 | 2021-09-02T18:03:35.000Z | 2022-02-22T23:55:51.000Z | config/data_paths.py | DerekGloudemans/detrac-lbt | 097222912e476bf7864646bdc55adc7742342f2a | [
"MIT"
] | null | null | null | config/data_paths.py | DerekGloudemans/detrac-lbt | 097222912e476bf7864646bdc55adc7742342f2a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 30 17:29:07 2020
@author: worklab
"""
# 4 x Quadro RTX 6000 machine
data_paths = {
"train_im":"/home/worklab/Data/cv/Detrac/DETRAC-train-data",
"train_lab":"/home/worklab/Data/cv/Detrac/DETRAC-Train-Annotations-XML-v3",
"test_im":"/home/worklab/Data/cv/Detrac/DETRAC-test-data",
"test_lab":"/home/worklab/Data/cv/Detrac/DETRAC-Test-Annotations-XML",
"train_partition":"/home/worklab/Data/cv/Detrac/detrac_train_partition",
"val_partition":"/home/worklab/Data/cv/Detrac/detrac_val_partition"
}
directories = ["/home/worklab/Documents/derek/tracking-by-localization/config",
"/home/worklab/Documents/derek/tracking-by-localization/data/detrac_detections",
"/home/worklab/Documents/derek/tracking-by-localization/_data_utils",
"/home/worklab/Documents/derek/tracking-by-localization/_detectors",
"/home/worklab/Documents/derek/tracking-by-localization/_eval",
"/home/worklab/Documents/derek/tracking-by-localization/_localizers",
"/home/worklab/Documents/derek/tracking-by-localization/_train",
"/home/worklab/Documents/derek/tracking-by-localization/_tracker",
]
| 40.34375 | 95 | 0.683966 | 157 | 1,291 | 5.503185 | 0.324841 | 0.178241 | 0.185185 | 0.231481 | 0.704861 | 0.704861 | 0.704861 | 0.118056 | 0 | 0 | 0 | 0.018433 | 0.159566 | 1,291 | 31 | 96 | 41.645161 | 0.77788 | 0.096824 | 0 | 0 | 0 | 0 | 0.7671 | 0.715152 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
a043255c5bd60f2b27a50dccdbeb7984d16df5e5 | 6,541 | py | Python | allink_core/core_apps/allink_filer/tests/test_filer.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | 5 | 2017-03-13T08:49:45.000Z | 2022-03-05T20:05:56.000Z | allink_core/core_apps/allink_filer/tests/test_filer.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | 28 | 2019-10-21T08:32:18.000Z | 2022-02-10T13:16:38.000Z | allink_core/core_apps/allink_filer/tests/test_filer.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | null | null | null | import io
from django.test import TestCase
from django.core.files import File as DjangoFile
from filer.models import Folder
from allink_core.core_apps.allink_filer.utils import FilerStorage, TEST_IMAGE_PATH
class FilerStorageTestCase(TestCase):
valid_folder_path = '/root_folder/folder1'
valid_file_name = 'test.pdf'
def setUp(self):
self.filer_folder = Folder.objects.create(
name='root__filer_folder'
)
self.file_folder_valid_path = '/root__filer_folder'
self.filer_storage_valid = FilerStorage(
folder_path=self.valid_folder_path,
file_type='file',
file_name=self.valid_file_name
)
self.file_object_bytes_io = io.BytesIO()
def test_create_folder_static(self):
created_folder = FilerStorage.create_folder(
folder_path=self.valid_folder_path
)
self.assertEqual(created_folder.quoted_logical_path, self.valid_folder_path)
def test_create_object_static(self):
created_file = FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='file', name=self.valid_file_name)
self.assertEqual(created_file.original_filename, self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.file_folder_valid_path)
def test_create_object_static_path_variation(self):
# with trailing slash
created_file = FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='file', name=self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.file_folder_valid_path)
# with leading slash
created_file = FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='file', name=self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.file_folder_valid_path)
# with leading and trailing slash
created_file = FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='file', name=self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.file_folder_valid_path)
# no file extension
created_file = FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='file', name='test_invalidpdf')
self.assertEqual(created_file.original_filename, 'test_invalidpdf')
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.file_folder_valid_path)
def test_save_bytes_io(self):
created_folder, created_file = self.filer_storage_valid.save(file=self.file_object_bytes_io)
self.assertEqual(created_file.original_filename, self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.valid_folder_path)
self.assertEqual(created_folder.quoted_logical_path, self.valid_folder_path)
def test_save_string_io(self):
file_object = io.StringIO()
created_folder, created_file = self.filer_storage_valid.save(file=file_object)
self.assertEqual(created_file.original_filename, self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.valid_folder_path)
self.assertEqual(created_folder.quoted_logical_path, self.valid_folder_path)
def test_save_python_file_open(self):
with open(self.valid_file_name, 'w+b') as self.file_object_bytes_io:
created_folder, created_file = self.filer_storage_valid.save(file=self.file_object_bytes_io)
self.assertEqual(created_file.original_filename, self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.valid_folder_path)
self.assertEqual(created_folder.quoted_logical_path, self.valid_folder_path)
def test_save_django_file(self):
django_file = DjangoFile(
file=self.file_object_bytes_io,
name=None
)
created_folder, created_file = self.filer_storage_valid.save(file=django_file)
self.assertEqual(created_file.original_filename, self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.valid_folder_path)
self.assertEqual(created_folder.quoted_logical_path, self.valid_folder_path)
def test_create_object_stimage(self):
created_file = FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='image', name=self.valid_file_name)
self.assertEqual(created_file.original_filename, self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.file_folder_valid_path)
def test_create_object_static_path_variaimage(self):
# with trailing slash
created_file = FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='image', name=self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.file_folder_valid_path)
# with leading slash
created_file = FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='image', name=self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.file_folder_valid_path)
# with leading and trailing slash
created_file = FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='image', name=self.valid_file_name)
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.file_folder_valid_path)
# no file extension
created_file = FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='image', name='test_invalidpdf')
self.assertEqual(created_file.original_filename, 'test_invalidpdf')
self.assertEqual(created_file.logical_folder.quoted_logical_path, self.file_folder_valid_path)
def test_delete_duplicates(self):
FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='image', name=self.valid_file_name)
FilerStorage.create_object(folder=self.filer_folder, file=self.file_object_bytes_io, file_type='image', name=self.valid_file_name)
from filer.models import Image
self.assertEqual(Image.objects.all().count(), 1)
| 50.705426 | 153 | 0.771289 | 884 | 6,541 | 5.302036 | 0.076923 | 0.084489 | 0.126734 | 0.12204 | 0.845957 | 0.832942 | 0.818861 | 0.812673 | 0.812673 | 0.812673 | 0 | 0.000359 | 0.147531 | 6,541 | 128 | 154 | 51.101563 | 0.840208 | 0.02706 | 0 | 0.46988 | 0 | 0 | 0.029426 | 0 | 0 | 0 | 0 | 0 | 0.337349 | 1 | 0.13253 | false | 0 | 0.072289 | 0 | 0.240964 | 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 |
a0755f58077cf670b4a61ca0d1e1164dc8679517 | 785 | py | Python | packages/girder_worker/tests/test_docker_tasks.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | 37 | 2016-01-26T19:21:23.000Z | 2021-06-10T14:12:59.000Z | packages/girder_worker/tests/test_docker_tasks.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | 290 | 2016-01-27T14:02:10.000Z | 2022-01-24T16:50:27.000Z | packages/girder_worker/tests/test_docker_tasks.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | 29 | 2016-02-17T17:54:47.000Z | 2022-03-17T23:36:17.000Z | import pytest
from girder_worker.docker.tasks import ( # noqa F401
DockerTask,
_docker_run,
_handle_streaming_args,
_pull_image,
_run_container,
_run_select_loop,
docker_run
)
# TODO: test DockerTask
@pytest.mark.skip
def test_DockerTask():
pass
# TODO: test _docker_run
@pytest.mark.skip
def test__docker_run():
pass
# TODO: test _handle_streaming_args
@pytest.mark.skip
def test__handle_streaming_args():
pass
# TODO: test _pull_image
@pytest.mark.skip
def test__pull_image():
pass
# TODO: test _run_container
@pytest.mark.skip
def test__run_container():
pass
# TODO: test _run_select_loop
@pytest.mark.skip
def test__run_select_loop():
pass
# TODO: test docker_run
@pytest.mark.skip
def test_docker_run():
pass
| 14.537037 | 52 | 0.73121 | 111 | 785 | 4.747748 | 0.225225 | 0.106262 | 0.185958 | 0.225806 | 0.419355 | 0.29981 | 0.208729 | 0.208729 | 0.208729 | 0.208729 | 0 | 0.00468 | 0.183439 | 785 | 53 | 53 | 14.811321 | 0.817473 | 0.238217 | 0 | 0.451613 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018868 | 0 | 1 | 0.225806 | true | 0.225806 | 0.064516 | 0 | 0.290323 | 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 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 6 |
a0815ce111422bedb329d33708dcf0854b6b7892 | 2,645 | py | Python | OAuthInterface.py | adriangersbach/python-oauth | e96a333d35b2259bb9df91542b7fa0e636b29062 | [
"MIT"
] | null | null | null | OAuthInterface.py | adriangersbach/python-oauth | e96a333d35b2259bb9df91542b7fa0e636b29062 | [
"MIT"
] | null | null | null | OAuthInterface.py | adriangersbach/python-oauth | e96a333d35b2259bb9df91542b7fa0e636b29062 | [
"MIT"
] | null | null | null | import requests
class OAuthInterface:
def __init__(self, base_url, api_key, api_secret, username, password):
self.base_url = base_url
self.api_key = api_key
self.api_secret = api_secret
self.username = username
self.password = password
self.access_token = ""
self.token_type = ""
self.expires_in = 0
self.refresh_token = ""
def reset(self):
self.access_token = ""
self.token_type = ""
self.expires_in = 0
self.refresh_token = ""
def request_access_token(self):
final_url = "https://{0}/oauth/token".format(self.base_url)
headers = {'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded'}
data = {'client_id': self.api_key, 'client_secret': self.api_secret, 'grant_type': 'password',
'username': self.username, 'password': self.password}
response = requests.post(final_url, headers=headers, data=data)
print(response.url)
print(response.status_code)
if response.status_code == 200:
json = response.json()
print(json)
self.access_token = json['access_token']
self.token_type = ""
self.expires_in = 0
self.refresh_token = json['refresh_token']
else:
self.reset()
def refresh_access_token(self, refresh_token):
final_url = "https://{0}/oauth/token".format(self.base_url)
headers = {'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded'}
data = {'client_id': self.api_key, 'client_secret': self.api_secret, 'grant_type': 'refresh_token',
'refresh_token': refresh_token}
response = requests.post(final_url, headers=headers, data=data)
print(response.url)
print(response.status_code)
if response.status_code == 200:
json = response.json()
print(json)
self.access_token = json['access_token']
self.token_type = ""
self.expires_in = 0
self.refresh_token = json['refresh_token']
else:
self.reset()
def revoke_access_token(self, access_token):
final_url = "https://{0}/oauth/revoke".format(self.base_url)
headers = {'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded'}
data = {'client_id': self.api_key, 'client_secret': self.api_secret, 'token': access_token}
return requests.post(final_url, headers=headers, data=data)
| 42.66129 | 108 | 0.600378 | 305 | 2,645 | 4.970492 | 0.163934 | 0.079815 | 0.069261 | 0.05277 | 0.751319 | 0.751319 | 0.73219 | 0.73219 | 0.704485 | 0.704485 | 0 | 0.006785 | 0.275614 | 2,645 | 61 | 109 | 43.360656 | 0.784447 | 0 | 0 | 0.660714 | 0 | 0 | 0.178793 | 0.038313 | 0 | 0 | 0 | 0 | 0 | 1 | 0.089286 | false | 0.071429 | 0.017857 | 0 | 0.142857 | 0.107143 | 0 | 0 | 0 | null | 0 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 6 |
a0a5f7b7751377ffc6bea79f426956edcae63bb2 | 74 | py | Python | td_encloser/__init__.py | marktgraham/td-encloser | f36d62455a21cf7d216138d144a54bc223258722 | [
"MIT"
] | null | null | null | td_encloser/__init__.py | marktgraham/td-encloser | f36d62455a21cf7d216138d144a54bc223258722 | [
"MIT"
] | null | null | null | td_encloser/__init__.py | marktgraham/td-encloser | f36d62455a21cf7d216138d144a54bc223258722 | [
"MIT"
] | null | null | null | from .td_encloser import TDENCLOSER
from .gaussian_kde import gaussian_kde | 37 | 38 | 0.878378 | 11 | 74 | 5.636364 | 0.636364 | 0.354839 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094595 | 74 | 2 | 38 | 37 | 0.925373 | 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 |
a0a77ecf9d26e4b0428d7ab8504a09bb9173ac3a | 144 | py | Python | pysyrenn/__init__.py | 95616ARG/SyReNN | 19abf589e84ee67317134573054c648bb25c244d | [
"MIT"
] | 36 | 2019-08-19T06:17:52.000Z | 2022-03-11T09:02:40.000Z | pysyrenn/__init__.py | 95616ARG/SyReNN | 19abf589e84ee67317134573054c648bb25c244d | [
"MIT"
] | 8 | 2020-04-09T20:59:04.000Z | 2022-03-11T23:56:50.000Z | pysyrenn/__init__.py | 95616ARG/SyReNN | 19abf589e84ee67317134573054c648bb25c244d | [
"MIT"
] | 4 | 2021-01-13T11:17:55.000Z | 2021-06-28T19:36:04.000Z | """PySyReNN.
This module is a Python front-end client to the SyReNN server.
"""
from pysyrenn.helpers import *
from pysyrenn.frontend import *
| 20.571429 | 62 | 0.756944 | 21 | 144 | 5.190476 | 0.809524 | 0.220183 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152778 | 144 | 6 | 63 | 24 | 0.893443 | 0.506944 | 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 |
a0af980c040df79bbbb168363071fd74c5873766 | 8,008 | py | Python | src/tests/date_utils_test.py | tomgilbertson/script-server-v1 | bbdf289d3d993a0c81f20c36bce5f3eb064b0261 | [
"Apache-2.0",
"CC0-1.0"
] | 833 | 2016-09-08T13:27:36.000Z | 2022-03-27T07:10:48.000Z | src/tests/date_utils_test.py | tomgilbertson/script-server-v1 | bbdf289d3d993a0c81f20c36bce5f3eb064b0261 | [
"Apache-2.0",
"CC0-1.0"
] | 528 | 2016-05-23T09:17:04.000Z | 2022-03-30T12:45:50.000Z | src/tests/date_utils_test.py | tomgilbertson/script-server-v1 | bbdf289d3d993a0c81f20c36bce5f3eb064b0261 | [
"Apache-2.0",
"CC0-1.0"
] | 214 | 2016-09-08T14:46:41.000Z | 2022-03-25T01:04:14.000Z | import unittest
from datetime import datetime, timezone, timedelta
from utils import date_utils
class TestScriptOutputLogging(unittest.TestCase):
def test_astimezone_naive_after_dst(self):
utc_datetime = datetime(2018, 6, 5, 12, 34, 56, tzinfo=timezone.utc)
local_datetime = utc_datetime.astimezone(tz=None)
naive_datetime = local_datetime.replace(tzinfo=None)
transformed_datetime = date_utils.astimezone(naive_datetime, timezone.utc)
self.assertEqual(utc_datetime, transformed_datetime)
def test_astimezone_naive_before_dst(self):
utc_datetime = datetime(2017, 1, 15, 20, 00, 00, tzinfo=timezone.utc)
local_datetime = utc_datetime.astimezone(tz=None)
naive_datetime = local_datetime.replace(tzinfo=None)
transformed_datetime = date_utils.astimezone(naive_datetime, timezone.utc)
self.assertEqual(utc_datetime, transformed_datetime)
class TestParseIsoDatetime(unittest.TestCase):
def test_parse_correct_time(self):
parsed = date_utils.parse_iso_datetime('2020-07-10T15:30:59.123456Z')
expected = datetime(2020, 7, 10, 15, 30, 59, 123456, timezone.utc)
self.assertEqual(expected, parsed)
def test_parse_wrong_time(self):
self.assertRaisesRegex(
ValueError,
'does not match format',
date_utils.parse_iso_datetime,
'15:30:59 2020-07-10')
class TestToIsoString(unittest.TestCase):
def test_utc_time(self):
iso_string = date_utils.to_iso_string(datetime(2020, 7, 10, 15, 30, 59, 123456, timezone.utc))
self.assertEqual('2020-07-10T15:30:59.123456Z', iso_string)
def test_naive_time(self):
iso_string = date_utils.to_iso_string(datetime(2020, 7, 10, 15, 30, 59, 123456))
self.assertEqual('2020-07-10T15:30:59.123456Z', iso_string)
def test_local_time(self):
iso_string = date_utils.to_iso_string(datetime(2020, 7, 10, 15, 30, 59, 123456, timezone(timedelta(hours=1))))
self.assertEqual('2020-07-10T14:30:59.123456Z', iso_string)
class TestIsPast(unittest.TestCase):
def test_when_past_naive(self):
value = datetime(2020, 7, 10, 15, 30, 59, 123456)
self.assertTrue(date_utils.is_past(value))
def test_when_past_utc(self):
value = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertTrue(date_utils.is_past(value))
def test_when_future_naive(self):
value = datetime(2030, 7, 10, 15, 30, 59, 123456)
self.assertFalse(date_utils.is_past(value))
def test_when_future_utc(self):
value = datetime(2030, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertFalse(date_utils.is_past(value))
def test_when_now(self):
value = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
date_utils._mocked_now = value
self.assertFalse(date_utils.is_past(value))
def tearDown(self) -> None:
date_utils._mocked_now = None
class TestSecondsBetween(unittest.TestCase):
def test_small_positive_delta(self):
start = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
end = datetime(2020, 7, 10, 15, 33, 12, 123456, tzinfo=timezone.utc)
seconds = date_utils.seconds_between(start, end)
self.assertEqual(133, seconds)
def test_small_negative_delta(self):
start = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
end = datetime(2020, 7, 10, 15, 30, 13, 123456, tzinfo=timezone.utc)
seconds = date_utils.seconds_between(start, end)
self.assertEqual(-46, seconds)
def test_large_positive_delta(self):
start = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
end = datetime(2021, 2, 15, 17, 33, 12, 123456, tzinfo=timezone.utc)
seconds = date_utils.seconds_between(start, end)
self.assertEqual(19015333, seconds)
def test_large_negative_delta(self):
start = datetime(2020, 7, 10, 15, 30, 13, 123456, tzinfo=timezone.utc)
end = datetime(2019, 11, 29, 9, 30, 59, 123456, tzinfo=timezone.utc)
seconds = date_utils.seconds_between(start, end)
self.assertEqual(-19375154, seconds)
def test_delta_with_microseconds(self):
start = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
end = datetime(2020, 7, 10, 15, 33, 12, 876543, tzinfo=timezone.utc)
seconds = date_utils.seconds_between(start, end)
self.assertEqual(133.753087, seconds)
class TestAddMonths(unittest.TestCase):
def test_add_one_month(self):
original = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
added = date_utils.add_months(original, 1)
expected = datetime(2020, 8, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertEqual(expected, added)
def test_add_4_months(self):
original = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
added = date_utils.add_months(original, 4)
expected = datetime(2020, 11, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertEqual(expected, added)
def test_add_months_to_roll_next_year(self):
original = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
added = date_utils.add_months(original, 6)
expected = datetime(2021, 1, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertEqual(expected, added)
def test_add_months_to_roll_multiple_years(self):
original = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
added = date_utils.add_months(original, 33)
expected = datetime(2023, 4, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertEqual(expected, added)
def test_add_months_to_last_day_when_next_shorter(self):
original = datetime(2020, 7, 31, 15, 30, 59, 123456, tzinfo=timezone.utc)
added = date_utils.add_months(original, 2)
expected = datetime(2020, 9, 30, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertEqual(expected, added)
def test_add_months_to_last_day_when_next_same(self):
original = datetime(2020, 7, 31, 15, 30, 59, 123456, tzinfo=timezone.utc)
added = date_utils.add_months(original, 1)
expected = datetime(2020, 8, 31, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertEqual(expected, added)
def test_add_months_to_last_day_when_next_longer(self):
original = datetime(2020, 6, 30, 15, 30, 59, 123456, tzinfo=timezone.utc)
added = date_utils.add_months(original, 2)
expected = datetime(2020, 8, 30, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertEqual(expected, added)
def test_add_months_to_last_day_when_next_february(self):
original = datetime(2020, 7, 30, 15, 30, 59, 123456, tzinfo=timezone.utc)
added = date_utils.add_months(original, 7)
expected = datetime(2021, 2, 28, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertEqual(expected, added)
def test_add_months_to_last_day_when_next_leap_february(self):
original = datetime(2019, 7, 30, 15, 30, 59, 123456, tzinfo=timezone.utc)
added = date_utils.add_months(original, 7)
expected = datetime(2020, 2, 29, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertEqual(expected, added)
def test_subtract_one_month(self):
original = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
added = date_utils.add_months(original, -1)
expected = datetime(2020, 6, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertEqual(expected, added)
def test_subtract_months_to_prev_year(self):
original = datetime(2020, 7, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
added = date_utils.add_months(original, -10)
expected = datetime(2019, 9, 10, 15, 30, 59, 123456, tzinfo=timezone.utc)
self.assertEqual(expected, added)
| 42.595745 | 118 | 0.680694 | 1,109 | 8,008 | 4.729486 | 0.118124 | 0.085987 | 0.119924 | 0.080076 | 0.79409 | 0.764728 | 0.757674 | 0.757674 | 0.750048 | 0.74776 | 0 | 0.148264 | 0.20492 | 8,008 | 187 | 119 | 42.823529 | 0.675514 | 0 | 0 | 0.369565 | 0 | 0 | 0.018482 | 0.013487 | 0 | 0 | 0 | 0 | 0.202899 | 1 | 0.210145 | false | 0 | 0.021739 | 0 | 0.275362 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
265a3e94d188e364ea92a9a8c41bdcd4a80782b1 | 19 | py | Python | mcanitexgen/integration/__init__.py | OrangeUtan/MCMetagen | 0293ea14bf1c6b1bae58741f9876ba662930b43d | [
"MIT"
] | 2 | 2021-03-18T04:34:23.000Z | 2021-03-23T17:35:07.000Z | mcanitexgen/integration/__init__.py | OrangeUtan/MCMetagen | 0293ea14bf1c6b1bae58741f9876ba662930b43d | [
"MIT"
] | null | null | null | mcanitexgen/integration/__init__.py | OrangeUtan/MCMetagen | 0293ea14bf1c6b1bae58741f9876ba662930b43d | [
"MIT"
] | null | null | null | from . import beet
| 9.5 | 18 | 0.736842 | 3 | 19 | 4.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.210526 | 19 | 1 | 19 | 19 | 0.933333 | 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 |
2676ea7c55950f7b296ee1d2b1973327617160e2 | 329 | bzl | Python | third_party/dependency_analyzer/src/test/analyzer_test.bzl | wiwa/rules_scala | 3dd5d8110d56cfc19722532866cbfc039a6a9612 | [
"Apache-2.0"
] | null | null | null | third_party/dependency_analyzer/src/test/analyzer_test.bzl | wiwa/rules_scala | 3dd5d8110d56cfc19722532866cbfc039a6a9612 | [
"Apache-2.0"
] | null | null | null | third_party/dependency_analyzer/src/test/analyzer_test.bzl | wiwa/rules_scala | 3dd5d8110d56cfc19722532866cbfc039a6a9612 | [
"Apache-2.0"
] | null | null | null | load(":analyzer_test_scala_2.bzl", "analyzer_tests_scala_2")
load(":analyzer_test_scala_3.bzl", "analyzer_tests_scala_3")
load("@io_bazel_rules_scala_config//:config.bzl", "SCALA_MAJOR_VERSION")
def tests():
if SCALA_MAJOR_VERSION.startswith("2"):
analyzer_tests_scala_2()
else:
analyzer_tests_scala_3()
| 32.9 | 72 | 0.75076 | 48 | 329 | 4.604167 | 0.375 | 0.235294 | 0.325792 | 0.190045 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024055 | 0.115502 | 329 | 9 | 73 | 36.555556 | 0.735395 | 0 | 0 | 0 | 0 | 0 | 0.477204 | 0.416413 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | true | 0 | 0 | 0 | 0.125 | 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 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
cd81f35db471fc2ef5dd90213513a29131788d0b | 257,698 | py | Python | instances/passenger_demand/pas-20210422-1717-int12e/55.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int12e/55.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int12e/55.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 23155
passenger_arriving = (
(4, 7, 8, 2, 6, 3, 0, 2, 1, 0, 1, 0, 0, 1, 11, 3, 2, 4, 4, 2, 1, 1, 2, 3, 1, 0), # 0
(13, 10, 5, 9, 3, 3, 2, 4, 7, 2, 1, 0, 0, 6, 6, 8, 0, 7, 3, 1, 2, 5, 1, 2, 0, 0), # 1
(5, 3, 5, 7, 4, 1, 4, 1, 4, 0, 0, 0, 0, 8, 9, 6, 3, 2, 5, 1, 2, 4, 0, 0, 1, 0), # 2
(11, 7, 6, 5, 6, 2, 0, 3, 6, 2, 0, 0, 0, 5, 8, 7, 4, 5, 4, 3, 2, 2, 1, 2, 0, 0), # 3
(5, 14, 6, 5, 6, 0, 6, 2, 3, 1, 1, 0, 0, 8, 8, 6, 3, 8, 4, 5, 2, 2, 0, 1, 1, 0), # 4
(8, 10, 8, 6, 5, 4, 8, 3, 2, 3, 0, 0, 0, 10, 7, 9, 3, 6, 10, 2, 1, 2, 4, 0, 1, 0), # 5
(7, 7, 9, 9, 12, 3, 3, 4, 0, 1, 1, 0, 0, 14, 7, 7, 1, 6, 3, 5, 5, 2, 1, 0, 0, 0), # 6
(8, 7, 8, 10, 7, 0, 2, 3, 2, 3, 3, 2, 0, 12, 6, 3, 5, 4, 2, 6, 2, 2, 4, 1, 0, 0), # 7
(12, 7, 3, 9, 9, 4, 3, 2, 5, 3, 0, 2, 0, 13, 6, 9, 1, 7, 7, 3, 1, 4, 2, 1, 0, 0), # 8
(9, 11, 12, 11, 5, 6, 1, 6, 6, 1, 0, 1, 0, 9, 6, 7, 6, 10, 4, 6, 3, 5, 5, 0, 1, 0), # 9
(10, 9, 10, 15, 5, 6, 4, 3, 5, 0, 0, 2, 0, 10, 11, 6, 2, 5, 7, 3, 0, 4, 3, 2, 1, 0), # 10
(13, 8, 18, 5, 6, 4, 4, 6, 8, 1, 1, 1, 0, 14, 10, 8, 6, 11, 6, 5, 2, 5, 1, 1, 1, 0), # 11
(7, 7, 10, 14, 4, 1, 4, 2, 1, 2, 1, 0, 0, 10, 6, 9, 9, 7, 5, 9, 6, 6, 2, 2, 0, 0), # 12
(12, 13, 9, 6, 4, 3, 4, 1, 7, 2, 1, 1, 0, 15, 8, 3, 6, 13, 7, 5, 1, 7, 4, 2, 0, 0), # 13
(12, 4, 8, 7, 7, 6, 1, 3, 3, 5, 2, 1, 0, 11, 15, 3, 3, 12, 5, 6, 3, 2, 4, 1, 0, 0), # 14
(12, 17, 12, 14, 14, 3, 6, 5, 3, 1, 0, 3, 0, 8, 13, 15, 6, 7, 3, 6, 2, 4, 1, 1, 1, 0), # 15
(14, 16, 9, 13, 8, 6, 6, 4, 5, 1, 0, 2, 0, 15, 13, 5, 7, 8, 5, 5, 5, 1, 7, 2, 3, 0), # 16
(9, 10, 13, 8, 9, 4, 10, 6, 5, 1, 2, 1, 0, 11, 12, 8, 9, 7, 4, 7, 2, 7, 4, 1, 1, 0), # 17
(14, 12, 6, 9, 11, 6, 4, 5, 11, 2, 3, 2, 0, 14, 6, 9, 6, 7, 1, 7, 3, 4, 4, 3, 1, 0), # 18
(18, 18, 10, 18, 13, 1, 4, 10, 2, 4, 1, 1, 0, 9, 11, 4, 6, 9, 7, 6, 2, 5, 3, 0, 1, 0), # 19
(17, 14, 10, 14, 15, 6, 7, 3, 3, 2, 0, 0, 0, 7, 12, 7, 6, 16, 8, 5, 1, 3, 5, 2, 2, 0), # 20
(8, 10, 6, 11, 5, 5, 5, 2, 4, 4, 3, 1, 0, 11, 10, 10, 9, 9, 8, 5, 5, 5, 3, 0, 0, 0), # 21
(9, 11, 12, 10, 6, 2, 5, 1, 5, 3, 3, 1, 0, 13, 11, 3, 8, 13, 3, 8, 2, 6, 1, 1, 1, 0), # 22
(16, 20, 15, 12, 13, 3, 7, 2, 7, 2, 1, 0, 0, 10, 6, 7, 8, 7, 6, 3, 3, 9, 2, 2, 0, 0), # 23
(8, 13, 9, 11, 8, 6, 4, 3, 3, 3, 2, 0, 0, 8, 6, 6, 7, 5, 13, 2, 2, 4, 5, 3, 2, 0), # 24
(6, 15, 10, 11, 12, 2, 3, 7, 4, 3, 4, 0, 0, 10, 13, 4, 5, 12, 9, 2, 4, 6, 3, 1, 1, 0), # 25
(12, 7, 12, 14, 8, 5, 3, 4, 4, 4, 0, 0, 0, 10, 7, 10, 8, 8, 6, 4, 5, 3, 6, 3, 1, 0), # 26
(10, 10, 11, 11, 7, 5, 0, 3, 6, 1, 2, 1, 0, 15, 11, 11, 8, 6, 8, 7, 4, 5, 3, 3, 1, 0), # 27
(7, 7, 10, 12, 6, 1, 6, 4, 5, 2, 4, 0, 0, 13, 7, 4, 11, 12, 6, 5, 6, 3, 5, 3, 0, 0), # 28
(15, 11, 14, 6, 11, 2, 4, 7, 2, 5, 1, 1, 0, 10, 7, 11, 6, 12, 11, 10, 3, 6, 4, 6, 0, 0), # 29
(12, 21, 10, 12, 13, 5, 3, 6, 9, 4, 2, 2, 0, 7, 15, 8, 5, 8, 10, 6, 5, 8, 3, 1, 1, 0), # 30
(18, 15, 15, 10, 6, 2, 4, 6, 4, 5, 1, 1, 0, 11, 11, 9, 4, 9, 7, 6, 2, 3, 3, 1, 0, 0), # 31
(15, 19, 6, 13, 9, 6, 2, 5, 3, 4, 0, 4, 0, 14, 14, 6, 2, 8, 10, 5, 5, 4, 5, 5, 1, 0), # 32
(11, 21, 8, 16, 7, 2, 3, 6, 6, 2, 1, 2, 0, 10, 10, 7, 8, 8, 5, 6, 7, 3, 3, 3, 1, 0), # 33
(14, 13, 17, 16, 8, 4, 2, 6, 8, 1, 3, 0, 0, 13, 9, 5, 7, 10, 7, 5, 6, 1, 4, 0, 0, 0), # 34
(17, 10, 11, 10, 5, 5, 4, 3, 7, 3, 4, 0, 0, 14, 11, 7, 7, 11, 3, 5, 6, 4, 5, 1, 0, 0), # 35
(13, 5, 14, 10, 12, 5, 3, 4, 4, 5, 3, 1, 0, 12, 7, 8, 6, 9, 14, 5, 4, 2, 4, 4, 0, 0), # 36
(10, 16, 9, 16, 6, 4, 5, 4, 3, 0, 2, 1, 0, 11, 11, 9, 3, 14, 7, 7, 3, 5, 5, 3, 1, 0), # 37
(7, 12, 11, 10, 10, 5, 2, 5, 8, 2, 1, 1, 0, 13, 13, 10, 5, 5, 9, 11, 7, 6, 4, 2, 2, 0), # 38
(13, 17, 9, 13, 13, 4, 7, 9, 3, 2, 0, 2, 0, 13, 8, 17, 6, 16, 7, 5, 0, 4, 4, 2, 1, 0), # 39
(11, 18, 16, 11, 12, 4, 6, 4, 3, 3, 2, 2, 0, 14, 13, 8, 9, 14, 8, 3, 2, 4, 8, 2, 1, 0), # 40
(8, 6, 14, 12, 9, 8, 7, 2, 4, 5, 1, 1, 0, 12, 9, 6, 10, 12, 7, 1, 4, 4, 2, 5, 1, 0), # 41
(11, 15, 11, 10, 4, 3, 5, 1, 4, 2, 1, 0, 0, 11, 6, 6, 13, 16, 3, 9, 6, 5, 6, 2, 0, 0), # 42
(11, 19, 15, 9, 15, 3, 2, 6, 9, 5, 2, 1, 0, 12, 12, 10, 5, 9, 8, 2, 2, 2, 4, 3, 2, 0), # 43
(14, 18, 9, 13, 13, 2, 4, 2, 4, 1, 2, 4, 0, 6, 12, 16, 10, 6, 6, 4, 3, 3, 2, 2, 1, 0), # 44
(14, 10, 9, 8, 5, 6, 2, 3, 4, 1, 0, 2, 0, 12, 11, 6, 5, 12, 11, 3, 7, 5, 1, 1, 1, 0), # 45
(12, 7, 13, 9, 13, 0, 4, 11, 1, 1, 0, 1, 0, 10, 11, 10, 8, 11, 6, 3, 2, 1, 3, 0, 0, 0), # 46
(11, 18, 12, 12, 8, 3, 2, 2, 4, 2, 0, 0, 0, 18, 8, 7, 7, 8, 8, 3, 2, 7, 3, 3, 0, 0), # 47
(18, 5, 9, 9, 9, 7, 4, 5, 12, 2, 4, 2, 0, 12, 10, 9, 4, 17, 3, 5, 3, 5, 1, 2, 1, 0), # 48
(12, 16, 6, 7, 14, 2, 4, 1, 5, 2, 2, 2, 0, 12, 10, 7, 7, 6, 7, 3, 9, 2, 6, 2, 0, 0), # 49
(14, 7, 13, 10, 5, 3, 1, 3, 6, 1, 3, 0, 0, 20, 14, 15, 9, 10, 1, 1, 4, 6, 4, 3, 1, 0), # 50
(14, 10, 15, 6, 10, 4, 4, 5, 9, 1, 6, 0, 0, 13, 10, 7, 7, 8, 10, 2, 2, 5, 0, 4, 0, 0), # 51
(17, 14, 15, 13, 12, 5, 8, 5, 8, 1, 0, 1, 0, 7, 11, 8, 5, 16, 5, 4, 3, 3, 3, 1, 1, 0), # 52
(10, 7, 14, 14, 10, 4, 6, 4, 6, 0, 2, 1, 0, 11, 11, 16, 7, 13, 6, 2, 5, 7, 4, 3, 2, 0), # 53
(10, 15, 10, 9, 7, 4, 6, 4, 1, 3, 2, 1, 0, 10, 16, 6, 5, 9, 6, 4, 3, 4, 3, 1, 0, 0), # 54
(12, 14, 9, 7, 10, 5, 7, 4, 6, 2, 1, 0, 0, 18, 12, 7, 11, 4, 8, 4, 3, 7, 4, 2, 1, 0), # 55
(13, 13, 13, 6, 9, 7, 0, 3, 6, 1, 0, 1, 0, 12, 12, 4, 9, 11, 8, 3, 1, 1, 2, 2, 0, 0), # 56
(10, 13, 16, 12, 17, 3, 5, 6, 9, 4, 0, 1, 0, 9, 13, 9, 9, 6, 2, 1, 2, 6, 3, 1, 5, 0), # 57
(19, 16, 6, 11, 9, 6, 5, 5, 4, 2, 2, 1, 0, 8, 10, 10, 9, 8, 5, 8, 3, 2, 2, 0, 0, 0), # 58
(9, 15, 8, 13, 9, 3, 7, 5, 2, 1, 2, 1, 0, 11, 7, 5, 7, 8, 5, 3, 2, 2, 6, 2, 1, 0), # 59
(13, 16, 3, 5, 14, 4, 2, 4, 3, 3, 2, 0, 0, 19, 11, 7, 7, 8, 3, 3, 3, 6, 4, 0, 2, 0), # 60
(16, 5, 11, 17, 10, 5, 5, 4, 2, 3, 2, 0, 0, 8, 6, 8, 6, 6, 3, 11, 3, 4, 6, 0, 1, 0), # 61
(12, 9, 9, 21, 8, 3, 7, 2, 10, 1, 1, 1, 0, 13, 14, 3, 7, 5, 6, 3, 3, 5, 6, 1, 4, 0), # 62
(8, 7, 14, 13, 8, 2, 4, 2, 8, 2, 1, 4, 0, 13, 10, 5, 4, 13, 6, 5, 6, 7, 5, 0, 4, 0), # 63
(14, 6, 13, 11, 9, 6, 9, 5, 3, 0, 3, 3, 0, 10, 13, 9, 4, 9, 7, 3, 6, 6, 4, 6, 1, 0), # 64
(15, 9, 9, 16, 9, 6, 5, 4, 8, 0, 2, 0, 0, 16, 10, 7, 7, 9, 1, 5, 0, 5, 3, 1, 0, 0), # 65
(12, 17, 9, 8, 8, 7, 2, 6, 3, 1, 3, 2, 0, 6, 10, 8, 6, 15, 4, 9, 2, 7, 3, 2, 1, 0), # 66
(6, 15, 8, 11, 7, 5, 3, 4, 2, 1, 3, 2, 0, 8, 15, 9, 6, 16, 1, 5, 5, 7, 4, 2, 2, 0), # 67
(16, 16, 11, 8, 13, 4, 2, 2, 2, 2, 2, 1, 0, 13, 6, 7, 4, 12, 2, 11, 5, 7, 2, 2, 1, 0), # 68
(8, 14, 9, 8, 9, 5, 3, 3, 11, 0, 1, 0, 0, 17, 9, 6, 5, 9, 4, 4, 3, 4, 4, 2, 0, 0), # 69
(15, 5, 10, 9, 12, 3, 11, 3, 3, 4, 0, 1, 0, 5, 11, 12, 12, 7, 2, 10, 5, 4, 3, 1, 4, 0), # 70
(11, 12, 18, 13, 8, 4, 5, 5, 7, 3, 3, 0, 0, 9, 13, 13, 3, 7, 7, 2, 1, 3, 3, 1, 2, 0), # 71
(14, 15, 11, 14, 9, 3, 4, 4, 3, 5, 2, 1, 0, 14, 10, 12, 5, 13, 6, 7, 4, 4, 7, 1, 0, 0), # 72
(16, 12, 9, 10, 9, 2, 4, 2, 3, 4, 1, 0, 0, 10, 10, 7, 11, 14, 5, 3, 2, 5, 5, 4, 0, 0), # 73
(5, 10, 8, 12, 8, 0, 5, 5, 3, 1, 3, 1, 0, 15, 8, 7, 8, 10, 4, 6, 2, 2, 5, 5, 3, 0), # 74
(8, 8, 11, 13, 13, 3, 5, 3, 8, 4, 0, 0, 0, 13, 11, 6, 7, 10, 6, 4, 2, 4, 2, 3, 2, 0), # 75
(9, 14, 14, 14, 10, 1, 4, 4, 5, 6, 1, 0, 0, 11, 6, 10, 7, 11, 1, 4, 4, 7, 4, 1, 2, 0), # 76
(14, 7, 13, 12, 11, 2, 6, 4, 4, 2, 3, 1, 0, 10, 16, 8, 4, 5, 3, 4, 3, 4, 5, 1, 1, 0), # 77
(10, 9, 7, 8, 6, 8, 4, 4, 5, 2, 2, 1, 0, 8, 9, 6, 6, 14, 3, 5, 3, 7, 4, 2, 1, 0), # 78
(13, 9, 12, 15, 6, 3, 4, 2, 8, 3, 4, 0, 0, 12, 12, 8, 9, 8, 1, 6, 4, 3, 3, 2, 0, 0), # 79
(12, 9, 9, 12, 11, 9, 5, 3, 5, 2, 1, 0, 0, 8, 8, 10, 6, 7, 4, 5, 10, 3, 1, 1, 2, 0), # 80
(18, 11, 12, 9, 12, 5, 4, 7, 7, 5, 3, 1, 0, 12, 9, 3, 8, 11, 5, 1, 3, 3, 3, 3, 0, 0), # 81
(16, 13, 7, 6, 11, 3, 5, 4, 3, 4, 2, 2, 0, 12, 12, 6, 4, 11, 4, 7, 6, 4, 4, 1, 0, 0), # 82
(13, 7, 10, 7, 12, 0, 5, 4, 5, 1, 0, 1, 0, 12, 6, 6, 5, 5, 1, 1, 1, 3, 1, 4, 0, 0), # 83
(10, 10, 7, 11, 10, 5, 3, 3, 4, 5, 0, 2, 0, 8, 14, 7, 5, 11, 0, 6, 2, 6, 0, 2, 0, 0), # 84
(14, 7, 9, 9, 10, 2, 4, 4, 4, 3, 1, 1, 0, 12, 7, 8, 4, 7, 3, 3, 5, 8, 3, 4, 2, 0), # 85
(4, 13, 10, 10, 12, 7, 4, 4, 2, 3, 3, 1, 0, 20, 7, 8, 5, 9, 5, 1, 1, 6, 4, 1, 1, 0), # 86
(7, 14, 7, 8, 9, 7, 6, 5, 6, 1, 1, 0, 0, 9, 10, 6, 8, 8, 8, 5, 2, 5, 6, 1, 3, 0), # 87
(21, 6, 13, 14, 7, 5, 1, 4, 4, 2, 2, 3, 0, 8, 9, 8, 7, 6, 5, 3, 1, 6, 3, 0, 1, 0), # 88
(4, 7, 15, 5, 8, 6, 2, 3, 6, 0, 0, 3, 0, 14, 14, 10, 8, 8, 2, 6, 1, 5, 5, 2, 1, 0), # 89
(12, 6, 11, 12, 8, 1, 9, 1, 5, 1, 1, 0, 0, 12, 13, 5, 10, 10, 3, 4, 7, 5, 4, 2, 3, 0), # 90
(11, 4, 10, 9, 7, 5, 3, 3, 5, 2, 1, 3, 0, 8, 9, 8, 4, 7, 3, 5, 2, 2, 7, 3, 0, 0), # 91
(7, 12, 9, 9, 5, 5, 4, 1, 6, 0, 4, 1, 0, 11, 13, 9, 3, 10, 3, 4, 2, 4, 6, 2, 1, 0), # 92
(10, 9, 11, 5, 9, 7, 4, 3, 4, 1, 2, 0, 0, 11, 12, 3, 2, 11, 1, 4, 1, 5, 1, 1, 0, 0), # 93
(10, 7, 13, 5, 7, 5, 5, 4, 3, 3, 0, 0, 0, 12, 10, 3, 2, 8, 5, 7, 5, 4, 2, 1, 0, 0), # 94
(8, 11, 6, 10, 8, 3, 9, 2, 6, 1, 0, 0, 0, 9, 6, 8, 7, 5, 1, 4, 5, 10, 5, 0, 2, 0), # 95
(12, 6, 10, 14, 6, 4, 6, 2, 7, 3, 1, 1, 0, 14, 12, 5, 4, 8, 8, 7, 3, 6, 2, 2, 0, 0), # 96
(10, 7, 13, 15, 9, 4, 5, 3, 5, 2, 1, 0, 0, 9, 14, 8, 5, 4, 4, 5, 0, 4, 3, 1, 0, 0), # 97
(14, 13, 8, 10, 9, 5, 6, 5, 2, 3, 1, 3, 0, 8, 7, 10, 5, 7, 5, 2, 1, 6, 4, 2, 1, 0), # 98
(11, 11, 10, 7, 10, 4, 8, 7, 5, 2, 3, 0, 0, 10, 8, 6, 8, 8, 2, 1, 6, 4, 1, 2, 2, 0), # 99
(17, 10, 10, 16, 8, 5, 3, 3, 4, 1, 2, 0, 0, 10, 8, 5, 8, 9, 3, 3, 2, 3, 2, 1, 0, 0), # 100
(12, 3, 6, 7, 8, 10, 3, 3, 5, 1, 2, 1, 0, 6, 10, 8, 2, 5, 5, 4, 4, 3, 1, 1, 1, 0), # 101
(7, 9, 15, 18, 8, 5, 2, 3, 1, 2, 1, 0, 0, 11, 9, 5, 5, 8, 6, 6, 3, 8, 1, 1, 1, 0), # 102
(7, 7, 13, 13, 10, 3, 4, 4, 8, 1, 2, 0, 0, 17, 5, 8, 6, 12, 3, 7, 2, 8, 4, 5, 0, 0), # 103
(6, 14, 8, 7, 14, 2, 6, 3, 6, 5, 1, 2, 0, 12, 6, 5, 9, 10, 4, 2, 2, 4, 2, 1, 0, 0), # 104
(9, 11, 5, 17, 9, 3, 3, 1, 3, 2, 2, 1, 0, 6, 10, 8, 5, 4, 3, 7, 3, 5, 1, 2, 0, 0), # 105
(10, 10, 10, 12, 7, 2, 3, 1, 2, 0, 2, 0, 0, 14, 4, 7, 3, 11, 4, 6, 3, 4, 1, 3, 1, 0), # 106
(14, 9, 12, 7, 9, 2, 4, 3, 5, 0, 1, 0, 0, 11, 18, 10, 12, 9, 6, 5, 3, 3, 3, 3, 0, 0), # 107
(11, 4, 8, 6, 8, 9, 10, 0, 8, 2, 3, 2, 0, 17, 6, 6, 5, 8, 3, 3, 2, 3, 4, 1, 0, 0), # 108
(13, 8, 15, 7, 7, 2, 5, 3, 3, 2, 0, 0, 0, 11, 12, 5, 4, 7, 1, 2, 7, 1, 4, 4, 2, 0), # 109
(16, 11, 9, 9, 14, 5, 5, 4, 4, 2, 1, 1, 0, 13, 8, 5, 3, 8, 3, 6, 6, 7, 0, 3, 0, 0), # 110
(13, 6, 6, 10, 8, 2, 2, 2, 3, 1, 1, 0, 0, 8, 8, 12, 4, 7, 3, 5, 0, 5, 6, 0, 0, 0), # 111
(9, 9, 9, 14, 6, 3, 5, 2, 3, 2, 3, 2, 0, 10, 6, 5, 6, 9, 6, 3, 2, 4, 3, 6, 1, 0), # 112
(8, 9, 12, 12, 6, 1, 1, 5, 7, 1, 1, 0, 0, 6, 7, 6, 5, 8, 6, 4, 0, 5, 5, 0, 1, 0), # 113
(6, 7, 13, 4, 3, 6, 2, 3, 4, 0, 3, 0, 0, 11, 16, 7, 8, 9, 4, 4, 3, 7, 5, 1, 1, 0), # 114
(11, 11, 11, 12, 11, 6, 4, 3, 4, 1, 1, 1, 0, 10, 8, 8, 5, 11, 5, 8, 2, 4, 5, 3, 2, 0), # 115
(10, 8, 9, 6, 9, 4, 3, 5, 4, 3, 2, 0, 0, 8, 7, 10, 5, 7, 6, 6, 2, 4, 3, 0, 1, 0), # 116
(13, 6, 5, 7, 9, 4, 2, 1, 5, 2, 1, 0, 0, 10, 10, 8, 8, 10, 1, 7, 4, 8, 2, 1, 0, 0), # 117
(8, 8, 7, 10, 8, 11, 4, 4, 8, 1, 0, 2, 0, 16, 10, 4, 6, 8, 4, 5, 0, 1, 1, 4, 1, 0), # 118
(7, 11, 6, 10, 13, 3, 6, 4, 3, 1, 1, 0, 0, 9, 11, 5, 5, 4, 2, 5, 2, 4, 3, 2, 0, 0), # 119
(8, 6, 12, 13, 5, 7, 5, 2, 4, 1, 3, 2, 0, 12, 6, 7, 4, 8, 6, 3, 4, 5, 3, 4, 1, 0), # 120
(8, 9, 8, 9, 13, 7, 1, 3, 4, 1, 0, 0, 0, 10, 14, 8, 10, 6, 5, 3, 1, 1, 2, 0, 2, 0), # 121
(13, 16, 9, 8, 11, 7, 2, 3, 5, 4, 2, 2, 0, 11, 11, 6, 3, 6, 4, 4, 1, 2, 6, 1, 1, 0), # 122
(11, 12, 8, 10, 5, 5, 5, 3, 3, 2, 3, 0, 0, 11, 12, 8, 4, 11, 5, 3, 2, 2, 5, 5, 0, 0), # 123
(10, 9, 9, 10, 12, 8, 5, 4, 2, 0, 1, 1, 0, 16, 9, 11, 6, 7, 2, 3, 3, 5, 5, 0, 0, 0), # 124
(13, 4, 9, 15, 7, 4, 3, 3, 8, 3, 2, 1, 0, 9, 7, 8, 4, 9, 4, 3, 6, 7, 2, 1, 0, 0), # 125
(6, 8, 9, 8, 10, 5, 2, 4, 6, 3, 1, 0, 0, 7, 9, 10, 6, 10, 5, 5, 4, 5, 4, 2, 0, 0), # 126
(6, 5, 5, 11, 3, 1, 4, 4, 5, 2, 2, 0, 0, 15, 6, 12, 7, 8, 4, 3, 1, 10, 2, 1, 0, 0), # 127
(15, 5, 9, 7, 9, 5, 2, 1, 4, 0, 4, 0, 0, 8, 6, 5, 3, 7, 4, 6, 4, 2, 3, 2, 1, 0), # 128
(7, 11, 8, 11, 10, 5, 1, 2, 2, 4, 0, 0, 0, 12, 12, 3, 2, 7, 3, 2, 2, 4, 4, 4, 1, 0), # 129
(8, 2, 10, 19, 5, 5, 3, 1, 4, 0, 2, 0, 0, 7, 3, 7, 3, 7, 3, 8, 1, 4, 7, 1, 0, 0), # 130
(8, 3, 14, 16, 9, 5, 5, 5, 6, 0, 1, 0, 0, 11, 8, 9, 4, 11, 1, 7, 1, 5, 4, 0, 1, 0), # 131
(7, 5, 13, 5, 8, 2, 5, 0, 6, 1, 0, 2, 0, 10, 8, 4, 5, 7, 4, 5, 0, 2, 4, 1, 0, 0), # 132
(10, 9, 12, 7, 9, 4, 2, 4, 4, 3, 1, 0, 0, 16, 8, 3, 6, 6, 6, 3, 2, 5, 3, 2, 1, 0), # 133
(10, 9, 12, 6, 11, 6, 2, 2, 3, 0, 1, 0, 0, 7, 11, 4, 7, 8, 3, 3, 1, 6, 0, 1, 1, 0), # 134
(12, 6, 11, 9, 6, 4, 4, 5, 5, 3, 0, 1, 0, 10, 5, 14, 4, 11, 6, 3, 5, 2, 1, 1, 1, 0), # 135
(10, 11, 12, 11, 7, 2, 3, 1, 5, 0, 0, 0, 0, 6, 7, 8, 2, 10, 4, 1, 2, 3, 5, 4, 1, 0), # 136
(9, 8, 7, 9, 5, 3, 3, 2, 5, 1, 1, 2, 0, 15, 6, 4, 8, 9, 2, 7, 3, 3, 2, 4, 0, 0), # 137
(9, 3, 6, 4, 10, 6, 3, 4, 6, 1, 3, 0, 0, 7, 10, 7, 3, 14, 6, 5, 3, 4, 4, 1, 0, 0), # 138
(10, 6, 8, 4, 9, 4, 3, 2, 5, 2, 4, 3, 0, 6, 11, 7, 5, 11, 3, 3, 5, 3, 2, 3, 0, 0), # 139
(11, 12, 11, 9, 10, 1, 4, 4, 5, 3, 1, 2, 0, 10, 9, 8, 3, 5, 2, 4, 3, 3, 3, 2, 0, 0), # 140
(8, 8, 11, 14, 11, 2, 2, 3, 5, 1, 1, 1, 0, 7, 7, 7, 6, 15, 4, 6, 0, 3, 4, 2, 0, 0), # 141
(9, 7, 12, 10, 10, 6, 3, 2, 5, 2, 4, 2, 0, 12, 8, 4, 1, 9, 7, 5, 4, 1, 3, 4, 0, 0), # 142
(6, 8, 9, 4, 12, 9, 4, 3, 3, 0, 1, 1, 0, 6, 9, 9, 7, 11, 4, 0, 2, 6, 2, 0, 3, 0), # 143
(5, 10, 9, 10, 6, 1, 2, 3, 4, 0, 1, 0, 0, 7, 11, 4, 3, 7, 5, 5, 1, 2, 3, 0, 1, 0), # 144
(5, 3, 11, 6, 5, 3, 6, 7, 3, 2, 1, 0, 0, 9, 7, 3, 1, 5, 3, 1, 3, 3, 1, 0, 3, 0), # 145
(21, 6, 12, 8, 12, 3, 4, 7, 5, 4, 1, 1, 0, 14, 6, 7, 4, 8, 4, 2, 6, 2, 1, 0, 2, 0), # 146
(13, 6, 9, 6, 6, 2, 2, 4, 4, 2, 2, 1, 0, 13, 9, 6, 6, 8, 6, 4, 2, 4, 1, 1, 1, 0), # 147
(9, 7, 9, 6, 16, 3, 3, 3, 0, 2, 1, 0, 0, 9, 7, 5, 10, 17, 6, 4, 2, 5, 6, 4, 1, 0), # 148
(7, 10, 9, 10, 9, 5, 3, 1, 4, 1, 2, 2, 0, 12, 4, 5, 4, 8, 4, 3, 3, 0, 4, 2, 1, 0), # 149
(10, 8, 3, 7, 4, 2, 0, 5, 4, 1, 2, 1, 0, 15, 7, 3, 3, 8, 2, 6, 2, 5, 3, 1, 2, 0), # 150
(13, 3, 6, 4, 5, 4, 4, 0, 4, 2, 1, 1, 0, 5, 9, 8, 6, 6, 3, 2, 2, 2, 1, 4, 0, 0), # 151
(8, 8, 12, 8, 5, 1, 4, 4, 5, 2, 0, 0, 0, 9, 9, 7, 4, 4, 2, 4, 1, 7, 1, 1, 1, 0), # 152
(11, 12, 10, 11, 8, 3, 2, 1, 4, 3, 1, 0, 0, 8, 9, 5, 9, 7, 5, 2, 3, 3, 4, 0, 1, 0), # 153
(9, 5, 6, 7, 4, 2, 0, 2, 2, 3, 1, 0, 0, 9, 6, 5, 5, 7, 4, 4, 5, 2, 3, 1, 0, 0), # 154
(8, 4, 7, 9, 7, 4, 1, 2, 5, 2, 0, 0, 0, 6, 9, 6, 3, 5, 3, 3, 2, 2, 4, 1, 0, 0), # 155
(8, 6, 9, 6, 6, 2, 2, 0, 3, 1, 2, 1, 0, 10, 8, 8, 4, 5, 2, 4, 4, 4, 1, 3, 2, 0), # 156
(14, 6, 15, 10, 6, 0, 4, 5, 2, 0, 3, 0, 0, 6, 6, 2, 8, 10, 3, 1, 0, 6, 4, 4, 2, 0), # 157
(10, 7, 11, 13, 6, 2, 2, 2, 1, 1, 1, 0, 0, 7, 7, 9, 0, 13, 1, 9, 3, 6, 2, 1, 2, 0), # 158
(7, 7, 8, 7, 10, 7, 3, 0, 8, 3, 2, 1, 0, 12, 4, 9, 6, 9, 7, 4, 5, 4, 4, 2, 0, 0), # 159
(14, 6, 10, 10, 9, 4, 3, 2, 3, 1, 1, 0, 0, 13, 9, 5, 6, 4, 1, 3, 3, 3, 1, 2, 0, 0), # 160
(8, 5, 8, 8, 4, 4, 1, 1, 4, 0, 1, 0, 0, 9, 10, 2, 7, 8, 6, 2, 4, 0, 2, 3, 0, 0), # 161
(12, 5, 7, 3, 8, 5, 0, 0, 5, 3, 2, 1, 0, 13, 5, 2, 7, 5, 5, 4, 2, 3, 3, 2, 1, 0), # 162
(6, 4, 10, 10, 10, 3, 1, 3, 3, 0, 0, 0, 0, 5, 6, 7, 6, 7, 2, 1, 0, 4, 3, 0, 3, 0), # 163
(11, 3, 14, 3, 9, 3, 2, 4, 5, 1, 0, 0, 0, 10, 8, 4, 3, 6, 1, 6, 4, 3, 3, 4, 0, 0), # 164
(12, 1, 12, 8, 7, 3, 0, 3, 3, 3, 0, 2, 0, 14, 11, 5, 3, 7, 3, 3, 3, 5, 1, 0, 1, 0), # 165
(6, 8, 8, 6, 5, 7, 4, 2, 4, 1, 0, 1, 0, 11, 9, 4, 3, 7, 4, 3, 4, 7, 4, 2, 2, 0), # 166
(7, 4, 3, 9, 7, 7, 1, 5, 2, 1, 0, 0, 0, 10, 9, 6, 4, 10, 4, 2, 3, 2, 4, 1, 0, 0), # 167
(12, 7, 6, 6, 2, 2, 1, 3, 4, 0, 1, 0, 0, 11, 8, 7, 5, 5, 2, 2, 5, 3, 3, 1, 2, 0), # 168
(11, 1, 7, 7, 5, 3, 1, 2, 2, 3, 1, 0, 0, 9, 9, 5, 7, 1, 2, 2, 2, 1, 1, 0, 1, 0), # 169
(7, 8, 6, 8, 7, 0, 1, 3, 3, 0, 0, 1, 0, 10, 5, 1, 2, 6, 4, 2, 1, 4, 0, 1, 1, 0), # 170
(8, 4, 11, 5, 7, 1, 2, 1, 2, 0, 1, 0, 0, 12, 5, 6, 3, 5, 5, 4, 1, 3, 2, 1, 2, 0), # 171
(7, 9, 5, 5, 6, 2, 2, 2, 1, 0, 2, 0, 0, 8, 5, 5, 6, 3, 3, 4, 3, 2, 2, 0, 1, 0), # 172
(0, 1, 4, 6, 2, 1, 2, 1, 1, 0, 1, 1, 0, 6, 5, 6, 2, 6, 3, 4, 1, 1, 2, 2, 0, 0), # 173
(4, 3, 5, 1, 6, 3, 0, 0, 6, 1, 1, 0, 0, 4, 3, 4, 1, 3, 2, 0, 3, 3, 2, 0, 1, 0), # 174
(4, 4, 6, 5, 6, 3, 1, 5, 6, 0, 1, 0, 0, 6, 3, 3, 5, 4, 3, 4, 2, 2, 1, 1, 0, 0), # 175
(8, 6, 8, 2, 4, 1, 1, 0, 1, 0, 0, 0, 0, 5, 5, 2, 2, 3, 3, 0, 7, 3, 2, 1, 2, 0), # 176
(3, 3, 5, 8, 6, 4, 0, 2, 2, 0, 1, 0, 0, 6, 1, 4, 2, 5, 3, 0, 1, 2, 1, 0, 0, 0), # 177
(5, 4, 5, 2, 4, 3, 0, 2, 0, 2, 0, 0, 0, 3, 3, 2, 3, 8, 1, 1, 2, 3, 1, 1, 0, 0), # 178
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # 179
)
station_arriving_intensity = (
(6.025038694046121, 6.630346271631799, 6.253539875535008, 7.457601328636119, 6.665622729131534, 3.766385918444806, 4.9752427384486975, 5.583811407575308, 7.308118874601608, 4.749618018626843, 5.046318196662723, 5.877498093967408, 6.100656255094035), # 0
(6.425192582423969, 7.06807283297371, 6.666415909596182, 7.950173103931939, 7.106988404969084, 4.015180300851067, 5.303362729516432, 5.951416467486849, 7.79069439159949, 5.062776830732579, 5.3797153631473575, 6.265459992977225, 6.503749976927826), # 1
(6.8240676107756775, 7.504062205069175, 7.077650742656896, 8.440785245597752, 7.546755568499692, 4.262982137414934, 5.630182209552845, 6.317550297485303, 8.271344168253059, 5.3746965300246545, 5.711787778531575, 6.651879182463666, 6.905237793851628), # 2
(7.220109351775874, 7.936584602323736, 7.485613043183825, 8.927491689038488, 7.983194011202282, 4.508808747102135, 5.954404369977547, 6.680761388993408, 8.74816219310531, 5.684139238111417, 6.041218094192859, 7.035222821916553, 7.30352736750507), # 3
(7.611763378099177, 8.363910239142928, 7.8886714796436435, 9.408346369659084, 8.41457352455579, 4.751677448878401, 6.27473240221015, 7.039598233433898, 9.219242454699248, 5.9898670766012145, 6.36668896150869, 7.413958070825716, 7.69702635952778), # 4
(7.9974752624202115, 8.784309329932306, 8.285194720503021, 9.881403222864472, 8.839163900039136, 4.990605561709457, 6.589869497670269, 7.392609322229511, 9.682678941577871, 6.290642167102395, 6.686883031856559, 7.786552088680978, 8.084142431559393), # 5
(8.375690577413598, 9.196052089097401, 8.673551434228639, 10.344716184059582, 9.255234929131252, 5.224610404561036, 6.898518847777515, 7.738343146802986, 10.136565642284177, 6.58522663122331, 7.000482956613939, 8.15147203497217, 8.463283245239527), # 6
(8.744854895753962, 9.597408731043757, 9.052110289287162, 10.796339188649354, 9.661056403311065, 5.452709296398865, 7.199383643951502, 8.075348198577062, 10.578996545361173, 6.872382590572303, 7.306171387158321, 8.507185069189115, 8.832856462207822), # 7
(9.103413790115921, 9.986649470176918, 9.419239954145274, 11.234326172038713, 10.054898114057503, 5.673919556188667, 7.491167077611837, 8.402172968974469, 11.008065639351846, 7.150872166757728, 7.602630974867185, 8.852158350821643, 9.1912697441039), # 8
(9.449812833174102, 10.362044520902426, 9.773309097269644, 11.656731069632603, 10.43502985284949, 5.88725850289618, 7.772572340178144, 8.717365949417955, 11.421866912799208, 7.419457481387929, 7.888544371118013, 9.184859039359576, 9.536930752567395), # 9
(9.782497597603118, 10.721864097625819, 10.11268638712695, 12.061607816835945, 10.79972141116596, 6.091743455487129, 8.042302623070025, 9.019475631330252, 11.818494354246257, 7.676900656071257, 8.162594227288288, 9.503754294292742, 9.868247149237932), # 10
(10.099913656077605, 11.064378414752648, 10.435740492183857, 12.447010349053675, 11.14724258048584, 6.286391732927242, 8.2990611177071, 9.307050506134097, 12.196041952235992, 7.921963812416062, 8.423463194755499, 9.807311275110973, 10.183626595755133), # 11
(10.400506581272174, 11.387857686688436, 10.740840080907047, 12.810992601690733, 11.475863152288053, 6.470220654182243, 8.541551015508974, 9.578639065252224, 12.552603695311413, 8.153409072030685, 8.669833924897121, 10.093997141304081, 10.48147675375864), # 12
(10.68272194586145, 11.690572127838744, 11.026353821763193, 13.151608510152052, 11.78385291805152, 6.642247538217868, 8.768475507895266, 9.832789800107378, 12.886273572015517, 8.369998556523484, 8.900389069090641, 10.362279052361904, 10.760205284888082), # 13
(10.945005322520059, 11.970791952609106, 11.290650383218976, 13.46691200984255, 12.069481669255188, 6.801489703999841, 8.978537786285592, 10.068051202122295, 13.195145570891304, 8.5704943875028, 9.113811278713541, 10.610624167774272, 11.018219850783076), # 14
(11.185802283922625, 12.22678737540506, 11.53209843374105, 13.754957036167182, 12.33101919737797, 6.946964470493895, 9.17044104209955, 10.282971762719706, 13.477313680481783, 8.753658686576989, 9.308783205143303, 10.837499647031004, 11.253928113083257), # 15
(11.40355840274376, 12.456828610632158, 11.749066641796109, 14.01379752453086, 12.5667352938988, 7.077689156665751, 9.34288846675677, 10.476099973322352, 13.730871889329944, 8.918253575354395, 9.483987499757415, 11.041372649621927, 11.465737733428254), # 16
(11.59671925165809, 12.659185872695934, 11.939923675850823, 14.241487410338534, 12.774899750296605, 7.192681081481142, 9.494583251676852, 10.64598432535298, 13.95391418597878, 9.06304117544336, 9.638106813933359, 11.220710335036866, 11.652056373457699), # 17
(11.763730403340244, 12.832129376001928, 12.103038204371856, 14.436080628995134, 12.953782358050306, 7.290957563905803, 9.62422858827942, 10.791173310234312, 14.144534558971316, 9.186783608452243, 9.76982379904861, 11.373979862765658, 11.811291694811214), # 18
(11.903037430464838, 12.973929334955693, 12.236778895825895, 14.595631115905576, 13.101652908638838, 7.37153592290545, 9.730527667984072, 10.910215419389093, 14.300826996850533, 9.288242995989393, 9.877821106480653, 11.499648392298115, 11.941851359128435), # 19
(12.013085905706498, 13.082855963962754, 12.339514418679602, 14.718192806474825, 13.216781193541133, 7.4334334774458215, 9.812183682210435, 11.00165914424006, 14.420885488159437, 9.36618145966315, 9.96078138760698, 11.59618308312407, 12.042143028048988), # 20
(12.09232140173984, 13.15717947742867, 12.409613441399662, 14.801819636107782, 13.297437004236105, 7.475667546492642, 9.86789982237811, 11.064052976209947, 14.502804021441024, 9.419361121081865, 10.01738729380507, 11.662051094733352, 12.110574363212494), # 21
(12.139189491239494, 13.195170089758973, 12.445444632452743, 14.844565540209402, 13.341890132202689, 7.497255449011639, 9.89637927990672, 11.095945406721498, 14.544676585238298, 9.44654410185389, 10.046321476452407, 11.695719586615787, 12.145553026258591), # 22
(12.156472036011166, 13.199668312757202, 12.449907818930042, 14.849916975308643, 13.353278467239116, 7.5, 9.899764802711205, 11.099392592592592, 14.54991148148148, 9.44975072702332, 10.049949644594088, 11.69987709190672, 12.15), # 23
(12.169214895640982, 13.197044444444446, 12.449177777777777, 14.849258333333335, 13.359729136337823, 7.5, 9.8979045751634, 11.0946, 14.549209999999999, 9.44778074074074, 10.049549494949495, 11.698903703703703, 12.15), # 24
(12.181688676253897, 13.191872427983538, 12.447736625514404, 14.84795524691358, 13.366037934713404, 7.5, 9.894238683127572, 11.085185185185185, 14.547824074074073, 9.443902606310013, 10.048756079311634, 11.696982167352537, 12.15), # 25
(12.19389242285764, 13.184231275720165, 12.445604115226338, 14.846022530864197, 13.372204642105325, 7.5, 9.888824061970466, 11.071325925925926, 14.54577148148148, 9.438180850480109, 10.047576580621024, 11.694138820301784, 12.15), # 26
(12.205825180459962, 13.174199999999997, 12.4428, 14.843474999999998, 13.378229038253057, 7.5, 9.881717647058824, 11.0532, 14.54307, 9.430679999999999, 10.046018181818182, 11.6904, 12.15), # 27
(12.217485994068602, 13.161857613168722, 12.439344032921811, 14.8403274691358, 13.384110902896081, 7.5, 9.87297637375938, 11.030985185185186, 14.539737407407406, 9.421464581618656, 10.04408806584362, 11.685792043895749, 12.15), # 28
(12.2288739086913, 13.147283127572017, 12.43525596707819, 14.83659475308642, 13.389850015773865, 7.5, 9.862657177438878, 11.004859259259257, 14.535791481481482, 9.410599122085047, 10.041793415637859, 11.680341289437584, 12.15), # 29
(12.239987969335797, 13.130555555555555, 12.430555555555555, 14.832291666666666, 13.395446156625884, 7.5, 9.850816993464052, 10.974999999999998, 14.53125, 9.398148148148149, 10.039141414141413, 11.674074074074072, 12.15), # 30
(12.25082722100983, 13.11175390946502, 12.42526255144033, 14.827433024691356, 13.400899105191609, 7.5, 9.837512757201647, 10.941585185185184, 14.52613074074074, 9.384176186556926, 10.0361392442948, 11.667016735253773, 12.15), # 31
(12.261390708721144, 13.09095720164609, 12.419396707818928, 14.822033641975308, 13.406208641210513, 7.5, 9.822801404018398, 10.904792592592594, 14.520451481481482, 9.368747764060357, 10.032794089038532, 11.659195610425241, 12.15), # 32
(12.271677477477477, 13.068244444444444, 12.412977777777778, 14.816108333333332, 13.411374544422076, 7.5, 9.806739869281046, 10.8648, 14.51423, 9.351927407407407, 10.02911313131313, 11.650637037037034, 12.15), # 33
(12.28168657228657, 13.04369465020576, 12.406025514403291, 14.809671913580246, 13.416396594565759, 7.5, 9.789385088356331, 10.821785185185183, 14.507484074074075, 9.33377964334705, 10.025103554059108, 11.641367352537722, 12.15), # 34
(12.291417038156167, 13.01738683127572, 12.398559670781895, 14.802739197530862, 13.421274571381044, 7.5, 9.77079399661099, 10.775925925925925, 14.500231481481482, 9.314368998628257, 10.020772540216983, 11.631412894375858, 12.15), # 35
(12.300867920094007, 12.989399999999998, 12.3906, 14.795324999999998, 13.426008254607403, 7.5, 9.751023529411764, 10.727400000000001, 14.492489999999998, 9.293759999999999, 10.016127272727273, 11.620800000000001, 12.15), # 36
(12.310038263107828, 12.95981316872428, 12.382166255144032, 14.787444135802469, 13.430597423984304, 7.5, 9.730130622125392, 10.676385185185184, 14.484277407407406, 9.272017174211248, 10.01117493453049, 11.609555006858711, 12.15), # 37
(12.31892711220537, 12.928705349794239, 12.37327818930041, 14.779111419753086, 13.435041859251228, 7.5, 9.708172210118615, 10.62305925925926, 14.475611481481481, 9.249205048010975, 10.005922708567153, 11.597704252400549, 12.15), # 38
(12.327533512394384, 12.896155555555554, 12.363955555555556, 14.770341666666667, 13.439341340147644, 7.5, 9.68520522875817, 10.567599999999999, 14.466510000000001, 9.225388148148149, 10.000377777777777, 11.585274074074073, 12.15), # 39
(12.335856508682596, 12.86224279835391, 12.354218106995884, 14.761149691358025, 13.443495646413021, 7.5, 9.661286613410796, 10.510185185185186, 14.456990740740741, 9.200631001371743, 9.99454732510288, 11.572290809327848, 12.15), # 40
(12.343895146077754, 12.82704609053498, 12.344085596707819, 14.751550308641974, 13.447504557786841, 7.5, 9.636473299443233, 10.450992592592593, 14.44707148148148, 9.174998134430727, 9.988438533482979, 11.558780795610424, 12.15), # 41
(12.3516484695876, 12.790644444444444, 12.333577777777778, 14.741558333333334, 13.45136785400857, 7.5, 9.610822222222222, 10.3902, 14.436770000000001, 9.148554074074074, 9.982058585858585, 11.54477037037037, 12.15), # 42
(12.35911552421987, 12.753116872427984, 12.322714403292181, 14.731188580246913, 13.455085314817683, 7.5, 9.584390317114499, 10.327985185185186, 14.426104074074072, 9.121363347050755, 9.97541466517022, 11.530285871056241, 12.15), # 43
(12.366295354982311, 12.714542386831276, 12.31151522633745, 14.72045586419753, 13.458656719953654, 7.5, 9.557234519486807, 10.264525925925927, 14.415091481481479, 9.09349048010974, 9.968513954358398, 11.515353635116599, 12.15), # 44
(12.37318700688266, 12.674999999999999, 12.299999999999999, 14.709375, 13.462081849155954, 7.5, 9.529411764705882, 10.2, 14.403749999999999, 9.065, 9.961363636363636, 11.499999999999998, 12.15), # 45
(12.379789524928656, 12.634568724279836, 12.288188477366253, 14.697960802469135, 13.465360482164058, 7.5, 9.500978988138465, 10.134585185185186, 14.392097407407405, 9.035956433470506, 9.953970894126448, 11.484251303155007, 12.15), # 46
(12.386101954128042, 12.59332757201646, 12.276100411522634, 14.686228086419751, 13.46849239871744, 7.5, 9.471993125151295, 10.068459259259258, 14.380151481481482, 9.006424307270233, 9.946342910587354, 11.468133882030179, 12.15), # 47
(12.392123339488554, 12.551355555555554, 12.263755555555555, 14.674191666666667, 13.471477378555573, 7.5, 9.442511111111111, 10.001800000000001, 14.367930000000001, 8.976468148148147, 9.938486868686867, 11.451674074074074, 12.15), # 48
(12.397852726017943, 12.508731687242797, 12.251173662551441, 14.661866358024692, 13.474315201417928, 7.5, 9.412589881384651, 9.934785185185184, 14.355450740740741, 8.946152482853224, 9.930409951365506, 11.434898216735254, 12.15), # 49
(12.403289158723938, 12.46553497942387, 12.23837448559671, 14.649266975308642, 13.477005647043978, 7.5, 9.38228637133866, 9.867592592592592, 14.342731481481481, 8.91554183813443, 9.922119341563786, 11.417832647462278, 12.15), # 50
(12.408431682614292, 12.421844444444444, 12.225377777777776, 14.636408333333332, 13.479548495173196, 7.5, 9.351657516339868, 9.8004, 14.329790000000001, 8.88470074074074, 9.913622222222223, 11.400503703703704, 12.15), # 51
(12.413279342696734, 12.377739094650208, 12.21220329218107, 14.62330524691358, 13.481943525545056, 7.5, 9.320760251755022, 9.733385185185183, 14.316644074074073, 8.853693717421125, 9.904925776281331, 11.382937722908094, 12.15), # 52
(12.417831183979011, 12.333297942386832, 12.198870781893005, 14.609972530864196, 13.484190517899036, 7.5, 9.28965151295086, 9.666725925925926, 14.303311481481483, 8.822585294924554, 9.89603718668163, 11.365161042524004, 12.15), # 53
(12.42208625146886, 12.2886, 12.185399999999998, 14.596425, 13.486289251974602, 7.5, 9.258388235294117, 9.600599999999998, 14.28981, 8.79144, 9.886963636363634, 11.347199999999999, 12.15), # 54
(12.426043590174027, 12.24372427983539, 12.171810699588478, 14.5826774691358, 13.488239507511228, 7.5, 9.227027354151536, 9.535185185185185, 14.276157407407407, 8.760322359396433, 9.877712308267864, 11.329080932784636, 12.15), # 55
(12.429702245102245, 12.198749794238683, 12.158122633744856, 14.568744753086419, 13.49004106424839, 7.5, 9.195625804889858, 9.470659259259259, 14.262371481481482, 8.729296899862826, 9.868290385334829, 11.310830178326475, 12.15), # 56
(12.433061261261258, 12.153755555555556, 12.144355555555556, 14.554641666666665, 13.49169370192556, 7.5, 9.164240522875817, 9.407200000000001, 14.24847, 8.698428148148148, 9.85870505050505, 11.292474074074073, 12.15), # 57
(12.436119683658815, 12.108820576131688, 12.130529218106995, 14.540383024691355, 13.493197200282209, 7.5, 9.132928443476155, 9.344985185185184, 14.23447074074074, 8.667780631001373, 9.848963486719043, 11.274038957475994, 12.15), # 58
(12.438876557302644, 12.064023868312757, 12.116663374485597, 14.525983641975307, 13.494551339057814, 7.5, 9.101746502057614, 9.284192592592593, 14.220391481481482, 8.637418875171468, 9.839072876917319, 11.255551165980796, 12.15), # 59
(12.441330927200491, 12.019444444444444, 12.102777777777776, 14.511458333333334, 13.495755897991843, 7.5, 9.070751633986927, 9.225, 14.20625, 8.607407407407408, 9.829040404040404, 11.237037037037037, 12.15), # 60
(12.443481838360098, 11.975161316872429, 12.08889218106996, 14.496821913580245, 13.496810656823774, 7.5, 9.040000774630839, 9.167585185185185, 14.192064074074073, 8.577810754458161, 9.818873251028807, 11.218522908093279, 12.15), # 61
(12.445328335789204, 11.931253497942386, 12.075026337448561, 14.482089197530865, 13.497715395293081, 7.5, 9.009550859356088, 9.112125925925925, 14.177851481481481, 8.548693443072702, 9.808578600823045, 11.20003511659808, 12.15), # 62
(12.44686946449555, 11.887799999999999, 12.0612, 14.467275, 13.498469893139227, 7.5, 8.979458823529411, 9.0588, 14.16363, 8.520119999999999, 9.798163636363636, 11.1816, 12.15), # 63
(12.448104269486876, 11.844879835390946, 12.047432921810698, 14.452394135802468, 13.499073930101698, 7.5, 8.94978160251755, 9.007785185185186, 14.149417407407407, 8.492154951989026, 9.787635540591094, 11.1632438957476, 12.15), # 64
(12.449031795770926, 11.802572016460903, 12.033744855967079, 14.437461419753085, 13.49952728591996, 7.5, 8.920576131687243, 8.959259259259259, 14.135231481481481, 8.464862825788751, 9.777001496445942, 11.144993141289435, 12.15), # 65
(12.449651088355436, 11.760955555555556, 12.020155555555556, 14.422491666666666, 13.499829740333487, 7.5, 8.891899346405228, 8.913400000000001, 14.12109, 8.438308148148147, 9.766268686868687, 11.126874074074076, 12.15), # 66
(12.44996119224815, 11.720109465020576, 12.00668477366255, 14.407499691358023, 13.499981073081754, 7.5, 8.863808182038246, 8.870385185185187, 14.10701074074074, 8.412555445816187, 9.755444294799851, 11.108913031550067, 12.15), # 67
(12.44974993737699, 11.679898367184387, 11.993287139917694, 14.392370088566828, 13.499853546356814, 7.49986081390032, 8.836218233795575, 8.830012620027434, 14.092905418381346, 8.3875445299766, 9.74434318624845, 11.09103602627969, 12.149850180041152), # 68
(12.447770048309177, 11.639094623655915, 11.979586111111109, 14.376340217391302, 13.498692810457515, 7.49876049382716, 8.808321817615935, 8.790118518518518, 14.078157407407408, 8.362567668845314, 9.731835406698563, 11.072662768031188, 12.148663194444444), # 69
(12.443862945070673, 11.597510951812026, 11.965522119341562, 14.35930454911433, 13.49639917695473, 7.496593507087334, 8.779992161473643, 8.75034293552812, 14.062683470507546, 8.33750342935528, 9.717778663831295, 11.05370731355137, 12.14631880144033), # 70
(12.438083592771514, 11.555172202309835, 11.951100102880657, 14.341288204508858, 13.493001694504963, 7.49339497027892, 8.751241991446784, 8.710699039780522, 14.046506652949246, 8.312352431211167, 9.702224844940634, 11.034183524655257, 12.142847865226338), # 71
(12.430486956521738, 11.51210322580645, 11.936324999999998, 14.322316304347826, 13.488529411764706, 7.4892, 8.722084033613445, 8.671199999999999, 14.02965, 8.287115294117646, 9.685225837320575, 11.014105263157894, 12.13828125), # 72
(12.421128001431383, 11.46832887295898, 11.921201748971193, 14.302413969404187, 13.48301137739046, 7.48404371284865, 8.69253101405171, 8.631858984910837, 14.012136556927299, 8.261792637779392, 9.666833528265105, 10.993486390874303, 12.132649819958848), # 73
(12.410061692610485, 11.423873994424532, 11.905735288065841, 14.281606320450885, 13.47647664003873, 7.477961225422954, 8.662595658839667, 8.59268916323731, 13.993989368998628, 8.236385081901073, 9.647099805068226, 10.972340769619521, 12.125984439300412), # 74
(12.397342995169081, 11.378763440860213, 11.889930555555553, 14.25991847826087, 13.468954248366014, 7.470987654320988, 8.6322906940554, 8.553703703703704, 13.97523148148148, 8.210893246187362, 9.626076555023921, 10.950682261208575, 12.118315972222222), # 75
(12.383026874217212, 11.33302206292314, 11.873792489711933, 14.237375563607086, 13.460473251028805, 7.463158116140832, 8.601628845776993, 8.514915775034293, 13.955885939643347, 8.185317750342934, 9.60381566542619, 10.928524727456498, 12.10967528292181), # 76
(12.367168294864912, 11.286674711270411, 11.857326028806582, 14.214002697262478, 13.451062696683609, 7.454507727480566, 8.570622840082535, 8.476338545953361, 13.935975788751714, 8.15965921407246, 9.580369023569023, 10.905882030178327, 12.10009323559671), # 77
(12.349822222222222, 11.23974623655914, 11.84053611111111, 14.189824999999999, 13.440751633986928, 7.445071604938271, 8.53928540305011, 8.437985185185186, 13.915524074074073, 8.133918257080609, 9.55578851674641, 10.882768031189086, 12.089600694444444), # 78
(12.331043621399177, 11.192261489446436, 11.823427674897118, 14.164867592592591, 13.429569111595256, 7.434884865112025, 8.5076292607578, 8.399868861454047, 13.894553840877913, 8.108095499072055, 9.530126032252346, 10.859196592303805, 12.07822852366255), # 79
(12.310887457505816, 11.144245320589407, 11.806005658436213, 14.139155595813206, 13.417544178165095, 7.423982624599908, 8.475667139283697, 8.362002743484226, 13.873088134430727, 8.082191559751472, 9.503433457380826, 10.835181575337522, 12.066007587448558), # 80
(12.289408695652174, 11.09572258064516, 11.788274999999999, 14.112714130434783, 13.40470588235294, 7.412399999999999, 8.443411764705882, 8.3244, 13.851149999999999, 8.05620705882353, 9.475762679425838, 10.810736842105262, 12.052968749999998), # 81
(12.26666230094829, 11.046718120270809, 11.770240637860082, 14.085568317230273, 13.391083272815298, 7.40017210791038, 8.410875863102444, 8.28707379972565, 13.828762482853223, 8.030142615992899, 9.447165585681375, 10.785876254422064, 12.039142875514404), # 82
(12.242703238504205, 10.997256790123457, 11.751907510288065, 14.057743276972623, 13.376705398208665, 7.387334064929126, 8.378072160551463, 8.250037311385459, 13.805948628257887, 8.003998850964253, 9.417694063441433, 10.760613674102954, 12.0245608281893), # 83
(12.21758647342995, 10.947363440860215, 11.733280555555554, 14.029264130434782, 13.361601307189543, 7.373920987654321, 8.345013383131029, 8.213303703703703, 13.78273148148148, 7.977776383442266, 9.3874, 10.734962962962962, 12.009253472222222), # 84
(12.191366970835569, 10.897062923138192, 11.714364711934154, 14.000155998389696, 13.345800048414427, 7.359967992684042, 8.311712256919229, 8.176886145404664, 13.759134087791493, 7.951475833131606, 9.356335282651072, 10.708937982817124, 11.9932516718107), # 85
(12.164099695831096, 10.846380087614497, 11.695164917695474, 13.970444001610307, 13.32933067053982, 7.34551019661637, 8.278181507994145, 8.14079780521262, 13.73517949245542, 7.925097819736949, 9.32455179868864, 10.682552595480471, 11.976586291152262), # 86
(12.135839613526569, 10.795339784946236, 11.67568611111111, 13.940153260869563, 13.312222222222223, 7.330582716049382, 8.244433862433862, 8.10505185185185, 13.710890740740743, 7.8986429629629615, 9.292101435406698, 10.655820662768031, 11.959288194444444), # 87
(12.106641689032028, 10.74396686579052, 11.655933230452675, 13.90930889694042, 13.29450375211813, 7.315220667581161, 8.210482046316468, 8.069661454046638, 13.686290877914953, 7.8721118825143215, 9.259036080099238, 10.628756046494837, 11.941388245884776), # 88
(12.076560887457505, 10.69228618080446, 11.63591121399177, 13.877936030595812, 13.276204308884047, 7.299459167809785, 8.176338785720048, 8.034639780521262, 13.661402949245542, 7.845505198095699, 9.225407620060253, 10.601372608475922, 11.922917309670781), # 89
(12.045652173913043, 10.640322580645162, 11.615625, 13.846059782608696, 13.257352941176471, 7.283333333333333, 8.142016806722689, 7.999999999999999, 13.636250000000002, 7.818823529411764, 9.191267942583732, 10.573684210526315, 11.90390625), # 90
(12.013970513508676, 10.588100915969731, 11.59507952674897, 13.813705273752015, 13.237978697651899, 7.266878280749885, 8.107528835402473, 7.965755281207133, 13.610855075445818, 7.79206749616719, 9.15666893496367, 10.54570471446105, 11.884385931069957), # 91
(11.981570871354446, 10.535646037435285, 11.574279732510288, 13.78089762479871, 13.218110626966835, 7.250129126657521, 8.07288759783749, 7.9319187928669415, 13.585241220850481, 7.7652377180666505, 9.121662484494063, 10.517447982095156, 11.864387217078187), # 92
(11.948508212560386, 10.482982795698925, 11.553230555555555, 13.74766195652174, 13.197777777777778, 7.2331209876543205, 8.03810582010582, 7.898503703703704, 13.55943148148148, 7.738334814814813, 9.0863004784689, 10.488927875243665, 11.84394097222222), # 93
(11.914837502236535, 10.43013604141776, 11.531936934156379, 13.714023389694042, 13.177009198741224, 7.215888980338362, 8.003196228285553, 7.865523182441701, 13.53344890260631, 7.7113594061163555, 9.050634804182172, 10.460158255721609, 11.823078060699588), # 94
(11.880613705492932, 10.377130625248904, 11.510403806584362, 13.680007045088566, 13.155833938513677, 7.198468221307727, 7.968171548454772, 7.832990397805213, 13.507316529492455, 7.684312111675945, 9.014717348927874, 10.431152985344015, 11.801829346707818), # 95
(11.845891787439614, 10.323991397849465, 11.488636111111111, 13.645638043478261, 13.134281045751633, 7.180893827160493, 7.933044506691564, 7.800918518518519, 13.481057407407405, 7.657193551198256, 8.9786, 10.401925925925926, 11.780225694444445), # 96
(11.810726713186616, 10.270743209876544, 11.466638786008229, 13.610941505636069, 13.112379569111596, 7.163200914494741, 7.897827829074016, 7.769320713305898, 13.454694581618655, 7.63000434438796, 8.942334644692538, 10.372490939282363, 11.758297968106996), # 97
(11.775173447843981, 10.217410911987256, 11.444416769547324, 13.575942552334944, 13.090158557250062, 7.145424599908551, 7.86253424168021, 7.738210150891632, 13.428251097393689, 7.602745110949729, 8.905973170299486, 10.342861887228358, 11.736077031893004), # 98
(11.739286956521738, 10.16401935483871, 11.421975, 13.540666304347825, 13.06764705882353, 7.1276, 7.827176470588236, 7.707599999999999, 13.40175, 7.575416470588234, 8.869567464114832, 10.313052631578946, 11.71359375), # 99
(11.703122204329933, 10.110593389088011, 11.39931841563786, 13.505137882447665, 13.044874122488501, 7.109762231367169, 7.791767241876174, 7.677503429355281, 13.375214334705076, 7.548019043008149, 8.833169413432572, 10.28307703414916, 11.690878986625515), # 100
(11.6667341563786, 10.057157865392274, 11.376451954732511, 13.469382407407409, 13.021868796901476, 7.091946410608139, 7.756319281622114, 7.647933607681755, 13.348667146776405, 7.5205534479141445, 8.796830905546694, 10.252948956754024, 11.667963605967076), # 101
(11.630177777777778, 10.003737634408603, 11.353380555555555, 13.433425, 12.998660130718955, 7.074187654320988, 7.720845315904139, 7.618903703703703, 13.32213148148148, 7.4930203050108934, 8.760603827751195, 10.222682261208577, 11.644878472222222), # 102
(11.593508033637502, 9.950357546794105, 11.3301091563786, 13.39729078099839, 12.975277172597435, 7.056521079103795, 7.685358070800336, 7.590426886145404, 13.295630384087792, 7.465420234003066, 8.724540067340067, 10.192290809327847, 11.621654449588474), # 103
(11.556779889067812, 9.897042453205893, 11.30664269547325, 13.361004871175522, 12.951748971193416, 7.03898180155464, 7.649870272388791, 7.562516323731138, 13.269186899862826, 7.437753854595336, 8.6886915116073, 10.161788462926864, 11.598322402263374), # 104
(11.520048309178742, 9.843817204301073, 11.28298611111111, 13.324592391304348, 12.928104575163397, 7.021604938271605, 7.614394646747589, 7.535185185185185, 13.242824074074074, 7.410021786492375, 8.653110047846889, 10.131189083820663, 11.574913194444443), # 105
(11.483368259080336, 9.790706650736759, 11.259144341563784, 13.288078462157811, 12.904373033163884, 7.004425605852766, 7.578943919954813, 7.508446639231824, 13.216564951989024, 7.382224649398854, 8.617847563352825, 10.100506533824273, 11.551457690329217), # 106
(11.446794703882626, 9.737735643170053, 11.235122325102882, 13.251488204508856, 12.880583393851365, 6.987478920896206, 7.543530818088553, 7.482313854595337, 13.190432578875171, 7.354363063019446, 8.582955945419101, 10.069754674752724, 11.527986754115226), # 107
(11.410382608695652, 9.684929032258065, 11.210925000000001, 13.214846739130435, 12.856764705882352, 6.9708, 7.508168067226889, 7.4568, 13.16445, 7.326437647058824, 8.548487081339712, 10.038947368421054, 11.504531250000001), # 108
(11.374186938629451, 9.632311668657906, 11.18655730452675, 13.178179186795488, 12.832946017913338, 6.954423959762231, 7.472868393447913, 7.431918244170096, 13.138640260631002, 7.298449021221656, 8.514492858408648, 10.008098476644285, 11.48112204218107), # 109
(11.338262658794058, 9.579908403026684, 11.162024176954734, 13.141510668276974, 12.809156378600823, 6.938385916780978, 7.437644522829707, 7.407681755829903, 13.113026406035663, 7.270397805212619, 8.4810251639199, 9.977221861237457, 11.457789994855966), # 110
(11.302664734299517, 9.527744086021507, 11.137330555555558, 13.104866304347826, 12.785424836601306, 6.922720987654322, 7.402509181450357, 7.384103703703703, 13.087631481481482, 7.242284618736383, 8.448135885167463, 9.946331384015595, 11.434565972222222), # 111
(11.26744813025586, 9.47584356829948, 11.112481378600824, 13.068271215780998, 12.76178044057129, 6.907464288980339, 7.367475095387949, 7.361197256515775, 13.062478532235938, 7.214110081497618, 8.41587690944533, 9.915440906793732, 11.411480838477365), # 112
(11.232605068443652, 9.424318342543142, 11.087541393902482, 13.031800658990448, 12.738210816208445, 6.892643723057416, 7.332631156388123, 7.339023082536727, 13.037655373510344, 7.185965683935275, 8.38430868738344, 9.884631523805313, 11.388532681011865), # 113
(11.197777077480078, 9.373676620230642, 11.062854810025941, 12.995747305532804, 12.71447202547959, 6.8782255302358815, 7.298421850092694, 7.317853511406144, 13.013542842855673, 7.158378201495339, 8.353493204535836, 9.85429460653557, 11.365530496992042), # 114
(11.162861883604794, 9.323936638419655, 11.038436319248781, 12.960101406218135, 12.69048921346632, 6.864172214998518, 7.264871580229873, 7.297683185134451, 12.990149974402547, 7.131390393585692, 8.323385413712511, 9.824445099070621, 11.342407957992451), # 115
(11.127815847885161, 9.275025937550042, 11.014238627980648, 12.924799380319685, 12.666226231660534, 6.8504506527445175, 7.231925781033471, 7.278456375478791, 12.967417607073395, 7.104952030139456, 8.293927117525778, 9.795027836984815, 11.319128711707068), # 116
(11.092595331388527, 9.226872058061664, 10.990214442631183, 12.889777647110693, 12.641646931554133, 6.837027718873069, 7.199529886737303, 7.260117354196302, 12.945286579790643, 7.079012881089755, 8.26506011858794, 9.7659876558525, 11.295656405829869), # 117
(11.057156695182252, 9.179402540394388, 10.96631646961004, 12.8549726258644, 12.61671516463901, 6.8238702887833655, 7.167629331575178, 7.2426103930441155, 12.923697731476722, 7.053522716369711, 8.236726219511308, 9.737269391248018, 11.271954688054828), # 118
(11.02145630033369, 9.132544924988075, 10.942497415326867, 12.820320735854047, 12.591394782407065, 6.810945237874599, 7.136169549780907, 7.225879763779374, 12.902591901054052, 7.028431305912446, 8.208867222908193, 9.708817878745721, 11.247987206075917), # 119
(10.985450507910194, 9.08622675228259, 10.918709986191313, 12.785758396352874, 12.565649636350196, 6.7982194415459585, 7.105095975588303, 7.209869738159211, 12.88190992744507, 7.003688419651087, 8.181424931390898, 9.680577953919956, 11.223717607587115), # 120
(10.949095678979122, 9.040375562717795, 10.894906888613024, 12.75122202663412, 12.539443577960302, 6.7856597751966365, 7.0743540432311764, 7.1945245879407675, 12.861592649572199, 6.979243827518755, 8.154341147571738, 9.652494452345065, 11.199109540282393), # 121
(10.912348174607825, 8.994918896733553, 10.871040829001652, 12.716648045971025, 12.512740458729281, 6.773233114225823, 7.043889186943341, 7.179788584881178, 12.841580906357867, 6.955047299448572, 8.127557674063022, 9.6245122095954, 11.174126651855724), # 122
(10.875164355863662, 8.949784294769728, 10.847064513766842, 12.681972873636832, 12.485504130149028, 6.76090633403271, 7.013646840958606, 7.16560600073758, 12.821815536724504, 6.931048605373665, 8.101016313477052, 9.596576061245305, 11.148732590001085), # 123
(10.837500583813984, 8.904899297266184, 10.822930649318243, 12.647132928904783, 12.457698443711445, 6.748646310016486, 6.983572439510783, 7.151921107267111, 12.802237379594539, 6.9071975152271525, 8.074658868426143, 9.56863084286913, 11.122891002412453), # 124
(10.79931321952615, 8.860191444662783, 10.798591942065508, 12.612064631048112, 12.429287250908427, 6.736419917576347, 6.953611416833687, 7.138678176226909, 12.78278727389039, 6.88344379894216, 8.048427141522602, 9.540621390041217, 11.096565536783794), # 125
(10.760558624067514, 8.815588277399392, 10.774001098418278, 12.576704399340064, 12.400234403231872, 6.724194032111481, 6.923709207161124, 7.12582147937411, 12.763406058534501, 6.859737226451811, 8.022262935378736, 9.51249253833592, 11.069719840809094), # 126
(10.721193158505432, 8.771017335915868, 10.749110824786205, 12.540988653053878, 12.370503752173677, 6.711935529021078, 6.893811244726913, 7.113295288465854, 12.744034572449289, 6.836027567689229, 7.9961080526068535, 9.484189123327578, 11.042317562182317), # 127
(10.681173183907255, 8.72640616065208, 10.72387382757894, 12.504853811462798, 12.340059149225747, 6.699611283704333, 6.863862963764858, 7.101043875259275, 12.72461365455718, 6.8122645925875345, 7.969904295819269, 9.455655980590546, 11.014322348597444), # 128
(10.640455061340337, 8.681682292047888, 10.698242813206127, 12.468236293840057, 12.308864445879973, 6.687188171560433, 6.833809798508775, 7.089011511511512, 12.705084143780608, 6.788398071079854, 7.943593467628284, 9.426837945699162, 10.985697847748446), # 129
(10.598995151872039, 8.63677327054316, 10.672170488077414, 12.431072519458903, 12.276883493628256, 6.6746330679885695, 6.803597183192475, 7.077142468979701, 12.685386879042001, 6.764377773099308, 7.9171173706462135, 9.397679854227782, 10.956407707329298), # 130
(10.556749816569713, 8.591606636577751, 10.645609558602457, 12.39329890759257, 12.244080143962494, 6.661912848387936, 6.773170552049771, 7.06538101942098, 12.665462699263783, 6.740153468579022, 7.890417807485361, 9.36812654175075, 10.926415575033973), # 131
(10.51367541650071, 8.546109930591532, 10.618512731190895, 12.354851877514305, 12.210418248374584, 6.648994388157723, 6.7424753393144705, 7.053671434592488, 12.645252443368385, 6.715674927452118, 7.863436580758037, 9.33812284384241, 10.89568509855645), # 132
(10.469728312732395, 8.500210693024362, 10.59083271225238, 12.315667848497341, 12.175861658356423, 6.63584456269712, 6.711456979220387, 7.041957986251359, 12.624696950278231, 6.690891919651718, 7.8361154930765515, 9.307613596077111, 10.864179925590703), # 133
(10.424864866332113, 8.453836464316106, 10.562522208196564, 12.275683239814922, 12.14037422539991, 6.622430247405318, 6.6800609060013345, 7.0301849461547326, 12.603737058915753, 6.665754215110948, 7.808396347053214, 9.2765436340292, 10.831863703830699), # 134
(10.379041438367224, 8.406914784906629, 10.53353392543309, 12.234834470740294, 12.103919800996945, 6.60871831768151, 6.648232553891121, 7.018296586059743, 12.582313608203375, 6.640211583762931, 7.78022094530033, 9.244857793273022, 10.798700080970423), # 135
(10.332214389905081, 8.35937319523579, 10.50382057037161, 12.193057960546687, 12.066462236639419, 6.594675648924887, 6.615917357123561, 7.0062371777235315, 12.560367437063528, 6.6142137955407865, 7.751531090430213, 9.212500909382928, 10.764652704703844), # 136
(10.28434008201304, 8.311139235743456, 10.473334849421772, 12.150290128507349, 12.027965383819241, 6.580269116534637, 6.583060749932466, 6.993950992903235, 12.537839384418639, 6.587710620377641, 7.722268585055167, 9.179417817933263, 10.729685222724932), # 137
(10.235374875758456, 8.26214044686949, 10.442029468993221, 12.106467393895516, 11.988393094028302, 6.565465595909957, 6.5496081665516455, 6.981382303355987, 12.514670289191137, 6.560651828206615, 7.692375231787501, 9.145553354498373, 10.693761282727667), # 138
(10.185275132208682, 8.212304369053752, 10.409857135495608, 12.06152617598443, 11.947709218758497, 6.550231962450032, 6.515505041214911, 6.968475380838929, 12.490800990303445, 6.532987188960836, 7.661792833239527, 9.110852354652607, 10.656844532406023), # 139
(10.133997212431076, 8.16155854273611, 10.376770555338585, 12.015402894047332, 11.905877609501735, 6.534535091554055, 6.480696808156076, 6.955174497109195, 12.466172326677999, 6.5046664725734225, 7.630463192023552, 9.07525965397031, 10.618898619453978), # 140
(10.081497477492995, 8.109830508356424, 10.342722434931792, 11.968033967357464, 11.862862117749904, 6.518341858621218, 6.445128901608954, 6.9414239239239235, 12.440725137237216, 6.4756394489775015, 7.598328110751885, 9.03872008802583, 10.579887191565495), # 141
(10.027732288461786, 8.057047806354559, 10.307665480684884, 11.919355815188064, 11.818626594994903, 6.501619139050712, 6.408746755807351, 6.927167933040253, 12.41440026090353, 6.445855888106193, 7.565329392036836, 9.001178492393512, 10.539773896434559), # 142
(9.972658006404808, 8.003137977170377, 10.27155239900751, 11.86930485681237, 11.773134892728635, 6.484333808241727, 6.371495804985082, 6.912350796215319, 12.387138536599375, 6.415265559892623, 7.531408838490711, 8.962579702647707, 10.49852238175514), # 143
(9.916230992389421, 7.948028561243743, 10.234335896309313, 11.817817511503627, 11.726350862442994, 6.466452741593456, 6.333321483375959, 6.896916785206259, 12.358880803247171, 6.383818234269912, 7.496508252725821, 8.922868554362758, 10.456096295221217), # 144
(9.858407607482972, 7.891647099014518, 10.195968678999947, 11.764830198535073, 11.67823835562988, 6.4479428145050885, 6.294169225213792, 6.880810171770211, 12.329567899769344, 6.351463681171185, 7.460569437354474, 8.881989883113016, 10.41245928452676), # 145
(9.79914421275282, 7.83392113092257, 10.156403453489059, 11.71027933717995, 11.62876122378119, 6.428770902375816, 6.253984464732396, 6.863975227664311, 12.299140665088327, 6.318151670529565, 7.423534194988978, 8.839888524472823, 10.367574997365741), # 146
(9.73839716926632, 7.774778197407756, 10.115592926186292, 11.654101346711496, 11.577883318388821, 6.4089038806048295, 6.212712636165577, 6.846356224645698, 12.267539938126548, 6.283831972278175, 7.385344328241643, 8.796509314016532, 10.321407081432142), # 147
(9.676122838090825, 7.714145838909944, 10.0734898035013, 11.596232646402955, 11.525568490944673, 6.38830862459132, 6.170299173747152, 6.827897434471509, 12.234706557806435, 6.248454356350137, 7.345941639724779, 8.751797087318483, 10.27391918441993), # 148
(9.612277580293695, 7.651951595868995, 10.030046791843732, 11.536609655527563, 11.471780592940645, 6.366952009734479, 6.126689511710929, 6.80854312889888, 12.200581363050405, 6.211968592678576, 7.3052679320506915, 8.705696679953029, 10.225074954023084), # 149
(9.546817756942277, 7.588123008724775, 9.985216597623232, 11.475168793358565, 11.416483475868631, 6.344800911433499, 6.08182908429072, 6.788237579684948, 12.165105192780901, 6.174324451196612, 7.2632650078316905, 8.658152927494514, 10.174838037935576), # 150
(9.47969972910393, 7.522587617917144, 9.93895192724945, 11.411846479169196, 11.359640991220532, 6.321822205087566, 6.03566332572034, 6.7669250585868514, 12.128218885920345, 6.135471701837373, 7.2198746696800855, 8.609110665517285, 10.123172083851381), # 151
(9.41087985784601, 7.455272963885967, 9.89120548713204, 11.346579132232701, 11.301216990488243, 6.297982766095876, 5.9881376702335976, 6.744549837361729, 12.089863281391164, 6.095360114533979, 7.175038720208185, 8.558514729595691, 10.070040739464476), # 152
(9.340314504235872, 7.386106587071107, 9.841929983680641, 11.279303171822319, 11.241175325163667, 6.273249469857618, 5.939197552064303, 6.721056187766714, 12.049979218115787, 6.053939459219555, 7.128698962028299, 8.506309955304076, 10.015407652468832), # 153
(9.267960029340873, 7.315016027912428, 9.79107812330491, 11.209955017211291, 11.179479846738696, 6.247589191771985, 5.888788405446274, 6.696388381558948, 12.008507535016639, 6.011159505827223, 7.080797197752734, 8.45244117821679, 9.959236470558428), # 154
(9.193772794228362, 7.241928826849794, 9.73860261241449, 11.138471087672853, 11.116094406705235, 6.220968807238165, 5.836855664613313, 6.670490690495563, 11.965389071016153, 5.966970024290105, 7.0312752299938, 8.396853233908178, 9.901490841427231), # 155
(9.117709159965697, 7.166772524323065, 9.684456157419032, 11.06478780248025, 11.050982856555176, 6.193355191655353, 5.7833447637992395, 6.643307386333702, 11.920564665036752, 5.921320784541327, 6.980074861363805, 8.339490957952586, 9.842134412769221), # 156
(9.039725487620235, 7.089474660772107, 9.628591464728181, 10.988841580906724, 10.984109047780422, 6.164715220422736, 5.728201137237862, 6.614782740830498, 11.873975156000865, 5.874161556514009, 6.927137894475059, 8.280299185924363, 9.781130832278372), # 157
(8.957617135686286, 7.008543744926709, 9.568310344682827, 10.907723497981491, 10.912417327045196, 6.133229371580532, 5.6701280651134285, 6.582956342819247, 11.821994509918916, 5.824039099549372, 6.870714903046731, 8.217119477033206, 9.715783031298415), # 158
(8.858744120374082, 6.915678383519373, 9.488085382083584, 10.804772590546143, 10.818229571737954, 6.088427577608523, 5.601855316062859, 6.536656239317259, 11.743712713466573, 5.762737192918494, 6.800900322742793, 8.13763502841973, 9.630513176304232), # 159
(8.741846513885172, 6.810116074248857, 9.386305149547066, 10.67829301249063, 10.699704157616154, 6.0292095552572205, 5.5226924980605405, 6.4747190274328155, 11.636910272674381, 5.689446782235472, 6.716711410331447, 8.040602338665416, 9.523704730672296), # 160
(8.607866465503152, 6.692545041696563, 9.26405636629237, 10.529487004508074, 10.558071749138534, 5.956292689884377, 5.433217735208252, 6.397920639731736, 11.50299572039882, 5.604789831805125, 6.618889985519648, 7.926920962689085, 9.396448853782916), # 161
(8.457746124511628, 6.563653510443886, 9.122425751538595, 10.359556807291591, 10.394563010763845, 5.870394366847746, 5.334009151607771, 6.307037008779842, 11.343377589496363, 5.509388305932277, 6.508177868014344, 7.797490455409552, 9.2498367050164), # 162
(8.292427640194196, 6.424129705072228, 8.962500024504841, 10.16970466153432, 10.210408606950825, 5.772231971505087, 5.22564487136088, 6.20284406714295, 11.159464412823487, 5.40386416892175, 6.38531687752249, 7.653210371745638, 9.084959443753055), # 163
(8.11285316183446, 6.2746618501629845, 8.785365904410211, 9.961132807929381, 10.006839202158226, 5.662522889214155, 5.108703018569359, 6.086117747386882, 10.952664723236667, 5.2888393850783615, 6.251048833751035, 7.494980266616163, 8.902908229373192), # 164
(7.9199648387160195, 6.115938170297558, 8.592110110473802, 9.735043487169902, 9.785085460844789, 5.541984505332703, 4.983761717334986, 5.957633982077455, 10.724387053592375, 5.164935918706936, 6.106115556406933, 7.323699694939943, 8.704774221257123), # 165
(7.714704820122476, 5.948646890057345, 8.383819361914712, 9.492638939949002, 9.546378047469256, 5.41133420521849, 4.851399091759543, 5.818168703780493, 10.476039936747087, 5.0327757341122945, 5.9512588651971345, 7.140268211635801, 8.491648578785155), # 166
(7.498015255337426, 5.773476234023744, 8.161580377952045, 9.235121406959811, 9.291947626490375, 5.27128937422927, 4.712193265944809, 5.668497845061811, 10.209031905557278, 4.892980795599256, 5.787220579828592, 6.94558537162255, 8.264622461337595), # 167
(7.2708382936444735, 5.591114426778154, 7.926479877804897, 8.963693128895455, 9.02302486236689, 5.122567397722799, 4.5667223639925645, 5.509397338487231, 9.924771492879426, 4.746173067472646, 5.614742520008257, 6.740550729819013, 8.024787028294753), # 168
(7.034116084327218, 5.402249692901975, 7.67960458069237, 8.67955634644906, 8.740840419557543, 4.965885661056833, 4.4155645100045895, 5.341643116622574, 9.624667231570005, 4.592974514037284, 5.434566505443081, 6.526063841144007, 7.773233439036942), # 169
(6.78879077666926, 5.207570256976605, 7.422041205833562, 8.383913300313743, 8.44662496252108, 4.8019615495891275, 4.259297828082663, 5.166011112033656, 9.310127654485486, 4.434007099597989, 5.247434355840019, 6.3030242605163505, 7.5110528529444665), # 170
(6.5358045199542, 5.007764343583441, 7.154876472447573, 8.077966231182643, 8.141609155716246, 4.631512448677438, 4.098500442328566, 4.983277257286299, 8.982561294482347, 4.269892788459586, 5.054087890906017, 6.072331542854863, 7.239336429397638), # 171
(6.276099463465638, 4.803520177303883, 6.879197099753504, 7.762917379748876, 7.827023663601784, 4.45525574367952, 3.9337504768440783, 4.794217484946325, 8.643376684417062, 4.101253544926895, 4.855268930348032, 5.834885243078365, 6.959175327776763), # 172
(6.010617756487176, 4.59552598271933, 6.596089806970453, 7.43996898670557, 7.504099150636442, 4.27390881995313, 3.7656260557309795, 4.599607727579548, 8.293982357146106, 3.9287113333047374, 4.651719293873013, 5.59158491610567, 6.671660707462155), # 173
(5.740301548302412, 4.384469984411181, 6.306641313317521, 7.110323292745848, 7.174066281278959, 4.088189062856022, 3.5947053030910503, 4.400223917751792, 7.935786845525956, 3.752888117897936, 4.444180801187913, 5.3433301168556016, 6.37788372783412), # 174
(5.466092988194946, 4.171040406960834, 6.01193833801381, 6.775182538562841, 6.838155719988083, 3.898813857745954, 3.421566343026069, 4.196841988028875, 7.570198682413086, 3.574405863011309, 4.233395271999683, 5.091020400246977, 6.078935548272969), # 175
(5.188934225448382, 3.9559254749496873, 5.713067600278413, 6.43574896484967, 6.497598131222556, 3.7065005899806795, 3.2467872996378175, 3.9902378709766184, 7.1986264006639695, 3.3938865329496806, 4.020104526015276, 4.835555321198615, 5.7759073281590085), # 176
(4.909767409346319, 3.7398134129591414, 5.411115819330436, 6.09322481229946, 6.1536241794411275, 3.511966644917956, 3.0709462970280748, 3.781187499160839, 6.822478533135084, 3.2119520920178695, 3.8050503829416424, 4.5778344346293345, 5.4698902268725496), # 177
(4.629534689172356, 3.5233924455705936, 5.107169714388976, 5.748812321605339, 5.807464529102536, 3.3159294079155393, 2.894621459298621, 3.5704668051473587, 6.443163612682903, 3.0292245045207, 3.588974662485735, 4.318757295457952, 5.161975403793902), # 178
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 179
)
passenger_arriving_acc = (
(4, 7, 8, 2, 6, 3, 0, 2, 1, 0, 1, 0, 0, 1, 11, 3, 2, 4, 4, 2, 1, 1, 2, 3, 1, 0), # 0
(17, 17, 13, 11, 9, 6, 2, 6, 8, 2, 2, 0, 0, 7, 17, 11, 2, 11, 7, 3, 3, 6, 3, 5, 1, 0), # 1
(22, 20, 18, 18, 13, 7, 6, 7, 12, 2, 2, 0, 0, 15, 26, 17, 5, 13, 12, 4, 5, 10, 3, 5, 2, 0), # 2
(33, 27, 24, 23, 19, 9, 6, 10, 18, 4, 2, 0, 0, 20, 34, 24, 9, 18, 16, 7, 7, 12, 4, 7, 2, 0), # 3
(38, 41, 30, 28, 25, 9, 12, 12, 21, 5, 3, 0, 0, 28, 42, 30, 12, 26, 20, 12, 9, 14, 4, 8, 3, 0), # 4
(46, 51, 38, 34, 30, 13, 20, 15, 23, 8, 3, 0, 0, 38, 49, 39, 15, 32, 30, 14, 10, 16, 8, 8, 4, 0), # 5
(53, 58, 47, 43, 42, 16, 23, 19, 23, 9, 4, 0, 0, 52, 56, 46, 16, 38, 33, 19, 15, 18, 9, 8, 4, 0), # 6
(61, 65, 55, 53, 49, 16, 25, 22, 25, 12, 7, 2, 0, 64, 62, 49, 21, 42, 35, 25, 17, 20, 13, 9, 4, 0), # 7
(73, 72, 58, 62, 58, 20, 28, 24, 30, 15, 7, 4, 0, 77, 68, 58, 22, 49, 42, 28, 18, 24, 15, 10, 4, 0), # 8
(82, 83, 70, 73, 63, 26, 29, 30, 36, 16, 7, 5, 0, 86, 74, 65, 28, 59, 46, 34, 21, 29, 20, 10, 5, 0), # 9
(92, 92, 80, 88, 68, 32, 33, 33, 41, 16, 7, 7, 0, 96, 85, 71, 30, 64, 53, 37, 21, 33, 23, 12, 6, 0), # 10
(105, 100, 98, 93, 74, 36, 37, 39, 49, 17, 8, 8, 0, 110, 95, 79, 36, 75, 59, 42, 23, 38, 24, 13, 7, 0), # 11
(112, 107, 108, 107, 78, 37, 41, 41, 50, 19, 9, 8, 0, 120, 101, 88, 45, 82, 64, 51, 29, 44, 26, 15, 7, 0), # 12
(124, 120, 117, 113, 82, 40, 45, 42, 57, 21, 10, 9, 0, 135, 109, 91, 51, 95, 71, 56, 30, 51, 30, 17, 7, 0), # 13
(136, 124, 125, 120, 89, 46, 46, 45, 60, 26, 12, 10, 0, 146, 124, 94, 54, 107, 76, 62, 33, 53, 34, 18, 7, 0), # 14
(148, 141, 137, 134, 103, 49, 52, 50, 63, 27, 12, 13, 0, 154, 137, 109, 60, 114, 79, 68, 35, 57, 35, 19, 8, 0), # 15
(162, 157, 146, 147, 111, 55, 58, 54, 68, 28, 12, 15, 0, 169, 150, 114, 67, 122, 84, 73, 40, 58, 42, 21, 11, 0), # 16
(171, 167, 159, 155, 120, 59, 68, 60, 73, 29, 14, 16, 0, 180, 162, 122, 76, 129, 88, 80, 42, 65, 46, 22, 12, 0), # 17
(185, 179, 165, 164, 131, 65, 72, 65, 84, 31, 17, 18, 0, 194, 168, 131, 82, 136, 89, 87, 45, 69, 50, 25, 13, 0), # 18
(203, 197, 175, 182, 144, 66, 76, 75, 86, 35, 18, 19, 0, 203, 179, 135, 88, 145, 96, 93, 47, 74, 53, 25, 14, 0), # 19
(220, 211, 185, 196, 159, 72, 83, 78, 89, 37, 18, 19, 0, 210, 191, 142, 94, 161, 104, 98, 48, 77, 58, 27, 16, 0), # 20
(228, 221, 191, 207, 164, 77, 88, 80, 93, 41, 21, 20, 0, 221, 201, 152, 103, 170, 112, 103, 53, 82, 61, 27, 16, 0), # 21
(237, 232, 203, 217, 170, 79, 93, 81, 98, 44, 24, 21, 0, 234, 212, 155, 111, 183, 115, 111, 55, 88, 62, 28, 17, 0), # 22
(253, 252, 218, 229, 183, 82, 100, 83, 105, 46, 25, 21, 0, 244, 218, 162, 119, 190, 121, 114, 58, 97, 64, 30, 17, 0), # 23
(261, 265, 227, 240, 191, 88, 104, 86, 108, 49, 27, 21, 0, 252, 224, 168, 126, 195, 134, 116, 60, 101, 69, 33, 19, 0), # 24
(267, 280, 237, 251, 203, 90, 107, 93, 112, 52, 31, 21, 0, 262, 237, 172, 131, 207, 143, 118, 64, 107, 72, 34, 20, 0), # 25
(279, 287, 249, 265, 211, 95, 110, 97, 116, 56, 31, 21, 0, 272, 244, 182, 139, 215, 149, 122, 69, 110, 78, 37, 21, 0), # 26
(289, 297, 260, 276, 218, 100, 110, 100, 122, 57, 33, 22, 0, 287, 255, 193, 147, 221, 157, 129, 73, 115, 81, 40, 22, 0), # 27
(296, 304, 270, 288, 224, 101, 116, 104, 127, 59, 37, 22, 0, 300, 262, 197, 158, 233, 163, 134, 79, 118, 86, 43, 22, 0), # 28
(311, 315, 284, 294, 235, 103, 120, 111, 129, 64, 38, 23, 0, 310, 269, 208, 164, 245, 174, 144, 82, 124, 90, 49, 22, 0), # 29
(323, 336, 294, 306, 248, 108, 123, 117, 138, 68, 40, 25, 0, 317, 284, 216, 169, 253, 184, 150, 87, 132, 93, 50, 23, 0), # 30
(341, 351, 309, 316, 254, 110, 127, 123, 142, 73, 41, 26, 0, 328, 295, 225, 173, 262, 191, 156, 89, 135, 96, 51, 23, 0), # 31
(356, 370, 315, 329, 263, 116, 129, 128, 145, 77, 41, 30, 0, 342, 309, 231, 175, 270, 201, 161, 94, 139, 101, 56, 24, 0), # 32
(367, 391, 323, 345, 270, 118, 132, 134, 151, 79, 42, 32, 0, 352, 319, 238, 183, 278, 206, 167, 101, 142, 104, 59, 25, 0), # 33
(381, 404, 340, 361, 278, 122, 134, 140, 159, 80, 45, 32, 0, 365, 328, 243, 190, 288, 213, 172, 107, 143, 108, 59, 25, 0), # 34
(398, 414, 351, 371, 283, 127, 138, 143, 166, 83, 49, 32, 0, 379, 339, 250, 197, 299, 216, 177, 113, 147, 113, 60, 25, 0), # 35
(411, 419, 365, 381, 295, 132, 141, 147, 170, 88, 52, 33, 0, 391, 346, 258, 203, 308, 230, 182, 117, 149, 117, 64, 25, 0), # 36
(421, 435, 374, 397, 301, 136, 146, 151, 173, 88, 54, 34, 0, 402, 357, 267, 206, 322, 237, 189, 120, 154, 122, 67, 26, 0), # 37
(428, 447, 385, 407, 311, 141, 148, 156, 181, 90, 55, 35, 0, 415, 370, 277, 211, 327, 246, 200, 127, 160, 126, 69, 28, 0), # 38
(441, 464, 394, 420, 324, 145, 155, 165, 184, 92, 55, 37, 0, 428, 378, 294, 217, 343, 253, 205, 127, 164, 130, 71, 29, 0), # 39
(452, 482, 410, 431, 336, 149, 161, 169, 187, 95, 57, 39, 0, 442, 391, 302, 226, 357, 261, 208, 129, 168, 138, 73, 30, 0), # 40
(460, 488, 424, 443, 345, 157, 168, 171, 191, 100, 58, 40, 0, 454, 400, 308, 236, 369, 268, 209, 133, 172, 140, 78, 31, 0), # 41
(471, 503, 435, 453, 349, 160, 173, 172, 195, 102, 59, 40, 0, 465, 406, 314, 249, 385, 271, 218, 139, 177, 146, 80, 31, 0), # 42
(482, 522, 450, 462, 364, 163, 175, 178, 204, 107, 61, 41, 0, 477, 418, 324, 254, 394, 279, 220, 141, 179, 150, 83, 33, 0), # 43
(496, 540, 459, 475, 377, 165, 179, 180, 208, 108, 63, 45, 0, 483, 430, 340, 264, 400, 285, 224, 144, 182, 152, 85, 34, 0), # 44
(510, 550, 468, 483, 382, 171, 181, 183, 212, 109, 63, 47, 0, 495, 441, 346, 269, 412, 296, 227, 151, 187, 153, 86, 35, 0), # 45
(522, 557, 481, 492, 395, 171, 185, 194, 213, 110, 63, 48, 0, 505, 452, 356, 277, 423, 302, 230, 153, 188, 156, 86, 35, 0), # 46
(533, 575, 493, 504, 403, 174, 187, 196, 217, 112, 63, 48, 0, 523, 460, 363, 284, 431, 310, 233, 155, 195, 159, 89, 35, 0), # 47
(551, 580, 502, 513, 412, 181, 191, 201, 229, 114, 67, 50, 0, 535, 470, 372, 288, 448, 313, 238, 158, 200, 160, 91, 36, 0), # 48
(563, 596, 508, 520, 426, 183, 195, 202, 234, 116, 69, 52, 0, 547, 480, 379, 295, 454, 320, 241, 167, 202, 166, 93, 36, 0), # 49
(577, 603, 521, 530, 431, 186, 196, 205, 240, 117, 72, 52, 0, 567, 494, 394, 304, 464, 321, 242, 171, 208, 170, 96, 37, 0), # 50
(591, 613, 536, 536, 441, 190, 200, 210, 249, 118, 78, 52, 0, 580, 504, 401, 311, 472, 331, 244, 173, 213, 170, 100, 37, 0), # 51
(608, 627, 551, 549, 453, 195, 208, 215, 257, 119, 78, 53, 0, 587, 515, 409, 316, 488, 336, 248, 176, 216, 173, 101, 38, 0), # 52
(618, 634, 565, 563, 463, 199, 214, 219, 263, 119, 80, 54, 0, 598, 526, 425, 323, 501, 342, 250, 181, 223, 177, 104, 40, 0), # 53
(628, 649, 575, 572, 470, 203, 220, 223, 264, 122, 82, 55, 0, 608, 542, 431, 328, 510, 348, 254, 184, 227, 180, 105, 40, 0), # 54
(640, 663, 584, 579, 480, 208, 227, 227, 270, 124, 83, 55, 0, 626, 554, 438, 339, 514, 356, 258, 187, 234, 184, 107, 41, 0), # 55
(653, 676, 597, 585, 489, 215, 227, 230, 276, 125, 83, 56, 0, 638, 566, 442, 348, 525, 364, 261, 188, 235, 186, 109, 41, 0), # 56
(663, 689, 613, 597, 506, 218, 232, 236, 285, 129, 83, 57, 0, 647, 579, 451, 357, 531, 366, 262, 190, 241, 189, 110, 46, 0), # 57
(682, 705, 619, 608, 515, 224, 237, 241, 289, 131, 85, 58, 0, 655, 589, 461, 366, 539, 371, 270, 193, 243, 191, 110, 46, 0), # 58
(691, 720, 627, 621, 524, 227, 244, 246, 291, 132, 87, 59, 0, 666, 596, 466, 373, 547, 376, 273, 195, 245, 197, 112, 47, 0), # 59
(704, 736, 630, 626, 538, 231, 246, 250, 294, 135, 89, 59, 0, 685, 607, 473, 380, 555, 379, 276, 198, 251, 201, 112, 49, 0), # 60
(720, 741, 641, 643, 548, 236, 251, 254, 296, 138, 91, 59, 0, 693, 613, 481, 386, 561, 382, 287, 201, 255, 207, 112, 50, 0), # 61
(732, 750, 650, 664, 556, 239, 258, 256, 306, 139, 92, 60, 0, 706, 627, 484, 393, 566, 388, 290, 204, 260, 213, 113, 54, 0), # 62
(740, 757, 664, 677, 564, 241, 262, 258, 314, 141, 93, 64, 0, 719, 637, 489, 397, 579, 394, 295, 210, 267, 218, 113, 58, 0), # 63
(754, 763, 677, 688, 573, 247, 271, 263, 317, 141, 96, 67, 0, 729, 650, 498, 401, 588, 401, 298, 216, 273, 222, 119, 59, 0), # 64
(769, 772, 686, 704, 582, 253, 276, 267, 325, 141, 98, 67, 0, 745, 660, 505, 408, 597, 402, 303, 216, 278, 225, 120, 59, 0), # 65
(781, 789, 695, 712, 590, 260, 278, 273, 328, 142, 101, 69, 0, 751, 670, 513, 414, 612, 406, 312, 218, 285, 228, 122, 60, 0), # 66
(787, 804, 703, 723, 597, 265, 281, 277, 330, 143, 104, 71, 0, 759, 685, 522, 420, 628, 407, 317, 223, 292, 232, 124, 62, 0), # 67
(803, 820, 714, 731, 610, 269, 283, 279, 332, 145, 106, 72, 0, 772, 691, 529, 424, 640, 409, 328, 228, 299, 234, 126, 63, 0), # 68
(811, 834, 723, 739, 619, 274, 286, 282, 343, 145, 107, 72, 0, 789, 700, 535, 429, 649, 413, 332, 231, 303, 238, 128, 63, 0), # 69
(826, 839, 733, 748, 631, 277, 297, 285, 346, 149, 107, 73, 0, 794, 711, 547, 441, 656, 415, 342, 236, 307, 241, 129, 67, 0), # 70
(837, 851, 751, 761, 639, 281, 302, 290, 353, 152, 110, 73, 0, 803, 724, 560, 444, 663, 422, 344, 237, 310, 244, 130, 69, 0), # 71
(851, 866, 762, 775, 648, 284, 306, 294, 356, 157, 112, 74, 0, 817, 734, 572, 449, 676, 428, 351, 241, 314, 251, 131, 69, 0), # 72
(867, 878, 771, 785, 657, 286, 310, 296, 359, 161, 113, 74, 0, 827, 744, 579, 460, 690, 433, 354, 243, 319, 256, 135, 69, 0), # 73
(872, 888, 779, 797, 665, 286, 315, 301, 362, 162, 116, 75, 0, 842, 752, 586, 468, 700, 437, 360, 245, 321, 261, 140, 72, 0), # 74
(880, 896, 790, 810, 678, 289, 320, 304, 370, 166, 116, 75, 0, 855, 763, 592, 475, 710, 443, 364, 247, 325, 263, 143, 74, 0), # 75
(889, 910, 804, 824, 688, 290, 324, 308, 375, 172, 117, 75, 0, 866, 769, 602, 482, 721, 444, 368, 251, 332, 267, 144, 76, 0), # 76
(903, 917, 817, 836, 699, 292, 330, 312, 379, 174, 120, 76, 0, 876, 785, 610, 486, 726, 447, 372, 254, 336, 272, 145, 77, 0), # 77
(913, 926, 824, 844, 705, 300, 334, 316, 384, 176, 122, 77, 0, 884, 794, 616, 492, 740, 450, 377, 257, 343, 276, 147, 78, 0), # 78
(926, 935, 836, 859, 711, 303, 338, 318, 392, 179, 126, 77, 0, 896, 806, 624, 501, 748, 451, 383, 261, 346, 279, 149, 78, 0), # 79
(938, 944, 845, 871, 722, 312, 343, 321, 397, 181, 127, 77, 0, 904, 814, 634, 507, 755, 455, 388, 271, 349, 280, 150, 80, 0), # 80
(956, 955, 857, 880, 734, 317, 347, 328, 404, 186, 130, 78, 0, 916, 823, 637, 515, 766, 460, 389, 274, 352, 283, 153, 80, 0), # 81
(972, 968, 864, 886, 745, 320, 352, 332, 407, 190, 132, 80, 0, 928, 835, 643, 519, 777, 464, 396, 280, 356, 287, 154, 80, 0), # 82
(985, 975, 874, 893, 757, 320, 357, 336, 412, 191, 132, 81, 0, 940, 841, 649, 524, 782, 465, 397, 281, 359, 288, 158, 80, 0), # 83
(995, 985, 881, 904, 767, 325, 360, 339, 416, 196, 132, 83, 0, 948, 855, 656, 529, 793, 465, 403, 283, 365, 288, 160, 80, 0), # 84
(1009, 992, 890, 913, 777, 327, 364, 343, 420, 199, 133, 84, 0, 960, 862, 664, 533, 800, 468, 406, 288, 373, 291, 164, 82, 0), # 85
(1013, 1005, 900, 923, 789, 334, 368, 347, 422, 202, 136, 85, 0, 980, 869, 672, 538, 809, 473, 407, 289, 379, 295, 165, 83, 0), # 86
(1020, 1019, 907, 931, 798, 341, 374, 352, 428, 203, 137, 85, 0, 989, 879, 678, 546, 817, 481, 412, 291, 384, 301, 166, 86, 0), # 87
(1041, 1025, 920, 945, 805, 346, 375, 356, 432, 205, 139, 88, 0, 997, 888, 686, 553, 823, 486, 415, 292, 390, 304, 166, 87, 0), # 88
(1045, 1032, 935, 950, 813, 352, 377, 359, 438, 205, 139, 91, 0, 1011, 902, 696, 561, 831, 488, 421, 293, 395, 309, 168, 88, 0), # 89
(1057, 1038, 946, 962, 821, 353, 386, 360, 443, 206, 140, 91, 0, 1023, 915, 701, 571, 841, 491, 425, 300, 400, 313, 170, 91, 0), # 90
(1068, 1042, 956, 971, 828, 358, 389, 363, 448, 208, 141, 94, 0, 1031, 924, 709, 575, 848, 494, 430, 302, 402, 320, 173, 91, 0), # 91
(1075, 1054, 965, 980, 833, 363, 393, 364, 454, 208, 145, 95, 0, 1042, 937, 718, 578, 858, 497, 434, 304, 406, 326, 175, 92, 0), # 92
(1085, 1063, 976, 985, 842, 370, 397, 367, 458, 209, 147, 95, 0, 1053, 949, 721, 580, 869, 498, 438, 305, 411, 327, 176, 92, 0), # 93
(1095, 1070, 989, 990, 849, 375, 402, 371, 461, 212, 147, 95, 0, 1065, 959, 724, 582, 877, 503, 445, 310, 415, 329, 177, 92, 0), # 94
(1103, 1081, 995, 1000, 857, 378, 411, 373, 467, 213, 147, 95, 0, 1074, 965, 732, 589, 882, 504, 449, 315, 425, 334, 177, 94, 0), # 95
(1115, 1087, 1005, 1014, 863, 382, 417, 375, 474, 216, 148, 96, 0, 1088, 977, 737, 593, 890, 512, 456, 318, 431, 336, 179, 94, 0), # 96
(1125, 1094, 1018, 1029, 872, 386, 422, 378, 479, 218, 149, 96, 0, 1097, 991, 745, 598, 894, 516, 461, 318, 435, 339, 180, 94, 0), # 97
(1139, 1107, 1026, 1039, 881, 391, 428, 383, 481, 221, 150, 99, 0, 1105, 998, 755, 603, 901, 521, 463, 319, 441, 343, 182, 95, 0), # 98
(1150, 1118, 1036, 1046, 891, 395, 436, 390, 486, 223, 153, 99, 0, 1115, 1006, 761, 611, 909, 523, 464, 325, 445, 344, 184, 97, 0), # 99
(1167, 1128, 1046, 1062, 899, 400, 439, 393, 490, 224, 155, 99, 0, 1125, 1014, 766, 619, 918, 526, 467, 327, 448, 346, 185, 97, 0), # 100
(1179, 1131, 1052, 1069, 907, 410, 442, 396, 495, 225, 157, 100, 0, 1131, 1024, 774, 621, 923, 531, 471, 331, 451, 347, 186, 98, 0), # 101
(1186, 1140, 1067, 1087, 915, 415, 444, 399, 496, 227, 158, 100, 0, 1142, 1033, 779, 626, 931, 537, 477, 334, 459, 348, 187, 99, 0), # 102
(1193, 1147, 1080, 1100, 925, 418, 448, 403, 504, 228, 160, 100, 0, 1159, 1038, 787, 632, 943, 540, 484, 336, 467, 352, 192, 99, 0), # 103
(1199, 1161, 1088, 1107, 939, 420, 454, 406, 510, 233, 161, 102, 0, 1171, 1044, 792, 641, 953, 544, 486, 338, 471, 354, 193, 99, 0), # 104
(1208, 1172, 1093, 1124, 948, 423, 457, 407, 513, 235, 163, 103, 0, 1177, 1054, 800, 646, 957, 547, 493, 341, 476, 355, 195, 99, 0), # 105
(1218, 1182, 1103, 1136, 955, 425, 460, 408, 515, 235, 165, 103, 0, 1191, 1058, 807, 649, 968, 551, 499, 344, 480, 356, 198, 100, 0), # 106
(1232, 1191, 1115, 1143, 964, 427, 464, 411, 520, 235, 166, 103, 0, 1202, 1076, 817, 661, 977, 557, 504, 347, 483, 359, 201, 100, 0), # 107
(1243, 1195, 1123, 1149, 972, 436, 474, 411, 528, 237, 169, 105, 0, 1219, 1082, 823, 666, 985, 560, 507, 349, 486, 363, 202, 100, 0), # 108
(1256, 1203, 1138, 1156, 979, 438, 479, 414, 531, 239, 169, 105, 0, 1230, 1094, 828, 670, 992, 561, 509, 356, 487, 367, 206, 102, 0), # 109
(1272, 1214, 1147, 1165, 993, 443, 484, 418, 535, 241, 170, 106, 0, 1243, 1102, 833, 673, 1000, 564, 515, 362, 494, 367, 209, 102, 0), # 110
(1285, 1220, 1153, 1175, 1001, 445, 486, 420, 538, 242, 171, 106, 0, 1251, 1110, 845, 677, 1007, 567, 520, 362, 499, 373, 209, 102, 0), # 111
(1294, 1229, 1162, 1189, 1007, 448, 491, 422, 541, 244, 174, 108, 0, 1261, 1116, 850, 683, 1016, 573, 523, 364, 503, 376, 215, 103, 0), # 112
(1302, 1238, 1174, 1201, 1013, 449, 492, 427, 548, 245, 175, 108, 0, 1267, 1123, 856, 688, 1024, 579, 527, 364, 508, 381, 215, 104, 0), # 113
(1308, 1245, 1187, 1205, 1016, 455, 494, 430, 552, 245, 178, 108, 0, 1278, 1139, 863, 696, 1033, 583, 531, 367, 515, 386, 216, 105, 0), # 114
(1319, 1256, 1198, 1217, 1027, 461, 498, 433, 556, 246, 179, 109, 0, 1288, 1147, 871, 701, 1044, 588, 539, 369, 519, 391, 219, 107, 0), # 115
(1329, 1264, 1207, 1223, 1036, 465, 501, 438, 560, 249, 181, 109, 0, 1296, 1154, 881, 706, 1051, 594, 545, 371, 523, 394, 219, 108, 0), # 116
(1342, 1270, 1212, 1230, 1045, 469, 503, 439, 565, 251, 182, 109, 0, 1306, 1164, 889, 714, 1061, 595, 552, 375, 531, 396, 220, 108, 0), # 117
(1350, 1278, 1219, 1240, 1053, 480, 507, 443, 573, 252, 182, 111, 0, 1322, 1174, 893, 720, 1069, 599, 557, 375, 532, 397, 224, 109, 0), # 118
(1357, 1289, 1225, 1250, 1066, 483, 513, 447, 576, 253, 183, 111, 0, 1331, 1185, 898, 725, 1073, 601, 562, 377, 536, 400, 226, 109, 0), # 119
(1365, 1295, 1237, 1263, 1071, 490, 518, 449, 580, 254, 186, 113, 0, 1343, 1191, 905, 729, 1081, 607, 565, 381, 541, 403, 230, 110, 0), # 120
(1373, 1304, 1245, 1272, 1084, 497, 519, 452, 584, 255, 186, 113, 0, 1353, 1205, 913, 739, 1087, 612, 568, 382, 542, 405, 230, 112, 0), # 121
(1386, 1320, 1254, 1280, 1095, 504, 521, 455, 589, 259, 188, 115, 0, 1364, 1216, 919, 742, 1093, 616, 572, 383, 544, 411, 231, 113, 0), # 122
(1397, 1332, 1262, 1290, 1100, 509, 526, 458, 592, 261, 191, 115, 0, 1375, 1228, 927, 746, 1104, 621, 575, 385, 546, 416, 236, 113, 0), # 123
(1407, 1341, 1271, 1300, 1112, 517, 531, 462, 594, 261, 192, 116, 0, 1391, 1237, 938, 752, 1111, 623, 578, 388, 551, 421, 236, 113, 0), # 124
(1420, 1345, 1280, 1315, 1119, 521, 534, 465, 602, 264, 194, 117, 0, 1400, 1244, 946, 756, 1120, 627, 581, 394, 558, 423, 237, 113, 0), # 125
(1426, 1353, 1289, 1323, 1129, 526, 536, 469, 608, 267, 195, 117, 0, 1407, 1253, 956, 762, 1130, 632, 586, 398, 563, 427, 239, 113, 0), # 126
(1432, 1358, 1294, 1334, 1132, 527, 540, 473, 613, 269, 197, 117, 0, 1422, 1259, 968, 769, 1138, 636, 589, 399, 573, 429, 240, 113, 0), # 127
(1447, 1363, 1303, 1341, 1141, 532, 542, 474, 617, 269, 201, 117, 0, 1430, 1265, 973, 772, 1145, 640, 595, 403, 575, 432, 242, 114, 0), # 128
(1454, 1374, 1311, 1352, 1151, 537, 543, 476, 619, 273, 201, 117, 0, 1442, 1277, 976, 774, 1152, 643, 597, 405, 579, 436, 246, 115, 0), # 129
(1462, 1376, 1321, 1371, 1156, 542, 546, 477, 623, 273, 203, 117, 0, 1449, 1280, 983, 777, 1159, 646, 605, 406, 583, 443, 247, 115, 0), # 130
(1470, 1379, 1335, 1387, 1165, 547, 551, 482, 629, 273, 204, 117, 0, 1460, 1288, 992, 781, 1170, 647, 612, 407, 588, 447, 247, 116, 0), # 131
(1477, 1384, 1348, 1392, 1173, 549, 556, 482, 635, 274, 204, 119, 0, 1470, 1296, 996, 786, 1177, 651, 617, 407, 590, 451, 248, 116, 0), # 132
(1487, 1393, 1360, 1399, 1182, 553, 558, 486, 639, 277, 205, 119, 0, 1486, 1304, 999, 792, 1183, 657, 620, 409, 595, 454, 250, 117, 0), # 133
(1497, 1402, 1372, 1405, 1193, 559, 560, 488, 642, 277, 206, 119, 0, 1493, 1315, 1003, 799, 1191, 660, 623, 410, 601, 454, 251, 118, 0), # 134
(1509, 1408, 1383, 1414, 1199, 563, 564, 493, 647, 280, 206, 120, 0, 1503, 1320, 1017, 803, 1202, 666, 626, 415, 603, 455, 252, 119, 0), # 135
(1519, 1419, 1395, 1425, 1206, 565, 567, 494, 652, 280, 206, 120, 0, 1509, 1327, 1025, 805, 1212, 670, 627, 417, 606, 460, 256, 120, 0), # 136
(1528, 1427, 1402, 1434, 1211, 568, 570, 496, 657, 281, 207, 122, 0, 1524, 1333, 1029, 813, 1221, 672, 634, 420, 609, 462, 260, 120, 0), # 137
(1537, 1430, 1408, 1438, 1221, 574, 573, 500, 663, 282, 210, 122, 0, 1531, 1343, 1036, 816, 1235, 678, 639, 423, 613, 466, 261, 120, 0), # 138
(1547, 1436, 1416, 1442, 1230, 578, 576, 502, 668, 284, 214, 125, 0, 1537, 1354, 1043, 821, 1246, 681, 642, 428, 616, 468, 264, 120, 0), # 139
(1558, 1448, 1427, 1451, 1240, 579, 580, 506, 673, 287, 215, 127, 0, 1547, 1363, 1051, 824, 1251, 683, 646, 431, 619, 471, 266, 120, 0), # 140
(1566, 1456, 1438, 1465, 1251, 581, 582, 509, 678, 288, 216, 128, 0, 1554, 1370, 1058, 830, 1266, 687, 652, 431, 622, 475, 268, 120, 0), # 141
(1575, 1463, 1450, 1475, 1261, 587, 585, 511, 683, 290, 220, 130, 0, 1566, 1378, 1062, 831, 1275, 694, 657, 435, 623, 478, 272, 120, 0), # 142
(1581, 1471, 1459, 1479, 1273, 596, 589, 514, 686, 290, 221, 131, 0, 1572, 1387, 1071, 838, 1286, 698, 657, 437, 629, 480, 272, 123, 0), # 143
(1586, 1481, 1468, 1489, 1279, 597, 591, 517, 690, 290, 222, 131, 0, 1579, 1398, 1075, 841, 1293, 703, 662, 438, 631, 483, 272, 124, 0), # 144
(1591, 1484, 1479, 1495, 1284, 600, 597, 524, 693, 292, 223, 131, 0, 1588, 1405, 1078, 842, 1298, 706, 663, 441, 634, 484, 272, 127, 0), # 145
(1612, 1490, 1491, 1503, 1296, 603, 601, 531, 698, 296, 224, 132, 0, 1602, 1411, 1085, 846, 1306, 710, 665, 447, 636, 485, 272, 129, 0), # 146
(1625, 1496, 1500, 1509, 1302, 605, 603, 535, 702, 298, 226, 133, 0, 1615, 1420, 1091, 852, 1314, 716, 669, 449, 640, 486, 273, 130, 0), # 147
(1634, 1503, 1509, 1515, 1318, 608, 606, 538, 702, 300, 227, 133, 0, 1624, 1427, 1096, 862, 1331, 722, 673, 451, 645, 492, 277, 131, 0), # 148
(1641, 1513, 1518, 1525, 1327, 613, 609, 539, 706, 301, 229, 135, 0, 1636, 1431, 1101, 866, 1339, 726, 676, 454, 645, 496, 279, 132, 0), # 149
(1651, 1521, 1521, 1532, 1331, 615, 609, 544, 710, 302, 231, 136, 0, 1651, 1438, 1104, 869, 1347, 728, 682, 456, 650, 499, 280, 134, 0), # 150
(1664, 1524, 1527, 1536, 1336, 619, 613, 544, 714, 304, 232, 137, 0, 1656, 1447, 1112, 875, 1353, 731, 684, 458, 652, 500, 284, 134, 0), # 151
(1672, 1532, 1539, 1544, 1341, 620, 617, 548, 719, 306, 232, 137, 0, 1665, 1456, 1119, 879, 1357, 733, 688, 459, 659, 501, 285, 135, 0), # 152
(1683, 1544, 1549, 1555, 1349, 623, 619, 549, 723, 309, 233, 137, 0, 1673, 1465, 1124, 888, 1364, 738, 690, 462, 662, 505, 285, 136, 0), # 153
(1692, 1549, 1555, 1562, 1353, 625, 619, 551, 725, 312, 234, 137, 0, 1682, 1471, 1129, 893, 1371, 742, 694, 467, 664, 508, 286, 136, 0), # 154
(1700, 1553, 1562, 1571, 1360, 629, 620, 553, 730, 314, 234, 137, 0, 1688, 1480, 1135, 896, 1376, 745, 697, 469, 666, 512, 287, 136, 0), # 155
(1708, 1559, 1571, 1577, 1366, 631, 622, 553, 733, 315, 236, 138, 0, 1698, 1488, 1143, 900, 1381, 747, 701, 473, 670, 513, 290, 138, 0), # 156
(1722, 1565, 1586, 1587, 1372, 631, 626, 558, 735, 315, 239, 138, 0, 1704, 1494, 1145, 908, 1391, 750, 702, 473, 676, 517, 294, 140, 0), # 157
(1732, 1572, 1597, 1600, 1378, 633, 628, 560, 736, 316, 240, 138, 0, 1711, 1501, 1154, 908, 1404, 751, 711, 476, 682, 519, 295, 142, 0), # 158
(1739, 1579, 1605, 1607, 1388, 640, 631, 560, 744, 319, 242, 139, 0, 1723, 1505, 1163, 914, 1413, 758, 715, 481, 686, 523, 297, 142, 0), # 159
(1753, 1585, 1615, 1617, 1397, 644, 634, 562, 747, 320, 243, 139, 0, 1736, 1514, 1168, 920, 1417, 759, 718, 484, 689, 524, 299, 142, 0), # 160
(1761, 1590, 1623, 1625, 1401, 648, 635, 563, 751, 320, 244, 139, 0, 1745, 1524, 1170, 927, 1425, 765, 720, 488, 689, 526, 302, 142, 0), # 161
(1773, 1595, 1630, 1628, 1409, 653, 635, 563, 756, 323, 246, 140, 0, 1758, 1529, 1172, 934, 1430, 770, 724, 490, 692, 529, 304, 143, 0), # 162
(1779, 1599, 1640, 1638, 1419, 656, 636, 566, 759, 323, 246, 140, 0, 1763, 1535, 1179, 940, 1437, 772, 725, 490, 696, 532, 304, 146, 0), # 163
(1790, 1602, 1654, 1641, 1428, 659, 638, 570, 764, 324, 246, 140, 0, 1773, 1543, 1183, 943, 1443, 773, 731, 494, 699, 535, 308, 146, 0), # 164
(1802, 1603, 1666, 1649, 1435, 662, 638, 573, 767, 327, 246, 142, 0, 1787, 1554, 1188, 946, 1450, 776, 734, 497, 704, 536, 308, 147, 0), # 165
(1808, 1611, 1674, 1655, 1440, 669, 642, 575, 771, 328, 246, 143, 0, 1798, 1563, 1192, 949, 1457, 780, 737, 501, 711, 540, 310, 149, 0), # 166
(1815, 1615, 1677, 1664, 1447, 676, 643, 580, 773, 329, 246, 143, 0, 1808, 1572, 1198, 953, 1467, 784, 739, 504, 713, 544, 311, 149, 0), # 167
(1827, 1622, 1683, 1670, 1449, 678, 644, 583, 777, 329, 247, 143, 0, 1819, 1580, 1205, 958, 1472, 786, 741, 509, 716, 547, 312, 151, 0), # 168
(1838, 1623, 1690, 1677, 1454, 681, 645, 585, 779, 332, 248, 143, 0, 1828, 1589, 1210, 965, 1473, 788, 743, 511, 717, 548, 312, 152, 0), # 169
(1845, 1631, 1696, 1685, 1461, 681, 646, 588, 782, 332, 248, 144, 0, 1838, 1594, 1211, 967, 1479, 792, 745, 512, 721, 548, 313, 153, 0), # 170
(1853, 1635, 1707, 1690, 1468, 682, 648, 589, 784, 332, 249, 144, 0, 1850, 1599, 1217, 970, 1484, 797, 749, 513, 724, 550, 314, 155, 0), # 171
(1860, 1644, 1712, 1695, 1474, 684, 650, 591, 785, 332, 251, 144, 0, 1858, 1604, 1222, 976, 1487, 800, 753, 516, 726, 552, 314, 156, 0), # 172
(1860, 1645, 1716, 1701, 1476, 685, 652, 592, 786, 332, 252, 145, 0, 1864, 1609, 1228, 978, 1493, 803, 757, 517, 727, 554, 316, 156, 0), # 173
(1864, 1648, 1721, 1702, 1482, 688, 652, 592, 792, 333, 253, 145, 0, 1868, 1612, 1232, 979, 1496, 805, 757, 520, 730, 556, 316, 157, 0), # 174
(1868, 1652, 1727, 1707, 1488, 691, 653, 597, 798, 333, 254, 145, 0, 1874, 1615, 1235, 984, 1500, 808, 761, 522, 732, 557, 317, 157, 0), # 175
(1876, 1658, 1735, 1709, 1492, 692, 654, 597, 799, 333, 254, 145, 0, 1879, 1620, 1237, 986, 1503, 811, 761, 529, 735, 559, 318, 159, 0), # 176
(1879, 1661, 1740, 1717, 1498, 696, 654, 599, 801, 333, 255, 145, 0, 1885, 1621, 1241, 988, 1508, 814, 761, 530, 737, 560, 318, 159, 0), # 177
(1884, 1665, 1745, 1719, 1502, 699, 654, 601, 801, 335, 255, 145, 0, 1888, 1624, 1243, 991, 1516, 815, 762, 532, 740, 561, 319, 159, 0), # 178
(1884, 1665, 1745, 1719, 1502, 699, 654, 601, 801, 335, 255, 145, 0, 1888, 1624, 1243, 991, 1516, 815, 762, 532, 740, 561, 319, 159, 0), # 179
)
passenger_arriving_rate = (
(6.025038694046121, 6.077817415662483, 5.211283229612507, 5.593200996477089, 4.443748486087689, 2.197058452426137, 2.4876213692243487, 2.3265880864897115, 2.4360396248672025, 1.187404504656711, 0.8410530327771206, 0.4897915078306174, 0.0, 6.100656255094035, 5.38770658613679, 4.205265163885603, 3.562213513970132, 4.872079249734405, 3.257223321085596, 2.4876213692243487, 1.5693274660186693, 2.2218742430438443, 1.8644003321590301, 1.0422566459225016, 0.5525288559693167, 0.0), # 0
(6.425192582423969, 6.479066763559234, 5.555346591330152, 5.9626298279489545, 4.737992269979389, 2.342188508829789, 2.651681364758216, 2.479756861452854, 2.5968981305331633, 1.265694207683145, 0.8966192271912263, 0.5221216660814355, 0.0, 6.503749976927826, 5.743338326895789, 4.483096135956131, 3.7970826230494343, 5.193796261066327, 3.4716596060339957, 2.651681364758216, 1.6729917920212778, 2.3689961349896946, 1.9875432759829852, 1.1110693182660305, 0.589006069414476, 0.0), # 1
(6.8240676107756775, 6.878723687980077, 5.8980422855474135, 6.330588934198314, 5.031170378999795, 2.4867395801587113, 2.8150911047764224, 2.6323126239522097, 2.7571147227510195, 1.3436741325061639, 0.9519646297552626, 0.5543232652053055, 0.0, 6.905237793851628, 6.09755591725836, 4.759823148776313, 4.031022397518491, 5.514229445502039, 3.6852376735330936, 2.8150911047764224, 1.7762425572562224, 2.5155851894998973, 2.1101963113994384, 1.179608457109483, 0.625338517089098, 0.0), # 2
(7.220109351775874, 7.275202552130091, 6.238010869319854, 6.695618766778866, 5.322129340801521, 2.6301384358095787, 2.9772021849887733, 2.7836505787472534, 2.9160540643684367, 1.4210348095278544, 1.0068696823654766, 0.5862685684930461, 0.0, 7.30352736750507, 6.448954253423507, 5.0343484118273825, 4.263104428583563, 5.8321081287368735, 3.8971108102461547, 2.9772021849887733, 1.8786703112925562, 2.6610646704007603, 2.2318729222596225, 1.247602173863971, 0.6613820501936447, 0.0), # 3
(7.611763378099177, 7.666917719214351, 6.573892899703036, 7.056259777244312, 5.609715683037193, 2.7718118451790676, 3.137366201105075, 2.9331659305974576, 3.0730808182330827, 1.4974667691503039, 1.0611148269181152, 0.6178298392354764, 0.0, 7.69702635952778, 6.79612823159024, 5.305574134590575, 4.492400307450911, 6.146161636466165, 4.10643230283644, 3.137366201105075, 1.9798656036993338, 2.8048578415185963, 2.3520865924147714, 1.3147785799406073, 0.6969925199285775, 0.0), # 4
(7.9974752624202115, 8.052283552437947, 6.904328933752518, 7.411052417148355, 5.892775933359424, 2.9111865776638504, 3.2949347488351344, 3.080253884262296, 3.2275596471926233, 1.5726605417755992, 1.1144805053094267, 0.6488793407234149, 0.0, 8.084142431559393, 7.137672747957563, 5.572402526547132, 4.7179816253267965, 6.455119294385247, 4.312355437967215, 3.2949347488351344, 2.079418984045607, 2.946387966679712, 2.4703508057161185, 1.3808657867505036, 0.7320257774943589, 0.0), # 5
(8.375690577413598, 8.42971441500595, 7.227959528523866, 7.758537138044686, 6.170156619420834, 3.047689402660605, 3.4492594238887575, 3.2243096445012442, 3.3788552140947257, 1.6463066578058279, 1.1667471594356567, 0.6792893362476808, 0.0, 8.463283245239527, 7.472182698724488, 5.833735797178282, 4.938919973417482, 6.757710428189451, 4.514033502301742, 3.4492594238887575, 2.176921001900432, 3.085078309710417, 2.586179046014896, 1.4455919057047733, 0.7663376740914501, 0.0), # 6
(8.744854895753962, 8.797624670123444, 7.543425241072636, 8.097254391487015, 6.440704268874043, 3.1807470895660046, 3.599691821975751, 3.3647284160737763, 3.5263321817870574, 1.7180956476430762, 1.2176952311930538, 0.708932089099093, 0.0, 8.832856462207822, 7.798252980090021, 6.088476155965268, 5.154286942929227, 7.052664363574115, 4.7106197825032865, 3.599691821975751, 2.2719622068328604, 3.2203521344370216, 2.699084797162339, 1.508685048214527, 0.7997840609203132, 0.0), # 7
(9.103413790115921, 9.154428680995508, 7.849366628454395, 8.425744629029035, 6.703265409371668, 3.309786407776723, 3.7455835388059184, 3.5009054037393623, 3.669355213117282, 1.7877180416894325, 1.2671051624778642, 0.7376798625684703, 0.0, 9.1912697441039, 8.114478488253173, 6.335525812389321, 5.363154125068296, 7.338710426234564, 4.901267565235107, 3.7455835388059184, 2.3641331484119448, 3.351632704685834, 2.8085815430096788, 1.5698733256908792, 0.8322207891814098, 0.0), # 8
(9.449812833174102, 9.498540810827224, 8.144424247724704, 8.742548302224453, 6.956686568566327, 3.4342341266894385, 3.886286170089072, 3.6322358122574814, 3.8072889709330693, 1.8548643703469827, 1.3147573951863356, 0.7654049199466314, 0.0, 9.536930752567395, 8.419454119412945, 6.573786975931678, 5.564593111040947, 7.614577941866139, 5.0851301371604745, 3.886286170089072, 2.453024376206742, 3.4783432842831634, 2.914182767408151, 1.6288848495449408, 0.8635037100752023, 0.0), # 9
(9.782497597603118, 9.828375422823667, 8.427238655939124, 9.046205862626959, 7.19981427411064, 3.5535170157008253, 4.021151311535013, 3.7581148463876053, 3.9394981180820854, 1.9192251640178146, 1.3604323712147148, 0.7919795245243952, 0.0, 9.868247149237932, 8.711774769768347, 6.802161856073574, 5.757675492053442, 7.878996236164171, 5.261360784942648, 4.021151311535013, 2.5382264397863037, 3.59990713705532, 3.015401954208987, 1.685447731187825, 0.8934886748021517, 0.0), # 10
(10.099913656077605, 10.142346880189926, 8.696450410153215, 9.335257761790256, 7.431495053657226, 3.667061844207558, 4.14953055885355, 3.8779377108892072, 4.065347317411997, 1.980490953104016, 1.40391053245925, 0.8172759395925812, 0.0, 10.183626595755133, 8.99003533551839, 7.019552662296249, 5.9414728593120465, 8.130694634823994, 5.42911279524489, 4.14953055885355, 2.619329888719684, 3.715747526828613, 3.1117525872634197, 1.7392900820306432, 0.9220315345627208, 0.0), # 11
(10.400506581272174, 10.438869546131066, 8.95070006742254, 9.60824445126805, 7.650575434858702, 3.7742953816063087, 4.270775507754487, 3.99109961052176, 4.184201231770471, 2.0383522680076718, 1.444972320816187, 0.8411664284420068, 0.0, 10.48147675375864, 9.252830712862075, 7.224861604080934, 6.115056804023014, 8.368402463540942, 5.587539454730464, 4.270775507754487, 2.6959252725759346, 3.825287717429351, 3.2027481504226842, 1.790140013484508, 0.9489881405573698, 0.0), # 12
(10.68272194586145, 10.716357783852182, 9.188628184802662, 9.863706382614039, 7.85590194536768, 3.8746443972937565, 4.384237753947633, 4.096995750044741, 4.295424524005172, 2.0924996391308714, 1.4833981781817738, 0.8635232543634921, 0.0, 10.760205284888082, 9.498755797998411, 7.416990890908868, 6.277498917392613, 8.590849048010345, 5.735794050062637, 4.384237753947633, 2.7676031409241117, 3.92795097268384, 3.287902127538014, 1.8377256369605324, 0.974214343986562, 0.0), # 13
(10.945005322520059, 10.973225956558347, 9.408875319349146, 10.100184007381912, 8.046321112836791, 3.967535660666574, 4.489268893142796, 4.195021334217623, 4.398381856963768, 2.1426235968757004, 1.518968546452257, 0.8842186806478561, 0.0, 11.018219850783076, 9.726405487126415, 7.594842732261284, 6.4278707906271, 8.796763713927536, 5.873029867904672, 4.489268893142796, 2.833954043333267, 4.023160556418396, 3.3667280024606385, 1.8817750638698296, 0.997565996050759, 0.0), # 14
(11.185802283922625, 11.207888427454638, 9.610082028117542, 10.316217777125386, 8.220679464918646, 4.052395941121439, 4.585220521049775, 4.284571567799878, 4.4924378934939275, 2.1884146716442476, 1.551463867523884, 0.9031249705859171, 0.0, 11.253928113083257, 9.934374676445087, 7.757319337619419, 6.565244014932741, 8.984875786987855, 5.998400194919829, 4.585220521049775, 2.894568529372456, 4.110339732459323, 3.4387392590417964, 1.9220164056235085, 1.0188989479504218, 0.0), # 15
(11.40355840274376, 11.418759559746144, 9.790888868163425, 10.510348143398145, 8.377823529265866, 4.128652008055021, 4.671444233378385, 4.36504165555098, 4.5769572964433145, 2.2295633938385993, 1.5806645832929027, 0.920114387468494, 0.0, 11.465737733428254, 10.121258262153432, 7.9033229164645125, 6.688690181515796, 9.153914592886629, 6.111058317771373, 4.671444233378385, 2.9490371486107296, 4.188911764632933, 3.503449381132716, 1.958177773632685, 1.0380690508860133, 0.0), # 16
(11.59671925165809, 11.604253716637938, 9.949936396542352, 10.6811155577539, 8.51659983353107, 4.1957306308639994, 4.747291625838426, 4.435826802230409, 4.651304728659593, 2.2657602938608403, 1.60635113565556, 0.9350591945864056, 0.0, 11.652056373457699, 10.28565114045046, 8.031755678277799, 6.79728088158252, 9.302609457319186, 6.2101575231225725, 4.747291625838426, 2.9969504506171427, 4.258299916765535, 3.5603718525846344, 1.9899872793084707, 1.0549321560579947, 0.0), # 17
(11.763730403340244, 11.7627852613351, 10.08586517030988, 10.82706047174635, 8.63585490536687, 4.253058578945052, 4.81211429413971, 4.49632221259763, 4.7148448529904385, 2.2966959021130613, 1.6283039665081016, 0.9478316552304716, 0.0, 11.811291694811214, 10.426148207535187, 8.141519832540508, 6.890087706339182, 9.429689705980877, 6.294851097636682, 4.81211429413971, 3.0378989849607514, 4.317927452683435, 3.6090201572487843, 2.0171730340619765, 1.0693441146668274, 0.0), # 18
(11.903037430464838, 11.892768557042718, 10.197315746521578, 10.946723336929182, 8.734435272425891, 4.300062621694845, 4.865263833992036, 4.5459230914121225, 4.766942332283511, 2.3220607489973486, 1.6463035177467755, 0.9583040326915097, 0.0, 11.941851359128435, 10.541344359606605, 8.231517588733878, 6.9661822469920445, 9.533884664567022, 6.364292327976972, 4.865263833992036, 3.071473301210604, 4.367217636212946, 3.648907778976395, 2.039463149304316, 1.0811607779129746, 0.0), # 19
(12.013085905706498, 11.992617966965858, 10.282928682233003, 11.038644604856119, 8.811187462360754, 4.336169528510063, 4.9060918411052175, 4.5840246434333585, 4.806961829386479, 2.341545364915788, 1.66013023126783, 0.9663485902603393, 0.0, 12.042143028048988, 10.62983449286373, 8.30065115633915, 7.024636094747362, 9.613923658772958, 6.417634500806702, 4.9060918411052175, 3.097263948935759, 4.405593731180377, 3.679548201618707, 2.0565857364466007, 1.0902379969968963, 0.0), # 20
(12.09232140173984, 12.060747854309614, 10.341344534499719, 11.101364727080837, 8.86495800282407, 4.360806068787375, 4.933949911189055, 4.6100220734208115, 4.834268007147008, 2.3548402802704667, 1.669564548967512, 0.9718375912277795, 0.0, 12.110574363212494, 10.690213503505571, 8.34782274483756, 7.064520840811399, 9.668536014294016, 6.454030902789136, 4.933949911189055, 3.1148614777052677, 4.432479001412035, 3.7004549090269463, 2.068268906899944, 1.096431623119056, 0.0), # 21
(12.139189491239494, 12.095572582279058, 10.371203860377285, 11.133424155157051, 8.894593421468459, 4.373399011923457, 4.94818963995336, 4.623310586133957, 4.848225528412765, 2.361636025463473, 1.674386912742068, 0.9746432988846491, 0.0, 12.145553026258591, 10.721076287731139, 8.37193456371034, 7.084908076390418, 9.69645105682553, 6.47263482058754, 4.94818963995336, 3.1238564370881834, 4.447296710734229, 3.7111413850523514, 2.0742407720754574, 1.0995975074799145, 0.0), # 22
(12.156472036011166, 12.099695953360769, 10.374923182441702, 11.137437731481482, 8.902185644826076, 4.375, 4.949882401355603, 4.624746913580247, 4.8499704938271595, 2.3624376817558304, 1.6749916074323483, 0.9749897576588934, 0.0, 12.15, 10.724887334247827, 8.37495803716174, 7.087313045267489, 9.699940987654319, 6.474645679012346, 4.949882401355603, 3.125, 4.451092822413038, 3.7124792438271617, 2.0749846364883404, 1.0999723593964337, 0.0), # 23
(12.169214895640982, 12.09729074074074, 10.374314814814815, 11.13694375, 8.906486090891882, 4.375, 4.9489522875817, 4.62275, 4.849736666666666, 2.3619451851851854, 1.6749249158249162, 0.9749086419753087, 0.0, 12.15, 10.723995061728393, 8.37462457912458, 7.085835555555555, 9.699473333333332, 6.47185, 4.9489522875817, 3.125, 4.453243045445941, 3.7123145833333346, 2.074862962962963, 1.099753703703704, 0.0), # 24
(12.181688676253897, 12.092549725651576, 10.373113854595337, 11.135966435185185, 8.910691956475603, 4.375, 4.947119341563786, 4.618827160493828, 4.8492746913580245, 2.3609756515775038, 1.6747926798852726, 0.9747485139460449, 0.0, 12.15, 10.722233653406493, 8.373963399426362, 7.08292695473251, 9.698549382716049, 6.466358024691359, 4.947119341563786, 3.125, 4.455345978237801, 3.711988811728396, 2.0746227709190674, 1.0993227023319616, 0.0), # 25
(12.19389242285764, 12.085545336076818, 10.371336762688616, 11.134516898148147, 8.914803094736882, 4.375, 4.944412030985233, 4.613052469135803, 4.84859049382716, 2.3595452126200276, 1.674596096770171, 0.9745115683584822, 0.0, 12.15, 10.719627251943303, 8.372980483850855, 7.078635637860081, 9.69718098765432, 6.458273456790124, 4.944412030985233, 3.125, 4.457401547368441, 3.71150563271605, 2.0742673525377233, 1.0986859396433473, 0.0), # 26
(12.205825180459962, 12.076349999999996, 10.369, 11.132606249999998, 8.918819358835371, 4.375, 4.940858823529412, 4.6055, 4.84769, 2.35767, 1.674336363636364, 0.9742000000000002, 0.0, 12.15, 10.7162, 8.371681818181818, 7.073009999999999, 9.69538, 6.4477, 4.940858823529412, 3.125, 4.459409679417686, 3.7108687500000004, 2.0738000000000003, 1.09785, 0.0), # 27
(12.217485994068602, 12.065036145404662, 10.366120027434842, 11.13024560185185, 8.92274060193072, 4.375, 4.93648818687969, 4.596243827160494, 4.846579135802468, 2.3553661454046644, 1.6740146776406037, 0.9738160036579792, 0.0, 12.15, 10.711976040237769, 8.370073388203018, 7.066098436213991, 9.693158271604936, 6.434741358024692, 4.93648818687969, 3.125, 4.46137030096536, 3.710081867283951, 2.073224005486969, 1.0968214677640604, 0.0), # 28
(12.2288739086913, 12.051676200274349, 10.362713305898492, 11.127446064814816, 8.926566677182576, 4.375, 4.931328588719439, 4.585358024691358, 4.845263827160494, 2.3526497805212623, 1.6736322359396434, 0.9733617741197987, 0.0, 12.15, 10.706979515317785, 8.368161179698216, 7.057949341563786, 9.690527654320988, 6.419501234567901, 4.931328588719439, 3.125, 4.463283338591288, 3.709148688271606, 2.0725426611796984, 1.0956069272976683, 0.0), # 29
(12.239987969335797, 12.036342592592591, 10.358796296296296, 11.12421875, 8.930297437750589, 4.375, 4.925408496732026, 4.572916666666666, 4.84375, 2.3495370370370376, 1.6731902356902357, 0.9728395061728394, 0.0, 12.15, 10.701234567901233, 8.365951178451178, 7.048611111111112, 9.6875, 6.402083333333333, 4.925408496732026, 3.125, 4.4651487188752945, 3.7080729166666675, 2.0717592592592595, 1.094212962962963, 0.0), # 30
(12.25082722100983, 12.019107750342934, 10.354385459533608, 11.120574768518516, 8.933932736794405, 4.375, 4.918756378600824, 4.558993827160494, 4.842043580246913, 2.346044046639232, 1.6726898740491336, 0.9722513946044812, 0.0, 12.15, 10.694765340649292, 8.363449370245666, 7.038132139917694, 9.684087160493826, 6.382591358024691, 4.918756378600824, 3.125, 4.466966368397203, 3.70685825617284, 2.070877091906722, 1.0926461591220853, 0.0), # 31
(12.261390708721144, 12.000044101508914, 10.349497256515773, 11.11652523148148, 8.937472427473676, 4.375, 4.911400702009199, 4.543663580246914, 4.84015049382716, 2.3421869410150897, 1.672132348173089, 0.9715996342021036, 0.0, 12.15, 10.687595976223138, 8.360661740865444, 7.026560823045267, 9.68030098765432, 6.36112901234568, 4.911400702009199, 3.125, 4.468736213736838, 3.705508410493828, 2.069899451303155, 1.0909131001371744, 0.0), # 32
(12.271677477477477, 11.979224074074073, 10.344148148148149, 11.11208125, 8.94091636294805, 4.375, 4.903369934640523, 4.527, 4.838076666666666, 2.3379818518518523, 1.6715188552188551, 0.9708864197530863, 0.0, 12.15, 10.679750617283949, 8.357594276094275, 7.013945555555555, 9.676153333333332, 6.3378000000000005, 4.903369934640523, 3.125, 4.470458181474025, 3.704027083333334, 2.06882962962963, 1.0890203703703705, 0.0), # 33
(12.28168657228657, 11.956720096021947, 10.338354595336076, 11.107253935185184, 8.944264396377172, 4.375, 4.894692544178166, 4.509077160493827, 4.835828024691358, 2.333444910836763, 1.670850592343185, 0.9701139460448103, 0.0, 12.15, 10.671253406492912, 8.354252961715924, 7.000334732510288, 9.671656049382715, 6.312708024691357, 4.894692544178166, 3.125, 4.472132198188586, 3.7024179783950624, 2.0676709190672153, 1.0869745541838134, 0.0), # 34
(12.291417038156167, 11.932604595336077, 10.332133058984912, 11.102054398148146, 8.947516380920696, 4.375, 4.885396998305495, 4.489969135802469, 4.83341049382716, 2.328592249657065, 1.6701287567028307, 0.969284407864655, 0.0, 12.15, 10.662128486511202, 8.350643783514153, 6.985776748971193, 9.66682098765432, 6.285956790123457, 4.885396998305495, 3.125, 4.473758190460348, 3.7006847993827163, 2.0664266117969827, 1.0847822359396435, 0.0), # 35
(12.300867920094007, 11.906949999999998, 10.3255, 11.096493749999999, 8.950672169738269, 4.375, 4.875511764705882, 4.46975, 4.830829999999999, 2.32344, 1.6693545454545458, 0.9684000000000001, 0.0, 12.15, 10.6524, 8.346772727272727, 6.970319999999999, 9.661659999999998, 6.257650000000001, 4.875511764705882, 3.125, 4.475336084869134, 3.6988312500000005, 2.0651, 1.08245, 0.0), # 36
(12.310038263107828, 11.879828737997256, 10.318471879286694, 11.090583101851852, 8.953731615989536, 4.375, 4.865065311062696, 4.448493827160494, 4.828092469135802, 2.3180042935528125, 1.668529155755082, 0.9674629172382261, 0.0, 12.15, 10.642092089620485, 8.34264577877541, 6.954012880658436, 9.656184938271604, 6.227891358024691, 4.865065311062696, 3.125, 4.476865807994768, 3.696861033950618, 2.063694375857339, 1.0799844307270234, 0.0), # 37
(12.31892711220537, 11.851313237311386, 10.311065157750342, 11.084333564814814, 8.956694572834152, 4.375, 4.854086105059308, 4.426274691358025, 4.825203827160493, 2.312301262002744, 1.6676537847611925, 0.9664753543667125, 0.0, 12.15, 10.631228898033836, 8.33826892380596, 6.936903786008231, 9.650407654320986, 6.196784567901235, 4.854086105059308, 3.125, 4.478347286417076, 3.6947778549382724, 2.0622130315500686, 1.0773921124828534, 0.0), # 38
(12.327533512394384, 11.821475925925924, 10.303296296296297, 11.07775625, 8.959560893431762, 4.375, 4.842602614379085, 4.4031666666666665, 4.82217, 2.3063470370370376, 1.6667296296296297, 0.9654395061728396, 0.0, 12.15, 10.619834567901233, 8.333648148148148, 6.919041111111111, 9.64434, 6.164433333333333, 4.842602614379085, 3.125, 4.479780446715881, 3.6925854166666676, 2.0606592592592596, 1.0746796296296297, 0.0), # 39
(12.335856508682596, 11.790389231824417, 10.295181755829903, 11.070862268518518, 8.962330430942014, 4.375, 4.830643306705398, 4.3792438271604945, 4.818996913580246, 2.3001577503429362, 1.6657578875171468, 0.9643575674439875, 0.0, 12.15, 10.60793324188386, 8.328789437585733, 6.900473251028807, 9.637993827160493, 6.1309413580246925, 4.830643306705398, 3.125, 4.481165215471007, 3.690287422839507, 2.059036351165981, 1.0718535665294926, 0.0), # 40
(12.343895146077754, 11.758125582990397, 10.286737997256516, 11.06366273148148, 8.96500303852456, 4.375, 4.818236649721617, 4.354580246913581, 4.81569049382716, 2.293749533607682, 1.6647397555804966, 0.9632317329675355, 0.0, 12.15, 10.595549062642888, 8.323698777902482, 6.881248600823045, 9.63138098765432, 6.096412345679013, 4.818236649721617, 3.125, 4.48250151926228, 3.6878875771604944, 2.0573475994513033, 1.0689205075445818, 0.0), # 41
(12.3516484695876, 11.724757407407406, 10.277981481481483, 11.056168750000001, 8.967578569339047, 4.375, 4.805411111111111, 4.32925, 4.812256666666666, 2.287138518518519, 1.663676430976431, 0.9620641975308644, 0.0, 12.15, 10.582706172839506, 8.318382154882155, 6.861415555555555, 9.624513333333333, 6.06095, 4.805411111111111, 3.125, 4.483789284669523, 3.6853895833333343, 2.055596296296297, 1.0658870370370372, 0.0), # 42
(12.35911552421987, 11.690357133058985, 10.268928669410151, 11.048391435185184, 8.970056876545122, 4.375, 4.7921951585572495, 4.3033271604938275, 4.80870135802469, 2.280340836762689, 1.6625691108617036, 0.9608571559213536, 0.0, 12.15, 10.569428715134888, 8.312845554308517, 6.841022510288067, 9.61740271604938, 6.024658024691359, 4.7921951585572495, 3.125, 4.485028438272561, 3.682797145061729, 2.0537857338820307, 1.062759739368999, 0.0), # 43
(12.366295354982311, 11.65499718792867, 10.259596021947875, 11.040341898148148, 8.972437813302435, 4.375, 4.778617259743403, 4.2768858024691365, 4.805030493827159, 2.2733726200274353, 1.6614189923930665, 0.9596128029263833, 0.0, 12.15, 10.555740832190216, 8.307094961965332, 6.820117860082305, 9.610060987654318, 5.987640123456791, 4.778617259743403, 3.125, 4.486218906651217, 3.6801139660493836, 2.0519192043895753, 1.0595451989026066, 0.0), # 44
(12.37318700688266, 11.618749999999999, 10.25, 11.03203125, 8.974721232770635, 4.375, 4.764705882352941, 4.25, 4.80125, 2.2662500000000003, 1.6602272727272729, 0.9583333333333333, 0.0, 12.15, 10.541666666666664, 8.301136363636363, 6.79875, 9.6025, 5.95, 4.764705882352941, 3.125, 4.487360616385318, 3.677343750000001, 2.0500000000000003, 1.0562500000000001, 0.0), # 45
(12.379789524928656, 11.581687997256516, 10.240157064471878, 11.023470601851852, 8.976906988109372, 4.375, 4.750489494069233, 4.222743827160494, 4.797365802469135, 2.258989108367627, 1.6589951490210748, 0.9570209419295841, 0.0, 12.15, 10.527230361225422, 8.294975745105374, 6.77696732510288, 9.59473160493827, 5.9118413580246925, 4.750489494069233, 3.125, 4.488453494054686, 3.6744902006172846, 2.048031412894376, 1.0528807270233198, 0.0), # 46
(12.386101954128042, 11.543883607681755, 10.230083676268862, 11.014671064814813, 8.978994932478294, 4.375, 4.7359965625756475, 4.195191358024691, 4.793383827160493, 2.2516060768175588, 1.657723818431226, 0.955677823502515, 0.0, 12.15, 10.512456058527663, 8.288619092156129, 6.754818230452675, 9.586767654320987, 5.873267901234568, 4.7359965625756475, 3.125, 4.489497466239147, 3.6715570216049387, 2.046016735253773, 1.049443964334705, 0.0), # 47
(12.392123339488554, 11.505409259259258, 10.219796296296296, 11.00564375, 8.980984919037049, 4.375, 4.7212555555555555, 4.167416666666667, 4.78931, 2.244117037037037, 1.656414478114478, 0.9543061728395063, 0.0, 12.15, 10.497367901234567, 8.28207239057239, 6.73235111111111, 9.57862, 5.834383333333334, 4.7212555555555555, 3.125, 4.490492459518524, 3.6685479166666677, 2.0439592592592595, 1.0459462962962964, 0.0), # 48
(12.397852726017943, 11.466337379972563, 10.209311385459534, 10.996399768518518, 8.982876800945284, 4.375, 4.706294940692326, 4.139493827160494, 4.78515024691358, 2.2365381207133064, 1.6550683252275846, 0.9529081847279379, 0.0, 12.15, 10.481990032007316, 8.275341626137923, 6.709614362139918, 9.57030049382716, 5.795291358024691, 4.706294940692326, 3.125, 4.491438400472642, 3.665466589506174, 2.0418622770919073, 1.0423943072702333, 0.0), # 49
(12.403289158723938, 11.426740397805213, 10.198645404663925, 10.986950231481481, 8.984670431362652, 4.375, 4.69114318566933, 4.111496913580247, 4.78091049382716, 2.228885459533608, 1.6536865569272978, 0.9514860539551899, 0.0, 12.15, 10.466346593507089, 8.268432784636488, 6.686656378600823, 9.56182098765432, 5.756095679012346, 4.69114318566933, 3.125, 4.492335215681326, 3.6623167438271613, 2.0397290809327853, 1.038794581618656, 0.0), # 50
(12.408431682614292, 11.38669074074074, 10.187814814814814, 10.977306249999998, 8.986365663448797, 4.375, 4.675828758169934, 4.0835, 4.776596666666666, 2.2211751851851855, 1.6522703703703707, 0.9500419753086421, 0.0, 12.15, 10.450461728395062, 8.261351851851853, 6.663525555555555, 9.553193333333333, 5.7169, 4.675828758169934, 3.125, 4.493182831724399, 3.659102083333334, 2.037562962962963, 1.0351537037037037, 0.0), # 51
(12.413279342696734, 11.34626083676269, 10.176836076817558, 10.967478935185184, 8.98796235036337, 4.375, 4.660380125877511, 4.055577160493827, 4.772214691358024, 2.2134234293552817, 1.6508209627135553, 0.9485781435756746, 0.0, 12.15, 10.434359579332419, 8.254104813567777, 6.640270288065844, 9.544429382716048, 5.677808024691357, 4.660380125877511, 3.125, 4.493981175181685, 3.655826311728396, 2.035367215363512, 1.0314782578875175, 0.0), # 52
(12.417831183979011, 11.305523113854596, 10.165725651577505, 10.957479398148147, 8.989460345266023, 4.375, 4.64482575647543, 4.0278024691358025, 4.767770493827161, 2.205646323731139, 1.6493395311136052, 0.9470967535436672, 0.0, 12.15, 10.418064288980338, 8.246697655568026, 6.616938971193416, 9.535540987654322, 5.638923456790124, 4.64482575647543, 3.125, 4.4947301726330116, 3.65249313271605, 2.0331451303155013, 1.0277748285322361, 0.0), # 53
(12.42208625146886, 11.26455, 10.154499999999999, 10.94731875, 8.9908595013164, 4.375, 4.629194117647058, 4.000249999999999, 4.7632699999999994, 2.1978600000000004, 1.6478272727272725, 0.9456, 0.0, 12.15, 10.401599999999998, 8.239136363636362, 6.593579999999999, 9.526539999999999, 5.60035, 4.629194117647058, 3.125, 4.4954297506582, 3.649106250000001, 2.0309, 1.0240500000000001, 0.0), # 54
(12.426043590174027, 11.223413923182441, 10.143175582990398, 10.93700810185185, 8.992159671674152, 4.375, 4.613513677075768, 3.9729938271604937, 4.758719135802469, 2.1900805898491087, 1.6462853847113108, 0.9440900777320531, 0.0, 12.15, 10.384990855052584, 8.231426923556553, 6.570241769547325, 9.517438271604938, 5.562191358024691, 4.613513677075768, 3.125, 4.496079835837076, 3.645669367283951, 2.02863511659808, 1.0203103566529494, 0.0), # 55
(12.429702245102245, 11.182187311385459, 10.131768861454047, 10.926558564814814, 8.993360709498926, 4.375, 4.597812902444929, 3.946108024691358, 4.754123827160494, 2.182324224965707, 1.6447150642224717, 0.9425691815272064, 0.0, 12.15, 10.368260996799268, 8.223575321112358, 6.54697267489712, 9.508247654320988, 5.524551234567902, 4.597812902444929, 3.125, 4.496680354749463, 3.6421861882716056, 2.02635377229081, 1.0165624828532238, 0.0), # 56
(12.433061261261258, 11.140942592592593, 10.120296296296297, 10.915981249999998, 8.994462467950372, 4.375, 4.582120261437908, 3.9196666666666675, 4.74949, 2.1746070370370374, 1.6431175084175085, 0.9410395061728396, 0.0, 12.15, 10.351434567901233, 8.215587542087542, 6.523821111111111, 9.49898, 5.487533333333334, 4.582120261437908, 3.125, 4.497231233975186, 3.638660416666667, 2.0240592592592597, 1.0128129629629632, 0.0), # 57
(12.436119683658815, 11.09975219478738, 10.108774348422497, 10.905287268518517, 8.995464800188138, 4.375, 4.5664642217380775, 3.8937438271604936, 4.744823580246913, 2.1669451577503436, 1.641493914453174, 0.939503246456333, 0.0, 12.15, 10.334535711019662, 8.20746957226587, 6.50083547325103, 9.489647160493826, 5.451241358024691, 4.5664642217380775, 3.125, 4.497732400094069, 3.6350957561728396, 2.0217548696844996, 1.0090683813443075, 0.0), # 58
(12.438876557302644, 11.05868854595336, 10.097219478737998, 10.89448773148148, 8.996367559371876, 4.375, 4.550873251028807, 3.868413580246914, 4.74013049382716, 2.1593547187928674, 1.63984547948622, 0.9379625971650665, 0.0, 12.15, 10.31758856881573, 8.1992273974311, 6.478064156378601, 9.48026098765432, 5.41577901234568, 4.550873251028807, 3.125, 4.498183779685938, 3.6314959104938276, 2.0194438957476, 1.0053353223593966, 0.0), # 59
(12.441330927200491, 11.017824074074072, 10.085648148148147, 10.88359375, 8.997170598661228, 4.375, 4.535375816993463, 3.84375, 4.735416666666667, 2.1518518518518523, 1.6381734006734008, 0.9364197530864199, 0.0, 12.15, 10.300617283950617, 8.190867003367003, 6.455555555555556, 9.470833333333333, 5.3812500000000005, 4.535375816993463, 3.125, 4.498585299330614, 3.6278645833333343, 2.0171296296296295, 1.0016203703703705, 0.0), # 60
(12.443481838360098, 10.977231207133059, 10.0740768175583, 10.872616435185183, 8.997873771215849, 4.375, 4.520000387315419, 3.819827160493827, 4.730688024691357, 2.1444526886145407, 1.6364788751714678, 0.9348769090077733, 0.0, 12.15, 10.283645999085506, 8.182394375857339, 6.4333580658436205, 9.461376049382714, 5.347758024691358, 4.520000387315419, 3.125, 4.498936885607924, 3.624205478395062, 2.0148153635116604, 0.9979301097393691, 0.0), # 61
(12.445328335789204, 10.936982373113853, 10.062521947873801, 10.861566898148148, 8.998476930195388, 4.375, 4.504775429678044, 3.796719135802469, 4.72595049382716, 2.137173360768176, 1.6347631001371743, 0.9333362597165068, 0.0, 12.15, 10.266698856881574, 8.17381550068587, 6.411520082304527, 9.45190098765432, 5.315406790123457, 4.504775429678044, 3.125, 4.499238465097694, 3.620522299382717, 2.0125043895747603, 0.9942711248285323, 0.0), # 62
(12.44686946449555, 10.897149999999998, 10.051, 10.85045625, 8.998979928759484, 4.375, 4.4897294117647055, 3.7745, 4.721209999999999, 2.13003, 1.6330272727272728, 0.9318000000000001, 0.0, 12.15, 10.249799999999999, 8.165136363636364, 6.390089999999999, 9.442419999999998, 5.2843, 4.4897294117647055, 3.125, 4.499489964379742, 3.616818750000001, 2.0102, 0.99065, 0.0), # 63
(12.448104269486876, 10.857806515775033, 10.039527434842249, 10.839295601851852, 8.999382620067799, 4.375, 4.474890801258775, 3.7532438271604947, 4.716472469135802, 2.123038737997257, 1.6312725900985157, 0.9302703246456334, 0.0, 12.15, 10.232973571101967, 8.156362950492579, 6.369116213991769, 9.432944938271604, 5.254541358024692, 4.474890801258775, 3.125, 4.499691310033899, 3.613098533950618, 2.00790548696845, 0.9870733196159123, 0.0), # 64
(12.449031795770926, 10.819024348422495, 10.0281207133059, 10.828096064814813, 8.999684857279973, 4.375, 4.4602880658436215, 3.7330246913580245, 4.711743827160493, 2.1162157064471883, 1.6295002494076571, 0.9287494284407863, 0.0, 12.15, 10.216243712848648, 8.147501247038285, 6.348647119341564, 9.423487654320986, 5.226234567901234, 4.4602880658436215, 3.125, 4.499842428639987, 3.609365354938272, 2.0056241426611803, 0.9835476680384088, 0.0), # 65
(12.449651088355436, 10.780875925925926, 10.016796296296297, 10.81686875, 8.999886493555657, 4.375, 4.445949673202614, 3.7139166666666674, 4.70703, 2.1095770370370373, 1.6277114478114478, 0.9272395061728398, 0.0, 12.15, 10.199634567901235, 8.138557239057238, 6.328731111111111, 9.41406, 5.199483333333334, 4.445949673202614, 3.125, 4.499943246777828, 3.6056229166666673, 2.0033592592592595, 0.9800796296296298, 0.0), # 66
(12.44996119224815, 10.743433676268861, 10.005570644718793, 10.805624768518516, 8.999987382054503, 4.375, 4.431904091019123, 3.695993827160495, 4.702336913580247, 2.103138861454047, 1.625907382466642, 0.9257427526291724, 0.0, 12.15, 10.183170278920894, 8.12953691233321, 6.30941658436214, 9.404673827160494, 5.1743913580246925, 4.431904091019123, 3.125, 4.499993691027251, 3.6018749228395066, 2.0011141289437586, 0.9766757887517148, 0.0), # 67
(12.44974993737699, 10.706573503252354, 9.994405949931412, 10.794277566425121, 8.999902364237876, 4.37491880810852, 4.418109116897788, 3.6791719250114308, 4.6976351394604485, 2.0968861324941503, 1.624057197708075, 0.9242530021899743, 0.0, 12.149850180041152, 10.166783024089716, 8.120285988540376, 6.290658397482449, 9.395270278920897, 5.1508406950160035, 4.418109116897788, 3.1249420057918, 4.499951182118938, 3.598092522141708, 1.9988811899862826, 0.9733248639320324, 0.0), # 68
(12.447770048309177, 10.669170071684588, 9.982988425925925, 10.782255163043477, 8.999128540305009, 4.374276954732511, 4.404160908807968, 3.6625493827160494, 4.692719135802469, 2.090641917211329, 1.621972567783094, 0.9227218973359325, 0.0, 12.148663194444444, 10.149940870695255, 8.10986283891547, 6.271925751633985, 9.385438271604938, 5.127569135802469, 4.404160908807968, 3.1244835390946504, 4.499564270152504, 3.5940850543478264, 1.996597685185185, 0.9699245519713263, 0.0), # 69
(12.443862945070673, 10.63105170582769, 9.971268432784635, 10.769478411835749, 8.997599451303152, 4.373012879134278, 4.389996080736822, 3.645976223136717, 4.687561156835848, 2.0843758573388205, 1.619629777305216, 0.921142276129281, 0.0, 12.14631880144033, 10.13256503742209, 8.09814888652608, 6.25312757201646, 9.375122313671696, 5.104366712391404, 4.389996080736822, 3.123580627953056, 4.498799725651576, 3.5898261372785836, 1.9942536865569274, 0.9664592459843356, 0.0), # 70
(12.438083592771514, 10.592241185450682, 9.959250085733881, 10.755966153381644, 8.995334463003308, 4.371147065996037, 4.375620995723392, 3.629457933241884, 4.682168884316415, 2.078088107802792, 1.6170374741567726, 0.9195152937212715, 0.0, 12.142847865226338, 10.114668230933985, 8.085187370783862, 6.234264323408375, 9.36433776863283, 5.081241106538638, 4.375620995723392, 3.1222479042828835, 4.497667231501654, 3.5853220511272155, 1.9918500171467763, 0.962931016859153, 0.0), # 71
(12.430486956521738, 10.552761290322579, 9.946937499999999, 10.74173722826087, 8.99235294117647, 4.3687000000000005, 4.3610420168067225, 3.6129999999999995, 4.67655, 2.071778823529412, 1.614204306220096, 0.917842105263158, 0.0, 12.13828125, 10.096263157894736, 8.07102153110048, 6.215336470588234, 9.3531, 5.058199999999999, 4.3610420168067225, 3.1205000000000003, 4.496176470588235, 3.5805790760869574, 1.9893874999999999, 0.959341935483871, 0.0), # 72
(12.421128001431383, 10.512634800212398, 9.934334790809327, 10.72681047705314, 8.98867425159364, 4.36569216582838, 4.346265507025855, 3.5966079103795154, 4.670712185642433, 2.0654481594448484, 1.6111389213775176, 0.916123865906192, 0.0, 12.132649819958848, 10.07736252496811, 8.055694606887588, 6.196344478334543, 9.341424371284866, 5.035251074531322, 4.346265507025855, 3.118351547020271, 4.49433712579682, 3.5756034923510476, 1.9868669581618656, 0.9556940727465817, 0.0), # 73
(12.410061692610485, 10.471884494889155, 9.921446073388202, 10.711204740338164, 8.984317760025819, 4.3621440481633895, 4.331297829419833, 3.5802871513488794, 4.664663122999542, 2.0590962704752687, 1.607849967511371, 0.9143617308016269, 0.0, 12.125984439300412, 10.057979038817894, 8.039249837556856, 6.177288811425805, 9.329326245999084, 5.012402011888431, 4.331297829419833, 3.115817177259564, 4.4921588800129095, 3.5704015801127222, 1.9842892146776405, 0.9519894995353778, 0.0), # 74
(12.397342995169081, 10.430533154121862, 9.908275462962962, 10.694938858695652, 8.97930283224401, 4.358076131687243, 4.3161453470277, 3.5640432098765435, 4.6584104938271595, 2.052723311546841, 1.604346092503987, 0.9125568551007147, 0.0, 12.118315972222222, 10.038125406107861, 8.021730462519935, 6.158169934640522, 9.316820987654319, 4.989660493827161, 4.3161453470277, 3.112911522633745, 4.489651416122005, 3.5649796195652184, 1.9816550925925924, 0.9482302867383512, 0.0), # 75
(12.383026874217212, 10.388603557679545, 9.894827074759945, 10.678031672705314, 8.973648834019203, 4.353508901082153, 4.300814422888497, 3.5478815729309554, 4.651961979881115, 2.046329437585734, 1.6006359442376985, 0.9107103939547083, 0.0, 12.10967528292181, 10.01781433350179, 8.003179721188491, 6.138988312757201, 9.30392395976223, 4.967034202103338, 4.300814422888497, 3.1096492150586803, 4.486824417009601, 3.5593438909017725, 1.978965414951989, 0.9444185052435952, 0.0), # 76
(12.367168294864912, 10.34611848533121, 9.881105024005485, 10.660502022946858, 8.967375131122406, 4.34846284103033, 4.285311420041268, 3.531807727480567, 4.645325262917238, 2.0399148035181156, 1.5967281705948373, 0.9088235025148608, 0.0, 12.10009323559671, 9.997058527663466, 7.983640852974187, 6.119744410554345, 9.290650525834476, 4.944530818472794, 4.285311420041268, 3.106044886450236, 4.483687565561203, 3.5535006743156203, 1.9762210048010973, 0.9405562259392011, 0.0), # 77
(12.349822222222222, 10.30310071684588, 9.867113425925925, 10.64236875, 8.960501089324618, 4.3429584362139915, 4.269642701525055, 3.5158271604938274, 4.638508024691357, 2.0334795642701526, 1.5926314194577353, 0.9068973359324239, 0.0, 12.089600694444444, 9.975870695256662, 7.963157097288676, 6.100438692810457, 9.277016049382715, 4.922158024691359, 4.269642701525055, 3.1021131687242796, 4.480250544662309, 3.5474562500000006, 1.9734226851851853, 0.9366455197132618, 0.0), # 78
(12.331043621399177, 10.259573031992566, 9.8528563957476, 10.623650694444443, 8.953046074396838, 4.337016171315348, 4.2538146303789, 3.4999453589391867, 4.631517946959304, 2.0270238747680143, 1.5883543387087244, 0.9049330493586505, 0.0, 12.07822852366255, 9.954263542945155, 7.941771693543622, 6.081071624304041, 9.263035893918609, 4.899923502514861, 4.2538146303789, 3.097868693796677, 4.476523037198419, 3.5412168981481487, 1.97057127914952, 0.9326884574538697, 0.0), # 79
(12.310887457505816, 10.215558210540289, 9.838338048696844, 10.604366696859904, 8.945029452110063, 4.330656531016613, 4.2378335696418485, 3.4841678097850943, 4.624362711476909, 2.0205478899378684, 1.5839055762301377, 0.9029317979447936, 0.0, 12.066007587448558, 9.932249777392729, 7.919527881150689, 6.061643669813604, 9.248725422953818, 4.877834933699132, 4.2378335696418485, 3.093326093583295, 4.4725147260550315, 3.5347888989533023, 1.967667609739369, 0.9286871100491174, 0.0), # 80
(12.289408695652174, 10.171079032258064, 9.8235625, 10.584535597826088, 8.936470588235293, 4.3239, 4.221705882352941, 3.4685000000000006, 4.617049999999999, 2.014051764705883, 1.5792937799043065, 0.9008947368421053, 0.0, 12.052968749999998, 9.909842105263158, 7.8964688995215315, 6.042155294117647, 9.234099999999998, 4.855900000000001, 4.221705882352941, 3.0885, 4.468235294117647, 3.5281785326086967, 1.9647125, 0.9246435483870968, 0.0), # 81
(12.26666230094829, 10.126158276914907, 9.808533864883403, 10.564176237922705, 8.927388848543531, 4.316767062947722, 4.205437931551222, 3.4529474165523544, 4.6095874942844075, 2.007535653998225, 1.5745275976135626, 0.8988230212018388, 0.0, 12.039142875514404, 9.887053233220225, 7.8726379880678135, 6.022606961994674, 9.219174988568815, 4.834126383173296, 4.205437931551222, 3.0834050449626584, 4.4636944242717655, 3.521392079307569, 1.9617067729766806, 0.9205598433559008, 0.0), # 82
(12.242703238504205, 10.080818724279835, 9.793256258573388, 10.543307457729467, 8.917803598805776, 4.30927820454199, 4.189036080275732, 3.4375155464106077, 4.6019828760859625, 2.0009997127410637, 1.569615677240239, 0.8967178061752463, 0.0, 12.0245608281893, 9.863895867927708, 7.848078386201194, 6.00299913822319, 9.203965752171925, 4.812521764974851, 4.189036080275732, 3.078055860387136, 4.458901799402888, 3.5144358192431566, 1.9586512517146777, 0.9164380658436215, 0.0), # 83
(12.21758647342995, 10.035083154121864, 9.777733796296296, 10.521948097826087, 8.907734204793028, 4.301453909465021, 4.1725066915655145, 3.4222098765432096, 4.5942438271604935, 1.994444095860567, 1.5645666666666667, 0.8945802469135803, 0.0, 12.009253472222222, 9.840382716049382, 7.8228333333333335, 5.9833322875817, 9.188487654320987, 4.791093827160494, 4.1725066915655145, 3.0724670781893004, 4.453867102396514, 3.5073160326086965, 1.9555467592592592, 0.9122802867383514, 0.0), # 84
(12.191366970835569, 9.988974346210009, 9.761970593278463, 10.500116998792272, 8.897200032276285, 4.293314662399025, 4.1558561284596145, 3.4070358939186103, 4.58637802926383, 1.9878689582829019, 1.5593892137751788, 0.8924114985680938, 0.0, 11.9932516718107, 9.81652648424903, 7.796946068875894, 5.963606874848704, 9.17275605852766, 4.769850251486054, 4.1558561284596145, 3.0666533302850176, 4.448600016138142, 3.500038999597425, 1.9523941186556926, 0.9080885769281828, 0.0), # 85
(12.164099695831096, 9.942515080313289, 9.745970764746229, 10.477833001207731, 8.886220447026545, 4.284880948026216, 4.139090753997072, 3.391999085505258, 4.578393164151806, 1.9812744549342376, 1.5540919664481068, 0.8902127162900394, 0.0, 11.976586291152262, 9.792339879190433, 7.770459832240534, 5.943823364802712, 9.156786328303612, 4.748798719707362, 4.139090753997072, 3.0606292485901543, 4.443110223513273, 3.4926110004025777, 1.9491941529492458, 0.9038650073012082, 0.0), # 86
(12.135839613526569, 9.895728136200717, 9.729738425925925, 10.455114945652172, 8.874814814814815, 4.276173251028807, 4.122216931216931, 3.3771049382716045, 4.570296913580247, 1.9746607407407408, 1.5486835725677832, 0.8879850552306694, 0.0, 11.959288194444444, 9.76783560753736, 7.743417862838915, 5.923982222222222, 9.140593827160494, 4.727946913580246, 4.122216931216931, 3.054409465020576, 4.437407407407408, 3.4850383152173916, 1.9459476851851853, 0.8996116487455198, 0.0), # 87
(12.106641689032028, 9.84863629364131, 9.713277692043896, 10.431981672705316, 8.863002501412087, 4.2672120560890106, 4.105241023158234, 3.3623589391860995, 4.562096959304984, 1.9680279706285808, 1.5431726800165397, 0.8857296705412365, 0.0, 11.941388245884776, 9.743026375953601, 7.715863400082698, 5.904083911885741, 9.124193918609969, 4.707302514860539, 4.105241023158234, 3.0480086114921505, 4.431501250706043, 3.477327224235106, 1.9426555384087794, 0.8953305721492102, 0.0), # 88
(12.076560887457505, 9.801262332404088, 9.696592678326475, 10.40845202294686, 8.850802872589364, 4.258017847889041, 4.088169392860024, 3.3477665752171926, 4.553800983081847, 1.9613762995239252, 1.537567936676709, 0.8834477173729935, 0.0, 11.922917309670781, 9.717924891102928, 7.687839683383544, 5.884128898571774, 9.107601966163694, 4.68687320530407, 4.088169392860024, 3.041441319920744, 4.425401436294682, 3.469484007648954, 1.9393185356652953, 0.8910238484003719, 0.0), # 89
(12.045652173913043, 9.753629032258065, 9.6796875, 10.384544836956522, 8.838235294117647, 4.248611111111111, 4.071008403361344, 3.333333333333333, 4.545416666666667, 1.9547058823529415, 1.5318779904306221, 0.881140350877193, 0.0, 11.90390625, 9.692543859649122, 7.65938995215311, 5.864117647058823, 9.090833333333334, 4.666666666666666, 4.071008403361344, 3.0347222222222223, 4.419117647058823, 3.461514945652175, 1.9359375, 0.8866935483870969, 0.0), # 90
(12.013970513508676, 9.705759172972254, 9.662566272290809, 10.360278955314012, 8.825319131767932, 4.239012330437433, 4.053764417701236, 3.319064700502972, 4.536951691815272, 1.948016874041798, 1.526111489160612, 0.8788087262050875, 0.0, 11.884385931069957, 9.66689598825596, 7.630557445803059, 5.844050622125392, 9.073903383630544, 4.646690580704161, 4.053764417701236, 3.027865950312452, 4.412659565883966, 3.4534263184380047, 1.9325132544581618, 0.8823417429974777, 0.0), # 91
(11.981570871354446, 9.657675534315677, 9.64523311042524, 10.335673218599032, 8.812073751311223, 4.2292419905502205, 4.036443798918745, 3.304966163694559, 4.528413740283494, 1.941309429516663, 1.5202770807490107, 0.8764539985079298, 0.0, 11.864387217078187, 9.640993983587226, 7.601385403745053, 5.823928288549988, 9.056827480566987, 4.626952629172383, 4.036443798918745, 3.0208871361073006, 4.406036875655611, 3.4452244061996784, 1.9290466220850482, 0.8779705031196072, 0.0), # 92
(11.948508212560386, 9.609400896057348, 9.62769212962963, 10.310746467391306, 8.798518518518518, 4.219320576131687, 4.01905291005291, 3.2910432098765434, 4.51981049382716, 1.9345837037037037, 1.5143834130781502, 0.8740773229369722, 0.0, 11.84394097222222, 9.614850552306692, 7.57191706539075, 5.80375111111111, 9.03962098765432, 4.607460493827161, 4.01905291005291, 3.0138004115226336, 4.399259259259259, 3.436915489130436, 1.925538425925926, 0.8735818996415772, 0.0), # 93
(11.914837502236535, 9.56095803796628, 9.609947445130317, 10.285517542270531, 8.784672799160816, 4.209268571864045, 4.0015981141427766, 3.277301326017376, 4.511149634202103, 1.9278398515290893, 1.5084391340303622, 0.8716798546434675, 0.0, 11.823078060699588, 9.588478401078142, 7.54219567015181, 5.783519554587267, 9.022299268404206, 4.588221856424326, 4.0015981141427766, 3.0066204084743178, 4.392336399580408, 3.4285058474235113, 1.9219894890260634, 0.8691780034514802, 0.0), # 94
(11.880613705492932, 9.512369739811495, 9.592003172153635, 10.260005283816424, 8.770555959009117, 4.199106462429508, 3.984085774227386, 3.2637459990855056, 4.5024388431641515, 1.9210780279189867, 1.5024528914879791, 0.869262748778668, 0.0, 11.801829346707818, 9.561890236565347, 7.512264457439896, 5.763234083756959, 9.004877686328303, 4.569244398719708, 3.984085774227386, 2.9993617588782198, 4.385277979504559, 3.4200017612721423, 1.9184006344307272, 0.8647608854374088, 0.0), # 95
(11.845891787439614, 9.463658781362009, 9.573863425925927, 10.234228532608697, 8.756187363834421, 4.188854732510288, 3.966522253345782, 3.250382716049383, 4.493685802469135, 1.9142983877995645, 1.4964333333333335, 0.8668271604938274, 0.0, 11.780225694444445, 9.5350987654321, 7.482166666666667, 5.742895163398693, 8.98737160493827, 4.5505358024691365, 3.966522253345782, 2.9920390946502056, 4.3780936819172105, 3.411409510869566, 1.9147726851851854, 0.8603326164874555, 0.0), # 96
(11.810726713186616, 9.414847942386832, 9.555532321673525, 10.208206129227051, 8.74158637940773, 4.178533866788599, 3.948913914537008, 3.237216963877458, 4.484898193872885, 1.9075010860969905, 1.4903891074487565, 0.864374244940197, 0.0, 11.758297968106996, 9.508116694342165, 7.451945537243782, 5.7225032582909705, 8.96979638774577, 4.532103749428441, 3.948913914537008, 2.984667047706142, 4.370793189703865, 3.402735376409018, 1.911106464334705, 0.8558952674897121, 0.0), # 97
(11.775173447843981, 9.365960002654985, 9.53701397462277, 10.181956914251208, 8.72677237150004, 4.168164349946655, 3.931267120840105, 3.22425422953818, 4.476083699131229, 1.9006862777374327, 1.484328861716581, 0.8619051572690299, 0.0, 11.736077031893004, 9.480956729959328, 7.421644308582906, 5.702058833212297, 8.952167398262459, 4.513955921353452, 3.931267120840105, 2.9772602499618963, 4.36338618575002, 3.3939856380837368, 1.9074027949245542, 0.8514509093322715, 0.0), # 98
(11.739286956521738, 9.317017741935484, 9.5183125, 10.15549972826087, 8.711764705882352, 4.157766666666667, 3.913588235294118, 3.2115, 4.46725, 1.893854117647059, 1.4782612440191387, 0.859421052631579, 0.0, 11.71359375, 9.453631578947368, 7.391306220095694, 5.681562352941175, 8.9345, 4.4961, 3.913588235294118, 2.9698333333333333, 4.355882352941176, 3.385166576086957, 1.9036625000000003, 0.8470016129032258, 0.0), # 99
(11.703122204329933, 9.268043939997343, 9.49943201303155, 10.128853411835749, 8.696582748325667, 4.147361301630848, 3.895883620938087, 3.1989597622313672, 4.458404778235025, 1.8870047607520377, 1.4721949022387621, 0.8569230861790968, 0.0, 11.690878986625515, 9.426153947970063, 7.36097451119381, 5.661014282256112, 8.91680955647005, 4.4785436671239145, 3.895883620938087, 2.9624009297363205, 4.348291374162834, 3.376284470611917, 1.89988640260631, 0.8425494490906678, 0.0), # 100
(11.6667341563786, 9.219061376609584, 9.480376628943759, 10.102036805555556, 8.681245864600983, 4.136968739521414, 3.878159640811057, 3.1866390032007312, 4.449555715592135, 1.8801383619785366, 1.4661384842577825, 0.8544124130628354, 0.0, 11.667963605967076, 9.398536543691188, 7.330692421288911, 5.640415085935608, 8.89911143118427, 4.461294604481024, 3.878159640811057, 2.9549776710867244, 4.340622932300492, 3.367345601851853, 1.8960753257887522, 0.8380964887826896, 0.0), # 101
(11.630177777777778, 9.170092831541218, 9.461150462962962, 10.07506875, 8.665773420479303, 4.126609465020577, 3.8604226579520695, 3.174543209876543, 4.44071049382716, 1.8732550762527238, 1.4601006379585326, 0.8518901884340482, 0.0, 11.644878472222222, 9.37079207277453, 7.300503189792663, 5.61976522875817, 8.88142098765432, 4.44436049382716, 3.8604226579520695, 2.947578189300412, 4.332886710239651, 3.358356250000001, 1.8922300925925928, 0.8336448028673837, 0.0), # 102
(11.593508033637502, 9.121161084561264, 9.4417576303155, 10.047968085748792, 8.650184781731623, 4.116303962810547, 3.842679035400168, 3.162677869227252, 4.43187679469593, 1.8663550585007669, 1.4540900112233446, 0.8493575674439874, 0.0, 11.621654449588474, 9.342933241883859, 7.270450056116723, 5.599065175502299, 8.86375358939186, 4.427749016918153, 3.842679035400168, 2.940217116293248, 4.325092390865811, 3.3493226952495982, 1.8883515260631, 0.8291964622328422, 0.0), # 103
(11.556779889067812, 9.072288915438735, 9.422202246227709, 10.020753653381641, 8.634499314128943, 4.10607271757354, 3.8249351361943953, 3.151048468221308, 4.423062299954275, 1.8594384636488344, 1.44811525193455, 0.8468157052439055, 0.0, 11.598322402263374, 9.314972757682959, 7.24057625967275, 5.578315390946502, 8.84612459990855, 4.411467855509831, 3.8249351361943953, 2.9329090839811003, 4.317249657064472, 3.3402512177938815, 1.884440449245542, 0.8247535377671579, 0.0), # 104
(11.520048309178742, 9.023499103942651, 9.402488425925926, 9.99344429347826, 8.618736383442265, 4.09593621399177, 3.8071973233737944, 3.1396604938271606, 4.414274691358024, 1.8525054466230941, 1.4421850079744816, 0.8442657569850553, 0.0, 11.574913194444443, 9.286923326835607, 7.210925039872408, 5.557516339869281, 8.828549382716048, 4.395524691358025, 3.8071973233737944, 2.9256687242798356, 4.309368191721132, 3.331148097826088, 1.8804976851851853, 0.8203181003584229, 0.0), # 105
(11.483368259080336, 8.974814429842029, 9.382620284636488, 9.966058846618358, 8.602915355442589, 4.0859149367474465, 3.7894719599774067, 3.12851943301326, 4.405521650663008, 1.8455561623497139, 1.436307927225471, 0.8417088778186895, 0.0, 11.551457690329217, 9.258797656005584, 7.181539636127354, 5.53666848704914, 8.811043301326016, 4.379927206218564, 3.7894719599774067, 2.918510669105319, 4.301457677721294, 3.3220196155394537, 1.8765240569272976, 0.81589222089473, 0.0), # 106
(11.446794703882626, 8.926257672905882, 9.362601937585735, 9.938616153381641, 8.58705559590091, 4.076029370522787, 3.7717654090442765, 3.117630772748057, 4.396810859625057, 1.838590765754862, 1.4304926575698504, 0.8391462228960604, 0.0, 11.527986754115226, 9.230608451856664, 7.152463287849251, 5.515772297264585, 8.793621719250114, 4.36468308184728, 3.7717654090442765, 2.911449550373419, 4.293527797950455, 3.312872051127215, 1.8725203875171472, 0.8114779702641711, 0.0), # 107
(11.410382608695652, 8.877851612903227, 9.3424375, 9.911135054347826, 8.571176470588235, 4.0663, 3.7540840336134447, 3.107, 4.3881499999999996, 1.8316094117647064, 1.4247478468899522, 0.8365789473684213, 0.0, 11.504531250000001, 9.202368421052633, 7.12373923444976, 5.494828235294118, 8.776299999999999, 4.3498, 3.7540840336134447, 2.9045, 4.285588235294117, 3.3037116847826096, 1.8684875000000005, 0.8070774193548388, 0.0), # 108
(11.374186938629451, 8.82961902960308, 9.322131087105625, 9.883634390096615, 8.555297345275559, 4.056747309861302, 3.7364341967239567, 3.0966326017375403, 4.379546753543667, 1.8246122553054145, 1.4190821430681082, 0.8340082063870239, 0.0, 11.48112204218107, 9.174090270257262, 7.09541071534054, 5.473836765916242, 8.759093507087334, 4.335285642432557, 3.7364341967239567, 2.8976766499009297, 4.277648672637779, 3.294544796698873, 1.864426217421125, 0.8026926390548256, 0.0), # 109
(11.338262658794058, 8.78158270277446, 9.301686814128946, 9.85613300120773, 8.539437585733882, 4.047391784788904, 3.7188222614148536, 3.0865340649291264, 4.371008802011888, 1.8175994513031553, 1.4135041939866502, 0.8314351551031215, 0.0, 11.457789994855966, 9.145786706134334, 7.067520969933251, 5.452798353909465, 8.742017604023776, 4.321147690900777, 3.7188222614148536, 2.8909941319920742, 4.269718792866941, 3.2853776670692443, 1.8603373628257893, 0.7983257002522237, 0.0), # 110
(11.302664734299517, 8.733765412186381, 9.281108796296298, 9.82864972826087, 8.523616557734204, 4.038253909465022, 3.7012545907251786, 3.0767098765432097, 4.3625438271604935, 1.8105711546840961, 1.4080226475279107, 0.8288609486679663, 0.0, 11.434565972222222, 9.117470435347629, 7.040113237639553, 5.431713464052287, 8.725087654320987, 4.307393827160493, 3.7012545907251786, 2.8844670781893007, 4.261808278867102, 3.2762165760869575, 1.8562217592592598, 0.7939786738351257, 0.0), # 111
(11.26744813025586, 8.686189937607857, 9.26040114883402, 9.801203411835749, 8.507853627047526, 4.029354168571865, 3.6837375476939744, 3.0671655235482396, 4.354159510745312, 1.803527520374405, 1.402646151574222, 0.8262867422328111, 0.0, 11.411480838477365, 9.08915416456092, 7.013230757871109, 5.4105825611232135, 8.708319021490624, 4.294031732967535, 3.6837375476939744, 2.8781101204084747, 4.253926813523763, 3.2670678039452503, 1.8520802297668042, 0.7896536306916234, 0.0), # 112
(11.232605068443652, 8.638958480664547, 9.239617828252069, 9.773850494242836, 8.492140544138962, 4.02070883845016, 3.6663155781940615, 3.057926284390303, 4.3458851245034475, 1.7964914209838192, 1.3973847812305735, 0.8237192936504428, 0.0, 11.388532681011865, 9.06091223015487, 6.9869239061528665, 5.389474262951456, 8.691770249006895, 4.281096798146424, 3.6663155781940615, 2.8719348846072568, 4.246070272069481, 3.257950164747613, 1.8479235656504138, 0.7853598618785952, 0.0), # 113
(11.197777077480078, 8.592536901878088, 9.219045675021619, 9.746810479149604, 8.47631468365306, 4.012298225970931, 3.649210925046347, 3.04910562975256, 4.337847614285224, 1.7895945503738353, 1.3922488674226394, 0.8211912172112975, 0.0, 11.365530496992042, 9.033103389324271, 6.961244337113197, 5.368783651121505, 8.675695228570447, 4.268747881653584, 3.649210925046347, 2.8659273042649507, 4.23815734182653, 3.248936826383202, 1.8438091350043238, 0.7811397183525536, 0.0), # 114
(11.162861883604794, 8.546941918551349, 9.198696932707318, 9.7200760546636, 8.46032614231088, 4.004100458749136, 3.6324357901149367, 3.0407013271393546, 4.330049991467515, 1.7828475983964234, 1.3872309022854188, 0.8187037582558852, 0.0, 11.342407957992451, 9.005741340814735, 6.936154511427093, 5.348542795189269, 8.66009998293503, 4.256981857995097, 3.6324357901149367, 2.8600717562493823, 4.23016307115544, 3.2400253515545345, 1.8397393865414637, 0.7769947198683046, 0.0), # 115
(11.127815847885161, 8.502107109420871, 9.178532189983873, 9.693599535239764, 8.444150821107023, 3.9960962141009686, 3.6159628905167356, 3.0326901564494966, 4.322472535691132, 1.7762380075348645, 1.3823211862542963, 0.8162523197487347, 0.0, 11.319128711707068, 8.97877551723608, 6.911605931271482, 5.328714022604592, 8.644945071382264, 4.245766219029295, 3.6159628905167356, 2.854354438643549, 4.222075410553511, 3.231199845079922, 1.835706437996775, 0.7729188281291702, 0.0), # 116
(11.092595331388527, 8.457966053223192, 9.158512035525986, 9.66733323533302, 8.427764621036088, 3.988266169342624, 3.5997649433686516, 3.0250488975817924, 4.315095526596881, 1.769753220272439, 1.3775100197646568, 0.8138323046543751, 0.0, 11.295656405829869, 8.952155351198124, 6.887550098823283, 5.309259660817316, 8.630191053193762, 4.23506845661451, 3.5997649433686516, 2.8487615495304452, 4.213882310518044, 3.222444411777674, 1.8317024071051975, 0.768906004838472, 0.0), # 117
(11.057156695182252, 8.414452328694855, 9.138597058008367, 9.6412294693983, 8.411143443092673, 3.980591001790297, 3.583814665787589, 3.0177543304350483, 4.307899243825574, 1.7633806790924282, 1.3727877032518847, 0.811439115937335, 0.0, 11.271954688054828, 8.925830275310684, 6.863938516259424, 5.290142037277283, 8.615798487651148, 4.224856062609067, 3.583814665787589, 2.843279286993069, 4.205571721546336, 3.213743156466101, 1.8277194116016737, 0.7649502116995325, 0.0), # 118
(11.02145630033369, 8.3714995145724, 9.118747846105723, 9.615240551890535, 8.394263188271376, 3.973051388760183, 3.5680847748904534, 3.0107832349080725, 4.300863967018017, 1.757107826478112, 1.3681445371513656, 0.8090681565621435, 0.0, 11.247987206075917, 8.899749722183577, 6.840722685756828, 5.271323479434335, 8.601727934036035, 4.215096528871301, 3.5680847748904534, 2.8378938491144163, 4.197131594135688, 3.2050801839635126, 1.8237495692211447, 0.761045410415673, 0.0), # 119
(10.985450507910194, 8.329041189592374, 9.098924988492762, 9.589318797264655, 8.377099757566796, 3.965628007568476, 3.5525479877941515, 3.0041123908996714, 4.293969975815023, 1.7509221049127721, 1.3635708218984832, 0.8067148294933297, 0.0, 11.223717607587115, 8.873863124426626, 6.817854109492416, 5.252766314738315, 8.587939951630046, 4.20575734725954, 3.5525479877941515, 2.8325914339774827, 4.188549878783398, 3.1964395990882193, 1.8197849976985525, 0.7571855626902159, 0.0), # 120
(10.949095678979122, 8.287010932491311, 9.079089073844187, 9.56341651997559, 8.359629051973535, 3.9583015355313718, 3.5371770216155882, 2.9977185783086533, 4.2871975498573995, 1.7448109568796892, 1.3590568579286233, 0.8043745376954222, 0.0, 11.199109540282393, 8.848119914649644, 6.795284289643115, 5.234432870639067, 8.574395099714799, 4.196806009632114, 3.5371770216155882, 2.8273582396652652, 4.179814525986767, 3.1878055066585307, 1.8158178147688375, 0.753364630226483, 0.0), # 121
(10.912348174607825, 8.245342322005756, 9.059200690834711, 9.537486034478269, 8.341826972486187, 3.951052649965064, 3.5219445934716704, 2.9915785770338243, 4.2805269687859555, 1.7387618248621435, 1.3545929456771704, 0.8020426841329501, 0.0, 11.174126651855724, 8.82246952546245, 6.772964728385852, 5.216285474586429, 8.561053937571911, 4.1882100078473545, 3.5219445934716704, 2.8221804642607595, 4.170913486243093, 3.1791620114927572, 1.8118401381669422, 0.7495765747277962, 0.0), # 122
(10.875164355863662, 8.20396893687225, 9.039220428139036, 9.511479655227625, 8.323669420099352, 3.9438620281857477, 3.506823420479303, 2.9856691669739917, 4.273938512241501, 1.7327621513434166, 1.3501693855795087, 0.7997146717704421, 0.0, 11.148732590001085, 8.796861389474863, 6.750846927897544, 5.1982864540302485, 8.547877024483002, 4.1799368337635885, 3.506823420479303, 2.8170443058469625, 4.161834710049676, 3.170493218409209, 1.8078440856278073, 0.7458153578974774, 0.0), # 123
(10.837500583813984, 8.162824355827334, 9.01910887443187, 9.485349696678588, 8.30513229580763, 3.9367103475096172, 3.4917862197553915, 2.979967128027963, 4.267412459864846, 1.7267993788067886, 1.345776478071024, 0.7973859035724276, 0.0, 11.122891002412453, 8.771244939296702, 6.728882390355119, 5.180398136420364, 8.534824919729692, 4.171953979239149, 3.4917862197553915, 2.8119359625068694, 4.152566147903815, 3.1617832322261967, 1.803821774886374, 0.7420749414388487, 0.0), # 124
(10.79931321952615, 8.121842157607551, 8.998826618387923, 9.459048473286083, 8.286191500605618, 3.9295782852528696, 3.4768057084168436, 2.9744492400945455, 4.260929091296797, 1.7208609497355405, 1.3414045235871004, 0.7950517825034348, 0.0, 11.096565536783794, 8.745569607537782, 6.707022617935502, 5.16258284920662, 8.521858182593594, 4.164228936132364, 3.4768057084168436, 2.806841632323478, 4.143095750302809, 3.153016157762029, 1.799765323677585, 0.7383492870552321, 0.0), # 125
(10.760558624067514, 8.080955920949442, 8.978334248681898, 9.432528299505048, 8.266822935487914, 3.9224465187316975, 3.461854603580562, 2.969092283072546, 4.254468686178167, 1.7149343066129532, 1.3370438225631227, 0.7927077115279934, 0.0, 11.069719840809094, 8.719784826807926, 6.685219112815614, 5.144802919838858, 8.508937372356334, 4.156729196301565, 3.461854603580562, 2.801747513379784, 4.133411467743957, 3.144176099835017, 1.79566684973638, 0.7346323564499494, 0.0), # 126
(10.721193158505432, 8.040099224589545, 8.957592353988504, 9.405741489790408, 8.247002501449117, 3.915295725262296, 3.4469056223634564, 2.9638730368607726, 4.248011524149763, 1.7090068919223076, 1.3326846754344757, 0.7903490936106315, 0.0, 11.042317562182317, 8.693840029716947, 6.6634233771723785, 5.127020675766921, 8.496023048299525, 4.149422251605082, 3.4469056223634564, 2.7966398037587825, 4.1235012507245585, 3.1352471632634704, 1.7915184707977012, 0.7309181113263225, 0.0), # 127
(10.681173183907255, 7.999205647264407, 8.93656152298245, 9.3786403585971, 8.226706099483831, 3.908106582160861, 3.431931481882429, 2.958768281358031, 4.241537884852393, 1.703066148146884, 1.328317382636545, 0.7879713317158789, 0.0, 11.014322348597444, 8.667684648874667, 6.641586913182724, 5.109198444440651, 8.483075769704786, 4.1422755939012434, 3.431931481882429, 2.791504701543472, 4.1133530497419155, 3.1262134528657004, 1.7873123045964903, 0.7272005133876734, 0.0), # 128
(10.640455061340337, 7.958208767710564, 8.91520234433844, 9.351177220380043, 8.205909630586648, 3.9008597667435865, 3.4169048992543876, 2.95375479646313, 4.235028047926869, 1.697099517769964, 1.3239322446047141, 0.7855698288082636, 0.0, 10.985697847748446, 8.641268116890899, 6.619661223023571, 5.0912985533098905, 8.470056095853739, 4.135256715048382, 3.4169048992543876, 2.7863284048168473, 4.102954815293324, 3.117059073460015, 1.783040468867688, 0.7234735243373241, 0.0), # 129
(10.598995151872039, 7.917042164664562, 8.893475406731179, 9.323304389594178, 8.18458899575217, 3.893535956326666, 3.4017985915962377, 2.948809362074875, 4.228462293014, 1.6910944432748274, 1.3195195617743691, 0.7831399878523152, 0.0, 10.956407707329298, 8.614539866375466, 6.5975978088718445, 5.073283329824481, 8.456924586028, 4.128333106904826, 3.4017985915962377, 2.781097111661904, 4.092294497876085, 3.1077681298647266, 1.7786950813462359, 0.7197311058785967, 0.0), # 130
(10.556749816569713, 7.8756394168629384, 8.87134129883538, 9.294974180694428, 8.162720095974995, 3.886115828226296, 3.3865852760248853, 2.943908758092075, 4.221820899754594, 1.685038367144756, 1.3150696345808937, 0.7806772118125626, 0.0, 10.926415575033973, 8.587449329938186, 6.575348172904468, 5.055115101434266, 8.443641799509187, 4.121472261328905, 3.3865852760248853, 2.77579702016164, 4.081360047987498, 3.0983247268981433, 1.7742682597670765, 0.7159672197148127, 0.0), # 131
(10.51367541650071, 7.833934103042237, 8.848760609325746, 9.266138908135728, 8.140278832249722, 3.878580059758672, 3.3712376696572353, 2.9390297644135366, 4.215084147789462, 1.6789187318630299, 1.310572763459673, 0.7781769036535342, 0.0, 10.89568509855645, 8.559945940188875, 6.552863817298364, 5.0367561955890885, 8.430168295578923, 4.114641670178951, 3.3712376696572353, 2.770414328399051, 4.070139416124861, 3.088712969378577, 1.7697521218651495, 0.7121758275492944, 0.0), # 132
(10.469728312732395, 7.791859801938998, 8.825693926876983, 9.236750886373006, 8.117241105570947, 3.870909328239987, 3.3557284896101933, 2.934149160938066, 4.2082323167594105, 1.67272297991293, 1.306019248846092, 0.7756344663397593, 0.0, 10.864179925590703, 8.531979129737351, 6.53009624423046, 5.018168939738788, 8.416464633518821, 4.107808825313293, 3.3557284896101933, 2.764935234457133, 4.058620552785474, 3.078916962124336, 1.765138785375397, 0.7083508910853636, 0.0), # 133
(10.424864866332113, 7.749350092289764, 8.802101840163804, 9.206762429861191, 8.093582816933273, 3.863084310986436, 3.3400304530006673, 2.929243727564472, 4.201245686305251, 1.6664385537777375, 1.3013993911755357, 0.7730453028357667, 0.0, 10.831863703830699, 8.503498331193432, 6.506996955877678, 4.9993156613332115, 8.402491372610502, 4.100941218590261, 3.3400304530006673, 2.7593459364188826, 4.046791408466636, 3.0689208099537315, 1.7604203680327608, 0.7044863720263422, 0.0), # 134
(10.379041438367224, 7.706338552831077, 8.777944937860909, 9.17612585305522, 8.069279867331296, 3.8550856853142146, 3.3241162769455603, 2.92429024419156, 4.194104536067791, 1.6600528959407332, 1.2967034908833885, 0.7704048161060852, 0.0, 10.798700080970423, 8.474452977166937, 6.483517454416942, 4.980158687822199, 8.388209072135583, 4.094006341868184, 3.3241162769455603, 2.753632632367296, 4.034639933665648, 3.0587086176850744, 1.755588987572182, 0.7005762320755525, 0.0), # 135
(10.332214389905081, 7.6627587622994735, 8.753183808643008, 9.144793470410015, 8.044308157759612, 3.8468941285395175, 3.3079586785617807, 2.9192654907181383, 4.186789145687842, 1.653553448885197, 1.2919218484050357, 0.7677084091152441, 0.0, 10.764652704703844, 8.444792500267685, 6.459609242025177, 4.96066034665559, 8.373578291375685, 4.086971687005394, 3.3079586785617807, 2.7477815203853697, 4.022154078879806, 3.0482644901366727, 1.750636761728602, 0.6966144329363159, 0.0), # 136
(10.28434008201304, 7.618544299431501, 8.72777904118481, 9.112717596380511, 8.018643589212827, 3.838490317978539, 3.291530374966233, 2.9141462470430146, 4.179279794806213, 1.6469276550944107, 1.2870447641758613, 0.764951484827772, 0.0, 10.729685222724932, 8.41446633310549, 6.435223820879306, 4.940782965283231, 8.358559589612426, 4.079804745860221, 3.291530374966233, 2.741778798556099, 4.0093217946064135, 3.037572532126838, 1.7455558082369622, 0.6925949363119547, 0.0), # 137
(10.235374875758456, 7.573628742963698, 8.701691224161017, 9.079850545421637, 7.992262062685534, 3.8298549309474748, 3.2748040832758227, 2.908909293064995, 4.1715567630637125, 1.6401629570516543, 1.2820625386312503, 0.7621294462081979, 0.0, 10.693761282727667, 8.383423908290176, 6.410312693156252, 4.920488871154961, 8.343113526127425, 4.0724730102909925, 3.2748040832758227, 2.735610664962482, 3.996131031342767, 3.02661684847388, 1.7403382448322038, 0.6885117039057909, 0.0), # 138
(10.185275132208682, 7.527945671632606, 8.67488094624634, 9.046144631988323, 7.965139479172331, 3.8209686447625186, 3.2577525206074553, 2.903531408682887, 4.163600330101148, 1.6332467972402094, 1.276965472206588, 0.7592376962210506, 0.0, 10.656844532406023, 8.351614658431556, 6.38482736103294, 4.899740391720627, 8.327200660202296, 4.064943972156042, 3.2577525206074553, 2.729263317687513, 3.9825697395861654, 3.0153815439961082, 1.7349761892492683, 0.6843586974211461, 0.0), # 139
(10.133997212431076, 7.481428664174767, 8.647308796115487, 9.011552170535499, 7.937251739667823, 3.811812136739866, 3.240348404078038, 2.897989373795498, 4.155390775559333, 1.626166618143356, 1.2717438653372588, 0.7562716378308593, 0.0, 10.618898619453978, 8.31898801613945, 6.358719326686294, 4.878499854430067, 8.310781551118666, 4.0571851233136975, 3.240348404078038, 2.7227229548141896, 3.9686258698339114, 3.003850723511834, 1.7294617592230976, 0.6801298785613425, 0.0), # 140
(10.081497477492995, 7.4340112993267216, 8.61893536244316, 8.976025475518098, 7.908574745166602, 3.802366084195711, 3.222564450804477, 2.892259968301635, 4.146908379079072, 1.6189098622443758, 1.2663880184586478, 0.7532266740021526, 0.0, 10.579887191565495, 8.285493414023676, 6.331940092293238, 4.856729586733126, 8.293816758158144, 4.049163955622289, 3.222564450804477, 2.7159757744255075, 3.954287372583301, 2.9920084918393663, 1.7237870724886322, 0.675819209029702, 0.0), # 141
(10.027732288461786, 7.385627155825012, 8.58972123390407, 8.939516861391049, 7.879084396663268, 3.792611164446249, 3.2043733779036754, 2.8863199721001056, 4.138133420301177, 1.6114639720265487, 1.2608882320061394, 0.7500982076994595, 0.0, 10.539773896434559, 8.251080284694053, 6.304441160030697, 4.834391916079644, 8.276266840602354, 4.040847960940148, 3.2043733779036754, 2.7090079746044635, 3.939542198331634, 2.9798389537970165, 1.7179442467808141, 0.6714206505295467, 0.0), # 142
(9.972658006404808, 7.336209812406179, 8.559626999172925, 8.901978642609278, 7.848756595152423, 3.7825280548076745, 3.185747902492541, 2.880146165089716, 4.129046178866458, 1.6038163899731561, 1.2552348064151186, 0.746881641887309, 0.0, 10.49852238175514, 8.215698060760397, 6.276174032075593, 4.811449169919467, 8.258092357732917, 4.032204631125603, 3.185747902492541, 2.701805753434053, 3.9243782975762116, 2.967326214203093, 1.7119253998345851, 0.6669281647641981, 0.0), # 143
(9.916230992389421, 7.285692847806764, 8.528613246924428, 8.86336313362772, 7.817567241628662, 3.772097432596183, 3.1666607416879793, 2.8737153271692746, 4.119626934415724, 1.5959545585674784, 1.2494180421209704, 0.7435723795302299, 0.0, 10.456096295221217, 8.179296174832528, 6.247090210604851, 4.787863675702434, 8.239253868831447, 4.023201458036985, 3.1666607416879793, 2.6943553089972734, 3.908783620814331, 2.954454377875907, 1.7057226493848856, 0.6623357134369786, 0.0), # 144
(9.858407607482972, 7.234009840763308, 8.496640565833289, 8.823622648901305, 7.785492237086586, 3.7612999751279688, 3.147084612606896, 2.867004238237588, 4.109855966589781, 1.5878659202927967, 1.2434282395590792, 0.7401658235927514, 0.0, 10.41245928452676, 8.141824059520264, 6.217141197795395, 4.763597760878389, 8.219711933179562, 4.013805933532623, 3.147084612606896, 2.6866428393771202, 3.892746118543293, 2.9412075496337686, 1.699328113166658, 0.6576372582512099, 0.0), # 145
(9.79914421275282, 7.181094370012356, 8.463669544574216, 8.782709502884963, 7.752507482520793, 3.750116359719226, 3.126992232366198, 2.8599896781934633, 4.099713555029442, 1.5795379176323916, 1.2372556991648298, 0.7366573770394019, 0.0, 10.367574997365741, 8.103231147433421, 6.186278495824149, 4.738613752897173, 8.199427110058885, 4.0039855494708485, 3.126992232366198, 2.67865454265659, 3.8762537412603963, 2.927569834294988, 1.6927339089148434, 0.6528267609102142, 0.0), # 146
(9.73839716926632, 7.126880014290443, 8.42966077182191, 8.740576010033621, 7.71858887892588, 3.7385272636861506, 3.1063563180827884, 2.8526484269357075, 4.0891799793755155, 1.570957993069544, 1.2308907213736073, 0.7330424428347111, 0.0, 10.321407081432142, 8.06346687118182, 6.154453606868036, 4.712873979208631, 8.178359958751031, 3.9937077977099906, 3.1063563180827884, 2.670376616918679, 3.85929443946294, 2.9135253366778744, 1.6859321543643822, 0.6478981831173131, 0.0), # 147
(9.676122838090825, 7.071300352334116, 8.394574836251083, 8.697174484802217, 7.6837123272964485, 3.726513364344937, 3.085149586873576, 2.8449572643631287, 4.078235519268811, 1.5621135890875346, 1.2243236066207965, 0.729316423943207, 0.0, 10.27391918441993, 8.022480663375276, 6.1216180331039824, 4.686340767262602, 8.156471038537623, 3.9829401701083804, 3.085149586873576, 2.6617952602463837, 3.8418561636482242, 2.899058161600739, 1.6789149672502168, 0.6428454865758287, 0.0), # 148
(9.612277580293695, 7.014288962879912, 8.358372326536443, 8.652457241645672, 7.647853728627096, 3.71405533901178, 3.0633447558554643, 2.8368929703745334, 4.0668604543501345, 1.5529921481696445, 1.2175446553417821, 0.7254747233294191, 0.0, 10.225074954023084, 7.980221956623609, 6.08772327670891, 4.658976444508932, 8.133720908700269, 3.971650158524347, 3.0633447558554643, 2.6528966707226997, 3.823926864313548, 2.8841524138818913, 1.671674465307289, 0.637662632989083, 0.0), # 149
(9.546817756942277, 6.955779424664377, 8.321013831352694, 8.606376595018924, 7.610988983912421, 3.7011338650028747, 3.04091454214536, 2.828432324868728, 4.0550350642603, 1.5435811127991534, 1.2105441679719486, 0.7215127439578762, 0.0, 10.174838037935576, 7.936640183536638, 6.0527208398597425, 4.630743338397459, 8.1100701285206, 3.95980525481622, 3.04091454214536, 2.6436670464306244, 3.8054944919562104, 2.8687921983396416, 1.6642027662705388, 0.632343584060398, 0.0), # 150
(9.47969972910393, 6.895705316424048, 8.282459939374542, 8.558884859376896, 7.573093994147021, 3.6877296196344136, 3.01783166286017, 2.8195521077445216, 4.042739628640115, 1.5338679254593437, 1.203312444946681, 0.7174258887931072, 0.0, 10.123172083851381, 7.891684776724178, 6.016562224733405, 4.601603776378029, 8.08547925728023, 3.9473729508423303, 3.01783166286017, 2.6340925854531525, 3.7865469970735104, 2.8529616197922993, 1.6564919878749085, 0.6268823014930954, 0.0), # 151
(9.41087985784601, 6.83400021689547, 8.242671239276701, 8.509934349174525, 7.534144660325495, 3.6738232802225945, 2.9940688351167988, 2.8102290989007206, 4.029954427130388, 1.5238400286334952, 1.1958397867013644, 0.713209560799641, 0.0, 10.070040739464476, 7.84530516879605, 5.979198933506821, 4.5715200859004845, 8.059908854260776, 3.9343207384610093, 2.9940688351167988, 2.6241594858732817, 3.7670723301627476, 2.836644783058176, 1.6485342478553402, 0.6212727469904974, 0.0), # 152
(9.340314504235872, 6.770597704815181, 8.201608319733868, 8.459477378866739, 7.4941168834424445, 3.659395524083611, 2.9695987760321514, 2.800440078236131, 4.016659739371929, 1.513484864804889, 1.1881164936713833, 0.7088591629420063, 0.0, 10.015407652468832, 7.797450792362069, 5.940582468356916, 4.5404545944146655, 8.033319478743858, 3.9206161095305836, 2.9695987760321514, 2.6138539457740078, 3.7470584417212223, 2.81982579295558, 1.6403216639467737, 0.6155088822559257, 0.0), # 153
(9.267960029340873, 6.705431358919725, 8.159231769420758, 8.407466262908468, 7.4529865644924636, 3.644427028533658, 2.944394202723137, 2.7901618256495615, 4.002835845005546, 1.5027898764568062, 1.1801328662921224, 0.7043700981847325, 0.0, 9.959236470558428, 7.748071080032056, 5.900664331460612, 4.508369629370417, 8.005671690011091, 3.9062265559093863, 2.944394202723137, 2.603162163238327, 3.7264932822462318, 2.802488754302823, 1.631846353884152, 0.6095846689927024, 0.0), # 154
(9.193772794228362, 6.638434757945644, 8.115502177012075, 8.35385331575464, 7.4107296044701565, 3.62889847088893, 2.9184278323066564, 2.779371121039818, 3.988463023672051, 1.4917425060725265, 1.1718792049989668, 0.6997377694923482, 0.0, 9.901490841427231, 7.6971154644158295, 5.859396024994833, 4.4752275182175785, 7.976926047344102, 3.8911195694557454, 2.9184278323066564, 2.5920703363492357, 3.7053648022350782, 2.7846177719182137, 1.6231004354024152, 0.6034940689041496, 0.0), # 155
(9.117709159965697, 6.569541480629476, 8.070380131182526, 8.298590851860187, 7.367321904370117, 3.612790528465623, 2.8916723818996197, 2.7680447443057092, 3.9735215550122502, 1.480330196135332, 1.163345810227301, 0.6949575798293822, 0.0, 9.842134412769221, 7.644533378123204, 5.816729051136504, 4.440990588405995, 7.9470431100245005, 3.875262642027993, 2.8916723818996197, 2.5805646631897305, 3.6836609521850585, 2.766196950620063, 1.6140760262365055, 0.5972310436935888, 0.0), # 156
(9.039725487620235, 6.498685105707764, 8.023826220606818, 8.241631185680044, 7.322739365186948, 3.59608387857993, 2.864100568618931, 2.756159475346041, 3.957991718666955, 1.4685403891285025, 1.1545229824125098, 0.6900249321603636, 0.0, 9.781130832278372, 7.590274253763999, 5.772614912062549, 4.405621167385506, 7.91598343733391, 3.8586232654844577, 2.864100568618931, 2.568631341842807, 3.661369682593474, 2.7472103952266815, 1.6047652441213638, 0.5907895550643424, 0.0), # 157
(8.957617135686286, 6.424498432849483, 7.973591953902356, 8.180792623486118, 7.274944884696797, 3.5777171334219773, 2.8350640325567142, 2.742898476174686, 3.9406648366396384, 1.4560097748873433, 1.1451191505077887, 0.6847599564194339, 0.0, 9.715783031298415, 7.532359520613772, 5.7255957525389425, 4.368029324662029, 7.881329673279277, 3.840057866644561, 2.8350640325567142, 2.555512238158555, 3.6374724423483986, 2.7269308744953733, 1.5947183907804712, 0.5840453120772259, 0.0), # 158
(8.858744120374082, 6.3393718515594255, 7.906737818402987, 8.103579442909608, 7.212153047825302, 3.551582753604972, 2.8009276580314295, 2.7236067663821912, 3.9145709044888575, 1.4406842982296237, 1.133483387123799, 0.6781362523683109, 0.0, 9.630513176304232, 7.459498776051419, 5.667416935618994, 4.322052894688871, 7.829141808977715, 3.813049472935068, 2.8009276580314295, 2.5368448240035515, 3.606076523912651, 2.7011931476365363, 1.5813475636805976, 0.5763065319599479, 0.0), # 159
(8.741846513885172, 6.242606401394785, 7.821920957955889, 8.008719759367974, 7.133136105077435, 3.517038907233379, 2.7613462490302703, 2.6977995947636733, 3.8789700908914604, 1.4223616955588683, 1.119451901721908, 0.6700501948887847, 0.0, 9.523704730672296, 7.370552143776631, 5.59725950860954, 4.267085086676604, 7.757940181782921, 3.7769194326691427, 2.7613462490302703, 2.512170648023842, 3.5665680525387176, 2.669573253122658, 1.5643841915911778, 0.5675096728540715, 0.0), # 160
(8.607866465503152, 6.134832954888515, 7.7200469719103095, 7.897115253381055, 7.038714499425689, 3.4745040690992197, 2.716608867604126, 2.66580026655489, 3.8343319067996067, 1.4011974579512814, 1.1031483309199415, 0.6605767468907572, 0.0, 9.396448853782916, 7.266344215798328, 5.515741654599707, 4.203592373853843, 7.668663813599213, 3.7321203731768464, 2.716608867604126, 2.481788620785157, 3.5193572497128445, 2.632371751127019, 1.5440093943820619, 0.557712086808047, 0.0), # 161
(8.457746124511628, 6.016682384573562, 7.602021459615496, 7.769667605468694, 6.929708673842563, 3.424396713994519, 2.6670045758038854, 2.627932086991601, 3.781125863165454, 1.3773470764830695, 1.0846963113357242, 0.6497908712841294, 0.0, 9.2498367050164, 7.147699584125422, 5.42348155667862, 4.132041229449208, 7.562251726330908, 3.6791049217882414, 2.6670045758038854, 2.4459976528532277, 3.4648543369212814, 2.5898892018228983, 1.5204042919230993, 0.5469711258703239, 0.0), # 162
(8.292427640194196, 5.888785562982875, 7.468750020420702, 7.6272784961507405, 6.806939071300549, 3.367135316711301, 2.61282243568044, 2.5845183613095624, 3.719821470941162, 1.3509660422304377, 1.0642194795870819, 0.6377675309788032, 0.0, 9.084959443753055, 7.015442840766835, 5.321097397935408, 4.052898126691312, 7.439642941882324, 3.6183257058333878, 2.61282243568044, 2.405096654793786, 3.4034695356502747, 2.5424261653835805, 1.4937500040841403, 0.5353441420893524, 0.0), # 163
(8.11285316183446, 5.751773362649402, 7.321138253675176, 7.470849605947036, 6.67122613477215, 3.3031383520415907, 2.5543515092846794, 2.5358823947445344, 3.650888241078889, 1.3222098462695906, 1.0418414722918394, 0.6245816888846804, 0.0, 8.902908229373192, 6.870398577731482, 5.209207361459196, 3.966629538808771, 7.301776482157778, 3.550235352642348, 2.5543515092846794, 2.3593845371725646, 3.335613067386075, 2.4902832019823458, 1.4642276507350354, 0.5228884875135821, 0.0), # 164
(7.9199648387160195, 5.606276656106095, 7.160091758728169, 7.301282615377426, 6.5233903072298585, 3.2328242947774104, 2.491880858667493, 2.482347492532273, 3.5747956845307916, 1.2912339796767343, 1.0176859260678224, 0.610308307911662, 0.0, 8.704774221257123, 6.713391387028281, 5.088429630339111, 3.873701939030202, 7.149591369061583, 3.4752864895451823, 2.491880858667493, 2.309160210555293, 3.2616951536149292, 2.433760871792476, 1.432018351745634, 0.5096615141914632, 0.0), # 165
(7.714704820122476, 5.452926315885899, 6.9865161349289275, 7.119479204961751, 6.364252031646171, 3.156611619710786, 2.4256995458797714, 2.4242369599085385, 3.492013312249029, 1.2581939335280738, 0.9918764775328559, 0.5950223509696502, 0.0, 8.491648578785155, 6.545245860666151, 4.959382387664279, 3.7745818005842207, 6.984026624498058, 3.393931743871954, 2.4256995458797714, 2.254722585507704, 3.1821260158230853, 2.373159734987251, 1.3973032269857855, 0.4957205741714455, 0.0), # 166
(7.498015255337426, 5.292353214521765, 6.801316981626705, 6.926341055219858, 6.194631750993583, 3.074918801633741, 2.3560966329724047, 2.361874102109088, 3.403010635185759, 1.2232451988998143, 0.9645367633047655, 0.5787987809685459, 0.0, 8.264622461337595, 6.366786590654004, 4.822683816523827, 3.669735596699442, 6.806021270371518, 3.3066237429527234, 2.3560966329724047, 2.196370572595529, 3.0973158754967915, 2.308780351739953, 1.360263396325341, 0.4811230195019787, 0.0), # 167
(7.2708382936444735, 5.125188224546641, 6.605399898170748, 6.722769846671591, 6.015349908244593, 2.9881643153382993, 2.2833611819962822, 2.2955822243696797, 3.308257164293142, 1.1865432668681617, 0.9357904200013762, 0.5617125608182512, 0.0, 8.024787028294753, 6.178838169000762, 4.678952100006881, 3.559629800604484, 6.616514328586284, 3.2138151141175517, 2.2833611819962822, 2.1344030823844995, 3.0076749541222965, 2.2409232822238643, 1.3210799796341497, 0.46592620223151293, 0.0), # 168
(7.034116084327218, 4.952062218493477, 6.399670483910309, 6.509667259836794, 5.827226946371695, 2.8967666356164865, 2.2077822550022947, 2.2256846319260726, 3.2082224105233346, 1.1482436285093212, 0.9057610842405137, 0.5438386534286673, 0.0, 7.773233439036942, 5.982225187715339, 4.528805421202568, 3.444730885527963, 6.416444821046669, 3.1159584846965016, 2.2077822550022947, 2.0691190254403473, 2.9136134731858476, 2.1698890866122653, 1.2799340967820618, 0.450187474408498, 0.0), # 169
(6.78879077666926, 4.773606068895221, 6.185034338194635, 6.2879349752353075, 5.631083308347386, 2.8011442372603246, 2.1296489140413315, 2.1525046300140236, 3.103375884828495, 1.1085017748994974, 0.8745723926400033, 0.525252021709696, 0.0, 7.5110528529444665, 5.777772238806654, 4.372861963200016, 3.325505324698492, 6.20675176965699, 3.013506482019633, 2.1296489140413315, 2.0008173123288033, 2.815541654173693, 2.0959783250784363, 1.2370068676389272, 0.4339641880813838, 0.0), # 170
(6.5358045199542, 4.59045064828482, 5.962397060372978, 6.058474673386982, 5.427739437144163, 2.701715595061839, 2.049250221164283, 2.0763655238692915, 2.994187098160782, 1.0674731971148967, 0.8423479818176697, 0.5060276285712387, 0.0, 7.239336429397638, 5.566303914283624, 4.211739909088348, 3.2024195913446896, 5.988374196321564, 2.906911733417008, 2.049250221164283, 1.9297968536155994, 2.7138697185720817, 2.019491557795661, 1.1924794120745956, 0.4173136952986201, 0.0), # 171
(6.276099463465638, 4.403226829195226, 5.7326642497945866, 5.822188034811656, 5.218015775734522, 2.5988991838130535, 1.9668752384220392, 1.9975906187276353, 2.881125561472354, 1.025313386231724, 0.8092114883913387, 0.4862404369231972, 0.0, 6.959175327776763, 5.348644806155168, 4.046057441956694, 3.075940158695172, 5.762251122944708, 2.7966268662186895, 1.9668752384220392, 1.8563565598664666, 2.609007887867261, 1.9407293449372194, 1.1465328499589174, 0.40029334810865697, 0.0), # 172
(6.010617756487176, 4.212565484159386, 5.4967415058087115, 5.579976740029178, 5.002732767090961, 2.4931134783059927, 1.8828130278654898, 1.916503219824812, 2.7646607857153684, 0.9821778333261846, 0.7752865489788355, 0.4659654096754725, 0.0, 6.671660707462155, 5.125619506430197, 3.8764327448941778, 2.9465334999785533, 5.529321571430737, 2.6831045077547366, 1.8828130278654898, 1.7807953416471376, 2.5013663835454807, 1.859992246676393, 1.0993483011617424, 0.38296049855994424, 0.0), # 173
(5.740301548302412, 4.019097485710249, 5.2555344277646014, 5.332742469559387, 4.782710854185972, 2.3847769533326795, 1.7973526515455251, 1.8334266323965802, 2.645262281841985, 0.9382220294744842, 0.7406968001979856, 0.44527750973796687, 0.0, 6.37788372783412, 4.898052607117634, 3.7034840009899272, 2.814666088423452, 5.29052456368397, 2.5667972853552126, 1.7973526515455251, 1.7034121095233423, 2.391355427092986, 1.7775808231864625, 1.0511068855529204, 0.3653724987009318, 0.0), # 174
(5.466092988194946, 3.823453706380764, 5.009948615011508, 5.08138690392213, 4.558770479992055, 2.2743080836851397, 1.7107831715130346, 1.748684161678698, 2.5233995608043616, 0.8936014657528275, 0.7055658786666139, 0.4242517000205815, 0.0, 6.078935548272969, 4.666768700226395, 3.5278293933330693, 2.680804397258482, 5.046799121608723, 2.4481578263501773, 1.7107831715130346, 1.6245057740608142, 2.2793852399960275, 1.6937956346407106, 1.0019897230023018, 0.3475867005800695, 0.0), # 175
(5.188934225448382, 3.62626501870388, 4.760889666898678, 4.8268117236372525, 4.331732087481704, 2.1621253441553967, 1.6233936498189088, 1.6625991129069244, 2.3995421335546565, 0.8484716332374204, 0.670017421002546, 0.4029629434332179, 0.0, 5.7759073281590085, 4.432592377765396, 3.35008710501273, 2.5454148997122603, 4.799084267109313, 2.327638758069694, 1.6233936498189088, 1.5443752458252833, 2.165866043740852, 1.6089372412124179, 0.9521779333797357, 0.3296604562458073, 0.0), # 176
(4.909767409346319, 3.4281622952125463, 4.5092631827753635, 4.569918609224595, 4.102416119627418, 2.0486472095354746, 1.5354731485140374, 1.5754947913170163, 2.2741595110450277, 0.8029880230044676, 0.6341750638236071, 0.3814862028857779, 0.0, 5.4698902268725496, 4.196348231743556, 3.1708753191180357, 2.408964069013402, 4.548319022090055, 2.2056927078438227, 1.5354731485140374, 1.4633194353824817, 2.051208059813709, 1.5233062030748654, 0.9018526365550728, 0.31165111774659515, 0.0), # 177
(4.629534689172356, 3.2297764084397107, 4.255974761990814, 4.311609241204004, 3.8716430194016906, 1.9342921546173981, 1.4473107296493104, 1.4876945021447328, 2.147721204227634, 0.7573061261301752, 0.5981624437476226, 0.3598964412881627, 0.0, 5.161975403793902, 3.958860854169789, 2.9908122187381125, 2.271918378390525, 4.295442408455268, 2.082772303002626, 1.4473107296493104, 1.3816372532981414, 1.9358215097008453, 1.437203080401335, 0.8511949523981628, 0.29361603713088286, 0.0), # 178
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 179
)
passenger_allighting_rate = (
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 0
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 1
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 2
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 3
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 4
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 5
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 6
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 7
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 8
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 9
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 10
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 11
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 12
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 13
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 14
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 15
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 16
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 17
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 18
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 19
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 20
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 21
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 22
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 23
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 24
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 25
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 26
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 27
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 28
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 29
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 30
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 31
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 32
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 33
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 34
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 35
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 36
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 37
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 38
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 39
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 40
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 41
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 42
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 43
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 44
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 45
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 46
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 47
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 48
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 49
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 50
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 51
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 52
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 53
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 54
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 55
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 56
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 57
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 58
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 59
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 60
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 61
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 62
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 63
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 64
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 65
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 66
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 67
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 68
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 69
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 70
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 71
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 72
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 73
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 74
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 75
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 76
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 77
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 78
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 79
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 80
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 81
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 82
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 83
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 84
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 85
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 86
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 87
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 88
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 89
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 90
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 91
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 92
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 93
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 94
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 95
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 96
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 97
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 98
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 99
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 100
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 101
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 102
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 103
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 104
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 105
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 106
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 107
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 108
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 109
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 110
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 111
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 112
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 113
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 114
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 115
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 116
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 117
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 118
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 119
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 120
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 121
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 122
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 123
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 124
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 125
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 126
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 127
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 128
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 129
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 130
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 131
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 132
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 133
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 134
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 135
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 136
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 137
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 138
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 139
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 140
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 141
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 142
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 143
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 144
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 145
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 146
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 147
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 148
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 149
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 150
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 151
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 152
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 153
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 154
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 155
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 156
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 157
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 158
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 159
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 160
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 161
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 162
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 163
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 164
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 165
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 166
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 167
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 168
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 169
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 170
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 171
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 172
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 173
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 174
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 175
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 176
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 177
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 178
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 179
)
"""
parameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html
"""
#initial entropy
entropy = 8991598675325360468762009371570610170
#index for seed sequence child
child_seed_index = (
1, # 0
54, # 1
)
| 275.612834 | 493 | 0.769016 | 32,987 | 257,698 | 6.007306 | 0.222906 | 0.359704 | 0.34517 | 0.654007 | 0.375226 | 0.36742 | 0.365638 | 0.365275 | 0.365194 | 0.365194 | 0 | 0.849419 | 0.095981 | 257,698 | 934 | 494 | 275.907923 | 0.001198 | 0.015565 | 0 | 0.200873 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.005459 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
cd8b89c5e5902ba8f0b2538a49a1cc4cf166158c | 50,457 | py | Python | tests/test_comments.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | tests/test_comments.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | tests/test_comments.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import datetime as dt
import unittest
from collections import OrderedDict
from nose.tools import * # noqa PEP8 asserts
from nose_parameterized import parameterized
from modularodm.exceptions import ValidationValueError, ValidationError
from modularodm import Q
from framework.auth import Auth, User
from framework.exceptions import PermissionsError
from framework.guid.model import Guid
from website.addons.osfstorage import settings as osfstorage_settings
from website.files.models import FileNode
from website.files.models.box import BoxFile
from website.files.models.dropbox import DropboxFile
from website.files.models.github import GithubFile
from website.files.models.googledrive import GoogleDriveFile
from website.files.models.osfstorage import OsfStorageFile
from website.files.models.s3 import S3File
from website.project.model import Comment, NodeLog
from website.project.signals import comment_added, mention_added, contributor_added
from website.project.views.comment import update_file_guid_referent
from website.util import permissions
from website import settings
from tests.base import (
OsfTestCase,
assert_datetime_equal,
capture_signals
)
from tests.factories import (
UserFactory, ProjectFactory, AuthUserFactory, CommentFactory, NodeFactory
)
class TestCommentViews(OsfTestCase):
def setUp(self):
super(TestCommentViews, self).setUp()
self.project = ProjectFactory(is_public=True)
self.user = AuthUserFactory()
self.project.add_contributor(self.user)
self.project.save()
self.user.save()
def test_view_project_comments_updates_user_comments_view_timestamp(self):
url = self.project.api_url_for('update_comments_timestamp')
res = self.app.put_json(url, {
'page': 'node',
'rootId': self.project._id
}, auth=self.user.auth)
self.user.reload()
user_timestamp = self.user.comments_viewed_timestamp[self.project._id]
view_timestamp = dt.datetime.utcnow()
assert_datetime_equal(user_timestamp, view_timestamp)
def test_confirm_non_contrib_viewers_dont_have_pid_in_comments_view_timestamp(self):
non_contributor = AuthUserFactory()
url = self.project.api_url_for('update_comments_timestamp')
res = self.app.put_json(url, {
'page': 'node',
'rootId': self.project._id
}, auth=self.user.auth)
non_contributor.reload()
assert_not_in(self.project._id, non_contributor.comments_viewed_timestamp)
def test_view_comments_updates_user_comments_view_timestamp_files(self):
osfstorage = self.project.get_addon('osfstorage')
root_node = osfstorage.get_root()
test_file = root_node.append_file('test_file')
test_file.create_version(self.user, {
'object': '06d80e',
'service': 'cloud',
osfstorage_settings.WATERBUTLER_RESOURCE: 'osf',
}, {
'size': 1337,
'contentType': 'img/png'
}).save()
url = self.project.api_url_for('update_comments_timestamp')
res = self.app.put_json(url, {
'page': 'files',
'rootId': test_file._id
}, auth=self.user.auth)
self.user.reload()
user_timestamp = self.user.comments_viewed_timestamp[test_file._id]
view_timestamp = dt.datetime.utcnow()
assert_datetime_equal(user_timestamp, view_timestamp)
class TestCommentModel(OsfTestCase):
def setUp(self):
super(TestCommentModel, self).setUp()
self.comment = CommentFactory()
self.auth = Auth(user=self.comment.user)
def test_create(self):
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
root_target=self.comment.root_target,
page='node',
is_public=True,
content='This is a comment.'
)
assert_equal(comment.user, self.comment.user)
assert_equal(comment.node, self.comment.node)
assert_equal(comment.target, self.comment.target)
assert_equal(len(comment.node.logs), 2)
assert_equal(comment.node.logs[-1].action, NodeLog.COMMENT_ADDED)
assert_equal([], self.comment.ever_mentioned)
def test_create_comment_content_cannot_exceed_max_length_simple(self):
with assert_raises(ValidationValueError):
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
is_public=True,
content=''.join(['c' for c in range(settings.COMMENT_MAXLENGTH + 3)])
)
def test_create_comment_content_cannot_exceed_max_length_complex(self):
with assert_raises(ValidationValueError):
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
is_public=True,
content=''.join(['c' for c in range(settings.COMMENT_MAXLENGTH - 8)]) + '[@George Ant](http://localhost:5000/' + self.comment.user._id + '/)'
)
def test_create_comment_content_does_not_exceed_max_length_complex(self):
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
is_public=True,
content=''.join(['c' for c in range(settings.COMMENT_MAXLENGTH - 12)]) + '[@George Ant](http://localhost:5000/' + self.comment.user._id + '/)'
)
def test_create_comment_content_cannot_be_none(self):
with assert_raises(ValidationError) as error:
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
is_public=True,
content=None
)
assert_equal(error.exception.message, 'Value <content> is required.')
def test_create_comment_content_cannot_be_empty(self):
with assert_raises(ValidationValueError) as error:
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
is_public=True,
content=''
)
assert_equal(error.exception.message, 'Value must not be empty.')
def test_create_comment_content_cannot_be_whitespace(self):
with assert_raises(ValidationValueError) as error:
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
is_public=True,
content=' '
)
assert_equal(error.exception.message, 'Value must not be empty.')
def test_create_sends_comment_added_signal(self):
with capture_signals() as mock_signals:
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
root_target=self.comment.root_target,
is_public=True,
content='This is a comment.'
)
assert_equal(mock_signals.signals_sent(), set([comment_added]))
def test_create_sends_mention_added_signal_if_mentions(self):
with capture_signals() as mock_signals:
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
is_public=True,
content='This is a comment with a bad mention [@Unconfirmed User](http://localhost:5000/' + self.comment.user._id + '/).'
)
assert_equal(mock_signals.signals_sent(), set([comment_added, mention_added]))
def test_create_does_not_send_mention_added_signal_if_unconfirmed_contributor_mentioned(self):
with assert_raises(ValidationValueError) as error:
with capture_signals() as mock_signals:
user = UserFactory()
user.is_registered = False
user.is_claimed = False
user.save()
self.comment.node.add_contributor(user, visible=False,permissions=[permissions.READ])
self.comment.node.save()
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
is_public=True,
content='This is a comment with a bad mention [@Unconfirmed User](http://localhost:5000/' + user._id + '/).'
)
assert_equal(mock_signals.signals_sent(), set([contributor_added]))
assert_equal(error.exception.message, 'User does not exist or is not active.')
def test_create_does_not_send_mention_added_signal_if_noncontributor_mentioned(self):
with assert_raises(ValidationValueError) as error:
with capture_signals() as mock_signals:
user = UserFactory()
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
is_public=True,
content='This is a comment with a bad mention [@Non-contributor User](http://localhost:5000/' + user._id + '/).'
)
assert_equal(mock_signals.signals_sent(), set([]))
assert_equal(error.exception.message, 'Mentioned user is not a contributor.')
def test_create_does_not_send_mention_added_signal_if_nonuser_mentioned(self):
with assert_raises(ValidationValueError) as error:
with capture_signals() as mock_signals:
comment = Comment.create(
auth=self.auth,
user=self.comment.user,
node=self.comment.node,
target=self.comment.target,
is_public=True,
content='This is a comment with a bad mention [@Not a User](http://localhost:5000/qwert/).'
)
assert_equal(mock_signals.signals_sent(), set([]))
assert_equal(error.exception.message, 'User does not exist or is not active.')
def test_edit(self):
self.comment.edit(
auth=self.auth,
content='edited',
save=True
)
assert_equal(self.comment.content, 'edited')
assert_true(self.comment.modified)
assert_equal(len(self.comment.node.logs), 2)
assert_equal(self.comment.node.logs[-1].action, NodeLog.COMMENT_UPDATED)
def test_edit_sends_mention_added_signal_if_mentions(self):
with capture_signals() as mock_signals:
self.comment.edit(
auth=self.auth,
content='This is a comment with a bad mention [@Mentioned User](http://localhost:5000/' + self.comment.user._id + '/).',
save=True
)
assert_equal(mock_signals.signals_sent(), set([mention_added]))
def test_edit_does_not_send_mention_added_signal_if_nonuser_mentioned(self):
with assert_raises(ValidationValueError) as error:
with capture_signals() as mock_signals:
self.comment.edit(
auth=self.auth,
content='This is a comment with a bad mention [@Not a User](http://localhost:5000/qwert/).',
save=True
)
assert_equal(mock_signals.signals_sent(), set([]))
assert_equal(error.exception.message, 'User does not exist or is not active.')
def test_edit_does_not_send_mention_added_signal_if_noncontributor_mentioned(self):
with assert_raises(ValidationValueError) as error:
with capture_signals() as mock_signals:
user = UserFactory()
self.comment.edit(
auth=self.auth,
content='This is a comment with a bad mention [@Non-contributor User](http://localhost:5000/' + user._id + '/).',
save=True
)
assert_equal(mock_signals.signals_sent(), set([]))
assert_equal(error.exception.message, 'Mentioned user is not a contributor.')
def test_edit_does_not_send_mention_added_signal_if_unconfirmed_contributor_mentioned(self):
with assert_raises(ValidationValueError) as error:
with capture_signals() as mock_signals:
user = UserFactory()
user.is_registered = False
user.is_claimed = False
user.save()
self.comment.node.add_contributor(user, visible=False,permissions=[permissions.READ])
self.comment.node.save()
self.comment.edit(
auth=self.auth,
content='This is a comment with a bad mention [@Unconfirmed User](http://localhost:5000/' + user._id + '/).',
save=True
)
assert_equal(mock_signals.signals_sent(), set([contributor_added]))
assert_equal(error.exception.message, 'User does not exist or is not active.')
def test_edit_does_not_send_mention_added_signal_if_already_mentioned(self):
with capture_signals() as mock_signals:
self.comment.ever_mentioned=[self.comment.user._id]
self.comment.edit(
auth=self.auth,
content='This is a comment with a bad mention [@Already Mentioned User](http://localhost:5000/' + self.comment.user._id + '/).',
save=True
)
assert_equal(mock_signals.signals_sent(), set([]))
def test_delete(self):
self.comment.delete(auth=self.auth, save=True)
assert_equal(self.comment.is_deleted, True)
assert_equal(len(self.comment.node.logs), 2)
assert_equal(self.comment.node.logs[-1].action, NodeLog.COMMENT_REMOVED)
def test_undelete(self):
self.comment.delete(auth=self.auth, save=True)
self.comment.undelete(auth=self.auth, save=True)
assert_equal(self.comment.is_deleted, False)
assert_equal(len(self.comment.node.logs), 3)
assert_equal(self.comment.node.logs[-1].action, NodeLog.COMMENT_RESTORED)
def test_read_permission_contributor_can_comment(self):
project = ProjectFactory()
user = UserFactory()
project.set_privacy('private')
project.add_contributor(user, permissions=[permissions.READ])
project.save()
assert_true(project.can_comment(Auth(user=user)))
def test_get_content_for_not_deleted_comment(self):
project = ProjectFactory(is_public=True)
comment = CommentFactory(node=project)
content = comment.get_content(auth=Auth(comment.user))
assert_equal(content, comment.content)
def test_get_content_returns_deleted_content_to_commenter(self):
comment = CommentFactory(is_deleted=True)
content = comment.get_content(auth=Auth(comment.user))
assert_equal(content, comment.content)
def test_get_content_does_not_return_deleted_content_to_non_commenter(self):
user = AuthUserFactory()
comment = CommentFactory(is_deleted=True)
content = comment.get_content(auth=Auth(user))
assert_is_none(content)
def test_get_content_public_project_does_not_return_deleted_content_to_logged_out_user(self):
project = ProjectFactory(is_public=True)
comment = CommentFactory(node=project, is_deleted=True)
content = comment.get_content(auth=None)
assert_is_none(content)
def test_get_content_private_project_throws_permissions_error_for_logged_out_users(self):
project = ProjectFactory(is_public=False)
comment = CommentFactory(node=project, is_deleted=True)
with assert_raises(PermissionsError):
comment.get_content(auth=None)
def test_find_unread_is_zero_when_no_comments(self):
n_unread = Comment.find_n_unread(user=UserFactory(), node=ProjectFactory(), page='node')
assert_equal(n_unread, 0)
def test_find_unread_new_comments(self):
project = ProjectFactory()
user = UserFactory()
project.add_contributor(user)
project.save()
comment = CommentFactory(node=project, user=project.creator)
n_unread = Comment.find_n_unread(user=user, node=project, page='node')
assert_equal(n_unread, 1)
def test_find_unread_includes_comment_replies(self):
project = ProjectFactory()
user = UserFactory()
project.add_contributor(user)
project.save()
comment = CommentFactory(node=project, user=user)
reply = CommentFactory(node=project, target=Guid.load(comment._id), user=project.creator)
n_unread = Comment.find_n_unread(user=user, node=project, page='node')
assert_equal(n_unread, 1)
# Regression test for https://openscience.atlassian.net/browse/OSF-5193
def test_find_unread_includes_edited_comments(self):
project = ProjectFactory()
user = AuthUserFactory()
project.add_contributor(user)
project.save()
comment = CommentFactory(node=project, user=project.creator)
url = project.api_url_for('update_comments_timestamp')
payload = {'page': 'node', 'rootId': project._id}
res = self.app.put_json(url, payload, auth=user.auth)
user.reload()
n_unread = Comment.find_n_unread(user=user, node=project, page='node')
assert_equal(n_unread, 0)
# Edit previously read comment
comment.edit(
auth=Auth(project.creator),
content='edited',
save=True
)
n_unread = Comment.find_n_unread(user=user, node=project, page='node')
assert_equal(n_unread, 1)
def test_find_unread_does_not_include_deleted_comments(self):
project = ProjectFactory()
user = AuthUserFactory()
project.add_contributor(user)
project.save()
comment = CommentFactory(node=project, user=project.creator, is_deleted=True)
n_unread = Comment.find_n_unread(user=user, node=project, page='node')
assert_equal(n_unread, 0)
class FileCommentMoveRenameTestMixin(object):
# TODO: Remove skip decorators when waterbutler returns a consistently formatted payload
# for intra-provider folder moves and renames.
id_based_providers = ['osfstorage']
@property
def provider(self):
raise NotImplementedError
@property
def ProviderFile(self):
raise NotImplementedError
@classmethod
def _format_path(cls, path, file_id=None):
return path
def setUp(self):
super(FileCommentMoveRenameTestMixin, self).setUp()
self.user = UserFactory()
self.project = ProjectFactory(creator=self.user)
self.project.add_addon(self.provider, auth=Auth(self.user))
self.project.save()
self.project_settings = self.project.get_addon(self.provider)
self.project_settings.folder = '/Folder1'
self.project_settings.save()
self.component = NodeFactory(parent=self.project, creator=self.user)
self.component.add_addon(self.provider, auth=Auth(self.user))
self.component.save()
self.component_settings = self.component.get_addon(self.provider)
self.component_settings.folder = '/Folder2'
self.component_settings.save()
def _create_source_payload(self, path, node, provider, file_id=None):
return OrderedDict([('materialized', path),
('name', path.split('/')[-1]),
('nid', node._id),
('path', self._format_path(path, file_id)),
('provider', provider),
('url', '/project/{}/files/{}/{}/'.format(node._id, provider, path.strip('/'))),
('node', {'url': '/{}/'.format(node._id), '_id': node._id, 'title': node.title}),
('addon', provider)])
def _create_destination_payload(self, path, node, provider, file_id, children=None):
destination_path = PROVIDER_CLASS.get(provider)._format_path(path=path, file_id=file_id)
destination = OrderedDict([('contentType', ''),
('etag', 'abcdefghijklmnop'),
('extra', OrderedDict([('revisionId', '12345678910')])),
('kind', 'file'),
('materialized', path),
('modified', 'Tue, 02 Feb 2016 17:55:48 +0000'),
('name', path.split('/')[-1]),
('nid', node._id),
('path', destination_path),
('provider', provider),
('size', 1000),
('url', '/project/{}/files/{}/{}/'.format(node._id, provider, path.strip('/'))),
('node', {'url': '/{}/'.format(node._id), '_id': node._id, 'title': node.title}),
('addon', provider)])
if children:
destination_children = [self._create_destination_payload(child['path'], child['node'], child['provider'], file_id) for child in children]
destination.update({'children': destination_children})
return destination
def _create_payload(self, action, user, source, destination, file_id, destination_file_id=None):
return OrderedDict([
('action', action),
('auth', OrderedDict([('email', user.username), ('id', user._id), ('name', user.fullname)])),
('destination', self._create_destination_payload(path=destination['path'],
node=destination['node'],
provider=destination['provider'],
file_id=destination_file_id or file_id,
children=destination.get('children', []))),
('source', self._create_source_payload(source['path'], source['node'], source['provider'], file_id=file_id)),
('time', 100000000),
('node', source['node']),
('project', None)
])
def _create_file_with_comment(self, node, path):
self.file = self.ProviderFile.create(
is_file=True,
node=node,
path=path,
name=path.strip('/'),
materialized_path=path)
self.guid = self.file.get_guid(create=True)
self.file.save()
self.comment = CommentFactory(user=self.user, node=node, target=self.guid)
def test_comments_move_on_file_rename(self):
source = {
'path': '/file.txt',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/file_renamed.txt',
'node': self.project,
'provider': self.provider
}
self._create_file_with_comment(node=source['node'], path=source['path'])
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_renamed', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path(destination['path'], file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
@unittest.skip
def test_comments_move_on_folder_rename(self):
source = {
'path': '/subfolder1/',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/subfolder2/',
'node': self.project,
'provider': self.provider
}
file_name = 'file.txt'
self._create_file_with_comment(node=source['node'], path='{}{}'.format(source['path'], file_name))
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_renamed', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path('{}{}'.format(destination['path'], file_name), file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
@unittest.skip
def test_comments_move_on_subfolder_file_when_parent_folder_is_renamed(self):
source = {
'path': '/subfolder1/',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/subfolder2/',
'node': self.project,
'provider': self.provider
}
file_path = 'sub-subfolder/file.txt'
self._create_file_with_comment(node=source['node'], path='{}{}'.format(source['path'], file_path))
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_renamed', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path('{}{}'.format(destination['path'], file_path), file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
def test_comments_move_when_file_moved_to_subfolder(self):
source = {
'path': '/file.txt',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/subfolder/file.txt',
'node': self.project,
'provider': self.provider
}
self._create_file_with_comment(node=source['node'], path=source['path'])
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path(destination['path'], file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
def test_comments_move_when_file_moved_from_subfolder_to_root(self):
source = {
'path': '/subfolder/file.txt',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/file.txt',
'node': self.project,
'provider': self.provider
}
self._create_file_with_comment(node=source['node'], path=source['path'])
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path(destination['path'], file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
def test_comments_move_when_file_moved_from_project_to_component(self):
source = {
'path': '/file.txt',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/file.txt',
'node': self.component,
'provider': self.provider
}
self._create_file_with_comment(node=source['node'], path=source['path'])
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path(destination['path'], file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
assert_equal(self.guid.referent.node._id, destination['node']._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
def test_comments_move_when_file_moved_from_component_to_project(self):
source = {
'path': '/file.txt',
'node': self.component,
'provider': self.provider
}
destination = {
'path': '/file.txt',
'node': self.project,
'provider': self.provider
}
self._create_file_with_comment(node=source['node'], path=source['path'])
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path(destination['path'], file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
assert_equal(self.guid.referent.node._id, destination['node']._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
@unittest.skip
def test_comments_move_when_folder_moved_to_subfolder(self):
source = {
'path': '/subfolder/',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/subfolder2/subfolder/',
'node': self.project,
'provider': self.provider
}
file_name = 'file.txt'
self._create_file_with_comment(node=source['node'], path='{}{}'.format(source['path'], file_name))
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path('{}{}'.format(destination['path'], file_name), file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
@unittest.skip
def test_comments_move_when_folder_moved_from_subfolder_to_root(self):
source = {
'path': '/subfolder2/subfolder/',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/subfolder/',
'node': self.project,
'provider': self.provider
}
file_name = 'file.txt'
self._create_file_with_comment(node=source['node'], path='{}{}'.format(source['path'], file_name))
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path('{}{}'.format(destination['path'], file_name), file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
@unittest.skip
def test_comments_move_when_folder_moved_from_project_to_component(self):
source = {
'path': '/subfolder/',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/subfolder/',
'node': self.component,
'provider': self.provider
}
file_name = 'file.txt'
self._create_file_with_comment(node=source['node'], path='{}{}'.format(source['path'], file_name))
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path('{}{}'.format(destination['path'], file_name), file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
@unittest.skip
def test_comments_move_when_folder_moved_from_component_to_project(self):
source = {
'path': '/subfolder/',
'node': self.component,
'provider': self.provider
}
destination = {
'path': '/subfolder/',
'node': self.project,
'provider': self.provider
}
file_name = 'file.txt'
self._create_file_with_comment(node=source['node'], path='{}{}'.format(source['path'], file_name))
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path('{}{}'.format(destination['path'], file_name), file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
def test_comments_move_when_file_moved_to_osfstorage(self):
osfstorage = self.project.get_addon('osfstorage')
root_node = osfstorage.get_root()
osf_file = root_node.append_file('file.txt')
osf_file.create_version(self.user, {
'object': '06d80e',
'service': 'cloud',
osfstorage_settings.WATERBUTLER_RESOURCE: 'osf',
}, {
'size': 1337,
'contentType': 'img/png',
'etag': 'abcdefghijklmnop'
}).save()
source = {
'path': '/file.txt',
'node': self.project,
'provider': self.provider
}
destination = {
'path': osf_file.path,
'node': self.project,
'provider': 'osfstorage'
}
self._create_file_with_comment(node=source['node'], path=source['path'])
payload = self._create_payload('move', self.user, source, destination, self.file._id, destination_file_id=destination['path'].strip('/'))
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class('osfstorage', FileNode.FILE).get_or_create(destination['node'], destination['path'])
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
def test_comments_move_when_folder_moved_to_osfstorage(self):
osfstorage = self.project.get_addon('osfstorage')
root_node = osfstorage.get_root()
osf_folder = root_node.append_folder('subfolder')
osf_file = osf_folder.append_file('file.txt')
osf_file.create_version(self.user, {
'object': '06d80e',
'service': 'cloud',
osfstorage_settings.WATERBUTLER_RESOURCE: 'osf',
}, {
'size': 1337,
'contentType': 'img/png',
'etag': '1234567890abcde'
}).save()
source = {
'path': '/subfolder/',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/subfolder/',
'node': self.project,
'provider': 'osfstorage',
'children': [{
'path': '/subfolder/file.txt',
'node': self.project,
'provider': 'osfstorage'
}]
}
file_name = 'file.txt'
self._create_file_with_comment(node=source['node'], path='{}{}'.format(source['path'], file_name))
payload = self._create_payload('move', self.user, source, destination, self.file._id, destination_file_id=osf_file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class('osfstorage', FileNode.FILE).get_or_create(destination['node'], osf_file._id)
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
@parameterized.expand([('box', '/1234567890'), ('dropbox', '/file.txt'), ('github', '/file.txt'), ('googledrive', '/file.txt'), ('s3', '/file.txt'),])
def test_comments_move_when_file_moved_to_different_provider(self, destination_provider, destination_path):
if self.provider == destination_provider:
return True
self.project.add_addon(destination_provider, auth=Auth(self.user))
self.project.save()
self.addon_settings = self.project.get_addon(destination_provider)
self.addon_settings.folder = '/AddonFolder'
self.addon_settings.save()
source = {
'path': '/file.txt',
'node': self.project,
'provider': self.provider
}
destination = {
'path': destination_path,
'node': self.project,
'provider': destination_provider
}
self._create_file_with_comment(node=source['node'], path=source['path'])
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(destination_provider, FileNode.FILE).get_or_create(destination['node'], destination['path'])
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
@parameterized.expand([('box', '/1234567890'), ('dropbox', '/subfolder/file.txt'), ('github', '/subfolder/file.txt'), ('googledrive', '/subfolder/file.txt'), ('s3', '/subfolder/file.txt'),])
def test_comments_move_when_folder_moved_to_different_provider(self, destination_provider, destination_path):
if self.provider == destination_provider:
return True
self.project.add_addon(destination_provider, auth=Auth(self.user))
self.project.save()
self.addon_settings = self.project.get_addon(destination_provider)
self.addon_settings.folder = '/AddonFolder'
self.addon_settings.save()
source = {
'path': '/subfolder/',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/subfolder/',
'node': self.project,
'provider': destination_provider,
'children': [{
'path': '/subfolder/file.txt',
'node': self.project,
'provider': destination_provider
}]
}
file_name = 'file.txt'
self._create_file_with_comment(node=source['node'], path='{}{}'.format(source['path'], file_name))
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(destination_provider, FileNode.FILE).get_or_create(destination['node'], destination_path)
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
class TestOsfstorageFileCommentMoveRename(FileCommentMoveRenameTestMixin, OsfTestCase):
provider = 'osfstorage'
ProviderFile = OsfStorageFile
@classmethod
def _format_path(cls, path, file_id=None):
super(TestOsfstorageFileCommentMoveRename, cls)._format_path(path)
return '/{}{}'.format(file_id, ('/' if path.endswith('/') else ''))
def _create_file_with_comment(self, node, path):
osfstorage = node.get_addon(self.provider)
root_node = osfstorage.get_root()
self.file = root_node.append_file('file.txt')
self.file.create_version(self.user, {
'object': '06d80e',
'service': 'cloud',
osfstorage_settings.WATERBUTLER_RESOURCE: 'osf',
}, {
'size': 1337,
'contentType': 'img/png',
'etag': 'abcdefghijklmnop'
}).save()
self.file.materialized_path = path
self.guid = self.file.get_guid(create=True)
self.comment = CommentFactory(user=self.user, node=node, target=self.guid)
def test_comments_move_when_file_moved_from_project_to_component(self):
source = {
'path': '/file.txt',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/file.txt',
'node': self.component,
'provider': self.provider
}
self._create_file_with_comment(node=source['node'], path=source['path'])
self.file.move_under(destination['node'].get_addon(self.provider).get_root())
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path(destination['path'], file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
assert_equal(self.guid.referent.node._id, destination['node']._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
def test_comments_move_when_file_moved_from_component_to_project(self):
source = {
'path': '/file.txt',
'node': self.component,
'provider': self.provider
}
destination = {
'path': '/file.txt',
'node': self.project,
'provider': self.provider
}
self._create_file_with_comment(node=source['node'], path=source['path'])
self.file.move_under(destination['node'].get_addon(self.provider).get_root())
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path(destination['path'], file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
assert_equal(self.guid.referent.node._id, destination['node']._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
def test_comments_move_when_folder_moved_from_project_to_component(self):
source = {
'path': '/subfolder/',
'node': self.project,
'provider': self.provider
}
destination = {
'path': '/subfolder/',
'node': self.component,
'provider': self.provider
}
file_name = 'file.txt'
self._create_file_with_comment(node=source['node'], path='{}{}'.format(source['path'], file_name))
self.file.move_under(destination['node'].get_addon(self.provider).get_root())
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path('{}{}'.format(destination['path'], file_name), file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
def test_comments_move_when_folder_moved_from_component_to_project(self):
source = {
'path': '/subfolder/',
'node': self.component,
'provider': self.provider
}
destination = {
'path': '/subfolder/',
'node': self.project,
'provider': self.provider
}
file_name = 'file.txt'
self._create_file_with_comment(node=source['node'], path='{}{}'.format(source['path'], file_name))
self.file.move_under(destination['node'].get_addon(self.provider).get_root())
payload = self._create_payload('move', self.user, source, destination, self.file._id)
update_file_guid_referent(self=None, node=destination['node'], event_type='addon_file_moved', payload=payload)
self.guid.reload()
file_node = FileNode.resolve_class(self.provider, FileNode.FILE).get_or_create(destination['node'], self._format_path('{}{}'.format(destination['path'], file_name), file_id=self.file._id))
assert_equal(self.guid._id, file_node.get_guid()._id)
file_comments = Comment.find(Q('root_target', 'eq', self.guid._id))
assert_equal(file_comments.count(), 1)
@unittest.skip
def test_comments_move_when_file_moved_to_osfstorage(self):
super(TestOsfstorageFileCommentMoveRename, self).test_comments_move_when_file_moved_to_osfstorage()
@unittest.skip
def test_comments_move_when_folder_moved_to_osfstorage(self):
super(TestOsfstorageFileCommentMoveRename, self).test_comments_move_when_folder_moved_to_osfstorage()
class TestBoxFileCommentMoveRename(FileCommentMoveRenameTestMixin, OsfTestCase):
provider = 'box'
ProviderFile = BoxFile
def _create_file_with_comment(self, node, path):
self.file = self.ProviderFile.create(
is_file=True,
node=node,
path=self._format_path(path),
name=path.strip('/'),
materialized_path=path)
self.guid = self.file.get_guid(create=True)
self.file.save()
self.comment = CommentFactory(user=self.user, node=node, target=self.guid)
@classmethod
def _format_path(cls, path, file_id=None):
super(TestBoxFileCommentMoveRename, cls)._format_path(path)
return '/9876543210/' if path.endswith('/') else '/1234567890'
class TestDropboxFileCommentMoveRename(FileCommentMoveRenameTestMixin, OsfTestCase):
provider = 'dropbox'
ProviderFile = DropboxFile
def _create_file_with_comment(self, node, path):
self.file = self.ProviderFile.create(
is_file=True,
node=node,
path='{}{}'.format(node.get_addon(self.provider).folder, path),
name=path.strip('/'),
materialized_path=path)
self.guid = self.file.get_guid(create=True)
self.file.save()
self.comment = CommentFactory(user=self.user, node=node, target=self.guid)
class TestGoogleDriveFileCommentMoveRename(FileCommentMoveRenameTestMixin, OsfTestCase):
provider = 'googledrive'
ProviderFile = GoogleDriveFile
class TestGithubFileCommentMoveRename(FileCommentMoveRenameTestMixin, OsfTestCase):
provider = 'github'
ProviderFile = GithubFile
class TestS3FileCommentMoveRename(FileCommentMoveRenameTestMixin, OsfTestCase):
provider = 's3'
ProviderFile = S3File
PROVIDER_CLASS = {
'osfstorage': TestOsfstorageFileCommentMoveRename,
'box': TestBoxFileCommentMoveRename,
'dropbox': TestDropboxFileCommentMoveRename,
'github': TestGithubFileCommentMoveRename,
'googledrive': TestGoogleDriveFileCommentMoveRename,
's3': TestS3FileCommentMoveRename
}
| 45.131485 | 196 | 0.632281 | 5,670 | 50,457 | 5.361376 | 0.056966 | 0.030396 | 0.017961 | 0.024211 | 0.809204 | 0.789533 | 0.774894 | 0.760782 | 0.748808 | 0.730485 | 0 | 0.005952 | 0.244089 | 50,457 | 1,117 | 197 | 45.171889 | 0.791065 | 0.004915 | 0 | 0.678608 | 0 | 0.002047 | 0.09611 | 0.004263 | 0 | 0 | 0 | 0.000895 | 0.106448 | 1 | 0.071648 | false | 0 | 0.026612 | 0.003071 | 0.128966 | 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 |
269cb5c8215b29801236cfa5b2371aeec9fd7fbd | 126 | py | Python | pico_ir/__init__.py | bartoszadamczyk/pico-ir | 13cd0fd9ebc689d42e49a5be91370a64455c1e33 | [
"MIT"
] | null | null | null | pico_ir/__init__.py | bartoszadamczyk/pico-ir | 13cd0fd9ebc689d42e49a5be91370a64455c1e33 | [
"MIT"
] | null | null | null | pico_ir/__init__.py | bartoszadamczyk/pico-ir | 13cd0fd9ebc689d42e49a5be91370a64455c1e33 | [
"MIT"
] | 1 | 2022-01-16T14:57:27.000Z | 2022-01-16T14:57:27.000Z | from read_code import read_code
from send_code import send_code
from validate_code import validate_code, InvalidCodeException
| 31.5 | 61 | 0.888889 | 19 | 126 | 5.578947 | 0.368421 | 0.283019 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.103175 | 126 | 3 | 62 | 42 | 0.938053 | 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 |
269d22e606f6f1ff872881009cc86c4b0b1c692e | 31 | py | Python | package-files/simple_icd_10_CM/__init__.py | StefanoTrv/simple_icd_10-CM | e6d35afe7e034564fc5317a3dd92244a32d2b57a | [
"MIT"
] | 6 | 2021-05-28T20:20:49.000Z | 2022-03-01T22:43:16.000Z | package-files/simple_icd_10_CM/__init__.py | StefanoTrv/simple_icd_10_CM | e6d35afe7e034564fc5317a3dd92244a32d2b57a | [
"MIT"
] | null | null | null | package-files/simple_icd_10_CM/__init__.py | StefanoTrv/simple_icd_10_CM | e6d35afe7e034564fc5317a3dd92244a32d2b57a | [
"MIT"
] | null | null | null | from .simple_icd_10_cm import * | 31 | 31 | 0.83871 | 6 | 31 | 3.833333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071429 | 0.096774 | 31 | 1 | 31 | 31 | 0.75 | 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 |
26bd65f0ee528060a26704e5ddc0afac9cd0e10e | 156 | py | Python | brainstorming/brainstorming/doctype/website_certificate/test_website_certificate.py | dokos-io/brainstorming | cadb9e090489d13f7b7bc6a33f84b1b7a3e4048d | [
"MIT"
] | null | null | null | brainstorming/brainstorming/doctype/website_certificate/test_website_certificate.py | dokos-io/brainstorming | cadb9e090489d13f7b7bc6a33f84b1b7a3e4048d | [
"MIT"
] | null | null | null | brainstorming/brainstorming/doctype/website_certificate/test_website_certificate.py | dokos-io/brainstorming | cadb9e090489d13f7b7bc6a33f84b1b7a3e4048d | [
"MIT"
] | null | null | null | # Copyright (c) 2022, Dokos SAS and Contributors
# See license.txt
# import frappe
import unittest
class TestWebsiteCertificate(unittest.TestCase):
pass
| 17.333333 | 48 | 0.788462 | 19 | 156 | 6.473684 | 0.894737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029851 | 0.141026 | 156 | 8 | 49 | 19.5 | 0.88806 | 0.487179 | 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 |
26dd765f8c7a723e02d5d493b6e5b3a7c530df03 | 69 | py | Python | data/db_models/__all_models.py | ZyMa-1/Offnline-judge | 29734c36f8e3c82ad37b43e2034bb5b44c296cb5 | [
"MIT"
] | 1 | 2020-05-03T16:34:20.000Z | 2020-05-03T16:34:20.000Z | data/db_models/__all_models.py | ZyMa-1/web_project | 29734c36f8e3c82ad37b43e2034bb5b44c296cb5 | [
"MIT"
] | 2 | 2021-09-08T01:58:17.000Z | 2022-03-12T00:27:42.000Z | data/db_models/__all_models.py | ZyMa-1/Offnline-judge | 29734c36f8e3c82ad37b43e2034bb5b44c296cb5 | [
"MIT"
] | null | null | null | from . import submissions
from . import problems
from . import users
| 17.25 | 25 | 0.782609 | 9 | 69 | 6 | 0.555556 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 69 | 3 | 26 | 23 | 0.947368 | 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 |
f81d4b4a5c3ac31b8038afe9ef629a82ed5790ef | 93 | py | Python | ddq/fol/semantics/algorithms.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | null | null | null | ddq/fol/semantics/algorithms.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | 6 | 2021-03-19T12:06:56.000Z | 2022-03-12T00:23:09.000Z | ddq/fol/semantics/algorithms.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | null | null | null | from .thing import Thing
def recurse_find_thing(root: Thing, search_item: Thing):
pass
| 15.5 | 56 | 0.752688 | 14 | 93 | 4.785714 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172043 | 93 | 5 | 57 | 18.6 | 0.87013 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 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 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 6 |
f83206d899991cbe9e049d8e7cf1937a5376f3be | 2,810 | py | Python | testing/data_validation/transform-interaction-operator.py | kottmanj/z-quantum-core | 21752e92e79aafedbfeb6e7ae196bdc2fd5803e4 | [
"Apache-2.0"
] | 6 | 2020-05-08T15:27:32.000Z | 2021-11-17T11:37:54.000Z | testing/data_validation/transform-interaction-operator.py | kottmanj/z-quantum-core | 21752e92e79aafedbfeb6e7ae196bdc2fd5803e4 | [
"Apache-2.0"
] | 5 | 2020-04-29T00:35:46.000Z | 2020-05-27T21:11:08.000Z | testing/data_validation/transform-interaction-operator.py | kottmanj/z-quantum-core | 21752e92e79aafedbfeb6e7ae196bdc2fd5803e4 | [
"Apache-2.0"
] | 1 | 2021-01-15T23:05:09.000Z | 2021-01-15T23:05:09.000Z | import json
import sys
with open(sys.argv[1], "r") as f:
workflowresult = json.loads(f.read())
assert len(workflowresult.keys()) == 2
found_template = False
for key in workflowresult.keys():
if workflowresult[key]["class"] == "transform-interaction-operator":
found_template = True
assert workflowresult[key]["inputParam:transformation"] == "Jordan-Wigner"
assert workflowresult[key]["timing"]["schema"] == "zapata-v1-timing"
assert workflowresult[key]["timing"]["walltime"] > 0.
assert workflowresult[key]["transformed-op"]["schema"] == "zapata-v1-qubit_op"
assert len(workflowresult[key]["transformed-op"]["terms"]) == 5
assert workflowresult[key]["transformed-op"]["terms"][0]["coefficient"]["real"] == 2
assert workflowresult[key]["transformed-op"]["terms"][0]["coefficient"]["imag"] == 0
assert workflowresult[key]["transformed-op"]["terms"][1]["coefficient"]["real"] == -0.5
assert workflowresult[key]["transformed-op"]["terms"][1]["coefficient"]["imag"] == 0
assert len(workflowresult[key]["transformed-op"]["terms"][1]["pauli_ops"]) == 1
assert workflowresult[key]["transformed-op"]["terms"][1]["pauli_ops"][0]["op"] == "Z"
assert workflowresult[key]["transformed-op"]["terms"][1]["pauli_ops"][0]["qubit"] == 0
assert workflowresult[key]["transformed-op"]["terms"][2]["coefficient"]["real"] == -0.5
assert workflowresult[key]["transformed-op"]["terms"][2]["coefficient"]["imag"] == 0
assert len(workflowresult[key]["transformed-op"]["terms"][2]["pauli_ops"]) == 1
assert workflowresult[key]["transformed-op"]["terms"][2]["pauli_ops"][0]["op"] == "Z"
assert workflowresult[key]["transformed-op"]["terms"][2]["pauli_ops"][0]["qubit"] == 1
assert workflowresult[key]["transformed-op"]["terms"][3]["coefficient"]["real"] == -0.5
assert workflowresult[key]["transformed-op"]["terms"][3]["coefficient"]["imag"] == 0
assert len(workflowresult[key]["transformed-op"]["terms"][3]["pauli_ops"]) == 1
assert workflowresult[key]["transformed-op"]["terms"][3]["pauli_ops"][0]["op"] == "Z"
assert workflowresult[key]["transformed-op"]["terms"][3]["pauli_ops"][0]["qubit"] == 2
assert workflowresult[key]["transformed-op"]["terms"][4]["coefficient"]["real"] == -0.5
assert workflowresult[key]["transformed-op"]["terms"][4]["coefficient"]["imag"] == 0
assert len(workflowresult[key]["transformed-op"]["terms"][4]["pauli_ops"]) == 1
assert workflowresult[key]["transformed-op"]["terms"][4]["pauli_ops"][0]["op"] == "Z"
assert workflowresult[key]["transformed-op"]["terms"][4]["pauli_ops"][0]["qubit"] == 3
assert found_template
print("Workflow result is as expected")
| 56.2 | 95 | 0.62847 | 332 | 2,810 | 5.271084 | 0.171687 | 0.272 | 0.384 | 0.411429 | 0.741143 | 0.741143 | 0.72 | 0.692 | 0.530286 | 0.509714 | 0 | 0.024027 | 0.140925 | 2,810 | 49 | 96 | 57.346939 | 0.700911 | 0 | 0 | 0 | 0 | 0 | 0.324199 | 0.019573 | 0 | 0 | 0 | 0 | 0.763158 | 1 | 0 | false | 0 | 0.052632 | 0 | 0.052632 | 0.026316 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 1 | 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 |
f83fa8c20eaff5630052128e86a847c391d1e380 | 1,711 | py | Python | tests/clean_payload_test.py | bakdata/faust-avro-serializer | 118c7fe14a2893db641332d6bf8f46f3e8c5b603 | [
"MIT"
] | 6 | 2020-07-10T12:29:30.000Z | 2022-03-01T05:41:20.000Z | tests/clean_payload_test.py | bakdata/faust-avro-serializer | 118c7fe14a2893db641332d6bf8f46f3e8c5b603 | [
"MIT"
] | 3 | 2020-07-16T10:03:10.000Z | 2020-09-27T18:59:02.000Z | tests/clean_payload_test.py | bakdata/faust-avro-serializer | 118c7fe14a2893db641332d6bf8f46f3e8c5b603 | [
"MIT"
] | 1 | 2020-07-08T19:06:12.000Z | 2020-07-08T19:06:12.000Z | import typing
from faust import Record
from faust_avro_serializer import FaustAvroSerializer
class DummyRecord(Record):
item: typing.Any
def test_simple_record():
result = {"__faust": {"ns": "tests.clean_payload_test.DummyRecord"}, "item": "test"}
dummy = DummyRecord("test")
assert result == FaustAvroSerializer.clean_payload(dummy)
def test_nested_record():
result = {
"__faust": {"ns": "tests.clean_payload_test.DummyRecord"},
"item": {"__faust": {"ns": "tests.clean_payload_test.DummyRecord"}, "item": "test"},
}
dummy = DummyRecord(DummyRecord("test"))
assert result == FaustAvroSerializer.clean_payload(dummy)
def test_list_of_records():
result = {
"__faust": {"ns": "tests.clean_payload_test.DummyRecord"},
"item": [
{"__faust": {"ns": "tests.clean_payload_test.DummyRecord"}, "item": "test"},
{"__faust": {"ns": "tests.clean_payload_test.DummyRecord"}, "item": "test"},
],
}
dummy = DummyRecord([DummyRecord("test"), DummyRecord("test")])
assert result == FaustAvroSerializer.clean_payload(dummy)
def test_map_of_records():
result = {
"__faust": {"ns": "tests.clean_payload_test.DummyRecord"},
"item": {
"key1": {
"__faust": {"ns": "tests.clean_payload_test.DummyRecord"},
"item": "test",
},
"key2": {
"__faust": {"ns": "tests.clean_payload_test.DummyRecord"},
"item": "test",
},
},
}
dummy = DummyRecord({"key1": DummyRecord("test"), "key2": DummyRecord("test")})
assert result == FaustAvroSerializer.clean_payload(dummy)
| 29 | 92 | 0.602572 | 165 | 1,711 | 5.933333 | 0.175758 | 0.159346 | 0.110317 | 0.156282 | 0.823289 | 0.823289 | 0.823289 | 0.823289 | 0.758938 | 0.71093 | 0 | 0.003051 | 0.233781 | 1,711 | 58 | 93 | 29.5 | 0.743707 | 0 | 0 | 0.380952 | 0 | 0 | 0.295149 | 0.189363 | 0 | 0 | 0 | 0 | 0.095238 | 1 | 0.095238 | false | 0 | 0.071429 | 0 | 0.214286 | 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 |
f89a2fbb6aaccc447e2a1122d9570fe0720a4a85 | 288 | py | Python | Python-For-Everyone-Horstmann/Chapter11-Recursion/recursive_list_sum.py | islayy/Books-solutions | 5fe05deb4e9f65875284d8af43bd383bf9ae145b | [
"MIT"
] | null | null | null | Python-For-Everyone-Horstmann/Chapter11-Recursion/recursive_list_sum.py | islayy/Books-solutions | 5fe05deb4e9f65875284d8af43bd383bf9ae145b | [
"MIT"
] | null | null | null | Python-For-Everyone-Horstmann/Chapter11-Recursion/recursive_list_sum.py | islayy/Books-solutions | 5fe05deb4e9f65875284d8af43bd383bf9ae145b | [
"MIT"
] | 1 | 2021-01-30T22:19:07.000Z | 2021-01-30T22:19:07.000Z | # Recursively calculates the sum of a list's items
# FUNCTIONS
def _sum_helper(given_list, start):
if start == len(given_list):
return 0
return given_list[start] + _sum_helper(given_list, start + 1)
def recursive_sum(given_list):
return _sum_helper(given_list, 0)
| 22.153846 | 65 | 0.71875 | 44 | 288 | 4.409091 | 0.454545 | 0.278351 | 0.216495 | 0.278351 | 0.237113 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012931 | 0.194444 | 288 | 12 | 66 | 24 | 0.823276 | 0.201389 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.166667 | 0.833333 | 0 | 0 | 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 | 1 | 1 | 0 | 0 | 6 |
f8a1772c408a2ab41c090ec8d783d1708b71a5e5 | 191 | py | Python | pytest-ui-tests/pages/main_page.py | jagdeepjain/ski11up.com | 87e007c2d5b8f7e69fb2c1c1f5bfcfda0d3006fd | [
"MIT"
] | null | null | null | pytest-ui-tests/pages/main_page.py | jagdeepjain/ski11up.com | 87e007c2d5b8f7e69fb2c1c1f5bfcfda0d3006fd | [
"MIT"
] | null | null | null | pytest-ui-tests/pages/main_page.py | jagdeepjain/ski11up.com | 87e007c2d5b8f7e69fb2c1c1f5bfcfda0d3006fd | [
"MIT"
] | null | null | null | class MainPage:
url = "https://google.co.in"
def __init__(self, driver):
super().__init__()
self.driver = driver
def go(self):
self.driver.get(self.url)
| 19.1 | 33 | 0.575916 | 24 | 191 | 4.25 | 0.583333 | 0.294118 | 0.27451 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.277487 | 191 | 9 | 34 | 21.222222 | 0.73913 | 0 | 0 | 0 | 0 | 0 | 0.104712 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0 | 0 | 0.571429 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 6 |
6ef6793f3a995778cf65bac3b4d646683ad238f6 | 277 | py | Python | objects/CSCG/_3d/__init__.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | 1 | 2020-10-14T12:48:35.000Z | 2020-10-14T12:48:35.000Z | objects/CSCG/_3d/__init__.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | objects/CSCG/_3d/__init__.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from objects.CSCG._3d.master import MeshGenerator as mesh
from objects.CSCG._3d.master import FormCaller as form
from objects.CSCG._3d.master import SpaceInvoker as space
from objects.CSCG._3d.master import ExactSolutionSelector as exact_solution | 23.083333 | 75 | 0.797834 | 40 | 277 | 5.4 | 0.475 | 0.203704 | 0.277778 | 0.314815 | 0.537037 | 0.537037 | 0 | 0 | 0 | 0 | 0 | 0.020661 | 0.126354 | 277 | 12 | 75 | 23.083333 | 0.871901 | 0.075812 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 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 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
3e11ec2519cb96c05a862ea4691affc2f031360a | 145 | py | Python | tracklib/analysis/__init__.py | SGrosse-Holz/tracklib | e0b88e3959db2ce65869d8292ce5792f4c77c7a4 | [
"MIT"
] | 1 | 2022-01-30T15:10:51.000Z | 2022-01-30T15:10:51.000Z | tracklib/analysis/__init__.py | SGrosse-Holz/tracklib | e0b88e3959db2ce65869d8292ce5792f4c77c7a4 | [
"MIT"
] | null | null | null | tracklib/analysis/__init__.py | SGrosse-Holz/tracklib | e0b88e3959db2ce65869d8292ce5792f4c77c7a4 | [
"MIT"
] | null | null | null | from . import p2
from .p2 import MSD, ACovF, ACorrF, VACorrF, VACovF
from . import chi2
from . import kld
from . import plots
from . import bild
| 20.714286 | 51 | 0.737931 | 23 | 145 | 4.652174 | 0.521739 | 0.46729 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025641 | 0.193103 | 145 | 6 | 52 | 24.166667 | 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 |
3e260fddd3ca08112f5034a3bae770a46f0a5764 | 46,384 | py | Python | variableServer/tests/test_apiView.py | bhecquet/seleniumRobot-server | b5930a21a25d63f2071dd57a55855b62808800d1 | [
"Apache-2.0"
] | null | null | null | variableServer/tests/test_apiView.py | bhecquet/seleniumRobot-server | b5930a21a25d63f2071dd57a55855b62808800d1 | [
"Apache-2.0"
] | 95 | 2017-05-04T09:00:52.000Z | 2022-03-11T23:19:20.000Z | variableServer/tests/test_apiView.py | bhecquet/seleniumRobot-server | b5930a21a25d63f2071dd57a55855b62808800d1 | [
"Apache-2.0"
] | null | null | null |
from django.urls.base import reverse
from variableServer.utils.utils import updateVariables
from variableServer.models import Variable, Version,\
TestEnvironment, TestCase
import time
import datetime
from django.utils import timezone
from variableServer.tests import authenticate_test_client
from rest_framework.test import APITestCase
class TestApiView(APITestCase):
'''
Using APITestCase as we call the REST Framework API
Client handles patch / put cases
'''
fixtures = ['varServer.yaml']
def setUp(self):
authenticate_test_client(self.client)
def test_ping(self):
"""
Check 'ping' api can be called without security token
"""
self.client.credentials()
response = self.client.get(reverse('variablePing'))
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
def test_update_variables(self):
"""
check that updateVariable keeps the variable from additional_query_set parameters when it overrides one from source_query_set
"""
source_query_set = Variable.objects.filter(application=None, version=None, environment=None, test=None)
additional_query_set = Variable.objects.filter(application=None, version=None, environment=1, test=None)
resulting_qs = updateVariables(source_query_set, additional_query_set)
self.assertEqual(resulting_qs.get(name='proxyPassword').value, 'azerty')
def test_several_update_variables(self):
"""
check that several updateVariables calls can be chained
"""
source_query_set = Variable.objects.filter(application=None, version=None, environment=None, test=None)
additional_query_set = Variable.objects.filter(application=None, version=None, environment=1, test=None)
resulting_qs = updateVariables(source_query_set, additional_query_set)
other_query_set = Variable.objects.filter(application=2, version=None, environment=None, test=None)
resulting_qs = updateVariables(resulting_qs, other_query_set)
self.assertEqual(resulting_qs.get(name='proxyPassword').value, 'azerty')
self.assertEqual(resulting_qs.get(name='appName').value, 'myOtherApp')
def _convert_to_dict(self, responseData):
variable_dict = {}
for variable in responseData:
variable_dict[variable['name']] = variable
return variable_dict
def test_get_all_variables_no_security(self):
"""
Check we cannot access API without API token
"""
self.client.credentials()
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 401, 'status code should be 401: ' + str(response.content))
def test_get_all_variables(self):
"""
Check a reference is created when none is found
"""
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
# check filtering is correct. We should not get any variable corresponding to an other environment, test or version
for variable in response.data:
self.assertTrue(variable['environment'] in [1, 3, None], "variable %s should not be get as environment is different from 1, 3 and None" % variable['name'])
self.assertTrue(variable['version'] in [2, None], "variable %s should not be get as version is different from 2 and None" % variable['name'])
self.assertTrue(variable['test'] in [[1], []], "variable %s should not be get as test is different from 1 and []" % variable['name'])
# check we get variables from the generic environment
for variable in response.data:
if variable['name'] == 'logs' and variable['environment'] == 1:
break
else:
self.fail("No variable from generic environment get")
self.assertTrue(len(response.data) > 5)
def test_get_all_variables_with_name(self):
"""
Check we filter variables by name and get only one variable
"""
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1, 'name': 'proxyPassword'})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
# check filtering is correct. We should not get any variable corresponding to an other environment, test or version
for variable in response.data:
self.assertEqual(variable['name'], 'proxyPassword')
self.assertEqual(len(response.data), 1)
def test_get_all_variables_with_value(self):
"""
Check we filter variables by value and get only one variable
"""
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1, 'value': 'logs_dev'})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
# check filtering is correct. We should not get any variable corresponding to an other environment, test or version
for variable in response.data:
self.assertEqual(variable['value'], 'logs_dev')
self.assertEqual(variable['name'], 'logs')
self.assertEqual(len(response.data), 1)
def test_get_all_variables_with_name_and_value(self):
"""
Check we filter variables by value/name and get only one variable
"""
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1, 'name': 'logs', 'value': 'logs_dev'})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
# check filtering is correct. We should not get any variable corresponding to an other environment, test or version
for variable in response.data:
self.assertEqual(variable['value'], 'logs_dev')
self.assertEqual(variable['name'], 'logs')
self.assertEqual(len(response.data), 1)
def test_get_all_variables_with_name_and_value_reserved(self):
"""
Check we filter variables by value/name and get only one variable
"""
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1, 'name': 'login'})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
# check filtering is correct. We should not get any variable corresponding to an other environment, test or version
for variable in response.data:
self.assertEqual(variable['name'], 'login')
self.assertTrue(Variable.objects.get(pk=response.data[0]['id']), "returned variable should be reserved")
def test_get_all_variables_without_test(self):
"""
Check that test parameter is not mandatory
"""
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
# check filtering is correct. We should not get any variable corresponding to an other environment, test or version
for variable in response.data:
self.assertTrue(variable['environment'] in [1, 3, None], "variable %s should not be get as environment is different from 1, 3 and None" % variable['name'])
self.assertTrue(variable['version'] in [2, None], "variable %s should not be get as version is different from 2 and None" % variable['name'])
self.assertTrue(variable['test'] in [[1], []], "variable %s should not be get as test is different from 1 and []" % variable['name'])
# check we get variables from the generic environment
for variable in response.data:
if variable['name'] == 'logs' and variable['environment'] == 1:
break
else:
self.fail("No variable from generic environment get")
def test_get_all_variables_without_environment(self):
"""
Check that environment parameter is mandatory
"""
response = self.client.get(reverse('variableApi'), data={'version': 2, 'test': 1})
self.assertEqual(response.status_code, 400, 'status code should be 400: ' + str(response.content))
def test_get_all_variables_without_version(self):
"""
Check that environment parameter is mandatory
"""
response = self.client.get(reverse('variableApi'), data={'test': 1, 'environment': 3})
self.assertEqual(response.status_code, 400, 'status code should be 400: ' + str(response.content))
def test_get_all_variables_with_text(self):
"""
Check Variables are get when requesting them with environment name, application name, test name, ...
"""
response = self.client.get(reverse('variableApi'), data={'application': 'app1', 'version': '2.5', 'environment': 'DEV1', 'test': 'test1 with some spaces'})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
# check filtering is correct. We should not get any variable corresponding to an other environment, test or version
for variable in response.data:
self.assertTrue(variable['environment'] in [1, 3, None], "variable %s should not be get as environment is different from 1, 3 and None" % variable['name'])
self.assertTrue(variable['version'] in [2, None], "variable %s should not be get as version is different from 2 and None" % variable['name'])
self.assertTrue(variable['test'] in [[1], []], "variable %s should not be get as test is different from 1 and None" % variable['name'])
# check we get variables from the generic environment
for variable in response.data:
if variable['name'] == 'logs' and variable['environment'] == 1:
break
else:
self.fail("No variable from generic environment get");
def test_get_all_variables_with_text_missing_application(self):
"""
Check error is raised when application name is missing (mandatory for finding version from its name)
"""
response = self.client.get(reverse('variableApi'), data={'version': '2.5', 'environment': 'DEV1', 'test': 'test1 with some spaces'})
self.assertEqual(response.status_code, 400, 'status code should be 400: ' + str(response.content))
def test_get_all_variables_with_release_date(self):
"""
Check that release dates are correctly managed
variable is returned if
- releaseDate is None
- releaseDate is in the past (then it should be set to None)
"""
version = Version.objects.get(pk=3)
Variable(name='var0', value='value0', application=version.application, version=version).save()
Variable(name='var1', value='value1', application=version.application, version=version, releaseDate=timezone.now() + datetime.timedelta(seconds=60)).save()
Variable(name='var1', value='value2', application=version.application, version=version, releaseDate=timezone.now() - datetime.timedelta(seconds=60)).save()
response = self.client.get(reverse('variableApi'), data={'version': 3, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
self.assertEqual(1, len([v for v in response.data if v['name'] == 'var1']), "Only one value should be get")
all_variables = self._convert_to_dict(response.data)
# check we only get variable where release date is before now and variables without release date
self.assertTrue('var1' in all_variables) # release date in the past, should be removed
self.assertEqual("value2", all_variables['var1']['value'])
self.assertIsNone(all_variables['var1']['releaseDate']) # release date should be reset
self.assertTrue('var0' in all_variables) # no release date
def test_get_variables_override_global(self):
"""
Check that global variables are overriden by application specific variables
Order is (bottom take precedence):
- global (no app, no env, no version, no test)
- specific to on of the parameter (matching app or matching version or matching env or matching test in this order)
- specific to tuple (application / environment)
- specific to tuple (application / version / environment)
- specific to tuple (application / environment / test)
- specific to tuple (application / version / environment / test)
"""
version = Version.objects.get(pk=3)
Variable(name='var0', value='value0').save()
Variable(name='var0', value='value1', application=version.application).save()
response = self.client.get(reverse('variableApi'), data={'version': version.id, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check overriding of variables
self.assertEqual(all_variables['var0']['value'], 'value1')
def test_get_variables_override_app_specific(self):
"""
Check that application specific variables are overriden by application/version specific
Order is (bottom take precedence):
- global (no app, no env, no version, no test)
- specific to on of the parameter (matching app or matching version or matching env or matching test in this order)
- specific to tuple (application / environment)
- specific to tuple (application / version / environment)
- specific to tuple (application / environment / test)
- specific to tuple (application / version / environment / test)
"""
version = Version.objects.get(pk=3)
Variable(name='var0', value='value0', application=version.application).save()
Variable(name='var0', value='value1', application=version.application, version=version).save()
response = self.client.get(reverse('variableApi'), data={'version': version.id, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check overriding of variables
self.assertEqual(all_variables['var0']['value'], 'value1')
def test_get_variables_override_version_specific(self):
"""
Check that application/version specific variables are overriden by environment specific
Order is (bottom take precedence):
- global (no app, no env, no version, no test)
- specific to on of the parameter (matching app or matching version or matching env or matching test in this order)
- specific to tuple (application / environment)
- specific to tuple (application / version / environment)
- specific to tuple (application / environment / test)
- specific to tuple (application / version / environment / test)
"""
version = Version.objects.get(pk=3)
env = TestEnvironment.objects.get(pk=3)
Variable(name='var0', value='value0', application=version.application, version=version).save()
Variable(name='var0', value='value1', environment=env).save()
response = self.client.get(reverse('variableApi'), data={'version': version.id, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check overriding of variables
self.assertEqual(all_variables['var0']['value'], 'value1')
def test_get_variables_override_generic_environment(self):
"""
Check that application/version specific variables are overriden by environment specific
Order is (bottom take precedence):
- global (no app, no env, no version, no test)
- specific to on of the parameter (matching app or matching version or matching env or matching test in this order)
- specific to tuple (application / environment)
- specific to tuple (application / version / environment)
- specific to tuple (application / environment / test)
- specific to tuple (application / version / environment / test)
"""
version = Version.objects.get(pk=3)
env = TestEnvironment.objects.get(pk=3)
gen_env = TestEnvironment.objects.get(pk=1)
Variable(name='var0', value='value0', environment=gen_env).save()
Variable(name='var0', value='value1', environment=env).save()
response = self.client.get(reverse('variableApi'), data={'version': version.id, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check overriding of variables
self.assertEqual(all_variables['var0']['value'], 'value1')
def test_get_variables_override_multiple_generic_environment(self):
"""
Check that application/version specific variables are overriden by environment specific. Here, we have multiple parents for environment
Order is (bottom take precedence):
- global (no app, no env, no version, no test)
- specific to on of the parameter (matching app or matching version or matching env or matching test in this order)
- specific to tuple (application / environment)
- specific to tuple (application / version / environment)
- specific to tuple (application / environment / test)
- specific to tuple (application / version / environment / test)
"""
version = Version.objects.get(pk=3)
env = TestEnvironment.objects.get(pk=4)
gen_env1 = TestEnvironment.objects.get(pk=3)
gen_env2 = TestEnvironment.objects.get(pk=1)
Variable(name='var0', value='value0', environment=gen_env2).save()
Variable(name='var0', value='value1', environment=gen_env1).save()
Variable(name='var0', value='value2', environment=env).save()
response = self.client.get(reverse('variableApi'), data={'version': version.id, 'environment': 4, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check overriding of variables
self.assertEqual(all_variables['var0']['value'], 'value2')
def test_get_variables_override_multiple_generic_environment2(self):
"""
Check that application/version specific variables are overriden by environment specific. Here, we have multiple parents for environment
Order is (bottom take precedence):
- global (no app, no env, no version, no test)
- specific to on of the parameter (matching app or matching version or matching env or matching test in this order)
- specific to tuple (application / environment)
- specific to tuple (application / version / environment)
- specific to tuple (application / environment / test)
- specific to tuple (application / version / environment / test)
"""
version = Version.objects.get(pk=3)
env = TestEnvironment.objects.get(pk=4)
gen_env1 = TestEnvironment.objects.get(pk=3)
gen_env2 = TestEnvironment.objects.get(pk=1)
Variable(name='var0', value='value0', environment=gen_env2).save()
Variable(name='var0', value='value1', environment=gen_env1).save()
response = self.client.get(reverse('variableApi'), data={'version': version.id, 'environment': 4, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check overriding of variables
self.assertEqual(all_variables['var0']['value'], 'value1')
def test_get_variables_override_environment(self):
"""
Check that environment specific variables are overriden by test specific
Order is (bottom take precedence):
- global (no app, no env, no version, no test)
- specific to on of the parameter (matching app or matching version or matching env or matching test in this order)
- specific to tuple (application / environment)
- specific to tuple (application / version / environment)
- specific to tuple (application / environment / test)
- specific to tuple (application / version / environment / test)
"""
version = Version.objects.get(pk=3)
env = TestEnvironment.objects.get(pk=3)
test = TestCase.objects.get(pk=1)
Variable(name='var0', value='value0', environment=env).save()
var1 = Variable(name='var0', value='value1', application=version.application)
var1.save()
var1.test.add(test)
response = self.client.get(reverse('variableApi'), data={'version': version.id, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check overriding of variables
self.assertEqual(all_variables['var0']['value'], 'value1')
def test_get_variables_override_test(self):
"""
Check that test specific variables are overriden by application/env specific
Order is (bottom take precedence):
- global (no app, no env, no version, no test)
- specific to on of the parameter (matching app or matching version or matching env or matching test in this order)
- specific to tuple (application / environment)
- specific to tuple (application / version / environment)
- specific to tuple (application / environment / test)
- specific to tuple (application / version / environment / test)
"""
version = Version.objects.get(pk=3)
env = TestEnvironment.objects.get(pk=3)
test = TestCase.objects.get(pk=1)
var0 = Variable(name='var0', value='value0')
var0.save()
var0.test.add(test)
Variable(name='var0', value='value1', application=version.application, environment=env).save()
response = self.client.get(reverse('variableApi'), data={'version': version.id, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check overriding of variables
self.assertEqual(all_variables['var0']['value'], 'value1')
def test_get_variables_override_app_env(self):
"""
Check that application/env specific variables are overriden by application/version/env specific
Order is (bottom take precedence):
- global (no app, no env, no version, no test)
- specific to on of the parameter (matching app or matching version or matching env or matching test in this order)
- specific to tuple (application / environment)
- specific to tuple (application / version / environment)
- specific to tuple (application / environment / test)
- specific to tuple (application / version / environment / test)
"""
version = Version.objects.get(pk=3)
env = TestEnvironment.objects.get(pk=3)
Variable(name='var0', value='value0', application=version.application, environment=env).save()
Variable(name='var0', value='value1', application=version.application, version=version, environment=env).save()
response = self.client.get(reverse('variableApi'), data={'version': version.id, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check overriding of variables
self.assertEqual(all_variables['var0']['value'], 'value1')
def test_get_variables_override_app_version_env(self):
"""
Check that application/version/env specific variables are overriden by application/version/env/test specific
Order is (bottom take precedence):
- global (no app, no env, no version, no test)
- specific to on of the parameter (matching app or matching version or matching env or matching test in this order)
- specific to tuple (application / environment)
- specific to tuple (application / version / environment)
- specific to tuple (application / environment / test)
- specific to tuple (application / version / environment / test)
"""
version = Version.objects.get(pk=3)
env = TestEnvironment.objects.get(pk=3)
test = TestCase.objects.get(pk=1)
Variable(name='var0', value='value0', application=version.application, version=version, environment=env).save()
var1 = Variable(name='var0', value='value1', application=version.application, version=version, environment=env)
var1.save()
var1.test.add(test)
response = self.client.get(reverse('variableApi'), data={'version': version.id, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check overriding of variables
self.assertEqual(all_variables['var0']['value'], 'value1')
def test_get_variables_override_app_env_test(self):
"""
Check that application/version/env specific variables are overriden by application/env/test specific
Order is (bottom take precedence):
- global (no app, no env, no version, no test)
- specific to on of the parameter (matching app or matching version or matching env or matching test in this order)
- specific to tuple (application / environment)
- specific to tuple (application / version / environment)
- specific to tuple (application / environment / test)
- specific to tuple (application / version / environment / test)
"""
version = Version.objects.get(pk=3)
env = TestEnvironment.objects.get(pk=3)
test = TestCase.objects.get(pk=1)
Variable(name='var0', value='value0', application=version.application, version=version, environment=env).save()
var1 = Variable(name='var0', value='value1', application=version.application, environment=env)
var1.save()
var1.test.add(test)
response = self.client.get(reverse('variableApi'), data={'version': version.id, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check overriding of variables
self.assertEqual(all_variables['var0']['value'], 'value1')
def test_get_all_variables_with_same_name(self):
"""
Check we get only one value for the variable 'dupVariable'
"""
response = self.client.get(reverse('variableApi'), data={'version': 4, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
self.assertEqual(1, len([v for v in response.data if v['name'] == 'dupVariable']), "Only one value should be get")
all_variables = self._convert_to_dict(response.data)
self.assertIsNone(all_variables['dupVariable']['releaseDate'], 'releaseDate should be null as variable is not reservable')
def test_reserve_variable(self):
"""
Check we get only one value for the variable 'login' and this is marked as reserved (release date not null)
This is the default behaviour when 'reserve' parameter is not given
"""
response = self.client.get(reverse('variableApi'), data={'version': 4, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
self.assertEqual(1, len([v for v in response.data if v['name'] == 'login']), "Only one value should be get")
all_variables = self._convert_to_dict(response.data)
self.assertIsNotNone(all_variables['login']['releaseDate'], 'releaseDate should not be null as variable is reserved')
def test_reserve_variable_with_parameter(self):
"""
Check we get only one value for the variable 'login' and this is marked as reserved (release date not null)
We request to reserve it via 'reserve=True' parameter
"""
response = self.client.get(reverse('variableApi'), data={'version': 4, 'environment': 3, 'test': 1, 'reserve': 'true'})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
self.assertEqual(1, len([v for v in response.data if v['name'] == 'login']), "Only one value should be get")
all_variables = self._convert_to_dict(response.data)
self.assertIsNotNone(all_variables['login']['releaseDate'], 'releaseDate should not be null as variable is reserved')
def test_do_not_reserve_variable(self):
"""
Check we get only one value for the variable 'login' and this is marked not reserved if we request not to reserve it via 'reserve=False' parameter
"""
response = self.client.get(reverse('variableApi'), data={'version': 4, 'environment': 3, 'test': 1, 'reserve': 'false'})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
self.assertEqual(1, len([v for v in response.data if v['name'] == 'login']), "Only one value should be get")
all_variables = self._convert_to_dict(response.data)
self.assertIsNone(all_variables['login']['releaseDate'], 'releaseDate should be null as variable should not be reserved')
def test_reservable_state_correction(self):
"""
Check that when a variable is added with the same characteristics of another, reservable state is set to the newly created variable
"""
version = Version.objects.get(pk=3)
Variable(name='var0', value='value0', application=version.application, reservable=True).save()
response = self.client.post(reverse('variableApi'), data={'name': 'var0', 'value': 'value1', 'application': version.application.id, 'reservable': False})
self.assertEqual(response.status_code, 201, 'status code should be 201: ' + str(response.content))
for v in Variable.objects.filter(name='var0'):
self.assertFalse(v.reservable)
def test_reservable_state_correction_with_test(self):
"""
Check that when a variable is added with the same characteristics of another, reservable state is set to the newly created variable
Check with test as ManyToMany relationship must be treated seperately
"""
test = TestCase.objects.get(pk=1)
version = Version.objects.get(pk=3)
var0 = Variable(name='var0', value='value0', application=version.application, reservable=True)
var0.save()
var0.test.add(test)
response = self.client.post(reverse('variableApi'), data={'name': 'var0', 'value': 'value1', 'application': version.application.id, 'reservable': False, 'test': [1]})
self.assertEqual(response.status_code, 201, 'status code should be 201: ' + str(response.content))
for v in Variable.objects.filter(name='var0'):
self.assertFalse(v.reservable)
def test_update_reservable_state_correction_with_test(self):
"""
Check that when a variable is changed with the same characteristics of another, reservable state is set to the updated variable
Check with test as ManyToMany relationship must be treated seperately
"""
test = TestCase.objects.get(pk=1)
version = Version.objects.get(pk=3)
var0 = Variable(name='var0', value='value0', application=version.application, reservable=True)
var0.save()
var0.test.add(test)
var1 = Variable(name='var0', value='value0', application=version.application, reservable=True)
var1.save()
var1.test.add(test)
response = self.client.patch(reverse('variableApiPut', args=[var1.id]), {'reservable': False, 'test': [1]})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
# var0 and var1 are similar, so when 'reservable' is updated on var1, var0 is also updated
self.assertFalse(Variable.objects.get(pk=var0.id).reservable)
self.assertFalse(Variable.objects.get(pk=var1.id).reservable)
def test_update_reservable_state_correction_with_different_tests(self):
"""
Check that when a variable with the same characteristics of another (except test list) is not changed
"""
test = TestCase.objects.get(pk=1)
version = Version.objects.get(pk=3)
var0 = Variable(name='var0', value='value0', application=version.application, reservable=True)
var0.save()
var0.test.add(test)
var1 = Variable(name='var0', value='value0', application=version.application, reservable=True)
var1.save()
response = self.client.patch(reverse('variableApiPut', args=[var1.id]), {'reservable': False, 'test': [1]})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
# var0 and var1 are similar, except for test list, so when 'reservable' is updated on var1, var0 is not updated
self.assertTrue(Variable.objects.get(pk=var0.id).reservable)
self.assertFalse(Variable.objects.get(pk=var1.id).reservable)
def test_variable_already_reserved(self):
"""
When variable cannot be reserved because all are alrealdy taken by other test, an error should be raised
"""
# login variable is defined twice, reserve it 3 times
self.client.get(reverse('variableApi'), data={'version': 4, 'environment': 3, 'test': 1})
self.client.get(reverse('variableApi'), data={'version': 4, 'environment': 3, 'test': 1})
response = self.client.get(reverse('variableApi'), data={'version': 4, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 423, 'status code should be 423: ' + str(response.content))
self.assertTrue(b'login' in response.content)
def test_destroy_old_variables(self):
"""
Check that if a variable reached its max number of days, it's automatically removed
"""
version = Version.objects.get(pk=2)
env = TestEnvironment.objects.get(pk=3)
Variable(name='oldVar', value='oldValue', application=version.application, version=version, environment=env,
creationDate=timezone.now() - datetime.timedelta(2),
timeToLive=1).save()
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
self.assertNotIn('oldVar', all_variables, "oldVar should be removed, as it's too old")
def test_do_not_destroy_not_so_old_variables(self):
"""
Check that if a variable did not reach its max number of days, it's not removed
"""
version = Version.objects.get(pk=2)
env = TestEnvironment.objects.get(pk=3)
Variable(name='oldVar', value='oldValue', application=version.application, version=version, environment=env,
creationDate=timezone.now() - datetime.timedelta(0, 23 * 60 * 60),
timeToLive=1).save()
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
self.assertIn('oldVar', all_variables, "oldVar should not be removed, as it's not old enough")
def test_return_variables_older_than_x_days(self):
"""
Check that we get only variables older than X days
"""
version = Version.objects.get(pk=2)
env = TestEnvironment.objects.get(pk=3)
Variable(name='oldVar', value='oldValue1', application=version.application, version=version, environment=env,
creationDate=timezone.now() - datetime.timedelta(2),
timeToLive=5).save()
Variable(name='oldVar2', value='oldValue2', application=version.application, version=version, environment=env,
creationDate=timezone.now() - datetime.timedelta(seconds=23 * 60 * 60), # almost 1 day
timeToLive=5).save()
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1, 'olderThan': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
self.assertIn('oldVar', all_variables, "oldVar should be get as it's older than requested")
self.assertNotIn('oldVar2', all_variables, "oldVar2 should not be get as it's younger than requested")
def test_return_all_variables_if_no_older_than_provided(self):
"""
Check that we get all variables if 'olderThan' param is not provided
"""
version = Version.objects.get(pk=2)
env = TestEnvironment.objects.get(pk=3)
Variable(name='oldVar', value='oldValue1', application=version.application, version=version, environment=env,
creationDate=timezone.now() - datetime.timedelta(2),
timeToLive=5).save()
Variable(name='oldVar2', value='oldValue2', application=version.application, version=version, environment=env,
creationDate=timezone.now() - datetime.timedelta(1),
timeToLive=5).save()
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
self.assertIn('oldVar', all_variables, "oldVar should be get as it's older than requested")
self.assertIn('oldVar2', all_variables, "oldVar2 should not be get as it's younger than requested")
def test_return_all_variables_if_older_than_0_days(self):
"""
Check that we get all variables if 'olderThan' param is 0
"""
version = Version.objects.get(pk=2)
env = TestEnvironment.objects.get(pk=3)
Variable(name='oldVar', value='oldValue1', application=version.application, version=version, environment=env,
creationDate=timezone.now(),
timeToLive=5).save()
Variable(name='oldVar2', value='oldValue2', application=version.application, version=version, environment=env,
creationDate=timezone.now() - datetime.timedelta(1),
timeToLive=5).save()
time.sleep(0.5) # wait so that comparing variable time is not a problem
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1, 'olderThan': 0})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
self.assertIn('oldVar', all_variables, "oldVar should be get as it's older than requested")
self.assertIn('oldVar2', all_variables, "oldVar2 should not be get as it's younger than requested")
def test_return_all_variables_if_older_than_negative_days(self):
"""
Check that we get all variables if 'olderThan' param is negative
"""
version = Version.objects.get(pk=2)
env = TestEnvironment.objects.get(pk=3)
Variable(name='oldVar', value='oldValue1', application=version.application, version=version, environment=env,
creationDate=timezone.now(),
timeToLive=5).save()
Variable(name='oldVar2', value='oldValue2', application=version.application, version=version, environment=env,
creationDate=timezone.now() - datetime.timedelta(1),
timeToLive=5).save()
time.sleep(0.5) # wait so that comparing variable time is not a problem
response = self.client.get(reverse('variableApi'), data={'version': 2, 'environment': 3, 'test': 1, 'olderThan': -1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
self.assertIn('oldVar', all_variables, "oldVar should be get as it's older than requested")
self.assertIn('oldVar2', all_variables, "oldVar2 should not be get as it's younger than requested")
def test_get_all_variables_with_linked_application(self):
"""
Check that if a linked application is defined, it's variables are get
"""
response = self.client.get(reverse('variableApi'), data={'version': 5, 'environment': 1, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check filtering is correct.
self.assertTrue('varApp4' in all_variables)
self.assertTrue('varApp4Env' in all_variables)
self.assertTrue('linkedApp4.varApp4Linked' in all_variables) # variable without environment
self.assertTrue('linkedApp4.varApp4EnvLinked' in all_variables) # variable with environment
self.assertFalse('linkedApp4.varApp4EnvLinked2' in all_variables) # variable with specific version will not be returned
self.assertFalse('linkedApp4.varApp4EnvLinkedReservable' in all_variables) # variable is reservable, it should not be retrieved
def test_get_all_variables_with_reverse_linked_application(self):
"""
Check that application that the link between application is not in both directions
app1 => app2 does not mean app2 => app1
"""
response = self.client.get(reverse('variableApi'), data={'version': 6, 'environment': 1, 'test': 1})
self.assertEqual(response.status_code, 200, 'status code should be 200: ' + str(response.content))
all_variables = self._convert_to_dict(response.data)
# check we only get variables from 'app4Linked' application
self.assertFalse('app4.varApp4' in all_variables)
self.assertFalse('app4.varApp4Env' in all_variables)
self.assertTrue('varApp4Linked' in all_variables)
self.assertTrue('varApp4EnvLinked' in all_variables)
self.assertTrue('varApp4EnvLinked2' in all_variables)
self.assertTrue('varApp4EnvLinkedReservable' in all_variables)
| 57.264198 | 175 | 0.635715 | 5,388 | 46,384 | 5.38827 | 0.058092 | 0.035547 | 0.02232 | 0.039405 | 0.890362 | 0.862221 | 0.842553 | 0.830601 | 0.818821 | 0.805697 | 0 | 0.019653 | 0.25733 | 46,384 | 810 | 176 | 57.264198 | 0.823125 | 0.234154 | 0 | 0.660147 | 0 | 0 | 0.174755 | 0.004304 | 0 | 0 | 0 | 0 | 0.286064 | 1 | 0.110024 | false | 0.00978 | 0.01956 | 0 | 0.136919 | 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 |
3e587bc80fa1dd5e94f8396373f920d99dcef04d | 39 | py | Python | open_crypto_tax/__init__.py | Ryley-TokenSign/OpenCryptoTax | e3d25524df7f3802a2aa3cd3a1d7c54f7b9a8db7 | [
"MIT"
] | null | null | null | open_crypto_tax/__init__.py | Ryley-TokenSign/OpenCryptoTax | e3d25524df7f3802a2aa3cd3a1d7c54f7b9a8db7 | [
"MIT"
] | 1 | 2022-02-19T19:10:51.000Z | 2022-02-19T19:10:51.000Z | open_crypto_tax/__init__.py | Ryley-TokenSign/OpenCryptoTax | e3d25524df7f3802a2aa3cd3a1d7c54f7b9a8db7 | [
"MIT"
] | null | null | null | from .core import Validator, Processor
| 19.5 | 38 | 0.820513 | 5 | 39 | 6.4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.128205 | 39 | 1 | 39 | 39 | 0.941176 | 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 |
e44fad2d614f163290dc406696e581917c2b95df | 150 | py | Python | src/msbackup/storage.py | aissa-laribi/msbackup | 1f2264c8b14e3b5f04d7802430fcb4b9c5e386f7 | [
"MIT"
] | null | null | null | src/msbackup/storage.py | aissa-laribi/msbackup | 1f2264c8b14e3b5f04d7802430fcb4b9c5e386f7 | [
"MIT"
] | null | null | null | src/msbackup/storage.py | aissa-laribi/msbackup | 1f2264c8b14e3b5f04d7802430fcb4b9c5e386f7 | [
"MIT"
] | null | null | null | def local(infile, outfile):
outfile.write(infile)
def s3(client, infile, bucket, file_name):
client.upload_fileobj(infile, bucket, file_name) | 30 | 52 | 0.746667 | 21 | 150 | 5.190476 | 0.571429 | 0.220183 | 0.293578 | 0.366972 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007692 | 0.133333 | 150 | 5 | 52 | 30 | 0.830769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 0.5 | 0 | 1 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
e4782f2228756b20a6b181ad895182d8f317c0cd | 59 | py | Python | finserv/vault/__init__.py | finserv/vault | 638c1ebd62b1a28e1161396803dd5392d0264f30 | [
"MIT"
] | null | null | null | finserv/vault/__init__.py | finserv/vault | 638c1ebd62b1a28e1161396803dd5392d0264f30 | [
"MIT"
] | null | null | null | finserv/vault/__init__.py | finserv/vault | 638c1ebd62b1a28e1161396803dd5392d0264f30 | [
"MIT"
] | null | null | null | from .vault import Vault
from .key import Key, PasswordKey
| 19.666667 | 33 | 0.79661 | 9 | 59 | 5.222222 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152542 | 59 | 2 | 34 | 29.5 | 0.94 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 1 | 0 | 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 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 6 |
e4814d493c6dcdcacde5b9d68a3df5fdba4f098d | 138 | py | Python | boa3_test/test_sc/interop_test/oracle/OracleGetPrice.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/interop_test/oracle/OracleGetPrice.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/interop_test/oracle/OracleGetPrice.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from boa3.builtin import public
from boa3.builtin.interop.oracle import Oracle
@public
def main() -> int:
return Oracle.get_price()
| 17.25 | 46 | 0.753623 | 20 | 138 | 5.15 | 0.65 | 0.15534 | 0.291262 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017094 | 0.152174 | 138 | 7 | 47 | 19.714286 | 0.863248 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.4 | 0.2 | 0.8 | 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 | 1 | 0 | 0 | 0 | 6 |
e4890122391a62a6669a2c7d5b91605cd386c2c4 | 314 | py | Python | test/test_patch.py | jeffreywolf/landscape | 4fd3d44b199628cb92feb6c109a986b66a0a44ad | [
"Apache-2.0"
] | 1 | 2021-03-22T16:50:02.000Z | 2021-03-22T16:50:02.000Z | test/test_patch.py | jeffreywolf/landscape | 4fd3d44b199628cb92feb6c109a986b66a0a44ad | [
"Apache-2.0"
] | null | null | null | test/test_patch.py | jeffreywolf/landscape | 4fd3d44b199628cb92feb6c109a986b66a0a44ad | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test suite for `patch` subpackage
"""
from landscape.patch import patches
from landscape.patch import datasets
from landscape.patch import load_datasets
from landscape.patch import scene
from landscape.patch import splits
import unittest
import os
import shutil
import numpy as np
pass
| 20.933333 | 41 | 0.792994 | 45 | 314 | 5.511111 | 0.511111 | 0.262097 | 0.362903 | 0.483871 | 0.258065 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00369 | 0.136943 | 314 | 14 | 42 | 22.428571 | 0.911439 | 0.178344 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.1 | 0.9 | 0 | 0.9 | 0 | 0 | 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 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 6 |
e4a38ef929f99f304553571c1d7986bc382de2a4 | 63 | py | Python | pydocspec/test/testpackages/cyclic_imports_all_many_levels/level1/level2/__init__.py | tristanlatr/pydocspec | 25965310c7f576d2f2e877f8a1b2984bb77725b9 | [
"MIT"
] | null | null | null | pydocspec/test/testpackages/cyclic_imports_all_many_levels/level1/level2/__init__.py | tristanlatr/pydocspec | 25965310c7f576d2f2e877f8a1b2984bb77725b9 | [
"MIT"
] | 5 | 2021-08-28T14:33:13.000Z | 2022-02-27T23:51:48.000Z | pydocspec/test/testpackages/cyclic_imports_all_many_levels/level1/level2/__init__.py | tristanlatr/pydocspec | 25965310c7f576d2f2e877f8a1b2984bb77725b9 | [
"MIT"
] | 1 | 2022-02-10T01:55:14.000Z | 2022-02-10T01:55:14.000Z | from cyclic_imports_all_many_levels import *
class l2:
pass | 21 | 44 | 0.809524 | 10 | 63 | 4.7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018868 | 0.15873 | 63 | 3 | 45 | 21 | 0.867925 | 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 |
e4d749b9dfc58c42791124ed3d625496748e68c1 | 59 | py | Python | example_snippets/multimenus_snippets/NewSnippets/h5py/Setup.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/NewSnippets/h5py/Setup.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/NewSnippets/h5py/Setup.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | 1 | 2021-02-04T04:51:48.000Z | 2021-02-04T04:51:48.000Z | from __future__ import print_function, division
import h5py | 29.5 | 47 | 0.881356 | 8 | 59 | 5.875 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018868 | 0.101695 | 59 | 2 | 48 | 29.5 | 0.867925 | 0 | 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 |
901a489be86e0895454aafc6750f2763533757bb | 5,755 | py | Python | redata/grafana/panels/base.py | hishoss/redata | e6cf77ca4c957e620066c65925437e36488040ec | [
"MIT"
] | null | null | null | redata/grafana/panels/base.py | hishoss/redata | e6cf77ca4c957e620066c65925437e36488040ec | [
"MIT"
] | null | null | null | redata/grafana/panels/base.py | hishoss/redata | e6cf77ca4c957e620066c65925437e36488040ec | [
"MIT"
] | null | null | null | from redata.metric import Metric
class HomeLastModifiedTime:
def format(self):
return "time_series"
@staticmethod
def title():
return "time_since_last_record_created"
def query(self):
return f"""
SELECT
metric.created_at AS time,
m.table_name,
(metric.result->>'value')::float
FROM metric metric, monitored_table m
WHERE
m.id = metric.table_id and
m.active = true and
metric.metric = '{Metric.DELAY}' and
$__timeFilter(metric.created_at)
ORDER BY 1
"""
class HomeLastDayTraffic:
def format(self):
return "time_series"
@staticmethod
def title():
return "new_records_created (in last 24h)"
def query(self):
return f"""
SELECT
metric.created_at AS time,
m.table_name,
(metric.result->>'value')::float
FROM metric metric, monitored_table m
WHERE
m.id = metric.table_id and
m.active = true and
metric.metric = '{Metric.COUNT}' and
params ->> 'time_interval' = '1 day' and
$__timeFilter(metric.created_at)
"""
class HomeAlerts:
def format(self):
return "table"
@staticmethod
def title():
return "RECENT ALERTS"
def query(self):
return f"""
SELECT
m.table_name,
alert.text,
alert.alert_type,
alert.created_at
FROM
alerts_alert alert,
monitored_table m
WHERE
alert.table_id = m.id AND
$__timeFilter(alert.created_at)
ORDER BY
alert.created_at DESC
"""
class AlertsTable:
def __init__(self, table):
self.table = table
def format(self):
return "table"
@staticmethod
def title():
return "RECENT ALERTS"
def query(self):
return f"""
SELECT
alert.text,
alert.alert_type,
alert.created_at
FROM
alerts_alert alert
WHERE
table_id = {self.table.id} and
$__timeFilter(alert.created_at)
ORDER BY
alert.created_at DESC
"""
class AlertsByDay:
def __init__(self, table):
self.table = table
def format(self):
return "time_series"
@staticmethod
def title():
return "ALERTS BY DAY"
def query(self):
return f"""
SELECT
alert.created_at::date as time,
alert.alert_type,
count(*)
FROM
alerts_alert alert
WHERE
table_id = {self.table.id} and
$__timeFilter(alert.created_at)
GROUP BY
alert.created_at::date, alert.alert_type
ORDER BY
alert.created_at::date DESC
"""
class DelayOnTable:
def __init__(self, table) -> None:
self.table = table
def format(self):
return "time_series"
@staticmethod
def title():
return f"TIME SINCE LAST NEW RECORD"
def query(self):
return f"""
SELECT
created_at AS "time",
(result ->> 'value')::float as delay
FROM metric
WHERE
table_id = {self.table.id} and
metric = '{Metric.DELAY}' and
$__timeFilter(created_at)
ORDER BY 1
"""
class VolumeGraphs:
def __init__(self, table) -> None:
self.table = table
def format(self):
return "time_series"
@staticmethod
def title():
return f"NEW RECORDS"
def query(self):
return f"""
SELECT
created_at AS "time",
(result ->> 'value')::float as volume_24h
FROM metric
WHERE
table_id = {self.table.id} and
metric = '{Metric.COUNT}' and
params ->> 'time_interval' = '1 day' and
$__timeFilter(created_at)
ORDER BY 1
"""
class CheckForColumn:
def __init__(self, table, column, metric) -> None:
self.table = table
self.column = column
self.metric = metric
def format(self):
return "time_series"
@staticmethod
def title():
return f"NOT_EXISTING"
def query(self):
return f"""
SELECT
created_at as time,
(result ->> 'value')::float as {self.metric}
FROM
metric
WHERE
table_id = {self.table.id} and
table_column = '{self.column}' and
metric = '{self.metric}'
ORDER BY
1
"""
class CustomMetric:
def __init__(self, table, metric, column=None):
self.table = table
self.metric = metric
self.column = column
def format(self):
return "time_series"
@staticmethod
def title():
return f"NOT_EXISTING"
def query(self):
table_column = column if column else Metric.TABLE_METRIC
return f"""
SELECT
created_at as time,
(result ->> 'value')::float as {self.metric}
FROM
metric
WHERE
table_id = {self.table_id} and
metric = '{self.metric}' and
table_column = '{table_column}'
ORDER BY 1
"""
ALL_PANELS = (
VolumeGraphs,
DelayOnTable,
AlertsTable,
AlertsByDay,
)
| 22.928287 | 64 | 0.505647 | 588 | 5,755 | 4.770408 | 0.12585 | 0.064171 | 0.049911 | 0.060963 | 0.755793 | 0.708378 | 0.700535 | 0.68984 | 0.669519 | 0.669519 | 0 | 0.003225 | 0.407298 | 5,755 | 250 | 65 | 23.02 | 0.819115 | 0 | 0 | 0.784314 | 0 | 0 | 0.620504 | 0.063944 | 0 | 0 | 0 | 0 | 0 | 1 | 0.161765 | false | 0 | 0.004902 | 0.127451 | 0.343137 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 6 |
5f795afc107f67b4e4ac9b9d916c988df40dc1de | 25 | py | Python | nbs/test_files/show.py | outerbounds/nbdoc | b642d0f684c28594e601898ab6cbd12af3b9d7c1 | [
"Apache-2.0"
] | 15 | 2022-02-15T09:38:07.000Z | 2022-03-26T09:12:02.000Z | nbs/test_files/show.py | outerbounds/nbdoc | b642d0f684c28594e601898ab6cbd12af3b9d7c1 | [
"Apache-2.0"
] | 10 | 2022-03-16T23:20:54.000Z | 2022-03-30T14:58:15.000Z | nbs/test_files/show.py | outerbounds/nbdoc | b642d0f684c28594e601898ab6cbd12af3b9d7c1 | [
"Apache-2.0"
] | null | null | null | def ShowDoc(x): return x
| 12.5 | 24 | 0.72 | 5 | 25 | 3.6 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16 | 25 | 1 | 25 | 25 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | false | 0 | 0 | 1 | 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 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 6 |
39a89b98629e1c22ad60680a25b0356d3029a500 | 291 | py | Python | test_proj/api.py | Anexen/import-guard | 3135e77ae394be6f0d4b8a49bf72e8ec645f794f | [
"MIT"
] | 2 | 2021-06-16T08:30:56.000Z | 2021-06-18T07:28:41.000Z | test_proj/api.py | Anexen/import-guard | 3135e77ae394be6f0d4b8a49bf72e8ec645f794f | [
"MIT"
] | null | null | null | test_proj/api.py | Anexen/import-guard | 3135e77ae394be6f0d4b8a49bf72e8ec645f794f | [
"MIT"
] | null | null | null | import bisect
import csv
from test_proj.logging import *
def handle_request_1():
from .tasks import task_1
task_1()
def handle_request_2():
from .tasks import task_2
task_2()
def run_server():
log("Server started")
handle_request_1()
handle_request_2()
| 12.125 | 31 | 0.687285 | 43 | 291 | 4.325581 | 0.418605 | 0.27957 | 0.172043 | 0.204301 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035556 | 0.226804 | 291 | 23 | 32 | 12.652174 | 0.791111 | 0 | 0 | 0 | 0 | 0 | 0.04811 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | true | 0 | 0.384615 | 0 | 0.615385 | 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 | 1 | 0 | 1 | 0 | 0 | 6 |
39daf4ff16e74cc6352422464704f6ace218c2f7 | 188 | py | Python | mt/opencv/__init__.py | inteplus/opencvmt | 29a049f23f6bff8c3399cbadc527c9a6583737ec | [
"MIT"
] | null | null | null | mt/opencv/__init__.py | inteplus/opencvmt | 29a049f23f6bff8c3399cbadc527c9a6583737ec | [
"MIT"
] | null | null | null | mt/opencv/__init__.py | inteplus/opencvmt | 29a049f23f6bff8c3399cbadc527c9a6583737ec | [
"MIT"
] | null | null | null | from mt.base import logger
try:
import cv2
except ImportError:
logger.error("IMPORT: OpenCV for Python is not detected. Please install a version of OpenCV for Python.")
raise
| 23.5 | 109 | 0.739362 | 28 | 188 | 4.964286 | 0.785714 | 0.129496 | 0.215827 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006667 | 0.202128 | 188 | 7 | 110 | 26.857143 | 0.92 | 0 | 0 | 0 | 0 | 0 | 0.473404 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 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 |
84076b1f52ecf0992acadb9703ef8a65775c379c | 25 | py | Python | scripts/geodyn1d/sedimento/__init__.py | tth030/SM_ESR_isostasy | fbd2ac586e8e31dd18a0988181514bc2fff7f08a | [
"MIT"
] | null | null | null | scripts/geodyn1d/sedimento/__init__.py | tth030/SM_ESR_isostasy | fbd2ac586e8e31dd18a0988181514bc2fff7f08a | [
"MIT"
] | null | null | null | scripts/geodyn1d/sedimento/__init__.py | tth030/SM_ESR_isostasy | fbd2ac586e8e31dd18a0988181514bc2fff7f08a | [
"MIT"
] | null | null | null | from .sedimento 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 |
844c3c2e2d168f095d921a240850751bac6ab199 | 137 | py | Python | micromagneticmodel/evolver.py | ubermag/micromagneticmodel | 91ad92d26cdbec369a5a41f7b90a17ca5328cd07 | [
"BSD-3-Clause"
] | 5 | 2019-10-21T01:12:16.000Z | 2021-09-24T03:52:30.000Z | micromagneticmodel/evolver.py | ubermag/micromagneticmodel | 91ad92d26cdbec369a5a41f7b90a17ca5328cd07 | [
"BSD-3-Clause"
] | 11 | 2019-08-12T22:38:17.000Z | 2022-03-15T00:08:47.000Z | micromagneticmodel/evolver.py | ubermag/micromagneticmodel | 91ad92d26cdbec369a5a41f7b90a17ca5328cd07 | [
"BSD-3-Clause"
] | 4 | 2020-06-27T15:36:28.000Z | 2021-12-06T15:08:04.000Z | import micromagneticmodel as mm
class Evolver(mm.abstract.Abstract):
"""An abstract class for deriving evolvers.
"""
pass
| 15.222222 | 47 | 0.70073 | 16 | 137 | 6 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.211679 | 137 | 8 | 48 | 17.125 | 0.888889 | 0.291971 | 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 |
0816f676c9f9a379a0ae67e62b2696abb7a3a3b6 | 27 | py | Python | optus/__init__.py | itchannel/optus-api | 9121c194d9c7eaa67cf16443d84231938b8b6bda | [
"MIT"
] | 1 | 2021-09-29T01:53:43.000Z | 2021-09-29T01:53:43.000Z | optus/__init__.py | itchannel/optus-api | 9121c194d9c7eaa67cf16443d84231938b8b6bda | [
"MIT"
] | null | null | null | optus/__init__.py | itchannel/optus-api | 9121c194d9c7eaa67cf16443d84231938b8b6bda | [
"MIT"
] | null | null | null | from .optus import Account
| 13.5 | 26 | 0.814815 | 4 | 27 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148148 | 27 | 1 | 27 | 27 | 0.956522 | 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 |
f23c87e46a9eaf7db19ac8665d176516dfb13b8c | 164 | py | Python | recursive_diff/dask_or_stub.py | crusaderky/recursive_diff | f94acf74e4e92bb44462627f22e24525d470abe3 | [
"Apache-2.0"
] | 10 | 2019-01-02T15:01:45.000Z | 2022-01-13T09:39:16.000Z | recursive_diff/dask_or_stub.py | crusaderky/recursive_diff | f94acf74e4e92bb44462627f22e24525d470abe3 | [
"Apache-2.0"
] | 10 | 2019-01-02T16:16:35.000Z | 2022-03-26T21:43:10.000Z | recursive_diff/dask_or_stub.py | crusaderky/recursive_diff | f94acf74e4e92bb44462627f22e24525d470abe3 | [
"Apache-2.0"
] | 2 | 2019-02-09T18:18:42.000Z | 2021-12-09T08:35:17.000Z | """Support dask-backed xarray objects, if dask is installed
"""
try:
from dask import compute
except ImportError:
def compute(*args):
return args
| 16.4 | 59 | 0.682927 | 21 | 164 | 5.333333 | 0.809524 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.231707 | 164 | 9 | 60 | 18.222222 | 0.888889 | 0.341463 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.4 | 0.2 | 0.8 | 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 | 0 | 1 | 1 | 1 | 0 | 0 | 6 |
f24c999adc5d62ed7e5c1dbf96355abc45ca7784 | 41 | py | Python | lifx/lan/client/__init__.py | majamassarini/lifx-lib | 32b8d9049e078e62403510242c530bbe98431750 | [
"MIT"
] | 3 | 2022-01-24T20:23:39.000Z | 2022-02-22T17:26:03.000Z | lifx/lan/client/__init__.py | majamassarini/lifx-lib | 32b8d9049e078e62403510242c530bbe98431750 | [
"MIT"
] | null | null | null | lifx/lan/client/__init__.py | majamassarini/lifx-lib | 32b8d9049e078e62403510242c530bbe98431750 | [
"MIT"
] | null | null | null | from lifx.lan.client import asynchronous
| 20.5 | 40 | 0.853659 | 6 | 41 | 5.833333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097561 | 41 | 1 | 41 | 41 | 0.945946 | 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 |
f28396c847c3d6a07c541ad5a55cd7d6c46e97e4 | 7,964 | py | Python | tests/test_synthia_format.py | jenhaoyang/datumaro | add81ddb59502362fa65fa07e5bc4d8c9f61afde | [
"MIT"
] | null | null | null | tests/test_synthia_format.py | jenhaoyang/datumaro | add81ddb59502362fa65fa07e5bc4d8c9f61afde | [
"MIT"
] | null | null | null | tests/test_synthia_format.py | jenhaoyang/datumaro | add81ddb59502362fa65fa07e5bc4d8c9f61afde | [
"MIT"
] | 1 | 2021-12-15T22:15:59.000Z | 2021-12-15T22:15:59.000Z |
from unittest import TestCase
import os.path as osp
import numpy as np
from datumaro.components.annotation import (
AnnotationType, LabelCategories, Mask, MaskCategories,
)
from datumaro.components.dataset import Dataset
from datumaro.components.environment import Environment
from datumaro.components.extractor import DatasetItem
from datumaro.util.test_utils import compare_datasets
import datumaro.plugins.synthia_format as Synthia
from .requirements import Requirements, mark_requirement
DUMMY_LABELS_SEGM_DATASET_DIR = osp.join(osp.dirname(__file__),
'assets', 'synthia_dataset', 'labels_segm_dataset')
DUMMY_COLOR_SEGM_DATASET_DIR = osp.join(osp.dirname(__file__),
'assets', 'synthia_dataset', 'color_segm_dataset')
DUMMY_DATASET_DIR_CUSTOM_LABELMAP = osp.join(osp.dirname(__file__),
'assets', 'synthia_dataset', 'dataset_with_custom_labelmap')
DUMMY_DATASET_DIR_META_FILE = osp.join(osp.dirname(__file__),
'assets', 'synthia_dataset', 'dataset_with_meta_file')
class SynthiaImporterTest(TestCase):
@mark_requirement(Requirements.DATUM_497)
def test_can_detect(self):
detected_formats = Environment().detect_dataset(DUMMY_LABELS_SEGM_DATASET_DIR)
self.assertEqual([Synthia.SynthiaImporter.NAME], detected_formats)
@mark_requirement(Requirements.DATUM_497)
def test_can_detect_with_colored_masks(self):
detected_formats = Environment().detect_dataset(DUMMY_COLOR_SEGM_DATASET_DIR)
self.assertEqual([Synthia.SynthiaImporter.NAME], detected_formats)
@mark_requirement(Requirements.DATUM_497)
def test_can_detect_with_custom_labelmap(self):
detected_formats = Environment().detect_dataset(DUMMY_DATASET_DIR_CUSTOM_LABELMAP)
self.assertEqual([Synthia.SynthiaImporter.NAME], detected_formats)
@mark_requirement(Requirements.DATUM_497)
def test_can_import(self):
expected_dataset = Dataset.from_iterable([
DatasetItem(id='Stereo_Left/Omni_B/000000',
image=np.ones((1, 5, 3)),
annotations=[
Mask(np.array([[1, 1, 0, 0, 0]]), label=1,
attributes={'dynamic_object': False}),
Mask(np.array([[0, 0, 1, 1, 1]]), label=10,
attributes={'dynamic_object': True}),
],
),
DatasetItem(id='Stereo_Left/Omni_B/000001',
image=np.ones((1, 5, 3)),
annotations=[
Mask(np.array([[1, 0, 0, 0, 0]]), label=8,
attributes={'dynamic_object': True}),
Mask(np.array([[0, 1, 1, 0, 0]]), label=11,
attributes={'dynamic_object': True}),
Mask(np.array([[0, 0, 0, 1, 1]]), label=3,
attributes={'dynamic_object': False}),
],
),
DatasetItem(id='Stereo_Left/Omni_F/000000',
image=np.ones((1, 5, 3)),
annotations=[
Mask(np.array([[1, 1, 0, 0, 0]]), label=1,
attributes={'dynamic_object': False}),
Mask(np.array([[0, 0, 1, 1, 0]]), label=2,
attributes={'dynamic_object': False}),
Mask(np.array([[0, 0, 0, 0, 1]]), label=3,
attributes={'dynamic_object': False}),
],
),
DatasetItem(id='Stereo_Left/Omni_F/000001',
image=np.ones((1, 5, 3)),
annotations=[
Mask(np.array([[1, 0, 0, 0, 0]]), label=1,
attributes={'dynamic_object': False}),
Mask(np.array([[0, 1, 0, 0, 0]]), label=2,
attributes={'dynamic_object': False}),
Mask(np.array([[0, 0, 1, 1, 0]]), label=15,
attributes={'dynamic_object': False}),
Mask(np.array([[0, 0, 0, 0, 1]]), label=3,
attributes={'dynamic_object': False}),
],
)
], categories=Synthia.make_categories())
dataset = Dataset.import_from(DUMMY_LABELS_SEGM_DATASET_DIR, 'synthia')
compare_datasets(self, expected_dataset, dataset, require_images=True)
@mark_requirement(Requirements.DATUM_497)
def test_can_import_with_colored_masks(self):
expected_dataset = Dataset.from_iterable([
DatasetItem(id='Stereo_Left/Omni_F/000000',
image=np.ones((1, 5, 3)),
annotations=[
Mask(np.array([[1, 1, 0, 0, 0]]), label=1),
Mask(np.array([[0, 0, 1, 1, 0]]), label=2),
Mask(np.array([[0, 0, 0, 0, 1]]), label=3),
],
),
DatasetItem(id='Stereo_Left/Omni_F/000001',
image=np.ones((1, 5, 3)),
annotations=[
Mask(np.array([[1, 0, 0, 0, 0]]), label=1),
Mask(np.array([[0, 1, 0, 0, 0]]), label=2),
Mask(np.array([[0, 0, 1, 1, 0]]), label=15),
Mask(np.array([[0, 0, 0, 0, 1]]), label=3),
],
)
], categories=Synthia.make_categories())
dataset = Dataset.import_from(DUMMY_COLOR_SEGM_DATASET_DIR, 'synthia')
compare_datasets(self, expected_dataset, dataset, require_images=True)
@mark_requirement(Requirements.DATUM_497)
def test_can_import_with_custom_labelmap(self):
expected_dataset = Dataset.from_iterable([
DatasetItem(id='Stereo_Left/Omni_F/000000',
image=np.ones((1, 5, 3)),
annotations=[
Mask(np.array([[1, 1, 1, 0, 0]]), label=1),
Mask(np.array([[0, 0, 0, 1, 1]]), label=4),
],
),
DatasetItem(id='Stereo_Left/Omni_F/000001',
image=np.ones((1, 5, 3)),
annotations=[
Mask(np.array([[1, 1, 0, 0, 0]]), label=2),
Mask(np.array([[0, 0, 1, 1, 0]]), label=3),
Mask(np.array([[0, 0, 0, 0, 1]]), label=4),
],
)
], categories={
AnnotationType.label: LabelCategories.from_iterable(
['background', 'sky', 'building', 'person', 'road']),
AnnotationType.mask: MaskCategories({0: (0, 0, 0), 1: (0, 0, 64),
2: (0, 128, 128), 3: (128, 0, 64), 4: (0, 192, 128)})
})
dataset = Dataset.import_from(DUMMY_DATASET_DIR_CUSTOM_LABELMAP, 'synthia')
compare_datasets(self, expected_dataset, dataset, require_images=True)
@mark_requirement(Requirements.DATUM_497)
def test_can_import_with_meta_file(self):
expected_dataset = Dataset.from_iterable([
DatasetItem(id='Stereo_Left/Omni_F/000000',
image=np.ones((1, 5, 3)),
annotations=[
Mask(np.array([[1, 1, 1, 0, 0]]), label=1),
Mask(np.array([[0, 0, 0, 1, 1]]), label=4),
],
),
DatasetItem(id='Stereo_Left/Omni_F/000001',
image=np.ones((1, 5, 3)),
annotations=[
Mask(np.array([[1, 1, 0, 0, 0]]), label=2),
Mask(np.array([[0, 0, 1, 1, 0]]), label=3),
Mask(np.array([[0, 0, 0, 0, 1]]), label=4),
],
)
], categories={
AnnotationType.label: LabelCategories.from_iterable(
['background', 'sky', 'building', 'person', 'road']),
AnnotationType.mask: MaskCategories({0: (0, 0, 0), 1: (0, 0, 64),
2: (0, 128, 128), 3: (128, 0, 64), 4: (0, 192, 128)})
})
dataset = Dataset.import_from(DUMMY_DATASET_DIR_META_FILE, 'synthia')
compare_datasets(self, expected_dataset, dataset, require_images=True)
| 43.519126 | 90 | 0.544324 | 916 | 7,964 | 4.525109 | 0.111354 | 0.031363 | 0.02316 | 0.055006 | 0.857177 | 0.837394 | 0.810615 | 0.775875 | 0.759952 | 0.713631 | 0 | 0.064346 | 0.31115 | 7,964 | 182 | 91 | 43.758242 | 0.691214 | 0 | 0 | 0.658228 | 0 | 0 | 0.085269 | 0.037674 | 0 | 0 | 0 | 0 | 0.018987 | 1 | 0.044304 | false | 0 | 0.139241 | 0 | 0.189873 | 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 |
4b2d42d6679543a895f48efa4b6af7356faffb48 | 2,298 | py | Python | epytope/Data/pssms/smmpmbec/mat/A_26_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/smmpmbec/mat/A_26_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/smmpmbec/mat/A_26_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | A_26_02_9 = {0: {'A': 0.109, 'C': -0.186, 'E': -0.694, 'D': -0.616, 'G': 0.238, 'F': -0.231, 'I': 0.156, 'H': -0.098, 'K': 0.739, 'M': -0.153, 'L': 0.27, 'N': -0.117, 'Q': 0.048, 'P': 0.109, 'S': -0.019, 'R': 0.694, 'T': -0.034, 'W': -0.351, 'V': 0.229, 'Y': -0.093}, 1: {'A': -0.866, 'C': 0.214, 'E': 0.5, 'D': 0.294, 'G': 0.032, 'F': 0.379, 'I': -0.659, 'H': 0.722, 'K': 0.19, 'M': 0.016, 'L': -0.184, 'N': 0.207, 'Q': 0.252, 'P': -0.031, 'S': -0.486, 'R': 0.421, 'T': -0.968, 'W': 0.467, 'V': -1.031, 'Y': 0.531}, 2: {'A': -0.52, 'C': -0.067, 'E': 0.226, 'D': 0.342, 'G': 0.184, 'F': 0.214, 'I': -0.602, 'H': 0.015, 'K': 0.098, 'M': 0.091, 'L': 0.188, 'N': 0.177, 'Q': 0.287, 'P': -0.006, 'S': -0.105, 'R': 0.101, 'T': -0.298, 'W': 0.114, 'V': -0.519, 'Y': 0.081}, 3: {'A': -0.186, 'C': -0.153, 'E': -0.149, 'D': -0.052, 'G': -0.096, 'F': 0.019, 'I': 0.428, 'H': 0.042, 'K': 0.0, 'M': 0.182, 'L': 0.392, 'N': 0.088, 'Q': -0.109, 'P': -0.005, 'S': -0.099, 'R': -0.263, 'T': -0.114, 'W': -0.085, 'V': 0.28, 'Y': -0.121}, 4: {'A': 0.158, 'C': -0.125, 'E': -0.123, 'D': -0.156, 'G': 0.006, 'F': 0.189, 'I': 0.112, 'H': -0.418, 'K': 0.233, 'M': 0.11, 'L': 0.276, 'N': 0.015, 'Q': -0.15, 'P': -0.048, 'S': 0.025, 'R': 0.058, 'T': 0.138, 'W': -0.322, 'V': 0.35, 'Y': -0.328}, 5: {'A': 0.276, 'C': 0.224, 'E': 0.281, 'D': 0.093, 'G': 0.12, 'F': -0.194, 'I': -0.43, 'H': 0.007, 'K': 0.493, 'M': -0.808, 'L': -0.589, 'N': -0.071, 'Q': 0.128, 'P': 0.42, 'S': 0.152, 'R': 0.548, 'T': -0.007, 'W': -0.209, 'V': -0.068, 'Y': -0.366}, 6: {'A': -0.282, 'C': -0.068, 'E': 0.098, 'D': 0.094, 'G': -0.302, 'F': 0.095, 'I': 0.158, 'H': 0.056, 'K': 0.207, 'M': 0.113, 'L': 0.17, 'N': 0.031, 'Q': -0.047, 'P': -0.092, 'S': -0.219, 'R': -0.151, 'T': -0.053, 'W': 0.04, 'V': 0.104, 'Y': 0.048}, 7: {'A': -0.31, 'C': 0.027, 'E': 0.108, 'D': 0.283, 'G': -0.217, 'F': -0.151, 'I': -0.022, 'H': 0.154, 'K': 0.122, 'M': -0.084, 'L': -0.183, 'N': 0.034, 'Q': 0.142, 'P': -0.024, 'S': -0.137, 'R': 0.188, 'T': 0.084, 'W': 0.014, 'V': -0.074, 'Y': 0.047}, 8: {'A': 0.463, 'C': -0.214, 'E': 0.183, 'D': 0.103, 'G': 0.15, 'F': -0.903, 'I': -0.162, 'H': -0.172, 'K': 0.625, 'M': -1.084, 'L': -0.262, 'N': -0.16, 'Q': 0.5, 'P': 0.818, 'S': 0.393, 'R': 0.616, 'T': 0.494, 'W': -0.621, 'V': 0.166, 'Y': -0.932}, -1: {'con': 4.15094}} | 2,298 | 2,298 | 0.394691 | 557 | 2,298 | 1.62298 | 0.317774 | 0.019912 | 0.011062 | 0.013274 | 0.015487 | 0 | 0 | 0 | 0 | 0 | 0 | 0.374026 | 0.162315 | 2,298 | 1 | 2,298 | 2,298 | 0.095584 | 0 | 0 | 0 | 0 | 0 | 0.0796 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
4ba43bc2e406ad6e595f85af7c6ce0aea902463a | 177 | py | Python | Python/Curos_Python_curemvid/Exercicios_dos_videos/Ex097.py | Jhonattan-rocha/Meus-primeiros-programas | f5971b66c0afd049b5d0493e8b7a116b391d058e | [
"MIT"
] | null | null | null | Python/Curos_Python_curemvid/Exercicios_dos_videos/Ex097.py | Jhonattan-rocha/Meus-primeiros-programas | f5971b66c0afd049b5d0493e8b7a116b391d058e | [
"MIT"
] | null | null | null | Python/Curos_Python_curemvid/Exercicios_dos_videos/Ex097.py | Jhonattan-rocha/Meus-primeiros-programas | f5971b66c0afd049b5d0493e8b7a116b391d058e | [
"MIT"
] | null | null | null | def escreva(txt):
print('-' * (len(txt) + 6))
print(f'---{txt}---')
print('-' * (len(txt) + 6))
escreva('Teste 1')
escreva("Teste 25215")
escreva("Teste 3259841")
| 17.7 | 31 | 0.536723 | 23 | 177 | 4.130435 | 0.478261 | 0.378947 | 0.231579 | 0.294737 | 0.315789 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104167 | 0.186441 | 177 | 9 | 32 | 19.666667 | 0.555556 | 0 | 0 | 0.285714 | 0 | 0 | 0.248588 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.142857 | 0.428571 | 1 | 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 | 0 | 0 | 0 | 1 | 0 | 6 |
29d218b5e76c56745c8f7e285fc1a5630e2b3c8c | 24 | py | Python | nonebot_plugin_arcaea/api/adapters/botarcapi/__init__.py | iyume/nonebot-plugin-arcaea | cd2110b11ae41707396a0db21f228474cc3e35b4 | [
"MIT"
] | 35 | 2021-02-08T09:55:51.000Z | 2022-03-19T08:22:07.000Z | nonebot_plugin_arcaea/api/adapters/botarcapi/__init__.py | iyume/nonebot-plugin-arcaea | cd2110b11ae41707396a0db21f228474cc3e35b4 | [
"MIT"
] | 10 | 2021-02-22T04:15:58.000Z | 2022-03-28T02:55:02.000Z | nonebot_plugin_arcaea/api/adapters/botarcapi/__init__.py | iyume/nonebot-plugin-arcaea | cd2110b11ae41707396a0db21f228474cc3e35b4 | [
"MIT"
] | 1 | 2022-01-18T03:57:07.000Z | 2022-01-18T03:57:07.000Z | from .v4 import APIQuery | 24 | 24 | 0.833333 | 4 | 24 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.047619 | 0.125 | 24 | 1 | 24 | 24 | 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 |
29e12e3f485be1ad55f47bfb5c22825b52bd34d8 | 13,998 | py | Python | util/data/gen/WINTRUST.DLL.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | util/data/gen/WINTRUST.DLL.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | util/data/gen/WINTRUST.DLL.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | symbols = []
exports = [{'type': 'function', 'name': 'AddPersonalTrustDBPages', 'address': '0x7ffb3bbcf890'}, {'type': 'function', 'name': 'CatalogCompactHashDatabase', 'address': '0x7ffb3bbaf080'}, {'type': 'function', 'name': 'ComputeFirstPageHash', 'address': '0x7ffb3bbc2480'}, {'type': 'function', 'name': 'ConfigCiFinalPolicy', 'address': '0x7ffb3bbd1330'}, {'type': 'function', 'name': 'ConfigCiPackageFamilyNameCheck', 'address': '0x7ffb3bbd1740'}, {'type': 'function', 'name': 'CryptCATAdminAcquireContext', 'address': '0x7ffb3bba1310'}, {'type': 'function', 'name': 'CryptCATAdminAcquireContext2', 'address': '0x7ffb3bbc4b30'}, {'type': 'function', 'name': 'CryptCATAdminAddCatalog', 'address': '0x7ffb3bbc4c10'}, {'type': 'function', 'name': 'CryptCATAdminCalcHashFromFileHandle', 'address': '0x7ffb3bbc4f60'}, {'type': 'function', 'name': 'CryptCATAdminCalcHashFromFileHandle2', 'address': '0x7ffb3bbc4fc0'}, {'type': 'function', 'name': 'CryptCATAdminCalcHashFromFileHandle3', 'address': '0x7ffb3bbc5040'}, {'type': 'function', 'name': 'CryptCATAdminEnumCatalogFromHash', 'address': '0x7ffb3bba3390'}, {'type': 'function', 'name': 'CryptCATAdminPauseServiceForBackup', 'address': '0x7ffb3bbc50b0'}, {'type': 'function', 'name': 'CryptCATAdminReleaseCatalogContext', 'address': '0x7ffb3bba13b0'}, {'type': 'function', 'name': 'CryptCATAdminReleaseContext', 'address': '0x7ffb3bba10f0'}, {'type': 'function', 'name': 'CryptCATAdminRemoveCatalog', 'address': '0x7ffb3bbc5100'}, {'type': 'function', 'name': 'CryptCATAdminResolveCatalogPath', 'address': '0x7ffb3bbc5150'}, {'type': 'function', 'name': 'CryptCATAllocSortedMemberInfo', 'address': '0x7ffb3bba8240'}, {'type': 'function', 'name': 'CryptCATCDFClose', 'address': '0x7ffb3bbc6e10'}, {'type': 'function', 'name': 'CryptCATCDFEnumAttributes', 'address': '0x7ffb3bbc6ec0'}, {'type': 'function', 'name': 'CryptCATCDFEnumAttributesWithCDFTag', 'address': '0x7ffb3bbc6ee0'}, {'type': 'function', 'name': 'CryptCATCDFEnumCatAttributes', 'address': '0x7ffb3bbc6f30'}, {'type': 'function', 'name': 'CryptCATCDFEnumMembers', 'address': '0x7ffb3bbc70e0'}, {'type': 'function', 'name': 'CryptCATCDFEnumMembersByCDFTag', 'address': '0x7ffb3bbc7150'}, {'type': 'function', 'name': 'CryptCATCDFEnumMembersByCDFTagEx', 'address': '0x7ffb3bbc71a0'}, {'type': 'function', 'name': 'CryptCATCDFOpen', 'address': '0x7ffb3bbc71f0'}, {'type': 'function', 'name': 'CryptCATCatalogInfoFromContext', 'address': '0x7ffb3bba1020'}, {'type': 'function', 'name': 'CryptCATClose', 'address': '0x7ffb3bba3050'}, {'type': 'function', 'name': 'CryptCATEnumerateAttr', 'address': '0x7ffb3bbab930'}, {'type': 'function', 'name': 'CryptCATEnumerateCatAttr', 'address': '0x7ffb3bbab990'}, {'type': 'function', 'name': 'CryptCATEnumerateMember', 'address': '0x7ffb3bbc3e10'}, {'type': 'function', 'name': 'CryptCATFreeSortedMemberInfo', 'address': '0x7ffb3bbc3f00'}, {'type': 'function', 'name': 'CryptCATGetAttrInfo', 'address': '0x7ffb3bbc3f40'}, {'type': 'function', 'name': 'CryptCATGetCatAttrInfo', 'address': '0x7ffb3bbc3ff0'}, {'type': 'function', 'name': 'CryptCATGetMemberInfo', 'address': '0x7ffb3bbc4080'}, {'type': 'function', 'name': 'CryptCATHandleFromStore', 'address': '0x7ffb3bbaef00'}, {'type': 'function', 'name': 'CryptCATOpen', 'address': '0x7ffb3bbc4150'}, {'type': 'function', 'name': 'CryptCATPersistStore', 'address': '0x7ffb3bbc42b0'}, {'type': 'function', 'name': 'CryptCATPutAttrInfo', 'address': '0x7ffb3bbc42f0'}, {'type': 'function', 'name': 'CryptCATPutCatAttrInfo', 'address': '0x7ffb3bbc44d0'}, {'type': 'function', 'name': 'CryptCATPutMemberInfo', 'address': '0x7ffb3bbc4770'}, {'type': 'function', 'name': 'CryptCATStoreFromHandle', 'address': '0x7ffb3bbaef00'}, {'type': 'function', 'name': 'CryptCATVerifyMember', 'address': '0x7ffb3bbc3dc0'}, {'type': 'function', 'name': 'CryptSIPCreateIndirectData', 'address': '0x7ffb3bba7c80'}, {'type': 'function', 'name': 'CryptSIPGetCaps', 'address': '0x7ffb3bba7bf0'}, {'type': 'function', 'name': 'CryptSIPGetInfo', 'address': '0x7ffb3bbca360'}, {'type': 'function', 'name': 'CryptSIPGetRegWorkingFlags', 'address': '0x7ffb3bbca350'}, {'type': 'function', 'name': 'CryptSIPGetSealedDigest', 'address': '0x7ffb3bbca3d0'}, {'type': 'function', 'name': 'CryptSIPGetSignedDataMsg', 'address': '0x7ffb3bbca4b0'}, {'type': 'function', 'name': 'CryptSIPPutSignedDataMsg', 'address': '0x7ffb3bbca5d0'}, {'type': 'function', 'name': 'CryptSIPRemoveSignedDataMsg', 'address': '0x7ffb3bbca6b0'}, {'type': 'function', 'name': 'CryptSIPVerifyIndirectData', 'address': '0x7ffb3bbca750'}, {'type': 'function', 'name': 'DllRegisterServer', 'address': '0x7ffb3bbbc820'}, {'type': 'function', 'name': 'DllUnregisterServer', 'address': '0x7ffb3bbbc870'}, {'type': 'function', 'name': 'DriverCleanupPolicy', 'address': '0x7ffb3bbae5c0'}, {'type': 'function', 'name': 'DriverFinalPolicy', 'address': '0x7ffb3bbab4d0'}, {'type': 'function', 'name': 'DriverInitializePolicy', 'address': '0x7ffb3bba1980'}, {'type': 'function', 'name': 'FindCertsByIssuer', 'address': '0x7ffb3bbd3a80'}, {'type': 'function', 'name': 'GenericChainCertificateTrust', 'address': '0x7ffb3bbcead0'}, {'type': 'function', 'name': 'GenericChainFinalProv', 'address': '0x7ffb3bbcee10'}, {'type': 'function', 'name': 'GetAuthenticodeSha256Hash', 'address': '0x7ffb3bbd1a60'}, {'type': 'function', 'name': 'HTTPSCertificateTrust', 'address': '0x7ffb3bbaad90'}, {'type': 'function', 'name': 'HTTPSFinalProv', 'address': '0x7ffb3bbadad0'}, {'type': 'function', 'name': 'IsCatalogFile', 'address': '0x7ffb3bbc9010'}, {'type': 'function', 'name': 'MsCatConstructHashTag', 'address': '0x7ffb3bbc94b0'}, {'type': 'function', 'name': 'MsCatFreeHashTag', 'address': '0x7ffb3bbc9360'}, {'type': 'function', 'name': 'OfficeCleanupPolicy', 'address': '0x7ffb3bbd3e90'}, {'type': 'function', 'name': 'OfficeInitializePolicy', 'address': '0x7ffb3bbd3e90'}, {'type': 'function', 'name': 'OpenPersonalTrustDBDialog', 'address': '0x7ffb3bbcf8c0'}, {'type': 'function', 'name': 'OpenPersonalTrustDBDialogEx', 'address': '0x7ffb3bbcf8d0'}, {'type': 'function', 'name': 'SoftpubAuthenticode', 'address': '0x7ffb3bbaba70'}, {'type': 'function', 'name': 'SoftpubCheckCert', 'address': '0x7ffb3bbaebf0'}, {'type': 'function', 'name': 'SoftpubCleanup', 'address': '0x7ffb3bbaf000'}, {'type': 'function', 'name': 'SoftpubDefCertInit', 'address': '0x7ffb3bbcf5f0'}, {'type': 'function', 'name': 'SoftpubDllRegisterServer', 'address': '0x7ffb3bbd4680'}, {'type': 'function', 'name': 'SoftpubDllUnregisterServer', 'address': '0x7ffb3bbd48f0'}, {'type': 'function', 'name': 'SoftpubDumpStructure', 'address': '0x7ffb3bbd5550'}, {'type': 'function', 'name': 'SoftpubFreeDefUsageCallData', 'address': '0x7ffb3bbcf6f0'}, {'type': 'function', 'name': 'SoftpubInitialize', 'address': '0x7ffb3bbac120'}, {'type': 'function', 'name': 'SoftpubLoadDefUsageCallData', 'address': '0x7ffb3bbcf740'}, {'type': 'function', 'name': 'SoftpubLoadMessage', 'address': '0x7ffb3bba8670'}, {'type': 'function', 'name': 'SoftpubLoadSignature', 'address': '0x7ffb3bbac910'}, {'type': 'function', 'name': 'SrpCheckSmartlockerEAandProcessToken', 'address': '0x7ffb3bbd7cc0'}, {'type': 'function', 'name': 'TrustDecode', 'address': '0x7ffb3bbc0370'}, {'type': 'function', 'name': 'TrustFindIssuerCertificate', 'address': '0x7ffb3bbc0460'}, {'type': 'function', 'name': 'TrustFreeDecode', 'address': '0x7ffb3bbc0680'}, {'type': 'function', 'name': 'TrustIsCertificateSelfSigned', 'address': '0x7ffb3bbc06b0'}, {'type': 'function', 'name': 'TrustOpenStores', 'address': '0x7ffb3bbc0740'}, {'type': 'function', 'name': 'WTConvertCertCtxToChainInfo', 'address': '0x7ffb3bbd1c70'}, {'type': 'function', 'name': 'WTGetBioSignatureInfo', 'address': '0x7ffb3bbc3740'}, {'type': 'function', 'name': 'WTGetPluginSignatureInfo', 'address': '0x7ffb3bbc3900'}, {'type': 'function', 'name': 'WTGetSignatureInfo', 'address': '0x7ffb3bbaa160'}, {'type': 'function', 'name': 'WTHelperCertCheckValidSignature', 'address': '0x7ffb3bbc1300'}, {'type': 'function', 'name': 'WTHelperCertFindIssuerCertificate', 'address': '0x7ffb3bbbc4f0'}, {'type': 'function', 'name': 'WTHelperCertIsSelfSigned', 'address': '0x7ffb3bbbc530'}, {'type': 'function', 'name': 'WTHelperCheckCertUsage', 'address': '0x7ffb3bbc1330'}, {'type': 'function', 'name': 'WTHelperGetAgencyInfo', 'address': '0x7ffb3bbc14a0'}, {'type': 'function', 'name': 'WTHelperGetFileHandle', 'address': '0x7ffb3bbc15a0'}, {'type': 'function', 'name': 'WTHelperGetFileHash', 'address': '0x7ffb3bbc10c0'}, {'type': 'function', 'name': 'WTHelperGetFileName', 'address': '0x7ffb3bba98d0'}, {'type': 'function', 'name': 'WTHelperGetKnownUsages', 'address': '0x7ffb3bbc15d0'}, {'type': 'function', 'name': 'WTHelperGetProvCertFromChain', 'address': '0x7ffb3bba14b0'}, {'type': 'function', 'name': 'WTHelperGetProvPrivateDataFromChain', 'address': '0x7ffb3bbc1680'}, {'type': 'function', 'name': 'WTHelperGetProvSignerFromChain', 'address': '0x7ffb3bbae7f0'}, {'type': 'function', 'name': 'WTHelperIsChainedToMicrosoft', 'address': '0x7ffb3bbc16e0'}, {'type': 'function', 'name': 'WTHelperIsChainedToMicrosoftFromStateData', 'address': '0x7ffb3bbc1890'}, {'type': 'function', 'name': 'WTHelperIsInRootStore', 'address': '0x7ffb3bbc1970'}, {'type': 'function', 'name': 'WTHelperOpenKnownStores', 'address': '0x7ffb3bbc1a80'}, {'type': 'function', 'name': 'WTHelperProvDataFromStateData', 'address': '0x7ffb3bbaef00'}, {'type': 'function', 'name': 'WTIsFirstConfigCiResultPreferred', 'address': '0x7ffb3bbd1d00'}, {'type': 'function', 'name': 'WTLogConfigCiScriptEvent', 'address': '0x7ffb3bbd1d60'}, {'type': 'function', 'name': 'WTLogConfigCiSignerEvent', 'address': '0x7ffb3bbd2140'}, {'type': 'function', 'name': 'WTValidateBioSignaturePolicy', 'address': '0x7ffb3bbc3b10'}, {'type': 'function', 'name': 'WVTAsn1CatMemberInfo2Decode', 'address': '0x7ffb3bbae290'}, {'type': 'function', 'name': 'WVTAsn1CatMemberInfo2Encode', 'address': '0x7ffb3bbbd300'}, {'type': 'function', 'name': 'WVTAsn1CatMemberInfoDecode', 'address': '0x7ffb3bbbd3b0'}, {'type': 'function', 'name': 'WVTAsn1CatMemberInfoEncode', 'address': '0x7ffb3bbbd490'}, {'type': 'function', 'name': 'WVTAsn1CatNameValueDecode', 'address': '0x7ffb3bbac740'}, {'type': 'function', 'name': 'WVTAsn1CatNameValueEncode', 'address': '0x7ffb3bbbd4f0'}, {'type': 'function', 'name': 'WVTAsn1IntentToSealAttributeDecode', 'address': '0x7ffb3bbbd560'}, {'type': 'function', 'name': 'WVTAsn1IntentToSealAttributeEncode', 'address': '0x7ffb3bbbd610'}, {'type': 'function', 'name': 'WVTAsn1SealingSignatureAttributeDecode', 'address': '0x7ffb3bbbd650'}, {'type': 'function', 'name': 'WVTAsn1SealingSignatureAttributeEncode', 'address': '0x7ffb3bbbd730'}, {'type': 'function', 'name': 'WVTAsn1SealingTimestampAttributeDecode', 'address': '0x7ffb3bbbd7f0'}, {'type': 'function', 'name': 'WVTAsn1SealingTimestampAttributeEncode', 'address': '0x7ffb3bbbd8d0'}, {'type': 'function', 'name': 'WVTAsn1SpcFinancialCriteriaInfoDecode', 'address': '0x7ffb3bbbd930'}, {'type': 'function', 'name': 'WVTAsn1SpcFinancialCriteriaInfoEncode', 'address': '0x7ffb3bbbd9f0'}, {'type': 'function', 'name': 'WVTAsn1SpcIndirectDataContentDecode', 'address': '0x7ffb3bbbda30'}, {'type': 'function', 'name': 'WVTAsn1SpcIndirectDataContentEncode', 'address': '0x7ffb3bbbdbe0'}, {'type': 'function', 'name': 'WVTAsn1SpcLinkDecode', 'address': '0x7ffb3bbbdcd0'}, {'type': 'function', 'name': 'WVTAsn1SpcLinkEncode', 'address': '0x7ffb3bbadd20'}, {'type': 'function', 'name': 'WVTAsn1SpcMinimalCriteriaInfoDecode', 'address': '0x7ffb3bbbddb0'}, {'type': 'function', 'name': 'WVTAsn1SpcMinimalCriteriaInfoEncode', 'address': '0x7ffb3bbbde70'}, {'type': 'function', 'name': 'WVTAsn1SpcPeImageDataDecode', 'address': '0x7ffb3bbbdeb0'}, {'type': 'function', 'name': 'WVTAsn1SpcPeImageDataEncode', 'address': '0x7ffb3bbb0490'}, {'type': 'function', 'name': 'WVTAsn1SpcSigInfoDecode', 'address': '0x7ffb3bbbdff0'}, {'type': 'function', 'name': 'WVTAsn1SpcSigInfoEncode', 'address': '0x7ffb3bbbe0b0'}, {'type': 'function', 'name': 'WVTAsn1SpcSpAgencyInfoDecode', 'address': '0x7ffb3bbbe120'}, {'type': 'function', 'name': 'WVTAsn1SpcSpAgencyInfoEncode', 'address': '0x7ffb3bbbe4b0'}, {'type': 'function', 'name': 'WVTAsn1SpcSpOpusInfoDecode', 'address': '0x7ffb3bbbe660'}, {'type': 'function', 'name': 'WVTAsn1SpcSpOpusInfoEncode', 'address': '0x7ffb3bbbe7b0'}, {'type': 'function', 'name': 'WVTAsn1SpcStatementTypeDecode', 'address': '0x7ffb3bbbe890'}, {'type': 'function', 'name': 'WVTAsn1SpcStatementTypeEncode', 'address': '0x7ffb3bbbe9c0'}, {'type': 'function', 'name': 'WinVerifyTrust', 'address': '0x7ffb3bba1da0'}, {'type': 'function', 'name': 'WinVerifyTrustEx', 'address': '0x7ffb3bbc11b0'}, {'type': 'function', 'name': 'WintrustAddActionID', 'address': '0x7ffb3bbbea80'}, {'type': 'function', 'name': 'WintrustAddDefaultForUsage', 'address': '0x7ffb3bbc08a0'}, {'type': 'function', 'name': 'WintrustCertificateTrust', 'address': '0x7ffb3bbaa9b0'}, {'type': 'function', 'name': 'WintrustGetDefaultForUsage', 'address': '0x7ffb3bbc0bf0'}, {'type': 'function', 'name': 'WintrustGetRegPolicyFlags', 'address': '0x7ffb3bbbf7e0'}, {'type': 'function', 'name': 'WintrustLoadFunctionPointers', 'address': '0x7ffb3bba1ba0'}, {'type': 'function', 'name': 'WintrustRemoveActionID', 'address': '0x7ffb3bbbeca0'}, {'type': 'function', 'name': 'WintrustSetDefaultIncludePEPageHashes', 'address': '0x7ffb3bbcbca0'}, {'type': 'function', 'name': 'WintrustSetRegPolicyFlags', 'address': '0x7ffb3bbbf8a0'}, {'type': 'function', 'name': 'WintrustUserWriteabilityCheck', 'address': '0x7ffb3bbd2390'}, {'type': 'function', 'name': 'mscat32DllRegisterServer', 'address': '0x7ffb3bbaf000'}, {'type': 'function', 'name': 'mscat32DllUnregisterServer', 'address': '0x7ffb3bbaf000'}, {'type': 'function', 'name': 'mssip32DllRegisterServer', 'address': '0x7ffb3bbca860'}, {'type': 'function', 'name': 'mssip32DllUnregisterServer', 'address': '0x7ffb3bbcaab0'}] | 6,999 | 13,985 | 0.704029 | 956 | 13,998 | 10.308577 | 0.333682 | 0.193607 | 0.258143 | 0.010046 | 0.030036 | 0 | 0 | 0 | 0 | 0 | 0 | 0.07431 | 0.068438 | 13,998 | 2 | 13,985 | 6,999 | 0.681442 | 0 | 0 | 0 | 0 | 0 | 0.702979 | 0.234017 | 0 | 0 | 0.159011 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
d9c52c3147b330a26552a550168541149356f0d6 | 8,788 | py | Python | python/example_code/transcribe/test/test_transcribe_basics.py | iconara/aws-doc-sdk-examples | 52706b31b4fce8fb89468e56743edf5369e69628 | [
"Apache-2.0"
] | 5,166 | 2016-09-02T08:48:38.000Z | 2022-03-31T19:12:43.000Z | python/example_code/transcribe/test/test_transcribe_basics.py | iconara/aws-doc-sdk-examples | 52706b31b4fce8fb89468e56743edf5369e69628 | [
"Apache-2.0"
] | 1,186 | 2016-09-28T23:05:19.000Z | 2022-03-31T18:07:47.000Z | python/example_code/transcribe/test/test_transcribe_basics.py | iconara/aws-doc-sdk-examples | 52706b31b4fce8fb89468e56743edf5369e69628 | [
"Apache-2.0"
] | 4,003 | 2016-08-29T19:51:40.000Z | 2022-03-31T16:40:02.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Unit tests for transcribe_basics.py functions.
"""
import boto3
from botocore.exceptions import ClientError
import pytest
import transcribe_basics
def make_test_job(index):
return {
'name': f'test-job-{index}',
'media_uri': 's3://example-bucket/test-media.mp3',
'media_format': 'mp3',
'language_code': 'en-US',
'vocabulary_name': f'test-vocabulary-{index}'
}
def make_test_vocabulary(index, phrases=False, table_uri=False):
vocab = {'name': f'test-vocab-{index}', 'language_code': 'en-US'}
if phrases:
vocab['phrases'] = ['word', 'other-word', 'yet-another-word']
if table_uri:
vocab['table_uri'] = 's3://test-bucket/test-table.txt'
return vocab
@pytest.mark.parametrize('error_code', [None, 'TestException'])
def test_start_job(make_stubber, error_code):
transcribe_client = boto3.client('transcribe')
transcribe_stubber = make_stubber(transcribe_client)
job = make_test_job(1)
transcribe_stubber.stub_start_transcription_job(job, error_code=error_code)
if error_code is None:
got_job = transcribe_basics.start_job(
job['name'], job['media_uri'], job['media_format'],
job['language_code'], transcribe_client, job['vocabulary_name'])
assert got_job['TranscriptionJobName'] == job['name']
else:
with pytest.raises(ClientError) as exc_info:
transcribe_basics.start_job(
job['name'], job['media_uri'], job['media_format'],
job['language_code'], transcribe_client, job['vocabulary_name'])
assert exc_info.value.response['Error']['Code'] == error_code
@pytest.mark.parametrize('job_slice,error_code', [
((0, 10), None),
((0, 5), None),
((0, 10), 'TestException')])
def test_list_jobs(make_stubber, job_slice, error_code):
transcribe_client = boto3.client('transcribe')
transcribe_stubber = make_stubber(transcribe_client)
job_filter = 'test-filter'
jobs = [make_test_job(index) for index in range(0, 10)]
transcribe_stubber.stub_list_transcription_jobs(
job_filter, jobs, job_slice, error_code=error_code)
if job_slice[1] < len(jobs):
transcribe_stubber.stub_list_transcription_jobs(
job_filter, jobs, [job_slice[1], len(jobs)], next_token='test-token',
error_code=error_code)
if error_code is None:
got_jobs = transcribe_basics.list_jobs(job_filter, transcribe_client)
assert [got['TranscriptionJobName'] for got in got_jobs] == \
[had['name'] for had in jobs]
else:
with pytest.raises(ClientError) as exc_info:
transcribe_basics.list_jobs(job_filter, transcribe_client)
assert exc_info.value.response['Error']['Code'] == error_code
@pytest.mark.parametrize('error_code', [None, 'TestException'])
def test_get_job(make_stubber, error_code):
transcribe_client = boto3.client('transcribe')
transcribe_stubber = make_stubber(transcribe_client)
job = make_test_job(1)
transcribe_stubber.stub_get_transcription_job(job, error_code=error_code)
if error_code is None:
got_job = transcribe_basics.get_job(job['name'], transcribe_client)
assert got_job['TranscriptionJobName'] == job['name']
else:
with pytest.raises(ClientError) as exc_info:
transcribe_basics.get_job(job['name'], transcribe_client)
assert exc_info.value.response['Error']['Code'] == error_code
@pytest.mark.parametrize('error_code', [None, 'TestException'])
def test_delete_job(make_stubber, error_code):
transcribe_client = boto3.client('transcribe')
transcribe_stubber = make_stubber(transcribe_client)
job_name = 'test-job'
transcribe_stubber.stub_delete_transcription_job(job_name, error_code=error_code)
if error_code is None:
transcribe_basics.delete_job(job_name, transcribe_client)
else:
with pytest.raises(ClientError) as exc_info:
transcribe_basics.delete_job(job_name, transcribe_client)
assert exc_info.value.response['Error']['Code'] == error_code
@pytest.mark.parametrize('phrases,error_code', [
(True, None),
(False, None),
(True, 'TestException')])
def test_create_vocabulary(make_stubber, phrases, error_code):
transcribe_client = boto3.client('transcribe')
transcribe_stubber = make_stubber(transcribe_client)
vocab = make_test_vocabulary(1, phrases=phrases, table_uri=not phrases)
transcribe_stubber.stub_create_vocabulary(vocab, error_code=error_code)
if error_code is None:
got_vocab = transcribe_basics.create_vocabulary(
vocab['name'], vocab['language_code'], transcribe_client,
phrases=vocab.get('phrases'), table_uri=vocab.get('table_uri'))
assert got_vocab['VocabularyName'] == vocab['name']
else:
with pytest.raises(ClientError) as exc_info:
transcribe_basics.create_vocabulary(
vocab['name'], vocab['language_code'], transcribe_client,
phrases=vocab.get('phrases'), table_uri=vocab.get('table_uri'))
assert exc_info.value.response['Error']['Code'] == error_code
@pytest.mark.parametrize('vocab_slice,error_code', [
((0, 10), None),
((0, 5), None),
((0, 10), 'TestException')])
def test_list_vocabularies(make_stubber, vocab_slice, error_code):
transcribe_client = boto3.client('transcribe')
transcribe_stubber = make_stubber(transcribe_client)
vocab_filter = 'test-filter'
vocabs = [make_test_vocabulary(index) for index in range(0, 10)]
transcribe_stubber.stub_list_vocabularies(
vocab_filter, vocabs, vocab_slice, error_code=error_code)
if vocab_slice[1] < len(vocabs):
transcribe_stubber.stub_list_vocabularies(
vocab_filter, vocabs, [vocab_slice[1], len(vocabs)],
next_token='test-token', error_code=error_code)
if error_code is None:
got_vocabs = transcribe_basics.list_vocabularies(
vocab_filter, transcribe_client)
assert [got['VocabularyName'] for got in got_vocabs] == \
[had['name'] for had in vocabs]
else:
with pytest.raises(ClientError) as exc_info:
transcribe_basics.list_vocabularies(vocab_filter, transcribe_client)
assert exc_info.value.response['Error']['Code'] == error_code
@pytest.mark.parametrize('error_code', [None, 'TestException'])
def test_get_vocabulary(make_stubber, error_code):
transcribe_client = boto3.client('transcribe')
transcribe_stubber = make_stubber(transcribe_client)
vocab = make_test_vocabulary(1)
transcribe_stubber.stub_get_vocabulary(vocab, error_code=error_code)
if error_code is None:
transcribe_basics.get_vocabulary(vocab['name'], transcribe_client)
else:
with pytest.raises(ClientError) as exc_info:
transcribe_basics.get_vocabulary(vocab['name'], transcribe_client)
assert exc_info.value.response['Error']['Code'] == error_code
@pytest.mark.parametrize('phrases,error_code', [
(True, None),
(False, None),
(True, 'TestException')])
def test_update_vocabulary(make_stubber, phrases, error_code):
transcribe_client = boto3.client('transcribe')
transcribe_stubber = make_stubber(transcribe_client)
vocab = make_test_vocabulary(1, phrases=phrases, table_uri=not phrases)
transcribe_stubber.stub_update_vocabulary(vocab, error_code=error_code)
if error_code is None:
transcribe_basics.update_vocabulary(
vocab['name'], vocab['language_code'], transcribe_client,
phrases=vocab.get('phrases'), table_uri=vocab.get('table_uri'))
else:
with pytest.raises(ClientError) as exc_info:
transcribe_basics.update_vocabulary(
vocab['name'], vocab['language_code'], transcribe_client,
phrases=vocab.get('phrases'), table_uri=vocab.get('table_uri'))
assert exc_info.value.response['Error']['Code'] == error_code
@pytest.mark.parametrize('error_code', [None, 'TestException'])
def test_delete_vocabulary(make_stubber, error_code):
transcribe_client = boto3.client('transcribe')
transcribe_stubber = make_stubber(transcribe_client)
vocab_name = 'test-vocab'
transcribe_stubber.stub_delete_vocabulary(vocab_name, error_code=error_code)
if error_code is None:
transcribe_basics.delete_vocabulary(vocab_name, transcribe_client)
else:
with pytest.raises(ClientError) as exc_info:
transcribe_basics.delete_vocabulary(vocab_name, transcribe_client)
assert exc_info.value.response['Error']['Code'] == error_code
| 39.945455 | 85 | 0.70107 | 1,087 | 8,788 | 5.372585 | 0.095676 | 0.103253 | 0.047945 | 0.061644 | 0.840411 | 0.820377 | 0.813527 | 0.813527 | 0.811986 | 0.773116 | 0 | 0.006527 | 0.180587 | 8,788 | 219 | 86 | 40.127854 | 0.804472 | 0.017069 | 0 | 0.602339 | 0 | 0 | 0.126202 | 0.012748 | 0 | 0 | 0 | 0 | 0.081871 | 1 | 0.064327 | false | 0 | 0.023392 | 0.005848 | 0.099415 | 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 |
d9f757096b57626fda60dcb4b9b3e4861d7e8c35 | 43 | py | Python | t2t_bert/task_module/adco_utils.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 34 | 2018-12-19T01:00:57.000Z | 2021-03-26T09:36:37.000Z | t2t_bert/task_module/adco_utils.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 11 | 2018-12-25T03:37:59.000Z | 2021-08-25T14:43:58.000Z | t2t_bert/task_module/adco_utils.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 9 | 2018-12-27T08:00:44.000Z | 2020-06-08T03:05:14.000Z |
import numpy as np
import tensorflow as tf | 14.333333 | 23 | 0.813953 | 8 | 43 | 4.375 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.186047 | 43 | 3 | 23 | 14.333333 | 1 | 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 |
8a2cbf97a18f79aa96f492170773f228b2ac3be9 | 44 | py | Python | tests/__init__.py | Luferov/FuzzyLogicToolBox | cacdc120aff78a07924333c2b61f10050a8db116 | [
"MIT"
] | 15 | 2020-03-21T18:22:13.000Z | 2022-01-24T21:17:46.000Z | tests/__init__.py | Luferov/FuzzyLogicToolBox | cacdc120aff78a07924333c2b61f10050a8db116 | [
"MIT"
] | null | null | null | tests/__init__.py | Luferov/FuzzyLogicToolBox | cacdc120aff78a07924333c2b61f10050a8db116 | [
"MIT"
] | 3 | 2021-03-18T18:25:41.000Z | 2022-01-20T07:24:01.000Z | from .mf_test import FuzzyVariablesTestCase
| 22 | 43 | 0.886364 | 5 | 44 | 7.6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 44 | 1 | 44 | 44 | 0.95 | 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 |
8a535c6b228009c34bb9b37ca3bf7f24ca209c63 | 17,121 | py | Python | nba_py/team.py | grillazz/basket_io | 09cfeded3c42d10113e378c4f2349348b9084e7a | [
"Apache-2.0"
] | null | null | null | nba_py/team.py | grillazz/basket_io | 09cfeded3c42d10113e378c4f2349348b9084e7a | [
"Apache-2.0"
] | null | null | null | nba_py/team.py | grillazz/basket_io | 09cfeded3c42d10113e378c4f2349348b9084e7a | [
"Apache-2.0"
] | null | null | null | from nba_py import _api_scrape, _get_json
from nba_py.constants import *
class TeamList:
_endpoint = 'commonteamyears'
def __init__(self,
league_id=League.NBA):
self.json = _get_json(endpoint=self._endpoint,
params={'LeagueID': league_id})
def info(self):
return _api_scrape(self.json, 0)
class TeamSummary:
_endpoint = 'teaminfocommon'
def __init__(self,
team_id,
season=CURRENT_SEASON,
league_id=League.NBA,
season_type=SeasonType.Default):
self.json = _get_json(endpoint=self._endpoint,
params={'TeamID': team_id,
'Season': season,
'LeagueID': league_id,
'SeasonType': season_type})
def info(self):
return _api_scrape(self.json, 0)
def season_ranks(self):
return _api_scrape(self.json, 1)
class TeamCommonRoster:
_endpoint = 'commonteamroster'
def __init__(self,
team_id,
season=CURRENT_SEASON):
self.json = _get_json(endpoint=self._endpoint,
params={'TeamID': team_id,
'Season': season})
def roster(self):
return _api_scrape(self.json, 0)
def coaches(self):
return _api_scrape(self.json, 1)
class _TeamDashboard:
_endpoint = ''
def __init__(self,
team_id,
measure_type=MeasureType.Default,
per_mode=PerMode.Default,
plus_minus=PlusMinus.Default,
pace_adjust=PaceAdjust.Default,
rank=Rank.Default,
league_id=League.Default,
season=CURRENT_SEASON,
season_type=SeasonType.Default,
po_round=PlayoffRound.Default,
outcome=Outcome.Default,
location=Location.Default,
month=Month.Default,
season_segment=SeasonSegment.Default,
date_from=DateFrom.Default,
date_to=DateTo.Default,
opponent_team_id=OpponentTeamID.Default,
vs_conference=VsConference.Default,
vs_division=VsDivision.Default,
game_segment=GameSegment.Default,
period=Period.Default,
shot_clock_range=ShotClockRange.Default,
last_n_games=LastNGames.Default):
self.json = _get_json(endpoint=self._endpoint,
params={'TeamID': team_id,
'MeasureType': measure_type,
'PerMode': per_mode,
'PlusMinus': plus_minus,
'PaceAdjust': pace_adjust,
'Rank': rank,
'LeagueID': league_id,
'Season': season,
'SeasonType': season_type,
'PORound': po_round,
'Outcome': outcome,
'Location': location,
'Month': month,
'SeasonSegment': season_segment,
'DateFrom': date_from,
'DateTo': date_to,
'OpponentTeamID': opponent_team_id,
'VsConference': vs_conference,
'VsDivision': vs_division,
'GameSegment': game_segment,
'Period': period,
'ShotClockRange': shot_clock_range,
'LastNGames': last_n_games})
def overall(self):
return _api_scrape(self.json, 0)
class TeamGeneralSplits(_TeamDashboard):
_endpoint = 'teamdashboardbygeneralsplits'
def location(self):
return _api_scrape(self.json, 1)
def wins_losses(self):
return _api_scrape(self.json, 2)
def monthly(self):
return _api_scrape(self.json, 3)
def pre_post_all_star(self):
return _api_scrape(self.json, 4)
def days_rest(self):
return _api_scrape(self.json, 5)
class TeamOpponentSplits(_TeamDashboard):
_endpoint = 'teamdashboardbyopponent'
def by_conference(self):
return _api_scrape(self.json, 1)
def by_division(self):
return _api_scrape(self.json, 2)
def by_opponent(self):
return _api_scrape(self.json, 2)
class TeamLastNGamesSplits(_TeamDashboard):
_endpoint = 'teamdashboardbylastngames'
def last5(self):
return _api_scrape(self.json, 1)
def last10(self):
return _api_scrape(self.json, 2)
def last15(self):
return _api_scrape(self.json, 3)
def last20(self):
return _api_scrape(self.json, 4)
def gamenumber(self):
return _api_scrape(self.json, 5)
class TeamInGameSplits(_TeamDashboard):
_endpoint = 'teamdashboardbygamesplits'
def by_half(self):
return _api_scrape(self.json, 1)
def by_period(self):
return _api_scrape(self.json, 2)
def by_score_margin(self):
return _api_scrape(self.json, 3)
def by_actual_margin(self):
return _api_scrape(self.json, 4)
class TeamClutchSplits(_TeamDashboard):
"""
This is a weird endpoint, to be honest.
It's got a lot of cool little stats and there are two extra
fields in the json that I have no idea what they do.
If you know please tell me.
* Last30Sec3Point2TeamDashboard
* Last10Sec3Point2TeamDashboard
"""
_endpoint = 'teamdashboardbyclutch'
def last5min_deficit_5point(self):
"""
Results in last 5 minutes <= 5 points
"""
return _api_scrape(self.json, 1)
def last3min_deficit_5point(self):
"""
Results in last 5 minutes <= 5 points
"""
return _api_scrape(self.json, 2)
def last1min_deficit_5point(self):
"""
Results in last 5 minutes <= 5 points
"""
return _api_scrape(self.json, 3)
def last30sec_deficit_3point(self):
"""
Results in last 5 minutes <= 5 points
"""
return _api_scrape(self.json, 4)
def last10sec_deficit_3point(self):
"""
Results in last 5 minutes <= 5 points
"""
return _api_scrape(self.json, 5)
def last5min_plusminus_5point(self):
"""
Last 5 minutes +/= 5 points
"""
return _api_scrape(self.json, 6)
def last3min_plusminus_5point(self):
"""
Last 3 minutes +/= 5 points
"""
return _api_scrape(self.json, 7)
def last1min_plusminus_5point(self):
"""
Last 1 minutes +/= 5 points
"""
return _api_scrape(self.json, 8)
def last30sec_plusminus_5point(self):
"""
Last 30 seconds +/= 3 points
"""
return _api_scrape(self.json, 9)
class TeamShootingSplits(_TeamDashboard):
_endpoint = 'teamdashboardbyshootingsplits'
def shot_5ft(self):
return _api_scrape(self.json, 1)
def shot_8ft(self):
return _api_scrape(self.json, 2)
def shot_areas(self):
return _api_scrape(self.json, 3)
def assisted_shots(self):
return _api_scrape(self.json, 4)
def shot_type_summary(self):
return _api_scrape(self.json, 5)
def shot_type_detail(self):
return _api_scrape(self.json, 6)
def assissted_by(self):
return _api_scrape(self.json, 7)
class TeamPerformanceSplits(_TeamDashboard):
_endpoint = 'teamdashboardbyteamperformance'
def score_differential(self):
return _api_scrape(self.json, 1)
def points_scored(self):
return _api_scrape(self.json, 2)
def points_against(self):
return _api_scrape(self.json, 3)
class TeamYearOverYearSplits(_TeamDashboard):
_endpoint = 'teamdashboardbyyearoveryear'
def by_year(self):
return _api_scrape(self.json, 1)
class TeamLineups:
_endpoint = 'teamdashlineups'
def __init__(self,
team_id,
game_id='',
group_quantity=GroupQuantity.Default,
season=CURRENT_SEASON,
season_type=SeasonType.Default,
measure_type=MeasureType.Default,
per_mode=PerMode.Default,
plus_minus=PlusMinus.Default,
pace_adjust=PaceAdjust.Default,
rank=Rank.Default,
outcome=Outcome.Default,
location=Location.Default,
month=Month.Default,
season_segment=SeasonSegment.Default,
date_from=DateFrom.Default,
date_to=DateTo.Default,
opponent_team_id=OpponentTeamID.Default,
vs_conference=VsConference.Default,
vs_division=VsDivision.Default,
game_segment=GameSegment.Default,
period=Period.Default,
last_n_games=LastNGames.Default):
self.json = _get_json(endpoint=self._endpoint,
params={'GroupQuantity': group_quantity,
'GameID': game_id,
'TeamID': team_id,
'Season': season,
'SeasonType': season_type,
'MeasureType': measure_type,
'PerMode': per_mode,
'PlusMinus': plus_minus,
'PaceAdjust': pace_adjust,
'Rank': rank,
'Outcome': outcome,
'Location': location,
'Month': month,
'SeasonSegment': season_segment,
'DateFrom': date_from,
'DateTo': date_to,
'OpponentTeamID': opponent_team_id,
'VsConference': vs_conference,
'VsDivision': vs_division,
'GameSegment': game_segment,
'Period': period,
'LastNGames': last_n_games})
def overall(self):
return _api_scrape(self.json, 0)
def lineups(self):
return _api_scrape(self.json, 1)
class TeamPlayers(_TeamDashboard):
_endpoint = 'teamplayerdashboard'
def season_totals(self):
return _api_scrape(self.json, 1)
class TeamPlayerOnOffDetail(_TeamDashboard):
_endpoint = 'teamplayeronoffdetails'
def on_court(self):
return _api_scrape(self.json, 1)
def off_court(self):
return _api_scrape(self.json, 2)
class TeamPlayerOnOffSummary(_TeamDashboard):
_endpoint = 'teamplayeronoffsummary'
def on_court(self):
return _api_scrape(self.json, 1)
def off_court(self):
return _api_scrape(self.json, 2)
class TeamGameLogs:
_endpoint = 'teamgamelog'
def __init__(self,
team_id,
season=CURRENT_SEASON,
season_type=SeasonType.Default):
self.json = _get_json(endpoint=self._endpoint,
params={'TeamID': team_id,
'Season': season,
'SeasonType': season_type})
def info(self):
return _api_scrape(self.json, 1)
class TeamSeasons:
_endpoint = 'teamyearbyyearstats'
def __init__(self,
team_id,
season_type=SeasonType.Default,
per_mode=PerMode.Default):
self.json = _get_json(endpoint=_endpoint,
params={'TeamID': team_id,
'SeasonType': season_type,
'PerMode': per_mode})
def info(self):
return _api_scrape(self.json, 1)
class TeamShotTracking(_TeamDashboard):
_endpoint = 'teamdashptshots'
def shot_clock_shooting(self):
return _api_scrape(self.json, 1)
def dribble_shooting(self):
return _api_scrape(self.json, 2)
def closest_defender_shooting(self):
return _api_scrape(self.json, 3)
def closest_defender_shooting_long(self):
return _api_scrape(self.json, 4)
def touch_time_shooting(self):
return _api_scrape(self.json, 5)
class TeamReboundTracking(_TeamDashboard):
_endpoint = 'teamdashptreb'
def shot_type_rebounding(self):
return _api_scrape(self.json, 1)
def contested_rebounding(self):
return _api_scrape(self.json, 2)
def shot_distance_rebounding(self):
return _api_scrape(self.json, 3)
def rebound_distance_rebounding(self):
return _api_scrape(self.json, 4)
class TeamPassTracking(_TeamDashboard):
_endpoint = 'teamdashptpass'
def passes_made(self):
return _api_scrape(self.json, 0)
def passes_recieved(self):
return _api_scrape(self.json, 1)
class TeamVsPlayer:
_endpoint = 'teamvsplayer'
def __init__(self,
team_id,
vs_player_id,
measure_type=MeasureType.Default,
per_mode=PerMode.Default,
plus_minus=PlusMinus.Default,
pace_adjust=PaceAdjust.Default,
rank=Rank.Default,
league_id=League.Default,
season=CURRENT_SEASON,
season_type=SeasonType.Default,
po_round=PlayoffRound.Default,
outcome=Outcome.Default,
location=Location.Default,
month=Month.Default,
season_segment=SeasonSegment.Default,
date_from=DateFrom.Default,
date_to=DateTo.Default,
opponent_team_id=OpponentTeamID.Default,
vs_conference=VsConference.Default,
vs_division=VsDivision.Default,
game_segment=GameSegment.Default,
period=Period.Default,
shot_clock_range=ShotClockRange.Default,
last_n_games=LastNGames.Default):
self.json = _get_json(endpoint=self._endpoint,
params={'TeamID': team_id,
'VsPlayerID': vs_player_id,
'MeasureType': measure_type,
'PerMode': per_mode,
'PlusMinus': plus_minus,
'PaceAdjust': pace_adjust,
'Rank': rank,
'LeagueID': league_id,
'Season': season,
'SeasonType': season_type,
'PORound': po_round,
'Outcome': outcome,
'Location': location,
'Month': month,
'SeasonSegment': season_segment,
'DateFrom': date_from,
'DateTo': date_to,
'OpponentTeamID': opponent_team_id,
'VsConference': vs_conference,
'VsDivision': vs_division,
'GameSegment': game_segment,
'Period': period,
'ShotClockRange': shot_clock_range,
'LastNGames': last_n_games})
def overall(self):
return _api_scrape(self.json, 0)
def vs_player_overall(self):
return _api_scrape(self.json, 1)
def on_off_court(self):
return _api_scrape(self.json, 2)
def shot_distance_overall(self):
return _api_scrape(self.json, 3)
def shot_distance_on_court(self):
return _api_scrape(self.json, 4)
def shot_distance_off_court(self):
return _api_scrape(self.json, 5)
def shot_area_overall(self):
return _api_scrape(self.json, 6)
def shot_area_on_court(self):
return _api_scrape(self.json, 7)
def shot_area_off_court(self):
return _api_scrape(self.json, 8)
| 32.242938 | 73 | 0.52532 | 1,568 | 17,121 | 5.430485 | 0.148597 | 0.075161 | 0.126835 | 0.160658 | 0.732002 | 0.720728 | 0.710863 | 0.690546 | 0.500763 | 0.459542 | 0 | 0.012459 | 0.395246 | 17,121 | 530 | 74 | 32.303774 | 0.809929 | 0.032475 | 0 | 0.667568 | 0 | 0 | 0.068374 | 0.015439 | 0 | 0 | 0 | 0 | 0 | 1 | 0.216216 | false | 0.010811 | 0.005405 | 0.17027 | 0.535135 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 1 | 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 | 1 | 1 | 0 | 0 | 6 |
8a55a3d92507b10ebc6e190b189a62589bd712ff | 437 | py | Python | onadata/apps/logger/models/__init__.py | BuildAMovement/whistler-kobocat | 7f61dd0761bb0aa5b27c909bcff8c29453d3311d | [
"BSD-2-Clause"
] | 38 | 2017-02-28T05:39:40.000Z | 2019-01-16T04:39:04.000Z | onadata/apps/logger/models/__init__.py | BuildAMovement/whistler-kobocat | 7f61dd0761bb0aa5b27c909bcff8c29453d3311d | [
"BSD-2-Clause"
] | 48 | 2019-03-18T09:26:31.000Z | 2019-05-27T08:12:03.000Z | onadata/apps/logger/models/__init__.py | BuildAMovement/whistler-kobocat | 7f61dd0761bb0aa5b27c909bcff8c29453d3311d | [
"BSD-2-Clause"
] | 5 | 2017-02-22T12:25:19.000Z | 2019-01-15T11:16:40.000Z | from onadata.apps.logger.models.attachment import Attachment # flake8: noqa
from onadata.apps.logger.models.instance import Instance
from onadata.apps.logger.models.survey_type import SurveyType
from onadata.apps.logger.models.xform import XForm
from onadata.apps.logger.xform_instance_parser import InstanceParseError
from onadata.apps.logger.models.ziggy_instance import ZiggyInstance
from onadata.apps.logger.models.note import Note
| 54.625 | 76 | 0.860412 | 61 | 437 | 6.098361 | 0.311475 | 0.206989 | 0.282258 | 0.395161 | 0.435484 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002469 | 0.073227 | 437 | 7 | 77 | 62.428571 | 0.916049 | 0.02746 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
8a5885ada801d4ab550967f46c2c1da95b57d266 | 21,992 | py | Python | UnitTest/TestAll.py | arlenwang815/12306 | 86eb6a1677f9bae8aaac7bf524658370ce1d76e8 | [
"MIT"
] | 3 | 2021-01-10T11:45:30.000Z | 2021-04-09T07:02:57.000Z | UnitTest/TestAll.py | arlenwang815/12306 | 86eb6a1677f9bae8aaac7bf524658370ce1d76e8 | [
"MIT"
] | 5 | 2020-01-28T23:03:37.000Z | 2022-02-10T00:21:25.000Z | UnitTest/TestAll.py | arlenwang815/12306 | 86eb6a1677f9bae8aaac7bf524658370ce1d76e8 | [
"MIT"
] | 1 | 2021-11-01T09:36:51.000Z | 2021-11-01T09:36:51.000Z | # coding=utf-8
import base64
import threading
import unittest
from collections import OrderedDict
import requests
from agency.agency_tools import proxy
from config.emailConf import sendEmail
from config.serverchanConf import sendServerChan
def _set_header_default():
header_dict = OrderedDict()
header_dict["Accept"] = "*/*"
header_dict["Accept-Encoding"] = "gzip, deflate"
header_dict["X-Requested-With"] = "superagent"
header_dict[
"User-Agent"] = "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
header_dict["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"
class testAll(unittest.TestCase):
def testProxy(self):
"""
测试代理是否可用
:return:
"""
_proxy = proxy()
proxie = _proxy.setProxy()
url = "http://httpbin.org/ip"
rsp = requests.get(url, proxies=proxie, timeout=5, headers=_set_header_default()).content
print(u"当前代理ip地址为: {}".format(rsp))
def testEmail(self):
"""
实测邮箱是否可用
:return:
"""
sendEmail(u"订票小助手测试一下")
# def testConfig(self):
# """
# 测试config是否配置正确
# :return:
# """
def testServerChan(self):
"""
实测server酱是否可用
:return:
"""
sendServerChan(u"server酱 微信通知测试一下")
def testUserAgent(self):
"""
测试UserAgent
:return:
"""
from fake_useragent import UserAgent
for i in range(10000):
ua = UserAgent(verify_ssl=False)
print(ua.random)
def testVerfyImage(self):
"""
测试模型加载识别
:return:
"""
from verify.localVerifyCode import Verify
v = Verify()
with open('../tkcode.png', 'rb') as f:
base64Image = base64.b64encode(f.read())
for i in range(5):
t = threading.Thread(target=v.verify, args=(base64Image,))
t.start()
def testRemoteVerfy(self):
"""
:return:
"""
import requests
import time
while True:
try:
starttime = time.time()
rsp = requests.post(url="http://34.97.127.118:8000/verify/base64/",
data={
'imageFile': '/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAC+ASUDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3+ivPNS1bUJdPlW2XWIJZ550EExgZ4mwMplZDkA5IIJwGA7Vd8P63d2Wi39zqC3k32C3VmR9gYkKSQPmJyeMZxQB21FcPqV14igvb/Vfs2qWlklsh8qKS1fGzeWbDk9iOnpU+r6tqVsohtdYij2W48w3GiT3DuxGdweJ0QcEcAcEHnsADsaK4Xwrq2p3un6fBd6zHIk1oqjydGuIpQxQYbzndkyPUrg0zXZdR0fxLpVqmq65c2k9rdTTpbpC8i+W0IDAbMkASNkAEnjAoA72iuH1C6iNlpk1tr11d2lxcPula7WDpE+FLoF24YDIIyCMYzxXKXOoapB4f1W4k1PUY5LfT7qaOctcxqZlVygjJkZWA25ywGRt4OTgA9jorh/Eev3507xBFb3OnWwtN0S75mWU/u1bcMdPvcfSpdS8RahBZ6lEtxYNLHps1zHNZuWKMm0DIOR/F+lKTsrl04OpNQW7djs6K8t/te+WGCAXOvLM9zsuws0MsxHkGUeWfuKMEE+2e9Ra/4hktvDVguma1qkEt+gWOC9MJdkZjmV5D90EHAO4AYHTBrneJik3Y9eOSVZTjBSXvPz89dL9vu7Hq9FeZaHrl5LqmnaWNcvCsjeWn76yuOFUthim5uQOp596ojxbq41DUzFqFrK90lwDAWZfsQh+VW64GRljgZJFH1mNr2BZHWcnFSW1+vd+Wmz+63VHrdMlkWGF5WDFUBY7VLH8AOTXL+Eb3UjeXmlX17BepY29uYrmNWzKHVjuYljk4Uc+9X/F15e2Xhy4l055EuuAjR2zTsPXCrzn36VvCXMrnmYig6FR0277fc1dfgxLHxjoWoXc9tDfoJII1kkEv7sqDnghsHI25PHGRWqt7ava/alnQweX5hfPAXGc/lXk9vpV5renWdtfLaQ2124WR57Xzi0xGNjElZM4XlsgjgDpmtUiCP4eyC00m0hutXn+xhNMtxE08JkKkjLdTFuIy2AT171Rgdi/iKOLwoddmgaJTbmeOByA7cZVf948DHqavJeiCztXv2jhmm2oQM7d5HQV5/LplrZXemxXPgfTTHe3KW3mXdyJrjB6kjYQcAE/fPSu6tNA0qwtTa2tlHFbmQSiJfuqw6EDt0HSgDSooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigDkbjwfcXuo+bd3kTWv2uW4WIQI2wMuB99WDE9zgY4x3Jh03wrqMWnalaXEWnRJqE6LLEu2VPIAw4wIo1LMMjBXAznJxiuu86T/n2l/Nf/iqPOk/59pfzX/4qgDjR8NdFJKPpOiGJmuFJGlwBgj8xkEJ95PujsR1ya0zp+vxypOh0+aV7CO2nDSPGokUsSygKeDu6e1b/nSf8+0v5r/8VR50n/PtL+a//FUAc/pGl61bXekrerZC2sLJ7ctBM7M7YjAJUqB/Ae/er13pU8/izS9VVoxBaWl1A6kncWkaEqQMYx+7bPPcda0vOk/59pfzX/4qjzpP+faX81/+KoAytb0u8u5LF9ONvE0E0jyeYWXIaN1JBXndlgc1zN94M1+XTtYt7e/si2o2M1oyzKMEupAYuE38ZPUkc9K7vzpP+faX81/+Ko86T/n2l/Nf/iqAMrXPD9rqOk6jFBZ2v2q6jYeY8YyXIABJxnoBz7U3WfD0N7o99bWENra3VzbtAJvKAwrYyDjscVr+dJ/z7S/mv/xVHnSf8+0v5r/8VSaurMunN05qcd1qc6/hK3h1G2lsILa2tbeCbEUabS8zqEDHHbbu/Oq9x4SmufDGjaaWhS5tGthPKpIJSM/MFOOvJxkV1XnSf8+0v5r/APFUedJ/z7S/mv8A8VUexhqdSzDELlfNqv8Ag/5s5KHwheQeKrK9S5DWFo7OvmzF5GJQrjbtAHJPOTUOm+EdXs9Vt7ie5sJraE3m2EI2R5xyAT/EPXpjtmuz86T/AJ9pfzX/AOKo86T/AJ9pfzX/AOKqfYQ/r+vIt5piGrO21tvX8feZg+GNCvNLur+6vVsonuFhijgst3lxpGCBgsAcnca09W0S01qOOO8a5CRtuAguHiyfcoRmrfnSf8+0v5r/APFUedJ/z7S/mv8A8VWkYqKsjkr1pV5upPfT8FYxbjw5NFpcdnpV95BjkMga7Q3GD7ZYEEduabpfhl7C808y3CyWmmWi21nEFwQ20BpGPckDA9Mn1rc86T/n2l/Nf/iqPOk/59pfzX/4qqMiC70u3vb+xvJt5ksnaSEA/LuZChJHfhjV2ofOk/59pfzX/wCKo86T/n2l/Nf/AIqgCaiofOk/59pfzX/4qjzpP+faX81/+KoAmoqHzpP+faX81/8AiqPOk/59pfzX/wCKoAmoqHzpP+faX81/+Ko86T/n2l/Nf/iqAJqKh86T/n2l/Nf/AIqjzpP+faX81/8AiqAJqKh86T/n2l/Nf/iqPOk/59pfzX/4qgCaiofOk/59pfzX/wCKo86T/n2l/Nf/AIqgCaiofOk/59pfzX/4qjzpP+faX81/+KoAmoqHzpP+faX81/8AiqPOk/59pfzX/wCKoAmoqHzpP+faX81/+KooAmorzb42ate6P4PsZrG/nspJNSSNpYJmjbaY5DjKkcZA68V45beJvFszhF17VyCMjbeSH3zkt/nNY1Kyp9CJT5eh9WUV8rxeKvE5kLnxBqh2ttKrfSHB9xupV8W+ImVVPiHVhufkm8kyB/31WLxiXQydfyPqeivla78XeI/NjRfEOqrk87byTv8AjWrD4n8QJpiO+u6kWYFgxu5M4OSO/pj86mWOjFXsP2yXQ+lKK+YW8VeIlt8nXtU3HH/L5J9fX6UW/ijxExUNr+qHjn/TJO5z60fXo2vYp1UfT1FfK+qeLvEaqFj1/VVLsFBW8kH9a+pJgfKbBIPqK6aVVVFdGidySiseW6dVOJH/AO+jWJealcofluZhj0c1qM7OivOhrF4s6sby42BgSDK3T869DzxnNADqKytflmi0W4lgdkkTa2VbBwGBPP0zXzTqeseMrfULu2j8Q6wscdw6JI2oSfdB46N6VMpKO5dOlOppBXPquivkmPX/ABf5ny+KtWxngtfyn9Mmu08B6zrsOvebqPiHUL2NoT+6mnkZMqVcnBYjorDp0Jqfaxva5s8JWUXJrRH0FRXnXxn1K/0vwfaT6de3NnM1+iGS3laNivlyHGVI4yBx7V4aPF/ij/oY9Y/8Dpf/AIqtDmPreivkoeL/ABP/ANDHq/8A4Gy//FV13h1vEV1b/wBpax4m1mGxH3UW/k3SH0GG/wA+wyaAPoeivGtf8bajpWlNFaX6Wk7sI4DdSyTy5LHB2jLHK9AQQCRyciuPPj/xhHPLGfFd0zQrG8qtpi7Y84zvIGVABHPU85A4oA+laK+eF+JWo3Vvs1W7dYCB/p2kXsuIckDMkZO8DJ+9wORgMcCsbV9Y8TWDLNbeJ9WuLOQboplvpCrLkjIO7kcEfUEHBGKAPqCivkr/AIS/xP28R6v/AOB0v/xVfUetyyRWSNFIyN5gGVOOxoA0qK49bu7Y4+1TD38w01L+6cZFzNkEjBc0m0iowbOyorkTcXpAYXE5x1AkNSLc3eTm4lx2+c1m6yN1hpdzqqK5b7XcBubmXH++af8Aa5xwZ5ef9s0vbLsDwzXU6aiubF3MOs8vy9fnPNCXE0rKiXEm4thj5h44z6+4q1NMiVFrU6SiiirMTy3482y3XgexRlLD+04zgHH/ACzlHX8a8JvLNLSOGJIVkZkB8thyOfUdfxr6F+MlrdXfg+2jtY1kIvkaRWfaNvlyd/rivn6DR5Znth5mwSSqrbiSQOSenpxz6kVyVYynOyN4U3KOxUuUgaGOeJEALYkjwA69uAR/nmtUaXYxRnzJH3BeAGUZ9f6+9TixLeIGW8vWuzapum4C4wCRx36j863m0m3lsrdY7SIzGLfIJcH5vYHp+naksJUmtA+pc0TBNi0U8Ms1vfQ2rgMGKK7L6/KXGcY9V6VVk1LZCkMqPhlVVLDbkYxwBn0HPuKuXekzXUgvI5mljcjIKgeTlRwFAHAAJwB2AweobceHZrpUWMqHQAFwcHO3PfnqfT+KsZYaUZJSRi8HJaMry3EcqHBKxgbgT7jipYrmGMF9wx0XCk+wHFYckcsd29nJclJV+TBztyAPT8f8KS3guBbsJN2QTlGHI9x6j/6/1qHh0lYiVBbF++VzexIyuAq78MD9PT2NfYUgzGwHUivi9bi/SXc87thcBi3JH4/y/wAn7RPSuzDRcbpglY5i4lwpHpmuev5uTzWxfuVkkU9mNczfS/Oa6rFDC27qe1ep27+ZbRSA5DIG/MZryON8mvUtFYvolkxOf3Kj9MUCF1cbtEvwMkm3kGB/umvnLxJCItYux2aQuPo3zf1r6ZdFdCjAFSMEHoRXzb4ojK6m7HJ3xxkE9/kA/mK5sQtEz1spdqsl3RzQ/wBYa6rwoVOtW6t/Gkkf/fSMP61ynSQV0Xhx9utaee32mPP03CuZNcyZ7EvehKPkemfHX/kSLL/sIp/6Lkr5+6ivoH46/wDIkWX/AGEU/wDRclfP1eifJGt4e0w6lqQDBRFEN8jSHCKOuWPZQMk+wrrLzX0toLa7R2jDs32CKVARDCuf3rAHly2cccYPbbWdo0DWnw513VlYLIzpArDqAWQN/wCOsR+NYfia7ke7dIWDaejCG3YMHDCJQm4Ec4P3h2O4n1oAytc1W6vCIJZmkjLmYlhyzHPJPXPJrHCgnJzheSR1AFS3B3SqT0xTmtmjgZs5YgAjHQDkkfpSuaU43ZPZX0kbDdd/ZfLjKq0EK5k6AqcYJBHrkEjkc12HhjUbM3sdrKobSNVk8p08sqlpck4UjOQAwA4DH/xwGuAHbH5frW5aCa80S+hNqix29ssiOsbLuYSIAx/vEIzYz6mmZl3XNKl0XWbnT5clom4Pqp5U/iOa+q9e/wCPFP8ArqP5GvmnxdcyarqVpd+Xm4uLSGaQID1dFfj/AL6/lX0vrgzZJ/10H8jTQI53y2c7VBI6nHoKao2KrYJLjd9KsJMLYO5zypXgZp8bW6lwrYUKBgjOR169ulRJG9N9yNpvLjMh+4Bk1Fc3AghDsCcjggfjViSezWLMhTYwyQcjbmkuL6yW3hEhQqxUbj3BIHH4EVi4M6FNFa5ZlaNApJZsZ9//ANYp8kc3mxnaUQY6/WjU9YtYI1dlRWyDg4z97Bqrq/iOO2NvIr5RZlLMhBAGcfypKm+pTqvojU+zEXMZLoepwDw3B6/nTvtcFt5pUENE2WC/MOgH8v5VyGveJfsV5CxlU4IZ9w52YwT/ADrC1TxI8WvlYVhuUvIxGsqnhG2hdw69z+lWtCOVy1Z7pRRRWxwnBfFxnTwjAyHCi8UuQcHaEfp+OPwzXjeBYWIMqkSlRI6kn5PQcdSWzg1698Yh5nhSwg27hNqcUbL6rtcn9Aa8d8T3KH/QYSWYBXkIOdv4d/X61tTirXPQw02oWH29itvbvfXQWRpfLZo2z8rZy2QRx8gHHQ9D1rXL3KWr3c4Al/eRRxryHLN+7B7cBfxBpoVbyz02QhlinxPIv3gCFHr09MD1NQ3txMi2DXYCqJmd1EnAx9wZ46n9K3ilBaGrd9iPU9Re1uZLOCJlKqFSKI9SRvYkemMD8T71RsYLtp5rrzHt4kZtqMpyeRkEHn8aks7ORme8maUS3M7A7eAkaksw4PQgBc9sitHV1MNgEIYInls0hOck5BH6A/jU8nN70jXnsrMwda06C6IuWjYNuwSrdS24/of5VmP4ev0CJAjO+GETwvl2XGSQo7AEc9Oa6fxI+57DSrZA8sn79lUYIUDjJHr89a93odhOkUV6rE7hFFKsTOVJPqPu5AA3dvyrkxFJKLmuhhVhFxueSKbm2YpBOFGeY5W6Hv7dfavt1ulfMF/8Ob4mSW1lS4BY7dku4n67gv8AM19Pt0rmw9aFW/L0PPmrHIayNt7MABy3T8K47UJo0c7pVHseM12fiG3B1APl1ZcOGjcqwOMdRz2NcXfWMAkcsjOzHLF3LE/UmupMgoreW6nBmQ+ytk16n4SnFx4btnDbsblH03GvK4LS2ifKW8Sk9wgBr0zwXL5miMuMeXMw/MA/1pMR0TdK+fvHMCQ6uyZwE3xqMdlkYf0FfQPOK8O+JNv5GrMvfzZD+e1//Z6yrfCehl38ex564t1IwZS3uAAP1rW0u6trdQ5gleZSCjecAAe38P8AWsWXh6vWbcCuOT0PfpU/es2z1746/wDIkWX/AGEU/wDRclfP1fQHx1OPBFnkgD+0UyT2/dS15jo2m2Wk7ZL7Tjf6gyiRbd1LRxDG7BXqx2gnJ4xyMgZr0T5EoaXdyT+E9Y0hAC7xmeNCe6MkjH/vhG/Ks3xMlrPeNq0UoU6htuUgALcOMyNu6cSB1x/s5+t+LxB4ue+DWc+h3CebuTT4zaudoGQMpgkY4+Vs8dqksriz8UafLYG2XTL/AE7fMYpld0QbSJFC8lE3YOMEpx1yxABxE46N2/yaWSaRgyqMqoALDvnr/n2FW9SsLmzuZrW8tzDOhIMZ7Hrwc8jpgjIxgg+sa/bprRIVhkMfRSsZVWGc5OAMnk8k9MCkylO0bdyjjr3H1x2rqtC0aa6l1CFtQR4fJEMs0UUkiqoYM2DjHCpnjIx0yM45+S0ezdDewtsYH5Vcc498HHr07dutdlprbfAepTtYNb22yIWxdwWlxMBM4OAc52JnbgAEDJU0yS7rvi2a10hrTw8klqgSKA3Ua/vUjQKu5mXJ6Ko68ZA56n6O1oZs0/66D+Rr421N1uQiRsRFuyBu3YPPU4GSOmfb8T9lauM2if74/kaEBzF/HK+n3AhYrKYzsPo2OK4BfFAgguVkjKxCGMZU4JJH3jyPevS2X5TXjmp2yRXlxAUyBFLCox1MbcfoaUkb0dTVu/E0jWEMaMfOAJKsOMDpj8/XtWfdeI5pILK2XPmLEodnBIOD8uOfRRms0P5i2six7UO5T+K5FULr5Ht5CTvGUA7dQf8AGoZ0JHQalr13dyywyFY1TC4XPOOc/U5qrd6rdXrwwTn5YAIwR3Hv69P1qpKoF6zbv9ZEpHvUc4Kzh8Ab1BzR1GiyZpJ3LTTyySKCpMrFtvOQAT9aoySP9ht2VtjxSnOOMY5/manLqJ2XcSDzj6jH9B+dRunm210hHDMHHsO/8qhmkT6looorc8s4v4lWr3OkaYVx+71BWP0MUq/+zCvC71dlvql8WMkjyEbsfdTquPT+EfhXuPxQ1S20nw5Zy3LECW+SFMDPzMj4z6Dg818/+J7wjwtG9swHmXJDgDO9VDdfb5VrpptKDZ0Qm1A6yx8uTRtG3E82asFHXkx4/LIrJa0aS8uTEqrH50dvFlh+5VUXe5HoAMfU0unapJ/whehs0Si4eVLYSIvKor859isYB9yK0bWRL23u3kAaKO7W24/hUyLv/TFb3TSRtTnpcrFRbQowhnVViVz5faJiTg++I8H13e9QI91re6N528pZZHY+XuAILbV6jgHjP6Vt3FzJe+Mrix8t/sdpbfv2YYDSOVIzzyAn5c1oWEVpYaRNfyKkVojNtCAAlN7bcepwVwKpxvrfQvmvqZOoWgk1uEO/zx2qxzMOAigsxP6jH1rYu9Kik0WzvF1GOyEUfl7Zlwg54ywIGcY/OsPSpn1DR5L8qga9umMsm84RckKoz144Htis3x7JZSW1hBIzxoWZ0VCSR8qjdjpzj9K4MdT56FoysTUk+U3sa5aRiVrQTRbuHt5Tlx6jPyj8B+NfQLdPxr4wtFubNy+l628LHrtco344r7PbpXBhKPs3L5HJUlexzuvx5mRvVMfkTXF6iuGNd7riFhE3bkVxWppgGuwzMJThvxrvvAsoNpdw91kDfmMf0rgDxKR2rtPAko+03cfdo1b8jj+tMR256V498Urci9klbr5qlfoyAf8AtOvYTzXl/wAVYTJ8wGNkUTZ9fmkB/wDQhWVX4GdmBdq8fU8Xm4erVmelV7gfNU1oeRXC9j6WOkz3T4rxxS6RoaTtthOswFz6AJITXzneavPLZX/3Fe8bMpjyoQZJKbegBJBHptx61778cnMXgywkHVdTjP8A5DkrxTVrKaWxm1WzZ7i1uHVrob+YJ8kEsox1LMAxGAHwOea9I+POOMA+zxyhm8wEKccken0rotM1u6l8VaXqTlFumaOGaVkBDLgo2fXKk5zzwKzobVWspSI7fAY7XZmDjGCQoBIz1HIzzW1odomjb9Vv4jvMObOFsfvHZflkKkH5FDbgepOCDSsXzItXGhaNd5ay1YWk5wJIbtSUVu5Ei/NjoANpPHJNSzaNeHG3xHpEeBg5Sc5+p8r/AArntgPJZvXrj/65pBFGB91T9eaLGdjYEWh2Eqy393LrF0n3YCPLhU4575Ydwfk6DIIyKVtdOoajH9viZrLb5PlRxhRFGRj5FIwCB0GOMLjHFZHAGAAOlB5z70xk+seH57HzJYXF7px+aO9hXKFTj739w9ip6EEcjmvrnV/+PRP98fyNfIcc80OfKmePPXa2M19d6wcWif8AXQfyNAGNXmPia3MPiBmAwBcjaAOokTBP55r03fzx1rl/FGivfRvd2qlrvEaopOB8rbv6miWprSdmeZSh7fTHLv8A8e8i5H0baf0qLUo2jgY7fuTAj23D/wCuK6G90N5G1SJYX2kl0yOGygOAe/Kmq15pF3NpUku3Ms0KOqAc7wAcf+O1kzsjYyXIZ7KQ9Crof5ii5VjHC/GOV/TitZtAuzBawxxFnimVmPHCE4Oc1ei8Oz3DC1KIZdwkVwPlwOSD+ApajVkcvIWDQSBf3joxBx+P8hWxZacW1BY3/wBVPG6gZ5yOv866aw8LQfbhbyO5W3XfGCR83BXBz1HJ/IVr2Njapezs8MbMil0YgHaSOcHt+FTa4Oolseo0UUV0HmnmnxwmaPwRaxjBWbUERlIHI8uRgOfdRXg8dtpl7bGx3lWc7VY5YxnPGOD1745PSvp3xz4R/wCEz0SHTvtotDHcLOJDD5nRWGMbh/e/SuV0L4NwaC5lh1dZZzx5r2nKjnIHz8df0rCop3vAtPSx49ZxPpmnxbZBJtyqozEncfmZwB90EqOvXNb3hy4trvSrwx+cjJqYkjhVQzSvhWAI6AZBP4E+9ei6j8In1KQyT68CwUhc2WQOOON/OP8A61L4d+D8Wg/aGOsNPLMGG9bcx7cgDgBzyCM5+npXThas1/FLU0jn7KCF4buZ5VCu+bq6Jyh527A3cD7ufw69M3VdLHiOa2Q3zWNvbj93amPfuOSQxGQM7SBtIPQ9ckV6Hc/DqacJGmsJFbxD91EtpwpxgE/Pzx9CMnBrMs/hFLaSvN/wkAeWRvn/ANDIURjO1FUSfKAWJzySSc9a6KtdOD5Vdle0XQ4y702azsIdOso0hs7eYZmY7iy43GQngAh9uB1yDzgjEmofDjU9TeS6WRYBGfKtLe4jLYjUAAllJwSctj5sZ65yB22o/C68u4Z4LXxDHaQzMS6rp4O7PXd84zn6DPfNdTbaBfQgb9XMjAcsYME/+PV5eNq4mpFKnD8UHtE92fO1/wDDnWbcsDYLcRr8zPbSq7N+Bw38q+pzWZ/ZDMAJZ45MdMw//XrUIzU4RVtfaqxlNp7GZrC5tkPo39DXFaouQa9CubcXEYQkABg3T0PSqj6Fp0rAvbhserNj8s12EHkMxIkz2rqPA0mNcI3cNCy8dCciu4OiaUQAdNszj1gU/wBKmFhbCWGRYlVoQQm0YAB68U7gTda4X4l2ct3YW6QR7pZswoP77bkIH5Bj+Fd5ijGKlpNWZcJuElJbo+epPhh4slXeunICSflM6Aj9a09M+EGvOhe6uLS3bHCbyx/QV7ltFGKz9jA63mNe90zzH46/8iRZf9hFP/RcteBWt3c2UwmtJ5IJB0aNtpr6l8deEP8AhNdEh037d9j8q5WfzPJ8zOFZcY3D+91z2rz3/hQP/Uzf+SH/ANsrU4TyBdQuUuxdpIkdznPnRxoj5OcndjOeTULSPJIZHdncnO5jk17N/wAKB/6mb/yQ/wDtlL/woL/qZv8AyQ/+2UAeLjgYFFez/wDCgv8AqZv/ACQ/+2Uv/Cgv+pm/8kP/ALZQB4vRXs//AAoL/qZv/JD/AO2Uv/Cgv+pm/wDJD/7ZQB4vX17rhxZJ/wBdB/I15V/woL/qZv8AyQ/+2V67f2f26BYvM2YbdnGex/xoA5bfzUM8zRpwCRnJrd/4R7/p6/8AIf8A9ehvDoYYN1/5D/8Ar0FXOQeWIJBIDzG5Xn0zUN3PDb6jCWxzIp68AZGf0zXVSeDopWYtd9f+mf8A9eoJPAlvKm17tjweqHvn/a9x+VS0aKa6nNC7t7bVQpcAOpX+o/rVZ9ThtdVgdAShYoxVc8Edfwrrj4EtzIj/AGlTtUrgw5zwRn73vU//AAh64AF5jHYRfL1PbPocfSlZjU4o5L7Xc/2350NuSpUg5+Xdlh6+hDVLa2s76i0m4LlcsMkjae3H1/Sutj8LMn/L9kHkjyu/r196sReHxF0ufyTH9aOXuDqI2qKKKswPOPjTq19o3g+yurC6nt5P7QRXaGZ4iy+VISCUIOOAevYV5VJfeJ7m2Wa08Ua2JthdoUv94OAc7StwzN0x92vSPj5n/hBbLGf+QknT/rlLXg2i6nb6XNI1xp0F4kgAIkJ3IR/dIB/ln8M0pOyGlc6iz1Dxhc28cw8QeIHR4w+5Lq7IGRxyEIPboecjpVeTU/GS2xuR4r1QRB/LHmX1xH8wJG3L7eQRyP8AIz7iCO30tfEOnSyCM3L2gSVUVkfYpLArxjDEA4HQVp3msCH4Z2Nk4kM90z4zIwEirIxyR0wCAMVm5tNWRSj5mXc+LvFEMgVfFGtMuOpvZBnkg4Icg8g1D/wmnir/AKGbWf8AwPl/+KrGeVpFjDdI12r9Mk/zJplakG5/wmnir/oZtZ/8D5f/AIqj/hNPFX/Qzaz/AOB8v/xVYdFAG5/wmnin/oZtZ/8AA+X/AOKr6o8VXE1tpcTwyyRMZgMoxU42txxXx2elfYPi4A6VED/z3H/oLVUdyofEjk/7S1E8/b7of9tm/wAaSTUr5omDajdpx1EzAj9agPy8cmoZrVJ9nmsxVTkqOAfr61tY67Iams6hvDSanqDIDgMJGAP61YOvXR4XUrtj/dEr5/nRnb8o49u1RurJG7IPn2nApWCyHQ63qMrOpvbxShwd0rf41I2q6iOl/df9/m/xqjaOklojIclhl8jnd3/KpdmDRYLIsDVdSP8AzELr/v8AN/jThq2o/wDP/dH/ALbN/jVM9eKUcUrBZHp+pSNHbqUYqd4GQcdjWU13MP8AltJ/30a0tWOLRf8AfH8jWA8mKiOxxFhr6Yf8t5P++zUb6nKqk+fJ/wB9mqEj5OMnFP0loLvUJo2YO0CqzJjgbun8jTYyCbWrsNxcTKP981s2RvZIVeW5lUsM7STkfWo9Zisr2xksrqJXRhgccqexHvVnTnmktYpJ4hG5Qb1U9D7e3WpckATS3MLDdPJg99xqI3sw/wCW8n/fRqDXRPdyrYWs7wSookM6qDjJIGAeD0OR9PrWXdR6tptl58nkXypgyeWphZV7tglgcfUf1ApAa5v5v+e8v/fZrI+Lk+rQeGdP/se7ubWeTUo0klt5WjIjKPnJBHHQ/hWEfHGnBDttrsv02OFGPqQT/n9d/wCLa3L+FLZbVY2c3qhhJnG3y5M9P8RWdeVoNoTPA7nxT4itGnth4u1ieWIgmSO/m2gdx985xkfiKWHxj4na284+JtXCZJBW7lYrgA9N3PGT34Bz0NVk0ePUNXu7uad447eTy7nZFuxjgEY4OSM4PJ5wGPB9Ej8NaJcWC20mmLEkStj98VKEHcArMm7aSXJJ/AEHjmjeSu2JK5n2F34v1XT7W0m1rWYJpyVhuFunXJGWDHDdCPXqvI5xjtbDVb2LT7S0bW55Rwn2s3DMxbcylXy+V3EMEJ6FcH5htNcxPbWCNZW1vDIsTgWcrjYrglo8nAwAcn5cYJODwCZLR0injW3UvLKzlGkjbeUJZyuTyMH1wMYHoa0pwcd2UlYsJqGqxX9wx1K9MciIEQyMVG3JYg56sGU4H93knvj2x1eynS4fxLqNyHDlkN5IysD90qM8N9zgcAFsAVpzefuilhjwjqFaBuSv+yTnnGSOOOvrVHVNPnRg6ssTMvCY4znNaWGMk1LUJ2nlg1vUo1uMY/0qQFCcdAzYU8njHpxVefWdbkmAi1bUYlVg7kzv83PIA3ZA4Pt/KsWS6mN+Iwx3xBiQTtzkHA47AnnOenTmprUhJPKDIsWDtCoSC3zFyT0AOQc5P60AfQ1FFFWSeV/H3/kRLH/sJx/+ipa+czjkn86+jPj6M+BbHgn/AImcfT/rlLXl/wAKfDkWs+IH1G7VZLXTQsu0nh5iTsBHHHylsf7IHepnJRXM+g4x5nY6Hw74OuNL8HyjxNGq2d2yXBtWYrJGoK4TPVWkbyuOoCkHBzXaQ6P4TsrBZJtNsBpsUH7hbpPN8smSQtgvk5Y8457YzWT4p8WvNczafbQs0MEu64nZtpcocuiL+G3d65wOATQ8NxSanEbWeKRrjTlEbN5wdGOSu5EwNvKNzznOSa4KtaTpOojowypVKvI3p1ZuW3hn4f8AiKVxBpNv5iKGZFWW3OPXHykgZweOM81ka78J/CrSrHaXtxpt1PxDCZVkXjqQrfO3/fQ711Nvo99p9hf3FkB/aDWsi2sfynMmMqeeOoHXj1rweTRb+71CWGWG6nv3YmRZEZpWOP4gfmz1681tl1CpioOTny2O2WGpubUNUh3ifwRq3hdvMuEWeyY/JdQglf8AgQ6qcYOOnoTiubP+cV9AveJoPgRP+EjdLpkg8qVJMN5rHomejEZAJ5+7nPSvn7HGcYzTw1aVS8Z626rqcGIpxhLQQ9K+w/Fuf7Ki24z54/8AQWr48PSvsTxXj+zIskD98Ov+6xrsh8SM4fEcaFGOn1z/AJ/z2ppxnAIP+f8AP/1qc7h5Ai5JC7iR6H/P+e7JIGWASlRt/Wu72emprKq1oLtFNJPTt71Uhu9s3kOxw/IPWr3BGR3Gfb/P+fplZFwlzIpzWp3edbHZN1Yfwv8AX/GmwXC3IZQNki8SITyD/X61aILcj7o61DNbQTjMiDKj5XHDL9D1Hr2qWigK45WoJrhYuis7Hoq9ajWW8SCKOaMmUAK0pwFkbAyw9j1xj8u9hIRGd7H94erd6QHpusc2i/74/ka5uYHtXTaqM2q/74/kawnjzWcdjhKMEDXM4iBxnv6VeGi2lrM2oRCb7U8QieUysdyg9xnbxjg9R+JqGIm2uVkC7hnlfUVem1/SoLZnmuVbAI8vHzn0wv8AWlMaFa3JjOAGbHORyavQjcoOMcc1naZqkF/GJbfLREA9RlcgHBHPP41pHcTvjbGP4eOakYs8KtGTxlecnsBzWdqWxNPuEPJkRokUclmZcAfrn2GTV5ys0ZSRBtbhg3Ix3rn7WzSD5yAZiAHb/ChK7Aq6ToNrpxa4MayXcjFmkPO09Sq+gGfqf0FD45zXMPgmy+yzGF31KNCw7gxycdCfyrpc1j/GHXk8PeELa6e1NyHvUiCiUx4JjkOcjn+Hp70VErWJPMPh/o89pa3V08s6XM7ltrQt8wAPI3AZPzE59j6NnvbS2nt4JDIlxNHJyIpSGK7sn+I5wCemQBtwO9ea+GfiLJeahdDVvsun2CxF5ZICwkzwox1ZzyOmOmc8YPZeHNc0jWbS5+zXk95HJcsjR3ZLE7wSAF5+XaCMbcDax6c1haxaNNZ5LS2jQKkDRsQ2+KQx7R/dGQRyB3PHXrmpl/02eNZ9OhlSNt0cgmBUAqQTgrkHIPHow55ID42vYkD6jcWsUaAbo1kAjVACcfMoPGcE8EgAjGSKjeeKynhZTBBBIwjyScls7QBzgHcRknI7YOcik2BppyBuU8cgZzVXUCxVcMuM5AC5BPYGo5rm2WUCWUK0RVsb9uQSQD746EHoce1VdQuphaSNCdrKMgSDKn8R1qgOa1e3aeQRmJvLilaRtrYc5OAFPpgjj2rLhP7x4owoAySs6ZZgpG44BAwRwPT8a6KaRjJZwzZWeWIgHyyB5qcn6ZAYjOcgdfXLaJLeWRGhDKwMypyT1GR09wfx/EwwPoOiiitSTyv4+/8AIi2Pf/iZx8ev7qWsv4YW0Vh4DhuPNOLmaW4lLADZtOwc+mI8/jWp8ff+REsv+wkmf+/UtcUkMt98FYIrbPCbnQDJZVmJb6Yxu9SB71x4z4EvM6cJDnqcrOttfD8V/cm6gnt5rJ5S6TI4dXXf0z3PBz7g1zvha9/sbxE2mmUsWV1kJ7lZ5xn8gfxxWD8MLy6sfFcNnG5+zXiOJF5wNqlgwHrlcc9iRU8cTyeMXvI2PmrczIqA5BHnSuzE9uXQD3bFc9OHuyijSpgFgqtl9o6fXfi0dD8RXOkyaRKVgcI8omXPIHzBNpz14G4Z77asav4mMHgxtb0pBOpjDRBwxHLBTkDBBGTnJHI/A4Xi7wJB4gvBqOmXaQ3coAuY593ls3rkAsGxt4rf8MaO3hjQobA3ZuJ97SSOqny1JP3VyM7fw7mubEulyRlF6rddzWipqTT2PEtV1rUdcuRcahdyXLgYTPCqPRVHAH0/WqHc9c9817Ne6hpVveyfZfDWn3DI7B53t44yzA4OD5bE85GePbI5rP8AH2kaZJ4TXVLbT4radGjZXjjWNmVuqsFOCeQcnPTjA698MUouKcLJmdbBVILnkeUHpX2D4vbZpcDf9PA/9Bavj4/1r7D8WqG0uH2nBA9flavQgve0OSHxI821trjTrgXsQLW5UCQDqB/n8PT0OM3jjTzCUa62Y6oxxj8Oo/Gu0zvXDAEH+Hrn/PtWPfeFNBv5fOutNhZ+5wRn8q9FzvGxpUpKRiaHq8er37zwAtbW4I83opb/AAxnmuptgzod2QoOFyMH8f8AD6Z68Ftp1rawpDBF5UafdjXAA9Tgf5HvU2wRqNqjaAAB/L/PftXPGLvdmkIqKsITg/Nx/n/P/wBeoZ9yxPKsTyMoysagbmPpzxn0ycevpU4UvhiM4PAz+H5/5FVpXLPsTlASoPqe/wDn86tRuKUuUrR2sj7pL2Q72OPLicgKPTIwW5J54z6DsCywAnn3CoP+WZlyR+J5/pT7qGW3ALDbkcEdabbXiyho5Gw68HjIP4DnPsKiUUiYVU3ax6nqnFqv++P5Gsg81rat/wAeq/74/kaxs1hHY5hroGBz0qleWENzGVkHUcN3X3/Dmr2aazelVuBT0CyOktPG04aGVg6KY9pQ4wcnPPGOfY10D3cUUTESBmxwBzWOcCmZ5pcoFn7TMybWk4I9MZpgbHWot4FNMgp2sBMXrm/jzALjwLZqWVQNSjYlun+rlrbMozWF8fInl8CWQRWbGpITtGcDypetZVdgPnp0sousombghRkD6ZHT869D+HvhvULeCe4mntW0uUENEtypBJAwJFHUFT90txnOK8z8hECedLBGrLn5n3fovA/Opba+uowVF7I0MbbFRWbyzu5Py+ny5/AVzpNdQR9CpAI5Ge8ZHuJDndEDGMDJAwXPIHUjA9hiob2RIgrSxkmFlMTMQw3ElSQevAP5Zx3rJ0ua5TStMt9ShIuRaCMhDgIN6ABg3U7cZP8Ast16HJ8ReNodNH2OUSC5aYyujAHMJcjAIP3ihyMntzjpVpml9DptRTSp7u1uJYI7i7RsQybA5hbaxLE44HyH15x9RSN/JBZXct+qsqKN0SR/vABuBPU7t3bgEdDk1ynh7VV1/VxqB89DZpFIYQR5fm4dRg5LY+Zu3PGcEDdoa7qtnYXlnb/M8lzdpGGz8q4dCQw4x2PHegVy/dtJEFiRJPKVyjIrknZ93chPoByPqR2Jq3Eyi7GYGiVFKRg9duEP4dcYPoarG6nGu3VncQF42Vbi3mkbO3lV444xkkjr6da5fxDrEtpZtbPchZjkeWqtlCHzkN3DZx2+7j1qdbjZ9b0UUVsQeV/HwZ8C2I/6icfTr/qpa8r+Hvi6LRpX02+kC2c7h45Dwschx1P904HsCvOATXqnx958CWX/AGE4/wD0VLXzn1PIzms6tJVYOLLpzcJXR9G29nZWcUlzpdtaw3EoUCSONR8pK5PHbGG9DgH0rz6GwvP7R1K/jErbJovlQYMpYAhfTbvZGPsPauN0TxXrOglEsbw+SGz5LjfGcHJwM5XJ67cZNbsHxHaLSrixbS1mS4Qbnjm8pvugH+Fun1rzlhcRTfuNP+tTrniIz1ludSsl3eSTLFLJCrvud0Yhvl4CKw6DPpyeOcZq9oWmyabcPKhdIudyEna7kjPy85Pv9R3rhbzxg+hX7w2emIxTa0csdyHjKsoIABXnggde1Zl58RvEN0qhY7a2I4BjiJ49MMSv5V1x5o4V0IU1d9TgnSbxaryqe6vsnqYsLGyswZ544YYgFZj8u3sOvA7Dknrxnv57408YQ6vGml6bkWERBZ8EeawGFxnnao6Z5557Y5C71TUNRcNe3U0xXOA7Ehc+g6D6ColJop0JvllWd7bHoYnHSrLlWwp7cV9ieK8f2XHn/nsP/QWr47NfYniz/kFxf9dx/wCgtXbD4kccPiRyDFVUljg1CJ1HJBHuKpyXSNPKhk+ZDjFWJI4vsnm+aM+ma7rWRU6jvoThw43I3txzmkByct19B/jWVa3ey7KdQwrU3grkHOaz5k2awlzIdwpz0Pp+n+fTvXKXWrSaTeyW92SqFi8bZ4APP9f8K6cf7XX1qtqNhaalb+TeQLIDwM9auEuUc48yMC78UQzRDfcoygccjFLoU6ahBNdIQYmbajZwCB746VRPwy0IzeY73G3OfKaT5K6i3sIbO3jgtwI0QYVVArCpdvQyp0nF3bPUNYOLRP8AroP5GsMtjvWzrjbbJD/00H8jXOmWso7GBOXphkqAy0wuTVATGT3qMy46GoiaSgB5lphkNJSd6YCEk1k/tBJJJ4DsFjbaf7Ujyc448qWtc1W+N9qt34KtEe6+zouoIzNkDI8uTjJ+v6VjWdo3A+Y10zaC0kmCOeBgY+p/wrY0KCxN/btktFA4coCGEjE/KvTB6cjvmnmHw5aE+ZPJdyKchslj9D0BH4VV1LVYLi3FvY2Yt4txYkYUsSMdBXE5SltcDsLnxbqMtxqEQj8t3TFvcbwQg9cYGW5JPYADgYyeSuPENxqkd0b6OCUzyM3zIQUJUAbc/h9KZc3UkkcETPIZM8nOc9R25zVKQqzeXAApDf3eWq1fqLmJtB1ibRbw3EYAMkZiO7sDg5/MCoL68nv5leSVpCzF2JAwSQq9sDooqKaWTCpgqjEgrmoF4c9eGPOev+eK1Wwzp7rxndT6VJbT20EkjfumZ8kFdoB/iBySM/41gapq1xrFyLi4Ee5V2gIpAAyTz+dV5x+7JweOlRIclgW688U1qNM+9KKKKsDlfH/gz/hOdCg0z7f9i8q5W48zyfMzhWXGNw/vdc9q85/4Z4/6mn/yn/8A2yvcKKAPD/8Ahnj/AKmn/wAp/wD9so/4Z3/6mj/yn/8A2yvcKKAPGLv4CNeJah/E4DQQCHcNP+8AzEE/vPQgfhVb/hnj/qaf/Kf/APbK9wooA8P/AOGd/wDqaP8Ayn//AGyj/hnf/qaf/Kf/APbK9wooA8OP7O//AFNP/lP/APttexatpv8AalqsAm8ra4fdt3diMdR61fooTtqNOzujz67+Gck9+11Brfk7vvJ9l3Z/8fFSf8K5nK4Otj/wF/8As672itHVm9Lil7zuzgbP4by212Z5NaEuRgL9lxj/AMfrRi8E+WCP7Rzn/pj/APZV1tFSpNFRnKKsjlf+EN/6f/8AyD/9lSDwXj/mIZPr5P8A9lXV0U/aS7le1l3OU/4Qvj/j/wD/ACD/APZUL4L25zqGc/8ATH/7Kuroo9pIXtJdypqNj9vt1i8zy8Nuztz2P+NZn/CN/wDT3/5D/wDr1vUVKbRBg/8ACNf9Pf8A5D/+vR/wjX/T3/5D/wDr1vUU+ZgYH/CNf9Pf/kP/AOvSf8Iz/wBPn/kP/wCvXQUUczA5/wD4Rj/p8/8AIX/16P8AhGP+nz/yF/8AXroKKOZgc9/wjH/T5/5C/wDr1V+IPgpfHmgwaW999jWK6W4L+T5m7Cuu3GRj72c+1dXRUt33A8Vi/Z5tI8btfZyO7Wn/ANnVpfgTFGrLHrqIGB6WA/P79ewUVHs4hY8Rk/Z73zCQeKMEEH/jwyT+PmVG37OuZ/MXxTt9B/Z/T/yLXuVFPkiKyPCpP2cQ7EjxURlt3On5P/o2mn9m4FiR4rxn/qHf/bf84r3einZDPCT+zhlcf8JWemP+Qf8A/baiH7NRUgjxaOn/AEDf/tte90UJWAKKKKYHACAMAIEhDCIMJMsnMdkaIbgA/9kKCg=='},
timeout=60,
)
print(rsp.content)
print(f"响应时间{time.time()-starttime}m")
except:
pass
if __name__ == '__main__':
unittest.main()
| 211.461538 | 19,349 | 0.906239 | 1,030 | 21,992 | 19.324272 | 0.812621 | 0.00201 | 0.001507 | 0.002412 | 0.009144 | 0.009144 | 0.009144 | 0.009144 | 0.009144 | 0.009144 | 0 | 0.149475 | 0.04297 | 21,992 | 103 | 19,350 | 213.514563 | 0.796218 | 0.00864 | 0 | 0.035088 | 0 | 0.035088 | 0.912199 | 0.895314 | 0 | 1 | 0 | 0 | 0 | 1 | 0.122807 | false | 0.017544 | 0.210526 | 0 | 0.350877 | 0.070175 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
8a8b71bdd27669be98d85d14d78724c4f3964ede | 21,636 | py | Python | wagtail/wagtailsearch/tests/test_elasticsearch_backend.py | edrex/wagtail | dc1b51a5be1a57f6cb1b90507eea6ab7f2e1affe | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailsearch/tests/test_elasticsearch_backend.py | edrex/wagtail | dc1b51a5be1a57f6cb1b90507eea6ab7f2e1affe | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailsearch/tests/test_elasticsearch_backend.py | edrex/wagtail | dc1b51a5be1a57f6cb1b90507eea6ab7f2e1affe | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from wagtail.tests.utils import unittest
import datetime
import json
from django.test import TestCase
from django.db.models import Q
from wagtail.tests import models
from .test_backends import BackendTests
class TestElasticSearchBackend(BackendTests, TestCase):
backend_path = 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch'
def test_search_with_spaces_only(self):
# Search for some space characters and hope it doesn't crash
results = self.backend.search(" ", models.SearchTest)
# Queries are lazily evaluated, force it to run
list(results)
# Didn't crash, yay!
def test_filter_on_non_filterindex_field(self):
# id is not listed in the search_fields for SearchTest; this should raise a FieldError
from wagtail.wagtailsearch.backends.elasticsearch import FieldError
with self.assertRaises(FieldError):
results = list(self.backend.search("Hello", models.SearchTest, filters=dict(id=42)))
def test_filter_with_unsupported_lookup_type(self):
from wagtail.wagtailsearch.backends.elasticsearch import FilterError
with self.assertRaises(FilterError):
results = list(self.backend.search("Hello", models.SearchTest, filters=dict(title__iregex='h(ea)llo')))
def test_partial_search(self):
# Reset the index
self.backend.reset_index()
self.backend.add_type(models.SearchTest)
self.backend.add_type(models.SearchTestChild)
# Add some test data
obj = models.SearchTest()
obj.title = "HelloWorld"
obj.live = True
obj.save()
self.backend.add(obj)
# Refresh the index
self.backend.refresh_index()
# Search and check
results = self.backend.search("HelloW", models.SearchTest.objects.all())
self.assertEqual(len(results), 1)
self.assertEqual(results[0].id, obj.id)
def test_child_partial_search(self):
# Reset the index
self.backend.reset_index()
self.backend.add_type(models.SearchTest)
self.backend.add_type(models.SearchTestChild)
obj = models.SearchTestChild()
obj.title = "WorldHello"
obj.subtitle = "HelloWorld"
obj.live = True
obj.save()
self.backend.add(obj)
# Refresh the index
self.backend.refresh_index()
# Search and check
results = self.backend.search("HelloW", models.SearchTest.objects.all())
self.assertEqual(len(results), 1)
self.assertEqual(results[0].id, obj.id)
def test_ascii_folding(self):
# Reset the index
self.backend.reset_index()
self.backend.add_type(models.SearchTest)
self.backend.add_type(models.SearchTestChild)
# Add some test data
obj = models.SearchTest()
obj.title = "Ĥéỻø"
obj.live = True
obj.save()
self.backend.add(obj)
# Refresh the index
self.backend.refresh_index()
# Search and check
results = self.backend.search("Hello", models.SearchTest.objects.all())
self.assertEqual(len(results), 1)
self.assertEqual(results[0].id, obj.id)
class TestElasticSearchQuery(TestCase):
def assertDictEqual(self, a, b):
default = self.JSONSerializer().default
self.assertEqual(json.dumps(a, sort_keys=True, default=default), json.dumps(b, sort_keys=True, default=default))
def setUp(self):
# Import using a try-catch block to prevent crashes if the elasticsearch-py
# module is not installed
try:
from wagtail.wagtailsearch.backends.elasticsearch import ElasticSearchQuery
from elasticsearch.serializer import JSONSerializer
except ImportError:
raise unittest.SkipTest("elasticsearch-py not installed")
self.ElasticSearchQuery = ElasticSearchQuery
self.JSONSerializer = JSONSerializer
def test_simple(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.all(), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'prefix': {'content_type': 'tests_searchtest'}}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_none_query_string(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.all(), None)
# Check it
expected_result = {'filtered': {'filter': {'prefix': {'content_type': 'tests_searchtest'}}, 'query': {'match_all': {}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_filter(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(title="Test"), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'term': {'title_filter': 'Test'}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_and_filter(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(title="Test", live=True), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'and': [{'term': {'live_filter': True}}, {'term': {'title_filter': 'Test'}}]}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
# Make sure field filters are sorted (as they can be in any order which may cause false positives)
query = query.to_es()
field_filters = query['filtered']['filter']['and'][1]['and']
field_filters[:] = sorted(field_filters, key=lambda f: list(f['term'].keys())[0])
self.assertDictEqual(query, expected_result)
def test_or_filter(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(Q(title="Test") | Q(live=True)), "Hello")
# Make sure field filters are sorted (as they can be in any order which may cause false positives)
query = query.to_es()
field_filters = query['filtered']['filter']['and'][1]['or']
field_filters[:] = sorted(field_filters, key=lambda f: list(f['term'].keys())[0])
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'or': [{'term': {'live_filter': True}}, {'term': {'title_filter': 'Test'}}]}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query, expected_result)
def test_negated_filter(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.exclude(live=True), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'not': {'term': {'live_filter': True}}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_fields(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.all(), "Hello", fields=['title'])
# Check it
expected_result = {'filtered': {'filter': {'prefix': {'content_type': 'tests_searchtest'}}, 'query': {'match': {'title': 'Hello'}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_exact_lookup(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(title__exact="Test"), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'term': {'title_filter': 'Test'}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_none_lookup(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(title=None), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'missing': {'field': 'title_filter'}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_isnull_true_lookup(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(title__isnull=True), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'missing': {'field': 'title_filter'}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_isnull_false_lookup(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(title__isnull=False), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'not': {'missing': {'field': 'title_filter'}}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_startswith_lookup(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(title__startswith="Test"), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'prefix': {'title_filter': 'Test'}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_gt_lookup(self):
# This also tests conversion of python dates to strings
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(published_date__gt=datetime.datetime(2014, 4, 29)), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'range': {'published_date_filter': {'gt': '2014-04-29'}}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_lt_lookup(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(published_date__lt=datetime.datetime(2014, 4, 29)), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'range': {'published_date_filter': {'lt': '2014-04-29'}}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_gte_lookup(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(published_date__gte=datetime.datetime(2014, 4, 29)), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'range': {'published_date_filter': {'gte': '2014-04-29'}}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_lte_lookup(self):
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(published_date__lte=datetime.datetime(2014, 4, 29)), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'range': {'published_date_filter': {'lte': '2014-04-29'}}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
def test_range_lookup(self):
start_date = datetime.datetime(2014, 4, 29)
end_date = datetime.datetime(2014, 8, 19)
# Create a query
query = self.ElasticSearchQuery(models.SearchTest.objects.filter(published_date__range=(start_date, end_date)), "Hello")
# Check it
expected_result = {'filtered': {'filter': {'and': [{'prefix': {'content_type': 'tests_searchtest'}}, {'range': {'published_date_filter': {'gte': '2014-04-29', 'lte': '2014-08-19'}}}]}, 'query': {'multi_match': {'query': 'Hello', 'fields': ['_all', '_partials']}}}}
self.assertDictEqual(query.to_es(), expected_result)
class TestElasticSearchMapping(TestCase):
def assertDictEqual(self, a, b):
default = self.JSONSerializer().default
self.assertEqual(json.dumps(a, sort_keys=True, default=default), json.dumps(b, sort_keys=True, default=default))
def setUp(self):
# Import using a try-catch block to prevent crashes if the elasticsearch-py
# module is not installed
try:
from wagtail.wagtailsearch.backends.elasticsearch import ElasticSearchMapping
from elasticsearch.serializer import JSONSerializer
except ImportError:
raise unittest.SkipTest("elasticsearch-py not installed")
self.JSONSerializer = JSONSerializer
# Create ES mapping
self.es_mapping = ElasticSearchMapping(models.SearchTest)
# Create ES document
self.obj = models.SearchTest(title="Hello")
self.obj.save()
def test_get_document_type(self):
self.assertEqual(self.es_mapping.get_document_type(), 'tests_searchtest')
def test_get_mapping(self):
# Build mapping
mapping = self.es_mapping.get_mapping()
# Check
expected_result = {
'tests_searchtest': {
'properties': {
'pk': {'index': 'not_analyzed', 'type': 'string', 'store': 'yes', 'include_in_all': False},
'content_type': {'index': 'not_analyzed', 'type': 'string', 'include_in_all': False},
'_partials': {'analyzer': 'edgengram_analyzer', 'include_in_all': False, 'type': 'string'},
'live_filter': {'index': 'not_analyzed', 'type': 'boolean', 'include_in_all': False},
'published_date_filter': {'index': 'not_analyzed', 'type': 'date', 'include_in_all': False},
'title': {'type': 'string', 'include_in_all': True, 'analyzer': 'edgengram_analyzer'},
'title_filter': {'index': 'not_analyzed', 'type': 'string', 'include_in_all': False},
'content': {'type': 'string', 'include_in_all': True},
'callable_indexed_field': {'type': 'string', 'include_in_all': True}
}
}
}
self.assertDictEqual(mapping, expected_result)
def test_get_document_id(self):
self.assertEqual(self.es_mapping.get_document_id(self.obj), 'tests_searchtest:' + str(self.obj.pk))
def test_get_document(self):
# Get document
document = self.es_mapping.get_document(self.obj)
# Check
expected_result = {
'pk': str(self.obj.pk),
'content_type': 'tests_searchtest',
'_partials': ['Hello'],
'live_filter': False,
'published_date_filter': None,
'title': 'Hello',
'title_filter': 'Hello',
'callable_indexed_field': 'Callable',
'content': '',
}
self.assertDictEqual(document, expected_result)
class TestElasticSearchMappingInheritance(TestCase):
def assertDictEqual(self, a, b):
default = self.JSONSerializer().default
self.assertEqual(json.dumps(a, sort_keys=True, default=default), json.dumps(b, sort_keys=True, default=default))
def setUp(self):
# Import using a try-catch block to prevent crashes if the elasticsearch-py
# module is not installed
try:
from wagtail.wagtailsearch.backends.elasticsearch import ElasticSearchMapping
from elasticsearch.serializer import JSONSerializer
except ImportError:
raise unittest.SkipTest("elasticsearch-py not installed")
self.JSONSerializer = JSONSerializer
# Create ES mapping
self.es_mapping = ElasticSearchMapping(models.SearchTestChild)
# Create ES document
self.obj = models.SearchTestChild(title="Hello", subtitle="World")
self.obj.save()
def test_get_document_type(self):
self.assertEqual(self.es_mapping.get_document_type(), 'tests_searchtest_tests_searchtestchild')
def test_get_mapping(self):
# Build mapping
mapping = self.es_mapping.get_mapping()
# Check
expected_result = {
'tests_searchtest_tests_searchtestchild': {
'properties': {
# New
'extra_content': {'type': 'string', 'include_in_all': True},
'subtitle': {'type': 'string', 'include_in_all': True, 'analyzer': 'edgengram_analyzer'},
# Inherited
'pk': {'index': 'not_analyzed', 'type': 'string', 'store': 'yes', 'include_in_all': False},
'content_type': {'index': 'not_analyzed', 'type': 'string', 'include_in_all': False},
'_partials': {'analyzer': 'edgengram_analyzer', 'include_in_all': False, 'type': 'string'},
'live_filter': {'index': 'not_analyzed', 'type': 'boolean', 'include_in_all': False},
'published_date_filter': {'index': 'not_analyzed', 'type': 'date', 'include_in_all': False},
'title': {'type': 'string', 'include_in_all': True, 'analyzer': 'edgengram_analyzer'},
'title_filter': {'index': 'not_analyzed', 'type': 'string', 'include_in_all': False},
'content': {'type': 'string', 'include_in_all': True},
'callable_indexed_field': {'type': 'string', 'include_in_all': True}
}
}
}
self.assertDictEqual(mapping, expected_result)
def test_get_document_id(self):
# This must be tests_searchtest instead of 'tests_searchtest_tests_searchtestchild'
# as it uses the contents base content type name.
# This prevents the same object being accidentally indexed twice.
self.assertEqual(self.es_mapping.get_document_id(self.obj), 'tests_searchtest:' + str(self.obj.pk))
def test_get_document(self):
# Build document
document = self.es_mapping.get_document(self.obj)
# Sort partials
if '_partials' in document:
document['_partials'].sort()
# Check
expected_result = {
# New
'extra_content': '',
'subtitle': 'World',
# Changed
'content_type': 'tests_searchtest_tests_searchtestchild',
# Inherited
'pk': str(self.obj.pk),
'_partials': ['Hello', 'World'],
'live_filter': False,
'published_date_filter': None,
'title': 'Hello',
'title_filter': 'Hello',
'callable_indexed_field': 'Callable',
'content': '',
}
self.assertDictEqual(document, expected_result)
class TestBackendConfiguration(TestCase):
def setUp(self):
# Import using a try-catch block to prevent crashes if the elasticsearch-py
# module is not installed
try:
from wagtail.wagtailsearch.backends.elasticsearch import ElasticSearch
except ImportError:
raise unittest.SkipTest("elasticsearch-py not installed")
self.ElasticSearch = ElasticSearch
def test_default_settings(self):
backend = self.ElasticSearch(params={})
self.assertEqual(len(backend.es_hosts), 1)
self.assertEqual(backend.es_hosts[0]['host'], 'localhost')
self.assertEqual(backend.es_hosts[0]['port'], 9200)
self.assertEqual(backend.es_hosts[0]['use_ssl'], False)
def test_hosts(self):
# This tests that HOSTS goes to es_hosts
backend = self.ElasticSearch(params={
'HOSTS': [
{
'host': '127.0.0.1',
'port': 9300,
'use_ssl': True,
}
]
})
self.assertEqual(len(backend.es_hosts), 1)
self.assertEqual(backend.es_hosts[0]['host'], '127.0.0.1')
self.assertEqual(backend.es_hosts[0]['port'], 9300)
self.assertEqual(backend.es_hosts[0]['use_ssl'], True)
def test_urls(self):
# This test backwards compatibility with old URLS setting
backend = self.ElasticSearch(params={
'URLS': ['http://localhost:12345', 'https://127.0.0.1:54321'],
})
self.assertEqual(len(backend.es_hosts), 2)
self.assertEqual(backend.es_hosts[0]['host'], 'localhost')
self.assertEqual(backend.es_hosts[0]['port'], 12345)
self.assertEqual(backend.es_hosts[0]['use_ssl'], False)
self.assertEqual(backend.es_hosts[1]['host'], '127.0.0.1')
self.assertEqual(backend.es_hosts[1]['port'], 54321)
self.assertEqual(backend.es_hosts[1]['use_ssl'], True)
| 44.245399 | 272 | 0.624422 | 2,363 | 21,636 | 5.526026 | 0.10876 | 0.04503 | 0.030556 | 0.037831 | 0.825394 | 0.816205 | 0.796447 | 0.788482 | 0.785725 | 0.760836 | 0 | 0.010386 | 0.225689 | 21,636 | 488 | 273 | 44.336066 | 0.769056 | 0.090682 | 0 | 0.535836 | 0 | 0 | 0.210526 | 0.022921 | 0 | 0 | 0 | 0 | 0.1843 | 1 | 0.139932 | false | 0 | 0.071672 | 0 | 0.232082 | 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 |
8acf11c514ade2e67bbf9ef3105667b9b183cde5 | 37 | py | Python | hand_tracking/__init__.py | K-Mahfoudh/Sign-Language-Translator | b75051846b98b5275e9b58ef7a87c6759d27dea9 | [
"MIT"
] | null | null | null | hand_tracking/__init__.py | K-Mahfoudh/Sign-Language-Translator | b75051846b98b5275e9b58ef7a87c6759d27dea9 | [
"MIT"
] | null | null | null | hand_tracking/__init__.py | K-Mahfoudh/Sign-Language-Translator | b75051846b98b5275e9b58ef7a87c6759d27dea9 | [
"MIT"
] | null | null | null | from .hand_tracker import HandTracker | 37 | 37 | 0.891892 | 5 | 37 | 6.4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.081081 | 37 | 1 | 37 | 37 | 0.941176 | 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 |
76d8b21b6f57af1515c5c6d17c3fb6c4d69084bc | 73 | py | Python | tests/demo_config.py | a-nau/yaml2pyclass | 5b0db4e00e911f1080c79535d6ed3ecade28f2a0 | [
"BSD-3-Clause"
] | 2 | 2021-03-12T19:28:31.000Z | 2021-03-26T08:31:05.000Z | tests/demo_config.py | a-nau/yaml2pyclass | 5b0db4e00e911f1080c79535d6ed3ecade28f2a0 | [
"BSD-3-Clause"
] | null | null | null | tests/demo_config.py | a-nau/yaml2pyclass | 5b0db4e00e911f1080c79535d6ed3ecade28f2a0 | [
"BSD-3-Clause"
] | 1 | 2021-12-30T07:35:23.000Z | 2021-12-30T07:35:23.000Z | import yaml2pyclass
class Config(yaml2pyclass.CodeGenerator):
pass
| 12.166667 | 41 | 0.794521 | 7 | 73 | 8.285714 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032258 | 0.150685 | 73 | 5 | 42 | 14.6 | 0.903226 | 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 |
0a4af004f0f9099b1ec792b9d6cad7351654087a | 40 | py | Python | kora/s/callbacks.py | wannaphong/kora | 8a9034097d07b14094e077769c02a0b4857d179b | [
"MIT"
] | 91 | 2020-05-26T05:54:51.000Z | 2022-03-09T07:33:44.000Z | kora/s/callbacks.py | wannaphong/kora | 8a9034097d07b14094e077769c02a0b4857d179b | [
"MIT"
] | 12 | 2020-10-03T10:09:11.000Z | 2021-03-06T23:12:21.000Z | kora/s/callbacks.py | wannaphong/kora | 8a9034097d07b14094e077769c02a0b4857d179b | [
"MIT"
] | 16 | 2020-07-07T18:39:29.000Z | 2021-03-06T03:46:49.000Z | from tensorflow.keras.callbacks import * | 40 | 40 | 0.85 | 5 | 40 | 6.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.075 | 40 | 1 | 40 | 40 | 0.918919 | 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 |
0a692de94c447b61a5aab73da1456f88413b2fc2 | 46 | py | Python | InstallPythonTest.py | schm2055/CourseraPythonCourses | 1a7f60b6877c69116804cc04b5fa55daf26bf588 | [
"CC0-1.0"
] | null | null | null | InstallPythonTest.py | schm2055/CourseraPythonCourses | 1a7f60b6877c69116804cc04b5fa55daf26bf588 | [
"CC0-1.0"
] | null | null | null | InstallPythonTest.py | schm2055/CourseraPythonCourses | 1a7f60b6877c69116804cc04b5fa55daf26bf588 | [
"CC0-1.0"
] | null | null | null | print "how much wood would a wood chuck chuck" | 46 | 46 | 0.782609 | 9 | 46 | 4 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 46 | 1 | 46 | 46 | 0.947368 | 0 | 0 | 0 | 0 | 0 | 0.808511 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 1 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 6 |
0a6a8ad142eda6a4f975fd848ab05b249e2dac30 | 168 | py | Python | mara_superset/cli.py | leo-schick/mara-superset | 359adcab3c2ac32283bd465901ceeb768d436557 | [
"MIT"
] | 3 | 2021-12-14T18:01:57.000Z | 2022-01-01T10:17:42.000Z | mara_superset/cli.py | leo-schick/mara-superset | 359adcab3c2ac32283bd465901ceeb768d436557 | [
"MIT"
] | null | null | null | mara_superset/cli.py | leo-schick/mara-superset | 359adcab3c2ac32283bd465901ceeb768d436557 | [
"MIT"
] | null | null | null | import click
@click.command()
def update_metadata():
"""Sync schema definitions from Mara to Superset"""
from . import metadata
metadata.update_metadata() | 21 | 55 | 0.720238 | 20 | 168 | 5.95 | 0.65 | 0.235294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.178571 | 168 | 8 | 56 | 21 | 0.862319 | 0.267857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.4 | 0 | 0.6 | 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 |
6a8fb1be3e44f3fe40e4594834c3e2488d3c9360 | 199 | py | Python | odoo-13.0/addons/delivery/tests/__init__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/delivery/tests/__init__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/delivery/tests/__init__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing detailsself.
from . import test_delivery_cost, test_delivery_stock_move
from . import test_packing_delivery
| 33.166667 | 78 | 0.78392 | 29 | 199 | 5.137931 | 0.793103 | 0.134228 | 0.187919 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005848 | 0.140704 | 199 | 5 | 79 | 39.8 | 0.865497 | 0.492462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 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 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
6a97ec876cb84e6d568ce02ee78aab2dc5e8eadb | 44,816 | py | Python | chronostar/retired/fit_group.py | tcrundall/chronostar | bdb5cd965e862ba5cc21bee75d5c8620e106c0cc | [
"MIT"
] | null | null | null | chronostar/retired/fit_group.py | tcrundall/chronostar | bdb5cd965e862ba5cc21bee75d5c8620e106c0cc | [
"MIT"
] | null | null | null | chronostar/retired/fit_group.py | tcrundall/chronostar | bdb5cd965e862ba5cc21bee75d5c8620e106c0cc | [
"MIT"
] | null | null | null | """This program takes an initial model for a stellar association and uses an affine invariant
Monte-Carlo to fit for the group parameters.
A group fitter, called after tracing orbits back.
This group fitter will find the best fit 6D error ellipse and best fit time for
the group formation based on Bayesian analysis, which in this case involves
computing overlap integrals.
TODO:
0) Once the group is found, output the probability of each star being in the group.
1) Add in multiple groups
2) Change from a group to a cluster, which can evaporate e.g. exponentially.
3) Add in a fixed background which is the Galaxy (from Robin et al 2003).
To use MPI, try:
mpirun -np 2 python fit_group.py
Note that this *doesn't* work yet due to a "pickling" problem.
"""
from __future__ import print_function, division
import emcee
import sys
import numpy as np
import matplotlib.pyplot as plt
import pickle
import pdb
try:
import astropy.io.fits as pyfits
except:
import pyfits
try:
import _overlap as overlap #&TC
except:
print("overlap not imported, SWIG not possible. Need to make in directory...")
import time #&TC
from emcee.utils import MPIPool
def compute_overlap(A,a,A_det,B,b,B_det):
"""Compute the overlap integral between a star and group mean + covariance matrix
in six dimensions, including some temporary variables for speed and to match the
notes.
This is the first function to be converted to a C program in order to speed up."""
#Preliminaries - add matrices together. This might make code more readable?
#Or might not.
ApB = A + B
AapBb = np.dot(A,a) + np.dot(B,b)
#Compute determinants.
ApB_det = np.linalg.det(ApB)
#Error checking (not needed in C once shown to work?) This shouldn't ever happen, as
#the determinants of the sum of positive definite matrices is
#greater than the sum of their determinants
if (ApB_det < 0) | (B_det<0):
pdb.set_trace()
return -np.inf
#Solve for c
c = np.linalg.solve(ApB, AapBb)
#Compute the overlap formula.
overlap = np.exp(-0.5*(np.dot(b-c,np.dot(B,b-c)) + \
np.dot(a-c,np.dot(A,a-c)) ))
overlap *= np.sqrt(B_det*A_det/ApB_det)/(2*np.pi)**3.0
return overlap
def read_stars(infile):
"""Read stars from a previous pickle file into a dictionary.
The input is an error ellipse in 6D (X,Y,Z,U,V,W) of a list of stars, at
a bunch of times in the past.
Parameters
----------
infile: string
input pickle file
Returns
-------
star_dictionary: dict
stars: (nstars) high astropy table including columns as documented in the Traceback class.
times: (ntimes) numpy array, containing times that have been traced back, in Myr
xyzuvw (nstars,ntimes,6) numpy array, XYZ in pc and UVW in km/s
xyzuvw_cov (nstars,ntimes,6,6) numpy array, covariance of xyzuvw
"""
if len(infile)==0:
print("Input a filename...")
raise UserWarning
#Stars is an astropy.Table of stars
if infile[-3:] == 'pkl':
with open(infile,'r') as fp:
(stars,times,xyzuvw,xyzuvw_cov)=pickle.load(fp)
elif (infile[-3:] == 'fit') or (infile[-4:] == 'fits'):
stars = pyfits.getdata(infile,1)
times = pyfits.getdata(infile,2)
xyzuvw = pyfits.getdata(infile,3)
xyzuvw_cov = pyfits.getdata(infile,4)
else:
print("Unknown File Type!")
raise UserWarning
#Create the inverse covariances to save time.
xyzuvw_icov = np.linalg.inv(xyzuvw_cov)
xyzuvw_icov_det = np.linalg.det(xyzuvw_icov)
return dict(stars=stars,times=times,xyzuvw=xyzuvw,xyzuvw_cov=xyzuvw_cov,xyzuvw_icov=xyzuvw_icov,xyzuvw_icov_det=xyzuvw_icov_det)
def interp_cov(target_time, star_params):
"""
Interpolate in time to get a xyzuvw vector and covariance matrix.
Note that there is a fast scipy package (in ndimage?) that might be good for this.
"""
times = star_params['times']
ix = np.interp(target_time,times,np.arange(len(times)))
ix0 = np.int(ix)
frac = ix-ix0
bs = star_params['xyzuvw'][:,ix0]*(1-frac) + star_params['xyzuvw'][:,ix0+1]*frac
cov = star_params['xyzuvw_cov'][:,ix0]*(1-frac) + star_params['xyzuvw_cov'][:,ix0+1]*frac
return bs, cov
def lnprob_one_group(x, star_params, background_density=2e-12,use_swig=True,t_ix = 0,return_overlaps=False,\
return_cov=False, min_axis=2.0,min_v_disp=0.5,debug=False, print_times=False):
"""Compute the log-likelihood for a fit to a group.
The x variables are:
xyzuvw (6), then xyz standard deviations (3), uvw_symmetrical_std (1), xyz_correlations (3)
A 14th variable, if present, is the time at which the calculation is made. If not given, the
calculation is made at a fixed time index t_ix.
The probability of a model is the product of the probabilities
overlaps of every star in the group.
Parameters
----------
x : array-like
The group parameters, which are...
x[0] to x[5] : xyzuvw
x[6] to x[8] : positional variances in x,y,z
x[9] : velocity dispersion (symmetrical for u,v,w)
x[10] to x[12] : correlations between x,y,z
x[13] : (optional) birth time of group in Myr.
background_density :
The density of a background stellar population, in
units of pc**(-3)*(km/s)**(-3).
t_ix : int
Time index (in the past) where we are computing the probabilities.
return_overlaps : bool
Return the overlaps (rather than the log probability)
return_cov : bool
Return the covariance (rather than the log probability)
min_axis : float
Minimum allowable position dispersion for the cluster in parsecs
min_v_disp : float
Minimum allowable cluster velocity dispersion in km/s.
"""
t0=time.time()
practically_infinity = np.inf#1e20
ns = len(star_params['xyzuvw']) #Number of stars
#See if we have a time in Myr in the input vector, in which case we have
#to interpolate in time. Otherwise, just choose a single time snapshot given
#by the input index t_ix.
if len(x)>13:
#If the input time is outside our range of traceback times, return
#zero likelihood.
if ( (x[13] < min(star_params['times'])) | (x[13] > max(star_params['times']))):
return -np.inf
#Linearly interpolate in time to get bs and Bs
bs, cov = interp_cov(x[13], star_params)
#WARNING: The next lines are slow, and should maybe be part of the overlap package,
#if numpy isn't fast enough. They are slow because an inverse and a determinant
#is computed for every star.
Bs = np.linalg.inv(cov)
B_dets = np.linalg.det(Bs)
else:
#Extract the time that we really care about.
#The result is a (ns,6) array for bs, and (ns,6,6) array for Bs.
bs = star_params['xyzuvw'][:,t_ix]
Bs = star_params['xyzuvw_icov'][:,t_ix]
B_dets = star_params['xyzuvw_icov_det'][:,t_ix]
#Sanity check inputs for out of bounds. If so, return zero likelihood.
if (np.min(x[6:9])<=min_axis):
if debug:
print("Positional Variance Too Low...")
return -practically_infinity
if (np.min(x[9])<min_v_disp):
if debug:
print("Velocity Variance Too Low...")
return -practically_infinity
if (np.max(np.abs(x[10:13])) >= 1):
if debug:
print("Correlations above 1...")
return -practically_infinity
#Create the group_mn and group_cov from x. This looks a little tricky
#because we're inputting correlations rather than elements of the covariance
#matrix.
#https://en.wikipedia.org/wiki/Correlation_and_dependence
x = np.array(x)
group_mn = x[0:6]
group_cov = np.eye( 6 )
#Fill in correlations
group_cov[np.tril_indices(3,-1)] = x[10:13]
group_cov[np.triu_indices(3,1)] = x[10:13]
#Convert correlation to covariance for position.
for i in range(3):
group_cov[i,:3] *= x[6:9]
group_cov[:3,i] *= x[6:9]
#Convert correlation to covariance for velocity.
for i in range(3,6):
group_cov[i,3:] *= x[9]
group_cov[3:,i] *= x[9]
#Allow this covariance matrix to be returned.
if return_cov:
return group_cov
#Enforce some sanity check limits on prior...
if (np.min(np.linalg.eigvalsh(group_cov[:3,:3])) < min_axis**2):
if debug:
print("Minimum positional covariance too small in one direction...")
return -practically_infinity
#Invert the group covariance matrix and check for negative eigenvalues
group_icov = np.linalg.inv(group_cov)
group_icov_eig = np.linalg.eigvalsh(group_icov)
if np.min(group_icov_eig) < 0:
if debug:
print("Numerical error in inverse covariance matrix!")
return -practically_infinity
group_icov_det = np.prod(group_icov_eig)
#Before starting, lets set the prior probability
#Given the way we're sampling the covariance matrix, I'm
#really not sure this is correct! But it is pretty close...
#it looks almost like 1/(product of standard deviations).
#See YangBerger1998
lnprob=np.log(np.abs(group_icov_det)**3.5)
t1=time.time()
#overlaps_start = time.clock()
#Now loop through stars, and save the overlap integral for every star.
overlaps = np.empty(ns)
if use_swig:
if (True):
overlaps = overlap.get_overlaps(group_icov, group_mn, group_icov_det,
Bs, bs, B_dets, ns)
#note 'ns' at end, see 'overlap.c' for documentation
lnprob = lnprob + np.sum(np.log(background_density + overlaps))
else:
for i in range(ns):
overlaps[i] = overlap.get_overlap(group_icov,
group_mn,
group_icov_det,
Bs[i],
bs[i],
B_dets[i]) #&TC
lnprob += np.log(background_density + overlaps[i])
else:
for i in range(ns):
overlaps[i] = compute_overlap(group_icov,group_mn,group_icov_det,Bs[i],bs[i],B_dets[i])
lnprob += np.log(background_density + overlaps[i])
#print (time.clock() - overlaps_start)
if print_times:
print("{0:9.6f}, {1:9.6f}".format(time.time()-t1, t1-t0))
if return_overlaps:
return overlaps
return lnprob
def lnprob_one_cluster(x, star_params, use_swig=False, return_overlaps=False, \
min_axis=2.0, min_v_disp=0.5, debug=False):
"""Compute the log-likelihood for a fit to a cluster. A cluster is defined as a group that decays
exponentially in time.
The minimal set of x variables are:
xyzuvw (6), the core radius (1),
the tidal radius now (1) [starts at 1.5 times the core radius], the initial velocity
dispersion (1) [decays according to density ** 0.5],
the birth time (1), the central density decay time (1),
The probability of a model is the product of the probabilities
overlaps of every star in the group.
Parameters
----------
x : array-like
The group parameters, which are...
x[0] to x[5] : xyzuvw at the CURRENT time.
x[6] : Core radius (constant with time)
x[7] : Tidal radius at current epoch.
x[8] : Initial velocity dispersion
x[9] : Birth time
x[10] : Central density 1/e decay time.
x[11] : Initial central density [for now as a multiplier of the
background density in units of pc^{-3} km^{-3} s^3
star_params : astropy table
return_overlaps : bool
Return the overlaps (rather than the log probability)
return_cov : bool
Return the covariance (rather than the log probability)
min_axis : float
Minimum allowable position dispersion for the cluster in parsecs
min_v_disp : float
Minimum allowable cluster velocity dispersion in km/s.
"""
practically_infinity = 1e20
#Extract the key parameters in shorthand from star_params.
xyzuvw = star_params['xyzuvw']
xyzuvw_cov = star_params['xyzuvw_cov']
xyzuvw_icov = star_params['xyzuvw_icov']
xyzuvw_icov_det = star_params['xyzuvw_icov_det']
times = star_params['times']
ns = len(star_params['xyzuvw']) #Number of stars
nt = len(times) #Number of times.
#Sanity check inputs for out of bounds...
if (np.min(x[6:8])<=min_axis):
if debug:
print("Positional Variance Too Low...")
return -practically_infinity
if (x[8]<min_v_disp):
if debug:
print("Velocity Variance Too Low...")
return -practically_infinity
#Trace the cluster backwards forwards in time. For every timestep, we have value of
#xyzuvw for the cluster. Covariances are simply formed from the radius and dispersion -
#they are symmetrical
#!!! THIS SHOULD USE THE TRACEBACK MODULE, AND IS A JOB FOR JONAH TO TRY !!!
#Now loop through stars, and save the overlap integral for every star.
overlaps = np.empty(ns)
for i in range(ns):
#!!! Check if the spatial overlap is significant. If it is, find the time of
#overlap and the parameters of the cluster treated as two groups at this time. !!!
spatial_overlap_is_significant = False
if spatial_overlap:
#!!! the "group" parameters below need to be set !!!
if use_swig:
overlaps[i] = overlap.get_overlap(group_icov.flatten().tolist(),
group_mn.flatten().tolist(),
group_icov_det,
Bs[i].flatten().tolist(),
bs[i].flatten().tolist(),
B_dets[i])
else:
overlaps[i] = compute_overlap(group_icov,group_mn,group_icov_det,Bs[i],bs[i],B_dets[i])
lnprob += np.log(1 + overlaps[i]*x[11])
if return_overlaps:
return overlaps
return lnprob
def fit_one_group(star_params, init_mod=np.array([ -6.574, 66.560, 23.436, -1.327,-11.427, -6.527, \
10.045, 10.319, 12.334, 0.762, 0.932, 0.735, 0.846, 20.589]),\
nwalkers=100,nchain=1000,nburn=200, return_sampler=False,pool=None,\
init_sdev = np.array([1,1,1,1,1,1,1,1,1,.01,.01,.01,.1,1]), background_density=2e-12, use_swig=True, \
plotit=False):
"""Fit a single group, using a affine invariant Monte-Carlo Markov chain.
Parameters
----------
star_params: dict
A dictionary of star parameters from read_stars. This should of course be a
class, but it doesn't work with MPI etc as class instances are not
"pickleable"
init_mod : array-like
Initial mean of models used to fit the group. See lnprob_one_group for parameter definitions.
nwalkers : int
Number of walkers to characterise the parameter covariance matrix. Has to be
at least 2 times the number of dimensions.
nchain : int
Number of elements in the chain. For characteristing a distribution near a
minimum, 1000 is a rough minimum number (giving ~10% uncertainties on
standard deviation estimates).
nburn : int
Number of burn in steps, before saving any chain output. If the beam acceptance
fraction is too low (e.g. significantly lower in burn in than normal, e.g.
less than 0.1) then this has to be increased.
Returns
-------
best_params: array-like
The best set of group parameters.
sampler: emcee.EmsembleSampler
Returned if return_sampler=True
"""
nparams = len(init_mod)
#Set up the MCMC...
ndim=nparams
#Set an initial series of models
p0 = [init_mod + (np.random.random(size=ndim) - 0.5)*init_sdev for i in range(nwalkers)]
#NB we can't set e.g. "threads=4" because the function isn't "pickleable"
sampler = emcee.EnsembleSampler(nwalkers, ndim, lnprob_one_group,pool=pool,args=[star_params,background_density,use_swig])
#Burn in...
pos, prob, state = sampler.run_mcmc(p0, nburn)
print("Mean burn-in acceptance fraction: {0:.3f}"
.format(np.mean(sampler.acceptance_fraction)))
sampler.reset()
#Run...
sampler.run_mcmc(pos, nchain)
if plotit:
plt.figure(1)
plt.clf()
plt.plot(sampler.lnprobability.T)
plt.savefig("plots/lnprobability.eps")
plt.pause(0.001)
#Best Model
best_ix = np.argmax(sampler.flatlnprobability)
print('[' + ",".join(["{0:7.3f}".format(f) for f in sampler.flatchain[best_ix]]) + ']')
overlaps = lnprob_one_group(sampler.flatchain[best_ix], star_params,return_overlaps=True,use_swig=use_swig)
group_cov = lnprob_one_group(sampler.flatchain[best_ix], star_params,return_cov=True,use_swig=use_swig)
np.sqrt(np.linalg.eigvalsh(group_cov[:3,:3]))
ww = np.where(overlaps < background_density)[0]
print("The following {0:d} stars are more likely not group members...".format(len(ww)))
try:
print(star_params['stars'][ww]['Name'])
except:
print(star_params['stars'][ww]['Name1'])
print("Mean acceptance fraction: {0:.3f}"
.format(np.mean(sampler.acceptance_fraction)))
if plotit:
plt.figure(2)
plt.clf()
plt.hist(sampler.chain[:,:,-1].flatten(),20)
plt.savefig("plots/distribution_of_ages.eps")
#pdb.set_trace()
if return_sampler:
return sampler
else:
return sampler.flatchain[best_ix]
def lnprob_two_groups(x,star_params,use_swig=True,t_ix = 0,return_overlaps=False,\
return_cov=False, min_axis=2.0,min_v_disp=0.5,debug=False, print_times=False):
"""Compute the log-likelihood for a fit to a group.
The x variables are:
xyzuvw (6), then xyz standard deviations (3), uvw_symmetrical_std (1), xyz_correlations (3)
for both the association and the background
A 26th variable, if present, is the time at which the calculation is made. If not given, the
calculation is made at a fixed time index t_ix.
The probability of a model is the product of the probabilities
overlaps of every star in the group.
Parameters
----------
x : array-like
The group parameters, which are...
x[0] to x[5] : xyzuvw
x[6] to x[8] : positional variances in x,y,z
x[9] : velocity dispersion (symmetrical for u,v,w)
x[10] to x[12] : correlations between x,y,z
x[13] to x[18] : xyzuvw of background (BG)
x[19] to x[21] : positional variances in x,y,z of BG
x[22] : velocity dispersion (symmetrical for u,v,w) of BG
x[23] to x[25] : correlations between x,y,z of BG
x[26] : fraction of stars (0.0 - 1.0) in association
x[27] : (optional) birth time of group in Myr.
t_ix : int
Time index (in the past) where we are computing the probabilities.
return_overlaps : bool
Return the overlaps (rather than the log probability)
return_cov : bool
Return the covariance (rather than the log probability)
"""
t0=time.time()
practically_infinity = np.inf#1e20
ns = len(star_params['xyzuvw']) #Number of stars
#See if we have a time in Myr in the input vector, in which case we have
#to interpolate in time. Otherwise, just choose a single time snapshot given
#by the input index t_ix.
if len(x)>27:
#If the input time is outside our range of traceback times, return
#zero likelihood.
if ( (x[27] < min(star_params['times'])) | (x[27] > max(star_params['times']))):
return -np.inf
#Linearly interpolate in time to get bs and Bs
bs, cov = interp_cov(x[27], star_params)
#WARNING: The next lines are slow, and should maybe be part of the overlap package,
#if numpy isn't fast enough. They are slow because an inverse and a determinant
#is computed for every star.
Bs = np.linalg.inv(cov)
B_dets = np.linalg.det(Bs)
#pdb.set_trace()
else:
#Extract the time that we really care about.
#The result is a (ns,6) array for bs, and (ns,6,6) array for Bs.
bs = star_params['xyzuvw'][:,t_ix]
Bs = star_params['xyzuvw_icov'][:,t_ix]
B_dets = star_params['xyzuvw_icov_det'][:,t_ix]
#Get the stars to be fitted to the background's data at time 0
#pdb.set_trace()
background_bs = star_params['xyzuvw'][:,0]
background_Bs = star_params['xyzuvw_icov'][:,0]
background_B_dets = star_params['xyzuvw_icov_det'][:,0]
xpos, y, z, u, v, w, dx, dy, dz, duvw, xcorr, ycorr, zcorr, \
xpos2, y2, z2, u2, v2, w2, dx2, dy2, dz2, duvw2, xcorr2, ycorr2, zcorr2, weight, t \
= x
if not (2.0 < dx < 200.0 and 2.0 < dy < 200.0 and 2.0 < dz < 100.0 and 0.5 < duvw \
and -1.0 < xcorr < 1.0 and -1.0 < ycorr < 1.0 and -1.0 < zcorr < 1.0 \
and 10.0 < dx2 and 10.0 < dy2 and 10.0 < dz2 and 0.5 < duvw2 \
and -1.0 < xcorr2 < 1.0 and -1.0 < ycorr2 < 1.0 and -1.0 < zcorr2 < 1.0 \
and 0.0 < weight < 1.0 and 0.0 < t < 25.0):
return -practically_infinity
if (t < 0.0):
print("Time is negative...?")
#Sanity check inputs for out of bounds. If so, return zero likelihood.
if (np.min(x[6:9])<=min_axis):
if debug:
print("Positional Variance Too Low...")
return -practically_infinity
if (np.min(x[9])<min_v_disp):
if debug:
print("Velocity Variance Too Low...")
return -practically_infinity
if (np.max(np.abs(x[10:13])) >= 1):
if debug:
print("Correlations above 1...")
return -practically_infinity
#Create the group_mn and group_cov from x. This looks a little tricky
#because we're inputting correlations rather than elements of the covariance
#matrix.
#https://en.wikipedia.org/wiki/Correlation_and_dependence
x = np.array(x)
group_mn = x[0:6]
group_cov = np.eye( 6 )
#Fill in correlations
group_cov[np.tril_indices(3,-1)] = x[10:13]
group_cov[np.triu_indices(3,1)] = x[10:13]
#Convert correlation to covariance for position.
for i in range(3):
group_cov[i,:3] *= x[6:9]
group_cov[:3,i] *= x[6:9]
#Convert correlation to covariance for velocity.
for i in range(3,6):
group_cov[i,3:] *= x[9]
group_cov[3:,i] *= x[9]
bg_mn = x[13:19]
bg_cov = np.eye( 6 )
#Fill in correlations
bg_cov[np.tril_indices(3,-1)] = x[23:26]
bg_cov[np.triu_indices(3,1)] = x[23:26]
#Convert correlation to covariance for position.
for i in range(3):
bg_cov[i,:3] *= x[19:22]
bg_cov[:3,i] *= x[19:22]
#Convert correlation to covariance for velocity.
for i in range(3,6):
bg_cov[i,3:] *= x[22]
bg_cov[3:,i] *= x[22]
#Allow this covariance matrix to be returned.
if return_cov:
return group_cov
#Enforce some sanity check limits on prior...
if (np.min(np.linalg.eigvalsh(group_cov[:3,:3])) < min_axis**2):
if debug:
print("Minimum positional covariance too small in one direction...")
return -practically_infinity
#Enforce some sanity check limits on prior...
if (np.min(np.linalg.eigvalsh(bg_cov[:3,:3])) < min_axis**2):
if debug:
print("Minimum positional bg covariance too small in one direction...")
return -practically_infinity
#Invert the group covariance matrix and check for negative eigenvalues
group_icov = np.linalg.inv(group_cov)
group_icov_eig = np.linalg.eigvalsh(group_icov)
if np.min(group_icov_eig) < 0:
if debug:
print("Numerical error in inverse covariance matrix!")
return -practically_infinity
group_icov_det = np.prod(group_icov_eig)
#Invert the background covariance matrix and check for negative eigenvalues
bg_icov = np.linalg.inv(bg_cov)
bg_icov_eig = np.linalg.eigvalsh(bg_icov)
if np.min(bg_icov_eig) < 0:
if debug:
print("Numerical error in bg inverse covariance matrix!")
return -practically_infinity
bg_icov_det = np.prod(bg_icov_eig)
#Before starting, lets set the prior probability
#Given the way we're sampling the covariance matrix, I'm
#really not sure this is correct! But it is pretty close...
#it looks almost like 1/(product of standard deviations).
#See YangBerger1998
lnprob=np.log(np.abs(group_icov_det)**3.5)
t1=time.time()
#overlaps_start = time.clock()
#Now loop through stars, and save the overlap integral for every star.
overlaps = np.empty(ns)
if use_swig:
if (True):
#pdb.set_trace()
overlaps = overlap.get_overlaps(group_icov, group_mn, group_icov_det,
Bs, bs, B_dets, ns)
bg_overlaps = overlap.get_overlaps(bg_icov, bg_mn, bg_icov_det,
background_Bs, background_bs,
background_B_dets, ns)
#note 'ns' at end, see 'overlap.c' for documentation
prob = weight*overlaps + (1.0 - weight)*bg_overlaps
#lnprob = lnprob + np.sum(np.log(background_density + overlaps))
lnprob = lnprob + np.sum(np.log(prob))
else:
print("oops, no code for no swig")
return -practically_infinity
for i in range(ns):
overlaps[i] = overlap.get_overlap(group_icov,
group_mn,
group_icov_det,
Bs[i],
bs[i],
B_dets[i]) #&TC
lnprob += np.log(background_density + overlaps[i])
else:
print("oops, no code for no swig")
return -practically_infinity
for i in range(ns):
overlaps[i] = compute_overlap(group_icov,group_mn,group_icov_det,Bs[i],bs[i],B_dets[i])
lnprob += np.log(background_density + overlaps[i])
#print (time.clock() - overlaps_start)
if print_times:
print("{0:9.6f}, {1:9.6f}".format(time.time()-t1, t1-t0))
if return_overlaps:
return (overlaps, bg_overlaps)
return lnprob
def fit_two_groups(star_params, init_mod,\
nwalkers=100,nchain=1000,nburn=200, return_sampler=False,pool=None,\
init_sdev = np.array([1,1,1,1,1,1,1,1,1,.01,.01,.01,.1,1]), use_swig=True, \
plotit=False):
"""Fit two group, using a affine invariant Monte-Carlo Markov chain.
Parameters
----------
star_params: dict
A dictionary of star parameters from read_stars. This should of course be a
class, but it doesn't work with MPI etc as class instances are not
"pickleable"
init_mod : array-like
Initial mean of models used to fit the group. See lnprob_two_groups for parameter definitions.
nwalkers : int
Number of walkers to characterise the parameter covariance matrix. Has to be
at least 2 times the number of dimensions.
nchain : int
Number of elements in the chain. For characteristing a distribution near a
minimum, 1000 is a rough minimum number (giving ~10% uncertainties on
standard deviation estimates).
nburn : int
Number of burn in steps, before saving any chain output. If the beam acceptance
fraction is too low (e.g. significantly lower in burn in than normal, e.g.
less than 0.1) then this has to be increased.
Returns
-------
best_params: array-like
The best set of group parameters.
sampler: emcee.EmsembleSampler
Returned if return_sampler=True
"""
nparams = len(init_mod)
#Set up the MCMC...
ndim=nparams
#Set an initial series of models
p0 = [init_mod + (np.random.random(size=ndim) - 0.5)*init_sdev for i in range(nwalkers)]
#NB we can't set e.g. "threads=4" because the function isn't "pickleable"
sampler = emcee.EnsembleSampler(nwalkers, ndim, lnprob_two_groups,pool=pool,args=[star_params,use_swig])
#Burn in...
pos, prob, state = sampler.run_mcmc(p0, nburn)
print("Mean burn-in acceptance fraction: {0:.3f}"
.format(np.mean(sampler.acceptance_fraction)))
sampler.reset()
#Run...
sampler.run_mcmc(pos, nchain)
if plotit:
plt.figure(1)
plt.clf()
plt.plot(sampler.lnprobability.T)
plt.savefig("plots/lnprobability.eps")
plt.pause(0.001)
#Best Model
best_ix = np.argmax(sampler.flatlnprobability)
print('[' + ",".join(["{0:7.3f}".format(f) for f in sampler.flatchain[best_ix]]) + ']')
# overlaps = lnprob_one_group(sampler.flatchain[best_ix], star_params,return_overlaps=True,use_swig=use_swig)
# group_cov = lnprob_one_group(sampler.flatchain[best_ix], star_params,return_cov=True,use_swig=use_swig)
# np.sqrt(np.linalg.eigvalsh(group_cov[:3,:3]))
# ww = np.where(overlaps < background_density)[0]
# print("The following {0:d} stars are more likely not group members...".format(len(ww)))
# try:
# print(star_params['stars'][ww]['Name'])
# except:
# print(star_params['stars'][ww]['Name1'])
#
print("Mean acceptance fraction: {0:.3f}"
.format(np.mean(sampler.acceptance_fraction)))
if plotit:
plt.figure(2)
plt.clf()
plt.hist(sampler.chain[:,:,-1].flatten(),20)
plt.savefig("plots/distribution_of_ages.eps")
#pdb.set_trace()
if return_sampler:
return sampler
else:
return sampler.flatchain[best_ix]
def lnprob_three_groups(x,star_params,use_swig=True,return_overlaps=False,\
return_cov=False, min_axis=2.0,min_v_disp=0.5,debug=False, print_times=False):
"""Compute the log-likelihood for a fit to a group.
The x variables are:
xyzuvw (6), then xyz standard deviations (3), uvw_symmetrical_std (1), xyz_correlations (3)
for two groups and the background
A 43rd variable, if present, is the time at which the calculation is made. If not given, the
calculation is made at a fixed time index t_ix.
The probability of a model is the product of the probabilities
overlaps of every star in the group.
&FLAG
Parameters
----------
x : array-like
The group parameters, which are...
GROUP 1:
x[0] to x[5] : xyzuvw
x[6] to x[8] : positional variances in x,y,z
x[9] : velocity dispersion (symmetrical for u,v,w)
x[10] to x[12] : correlations between x,y,z
x[13] : birth time of group in Myr
x[14] : fraction of stars in group 1
GROUP 2:
x[15] to x[20] : xyzuvw
x[21] to x[23] : positional variances in x,y,z
x[24] : velocity dispersion (symmetrical for u,v,w)
x[25] to x[27] : correlations between x,y,z
x[28] : birth time of group in Myr
x[29] : fraction of stars in group 2
BACKGROUND:
x[30] to x[35] : xyzuvw of background (BG)
x[36] to x[38] : positional variances in x,y,z of BG
x[39] : velocity dispersion (symmetrical for u,v,w) of BG
x[40] to x[42] : correlations between x,y,z of BG
return_overlaps : bool
Return the overlaps (rather than the log probability)
return_cov : bool
Return the covariance (rather than the log probability)
"""
t0=time.time()
practically_infinity = np.inf#1e20
ns = len(star_params['xyzuvw']) #Number of stars
# Interpolate for the each birth time of the groups
#If the input time is outside our range of traceback times, return
#zero likelihood.
# GROUP 1:
if ( (x[13] < min(star_params['times'])) | (x[13] > max(star_params['times']))):
return -np.inf
#Linearly interpolate in time to get bs and Bs
b1s, cov1 = interp_cov(x[13], star_params)
#WARNING: The next lines are slow, and should maybe be part of the overlap package,
#if numpy isn't fast enough. They are slow because an inverse and a determinant
#is computed for every star.
B1s = np.linalg.inv(cov1)
B1_dets = np.linalg.det(B1s)
#pdb.set_trace()
# GROUP 2:
if ( (x[28] < min(star_params['times'])) | (x[28] > max(star_params['times']))):
return -np.inf
#Linearly interpolate in time to get bs and Bs
b2s, cov2 = interp_cov(x[28], star_params)
#WARNING: The next lines are slow, and should maybe be part of the overlap package,
#if numpy isn't fast enough. They are slow because an inverse and a determinant
#is computed for every star.
B2s = np.linalg.inv(cov2)
B2_dets = np.linalg.det(B2s)
#Get the stars to be fitted to the background's data at time 0
background_bs = star_params['xyzuvw'][:,0]
background_Bs = star_params['xyzuvw_icov'][:,0]
background_B_dets = star_params['xyzuvw_icov_det'][:,0]
xpos, y, z, u, v, w, dx, dy, dz, duvw, xcorr, ycorr, zcorr, age1, weight1,\
xpos2, y2, z2, u2, v2, w2, dx2, dy2, dz2, duvw2, xcorr2, ycorr2, zcorr2,age2, weight2,\
xposBG, yBG, zBG, uBG, vBG, wBG, dxBG, dyBG, dzBG, duvwBG, xcorrBG, ycorrBG, zcorrBG\
= x
#&FLAG
if not (2.0 < dx < 200.0 and 2.0 < dy < 200.0 and 2.0 < dz < 100.0 and 0.5 < duvw \
and -1.0 < xcorr < 1.0 and -1.0 < ycorr < 1.0 and -1.0 < zcorr < 1.0 \
and 0.0 < age1 < 25.0 and 0.05 < weight1 < 0.9 \
and 2.0 < dx2 < 200.0 and 2.0 < dy2 < 200.0 and 2.0 < dz2 < 200.0 and 0.5 < duvw2 \
and -1.0 < xcorr2 < 1.0 and -1.0 < ycorr2 < 1.0 and -1.0 < zcorr2 < 1.0 \
and age1 + 1.0 < age2 < 25.0 and 0.05 < weight2 < 0.9 \
and 10.0 < dxBG and 10.0 < dyBG and 10.0 < dzBG and 0.5 < duvwBG \
and -1.0 < xcorrBG < 1.0 and -1.0 < ycorrBG < 1.0 and -1.0 < zcorrBG < 1.0 \
and weight1 + weight2 < 0.9):
return -practically_infinity
#Create the group_mn and group_cov from x. This looks a little tricky
#because we're inputting correlations rather than elements of the covariance
#matrix.
#https://en.wikipedia.org/wiki/Correlation_and_dependence
x = np.array(x)
group1_mn = x[0:6]
group1_cov = np.eye( 6 )
#Fill in correlations
group1_cov[np.tril_indices(3,-1)] = x[10:13]
group1_cov[np.triu_indices(3,1)] = x[10:13]
#Convert correlation to covariance for position.
for i in range(3):
group1_cov[i,:3] *= x[6:9]
group1_cov[:3,i] *= x[6:9]
#Convert correlation to covariance for velocity.
for i in range(3,6):
group1_cov[i,3:] *= x[9]
group1_cov[3:,i] *= x[9]
group2_mn = x[15:21]
group2_cov = np.eye( 6 )
#Fill in correlations
group2_cov[np.tril_indices(3,-1)] = x[25:28]
group2_cov[np.triu_indices(3,1)] = x[25:28]
#Convert correlation to covariance for position.
for i in range(3):
group2_cov[i,:3] *= x[21:24]
group2_cov[:3,i] *= x[21:24]
#Convert correlation to covariance for velocity.
for i in range(3,6):
group2_cov[i,3:] *= x[24]
group2_cov[3:,i] *= x[24]
bg_mn = x[30:35]
bg_cov = np.eye( 6 )
#Fill in correlations
bg_cov[np.tril_indices(3,-1)] = x[40:43]
bg_cov[np.triu_indices(3,1)] = x[40:43]
#Convert correlation to covariance for position.
for i in range(3):
bg_cov[i,:3] *= x[36:39]
bg_cov[:3,i] *= x[36:39]
#Convert correlation to covariance for velocity.
for i in range(3,6):
bg_cov[i,3:] *= x[39]
bg_cov[3:,i] *= x[39]
#Allow this covariance matrix to be returned.
if return_cov:
return group1_cov, group2_cov, bg_cov
#Invert the group covariance matrix and check for negative eigenvalues
group1_icov = np.linalg.inv(group2_cov)
group1_icov_eig = np.linalg.eigvalsh(group1_icov)
if np.min(group1_icov_eig) < 0:
if debug:
print("Numerical error in inverse covariance matrix!")
return -practically_infinity
group1_icov_det = np.prod(group1_icov_eig)
group2_icov = np.linalg.inv(group2_cov)
group2_icov_eig = np.linalg.eigvalsh(group2_icov)
if np.min(group2_icov_eig) < 0:
if debug:
print("Numerical error in inverse covariance matrix!")
return -practically_infinity
group2_icov_det = np.prod(group2_icov_eig)
#Invert the background covariance matrix and check for negative eigenvalues
bg_icov = np.linalg.inv(bg_cov)
bg_icov_eig = np.linalg.eigvalsh(bg_icov)
if np.min(bg_icov_eig) < 0:
if debug:
print("Numerical error in bg inverse covariance matrix!")
return -practically_infinity
bg_icov_det = np.prod(bg_icov_eig)
#Before starting, lets set the prior probability
#Given the way we're sampling the covariance matrix, I'm
#really not sure this is correct! But it is pretty close...
#it looks almost like 1/(product of standard deviations).
#See YangBerger1998
lnprob=np.log(np.abs(group1_icov_det)**3.5) + np.log(np.abs(group2_icov_det)**3.5)
t1=time.time()
#overlaps_start = time.clock()
#Now loop through stars, and save the overlap integral for every star.
#overlaps = np.empty(ns) #not needed I beleive...
if use_swig:
if (True):
#&FLAG
#pdb.set_trace()
g1_overlaps = overlap.get_overlaps(group1_icov, group1_mn, group1_icov_det,
B1s, b1s, B1_dets, ns)
g2_overlaps = overlap.get_overlaps(group2_icov, group2_mn, group2_icov_det,
B2s, b2s, B2_dets, ns)
bg_overlaps = overlap.get_overlaps(bg_icov, bg_mn, bg_icov_det,
background_Bs, background_bs,
background_B_dets, ns)
#note 'ns' at end, see 'overlap.c' for documentation
prob = weight1*g1_overlaps + weight2*g2_overlaps +\
(1.0 - weight1 - weight2)*bg_overlaps
#lnprob = lnprob + np.sum(np.log(background_density + overlaps))
lnprob = lnprob + np.sum(np.log(prob))
else:
print("oops, no code for no swig")
return -practically_infinity
for i in range(ns):
overlaps[i] = overlap.get_overlap(group_icov,
group_mn,
group_icov_det,
Bs[i],
bs[i],
B_dets[i]) #&TC
lnprob += np.log(background_density + overlaps[i])
else:
print("oops, no code for no swig")
return -practically_infinity
for i in range(ns):
overlaps[i] = compute_overlap(group_icov,group_mn,group_icov_det,Bs[i],bs[i],B_dets[i])
lnprob += np.log(background_density + overlaps[i])
#print (time.clock() - overlaps_start)
if print_times:
print("{0:9.6f}, {1:9.6f}".format(time.time()-t1, t1-t0))
if return_overlaps:
return (g1_overlaps, g2_overlaps, bg_overlaps)
return lnprob
# a dummy prior function required to suit syntax of PTSampler init
def logp(dummy):
return 0
def fit_three_groups(star_params, init_mod,\
nwalkers=100,nchain=1000,nburn=200, return_sampler=False,pool=None,\
init_sdev=[], use_swig=True, \
plotit=False):
"""Fit three groups, using a affine invariant Monte-Carlo Markov chain.
Parameters
----------
star_params: dict
A dictionary of star parameters from read_stars. This should of course be a
class, but it doesn't work with MPI etc as class instances are not
"pickleable"
init_mod : array-like
Initial mean of models used to fit the group. See lnprob_one_group for parameter definitions.
nwalkers : int
Number of walkers to characterise the parameter covariance matrix. Has to be
at least 2 times the number of dimensions.
nchain : int
Number of elements in the chain. For characteristing a distribution near a
minimum, 1000 is a rough minimum number (giving ~10% uncertainties on
standard deviation estimates).
nburn : int
Number of burn in steps, before saving any chain output. If the beam acceptance
fraction is too low (e.g. significantly lower in burn in than normal, e.g.
less than 0.1) then this has to be increased.
Returns
-------
best_params: array-like
The best set of group parameters.
sampler: emcee.EmsembleSampler
Returned if return_sampler=True
"""
nparams = len(init_mod)
#Set up the MCMC...
ndim=nparams
ntemps = 20
#Set an initial series of models
#p0 = [init_mod + (np.random.random(size=ndim) - 0.5)*init_sdev for i in range(nwalkers)]
p0 = [[init_mod + (np.random.random(size=ndim) - 0.5)*init_sdev for i in range(nwalkers)] for j in range(ntemps)]
#&FLAG
#NB we can't set e.g. "threads=4" because the function isn't "pickleable"
#sampler = emcee.EnsembleSampler(nwalkers, ndim, lnprob_three_groups,pool=pool,args=[star_params,use_swig])
sampler = emcee.PTSampler(ntemps, nwalkers, ndim, lnprob_three_groups, logp, pool=pool,loglargs=[star_params,use_swig])
#Burn in...
pos, prob, state = sampler.run_mcmc(p0, nburn)
print("Mean burn-in acceptance fraction: {0:.3f}"
.format(np.mean(sampler.acceptance_fraction)))
sampler.reset()
#Run...
sampler.run_mcmc(pos, nchain)
assert sampler.chain.shape == (ntemps, nwalkers, nchain, ndim)
#pdb.set_trace()
if plotit:
plt.figure(1)
plt.clf()
plt.plot(sampler.lnprobability.T)
plt.savefig("plots/lnprobability.eps")
plt.pause(0.001)
#Best Model
#best_ix = np.argmax(sampler.flatlnprobability)
#print('[' + ",".join(["{0:7.3f}".format(f) for f in sampler.flatchain[best_ix]]) + ']')
print("Mean acceptance fraction: {0:.3f}"
.format(np.mean(sampler.acceptance_fraction)))
if plotit:
plt.figure(2)
plt.clf()
plt.hist(sampler.chain[:,:,-1].flatten(),20)
plt.savefig("plots/distribution_of_ages.eps")
#pdb.set_trace()
return sampler
#skipping this for now
if return_sampler:
return sampler
else:
return sampler.flatchain[best_ix]
#Some test calculations applicable to the ARC DP17 proposal.
if __name__ == "__main__":
star_params = read_stars("traceback_save.pkl")
using_mpi = True
try:
# Initialize the MPI-based pool used for parallelization.
pool = MPIPool()
except:
print("MPI doesn't seem to be installed... maybe install it?")
using_mpi = False
pool=None
if using_mpi:
if not pool.is_master():
# Wait for instructions from the master process.
pool.wait()
sys.exit(0)
else:
print("MPI available! - call this with e.g. mpirun -np 4 python fit_group.py")
beta_pic_group = np.array([-6.574, 66.560, 23.436, -1.327,-11.427, -6.527,\
10.045, 10.319, 12.334, 0.762, 0.932, 0.735, 0.846, 20.589])
plei_group = np.array([116.0,27.6, -27.6, 4.7, -23.1, -13.2, 20, 20, 20,\
3, 0, 0, 0, 70])
dummy = lnprob_one_group(beta_pic_group, star_params, use_swig=True)
# dummy = lnprob_one_group(plei_group, star_params, background_density=1e-10, use_swig=False)
fitted_params = fit_one_group(star_params, pool=pool, use_swig=True)
if using_mpi:
# Close the processes.
pool.close()
| 38.902778 | 132 | 0.616588 | 6,585 | 44,816 | 4.088535 | 0.104784 | 0.024886 | 0.014857 | 0.009397 | 0.769342 | 0.744828 | 0.732534 | 0.715522 | 0.705791 | 0.699328 | 0 | 0.036174 | 0.277066 | 44,816 | 1,151 | 133 | 38.936577 | 0.794808 | 0.18692 | 0 | 0.658041 | 0 | 0 | 0.075902 | 0.006436 | 0 | 0 | 0 | 0.000869 | 0.001848 | 0 | null | null | 0 | 0.02403 | null | null | 0.088725 | 0 | 0 | 0 | null | 0 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
6ad7a0097e0ba5837e06953a048f2812269cb92d | 27,942 | py | Python | code/python/Symbology/v2/fds/sdk/Symbology/api/bloomberg_figi_api.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/Symbology/v2/fds/sdk/Symbology/api/bloomberg_figi_api.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/Symbology/v2/fds/sdk/Symbology/api/bloomberg_figi_api.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
FactSet Symbology API
The FactSet Symbology API provides symbol resolution services, allowing clients to translate market identifiers into various symbology types such as, FactSet Permanent Identifiers, CUSIP, ISIN, SEDOL, Tickers, and Bloomberg FIGIs. <p>Factset's Symbology API sits at the center of its hub-and-spoke data model, enabling you to quickly harmonize the expanding catalog of Content APIs. Translate market IDs into CUSIP, SEDOL, ISIN, Tickers as of a point in time or for the entire history of the requested id allowing Data Management workflows to normalize ids over time.</p> # noqa: E501
The version of the OpenAPI document: 2.1.1
Contact: api@factset.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from multiprocessing.pool import ApplyResult
import typing
from fds.sdk.Symbology.api_client import ApiClient, Endpoint as _Endpoint
from fds.sdk.Symbology.model_utils import ( # noqa: F401
check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
from fds.sdk.Symbology.exceptions import ApiException
from fds.sdk.Symbology.model.bloomberg_translation_request import BloombergTranslationRequest
from fds.sdk.Symbology.model.bloomberg_translation_response import BloombergTranslationResponse
from fds.sdk.Symbology.model.error_response import ErrorResponse
class BloombergFIGIApi(object):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
self.batch_translate_bloomberg_endpoint = _Endpoint(
settings={
'response_type': (
{ 200: (BloombergTranslationResponse,), 400: (ErrorResponse,), 401: (ErrorResponse,), 403: (ErrorResponse,), 415: (ErrorResponse,), 500: (ErrorResponse,), },
None
),
'auth': [
'FactSetApiKey',
'FactSetOAuth2'
],
'endpoint_path': '/symbology/v2/bloomberg',
'operation_id': 'batch_translate_bloomberg',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'bloomberg_translation_request',
],
'required': [
'bloomberg_translation_request',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'bloomberg_translation_request':
(BloombergTranslationRequest,),
},
'attribute_map': {
},
'location_map': {
'bloomberg_translation_request': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json'
]
},
api_client=api_client
)
self.translate_bloomberg_endpoint = _Endpoint(
settings={
'response_type': (
{ 200: (BloombergTranslationResponse,), 400: (ErrorResponse,), 401: (ErrorResponse,), 403: (ErrorResponse,), 415: (ErrorResponse,), 500: (ErrorResponse,), },
None
),
'auth': [
'FactSetApiKey',
'FactSetOAuth2'
],
'endpoint_path': '/symbology/v2/bloomberg',
'operation_id': 'translate_bloomberg',
'http_method': 'GET',
'servers': None,
},
params_map={
'all': [
'ids',
],
'required': [
'ids',
],
'nullable': [
],
'enum': [
],
'validation': [
'ids',
]
},
root_map={
'validations': {
('ids',): {
'max_items': 3000,
'min_items': 1,
},
},
'allowed_values': {
},
'openapi_types': {
'ids':
([str],),
},
'attribute_map': {
'ids': 'ids',
},
'location_map': {
'ids': 'query',
},
'collection_format_map': {
'ids': 'csv',
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [],
},
api_client=api_client
)
@staticmethod
def apply_kwargs_defaults(kwargs, return_http_data_only, async_req):
kwargs["async_req"] = async_req
kwargs["_return_http_data_only"] = return_http_data_only
kwargs["_preload_content"] = kwargs.get("_preload_content", True)
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
def batch_translate_bloomberg(
self,
bloomberg_translation_request,
**kwargs
) -> BloombergTranslationResponse:
"""Translate market security symbols into Bloomberg Identifiers. # noqa: E501
Returns the current security, composite, and regional identifiers from Bloomberg. <p>This method is best for requesting **large universes** of `ids`.</p><p>**This endpoint is included with all other Content API packages.**</p> # noqa: E501
This method makes a synchronous HTTP request. Returns the http data only
Args:
bloomberg_translation_request (BloombergTranslationRequest): Request Body for Bloomberg FIGIs.
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
BloombergTranslationResponse
Response Object
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False)
kwargs['bloomberg_translation_request'] = \
bloomberg_translation_request
return self.batch_translate_bloomberg_endpoint.call_with_http_info(**kwargs)
def batch_translate_bloomberg_with_http_info(
self,
bloomberg_translation_request,
**kwargs
) -> typing.Tuple[BloombergTranslationResponse, int, typing.MutableMapping]:
"""Translate market security symbols into Bloomberg Identifiers. # noqa: E501
Returns the current security, composite, and regional identifiers from Bloomberg. <p>This method is best for requesting **large universes** of `ids`.</p><p>**This endpoint is included with all other Content API packages.**</p> # noqa: E501
This method makes a synchronous HTTP request. Returns http data, http status and headers
Args:
bloomberg_translation_request (BloombergTranslationRequest): Request Body for Bloomberg FIGIs.
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
BloombergTranslationResponse
Response Object
int
Http Status Code
dict
Dictionary of the response headers
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False)
kwargs['bloomberg_translation_request'] = \
bloomberg_translation_request
return self.batch_translate_bloomberg_endpoint.call_with_http_info(**kwargs)
def batch_translate_bloomberg_async(
self,
bloomberg_translation_request,
**kwargs
) -> "ApplyResult[BloombergTranslationResponse]":
"""Translate market security symbols into Bloomberg Identifiers. # noqa: E501
Returns the current security, composite, and regional identifiers from Bloomberg. <p>This method is best for requesting **large universes** of `ids`.</p><p>**This endpoint is included with all other Content API packages.**</p> # noqa: E501
This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult
Args:
bloomberg_translation_request (BloombergTranslationRequest): Request Body for Bloomberg FIGIs.
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[BloombergTranslationResponse]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True)
kwargs['bloomberg_translation_request'] = \
bloomberg_translation_request
return self.batch_translate_bloomberg_endpoint.call_with_http_info(**kwargs)
def batch_translate_bloomberg_with_http_info_async(
self,
bloomberg_translation_request,
**kwargs
) -> "ApplyResult[typing.Tuple[BloombergTranslationResponse, int, typing.MutableMapping]]":
"""Translate market security symbols into Bloomberg Identifiers. # noqa: E501
Returns the current security, composite, and regional identifiers from Bloomberg. <p>This method is best for requesting **large universes** of `ids`.</p><p>**This endpoint is included with all other Content API packages.**</p> # noqa: E501
This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult
Args:
bloomberg_translation_request (BloombergTranslationRequest): Request Body for Bloomberg FIGIs.
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[(BloombergTranslationResponse, int, typing.Dict)]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True)
kwargs['bloomberg_translation_request'] = \
bloomberg_translation_request
return self.batch_translate_bloomberg_endpoint.call_with_http_info(**kwargs)
def translate_bloomberg(
self,
ids,
**kwargs
) -> BloombergTranslationResponse:
"""Translate market security symbols into Bloomberg Identifiers. # noqa: E501
Returns the current security, composite, regional Bloomberg (FIGI) unique identifiers. # noqa: E501
This method makes a synchronous HTTP request. Returns the http data only
Args:
ids ([str]): Requested market securities or entities. Accepted identifiers include all FactSet Permanent Identifiers types, CUSIP, SEDOL, ISIN, and Tickers. This request value is sent back in the response as, `requestId'. <p>***ids limit** = 3000 per request*</p> *<p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, its advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>*
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
BloombergTranslationResponse
Response Object
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False)
kwargs['ids'] = \
ids
return self.translate_bloomberg_endpoint.call_with_http_info(**kwargs)
def translate_bloomberg_with_http_info(
self,
ids,
**kwargs
) -> typing.Tuple[BloombergTranslationResponse, int, typing.MutableMapping]:
"""Translate market security symbols into Bloomberg Identifiers. # noqa: E501
Returns the current security, composite, regional Bloomberg (FIGI) unique identifiers. # noqa: E501
This method makes a synchronous HTTP request. Returns http data, http status and headers
Args:
ids ([str]): Requested market securities or entities. Accepted identifiers include all FactSet Permanent Identifiers types, CUSIP, SEDOL, ISIN, and Tickers. This request value is sent back in the response as, `requestId'. <p>***ids limit** = 3000 per request*</p> *<p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, its advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>*
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
BloombergTranslationResponse
Response Object
int
Http Status Code
dict
Dictionary of the response headers
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False)
kwargs['ids'] = \
ids
return self.translate_bloomberg_endpoint.call_with_http_info(**kwargs)
def translate_bloomberg_async(
self,
ids,
**kwargs
) -> "ApplyResult[BloombergTranslationResponse]":
"""Translate market security symbols into Bloomberg Identifiers. # noqa: E501
Returns the current security, composite, regional Bloomberg (FIGI) unique identifiers. # noqa: E501
This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult
Args:
ids ([str]): Requested market securities or entities. Accepted identifiers include all FactSet Permanent Identifiers types, CUSIP, SEDOL, ISIN, and Tickers. This request value is sent back in the response as, `requestId'. <p>***ids limit** = 3000 per request*</p> *<p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, its advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>*
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[BloombergTranslationResponse]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True)
kwargs['ids'] = \
ids
return self.translate_bloomberg_endpoint.call_with_http_info(**kwargs)
def translate_bloomberg_with_http_info_async(
self,
ids,
**kwargs
) -> "ApplyResult[typing.Tuple[BloombergTranslationResponse, int, typing.MutableMapping]]":
"""Translate market security symbols into Bloomberg Identifiers. # noqa: E501
Returns the current security, composite, regional Bloomberg (FIGI) unique identifiers. # noqa: E501
This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult
Args:
ids ([str]): Requested market securities or entities. Accepted identifiers include all FactSet Permanent Identifiers types, CUSIP, SEDOL, ISIN, and Tickers. This request value is sent back in the response as, `requestId'. <p>***ids limit** = 3000 per request*</p> *<p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, its advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>*
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[(BloombergTranslationResponse, int, typing.Dict)]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True)
kwargs['ids'] = \
ids
return self.translate_bloomberg_endpoint.call_with_http_info(**kwargs)
| 50.803636 | 607 | 0.616026 | 3,156 | 27,942 | 5.322877 | 0.094106 | 0.025716 | 0.018573 | 0.018096 | 0.872373 | 0.856658 | 0.856182 | 0.841122 | 0.841122 | 0.841122 | 0 | 0.008196 | 0.318839 | 27,942 | 549 | 608 | 50.896175 | 0.874429 | 0.612054 | 0 | 0.609865 | 0 | 0 | 0.160716 | 0.074523 | 0 | 0 | 0 | 0 | 0 | 1 | 0.044843 | false | 0 | 0.044843 | 0 | 0.130045 | 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 |
6ad955feaec69af5e7ba1d40094a67b7e1d573fe | 246 | py | Python | bitmovin_api_sdk/encoding/encodings/input_streams/audio_mix/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/encoding/encodings/input_streams/audio_mix/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/encoding/encodings/input_streams/audio_mix/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | from bitmovin_api_sdk.encoding.encodings.input_streams.audio_mix.audio_mix_api import AudioMixApi
from bitmovin_api_sdk.encoding.encodings.input_streams.audio_mix.audio_mix_input_stream_list_query_params import AudioMixInputStreamListQueryParams
| 82 | 147 | 0.926829 | 34 | 246 | 6.235294 | 0.5 | 0.150943 | 0.141509 | 0.169811 | 0.59434 | 0.59434 | 0.59434 | 0.59434 | 0.59434 | 0.59434 | 0 | 0 | 0.03252 | 246 | 2 | 148 | 123 | 0.890756 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
0a7cf8659bd9b75a6de6c2c9a27a604240ddc398 | 1,221 | py | Python | calculate_metrics.py | gugarosa/sampling_recognition | 226152dbf00f80ac1f98b12d6237fe50dcf8f04f | [
"MIT"
] | null | null | null | calculate_metrics.py | gugarosa/sampling_recognition | 226152dbf00f80ac1f98b12d6237fe50dcf8f04f | [
"MIT"
] | null | null | null | calculate_metrics.py | gugarosa/sampling_recognition | 226152dbf00f80ac1f98b12d6237fe50dcf8f04f | [
"MIT"
] | null | null | null | import pickle
import numpy as np
# Defining an input file
input_file = 'output/all_lenet_1024.pkl'
# Opening input file
with open(input_file, 'rb') as f:
# Loading pickle object
metrics = pickle.load(f)
# Outputting important information
print(f"Size: {len(metrics['train_time'])}")
# Calculating metrics
print(f"Training Time: {np.mean(metrics['train_time'])} +- {np.std(metrics['train_time'])}")
print(f"Test Loss: {np.mean(metrics['test_loss'])} +- {np.std(metrics['test_loss'])}")
print(f"Test Accuracy: {np.mean(metrics['test_accuracy'])} +- {np.std(metrics['test_accuracy'])}")
print(f"Test Precision: {np.mean(metrics['test_precision'])} +- {np.std(metrics['test_precision'])}")
print(f"Test Recall: {np.mean(metrics['test_recall'])} +- {np.std(metrics['test_recall'])}")
print(f"Test F1-Score: {np.mean(metrics['test_f1'])} +- {np.std(metrics['test_f1'])}")
print(f"${np.mean(metrics['test_accuracy']):.3f} \pm {np.std(metrics['test_accuracy']):.3f}$ & ${np.mean(metrics['test_precision']):.3f} \pm {np.std(metrics['test_precision']):.3f}$ & ${np.mean(metrics['test_recall']):.3f} \pm {np.std(metrics['test_recall']):.3f}$ & ${np.mean(metrics['test_f1']):.3f} \pm {np.std(metrics['test_f1']):.3f}$") | 50.875 | 341 | 0.682228 | 185 | 1,221 | 4.367568 | 0.237838 | 0.24505 | 0.160891 | 0.189356 | 0.477723 | 0.09901 | 0 | 0 | 0 | 0 | 0 | 0.015125 | 0.079443 | 1,221 | 24 | 341 | 50.875 | 0.703737 | 0.095004 | 0 | 0 | 0 | 0.538462 | 0.806364 | 0.673636 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.153846 | 0 | 0.153846 | 0.615385 | 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 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 6 |
0aea36bc4917d2a96edac89895949474933b5370 | 137 | py | Python | .circleci/validate_docs.py | jrzeszutek/cloudify-utilities-plugin | d62fc98e9164fd836d8f22a757b5a58ca119f97a | [
"Apache-2.0"
] | 13 | 2015-05-28T23:21:05.000Z | 2022-03-20T05:38:20.000Z | .circleci/validate_docs.py | jrzeszutek/cloudify-utilities-plugin | d62fc98e9164fd836d8f22a757b5a58ca119f97a | [
"Apache-2.0"
] | 75 | 2017-04-20T20:42:26.000Z | 2022-02-16T11:03:02.000Z | .circleci/validate_docs.py | jrzeszutek/cloudify-utilities-plugin | d62fc98e9164fd836d8f22a757b5a58ca119f97a | [
"Apache-2.0"
] | 41 | 2015-01-21T17:16:05.000Z | 2022-03-31T06:47:48.000Z | from ecosystem_cicd_tools.validations import validate_documentation_pulls
if __name__ == '__main__':
validate_documentation_pulls()
| 27.4 | 73 | 0.839416 | 15 | 137 | 6.733333 | 0.8 | 0.415842 | 0.514851 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.10219 | 137 | 4 | 74 | 34.25 | 0.821138 | 0 | 0 | 0 | 0 | 0 | 0.058394 | 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 |
e4091befc82b9dd101146b1ab29f20b27d67c66c | 5,142 | py | Python | platform/gsutil/third_party/boto/tests/unit/ec2/test_ec2object.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | 1 | 2021-04-30T05:26:20.000Z | 2021-04-30T05:26:20.000Z | platform/gsutil/third_party/boto/tests/unit/ec2/test_ec2object.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | platform/gsutil/third_party/boto/tests/unit/ec2/test_ec2object.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | 2 | 2020-07-25T05:03:06.000Z | 2020-11-04T04:55:57.000Z | #!/usr/bin/env python
from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.ec2.connection import EC2Connection
from boto.ec2.ec2object import TaggedEC2Object
CREATE_TAGS_RESPONSE = r"""<?xml version="1.0" encoding="UTF-8"?>
<CreateTagsResponse xmlns="http://ec2.amazonaws.com/doc/2014-05-01/">
<requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId>
<return>true</return>
</CreateTagsResponse>
"""
DELETE_TAGS_RESPONSE = r"""<?xml version="1.0" encoding="UTF-8"?>
<DeleteTagsResponse xmlns="http://ec2.amazonaws.com/doc/2014-05-01/">
<requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId>
<return>true</return>
</DeleteTagsResponse>
"""
class TestAddTags(AWSMockServiceTestCase):
connection_class = EC2Connection
def default_body(self):
return CREATE_TAGS_RESPONSE
def test_add_tag(self):
self.set_http_response(status_code=200)
taggedEC2Object = TaggedEC2Object(self.service_connection)
taggedEC2Object.id = "i-abcd1234"
taggedEC2Object.tags["already_present_key"] = "already_present_value"
taggedEC2Object.add_tag("new_key", "new_value")
self.assert_request_parameters({
'ResourceId.1': 'i-abcd1234',
'Action': 'CreateTags',
'Tag.1.Key': 'new_key',
'Tag.1.Value': 'new_value'},
ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
'SignatureVersion', 'Timestamp',
'Version'])
self.assertEqual(taggedEC2Object.tags, {
"already_present_key":"already_present_value",
"new_key":"new_value"})
def test_add_tags(self):
self.set_http_response(status_code=200)
taggedEC2Object = TaggedEC2Object(self.service_connection)
taggedEC2Object.id = "i-abcd1234"
taggedEC2Object.tags["already_present_key"] = "already_present_value"
taggedEC2Object.add_tags({"key1":"value1", "key2":"value2"})
self.assert_request_parameters({
'ResourceId.1': 'i-abcd1234',
'Action': 'CreateTags',
'Tag.1.Key': 'key1',
'Tag.1.Value': 'value1',
'Tag.2.Key': 'key2',
'Tag.2.Value': 'value2'},
ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
'SignatureVersion', 'Timestamp',
'Version'])
self.assertEqual(taggedEC2Object.tags, {
"already_present_key":"already_present_value",
"key1":"value1",
"key2": "value2"})
class TestRemoveTags(AWSMockServiceTestCase):
connection_class = EC2Connection
def default_body(self):
return DELETE_TAGS_RESPONSE
def test_remove_tag(self):
self.set_http_response(status_code=200)
taggedEC2Object = TaggedEC2Object(self.service_connection)
taggedEC2Object.id = "i-abcd1234"
taggedEC2Object.tags["key1"] = "value1"
taggedEC2Object.tags["key2"] = "value2"
taggedEC2Object.remove_tag("key1", "value1")
self.assert_request_parameters({
'ResourceId.1': 'i-abcd1234',
'Action': 'DeleteTags',
'Tag.1.Key': 'key1',
'Tag.1.Value': 'value1'},
ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
'SignatureVersion', 'Timestamp',
'Version'])
self.assertEqual(taggedEC2Object.tags, {"key2":"value2"})
def test_remove_tag_no_value(self):
self.set_http_response(status_code=200)
taggedEC2Object = TaggedEC2Object(self.service_connection)
taggedEC2Object.id = "i-abcd1234"
taggedEC2Object.tags["key1"] = "value1"
taggedEC2Object.tags["key2"] = "value2"
taggedEC2Object.remove_tag("key1")
self.assert_request_parameters({
'ResourceId.1': 'i-abcd1234',
'Action': 'DeleteTags',
'Tag.1.Key': 'key1'},
ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
'SignatureVersion', 'Timestamp',
'Version'])
self.assertEqual(taggedEC2Object.tags, {"key2":"value2"})
def test_remove_tag_empty_value(self):
self.set_http_response(status_code=200)
taggedEC2Object = TaggedEC2Object(self.service_connection)
taggedEC2Object.id = "i-abcd1234"
taggedEC2Object.tags["key1"] = "value1"
taggedEC2Object.tags["key2"] = "value2"
taggedEC2Object.remove_tag("key1", "")
self.assert_request_parameters({
'ResourceId.1': 'i-abcd1234',
'Action': 'DeleteTags',
'Tag.1.Key': 'key1',
'Tag.1.Value': ''},
ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
'SignatureVersion', 'Timestamp',
'Version'])
self.assertEqual(taggedEC2Object.tags, {"key2":"value2"})
if __name__ == '__main__':
unittest.main()
| 35.219178 | 77 | 0.608129 | 480 | 5,142 | 6.304167 | 0.197917 | 0.081626 | 0.045605 | 0.057502 | 0.831461 | 0.831461 | 0.831461 | 0.831461 | 0.823199 | 0.774289 | 0 | 0.05399 | 0.261571 | 5,142 | 145 | 78 | 35.462069 | 0.742955 | 0.00389 | 0 | 0.663636 | 0 | 0 | 0.290959 | 0.055458 | 0 | 0 | 0 | 0 | 0.090909 | 1 | 0.063636 | false | 0 | 0.036364 | 0.018182 | 0.154545 | 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 |
7c6a38992f08d95cce10844399a53f4d213abc86 | 135 | py | Python | parshuffle/__init__.py | ImoStocky/paragraph_permute | ea15dd98c1ba98b0cb7c854da5ea0165be0606a8 | [
"CC0-1.0"
] | null | null | null | parshuffle/__init__.py | ImoStocky/paragraph_permute | ea15dd98c1ba98b0cb7c854da5ea0165be0606a8 | [
"CC0-1.0"
] | null | null | null | parshuffle/__init__.py | ImoStocky/paragraph_permute | ea15dd98c1ba98b0cb7c854da5ea0165be0606a8 | [
"CC0-1.0"
] | null | null | null | # Define what will be available through from package import *?
from parshuffle.shuffle_file import *
from parshuffle.params import *
| 22.5 | 62 | 0.792593 | 18 | 135 | 5.888889 | 0.722222 | 0.188679 | 0.377358 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.155556 | 135 | 5 | 63 | 27 | 0.929825 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 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 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
7cdddbfedf934711758a384148370ba565083b60 | 26,729 | py | Python | tests/st/ops/gpu/test_scatter_func_op.py | PowerOlive/mindspore | bda20724a94113cedd12c3ed9083141012da1f15 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/st/ops/gpu/test_scatter_func_op.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/st/ops/gpu/test_scatter_func_op.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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 numpy as np
import pytest
import mindspore.context as context
import mindspore.nn as nn
from mindspore import Tensor, Parameter
from mindspore.ops import operations as P
from mindspore.ops.operations import _inner_ops as inner
context.set_context(mode=context.GRAPH_MODE, device_target="GPU")
# all cases tested against dchip
func_map = {
"update": P.ScatterUpdate,
"add": P.ScatterAdd,
"sub": P.ScatterSub,
}
class TestScatterFuncNet(nn.Cell):
def __init__(self, func, lock, inputx, indices, updates):
super(TestScatterFuncNet, self).__init__()
self.scatter_func = func_map[func](use_locking=lock)
self.inputx = Parameter(inputx, name="inputx")
self.indices = Parameter(indices, name="indices")
self.updates = Parameter(updates, name="updates")
def construct(self):
out = self.scatter_func(self.inputx, self.indices, self.updates)
return out
def scatter_func_net(func, inputx, indices, updates):
lock = True
net = TestScatterFuncNet(func, lock, inputx, indices, updates)
return net()
def scatter_func_use_locking_false_net(func, inputx, indices, updates):
lock = False
net = TestScatterFuncNet(func, lock, inputx, indices, updates)
return net()
class TestScatterFuncDynamicNet(nn.Cell):
def __init__(self, func, inputx, indices, updates):
super(TestScatterFuncDynamicNet, self).__init__()
self.scatter_func = func_map[func]()
self.test_dynamic = inner.GpuConvertToDynamicShape()
self.inputx = Parameter(inputx, name="inputx")
self.indices = Parameter(indices, name="indices")
self.updates = Parameter(updates, name="updates")
def construct(self):
indices = self.test_dynamic(self.indices)
updates = self.test_dynamic(self.updates)
out = self.scatter_func(self.inputx, indices, updates)
return out
def scatter_func_d_net(func, inputx, indices, updates):
context.set_context(mode=context.GRAPH_MODE, device_target="GPU")
net = TestScatterFuncDynamicNet(func, inputx, indices, updates)
return net()
class TestScatterFuncDynamicNet2(nn.Cell):
def __init__(self, func, inputx):
super(TestScatterFuncDynamicNet2, self).__init__()
self.scatter_func = func_map[func]()
self.test_dynamic = inner.GpuConvertToDynamicShape()
self.inputx = Parameter(inputx, name="inputx")
def construct(self, indices, updates):
indices = self.test_dynamic(indices)
updates = self.test_dynamic(updates)
out = self.scatter_func(self.inputx, indices, updates)
return out
def scatter_func_d2_net(func, inputx, indices_1, updates_1, indices_2, updates_2):
context.set_context(mode=context.GRAPH_MODE, device_target="GPU")
net = TestScatterFuncDynamicNet2(func, inputx)
out1 = net(indices_1, updates_1)
out2 = net(indices_2, updates_2)
return (out1, out2)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_small_float32():
inputx = Tensor(np.zeros((2, 3)).astype(np.float32))
indices = Tensor(np.array([[0, 1], [0, 1]]).astype(np.int32))
updates = Tensor(np.arange(12).reshape((2, 2, 3)).astype(np.float32))
# update
output = scatter_func_net("update", inputx, indices, updates)
expected = np.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0]])
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_net("add", inputx, indices, updates)
expected = np.array([[6.0, 8.0, 10.0], [12.0, 14.0, 16.0]])
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_net("sub", inputx, indices, updates)
expected = np.array([[-6.0, -8.0, -10.0], [-12.0, -14.0, -16.0]])
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_input_updated():
inputx = Tensor(np.zeros((2, 3)).astype(np.float32))
indices = Tensor(np.array([[0, 1], [0, 1]]).astype(np.int32))
updates = Tensor(np.arange(12).reshape((2, 2, 3)).astype(np.float32))
lock = True
# update
net = TestScatterFuncNet("update", lock, inputx, indices, updates)
net()
expected = np.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0]])
np.testing.assert_array_almost_equal(net.inputx.asnumpy(), expected)
# add
net = TestScatterFuncNet("add", lock, inputx, indices, updates)
net()
expected = np.array([[6.0, 8.0, 10.0], [12.0, 14.0, 16.0]])
np.testing.assert_array_almost_equal(net.inputx.asnumpy(), expected)
# sub
net = TestScatterFuncNet("sub", lock, inputx, indices, updates)
net()
expected = np.array([[-6.0, -8.0, -10.0], [-12.0, -14.0, -16.0]])
np.testing.assert_array_almost_equal(net.inputx.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_large_shape_float32():
inputx = Tensor(np.ones((4, 2, 3, 4)).astype(np.float32))
indices = Tensor(np.array([[0, 2], [3, 1]]).astype(np.int32))
updates = Tensor(np.arange(96).reshape((2, 2, 2, 3, 4)).astype(np.float32))
# update
output = scatter_func_net("update", inputx, indices, updates)
expected = np.array(
[
[
[[0.0, 1.0, 2.0, 3.0], [4.0, 5.0, 6.0, 7.0], [8.0, 9.0, 10.0, 11.0]],
[[12.0, 13.0, 14.0, 15.0], [16.0, 17.0, 18.0, 19.0], [20.0, 21.0, 22.0, 23.0]],
],
[
[[72.0, 73.0, 74.0, 75.0], [76.0, 77.0, 78.0, 79.0], [80.0, 81.0, 82.0, 83.0]],
[[84.0, 85.0, 86.0, 87.0], [88.0, 89.0, 90.0, 91.0], [92.0, 93.0, 94.0, 95.0]],
],
[
[[24.0, 25.0, 26.0, 27.0], [28.0, 29.0, 30.0, 31.0], [32.0, 33.0, 34.0, 35.0]],
[[36.0, 37.0, 38.0, 39.0], [40.0, 41.0, 42.0, 43.0], [44.0, 45.0, 46.0, 47.0]],
],
[
[[48.0, 49.0, 50.0, 51.0], [52.0, 53.0, 54.0, 55.0], [56.0, 57.0, 58.0, 59.0]],
[[60.0, 61.0, 62.0, 63.0], [64.0, 65.0, 66.0, 67.0], [68.0, 69.0, 70.0, 71.0]],
],
]
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_net("add", inputx, indices, updates)
expected = np.array(
[
[
[[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0], [9.0, 10.0, 11.0, 12.0]],
[[13.0, 14.0, 15.0, 16.0], [17.0, 18.0, 19.0, 20.0], [21.0, 22.0, 23.0, 24.0]],
],
[
[[73.0, 74.0, 75.0, 76.0], [77.0, 78.0, 79.0, 80.0], [81.0, 82.0, 83.0, 84.0]],
[[85.0, 86.0, 87.0, 88.0], [89.0, 90.0, 91.0, 92.0], [93.0, 94.0, 95.0, 96.0]],
],
[
[[25.0, 26.0, 27.0, 28.0], [29.0, 30.0, 31.0, 32.0], [33.0, 34.0, 35.0, 36.0]],
[[37.0, 38.0, 39.0, 40.0], [41.0, 42.0, 43.0, 44.0], [45.0, 46.0, 47.0, 48.0]],
],
[
[[49.0, 50.0, 51.0, 52.0], [53.0, 54.0, 55.0, 56.0], [57.0, 58.0, 59.0, 60.0]],
[[61.0, 62.0, 63.0, 64.0], [65.0, 66.0, 67.0, 68.0], [69.0, 70.0, 71.0, 72.0]],
],
]
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_net("sub", inputx, indices, updates)
expected = np.array(
[
[
[[1.0, 0.0, -1.0, -2.0], [-3.0, -4.0, -5.0, -6.0], [-7.0, -8.0, -9.0, -10.0]],
[
[-11.0, -12.0, -13.0, -14.0],
[-15.0, -16.0, -17.0, -18.0],
[-19.0, -20.0, -21.0, -22.0],
],
],
[
[
[-71.0, -72.0, -73.0, -74.0],
[-75.0, -76.0, -77.0, -78.0],
[-79.0, -80.0, -81.0, -82.0],
],
[
[-83.0, -84.0, -85.0, -86.0],
[-87.0, -88.0, -89.0, -90.0],
[-91.0, -92.0, -93.0, -94.0],
],
],
[
[
[-23.0, -24.0, -25.0, -26.0],
[-27.0, -28.0, -29.0, -30.0],
[-31.0, -32.0, -33.0, -34.0],
],
[
[-35.0, -36.0, -37.0, -38.0],
[-39.0, -40.0, -41.0, -42.0],
[-43.0, -44.0, -45.0, -46.0],
],
],
[
[
[-47.0, -48.0, -49.0, -50.0],
[-51.0, -52.0, -53.0, -54.0],
[-55.0, -56.0, -57.0, -58.0],
],
[
[-59.0, -60.0, -61.0, -62.0],
[-63.0, -64.0, -65.0, -66.0],
[-67.0, -68.0, -69.0, -70.0],
],
],
]
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_small_float32_use_locking_false():
inputx = Tensor(np.zeros((2, 3)).astype(np.float32))
indices = Tensor(np.array([1, 0]).astype(np.int32))
updates = Tensor(np.arange(6).reshape((2, 3)).astype(np.float32))
# update
output = scatter_func_use_locking_false_net("update", inputx, indices, updates)
expected = np.array([[3.0, 4.0, 5.0], [0.0, 1.0, 2.0]])
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_use_locking_false_net("add", inputx, indices, updates)
expected = np.array([[3.0, 4.0, 5.0], [0.0, 1.0, 2.0]])
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_use_locking_false_net("sub", inputx, indices, updates)
expected = np.array([[-3.0, -4.0, -5.0], [0.0, -1.0, -2.0]])
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_input_less_than_1_float32():
inputx = Tensor(
np.array(
[
[0.214141, 0.415151, 0.51516],
[0.876542, 0.451611, 0.55112],
[0.111244, 0.633333, 0.34444],
]
).astype(np.float32)
)
indices = Tensor(np.array([[[1, 0, 2], [2, 2, 0]], [[1, 0, 1], [2, 1, 2]]]).astype(np.int32))
updates = Tensor(np.arange(34, 70).reshape((2, 2, 3, 3)).astype(np.float32))
# update
output = scatter_func_net("update", inputx, indices, updates)
expected = np.array(
[[37.0, 38.0, 39.0], [34.0, 35.0, 66.0], [67.0, 68.0, 69.0],], dtype=np.float32,
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_net("add", inputx, indices, updates)
expected = np.array(
[
[141.21414, 144.41515, 147.51517],
[208.87654, 212.45161, 216.55112],
[257.11124, 262.63333, 267.34442],
],
dtype=np.float32,
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_net("sub", inputx, indices, updates)
expected = np.array(
[
[-140.78586, -143.58485, -146.48483],
[-207.12346, -211.54839, -215.44888],
[-256.88876, -261.36667, -266.65558],
],
dtype=np.float32,
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_float16():
inputx = Tensor(np.zeros((2, 3)).astype(np.float16))
indices = Tensor(np.array([[0, 1], [0, 1]]).astype(np.int32))
updates = Tensor(np.arange(12).reshape((2, 2, 3)).astype(np.float16))
# update
output = scatter_func_net("update", inputx, indices, updates)
expected = np.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0]])
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_net("add", inputx, indices, updates)
expected = np.array([[6.0, 8.0, 10.0], [12.0, 14.0, 16.0]])
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_net("sub", inputx, indices, updates)
expected = np.array([[-6.0, -8.0, -10.0], [-12.0, -14.0, -16.0]])
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_large_float16():
inputx = Tensor(np.zeros((2, 3, 4)).astype(np.float16))
indices = Tensor(np.array([[0, 0], [1, 1]]).astype(np.int32))
updates = Tensor(np.arange(63, 111).reshape((2, 2, 3, 4)).astype(np.float16))
# update
output = scatter_func_net("update", inputx, indices, updates)
expected = np.array(
[
[[63.0, 64.0, 65.0, 66.0], [67.0, 68.0, 69.0, 70.0], [71.0, 72.0, 73.0, 74.0],],
[[99.0, 100.0, 101.0, 102.0], [103.0, 104.0, 105.0, 106.0], [95.0, 96.0, 97.0, 98.0],],
]
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_net("add", inputx, indices, updates)
expected = np.array(
[
[
[138.0, 140.0, 142.0, 144.0],
[146.0, 148.0, 150.0, 152.0],
[154.0, 156.0, 158.0, 160.0],
],
[
[186.0, 188.0, 190.0, 192.0],
[194.0, 196.0, 198.0, 200.0],
[202.0, 204.0, 206.0, 208.0],
],
]
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_net("sub", inputx, indices, updates)
expected = np.array(
[
[
[-138.0, -140.0, -142.0, -144.0],
[-146.0, -148.0, -150.0, -152.0],
[-154.0, -156.0, -158.0, -160.0],
],
[
[-186.0, -188.0, -190.0, -192.0],
[-194.0, -196.0, -198.0, -200.0],
[-202.0, -204.0, -206.0, -208.0],
],
]
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_disordered_float16():
inputx = Tensor(np.flip(np.arange(34, 46).reshape(3, 4).astype(np.float16)))
indices = Tensor(np.array([[[0, 1, 2], [2, 1, 0]], [[0, 0, 0], [2, 2, 2]]]).astype(np.int32))
updates = Tensor(np.arange(63, 111).reshape((2, 2, 3, 4)).astype(np.float16))
# update
output = scatter_func_net("update", inputx, indices, updates)
expected = np.array(
[[95.0, 96.0, 97.0, 98.0], [67.0, 68.0, 69.0, 70.0], [99.0, 100.0, 101.0, 102.0]]
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_net("add", inputx, indices, updates)
expected = np.array(
[[464.0, 468.0, 472.0, 476.0], [187.0, 188.0, 189.0, 190.0], [492.0, 496.0, 500.0, 504.0]]
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_net("sub", inputx, indices, updates)
expected = np.array(
[
[-374.0, -380.0, -386.0, -392.0],
[-105.0, -108.0, -111.0, -114.0],
[-418.0, -424.0, -430.0, -436.0],
]
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_large_int32():
inputx = Tensor(np.zeros((2, 3, 4)).astype(np.int32))
indices = Tensor(np.array([[0, 0], [1, 1]]).astype(np.int32))
updates = Tensor(np.arange(63, 111).reshape((2, 2, 3, 4)).astype(np.int32))
# update
output = scatter_func_net("update", inputx, indices, updates)
expected = np.array(
[
[[63.0, 64.0, 65.0, 66.0], [67.0, 68.0, 69.0, 70.0], [71.0, 72.0, 73.0, 74.0],],
[[99.0, 100.0, 101.0, 102.0], [103.0, 104.0, 105.0, 106.0], [95.0, 96.0, 97.0, 98.0],],
]
).astype(np.int32)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_net("add", inputx, indices, updates)
expected = np.array(
[
[
[138.0, 140.0, 142.0, 144.0],
[146.0, 148.0, 150.0, 152.0],
[154.0, 156.0, 158.0, 160.0],
],
[
[186.0, 188.0, 190.0, 192.0],
[194.0, 196.0, 198.0, 200.0],
[202.0, 204.0, 206.0, 208.0],
],
]
).astype(np.int32)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_net("sub", inputx, indices, updates)
expected = np.array(
[
[
[-138.0, -140.0, -142.0, -144.0],
[-146.0, -148.0, -150.0, -152.0],
[-154.0, -156.0, -158.0, -160.0],
],
[
[-186.0, -188.0, -190.0, -192.0],
[-194.0, -196.0, -198.0, -200.0],
[-202.0, -204.0, -206.0, -208.0],
],
]
).astype(np.int32)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_disordered_int32():
inputx = Tensor(np.flip(np.arange(34, 46).reshape(3, 4).astype(np.int32)))
indices = Tensor(np.array([[[0, 1, 2], [2, 1, 0]], [[0, 0, 0], [2, 2, 2]]]).astype(np.int32))
updates = Tensor(np.arange(63, 111).reshape((2, 2, 3, 4)).astype(np.int32))
# update
output = scatter_func_net("update", inputx, indices, updates)
expected = np.array(
[[95.0, 96.0, 97.0, 98.0], [67.0, 68.0, 69.0, 70.0], [99.0, 100.0, 101.0, 102.0]]
).astype(np.int32)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_net("add", inputx, indices, updates)
expected = np.array(
[[464.0, 468.0, 472.0, 476.0], [187.0, 188.0, 189.0, 190.0], [492.0, 496.0, 500.0, 504.0]]
).astype(np.int32)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_net("sub", inputx, indices, updates)
expected = np.array(
[
[-374.0, -380.0, -386.0, -392.0],
[-105.0, -108.0, -111.0, -114.0],
[-418.0, -424.0, -430.0, -436.0],
]
).astype(np.int32)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_disordered_dynamic_int32():
inputx = Tensor(np.flip(np.arange(34, 46).reshape(3, 4).astype(np.int32)))
indices = Tensor(np.array([[[0, 1, 2], [2, 1, 0]], [[0, 0, 0], [2, 2, 2]]]).astype(np.int32))
updates = Tensor(np.arange(63, 111).reshape((2, 2, 3, 4)).astype(np.int32))
# update
output = scatter_func_d_net("update", inputx, indices, updates)
expected = np.array(
[[95.0, 96.0, 97.0, 98.0], [67.0, 68.0, 69.0, 70.0], [99.0, 100.0, 101.0, 102.0]]
).astype(np.int32)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_d_net("add", inputx, indices, updates)
expected = np.array(
[[464.0, 468.0, 472.0, 476.0], [187.0, 188.0, 189.0, 190.0], [492.0, 496.0, 500.0, 504.0]]
).astype(np.int32)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_d_net("sub", inputx, indices, updates)
expected = np.array(
[
[-374.0, -380.0, -386.0, -392.0],
[-105.0, -108.0, -111.0, -114.0],
[-418.0, -424.0, -430.0, -436.0],
]
).astype(np.int32)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_disordered_dynamic_int8():
inputx = Tensor(np.flip(np.arange(34, 46).reshape(3, 4).astype(np.int8)))
indices = Tensor(np.array([[[0, 1, 2], [2, 1, 0]], [[0, 0, 0], [2, 2, 2]]]).astype(np.int32))
updates = Tensor(np.arange(63, 111).reshape((2, 2, 3, 4)).astype(np.int8))
# update
output = scatter_func_d_net("update", inputx, indices, updates)
expected = np.array(
[[95.0, 96.0, 97.0, 98.0], [67.0, 68.0, 69.0, 70.0], [99.0, 100.0, 101.0, 102.0]]
).astype(np.int8)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_d_net("add", inputx, indices, updates)
expected = np.array(
[[464.0, 468.0, 472.0, 476.0], [187.0, 188.0, 189.0, 190.0], [492.0, 496.0, 500.0, 504.0]]
).astype(np.int8)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_d_net("sub", inputx, indices, updates)
expected = np.array(
[
[-118.0, -124.0, 126.0, 120.0],
[-105.0, -108.0, -111.0, -114.0],
[94.0, 88.0, 82.0, 76.0],
]
).astype(np.int8)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_disordered_dynamic_uint8():
inputx = Tensor(np.flip(np.arange(34, 46).reshape(3, 4).astype(np.uint8)))
indices = Tensor(np.array([[[0, 1, 2], [2, 1, 0]], [[0, 0, 0], [2, 2, 2]]]).astype(np.int32))
updates = Tensor(np.arange(63, 111).reshape((2, 2, 3, 4)).astype(np.uint8))
# update
output = scatter_func_d_net("update", inputx, indices, updates)
expected = np.array(
[[95.0, 96.0, 97.0, 98.0], [67.0, 68.0, 69.0, 70.0], [99.0, 100.0, 101.0, 102.0]]
).astype(np.uint8)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_d_net("add", inputx, indices, updates)
expected = np.array(
[[464.0, 468.0, 472.0, 476.0], [187.0, 188.0, 189.0, 190.0], [492.0, 496.0, 500.0, 504.0]]
).astype(np.uint8)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_d_net("sub", inputx, indices, updates)
expected = np.array(
[[138.0, 132.0, 126.0, 120.0], [151.0, 148.0, 145.0, 142.0], [94.0, 88.0, 82.0, 76.0]]
).astype(np.uint8)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_input_less_than_1_dynamic_float32():
inputx = Tensor(
np.array(
[
[0.214141, 0.415151, 0.51516],
[0.876542, 0.451611, 0.55112],
[0.111244, 0.633333, 0.34444],
]
).astype(np.float32)
)
indices = Tensor(np.array([[[1, 0, 2], [2, 2, 0]], [[1, 0, 1], [2, 1, 2]]]).astype(np.int32))
updates = Tensor(np.arange(34, 70).reshape((2, 2, 3, 3)).astype(np.float32))
# update
output = scatter_func_d_net("update", inputx, indices, updates)
expected = np.array(
[[37.0, 38.0, 39.0], [34.0, 35.0, 66.0], [67.0, 68.0, 69.0],], dtype=np.float32,
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# add
output = scatter_func_d_net("add", inputx, indices, updates)
expected = np.array(
[
[141.21414, 144.41515, 147.51517],
[208.87654, 212.45161, 216.55112],
[257.11124, 262.63333, 267.34442],
],
dtype=np.float32,
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
# sub
output = scatter_func_d_net("sub", inputx, indices, updates)
expected = np.array(
[
[-140.78586, -143.58485, -146.48483],
[-207.12346, -211.54839, -215.44888],
[-256.88876, -261.36667, -266.65558],
],
dtype=np.float32,
)
np.testing.assert_array_almost_equal(output.asnumpy(), expected)
@pytest.mark.level0
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_scatter_func_dynamic_two_inputs():
inputx = Tensor(np.zeros((2, 3)).astype(np.float32))
indices_1 = Tensor(np.array([[0, 1], [0, 1]]).astype(np.int32))
updates_1 = Tensor(np.arange(12).reshape((2, 2, 3)).astype(np.float32))
indices_2 = Tensor(np.array([[0, 0], [1, 1], [1, 0]]).astype(np.int32))
updates_2 = Tensor(np.flip(np.arange(18).reshape((3, 2, 3)).astype(np.float32)))
# update
output_1, output_2 = scatter_func_d2_net(
"update", inputx, indices_1, updates_1, indices_2, updates_2
)
expected_1 = np.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0]])
expected_2 = np.array([[17.0, 16.0, 15.0], [11.0, 10.0, 9.0]])
np.testing.assert_array_almost_equal(output_1.asnumpy(), expected_1)
np.testing.assert_array_almost_equal(output_2.asnumpy(), expected_2)
# add
output_1, output_2 = scatter_func_d2_net(
"add", inputx, indices_1, updates_1, indices_2, updates_2
)
expected_1 = np.array([[6.0, 8.0, 10.0], [12.0, 14.0, 16.0]])
expected_2 = np.array([[39.0, 38.0, 37.0], [36.0, 35.0, 34.0]])
np.testing.assert_array_almost_equal(output_1.asnumpy(), expected_1)
np.testing.assert_array_almost_equal(output_2.asnumpy(), expected_2)
# sub
output_1, output_2 = scatter_func_d2_net(
"sub", inputx, indices_1, updates_1, indices_2, updates_2
)
expected_1 = np.array([[-6.0, -8.0, -10.0], [-12.0, -14.0, -16.0]])
expected_2 = np.array([[-39.0, -38.0, -37.0], [-36.0, -35.0, -34.0]])
np.testing.assert_array_almost_equal(output_1.asnumpy(), expected_1)
np.testing.assert_array_almost_equal(output_2.asnumpy(), expected_2)
| 37.072122 | 99 | 0.568933 | 4,060 | 26,729 | 3.62266 | 0.089163 | 0.050109 | 0.07071 | 0.065271 | 0.901618 | 0.888972 | 0.872518 | 0.859804 | 0.841719 | 0.823429 | 0 | 0.163888 | 0.241648 | 26,729 | 720 | 100 | 37.123611 | 0.561717 | 0.033634 | 0 | 0.629433 | 0 | 0 | 0.009585 | 0 | 0 | 0 | 0 | 0 | 0.085106 | 1 | 0.044326 | false | 0 | 0.012411 | 0 | 0.074468 | 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 |
6b23ac628b45a261d3ae15d879e43af499cd1839 | 89 | py | Python | oledpy/__init__.py | jsbangsund/oledpy | 200934c3493e203c50523427d2286ec60341b510 | [
"MIT"
] | 4 | 2020-08-25T14:51:04.000Z | 2021-11-16T02:51:58.000Z | oledpy/__init__.py | deep-learning-ma/oledpy | 200934c3493e203c50523427d2286ec60341b510 | [
"MIT"
] | 1 | 2020-10-15T16:30:54.000Z | 2020-10-15T16:30:54.000Z | oledpy/__init__.py | deep-learning-ma/oledpy | 200934c3493e203c50523427d2286ec60341b510 | [
"MIT"
] | 5 | 2020-08-26T01:57:24.000Z | 2021-11-03T09:01:12.000Z | # import modules
#import oledpy.tmm
#import oledpy.dipole_emission
from .oledpy import *
| 17.8 | 30 | 0.797753 | 12 | 89 | 5.833333 | 0.583333 | 0.342857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.123596 | 89 | 4 | 31 | 22.25 | 0.897436 | 0.674157 | 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 |
6b3023f320409dee292fff6c2d9f0979079eafd5 | 32 | py | Python | MTLib/cosmos/__init__.py | skrrrlev/Masters_Thesis | 5b096b01ffdcb8d723723769058d43951c9db515 | [
"MIT"
] | null | null | null | MTLib/cosmos/__init__.py | skrrrlev/Masters_Thesis | 5b096b01ffdcb8d723723769058d43951c9db515 | [
"MIT"
] | null | null | null | MTLib/cosmos/__init__.py | skrrrlev/Masters_Thesis | 5b096b01ffdcb8d723723769058d43951c9db515 | [
"MIT"
] | null | null | null | from .catalogue import Catalogue | 32 | 32 | 0.875 | 4 | 32 | 7 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.09375 | 32 | 1 | 32 | 32 | 0.965517 | 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 |
6b39a6b1570f17bf005023acbf9ad7d0e67a08a8 | 220 | py | Python | src/gui/MainWindow/__init__.py | bochkovoi/AHP | b51dc598f8f7a65a2ade039d887dccfa6d070f1e | [
"MIT"
] | null | null | null | src/gui/MainWindow/__init__.py | bochkovoi/AHP | b51dc598f8f7a65a2ade039d887dccfa6d070f1e | [
"MIT"
] | null | null | null | src/gui/MainWindow/__init__.py | bochkovoi/AHP | b51dc598f8f7a65a2ade039d887dccfa6d070f1e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from .MainAlternativesVision import *
from .MainCategoriesVision import *
from .MainCriteriasVision import *
from .MainObjectWindow import *
from .MainRadioButton import *
| 24.444444 | 37 | 0.763636 | 22 | 220 | 7.636364 | 0.636364 | 0.238095 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010417 | 0.127273 | 220 | 8 | 38 | 27.5 | 0.864583 | 0.195455 | 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 |
860992e9ec6bbe2ffb7f5548f7c5e5212164c5ae | 33 | py | Python | python_retry/__init__.py | pyprogrammerblog/python-retry | ebeb787514ae5f05d72972d7b81cc71124db66cb | [
"MIT"
] | 1 | 2022-03-12T18:17:31.000Z | 2022-03-12T18:17:31.000Z | python_retry/__init__.py | pyprogrammerblog/python-retry | ebeb787514ae5f05d72972d7b81cc71124db66cb | [
"MIT"
] | null | null | null | python_retry/__init__.py | pyprogrammerblog/python-retry | ebeb787514ae5f05d72972d7b81cc71124db66cb | [
"MIT"
] | null | null | null | from .retry import retry # NOQA
| 16.5 | 32 | 0.727273 | 5 | 33 | 4.8 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.212121 | 33 | 1 | 33 | 33 | 0.923077 | 0.121212 | 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 |
8611b614c41b30ba8483f13e994600aaacb7182e | 18,303 | py | Python | tests/pytests/unit/modules/test_win_pkg.py | haodeon/salt | af2964f4ddbf9c5635d1528a495e473996cc7b71 | [
"Apache-2.0"
] | null | null | null | tests/pytests/unit/modules/test_win_pkg.py | haodeon/salt | af2964f4ddbf9c5635d1528a495e473996cc7b71 | [
"Apache-2.0"
] | null | null | null | tests/pytests/unit/modules/test_win_pkg.py | haodeon/salt | af2964f4ddbf9c5635d1528a495e473996cc7b71 | [
"Apache-2.0"
] | null | null | null | """
Tests for the win_pkg module
"""
import pytest
import salt.modules.config as config
import salt.modules.pkg_resource as pkg_resource
import salt.modules.win_pkg as win_pkg
import salt.utils.data
import salt.utils.platform
import salt.utils.win_reg as win_reg
from salt.exceptions import MinionError
from tests.support.mock import MagicMock, patch
pytestmark = [
pytest.mark.windows_whitelisted,
pytest.mark.skip_unless_on_windows,
]
@pytest.fixture
def configure_loader_modules():
pkg_info = {
"3.03": {
"full_name": "Nullsoft Install System",
"installer": "http://download.sourceforge.net/project/nsis/NSIS%203/3.03/nsis-3.03-setup.exe",
"install_flags": "/S",
"uninstaller": "%PROGRAMFILES(x86)%\\NSIS\\uninst-nsis.exe",
"uninstall_flags": "/S",
"msiexec": False,
"reboot": False,
},
"3.02": {
"full_name": "Nullsoft Install System",
"installer": "http://download.sourceforge.net/project/nsis/NSIS%203/3.02/nsis-3.02-setup.exe",
"install_flags": "/S",
"uninstaller": "%PROGRAMFILES(x86)%\\NSIS\\uninst-nsis.exe",
"uninstall_flags": "/S",
"msiexec": False,
"reboot": False,
},
}
return {
win_pkg: {
"_get_latest_package_version": MagicMock(return_value="3.03"),
"_get_package_info": MagicMock(return_value=pkg_info),
"__salt__": {
"pkg_resource.add_pkg": pkg_resource.add_pkg,
"pkg_resource.parse_targets": pkg_resource.parse_targets,
"pkg_resource.sort_pkglist": pkg_resource.sort_pkglist,
"pkg_resource.stringify": pkg_resource.stringify,
"config.valid_fileproto": config.valid_fileproto,
},
"__utils__": {
"reg.key_exists": win_reg.key_exists,
"reg.list_keys": win_reg.list_keys,
"reg.read_value": win_reg.read_value,
"reg.value_exists": win_reg.value_exists,
},
},
pkg_resource: {"__grains__": {"os": "Windows"}},
}
def test_pkg__get_reg_software():
result = win_pkg._get_reg_software()
assert isinstance(result, dict)
found_python = False
search = "Python 3"
for key in result:
if search in key:
found_python = True
assert found_python
def test_pkg__get_reg_software_noremove():
search = "test_pkg_noremove"
key = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{}".format(search)
win_reg.set_value(hive="HKLM", key=key, vname="DisplayName", vdata=search)
win_reg.set_value(hive="HKLM", key=key, vname="DisplayVersion", vdata="1.0.0")
win_reg.set_value(
hive="HKLM", key=key, vname="NoRemove", vtype="REG_DWORD", vdata="1"
)
try:
result = win_pkg._get_reg_software()
assert isinstance(result, dict)
found = False
search = "test_pkg"
for item in result:
if search in item:
found = True
assert found is True
finally:
win_reg.delete_key_recursive(hive="HKLM", key=key)
assert not win_reg.key_exists(hive="HKLM", key=key)
def test_pkg__get_reg_software_noremove_not_present():
search = "test_pkg_noremove_not_present"
key = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{}".format(search)
win_reg.set_value(hive="HKLM", key=key, vname="DisplayName", vdata=search)
win_reg.set_value(hive="HKLM", key=key, vname="DisplayVersion", vdata="1.0.0")
try:
result = win_pkg._get_reg_software()
assert isinstance(result, dict)
found = False
for item in result:
if search in item:
found = True
assert found is False
finally:
win_reg.delete_key_recursive(hive="HKLM", key=key)
assert not win_reg.key_exists(hive="HKLM", key=key)
def test_pkg_install_not_found():
"""
Test pkg.install when the Version is NOT FOUND in the Software
Definition
"""
ret_reg = {"Nullsoft Install System": "3.03"}
# The 2nd time it's run with stringify
se_list_pkgs = {"nsis": ["3.03"]}
with patch.object(win_pkg, "list_pkgs", return_value=se_list_pkgs), patch.object(
win_pkg, "_get_reg_software", return_value=ret_reg
):
expected = {"nsis": {"not found": "3.01"}}
result = win_pkg.install(name="nsis", version="3.01")
assert expected == result
def test_pkg_install_rollback():
"""
test pkg.install rolling back to a previous version
"""
ret_reg = {"Nullsoft Install System": "3.03"}
# The 2nd time it's run, pkg.list_pkgs uses with stringify
se_list_pkgs = [{"nsis": ["3.03"]}, {"nsis": "3.02"}]
with patch.object(win_pkg, "list_pkgs", side_effect=se_list_pkgs), patch.object(
win_pkg, "_get_reg_software", return_value=ret_reg
), patch.dict(
win_pkg.__salt__, {"cp.is_cached": MagicMock(return_value=False)}
), patch.dict(
win_pkg.__salt__,
{"cp.cache_file": MagicMock(return_value="C:\\fake\\path.exe")},
), patch.dict(
win_pkg.__salt__, {"cmd.run_all": MagicMock(return_value={"retcode": 0})}
):
expected = {"nsis": {"new": "3.02", "old": "3.03"}}
result = win_pkg.install(name="nsis", version="3.02")
assert expected == result
def test_pkg_install_existing():
"""
test pkg.install when the package is already installed
no version passed
"""
ret_reg = {"Nullsoft Install System": "3.03"}
# The 2nd time it's run, pkg.list_pkgs uses with stringify
se_list_pkgs = {"nsis": ["3.03"]}
with patch.object(win_pkg, "list_pkgs", return_value=se_list_pkgs), patch.object(
win_pkg, "_get_reg_software", return_value=ret_reg
), patch.dict(
win_pkg.__salt__, {"cp.is_cached": MagicMock(return_value=False)}
), patch.dict(
win_pkg.__salt__,
{"cp.cache_file": MagicMock(return_value="C:\\fake\\path.exe")},
), patch.dict(
win_pkg.__salt__, {"cmd.run_all": MagicMock(return_value={"retcode": 0})}
):
expected = {}
result = win_pkg.install(name="nsis")
assert expected == result
def test_pkg_install_existing_with_version():
"""
test pkg.install when the package is already installed
A version is passed
"""
ret_reg = {"Nullsoft Install System": "3.03"}
# The 2nd time it's run, pkg.list_pkgs uses with stringify
se_list_pkgs = {"nsis": ["3.03"]}
with patch.object(win_pkg, "list_pkgs", return_value=se_list_pkgs), patch.object(
win_pkg, "_get_reg_software", return_value=ret_reg
), patch.dict(
win_pkg.__salt__, {"cp.is_cached": MagicMock(return_value=False)}
), patch.dict(
win_pkg.__salt__,
{"cp.cache_file": MagicMock(return_value="C:\\fake\\path.exe")},
), patch.dict(
win_pkg.__salt__, {"cmd.run_all": MagicMock(return_value={"retcode": 0})}
):
expected = {}
result = win_pkg.install(name="nsis", version="3.03")
assert expected == result
def test_pkg_install_name():
"""
test pkg.install name extra_install_flags
"""
ret__get_package_info = {
"3.03": {
"uninstaller": "%program.exe",
"reboot": False,
"msiexec": False,
"installer": "runme.exe",
"uninstall_flags": "/S",
"locale": "en_US",
"install_flags": "/s",
"full_name": "Firebox 3.03 (x86 en-US)",
}
}
mock_cmd_run_all = MagicMock(return_value={"retcode": 0})
with patch.object(
salt.utils.data, "is_true", MagicMock(return_value=True)
), patch.object(
win_pkg, "_get_package_info", MagicMock(return_value=ret__get_package_info)
), patch.dict(
win_pkg.__salt__,
{
"pkg_resource.parse_targets": MagicMock(
return_value=[{"firebox": "3.03"}, None]
),
"cp.is_cached": MagicMock(return_value="C:\\fake\\path.exe"),
"cmd.run_all": mock_cmd_run_all,
},
):
ret = win_pkg.install(
name="firebox",
version="3.03",
extra_install_flags="-e True -test_flag True",
)
assert "-e True -test_flag True" in str(mock_cmd_run_all.call_args[0])
def test_pkg_install_single_pkg():
"""
test pkg.install pkg with extra_install_flags
"""
ret__get_package_info = {
"3.03": {
"uninstaller": "%program.exe",
"reboot": False,
"msiexec": False,
"installer": "runme.exe",
"uninstall_flags": "/S",
"locale": "en_US",
"install_flags": "/s",
"full_name": "Firebox 3.03 (x86 en-US)",
}
}
mock_cmd_run_all = MagicMock(return_value={"retcode": 0})
with patch.object(
salt.utils.data, "is_true", MagicMock(return_value=True)
), patch.object(
win_pkg, "_get_package_info", MagicMock(return_value=ret__get_package_info)
), patch.dict(
win_pkg.__salt__,
{
"pkg_resource.parse_targets": MagicMock(
return_value=[{"firebox": "3.03"}, None]
),
"cp.is_cached": MagicMock(return_value="C:\\fake\\path.exe"),
"cmd.run_all": mock_cmd_run_all,
},
):
ret = win_pkg.install(
pkgs=["firebox"],
version="3.03",
extra_install_flags="-e True -test_flag True",
)
assert "-e True -test_flag True" in str(mock_cmd_run_all.call_args[0])
def test_pkg_install_multiple_pkgs():
"""
test pkg.install pkg with extra_install_flags
"""
ret__get_package_info = {
"3.03": {
"uninstaller": "%program.exe",
"reboot": False,
"msiexec": False,
"installer": "runme.exe",
"uninstall_flags": "/S",
"locale": "en_US",
"install_flags": "/s",
"full_name": "Firebox 3.03 (x86 en-US)",
}
}
mock_cmd_run_all = MagicMock(return_value={"retcode": 0})
with patch.object(
salt.utils.data, "is_true", MagicMock(return_value=True)
), patch.object(
win_pkg, "_get_package_info", MagicMock(return_value=ret__get_package_info)
), patch.dict(
win_pkg.__salt__,
{
"pkg_resource.parse_targets": MagicMock(
return_value=[{"firebox": "3.03", "got": "3.03"}, None]
),
"cp.is_cached": MagicMock(return_value="C:\\fake\\path.exe"),
"cmd.run_all": mock_cmd_run_all,
},
):
ret = win_pkg.install(
pkgs=["firebox", "got"], extra_install_flags="-e True -test_flag True"
)
assert "-e True -test_flag True" not in str(mock_cmd_run_all.call_args[0])
def test_pkg_install_minion_error_https():
"""
Test pkg.install when cp.cache_file encounters a minion error
"""
ret__get_package_info = {
"3.03": {
"uninstaller": "%program.exe",
"reboot": False,
"msiexec": False,
"installer": "https://repo.test.com/runme.exe",
"uninstall_flags": "/S",
"locale": "en_US",
"install_flags": "/s",
"full_name": "Firebox 3.03 (x86 en-US)",
}
}
err_msg = (
"Error: [Errno 11001] getaddrinfo failed reading"
" https://repo.test.com/runme.exe"
)
mock_none = MagicMock(return_value=None)
mock_minion_error = MagicMock(side_effect=MinionError(err_msg))
mock_parse = MagicMock(return_value=[{"firebox": "3.03"}, None])
with patch.object(
salt.utils.data, "is_true", MagicMock(return_value=True)
), patch.object(
win_pkg, "_get_package_info", MagicMock(return_value=ret__get_package_info)
), patch.dict(
win_pkg.__salt__,
{
"pkg_resource.parse_targets": mock_parse,
"cp.is_cached": mock_none,
"cp.cache_file": mock_minion_error,
},
):
ret = win_pkg.install(
name="firebox",
version="3.03",
)
expected = (
"Failed to cache https://repo.test.com/runme.exe\nError: [Errno 11001]"
" getaddrinfo failed reading https://repo.test.com/runme.exe"
)
assert ret == expected
def test_pkg_install_minion_error_salt():
"""
Test pkg.install when cp.cache_file encounters a minion error
"""
ret__get_package_info = {
"3.03": {
"uninstaller": "%program.exe",
"reboot": False,
"msiexec": False,
"installer": "salt://software/runme.exe",
"uninstall_flags": "/S",
"locale": "en_US",
"install_flags": "/s",
"full_name": "Firebox 3.03 (x86 en-US)",
}
}
err_msg = "Error: [Errno 1] failed reading salt://software/runme.exe"
mock_none = MagicMock(return_value=None)
mock_minion_error = MagicMock(side_effect=MinionError(err_msg))
mock_parse = MagicMock(return_value=[{"firebox": "3.03"}, None])
with patch.object(
salt.utils.data, "is_true", MagicMock(return_value=True)
), patch.object(
win_pkg, "_get_package_info", MagicMock(return_value=ret__get_package_info)
), patch.dict(
win_pkg.__salt__,
{
"pkg_resource.parse_targets": mock_parse,
"cp.is_cached": mock_none,
"cp.cache_file": mock_minion_error,
},
):
ret = win_pkg.install(
name="firebox",
version="3.03",
)
expected = (
"Failed to cache salt://software/runme.exe\n"
"Error: [Errno 1] failed reading salt://software/runme.exe"
)
assert ret == expected
def test_pkg_install_minion_error_salt_cache_dir():
"""
Test pkg.install when cp.cache_dir encounters a minion error
"""
ret__get_package_info = {
"3.03": {
"uninstaller": "%program.exe",
"reboot": False,
"msiexec": False,
"installer": "salt://software/runme.exe",
"cache_dir": True,
"uninstall_flags": "/S",
"locale": "en_US",
"install_flags": "/s",
"full_name": "Firebox 3.03 (x86 en-US)",
}
}
err_msg = "Error: [Errno 1] failed reading salt://software"
mock_none = MagicMock(return_value=None)
mock_minion_error = MagicMock(side_effect=MinionError(err_msg))
mock_parse = MagicMock(return_value=[{"firebox": "3.03"}, None])
with patch.object(
salt.utils.data, "is_true", MagicMock(return_value=True)
), patch.object(
win_pkg, "_get_package_info", MagicMock(return_value=ret__get_package_info)
), patch.dict(
win_pkg.__salt__,
{"cp.cache_dir": mock_minion_error},
):
ret = win_pkg.install(
name="firebox",
version="3.03",
)
expected = (
"Failed to cache salt://software\n"
"Error: [Errno 1] failed reading salt://software"
)
assert ret == expected
def test_pkg_remove_minion_error_salt_cache_dir():
"""
Test pkg.remove when cp.cache_dir encounters a minion error
"""
ret__get_package_info = {
"3.03": {
"uninstaller": "salt://software/runme.exe",
"reboot": False,
"msiexec": False,
"installer": "salt://software/runme.exe",
"cache_dir": True,
"uninstall_flags": "/U /S",
"locale": "en_US",
"install_flags": "/s",
"full_name": "Firebox 3.03 (x86 en-US)",
}
}
err_msg = "Error: [Errno 1] failed reading salt://software"
mock_minion_error = MagicMock(side_effect=MinionError(err_msg))
mock_parse = MagicMock(return_value=[{"firebox": "3.03"}, None])
se_list_pkgs = {"firebox": ["3.03"]}
with patch.object(win_pkg, "list_pkgs", return_value=se_list_pkgs), patch.object(
salt.utils.data, "is_true", MagicMock(return_value=True)
), patch.object(
win_pkg, "_get_package_info", MagicMock(return_value=ret__get_package_info)
), patch.dict(
win_pkg.__salt__,
{
"pkg_resource.parse_targets": mock_parse,
"cp.cache_dir": mock_minion_error,
},
):
ret = win_pkg.remove(name="firebox")
expected = (
"Failed to cache salt://software\n"
"Error: [Errno 1] failed reading salt://software"
)
assert ret == expected
def test_pkg_remove_minion_error_salt():
"""
Test pkg.remove when cp.cache_file encounters a minion error
"""
ret__get_package_info = {
"3.03": {
"uninstaller": "salt://software/runme.exe",
"reboot": False,
"msiexec": False,
"installer": "salt://software/runme.exe",
"uninstall_flags": "/U /S",
"locale": "en_US",
"install_flags": "/s",
"full_name": "Firebox 3.03 (x86 en-US)",
}
}
err_msg = "Error: [Errno 1] failed reading salt://software/runme.exe"
mock_minion_error = MagicMock(side_effect=MinionError(err_msg))
mock_none = MagicMock(return_value=None)
mock_parse = MagicMock(return_value=[{"firebox": "3.03"}, None])
se_list_pkgs = {"firebox": ["3.03"]}
with patch.object(win_pkg, "list_pkgs", return_value=se_list_pkgs), patch.object(
salt.utils.data, "is_true", MagicMock(return_value=True)
), patch.object(
win_pkg, "_get_package_info", MagicMock(return_value=ret__get_package_info)
), patch.dict(
win_pkg.__salt__,
{
"pkg_resource.parse_targets": mock_parse,
"cp.is_cached": mock_none,
"cp.cache_file": mock_minion_error,
},
):
ret = win_pkg.remove(name="firebox")
expected = (
"Failed to cache salt://software/runme.exe\n"
"Error: [Errno 1] failed reading salt://software/runme.exe"
)
assert ret == expected
| 34.083799 | 106 | 0.588046 | 2,222 | 18,303 | 4.537354 | 0.086859 | 0.032136 | 0.089268 | 0.030351 | 0.887324 | 0.883456 | 0.856675 | 0.83535 | 0.818687 | 0.804106 | 0 | 0.017055 | 0.272797 | 18,303 | 536 | 107 | 34.147388 | 0.740421 | 0.051959 | 0 | 0.699095 | 0 | 0.006787 | 0.259024 | 0.048924 | 0 | 0 | 0 | 0 | 0.045249 | 1 | 0.036199 | false | 0 | 0.020362 | 0 | 0.058824 | 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 |
863577165203e2ab8335afdd2aac817ed3128e62 | 5,488 | py | Python | nemo/collections/nlp/nm/data_layers/glue_benchmark_datalayer.py | ParikhKadam/NeMo | ee11f7c4666d410d91f9da33c61f4819ea625013 | [
"Apache-2.0"
] | 10 | 2020-03-17T08:32:06.000Z | 2021-04-19T19:03:50.000Z | nemo/collections/nlp/nm/data_layers/glue_benchmark_datalayer.py | dcmartin/NeMo | d2120a40bf23d3e38ff5677c2685c712f297e6b1 | [
"Apache-2.0"
] | 1 | 2020-06-11T00:54:42.000Z | 2020-06-11T00:54:42.000Z | nemo/collections/nlp/nm/data_layers/glue_benchmark_datalayer.py | dcmartin/NeMo | d2120a40bf23d3e38ff5677c2685c712f297e6b1 | [
"Apache-2.0"
] | 3 | 2020-03-10T05:10:07.000Z | 2020-12-08T01:33:35.000Z | # =============================================================================
# Copyright 2020 NVIDIA. All Rights Reserved.
#
# 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 nemo.collections.nlp.data import GLUEDataset
from nemo.collections.nlp.nm.data_layers.text_datalayer import TextDataLayer
from nemo.core import CategoricalValuesType, ChannelType, NeuralType, RegressionValuesType
from nemo.utils.decorators import add_port_docs
__all__ = ['GlueClassificationDataLayer', 'GlueRegressionDataLayer']
class GlueClassificationDataLayer(TextDataLayer):
"""
Creates the data layer to use for the GLUE classification tasks,
more details here: https://gluebenchmark.com/tasks
All the data processing is done in GLUEDataset.
Args:
data_dir (str): data directory path
tokenizer (TokenizerSpec): text tokenizer.
max_seq_length (int): maximum allowed length of the text segments .
processor (DataProcessor): data processor.
evaluate (bool): true if data layer is used for evaluation. Default: False.
batch_size (int): batch size in segments
shuffle (bool): whether to shuffle data or not. Default: False.
dataset_type (GLUEDataset):
the dataset that needs to be converted to DataLayerNM
"""
@property
@add_port_docs()
def output_ports(self):
"""Returns definitions of module output ports.
input_ids:
indices of tokens which constitute batches of text segments
input_type_ids:
tensor with 0's and 1's to denote the text segment type
input_mask:
bool tensor with 0s in place of tokens to be masked
labels:
integer indices for sentence classication prediction
"""
return {
"input_ids": NeuralType(('B', 'T'), ChannelType()),
"input_type_ids": NeuralType(('B', 'T'), ChannelType()),
"input_mask": NeuralType(('B', 'T'), ChannelType()),
"labels": NeuralType(tuple('B'), CategoricalValuesType()),
}
def __init__(
self,
data_dir,
tokenizer,
max_seq_length,
processor,
evaluate=False,
shuffle=False,
batch_size=64,
dataset_type=GLUEDataset,
use_data_cache=False,
):
dataset_params = {
'data_dir': data_dir,
'output_mode': 'classification',
'processor': processor,
'evaluate': evaluate,
'tokenizer': tokenizer,
'max_seq_length': max_seq_length,
'use_data_cache': use_data_cache,
}
super().__init__(dataset_type, dataset_params, batch_size, shuffle)
class GlueRegressionDataLayer(TextDataLayer):
"""
Creates the data layer to use for the GLUE STS-B regression task,
more details here: https://gluebenchmark.com/tasks
All the data processing is done in GLUEDataset.
Args:
data_dir (str): data directory path
tokenizer (TokenizerSpec): text tokenizer.
max_seq_length (int): maximum allowed length of the text segments .
processor (DataProcessor): data processor.
evaluate (bool): true if data layer is used for evaluation. Default: False.
batch_size (int): batch size in segments
shuffle (bool): whether to shuffle data or not. Default: False.
dataset_type (GLUEDataset):
the dataset that needs to be converted to DataLayerNM
"""
@property
@add_port_docs()
def output_ports(self):
"""Returns definitions of module output ports.
input_ids:
indices of tokens which constitute batches of text segments
input_type_ids:
tensor with 0's and 1's to denote the text segment type
input_mask:
bool tensor with 0s in place of tokens to be masked
labels:
float for sentence regression prediction
"""
return {
"input_ids": NeuralType(('B', 'T'), ChannelType()),
"input_type_ids": NeuralType(('B', 'T'), ChannelType()),
"input_mask": NeuralType(('B', 'T'), ChannelType()),
"labels": NeuralType(tuple('B'), RegressionValuesType()),
}
def __init__(
self,
data_dir,
tokenizer,
max_seq_length,
processor,
evaluate=False,
shuffle=False,
batch_size=64,
dataset_type=GLUEDataset,
use_data_cache=False,
):
dataset_params = {
'data_dir': data_dir,
'output_mode': 'regression',
'processor': processor,
'evaluate': evaluate,
'tokenizer': tokenizer,
'max_seq_length': max_seq_length,
'use_data_cache': use_data_cache,
}
super().__init__(dataset_type, dataset_params, batch_size, shuffle)
| 36.105263 | 90 | 0.620445 | 614 | 5,488 | 5.382736 | 0.294788 | 0.016944 | 0.029047 | 0.038124 | 0.709834 | 0.709834 | 0.709834 | 0.709834 | 0.709834 | 0.709834 | 0 | 0.00449 | 0.269497 | 5,488 | 151 | 91 | 36.344371 | 0.819905 | 0.493258 | 0 | 0.782609 | 0 | 0 | 0.125604 | 0.020129 | 0 | 0 | 0 | 0 | 0 | 1 | 0.057971 | false | 0 | 0.057971 | 0 | 0.173913 | 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 |
8638e23a45beea8d12c0ac40c1305cb8c91bff7a | 173 | py | Python | reqcheck/exceptions.py | jaleskovec/reqcheck | ffc13cd28127f751617cdd29f7003866341fca58 | [
"MIT"
] | null | null | null | reqcheck/exceptions.py | jaleskovec/reqcheck | ffc13cd28127f751617cdd29f7003866341fca58 | [
"MIT"
] | 2 | 2021-01-27T12:22:11.000Z | 2021-01-31T03:32:08.000Z | reqcheck/exceptions.py | jaleskovec/reqcheck | ffc13cd28127f751617cdd29f7003866341fca58 | [
"MIT"
] | null | null | null | class ReqCheckException(Exception): pass
class PipMissing(ReqCheckException): pass
class PipFailed(ReqCheckException): pass
class ConstraintFailure(ReqCheckException): pass
| 34.6 | 48 | 0.861272 | 16 | 173 | 9.3125 | 0.4375 | 0.181208 | 0.348993 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.069364 | 173 | 4 | 49 | 43.25 | 0.925466 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 1 | 0 | 0 | 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 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 6 |
867b09dce2171381ea5936aaa2d94f6abb128720 | 29,213 | py | Python | holoviews/tests/core/data/testgridinterface.py | fedario/holoviews | 1cf01c36f746cff17f48c700c1f67b1b6254be85 | [
"BSD-3-Clause"
] | null | null | null | holoviews/tests/core/data/testgridinterface.py | fedario/holoviews | 1cf01c36f746cff17f48c700c1f67b1b6254be85 | [
"BSD-3-Clause"
] | null | null | null | holoviews/tests/core/data/testgridinterface.py | fedario/holoviews | 1cf01c36f746cff17f48c700c1f67b1b6254be85 | [
"BSD-3-Clause"
] | null | null | null | import datetime as dt
from collections import OrderedDict
from itertools import product
from unittest import SkipTest, skipIf
import numpy as np
from holoviews.core.data import Dataset
from holoviews.core.util import pd, date_range
from holoviews.element import Image, Curve, RGB, HSV
try:
import dask.array as da
except ImportError:
da = None
pd_skip = skipIf(pd is None, "pandas is not available")
from .base import (
GriddedInterfaceTests, InterfaceTests, HomogeneousColumnTests, DatatypeContext
)
from .testimageinterface import (
Image_ImageInterfaceTests, RGB_ImageInterfaceTests, HSV_ImageInterfaceTests
)
class GridInterfaceTests(GriddedInterfaceTests, HomogeneousColumnTests, InterfaceTests):
datatype = 'grid'
data_type = (OrderedDict, dict)
element = Dataset
@pd_skip
def test_dataset_dataframe_init_hm(self):
"Tests support for homogeneous DataFrames"
exception = "None of the available storage backends "\
"were able to support the supplied data format."
with self.assertRaisesRegexp(Exception, exception):
Dataset(pd.DataFrame({'x':self.xs, 'x2':self.xs_2}),
kdims=['x'], vdims=['x2'])
@pd_skip
def test_dataset_dataframe_init_hm_alias(self):
"Tests support for homogeneous DataFrames"
exception = "None of the available storage backends "\
"were able to support the supplied data format."
with self.assertRaisesRegexp(Exception, exception):
Dataset(pd.DataFrame({'x':self.xs, 'x2':self.xs_2}),
kdims=['x'], vdims=['x2'])
def test_irregular_grid_data_values(self):
nx, ny = 20, 5
xs, ys = np.meshgrid(np.arange(nx)+0.5, np.arange(ny)+0.5)
zs = np.arange(100).reshape(5, 20)
ds = Dataset((xs, ys, zs), ['x', 'y'], 'z')
self.assertEqual(ds.dimension_values(2, flat=False), zs)
self.assertEqual(ds.interface.coords(ds, 'x'), xs)
self.assertEqual(ds.interface.coords(ds, 'y'), ys)
def test_irregular_grid_data_values_inverted_y(self):
nx, ny = 20, 5
xs, ys = np.meshgrid(np.arange(nx)+0.5, np.arange(ny)*-1+0.5)
zs = np.arange(100).reshape(5, 20)
ds = Dataset((xs, ys, zs), ['x', 'y'], 'z')
self.assertEqual(ds.dimension_values(2, flat=False), zs)
self.assertEqual(ds.interface.coords(ds, 'x'), xs)
self.assertEqual(ds.interface.coords(ds, 'y'), ys)
def test_dataset_sort_hm(self):
raise SkipTest("Not supported")
def test_dataset_sort_reverse_hm(self):
raise SkipTest("Not supported")
def test_dataset_sort_vdim_hm(self):
exception = ('Compressed format cannot be sorted, either instantiate '
'in the desired order or use the expanded format.')
with self.assertRaisesRegexp(Exception, exception):
self.dataset_hm.sort('y')
def test_dataset_sort_reverse_vdim_hm(self):
exception = ('Compressed format cannot be sorted, either instantiate '
'in the desired order or use the expanded format.')
with self.assertRaisesRegexp(Exception, exception):
self.dataset_hm.sort('y', reverse=True)
def test_dataset_sort_vdim_hm_alias(self):
exception = ('Compressed format cannot be sorted, either instantiate '
'in the desired order or use the expanded format.')
with self.assertRaisesRegexp(Exception, exception):
self.dataset_hm.sort('y')
def test_dataset_groupby(self):
self.assertEqual(self.dataset_hm.groupby('x').keys(), list(self.xs))
def test_dataset_add_dimensions_value_hm(self):
with self.assertRaisesRegexp(Exception, 'Cannot add key dimension to a dense representation.'):
self.dataset_hm.add_dimension('z', 1, 0)
def test_dataset_add_dimensions_values_hm(self):
table = self.dataset_hm.add_dimension('z', 1, range(1,12), vdim=True)
self.assertEqual(table.vdims[1], 'z')
self.compare_arrays(table.dimension_values('z'), np.array(list(range(1,12))))
def test_dataset_add_dimensions_values_hm_alias(self):
table = self.dataset_hm.add_dimension(('z', 'Z'), 1, range(1,12), vdim=True)
self.assertEqual(table.vdims[1], 'Z')
self.compare_arrays(table.dimension_values('Z'), np.array(list(range(1,12))))
def test_dataset_2D_columnar_shape(self):
array = np.random.rand(11, 11)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=['x', 'y'], vdims=['z'])
self.assertEqual(dataset.shape, (11*11, 3))
def test_dataset_2D_gridded_shape(self):
array = np.random.rand(12, 11)
dataset = Dataset({'x':self.xs, 'y': range(12), 'z': array},
kdims=['x', 'y'], vdims=['z'])
self.assertEqual(dataset.interface.shape(dataset, gridded=True),
(12, 11))
def test_dataset_2D_aggregate_partial_hm(self):
array = np.random.rand(11, 11)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=['x', 'y'], vdims=['z'])
self.assertEqual(dataset.aggregate(['x'], np.mean),
Dataset({'x':self.xs, 'z': np.mean(array, axis=0)},
kdims=['x'], vdims=['z']))
def test_dataset_2D_aggregate_partial_hm_alias(self):
array = np.random.rand(11, 11)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=[('x', 'X'), ('y', 'Y')], vdims=[('z', 'Z')])
self.assertEqual(dataset.aggregate(['X'], np.mean),
Dataset({'x':self.xs, 'z': np.mean(array, axis=0)},
kdims=[('x', 'X')], vdims=[('z', 'Z')]))
def test_dataset_2D_reduce_hm(self):
array = np.random.rand(11, 11)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=['x', 'y'], vdims=['z'])
self.assertEqual(np.array(dataset.reduce(['x', 'y'], np.mean)),
np.mean(array))
def test_dataset_2D_reduce_hm_alias(self):
array = np.random.rand(11, 11)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=[('x', 'X'), ('y', 'Y')], vdims=[('z', 'Z')])
self.assertEqual(np.array(dataset.reduce(['x', 'y'], np.mean)),
np.mean(array))
self.assertEqual(np.array(dataset.reduce(['X', 'Y'], np.mean)),
np.mean(array))
def test_dataset_groupby_dynamic(self):
array = np.random.rand(11, 11)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=['x', 'y'], vdims=['z'])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], dataset):
grouped = dataset.groupby('x', dynamic=True)
first = Dataset({'y': self.y_ints, 'z': array[:, 0]},
kdims=['y'], vdims=['z'])
self.assertEqual(grouped[0], first)
def test_dataset_groupby_dynamic_alias(self):
array = np.random.rand(11, 11)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=[('x', 'X'), ('y', 'Y')], vdims=[('z', 'Z')])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], dataset):
grouped = dataset.groupby('X', dynamic=True)
first = Dataset({'y': self.y_ints, 'z': array[:, 0]},
kdims=[('y', 'Y')], vdims=[('z', 'Z')])
self.assertEqual(grouped[0], first)
def test_dataset_groupby_multiple_dims(self):
dataset = Dataset((range(8), range(8), range(8), range(8),
np.random.rand(8, 8, 8, 8)),
kdims=['a', 'b', 'c', 'd'], vdims=['Value'])
grouped = dataset.groupby(['c', 'd'])
keys = list(product(range(8), range(8)))
self.assertEqual(list(grouped.keys()), keys)
for c, d in keys:
self.assertEqual(grouped[c, d], dataset.select(c=c, d=d).reindex(['a', 'b']))
def test_dataset_groupby_drop_dims(self):
array = np.random.rand(3, 20, 10)
ds = Dataset({'x': range(10), 'y': range(20), 'z': range(3), 'Val': array},
kdims=['x', 'y', 'z'], vdims=['Val'])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], (ds, Dataset)):
partial = ds.to(Dataset, kdims=['x'], vdims=['Val'], groupby='y')
self.assertEqual(partial.last['Val'], array[:, -1, :].T.flatten())
def test_dataset_groupby_drop_dims_dynamic(self):
array = np.random.rand(3, 20, 10)
ds = Dataset({'x': range(10), 'y': range(20), 'z': range(3), 'Val': array},
kdims=['x', 'y', 'z'], vdims=['Val'])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], (ds, Dataset)):
partial = ds.to(Dataset, kdims=['x'], vdims=['Val'], groupby='y', dynamic=True)
self.assertEqual(partial[19]['Val'], array[:, -1, :].T.flatten())
def test_dataset_groupby_drop_dims_with_vdim(self):
array = np.random.rand(3, 20, 10)
ds = Dataset({'x': range(10), 'y': range(20), 'z': range(3), 'Val': array, 'Val2': array*2},
kdims=['x', 'y', 'z'], vdims=['Val', 'Val2'])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], (ds, Dataset)):
partial = ds.to(Dataset, kdims=['Val'], vdims=['Val2'], groupby='y')
self.assertEqual(partial.last['Val'], array[:, -1, :].T.flatten())
def test_dataset_groupby_drop_dims_dynamic_with_vdim(self):
array = np.random.rand(3, 20, 10)
ds = Dataset({'x': range(10), 'y': range(20), 'z': range(3), 'Val': array, 'Val2': array*2},
kdims=['x', 'y', 'z'], vdims=['Val', 'Val2'])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], (ds, Dataset)):
partial = ds.to(Dataset, kdims=['Val'], vdims=['Val2'], groupby='y', dynamic=True)
self.assertEqual(partial[19]['Val'], array[:, -1, :].T.flatten())
def test_dataset_ndloc_lists(self):
xs, ys = np.linspace(0.12, 0.81, 10), np.linspace(0.12, 0.391, 5)
arr = np.arange(10)*np.arange(5)[np.newaxis].T
ds = self.element((xs, ys, arr), kdims=['x', 'y'], vdims=['z'], datatype=[self.datatype, 'dictionary'])
sliced = self.element((xs[[1, 2, 3]], ys[[0, 1, 2]], arr[[0, 1, 2], [1, 2, 3]]), kdims=['x', 'y'], vdims=['z'],
datatype=['dictionary'])
self.assertEqual(ds.ndloc[[0, 1, 2], [1, 2, 3]], sliced)
def test_dataset_ndloc_lists_invert_x(self):
xs, ys = np.linspace(0.12, 0.81, 10), np.linspace(0.12, 0.391, 5)
arr = np.arange(10)*np.arange(5)[np.newaxis].T
ds = self.element((xs[::-1], ys, arr), kdims=['x', 'y'], vdims=['z'], datatype=[self.datatype, 'dictionary'])
sliced = self.element((xs[::-1][[8, 7, 6]], ys[[0, 1, 2]], arr[[0, 1, 2], [8, 7, 6]]), kdims=['x', 'y'], vdims=['z'],
datatype=['dictionary'])
self.assertEqual(ds.ndloc[[0, 1, 2], [1, 2, 3]], sliced)
def test_dataset_ndloc_lists_invert_y(self):
xs, ys = np.linspace(0.12, 0.81, 10), np.linspace(0.12, 0.391, 5)
arr = np.arange(10)*np.arange(5)[np.newaxis].T
ds = self.element((xs, ys[::-1], arr), kdims=['x', 'y'], vdims=['z'], datatype=[self.datatype, 'dictionary'])
sliced = self.element((xs[[1, 2, 3]], ys[::-1][[4, 3, 2]], arr[[4, 3, 2], [1, 2, 3]]), kdims=['x', 'y'], vdims=['z'],
datatype=['dictionary'])
self.assertEqual(ds.ndloc[[0, 1, 2], [1, 2, 3]], sliced)
def test_dataset_ndloc_lists_invert_xy(self):
xs, ys = np.linspace(0.12, 0.81, 10), np.linspace(0.12, 0.391, 5)
arr = np.arange(10)*np.arange(5)[np.newaxis].T
ds = self.element((xs[::-1], ys[::-1], arr), kdims=['x', 'y'], vdims=['z'], datatype=[self.datatype, 'dictionary'])
sliced = self.element((xs[::-1][[8, 7, 6]], ys[::-1][[4, 3, 2]], arr[[4, 3, 2], [8, 7, 6]]), kdims=['x', 'y'], vdims=['z'],
datatype=['dictionary'])
self.assertEqual(ds.ndloc[[0, 1, 2], [1, 2, 3]], sliced)
def test_dataset_ndloc_slice_two_vdims(self):
xs, ys = np.linspace(0.12, 0.81, 10), np.linspace(0.12, 0.391, 5)
arr = np.arange(10)*np.arange(5)[np.newaxis].T
arr2 = (np.arange(10)*np.arange(5)[np.newaxis].T)[::-1]
ds = self.element((xs, ys, arr, arr2), kdims=['x', 'y'], vdims=['z', 'z2'], datatype=[self.datatype, 'dictionary'])
sliced = self.element((xs[[1, 2, 3]], ys[[0, 1, 2]], arr[[0, 1, 2], [1, 2, 3]],
arr2[[0, 1, 2], [1, 2, 3]]), kdims=['x', 'y'], vdims=['z', 'z2'],
datatype=['dictionary'])
self.assertEqual(ds.ndloc[[0, 1, 2], [1, 2, 3]], sliced)
def test_reindex_drop_scalars_xs(self):
reindexed = self.dataset_grid.ndloc[:, 0].reindex()
ds = Dataset((self.grid_ys, self.grid_zs[:, 0]), 'y', 'z')
self.assertEqual(reindexed, ds)
def test_reindex_drop_scalars_ys(self):
reindexed = self.dataset_grid.ndloc[0].reindex()
ds = Dataset((self.grid_xs, self.grid_zs[0]), 'x', 'z')
self.assertEqual(reindexed, ds)
def test_reindex_2d_grid_to_1d(self):
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], self.dataset_grid):
ds = self.dataset_grid.reindex(kdims=['x'])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], Dataset):
self.assertEqual(ds, Dataset(self.dataset_grid.columns(), 'x', 'z'))
class DaskGridInterfaceTests(GridInterfaceTests):
def setUp(self):
if da is None:
raise SkipTest('DaskGridInterfaceTests requires dask.')
super(DaskGridInterfaceTests, self).setUp()
def init_column_data(self):
self.xs = np.arange(11)
self.xs_2 = self.xs**2
self.y_ints = da.from_array(self.xs*2, 3)
self.dataset_hm = self.element(
(self.xs, self.y_ints), ['x'], ['y']
)
self.dataset_hm_alias = self.element(
(self.xs, self.y_ints), [('x', 'X')], [('y', 'Y')]
)
def init_grid_data(self):
import dask.array as da
self.grid_xs = np.array([0, 1])
self.grid_ys = np.array([0.1, 0.2, 0.3])
self.grid_zs = da.from_array(np.array([[0, 1], [2, 3], [4, 5]]), 3)
self.dataset_grid = self.element(
(self.grid_xs, self.grid_ys, self.grid_zs), ['x', 'y'], ['z']
)
self.dataset_grid_alias = self.element(
(self.grid_xs, self.grid_ys, self.grid_zs), [('x', 'X'), ('y', 'Y')], [('z', 'Z')]
)
self.dataset_grid_inv = self.element(
(self.grid_xs[::-1], self.grid_ys[::-1], self.grid_zs), ['x', 'y'], ['z']
)
def test_select_lazy(self):
import dask.array as da
arr = da.from_array(np.arange(1, 12), 3)
ds = Dataset({'x': range(11), 'y': arr}, 'x', 'y')
self.assertIsInstance(ds.select(x=(0, 5)).data['y'], da.Array)
def test_dataset_add_dimensions_values_hm(self):
arr = da.from_array(np.arange(1, 12), 3)
table = self.dataset_hm.add_dimension('z', 1, arr, vdim=True)
self.assertEqual(table.vdims[1], 'z')
self.compare_arrays(table.dimension_values('z'), np.arange(1,12))
def test_dataset_add_dimensions_values_hm_alias(self):
arr = da.from_array(np.arange(1, 12), 3)
table = self.dataset_hm.add_dimension(('z', 'Z'), 1, arr, vdim=True)
self.assertEqual(table.vdims[1], 'Z')
self.compare_arrays(table.dimension_values('Z'), np.arange(1,12))
def test_dataset_2D_columnar_shape(self):
array = da.from_array(np.random.rand(11, 11), 3)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=['x', 'y'], vdims=['z'])
self.assertEqual(dataset.shape, (11*11, 3))
def test_dataset_2D_gridded_shape(self):
array = da.from_array(np.random.rand(12, 11), 3)
dataset = Dataset({'x':self.xs, 'y': range(12), 'z': array},
kdims=['x', 'y'], vdims=['z'])
self.assertEqual(dataset.interface.shape(dataset, gridded=True),
(12, 11))
def test_dataset_2D_aggregate_partial_hm(self):
array = da.from_array(np.random.rand(11, 11), 3)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=['x', 'y'], vdims=['z'])
self.assertEqual(dataset.aggregate(['x'], np.mean),
Dataset({'x':self.xs, 'z': np.mean(array, axis=0).compute()},
kdims=['x'], vdims=['z']))
def test_dataset_2D_aggregate_partial_hm_alias(self):
array = da.from_array(np.random.rand(11, 11), 3)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=[('x', 'X'), ('y', 'Y')], vdims=[('z', 'Z')])
self.assertEqual(dataset.aggregate(['X'], np.mean),
Dataset({'x':self.xs, 'z': np.mean(array, axis=0).compute()},
kdims=[('x', 'X')], vdims=[('z', 'Z')]))
def test_dataset_2D_reduce_hm(self):
array = da.from_array(np.random.rand(11, 11), 3)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=['x', 'y'], vdims=['z'])
self.assertEqual((dataset.reduce(['x', 'y'], np.mean)),
np.mean(array).compute())
def test_dataset_2D_reduce_hm_alias(self):
array = np.random.rand(11, 11)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=[('x', 'X'), ('y', 'Y')], vdims=[('z', 'Z')])
self.assertEqual(np.array(dataset.reduce(['x', 'y'], np.mean)),
np.mean(array))
self.assertEqual(np.array(dataset.reduce(['X', 'Y'], np.mean)),
np.mean(array))
def test_dataset_groupby_dynamic(self):
array = da.from_array(np.random.rand(11, 11), 3)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=['x', 'y'], vdims=['z'])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], dataset):
grouped = dataset.groupby('x', dynamic=True)
first = Dataset({'y': self.y_ints, 'z': array[:, 0]},
kdims=['y'], vdims=['z'])
self.assertEqual(grouped[0], first)
def test_dataset_groupby_dynamic_alias(self):
array = da.from_array(np.random.rand(11, 11), 3)
dataset = Dataset({'x':self.xs, 'y':self.y_ints, 'z': array},
kdims=[('x', 'X'), ('y', 'Y')], vdims=[('z', 'Z')])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], dataset):
grouped = dataset.groupby('X', dynamic=True)
first = Dataset({'y': self.y_ints, 'z': array[:, 0].compute()},
kdims=[('y', 'Y')], vdims=[('z', 'Z')])
self.assertEqual(grouped[0], first)
def test_dataset_groupby_multiple_dims(self):
dataset = Dataset((range(8), range(8), range(8), range(8),
da.from_array(np.random.rand(8, 8, 8, 8), 4)),
kdims=['a', 'b', 'c', 'd'], vdims=['Value'])
grouped = dataset.groupby(['c', 'd'])
keys = list(product(range(8), range(8)))
self.assertEqual(list(grouped.keys()), keys)
for c, d in keys:
self.assertEqual(grouped[c, d], dataset.select(c=c, d=d).reindex(['a', 'b']))
def test_dataset_groupby_drop_dims(self):
array = da.from_array(np.random.rand(3, 20, 10), 3)
ds = Dataset({'x': range(10), 'y': range(20), 'z': range(3), 'Val': array},
kdims=['x', 'y', 'z'], vdims=['Val'])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], (ds, Dataset)):
partial = ds.to(Dataset, kdims=['x'], vdims=['Val'], groupby='y')
self.assertEqual(partial.last['Val'], array[:, -1, :].T.flatten().compute())
def test_dataset_groupby_drop_dims_dynamic(self):
array = da.from_array(np.random.rand(3, 20, 10), 3)
ds = Dataset({'x': range(10), 'y': range(20), 'z': range(3), 'Val': array},
kdims=['x', 'y', 'z'], vdims=['Val'])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], (ds, Dataset)):
partial = ds.to(Dataset, kdims=['x'], vdims=['Val'], groupby='y', dynamic=True)
self.assertEqual(partial[19]['Val'], array[:, -1, :].T.flatten().compute())
def test_dataset_groupby_drop_dims_with_vdim(self):
array = da.from_array(np.random.rand(3, 20, 10), 3)
ds = Dataset({'x': range(10), 'y': range(20), 'z': range(3), 'Val': array, 'Val2': array*2},
kdims=['x', 'y', 'z'], vdims=['Val', 'Val2'])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], (ds, Dataset)):
partial = ds.to(Dataset, kdims=['Val'], vdims=['Val2'], groupby='y')
self.assertEqual(partial.last['Val'], array[:, -1, :].T.flatten().compute())
def test_dataset_groupby_drop_dims_dynamic_with_vdim(self):
array = da.from_array(np.random.rand(3, 20, 10), 3)
ds = Dataset({'x': range(10), 'y': range(20), 'z': range(3), 'Val': array, 'Val2': array*2},
kdims=['x', 'y', 'z'], vdims=['Val', 'Val2'])
with DatatypeContext([self.datatype, 'dictionary' , 'dataframe'], (ds, Dataset)):
partial = ds.to(Dataset, kdims=['Val'], vdims=['Val2'], groupby='y', dynamic=True)
self.assertEqual(partial[19]['Val'], array[:, -1, :].T.flatten().compute())
@pd_skip
def test_dataset_get_dframe(self):
df = self.dataset_hm.dframe()
self.assertEqual(df.x.values, self.xs)
self.assertEqual(df.y.values, self.y_ints.compute())
class Image_GridInterfaceTests(Image_ImageInterfaceTests):
datatype = 'grid'
data_type = OrderedDict
def init_data(self):
self.image = Image((self.xs, self.ys, self.array))
self.image_inv = Image((self.xs[::-1], self.ys[::-1], self.array[::-1, ::-1]))
def test_init_data_datetime_xaxis(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
xs = date_range(start, end, 10)
Image((xs, self.ys, self.array))
def test_init_data_datetime_yaxis(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
ys = date_range(start, end, 10)
Image((self.xs, ys, self.array))
def test_init_bounds_datetime_xaxis(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
xs = date_range(start, end, 10)
image = Image((xs, self.ys, self.array))
self.assertEqual(image.bounds.lbrt(), (start, 0, end, 10))
def test_init_bounds_datetime_yaxis(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
ys = date_range(start, end, 10)
image = Image((self.xs, ys, self.array))
self.assertEqual(image.bounds.lbrt(), (-10, start, 10, end))
def test_init_densities_datetime_xaxis(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
xs = date_range(start, end, 10)
image = Image((xs, self.ys, self.array))
self.assertEqual(image.xdensity, 1e-5)
self.assertEqual(image.ydensity, 1)
def test_init_densities_datetime_yaxis(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
ys = date_range(start, end, 10)
image = Image((self.xs, ys, self.array))
self.assertEqual(image.xdensity, 0.5)
self.assertEqual(image.ydensity, 1e-5)
def test_sample_datetime_xaxis(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
xs = date_range(start, end, 10)
image = Image((xs, self.ys, self.array))
curve = image.sample(x=xs[3])
self.assertEqual(curve, Curve((self.ys, self.array[:, 3]), 'y', 'z'))
def test_sample_datetime_yaxis(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
ys = date_range(start, end, 10)
image = Image((self.xs, ys, self.array))
curve = image.sample(y=ys[3])
self.assertEqual(curve, Curve((self.xs, self.array[3]), 'x', 'z'))
def test_range_datetime_xdim(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
xs = date_range(start, end, 10)
image = Image((xs, self.ys, self.array))
self.assertEqual(image.range(0), (start, end))
def test_range_datetime_ydim(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
ys = date_range(start, end, 10)
image = Image((self.xs, ys, self.array))
self.assertEqual(image.range(1), (start, end))
def test_dimension_values_datetime_xcoords(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
xs = date_range(start, end, 10)
image = Image((xs, self.ys, self.array))
self.assertEqual(image.dimension_values(0, expanded=False), xs)
def test_dimension_values_datetime_ycoords(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
ys = date_range(start, end, 10)
image = Image((self.xs, ys, self.array))
self.assertEqual(image.dimension_values(1, expanded=False), ys)
def test_slice_datetime_xaxis(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
xs = date_range(start, end, 10)
image = Image((xs, self.ys, self.array))
sliced = image[start+np.timedelta64(530, 'ms'): start+np.timedelta64(770, 'ms')]
self.assertEqual(sliced.dimension_values(2, flat=False),
self.array[:, 5:8])
def test_slice_datetime_yaxis(self):
start = np.datetime64(dt.datetime.today())
end = start+np.timedelta64(1, 's')
ys = date_range(start, end, 10)
image = Image((self.xs, ys, self.array))
sliced = image[:, start+np.timedelta64(120, 'ms'): start+np.timedelta64(520, 'ms')]
self.assertEqual(sliced.dimension_values(2, flat=False),
self.array[1:5, :])
def test_slice_xaxis_inv(self):
sliced = self.image_inv[0.3:5.2]
self.assertEqual(sliced.bounds.lbrt(), (0, 0, 6, 10))
self.assertEqual(sliced.xdensity, 0.5)
self.assertEqual(sliced.ydensity, 1)
self.assertEqual(sliced.dimension_values(2, flat=False),
self.array[:, 5:8])
def test_slice_yaxis_inv(self):
sliced = self.image_inv[:, 1.2:5.2]
self.assertEqual(sliced.bounds.lbrt(), (-10, 1., 10, 5))
self.assertEqual(sliced.xdensity, 0.5)
self.assertEqual(sliced.ydensity, 1)
self.assertEqual(sliced.dimension_values(2, flat=False),
self.array[1:5, :])
def test_slice_both_axes_inv(self):
sliced = self.image_inv[0.3:5.2, 1.2:5.2]
self.assertEqual(sliced.bounds.lbrt(), (0, 1., 6, 5))
self.assertEqual(sliced.xdensity, 0.5)
self.assertEqual(sliced.ydensity, 1)
self.assertEqual(sliced.dimension_values(2, flat=False),
self.array[1:5, 5:8])
def test_slice_x_index_y_inv(self):
sliced = self.image_inv[0.3:5.2, 5.2]
self.assertEqual(sliced.bounds.lbrt(), (0, 5.0, 6.0, 6.0))
self.assertEqual(sliced.xdensity, 0.5)
self.assertEqual(sliced.ydensity, 1)
self.assertEqual(sliced.dimension_values(2, flat=False),
self.array[5:6, 5:8])
def test_index_x_slice_y_inv(self):
sliced = self.image_inv[3.2, 1.2:5.2]
self.assertEqual(sliced.bounds.lbrt(), (2.0, 1.0, 4.0, 5.0))
self.assertEqual(sliced.xdensity, 0.5)
self.assertEqual(sliced.ydensity, 1)
self.assertEqual(sliced.dimension_values(2, flat=False),
self.array[1:5, 6:7])
class RGB_GridInterfaceTests(RGB_ImageInterfaceTests):
datatype = 'grid'
data_type = OrderedDict
def init_data(self):
self.rgb = RGB((self.xs, self.ys, self.rgb_array[:, :, 0],
self.rgb_array[:, :, 1], self.rgb_array[:, :, 2]))
class HSV_GridInterfaceTests(HSV_ImageInterfaceTests):
datatype = 'grid'
data_type = OrderedDict
def init_data(self):
self.hsv = HSV((self.xs, self.ys, self.hsv_array[:, :, 0],
self.hsv_array[:, :, 1], self.hsv_array[:, :, 2]))
| 47.34684 | 131 | 0.570465 | 3,933 | 29,213 | 4.120773 | 0.059242 | 0.07867 | 0.038872 | 0.026223 | 0.871105 | 0.843031 | 0.81582 | 0.80422 | 0.775776 | 0.762078 | 0 | 0.037136 | 0.244138 | 29,213 | 616 | 132 | 47.423701 | 0.696843 | 0.002773 | 0 | 0.661509 | 0 | 0 | 0.055215 | 0.000753 | 0 | 0 | 0 | 0 | 0.17795 | 1 | 0.147002 | false | 0 | 0.027079 | 0 | 0.201161 | 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 |
867ce2e72edbe1ad82ab05739900c9a4baf0107e | 118,541 | py | Python | pytests/tuqquery/n1ql_collections_ddl.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | null | null | null | pytests/tuqquery/n1ql_collections_ddl.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | null | null | null | pytests/tuqquery/n1ql_collections_ddl.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 2 | 2019-03-05T04:55:06.000Z | 2019-05-27T09:24:54.000Z | from collection.collections_cli_client import CollectionsCLI
from collection.collections_n1ql_client import CollectionsN1QL
from collection.collections_rest_client import CollectionsRest
from membase.api.exception import CBQError
from membase.helper.bucket_helper import BucketOperationHelper
from .tuq import QueryTests
class QueryCollectionsDDLTests(QueryTests):
"""
Tests descriptors.
Format:
"test_name":{
objects hierarchy to be created
"buckets": [
{collections_with_same_names_same_scope
"name": "bucket1",
"scopes": [
{"name": "scope1", "collections":[]}
]
}
],
objects to be tested for successful creation
"tests": [
{
"expected_result": "positive",
"object_type": "scope",
"object_name": "scope1",
"object_container": "bucket1"
}
]
},
"""
tests_objects = {
"massive_test": {
"buckets": [{"name": "bucket1",
"scopes": [{"name": "scope1",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope2",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope3",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope4",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope5",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope6",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope7",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope8",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope9",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope10",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
]
},
{"name": "bucket2",
"scopes": [{"name": "scope1",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope2",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope3",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope4",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope5",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope6",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope7",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope8",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope9",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope10",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
]
},
{"name": "bucket3",
"scopes": [{"name": "scope1",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope2",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope3",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope4",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope5",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope6",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope7",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope8",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope9",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope10",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
]
},
{"name": "bucket4",
"scopes": [{"name": "scope1",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope2",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope3",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope4",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope5",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope6",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope7",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope8",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope9",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope10",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
]
},
{"name": "bucket5",
"scopes": [{"name": "scope1",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope2",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope3",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope4",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope5",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope6",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope7",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope8",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope9",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope10",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
]
},
{"name": "bucket6",
"scopes": [{"name": "scope1",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope2",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope3",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope4",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope5",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope6",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope7",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope8",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope9",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope10",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
]
},
{"name": "bucket7",
"scopes": [{"name": "scope1",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope2",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope3",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope4",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope5",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope6",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope7",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope8",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope9",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope10",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
]
},
{"name": "bucket8",
"scopes": [{"name": "scope1",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope2",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope3",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope4",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope5",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope6",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope7",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope8",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope9",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope10",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
]
},
{"name": "bucket9",
"scopes": [{"name": "scope1",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope2",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope3",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope4",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope5",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope6",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope7",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope8",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope9",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope10",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
]
},
{"name": "bucket10",
"scopes": [{"name": "scope1",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope2",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope3",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope4",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope5",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope6",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope7",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope8",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope9",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
{"name": "scope10",
"collections": [{"name": "collection1"}, {"name": "collection2"},
{"name": "collection3"}, {"name": "collection4"},
{"name": "collection5"}, {"name": "collection6"},
{"name": "collection7"}, {"name": "collection8"},
{"name": "collection9"}, {"name": "collection10"}]
},
]
}
]
},
"single_scope": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1", "collections": []}
]
}
],
"tests": [
{
"expected_result": "positive",
"object_type": "scope",
"object_name": "scope1",
"object_container": "bucket1",
"object_scope": "scope1"
}
]
},
"multiple_scopes_different_names_same_bucket": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1", "collections": []},
{"name": "scope2", "collections": []}
]
}
],
"tests": [
{
"expected_result": "positive",
"object_type": "scope",
"object_name": "scope1",
"object_container": "bucket1",
"object_scope": "scope1",
},
{
"expected_result": "positive",
"object_type": "scope",
"object_name": "scope2",
"object_container": "bucket1",
"object_scope": "scope2",
}
]
},
"multiple_scopes_same_name_different_buckets": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1", "collections": []}
]
},
{
"name": "bucket2",
"scopes": [
{"name": "scope1", "collections": []}
]
}
],
"tests": [
{
"expected_result": "positive",
"object_type": "scope",
"object_name": "scope1",
"object_container": "bucket1",
"object_scope": "scope1",
},
{
"expected_result": "positive",
"object_type": "scope",
"object_name": "scope1",
"object_container": "bucket2",
"object_scope": "scope1",
}
]
},
"single_collection_not_default_scope": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1",
"collections": [
{"name": "collection1"}
]
}
]
}
],
"tests": [
{
"expected_result": "positive",
"object_type": "collection",
"object_name": "collection1",
"object_container": "bucket1",
"object_scope": "scope1"
}
]
},
"two_collections_not_default_scope": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1",
"collections": [
{"name": "collection1"},
{"name": "collection2"}
]
}
]
}
],
"tests": [
{
"expected_result": "positive",
"object_type": "collection",
"object_name": "collection1",
"object_container": "bucket1",
"object_scope": "scope1"
},
{
"expected_result": "positive",
"object_type": "collection",
"object_name": "collection2",
"object_container": "bucket1",
"object_scope": "scope1"
}
]
},
"two_collections_same_name_different_scopes": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1",
"collections": [
{"name": "collection1"}
]
},
{"name": "scope2",
"collections": [
{"name": "collection1"}
]
}
]
}
],
"tests": [
{
"expected_result": "positive",
"object_type": "collection",
"object_name": "collection1",
"object_container": "bucket1",
"object_scope": "scope1"
},
{
"expected_result": "positive",
"object_type": "collection",
"object_name": "collection1",
"object_container": "bucket1",
"object_scope": "scope2"
}
]
},
"single_collection_default_scope": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "_default",
"collections": [
{"name": "collection1"}
]
}
]
}
],
"tests": [
{
"expected_result": "positive",
"object_type": "collection",
"object_name": "collection1",
"object_container": "bucket1",
"object_scope": "_default"
}
]
},
"multiple_collections_default_scope": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "_default",
"collections": [
{"name": "collection1"},
{"name": "collection2"}
]
}
]
}
],
"tests": [
{
"expected_result": "positive",
"object_type": "collection",
"object_name": "collection1",
"object_container": "bucket1",
"object_scope": "_default"
},
{
"expected_result": "positive",
"object_type": "collection",
"object_name": "collection2",
"object_container": "bucket1",
"object_scope": "_default"
},
]
},
"multiple_collections_same_name_default_scope_different_buckets": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "_default",
"collections": [
{"name": "collection1"}
]
}
]
},
{
"name": "bucket2",
"scopes": [
{"name": "_default",
"collections": [
{"name": "collection1"}
]
}
]
},
],
"tests": [
{
"expected_result": "positive",
"object_type": "collection",
"object_name": "collection1",
"object_container": "bucket1",
"object_scope": "_default"
},
{
"expected_result": "positive",
"object_type": "collection",
"object_name": "collection1",
"object_container": "bucket2",
"object_scope": "_default"
},
]
},
}
negative_tests_objects = {
"same_name_scopes_same_bucket": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1", "collections": []}
]
}
],
"test_queries": [
{
"text": "create scope bucket1.scope1",
"expected_error": "Scope with name \"scope1\" already exists"
}
]
},
"scope_in_scope": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1", "collections": []}
]
}
],
"test_queries": [
{
"text": "create scope bucket1.scope1.scope2",
"expected_error": "syntax error - at ."
}
]
},
"scope_in_collection": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1",
"collections": [{"name": "collection1"}]
}
]
}
],
"test_queries": [
{
"text": "create scope bucket1.scope1.collection1.scope2",
"expected_error": "syntax error - at ."
}
]
},
"scope_in_missed_keyspace": {
"buckets": [
{
"name": "bucket1",
"scopes": []
}
],
"test_queries": [
{
"text": "create scope mykeyspace:bucket1.scope1",
"expected_error": "syntax error - at :"
}
]
},
"collection_in_missed_scope": {
"buckets": [
{
"name": "bucket1",
"scopes": []
}
],
"test_queries": [
{
"text": "create collection bucket1.scope1.collection1",
"expected_error": "Scope not found in CB datastore"
}
]
},
"collections_with_same_names_same_scope": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1",
"collections": [{"name": "collection1"}]
}
]
}
],
"test_queries": [
{
"text": "create collection bucket1.scope1.collection1",
"expected_error": "Collection with name \"collection1\" in scope \"scope1\" already exists"
}
]
},
"collection_missed_bucket_default_scope": {
"buckets": [
],
"test_queries": [
{
"text": "create collection bucket1.collection1",
"expected_error": "syntax error - at end of input"
}
]
},
"collections_with_same_names_same_default_scope": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "_default",
"collections": [{"name": "collection1"}]
}
]
}
],
"test_queries": [
{
"text": "create collection bucket1.collection1",
"expected_error": "syntax error - at end of input"
}
]
},
"collection_in_collection": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1",
"collections": [{"name": "collection1"}]
}
]
}
],
"test_queries": [
{
"text": "create collection bucket1.scope1.collection1.collection2",
"expected_error": "syntax error - at ."
}
]
},
"collection_in_missed_keyspace": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1",
"collections": [{"name": "collection1"}]
}
]
}
],
"test_queries": [
{
"text": "create collection mykeyspace.bucket1.scope1.collection2",
"expected_error": "syntax error - at ."
}
]
},
"incorrect_collection_drop": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1",
"collections": [{"name": "collection1"}]
}
]
}
],
"test_queries": [
{
"text": "drop collection collection1",
"expected_error": "4 path parts are expected"
}
]
},
"incorrect_collection_drop_ver2": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1",
"collections": [{"name": "collection1"}]
}
]
}
],
"test_queries": [
{
"text": "drop collection scope1.collection1",
"expected_error": "syntax error - at end of input"
}
]
},
"incorrect_scope_drop": {
"buckets": [
{
"name": "bucket1",
"scopes": [
{"name": "scope1",
"collections": []
}
]
}
],
"test_queries": [
{
"text": "drop scope scope1",
"expected_error": "syntax error - at end of input"
}
]
},
}
bucket_params = {}
def setUp(self):
super(QueryCollectionsDDLTests, self).setUp()
self.log.info("============== QueryCollectionsDDLTests setup has started ==============")
self.log_config_info()
bucket_type = self.input.param("bucket_type", self.bucket_type)
self.collections_helper = CollectionsN1QL(self.master)
self.cli_client = CollectionsCLI(self.master)
self.rest_client = CollectionsRest(self.master)
eviction_policy = "noEviction" if bucket_type == "ephemeral" else self.eviction_policy
self.bucket_params = self._create_bucket_params(server=self.master, size=100,
replicas=self.num_replicas, bucket_type=bucket_type,
enable_replica_index=self.enable_replica_index,
eviction_policy=eviction_policy, lww=self.lww)
self.log.info("============== QueryCollectionsDDLTests setup has completed ==============")
def suite_setUp(self):
self.log.info("============== QueryCollectionsDDLTests suite_setup has started ==============")
super(QueryCollectionsDDLTests, self).suite_setUp()
self.log.info("============== QueryCollectionsDDLTests suite_setup has completed ==============")
def tearDown(self):
self.log.info("============== QueryCollectionsDDLTests tearDown has started ==============")
BucketOperationHelper.delete_all_buckets_or_assert(self.servers, self)
super(QueryCollectionsDDLTests, self).tearDown()
self.log.info("============== QueryCollectionsDDLTests tearDown has completed ==============")
def suite_tearDown(self):
self.log.info("============== QueryCollectionsDDLTests suite_tearDown has started ==============")
super(QueryCollectionsDDLTests, self).suite_tearDown()
self.log.info("============== QueryCollectionsDDLTests suite_tearDown has completed ==============")
def test_create(self):
test_name = self.input.param("test_name", '')
if test_name == '':
self.fail("Test name cannot be empty, please fix .conf file")
test_data = self.tests_objects[test_name]
test_objects_created, error = \
self.collections_helper.create_bucket_scope_collection_multi_structure(cluster=self.cluster,
existing_buckets=self.buckets,
bucket_params=self.bucket_params,
data_structure=test_data)
if not test_objects_created:
self.assertEquals(True, False, f"Test objects load is failed: {error}")
result, message = self._perform_test(test_data)
self.assertEquals(result, True, message)
def test_scope_name_special_chars(self):
special_chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_', '-', '%']
tick_chars = ['-', '%']
bucket_name = 'bucket1'
errors = []
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
for special_char in special_chars:
tick_char = '`'
scope_name = f"scope{special_char}"
query = f"create scope {bucket_name}.{tick_char}{scope_name}{tick_char}"
try:
self.run_cbq_query(query)
except CBQError as err:
errors.append(f"Cannot run query: {query} \nError is:{str(err)}")
continue
bucket_scopes = self.rest.get_bucket_scopes(bucket_name)
if scope_name not in bucket_scopes:
errors.append(f"Cannot create scope {scope_name} in bucket {bucket_name}")
self.cluster.bucket_delete(self.master, bucket_name)
self.wait_for_bucket_delete(bucket_name, 3, 100)
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
for special_char in special_chars:
if special_char in tick_chars:
continue
scope_name = f"scope{special_char}"
query = f"create scope {bucket_name}.{scope_name}"
try:
self.run_cbq_query(query)
except CBQError as err:
errors.append(f"Cannot run query: {query} \nError is:{str(err)}")
continue
bucket_scopes = self.rest.get_bucket_scopes(bucket_name)
if scope_name not in bucket_scopes:
errors.append(f"Cannot create scope {scope_name} in bucket {bucket_name}")
self.cluster.bucket_delete(self.master, bucket_name)
self.wait_for_bucket_delete(bucket_name, 3, 100)
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
for special_char in special_chars:
if special_char in tick_chars:
continue
scope_name = f"scope{special_char}test"
query = f"create scope {bucket_name}.{scope_name}"
try:
self.run_cbq_query(query)
except CBQError as err:
errors.append(f"Cannot run query: {query} \nError is:{str(err)}")
continue
bucket_scopes = self.rest.get_bucket_scopes(bucket_name)
if scope_name not in bucket_scopes:
errors.append(f"Cannot create scope {scope_name} in bucket {bucket_name}")
self.cluster.bucket_delete(self.master, bucket_name)
self.wait_for_bucket_delete(bucket_name, 3, 100)
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
for special_char in special_chars:
if special_char not in tick_chars:
continue
tick_char = '`'
scope_name = f"scope{special_char}test"
query = f"create scope {bucket_name}.{tick_char}{scope_name}{tick_char}"
try:
self.run_cbq_query(query)
except CBQError as err:
errors.append(f"Cannot run query: {query} \nError is:{str(err)}")
continue
bucket_scopes = self.rest.get_bucket_scopes(bucket_name)
if scope_name not in bucket_scopes:
errors.append(f"Cannot create scope {scope_name} in bucket {bucket_name}")
for error in errors:
self.log.info(error)
self.assertEquals(len(errors), 0, "Creation of scope with special chars is failed.")
def test_collection_name_special_chars(self):
special_chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_', '-', '%']
tick_chars = ['-', '%']
bucket_name = 'bucket1'
scope_name = "_default"
errors = []
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
for special_char in special_chars:
tick_char = '`'
collection_name = f"collection{special_char}"
query = f"create collection {bucket_name}.{scope_name}.{tick_char}{collection_name}{tick_char}"
try:
self.run_cbq_query(query)
except CBQError as err:
errors.append(f"Cannot run query: {query} \nError is:{str(err)}")
continue
scope_collections = self.rest.get_scope_collections(bucket_name, scope_name)
if collection_name not in scope_collections:
errors.append(f"Cannot create collection {collection_name} in bucket {bucket_name}")
self.cluster.bucket_delete(self.master, bucket_name)
self.wait_for_bucket_delete(bucket_name, 3, 100)
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
for special_char in special_chars:
if special_char in tick_chars:
continue
collection_name = f"collection{special_char}"
query = f"create collection {bucket_name}.{scope_name}.{collection_name}"
try:
self.run_cbq_query(query)
except CBQError as err:
errors.append(f"Cannot run query: {query} \nError is:{str(err)}")
continue
scope_collections = self.rest.get_scope_collections(bucket_name, scope_name)
if collection_name not in scope_collections:
errors.append(f"Cannot create collection {collection_name} in bucket {bucket_name}")
self.cluster.bucket_delete(self.master, bucket_name)
self.wait_for_bucket_delete(bucket_name, 3, 100)
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
for special_char in special_chars:
tick_char = '`'
collection_name = f"collection{special_char}test"
query = f"create collection {bucket_name}.{scope_name}.{tick_char}{collection_name}{tick_char}"
try:
self.run_cbq_query(query)
except CBQError as err:
errors.append(f"Cannot run query: {query} \nError is:{str(err)}")
continue
scope_collections = self.rest.get_scope_collections(bucket_name, scope_name)
if collection_name not in scope_collections:
errors.append(f"Cannot create collection {collection_name} in bucket {bucket_name}")
for error in errors:
self.log.info(error)
self.assertEquals(len(errors), 0, "Creation of collections with special chars is failed.")
def test_create_negative(self):
test_name = self.input.param("test_name", '')
if test_name == '':
self.fail("Test name cannot be empty, please fix .conf file")
test_data = self.negative_tests_objects[test_name]
test_objects_created, error = \
self.collections_helper.create_bucket_scope_collection_multi_structure(cluster=self.cluster,
existing_buckets=self.buckets,
bucket_params=self.bucket_params,
data_structure=test_data)
if not test_objects_created:
self.assertEquals(True, False, f"Test objects load is failed: {error}")
test_fails = []
for test_query in test_data["test_queries"]:
wrong_object_created = False
query = test_query['text']
expected_error = test_query["expected_error"]
try:
self.run_cbq_query(test_query["text"])
wrong_object_created = True
except CBQError as err:
err_msg = str(err)
if expected_error not in err_msg:
test_fails.append(f"Unexpected error message found while executing query: {query}"
f"\nFound:{str(err)}"
f"\nExpected message fragment is: {expected_error}")
if wrong_object_created:
test_fails.append(f"Unexpected success while executing query: {query}")
for fail in test_fails:
self.log.info(fail)
self.assertEquals(len(test_fails), 0, "See logs for test fails information")
def test_incorrect_scope_naming_negative(self):
special_chars = ['_', '%']
bucket_name = 'bucket1'
errors = []
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
for special_char in special_chars:
tick_char = '`'
scope_name = f"{special_char}scope"
query = f"create scope {bucket_name}.{tick_char}{scope_name}{tick_char}"
try:
self.run_cbq_query(query)
except CBQError as err:
continue
bucket_scopes = self.rest.get_bucket_scopes(bucket_name)
if scope_name in bucket_scopes:
errors.append(f"Can create scope {scope_name} in bucket {bucket_name}")
for error in errors:
self.log.info(error)
self.assertEquals(len(errors), 0, "Creation of scope with incorrect name is successful.")
def test_create_default_scope(self):
bucket_name = 'bucket1'
scope_name = "_default"
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
query = f"create scope {bucket_name}.{scope_name}"
try:
self.run_cbq_query(query)
except CBQError as err:
self.assertEquals(True, True, "Cannot create scope named _default")
return
self.assertEquals(True, False, "Creation of scope with name _default is successful.")
def test_incorrect_scope_naming_not_allowed_symbols_negative(self):
special_chars = ["~", "!", "#", "$", "^", "&", "*", "(", ")", "+", "=", "{", "[", "}", "]", "|", "\\", ":",
";", "\"", "'", "<", ",", ">", ".", "?", "/"]
bucket_name = 'bucket1'
errors = []
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
for special_char in special_chars:
tick_char = '`'
scope_name = f"scope{special_char}test"
query = f"create scope {bucket_name}.{tick_char}{scope_name}{tick_char}"
try:
self.run_cbq_query(query)
except CBQError as err:
continue
bucket_scopes = self.rest.get_bucket_scopes(bucket_name)
if scope_name in bucket_scopes:
errors.append(f"Can create scope {scope_name} in bucket {bucket_name}")
for error in errors:
self.log.info(error)
self.assertEquals(len(errors), 0, "Creation of scope with incorrect name is successful.")
def test_incorrect_collection_naming_not_allowed_symbols_negative(self):
special_chars = ["~", "!", "#", "$", "^", "&", "*", "(", ")", "+", "=", "{", "[", "}", "]", "|", "\\", ":",
";", "\"", "'", "<", ",", ">", ".", "?", "/"]
bucket_name = 'bucket1'
scope_name = "_default"
errors = []
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
for special_char in special_chars:
tick_char = '`'
collection_name = f"collection{special_char}test"
query = f"create collection {bucket_name}.{tick_char}{collection_name}{tick_char}"
try:
self.run_cbq_query(query)
except CBQError as err:
continue
bucket_collections = self.rest.get_scope_collections(bucket_name, scope_name)
if collection_name in bucket_collections:
errors.append(f"Can create collection {collection_name} in bucket {bucket_name}")
for error in errors:
self.log.info(error)
self.assertEquals(len(errors), 0, "Creation of collection with incorrect name is successful.")
def test_drop_cli_collection(self):
bucket_name = "bucket1"
scope_name = "scope1"
collection_name = "collection1"
keyspace_name = "default"
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
collection_created = self.cli_client.create_scope_collection(bucket=bucket_name, scope=scope_name,
collection=collection_name)
if collection_created:
self.collections_helper.delete_collection(keyspace=keyspace_name, bucket_name=bucket_name,
scope_name=scope_name, collection_name=collection_name)
objects = self.rest.get_scope_collections(bucket_name, scope_name)
if collection_name in objects:
self.assertTrue(False, "Collection still exists after collection drop.")
result, _ = self.collections_helper.find_object_in_all_keyspaces(type="collection", name=collection_name, bucket=bucket_name, scope=scope_name)
self.assertFalse(result, "Collection still exists in system:all_keyspaces after collection drop.")
else:
self.assertTrue(False, "Failed to create collection using CLI. Test is failed.")
def test_drop_rest_collection(self):
bucket_name = "bucket1"
scope_name = "scope1"
collection_name = "collection1"
keyspace_name = "default"
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
self.rest_client.create_scope_collection(bucket=bucket_name, scope=scope_name, collection=collection_name)
# Allow time for scope and collection to be reflected in manifest after creation
self.sleep(8)
self.collections_helper.delete_collection(keyspace=keyspace_name, bucket_name=bucket_name,
scope_name=scope_name, collection_name=collection_name)
objects = self.rest.get_scope_collections(bucket_name, scope_name)
if collection_name in objects:
self.assertEquals(True, False, "Collection still exists after collection drop.")
result, _ = self.collections_helper.find_object_in_all_keyspaces(type="collection", name=collection_name, bucket=bucket_name, scope=scope_name)
self.assertFalse(result, "Collection still exists in system:all_keyspaces after collection drop.")
def test_drop_collection(self):
bucket_name = "bucket1"
scope_name = "scope1"
collection_name = "collection1"
keyspace_name = "default"
# creating all DB objects
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
self.collections_helper.create_scope(bucket_name=bucket_name, scope_name=scope_name)
self.collections_helper.create_collection(bucket_name=bucket_name, scope_name=scope_name,
collection_name=collection_name)
#Allow time for scope and collection to be reflected in manifest after creation
self.sleep(8)
# load document into collection
try:
self.run_cbq_query(
"INSERT INTO "+keyspace_name+":" + bucket_name + "." + scope_name + "."
+ collection_name + "(KEY, VALUE) VALUES ('id1', { 'name' : 'name1' })")
result = self.run_cbq_query(f"select name from {keyspace_name}:{bucket_name}.{scope_name}.{collection_name}"
f" use keys 'id1'")['results'][0]['name']
self.assertEquals(result, "name1", "Insert and select results do not match!")
except CBQError as e:
self.assertEquals(True, False, "Failed to perform insert into collection")
except KeyError as err:
self.assertEquals(True, False, "Failed to perform insert into collection")
# dropping collection
self.collections_helper.delete_collection(keyspace=keyspace_name, bucket_name=bucket_name,
scope_name=scope_name, collection_name=collection_name)
# test that collection is dropped
objects = self.rest.get_scope_collections(bucket_name, scope_name)
if collection_name in objects:
self.assertEquals(True, False, "Collection still exists after collection drop.")
result, _ = self.collections_helper.find_object_in_all_keyspaces(type="collection", name=collection_name,
bucket=bucket_name, scope=scope_name)
self.assertFalse(result, "Collection still exists in system:all_keyspaces after collection drop.")
# test that collection document is deleted
result = self.run_cbq_query(f"select count(*) as cnt from {bucket_name}")['results'][0]['cnt']
self.assertEquals(result, 0, "Collection document was not deleted after collection drop")
# test always fails because information about scopes is not going to be updated after manipulations with scopes. Waiting for fix.
def test_drop_cli_scope(self):
keyspace_name = "default"
bucket_name = "bucket1"
scope_name = "scope1"
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
scope_created = self.cli_client.create_scope(bucket=bucket_name, scope=scope_name)
if scope_created:
self.collections_helper.delete_scope(keyspace=keyspace_name, bucket_name=bucket_name, scope_name=scope_name)
self.sleep(5,"Wait before checking for scope deletion")
scope_exists = self.collections_helper.check_if_scope_exists_in_scopes(keyspace=keyspace_name, bucket=bucket_name,
scope=scope_name)
self.assertFalse(scope_exists, "Scope still exists in system:scopes after scope drop.")
else:
self.assertTrue(False, "Failed to create scope using CLI. Test is failed.")
def test_drop_rest_scope(self):
keyspace_name = "default"
bucket_name = "bucket1"
scope_name = "scope1"
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
self.rest_client.create_scope(bucket=bucket_name, scope=scope_name)
self.collections_helper.delete_scope(keyspace=keyspace_name, bucket_name=bucket_name, scope_name=scope_name)
objects = self.rest.get_bucket_scopes(bucket_name)
if scope_name in objects:
self.assertEquals(True, False, "Scope still exists after scope drop.")
scope_exists = self.collections_helper.check_if_scope_exists_in_scopes(keyspace=keyspace_name,
bucket=bucket_name,
scope=scope_name)
self.assertFalse(scope_exists, "Scope still exists in system:scopes after scope drop.")
def test_drop_scope_cascade(self):
bucket_name = "bucket1"
scope_name = "scope1"
collection_name = "collection1"
keyspace_name = "default"
# creating all DB objects
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
self.collections_helper.create_scope(bucket_name=bucket_name, scope_name=scope_name)
self.collections_helper.create_collection(bucket_name=bucket_name, scope_name=scope_name,
collection_name=collection_name)
self.sleep(8)
# load document into collection
try:
self.run_cbq_query(
"INSERT INTO " + bucket_name + "." + scope_name + "." + collection_name +
" (KEY, VALUE) VALUES ('id1', { 'name' : 'name1' })")
result = self.run_cbq_query(
f"select name from {keyspace_name}:{bucket_name}.{scope_name}.{collection_name} use keys 'id1'")[
'results'][0]['name']
self.assertEquals(result, "name1", "Insert and select results do not match!")
except CBQError as e:
self.assertEquals(True, False, "Failed to perform insert into collection")
except KeyError as err:
self.assertEquals(True, False, "Failed to perform insert into collection")
# dropping scope
self.collections_helper.delete_scope(keyspace=keyspace_name, bucket_name=bucket_name, scope_name=scope_name)
# check that collection is dropped
#this check is still invalid since we don't update bucket manifest after dropping scope by n1ql query
#objects = self.rest.get_scope_collections(bucket_name, scope_name)
#if collection_name in objects:
# self.assertEquals(True, False, "Collection still exists after scope drop.")
result, _ = self.collections_helper.find_object_in_all_keyspaces(type="collection", name=collection_name,
bucket=bucket_name, scope=scope_name)
self.assertFalse(result, "Collection still exists in system:all_keyspaces after scope drop.")
# check that scope is dropped
objects = self.rest.get_bucket_scopes(bucket_name)
if scope_name in objects:
self.assertEquals(True, False, "Scope still exists after scope drop.")
# check that collection document is dropped
result = self.run_cbq_query(f"select count(*) as cnt from {bucket_name}")['results'][0]['cnt']
self.assertEquals(result, 0, "Collection document was not deleted after scope drop")
def test_create_n1ql_collection_in_cli_scope(self):
bucket_name = "bucket1"
scope_name = "scope1"
collection_name = "collection1"
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
scope_created = self.cli_client.create_scope(bucket=bucket_name, scope=scope_name)
# Allow time for scope and collection to be reflected in manifest after creation
self.sleep(8)
if scope_created:
self.collections_helper.create_collection(bucket_name=bucket_name, scope_name=scope_name,
collection_name=collection_name)
scope_collections = self.rest.get_scope_collections(bucket_name, scope_name)
if collection_name not in scope_collections:
self.assertEquals(True, False, "Cannot create collection via N1QL in a scope created via CLI.")
result, error = self.collections_helper.find_object_in_all_keyspaces(type="collection", name=collection_name,
bucket=bucket_name, scope=scope_name)
self.assertTrue(result, f"Cannot find collection, created in scope, created via CLI in system:all_keyspaces. Error is: {error}")
else:
self.assertEquals(True, False, "Failed to create scope using CLI. Test is failed")
def test_create_n1ql_collection_in_rest_scope(self):
bucket_name = "bucket1"
scope_name = "scope1"
collection_name = "collection1"
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
self.rest_client.create_scope(bucket=bucket_name, scope=scope_name)
# Allow time for scope and collection to be reflected in manifest after creation
self.sleep(8)
self.collections_helper.create_collection(bucket_name=bucket_name, scope_name=scope_name,
collection_name=collection_name)
scope_collections = self.rest.get_scope_collections(bucket_name, scope_name)
if collection_name not in scope_collections:
self.assertEquals(True, False,
"Cannot create collection via N1QL in a scope created via REST. Test is failed.")
result, error = self.collections_helper.find_object_in_all_keyspaces(type="collection", name=collection_name,
bucket=bucket_name, scope=scope_name)
self.assertTrue(result, f"Cannot find collection, created in scope, created via REST in system:all_keyspaces. Error is: {error}")
def test_recreate_collection(self):
bucket_name = "bucket1"
scope_name = "scope1"
collection_name = "collection1"
objects = {"buckets": [{"name": f"{bucket_name}", "scopes": [
{"name": f"{scope_name}", "collections": [{"name": f"{collection_name}"}]}]}]}
self.collections_helper.create_bucket_scope_collection_multi_structure(cluster=self.cluster,
existing_buckets=self.buckets,
bucket_params=self.bucket_params,
data_structure=objects)
# todo: remove this sleep after fix of https://issues.couchbase.com/browse/MB-39500
self.sleep(30)
self.run_cbq_query(
"INSERT INTO " + bucket_name + "." + scope_name + "." + collection_name +
" (KEY, VALUE) VALUES ('id1', { 'name' : 'name1' })")
self.collections_helper.delete_collection(bucket_name=bucket_name, scope_name=scope_name,
collection_name=collection_name)
result, _ = self.collections_helper.find_object_in_all_keyspaces(type="collection", name=collection_name,
bucket=bucket_name, scope=scope_name)
self.assertFalse(result,
"Collection still exists in system:all_keyspaces after drop")
result = self.collections_helper.create_collection(bucket_name=bucket_name, scope_name=scope_name,
collection_name=collection_name)
self.assertEquals(result, True, "Cannot re-create collection. Test is failed.")
result, error = self.collections_helper.find_object_in_all_keyspaces(type="collection", name=collection_name,
bucket=bucket_name, scope=scope_name)
self.assertTrue(result, f"Collection cannot be found in system:all_keyspaces after re-creation. Error: {error}")
def test_recreate_scope(self):
bucket_name = "bucket1"
scope_name = "scope1"
collection_name = "collection1"
objects = {"buckets": [{"name": f"{bucket_name}", "scopes": [
{"name": f"{scope_name}", "collections": [{"name": f"{collection_name}"}]}]}]}
self.collections_helper.create_bucket_scope_collection_multi_structure(cluster=self.cluster,
existing_buckets=self.buckets,
bucket_params=self.bucket_params,
data_structure=objects)
self.run_cbq_query(
"INSERT INTO " + bucket_name + "." + scope_name + "." + collection_name +
" (KEY, VALUE) VALUES ('id1', { 'name' : 'name1' })")
self.collections_helper.delete_scope(bucket_name=bucket_name, scope_name=scope_name)
result, _ = self.collections_helper.find_object_in_all_keyspaces(type="scope", name=scope_name,
bucket=bucket_name, scope=scope_name)
self.assertFalse(result, "Scope still exists in system:all_keyspaces after drop")
result = self.collections_helper.create_scope(bucket_name=bucket_name, scope_name=scope_name)
self.assertEquals(result, True, "Cannot re-create scope. Test is failed.")
result, error = self.collections_helper.find_object_in_all_keyspaces(type="scope", name=scope_name,
bucket=bucket_name, scope=scope_name)
self.assertTrue(result, f"Scope cannmot be found in system:all_keyspaces after re-creation. Error: {error}")
def test_1000_objects_test(self):
bucket = "bucket1"
self._create_bucket(bucket)
for i in range(1, 100):
scope = f"scope_{i}"
scope_created = self.collections_helper.create_scope(bucket_name=bucket, scope_name=scope)
for j in range(1, 10):
collection = f"collection_{j}"
collection_created = self.collections_helper.create_collection(bucket_name=bucket, scope_name=scope, collection_name=collection)
for i in range(1, 100):
scope = f"scope_{i}"
for j in range(1, 10):
collection = f"collection_{j}"
result, error = self.collections_helper.find_object_in_all_keyspaces(type="collection", name=collection, bucket=bucket, scope=scope)
self.assertTrue(result, f"Collection {collection} cannot be found in system:all_keyspaces. Error: {error}")
def test_massive_test(self):
buckets = ["bucket1", "bucket2", "bucket3", "bucket4", "bucket5", "bucket6", "bucket7", "bucket8", "bucket9",
"bucket10"]
scopes = ["scope1", "scope2", "scope3", "scope4", "scope5", "scope6", "scope7", "scope8", "scope9", "scope10"]
collections = ["collection1", "collection2", "collection3", "collection4", "collection5", "collection6",
"collection7", "collection8", "collection9", "collection10"]
keyspace_name = "default"
# create schema
self.collections_helper.create_bucket_scope_collection_multi_structure(cluster=self.cluster,
existing_buckets=self.buckets,
bucket_params=self.bucket_params,
data_structure=self.tests_objects[
"massive_test"])
# fill collections:
for bucket in buckets:
for scope in scopes:
for collection in collections:
self.run_cbq_query(
"INSERT INTO " + bucket + "." + scope + "." + collection + " (KEY, VALUE) VALUES ('" + bucket
+ "_" + scope + "_" + collection + "', { 'name' : '" + bucket + "_" + scope + "_"
+ collection + "' })")
# selects
for bucket in buckets:
for scope in scopes:
for collection in collections:
result = self.run_cbq_query(
f"select name from {keyspace_name}:{bucket}.{scope}.{collection} use keys '" + bucket +
"_" + scope + "_" + collection + "'")[
'results'][0]['name']
self.assertEquals(result, bucket + "_" + scope + "_" + collection,
f"Data in {keyspace_name}:{bucket}.{scope}.{collection} "
f"is incorrect. Test is failed")
""" Test is invalid until we will start using python SDK 3.0
def test_create_scope_sdk(self):
bucket_name = "bucket1"
scope_name = "scope1"
collection_name = "collection1"
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
from couchbase.cluster import Cluster
from couchbase.cluster import PasswordAuthenticator
cl = Cluster("couchbase://"+self.master.ip)
authenticator = PasswordAuthenticator("Administrator", "password")
cl.authenticate(authenticator)
cb = cl.open_bucket("bucket1")
scope = cb.scope("scope1")
collection = scope.collection("collection1")
"""
def test_create_cbq(self):
bucket_name = "bucket1"
scope_name = "scope1"
collection_name = "collection1"
keyspace_name = "default"
rest_collections_helper = CollectionsN1QL(self.master)
self.cluster.create_standard_bucket(bucket_name, 11222, self.bucket_params)
self.collections_helper.use_rest = False
scope_created = self.collections_helper.create_scope(bucket_name=bucket_name, scope_name=scope_name)
self.assertEquals(scope_created, True, "Cannot create scope via CBQ console")
result, error = rest_collections_helper.find_object_in_all_keyspaces(type="scope", name=scope_name, bucket=bucket_name, scope=scope_name)
self.assertTrue(result, f"Scope {scope_name}, created via CBQ cannot be found in system:keyspaces. Error: {error}")
collection_created = self.collections_helper.create_collection(bucket_name=bucket_name, scope_name=scope_name,
collection_name=collection_name)
self.assertEquals(collection_created, True, "Cannot create collection via CBQ console")
result, error = rest_collections_helper.find_object_in_all_keyspaces(type="collection", name=collection_name, bucket=bucket_name, scope=scope_name)
self.assertTrue(result, f"Collection {collection_name}, created via CBQ cannot be found in system:all_keyspaces. Error: {error}")
# Trying to insert doc into created collection
try:
self.run_cbq_query(
"INSERT INTO " + bucket_name + "." + scope_name + "." + collection_name +
" (KEY, VALUE) VALUES ('id1', { 'name' : 'name1' })")
result = self.run_cbq_query(
f"select name from {keyspace_name}:{bucket_name}.{scope_name}.{collection_name} use keys 'id1'")[
'results'][0]['name']
self.assertEquals(result, "name1", "Insert and select results do not match!")
except CBQError as e:
self.assertEquals(True, False, "Failed to perform insert into collection created via CBQ console")
except KeyError as err:
self.assertEquals(True, False, "Failed to perform insert into collection created via CBQ console")
def _perform_test(self, data_structure=None):
if data_structure is None:
raise Exception("Empty value for data_structure parameter")
tests = data_structure["tests"]
for test in tests:
object_type = test["object_type"]
object_name = test["object_name"]
object_bucket = test["object_container"]
object_scope = test["object_scope"] if "object_scope" in test else None
result, error = self.collections_helper.find_object_in_all_keyspaces(type=object_type,
name=object_name,
bucket=object_bucket,
scope = object_scope)
if not result:
return False, error
if object_type == "scope":
objects = self.rest.get_bucket_scopes(object_bucket)
else:
objects = self.rest.get_scope_collections(object_bucket, test["object_scope"])
if not test["object_name"] in objects:
return False, f"{object_type} {object_name} is not found in bucket {object_bucket}. Test is failed"
return True, ""
def _create_bucket(self, bucket_name):
bucket_params = self._create_bucket_params(server=self.master, size=100,
replicas=self.num_replicas, bucket_type=self.bucket_type,
enable_replica_index=self.enable_replica_index,
eviction_policy=self.eviction_policy, lww=self.lww)
self.cluster.create_standard_bucket(bucket_name, 11222, bucket_params)
| 59.688318 | 155 | 0.392725 | 7,434 | 118,541 | 6.085822 | 0.042642 | 0.035365 | 0.066089 | 0.068962 | 0.900137 | 0.890566 | 0.869546 | 0.858715 | 0.845144 | 0.837651 | 0 | 0.026994 | 0.479674 | 118,541 | 1,985 | 156 | 59.718388 | 0.706501 | 0.01532 | 0 | 0.69029 | 0 | 0 | 0.259385 | 0.01773 | 0 | 0 | 0 | 0.000504 | 0.029576 | 1 | 0.015067 | false | 0 | 0.003348 | 0 | 0.022879 | 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 |
86939b5e470aa26911e3c3cc7009b5f1738975d3 | 1,999 | py | Python | docs/theory/figures/stress-strain.py | wolfv/ElastoPlasticQPot | 7753c6cfb34d4bc79bc7ef07738a0dd1046222eb | [
"MIT"
] | null | null | null | docs/theory/figures/stress-strain.py | wolfv/ElastoPlasticQPot | 7753c6cfb34d4bc79bc7ef07738a0dd1046222eb | [
"MIT"
] | null | null | null | docs/theory/figures/stress-strain.py | wolfv/ElastoPlasticQPot | 7753c6cfb34d4bc79bc7ef07738a0dd1046222eb | [
"MIT"
] | null | null | null |
import GooseTensor as gt
import ElastoPlasticQPot as gm
import numpy as np
import matplotlib.pyplot as plt
plt.style.use(['goose','goose-latex','goose-tick-lower'])
# --------------------------------------------------------------------------------------------------
fig = plt.figure(figsize=(14,12))
fig.set_tight_layout(True)
# --------------------------------------------------------------------------------------------------
mat = gm.Cartesian2d.Cusp( 1. , 1. , [ -1. , 1. , 1.5 , 3. , 6. , 10.1 ] , False )
Eps = np.array([
[ 0. , 1. ],
[ 1. , 0. ],
])
ninc = 20000
eps_xy = np.zeros((ninc))
sig_xy = np.zeros((ninc))
energy = np.zeros((ninc))
for i,d in enumerate(np.linspace(0,10.,ninc)):
eps = d * Eps
energy[i] = mat.energy(eps)
sig = mat.Sig(eps)
sig_xy[i] = sig[0,1]
eps_xy[i] = eps[0,1]
ax = fig.add_subplot(2,2,1)
ax.plot(eps_xy,sig_xy)
plt.xlabel(r'$\varepsilon_\mathrm{xy}$')
plt.ylabel(r'$\sigma_\mathrm{xy}$')
ax = fig.add_subplot(2,2,2)
ax.plot(eps_xy,energy)
plt.xlabel(r'$\varepsilon_\mathrm{xy}$')
plt.ylabel(r'$E$')
# --------------------------------------------------------------------------------------------------
mat = gm.Cartesian2d.Smooth( 1. , 1. , [ -1. , 1. , 1.5 , 3. , 6. , 10.1 ] , False )
Eps = np.array([
[ 0. , 1. ],
[ 1. , 0. ],
])
ninc = 20000
eps_xy = np.zeros((ninc))
sig_xy = np.zeros((ninc))
energy = np.zeros((ninc))
for i,d in enumerate(np.linspace(0,10.,ninc)):
eps = d * Eps
energy[i] = mat.energy(eps)
sig = mat.Sig(eps)
sig_xy[i] = sig[0,1]
eps_xy[i] = eps[0,1]
ax = fig.add_subplot(2,2,3)
ax.plot(eps_xy,sig_xy)
plt.xlabel(r'$\varepsilon_\mathrm{xy}$')
plt.ylabel(r'$\sigma_\mathrm{xy}$')
ax = fig.add_subplot(2,2,4)
ax.plot(eps_xy,energy)
plt.xlabel(r'$\varepsilon_\mathrm{xy}$')
plt.ylabel(r'$E$')
# --------------------------------------------------------------------------------------------------
plt.savefig('stress-strain.svg')
plt.show()
| 21.967033 | 100 | 0.477239 | 282 | 1,999 | 3.29078 | 0.244681 | 0.021552 | 0.019397 | 0.017241 | 0.728448 | 0.728448 | 0.728448 | 0.728448 | 0.728448 | 0.728448 | 0 | 0.042378 | 0.150075 | 1,999 | 90 | 101 | 22.211111 | 0.503826 | 0.197599 | 0 | 0.727273 | 0 | 0 | 0.122104 | 0.062617 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.072727 | 0 | 0.072727 | 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 |
86f93caafce28242ec4675b1768b943fed2dea09 | 83 | py | Python | frewpy/models/strut.py | frdwhite24/frewpy | 79368c69b918404e4d1ee5c3a7b6a88cee994d2f | [
"MIT"
] | 3 | 2020-10-02T15:49:44.000Z | 2021-11-22T15:39:55.000Z | frewpy/models/strut.py | frdwhite24/frewpy | 79368c69b918404e4d1ee5c3a7b6a88cee994d2f | [
"MIT"
] | 1 | 2020-10-02T09:07:04.000Z | 2020-10-02T09:07:04.000Z | frewpy/models/strut.py | frdwhite24/frewpy | 79368c69b918404e4d1ee5c3a7b6a88cee994d2f | [
"MIT"
] | 2 | 2021-04-20T14:43:14.000Z | 2021-12-09T10:02:55.000Z | class Strut:
def __init__(self, json_data):
self.json_data = json_data
| 20.75 | 34 | 0.674699 | 12 | 83 | 4.083333 | 0.583333 | 0.489796 | 0.489796 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.240964 | 83 | 3 | 35 | 27.666667 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 6 |
812d3c31200d4aabe28c82ce3810d1fd4895f0e8 | 121 | py | Python | movieapp/trial.py | Ketank21/Movie_recommendation | 444e85669689cc0d86c0aa11d708eaad17e6115b | [
"MIT"
] | null | null | null | movieapp/trial.py | Ketank21/Movie_recommendation | 444e85669689cc0d86c0aa11d708eaad17e6115b | [
"MIT"
] | null | null | null | movieapp/trial.py | Ketank21/Movie_recommendation | 444e85669689cc0d86c0aa11d708eaad17e6115b | [
"MIT"
] | null | null | null | import pandas as pd
df_mov_avg_cnt=pd.read_csv('./data/ml-latest-small/movies_avg_cnt.csv')
print(df_mov_avg_cnt.head())
| 30.25 | 71 | 0.801653 | 25 | 121 | 3.52 | 0.68 | 0.204545 | 0.181818 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.049587 | 121 | 3 | 72 | 40.333333 | 0.765217 | 0 | 0 | 0 | 0 | 0 | 0.338843 | 0.338843 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 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 | 0 | 0 | 0 | 6 |
813e90cefb97c8b4e6fa286f08313bd55104a4db | 5,284 | py | Python | aiomoex/candles.py | WLM1ke/aiomoex | dd7f6c4cb9482d0a3185c340274a4d4d42e15a9f | [
"Unlicense"
] | 55 | 2018-11-25T14:11:50.000Z | 2021-11-14T21:53:10.000Z | aiomoex/candles.py | WLM1ke/aiomoex | dd7f6c4cb9482d0a3185c340274a4d4d42e15a9f | [
"Unlicense"
] | 5 | 2018-12-01T05:42:41.000Z | 2021-07-13T11:15:23.000Z | aiomoex/candles.py | WLM1ke/aiomoex | dd7f6c4cb9482d0a3185c340274a4d4d42e15a9f | [
"Unlicense"
] | 21 | 2018-11-20T17:46:43.000Z | 2022-03-30T04:24:56.000Z | """Функции для получения информации о свечках."""
from typing import Optional
import aiohttp
from aiomoex import client, request_helpers
from aiomoex.request_helpers import (
CANDLE_BORDERS,
CANDLES,
DEFAULT_BOARD,
DEFAULT_ENGINE,
DEFAULT_MARKET,
)
async def get_market_candle_borders(
session: aiohttp.ClientSession,
security: str,
market: str = DEFAULT_MARKET,
engine: str = DEFAULT_ENGINE,
) -> client.Table:
"""Получить таблицу интервалов доступных дат для всех режимов торгов.
Описание запроса - https://iss.moex.com/iss/reference/156
:param session:
Сессия http соединения.
:param security:
Тикер ценной бумаги.
:param market:
Рынок - по умолчанию акции.
:param engine:
Движок - по умолчанию акции.
:return:
Список словарей, которые напрямую конвертируется в pandas.DataFrame.
"""
url = request_helpers.make_url(
engine=engine, market=market, security=security, ending=CANDLE_BORDERS,
)
table = "borders"
return await request_helpers.get_short_data(session, url, table)
async def get_board_candle_borders(
session: aiohttp.ClientSession,
security: str,
board: str = DEFAULT_BOARD,
market: str = DEFAULT_MARKET,
engine: str = DEFAULT_ENGINE,
) -> client.Table:
"""Получить таблицу интервалов доступных дат для указанного режиме торгов.
Описание запроса - https://iss.moex.com/iss/reference/48
:param session:
Сессия http соединения.
:param security:
Тикер ценной бумагию
:param board:
Режим торгов - по умолчанию основной режим торгов T+2.
:param market:
Рынок - по умолчанию акции.
:param engine:
Движок - по умолчанию акции.
:return:
Список словарей, которые напрямую конвертируется в pandas.DataFrame
"""
url = request_helpers.make_url(
engine=engine, market=market, board=board, security=security, ending=CANDLE_BORDERS,
)
table = "borders"
return await request_helpers.get_short_data(session, url, table)
async def get_market_candles(
session: aiohttp.ClientSession,
security: str,
interval: int = 24,
start: Optional[str] = None,
end: Optional[str] = None,
market: str = DEFAULT_MARKET,
engine: str = DEFAULT_ENGINE,
) -> client.Table:
"""Получить свечи в формате HLOCV указанного инструмента на рынке для основного режима торгов.
Если торговля идет в нескольких основных режимах, то на один интервал времени может быть выдано
несколько свечек - по свечке на каждый режим. Предположительно такая ситуация может произойти для
свечек длиннее 1 дня.
Описание запроса - https://iss.moex.com/iss/reference/155
:param session:
Сессия http соединения.
:param security:
Тикер ценной бумаги.
:param interval:
Размер свечки - целое число 1 (1 минута), 10 (10 минут), 60 (1 час), 24 (1 день), 7 (1 неделя),
31 (1 месяц) или 4 (1 квартал). По умолчанию дневные данные.
:param start:
Дата вида ГГГГ-ММ-ДД. При отсутствии данные будут загружены с начала истории.
:param end:
Дата вида ГГГГ-ММ-ДД. При отсутствии данные будут загружены до конца истории.
:param market:
Рынок - по умолчанию акции.
:param engine:
Движок - по умолчанию акции.
:return:
Список словарей, которые напрямую конвертируется в pandas.DataFrame.
"""
url = request_helpers.make_url(engine=engine, market=market, security=security, ending=CANDLES)
table = CANDLES
query = request_helpers.make_query(interval=interval, start=start, end=end)
return await request_helpers.get_long_data(session, url, table, query)
async def get_board_candles(
session: aiohttp.ClientSession,
security: str,
interval: int = 24,
start: Optional[str] = None,
end: Optional[str] = None,
board: str = DEFAULT_BOARD,
market: str = DEFAULT_MARKET,
engine: str = DEFAULT_ENGINE,
) -> client.Table:
"""Получить свечи в формате HLOCV указанного инструмента в указанном режиме торгов за интервал дат.
Описание запроса - https://iss.moex.com/iss/reference/46
:param session:
Сессия http соединения.
:param security:
Тикер ценной бумаги.
:param interval:
Размер свечки - целое число 1 (1 минута), 10 (10 минут), 60 (1 час), 24 (1 день), 7 (1 неделя),
31 (1 месяц) или 4 (1 квартал). По умолчанию дневные данные.
:param start:
Дата вида ГГГГ-ММ-ДД. При отсутствии данные будут загружены с начала истории.
:param end:
Дата вида ГГГГ-ММ-ДД. При отсутствии данные будут загружены до конца истории.
:param board:
Режим торгов - по умолчанию основной режим торгов T+2.
:param market:
Рынок - по умолчанию акции.
:param engine:
Движок - по умолчанию акции.
:return:
Список словарей, которые напрямую конвертируется в pandas.DataFrame.
"""
url = request_helpers.make_url(
engine=engine, market=market, board=board, security=security, ending=CANDLES,
)
table = CANDLES
query = request_helpers.make_query(interval=interval, start=start, end=end)
return await request_helpers.get_long_data(session, url, table, query)
| 33.025 | 103 | 0.68679 | 657 | 5,284 | 5.444444 | 0.240487 | 0.046967 | 0.035784 | 0.039139 | 0.850992 | 0.850992 | 0.850992 | 0.822477 | 0.798994 | 0.7565 | 0 | 0.01352 | 0.230129 | 5,284 | 159 | 104 | 33.232704 | 0.865782 | 0.008138 | 0 | 0.66129 | 0 | 0 | 0.006343 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.064516 | 0 | 0.129032 | 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 |
81413a51366175ae377ded9bc14969eeb14cbcf0 | 19,851 | py | Python | examples.py | JACKHAHA363/DeepRL | 5e91086c17fd6de85f4d53873fab17e049dd5df5 | [
"Apache-2.0"
] | null | null | null | examples.py | JACKHAHA363/DeepRL | 5e91086c17fd6de85f4d53873fab17e049dd5df5 | [
"Apache-2.0"
] | null | null | null | examples.py | JACKHAHA363/DeepRL | 5e91086c17fd6de85f4d53873fab17e049dd5df5 | [
"Apache-2.0"
] | null | null | null | #######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
#######################################################################
from deep_rl import *
## cart pole
def dqn_cart_pole():
game = 'CartPole-v0'
config = Config()
config.task_fn = lambda: ClassicalControl(game, max_steps=200)
config.evaluation_env = config.task_fn()
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, 0.001)
config.network_fn = lambda state_dim, action_dim: VanillaNet(action_dim, FCBody(state_dim))
# config.network_fn = lambda state_dim, action_dim: DuelingNet(action_dim, FCBody(state_dim))
config.policy_fn = lambda: GreedyPolicy(epsilon=1.0, final_step=10000, min_epsilon=0.1)
config.replay_fn = lambda: Replay(memory_size=10000, batch_size=10)
config.discount = 0.99
config.target_network_update_freq = 200
config.exploration_steps = 1000
config.logger = get_logger()
config.double_q = True
# config.double_q = False
run_episodes(DQNAgent(config))
def a2c_cart_pole():
config = Config()
name = 'CartPole-v0'
# name = 'MountainCar-v0'
task_fn = lambda log_dir: ClassicalControl(name, max_steps=200, log_dir=log_dir)
config.num_workers = 5
config.task_fn = lambda: ParallelizedTask(task_fn, config.num_workers,
log_dir=get_default_log_dir(a2c_cart_pole.__name__))
config.optimizer_fn = lambda params: torch.optim.Adam(params, 0.001)
config.network_fn = lambda state_dim, action_dim: CategoricalActorCriticNet(
state_dim, action_dim, FCBody(state_dim), gpu=-1)
config.policy_fn = SamplePolicy
config.discount = 0.99
config.logger = get_logger()
config.gae_tau = 1.0
config.entropy_weight = 0.01
config.rollout_length = 5
run_iterations(A2CAgent(config))
def categorical_dqn_cart_pole():
game = 'CartPole-v0'
config = Config()
config.task_fn = lambda: ClassicalControl(game, max_steps=200)
config.evaluation_env = config.task_fn()
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, 0.001)
config.network_fn = lambda state_dim, action_dim: \
CategoricalNet(action_dim, config.categorical_n_atoms, FCBody(state_dim))
config.policy_fn = lambda: GreedyPolicy(epsilon=0.1, final_step=10000, min_epsilon=0.1)
config.replay_fn = lambda: Replay(memory_size=10000, batch_size=10)
config.discount = 0.99
config.target_network_update_freq = 200
config.exploration_steps = 100
config.logger = get_logger(skip=True)
config.categorical_v_max = 100
config.categorical_v_min = -100
config.categorical_n_atoms = 50
run_episodes(CategoricalDQNAgent(config))
def quantile_regression_dqn_cart_pole():
config = Config()
config.task_fn = lambda: ClassicalControl('CartPole-v0', max_steps=200)
config.evaluation_env = config.task_fn()
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, 0.001)
config.network_fn = lambda state_dim, action_dim: \
QuantileNet(action_dim, config.num_quantiles, FCBody(state_dim))
config.policy_fn = lambda: GreedyPolicy(epsilon=0.1, final_step=10000, min_epsilon=0.1)
config.replay_fn = lambda: Replay(memory_size=10000, batch_size=10)
config.discount = 0.99
config.target_network_update_freq = 200
config.exploration_steps = 100
config.logger = get_logger(skip=True)
config.num_quantiles = 20
run_episodes(QuantileRegressionDQNAgent(config))
def n_step_dqn_cart_pole():
config = Config()
task_fn = lambda log_dir: ClassicalControl('CartPole-v0', max_steps=200, log_dir=log_dir)
config.evaluation_env = task_fn(None)
config.num_workers = 5
config.task_fn = lambda: ParallelizedTask(task_fn, config.num_workers)
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, 0.001)
config.network_fn = lambda state_dim, action_dim: VanillaNet(action_dim, FCBody(state_dim))
config.policy_fn = lambda: GreedyPolicy(epsilon=1.0, final_step=10000, min_epsilon=0.1)
config.discount = 0.99
config.target_network_update_freq = 200
config.rollout_length = 5
config.logger = get_logger()
run_iterations(NStepDQNAgent(config))
def ppo_cart_pole():
config = Config()
task_fn = lambda log_dir: ClassicalControl('CartPole-v0', max_steps=200, log_dir=log_dir)
config.num_workers = 5
config.task_fn = lambda: ParallelizedTask(task_fn, config.num_workers)
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, 0.001)
config.network_fn = lambda state_dim, action_dim: CategoricalActorCriticNet(
state_dim, action_dim, FCBody(state_dim), gpu=-1)
config.discount = 0.99
config.logger = get_logger()
config.use_gae = True
config.gae_tau = 0.95
config.entropy_weight = 0.01
config.gradient_clip = 0.5
config.rollout_length = 128
config.optimization_epochs = 10
config.num_mini_batches = 4
config.ppo_ratio_clip = 0.2
config.iteration_log_interval = 1
run_iterations(PPOAgent(config))
def option_critic_cart_pole():
config = Config()
game = 'CartPole-v0'
task_fn = lambda log_dir: ClassicalControl(game, max_steps=200, log_dir=log_dir)
config.num_workers = 5
config.task_fn = lambda: ParallelizedTask(task_fn, config.num_workers)
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, 0.001)
config.network_fn = lambda state_dim, action_dim: OptionCriticNet(
FCBody(state_dim), action_dim, num_options=2)
config.policy_fn = lambda: GreedyPolicy(epsilon=1.0, final_step=10000, min_epsilon=0.1)
config.discount = 0.99
config.target_network_update_freq = 200
config.rollout_length = 5
config.termination_regularizer = 0.01
config.entropy_weight = 0.01
config.logger = get_logger()
run_iterations(OptionCriticAgent(config))
## Atari games
def dqn_pixel_atari(name):
config = Config()
config.history_length = 4
config.task_fn = lambda: PixelAtari(name, frame_skip=4, history_length=config.history_length,
log_dir=get_default_log_dir(dqn_pixel_atari.__name__))
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, lr=0.00025, alpha=0.95, eps=0.01)
config.network_fn = lambda state_dim, action_dim: VanillaNet(action_dim, NatureConvBody(), gpu=0)
# config.network_fn = lambda state_dim, action_dim: DuelingNet(action_dim, NatureConvBody(), gpu=0)
config.policy_fn = lambda: GreedyPolicy(epsilon=1.0, final_step=1000000, min_epsilon=0.1)
config.replay_fn = lambda: Replay(memory_size=100000, batch_size=32)
config.state_normalizer = ImageNormalizer()
config.reward_normalizer = SignNormalizer()
config.discount = 0.99
config.target_network_update_freq = 10000
config.exploration_steps= 50000
config.logger = get_logger()
# config.double_q = True
config.double_q = False
run_episodes(DQNAgent(config))
def a2c_pixel_atari(name):
config = Config()
config.history_length = 4
config.num_workers = 16
task_fn = lambda log_dir: PixelAtari(name, frame_skip=4, history_length=config.history_length, log_dir=log_dir)
config.task_fn = lambda: ParallelizedTask(task_fn, config.num_workers, log_dir=get_default_log_dir(a2c_pixel_atari.__name__))
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, lr=0.0007)
config.network_fn = lambda state_dim, action_dim: CategoricalActorCriticNet(
state_dim, action_dim, NatureConvBody(), gpu=0)
config.policy_fn = SamplePolicy
config.state_normalizer = ImageNormalizer()
config.reward_normalizer = SignNormalizer()
config.discount = 0.99
config.use_gae = False
config.gae_tau = 0.97
config.entropy_weight = 0.01
config.rollout_length = 5
config.gradient_clip = 0.5
config.logger = get_logger(file_name=a2c_pixel_atari.__name__, skip=True)
run_iterations(A2CAgent(config))
def categorical_dqn_pixel_atari(name):
config = Config()
config.history_length = 4
config.task_fn = lambda: PixelAtari(name, frame_skip=4, history_length=config.history_length,
log_dir=get_default_log_dir(categorical_dqn_pixel_atari.__name__))
config.optimizer_fn = lambda params: torch.optim.Adam(params, lr=0.00025, eps=0.01 / 32)
config.network_fn = lambda state_dim, action_dim: \
CategoricalNet(action_dim, config.categorical_n_atoms, NatureConvBody(), gpu=1)
config.policy_fn = lambda: GreedyPolicy(epsilon=1.0, final_step=1000000, min_epsilon=0.1)
config.replay_fn = lambda: Replay(memory_size=100000, batch_size=32)
config.discount = 0.99
config.state_normalizer = ImageNormalizer()
config.reward_normalizer = SignNormalizer()
config.target_network_update_freq = 10000
config.exploration_steps= 50000
config.logger = get_logger()
config.double_q = False
config.categorical_v_max = 10
config.categorical_v_min = -10
config.categorical_n_atoms = 51
run_episodes(CategoricalDQNAgent(config))
def quantile_regression_dqn_pixel_atari(name):
config = Config()
config.history_length = 4
config.task_fn = lambda: PixelAtari(name, frame_skip=4, history_length=config.history_length,
log_dir=get_default_log_dir(quantile_regression_dqn_pixel_atari.__name__))
config.optimizer_fn = lambda params: torch.optim.Adam(params, lr=0.00005, eps=0.01 / 32)
config.network_fn = lambda state_dim, action_dim: \
QuantileNet(action_dim, config.num_quantiles, NatureConvBody(), gpu=2)
config.policy_fn = lambda: GreedyPolicy(epsilon=1.0, final_step=1000000, min_epsilon=0.01)
config.replay_fn = lambda: Replay(memory_size=100000, batch_size=32)
config.state_normalizer = ImageNormalizer()
config.reward_normalizer = SignNormalizer()
config.discount = 0.99
config.target_network_update_freq = 10000
config.exploration_steps= 50000
config.logger = get_logger()
config.double_q = False
config.num_quantiles = 200
run_episodes(QuantileRegressionDQNAgent(config))
def n_step_dqn_pixel_atari(name):
config = Config()
config.history_length = 4
task_fn = lambda log_dir: PixelAtari(name, frame_skip=4, history_length=config.history_length, log_dir=log_dir)
config.num_workers = 16
config.task_fn = lambda: ParallelizedTask(task_fn, config.num_workers,
log_dir=get_default_log_dir(n_step_dqn_pixel_atari.__name__))
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, lr=1e-4, alpha=0.99, eps=1e-5)
config.network_fn = lambda state_dim, action_dim: VanillaNet(action_dim, NatureConvBody(), gpu=3)
config.policy_fn = lambda: GreedyPolicy(epsilon=1.0, final_step=1000000, min_epsilon=0.05)
config.state_normalizer = ImageNormalizer()
config.reward_normalizer = SignNormalizer()
config.discount = 0.99
config.target_network_update_freq = 10000
config.rollout_length = 5
config.gradient_clip = 5
config.logger = get_logger()
run_iterations(NStepDQNAgent(config))
def ppo_pixel_atari(name):
config = Config()
config.history_length = 4
task_fn = lambda log_dir: PixelAtari(name, frame_skip=4, history_length=config.history_length, log_dir=log_dir)
config.num_workers = 16
config.task_fn = lambda: ParallelizedTask(task_fn, config.num_workers,
log_dir=get_default_log_dir(ppo_pixel_atari.__name__))
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, lr=0.00025)
config.network_fn = lambda state_dim, action_dim: CategoricalActorCriticNet(
state_dim, action_dim, NatureConvBody(), gpu=0)
config.state_normalizer = ImageNormalizer()
config.reward_normalizer = SignNormalizer()
config.discount = 0.99
config.logger = get_logger(file_name=ppo_pixel_atari.__name__)
config.use_gae = True
config.gae_tau = 0.95
config.entropy_weight = 0.01
config.gradient_clip = 0.5
config.rollout_length = 128
config.optimization_epochs = 4
config.num_mini_batches = 4
config.ppo_ratio_clip = 0.1
config.iteration_log_interval = 1
run_iterations(PPOAgent(config))
def option_ciritc_pixel_atari(name):
config = Config()
config.history_length = 4
task_fn = lambda log_dir: PixelAtari(name, frame_skip=4, history_length=config.history_length, log_dir=log_dir)
config.num_workers = 16
config.task_fn = lambda: ParallelizedTask(task_fn, config.num_workers,
log_dir=get_default_log_dir(config.tag))
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, lr=1e-4, alpha=0.99, eps=1e-5)
config.network_fn = lambda state_dim, action_dim: OptionCriticNet(NatureConvBody(), action_dim, num_options=4, gpu=0)
config.policy_fn = lambda: GreedyPolicy(epsilon=0.1, final_step=1000000, min_epsilon=0.1)
config.state_normalizer = ImageNormalizer()
config.reward_normalizer = SignNormalizer()
config.discount = 0.99
config.target_network_update_freq = 10000
config.rollout_length = 5
config.gradient_clip = 5
config.max_steps = 1e8
config.entropy_weight = 0.01
config.termination_regularizer = 0.01
config.logger = get_logger()
run_iterations(OptionCriticAgent(config))
def dqn_ram_atari(name):
config = Config()
config.task_fn = lambda: RamAtari(name, no_op=30, frame_skip=4,
log_dir=get_default_log_dir(dqn_ram_atari.__name__))
config.optimizer_fn = lambda params: torch.optim.RMSprop(params, lr=0.00025, alpha=0.95, eps=0.01)
config.network_fn = lambda state_dim, action_dim: VanillaNet(action_dim, FCBody(state_dim), gpu=2)
config.policy_fn = lambda: GreedyPolicy(epsilon=0.1, final_step=1000000, min_epsilon=0.1)
config.replay_fn = lambda: Replay(memory_size=100000, batch_size=32)
config.state_normalizer = RescaleNormalizer(1.0 / 128)
config.reward_normalizer = SignNormalizer()
config.discount = 0.99
config.target_network_update_freq = 10000
config.max_episode_length = 0
config.exploration_steps= 100
config.logger = get_logger()
config.double_q = True
# config.double_q = False
run_episodes(DQNAgent(config))
## continuous control
def ppo_continuous():
config = Config()
config.num_workers = 1
# task_fn = lambda log_dir: Pendulum(log_dir=log_dir)
# task_fn = lambda log_dir: Bullet('AntBulletEnv-v0', log_dir=log_dir)
task_fn = lambda log_dir: Roboschool('RoboschoolAnt-v1', log_dir=log_dir)
config.task_fn = lambda: ParallelizedTask(task_fn, config.num_workers, log_dir=get_default_log_dir(ppo_continuous.__name__))
config.network_fn = lambda state_dim, action_dim: GaussianActorCriticNet(
state_dim, action_dim, actor_body=FCBody(state_dim),
critic_body=FCBody(state_dim), gpu=-1)
config.optimizer_fn = lambda params: torch.optim.Adam(params, 3e-4, eps=1e-5)
# config.state_normalizer = RunningStatsNormalizer()
config.discount = 0.99
config.use_gae = True
config.gae_tau = 0.95
config.gradient_clip = 0.5
config.rollout_length = 2048
config.optimization_epochs = 10
config.num_mini_batches = 32
config.ppo_ratio_clip = 0.2
config.iteration_log_interval = 1
config.logger = get_logger()
run_iterations(PPOAgent(config))
def ddpg_low_dim_state():
config = Config()
log_dir = get_default_log_dir(ddpg_low_dim_state.__name__)
# config.task_fn = lambda **kwargs: Pendulum(log_dir=log_dir)
config.task_fn = lambda **kwargs: Bullet('AntBulletEnv-v0', **kwargs)
# config.task_fn = lambda **kwargs: Roboschool('RoboschoolAnt-v1', **kwargs)
config.evaluation_env = config.task_fn(log_dir=log_dir)
config.network_fn = lambda state_dim, action_dim: DeterministicActorCriticNet(
state_dim, action_dim,
actor_body=FCBody(state_dim, (300, 200), gate=F.tanh),
critic_body=TwoLayerFCBodyWithAction(state_dim, action_dim, (400, 300), gate=F.tanh),
actor_opt_fn=lambda params: torch.optim.Adam(params, lr=1e-4),
critic_opt_fn=lambda params: torch.optim.Adam(params, lr=1e-3))
config.replay_fn = lambda: Replay(memory_size=1000000, batch_size=64)
config.discount = 0.99
config.state_normalizer = RunningStatsNormalizer()
config.random_process_fn = lambda action_dim: GaussianProcess(action_dim, LinearSchedule(0.3, 0, 1e6))
config.min_memory_size = 64
config.target_network_mix = 1e-3
config.logger = get_logger()
run_episodes(DDPGAgent(config))
def ddpg_pixel():
config = Config()
log_dir = get_default_log_dir(ddpg_pixel.__name__)
config.task_fn = lambda **kwargs: PixelBullet('AntBulletEnv-v0', frame_skip=1,
history_length=4, **kwargs)
config.evaluation_env = config.task_fn(log_dir=log_dir)
phi_body=DDPGConvBody()
config.network_fn = lambda state_dim, action_dim: DeterministicActorCriticNet(
state_dim, action_dim, phi_body=phi_body,
actor_body=FCBody(phi_body.feature_dim, (50, ), gate=F.tanh),
critic_body=OneLayerFCBodyWithAction(phi_body.feature_dim, action_dim, 50, gate=F.tanh),
actor_opt_fn=lambda params: torch.optim.Adam(params, lr=1e-4),
critic_opt_fn=lambda params: torch.optim.Adam(params, lr=1e-3), gpu=0)
config.replay_fn = lambda: Replay(memory_size=1000000, batch_size=16)
config.discount = 0.99
config.state_normalizer = ImageNormalizer()
config.max_steps = 1e7
config.random_process_fn = lambda action_dim: GaussianProcess(
action_dim, LinearSchedule(0.3, 0, config.max_steps))
config.min_memory_size = 64
config.target_network_mix = 1e-3
config.logger = get_logger(file_name=ddpg_pixel.__name__)
run_episodes(DDPGAgent(config))
def plot():
import matplotlib.pyplot as plt
plotter = Plotter()
names = plotter.load_log_dirs(pattern='.*')
data = plotter.load_results(names)
for i, name in enumerate(names):
x, y = data[i]
plt.plot(x, y, color=Plotter.COLORS[i], label=name)
plt.legend()
plt.xlabel('timesteps')
plt.ylabel('episode return')
plt.show()
def action_conditional_video_prediction():
game = 'PongNoFrameskip-v4'
prefix = '.'
# Train an agent to generate the dataset
# a2c_pixel_atari(game)
# Generate a dataset with the trained model
# a2c_model_file = './data/A2CAgent-vanilla-model-%s.bin' % (game)
# generate_dataset(game, a2c_model_file, prefix)
# Train the action conditional video prediction model
acvp_train(game, prefix)
if __name__ == '__main__':
mkdir('data/video')
mkdir('dataset')
mkdir('log')
set_one_thread()
# dqn_cart_pole()
# a2c_cart_pole()
# categorical_dqn_cart_pole()
# quantile_regression_dqn_cart_pole()
# n_step_dqn_cart_pole()
# ppo_cart_pole()
# option_critic_cart_pole()
# dqn_pixel_atari('BreakoutNoFrameskip-v4')
# a2c_pixel_atari('BreakoutNoFrameskip-v4')
# categorical_dqn_pixel_atari('BreakoutNoFrameskip-v4')
# quantile_regression_dqn_pixel_atari('BreakoutNoFrameskip-v4')
# n_step_dqn_pixel_atari('BreakoutNoFrameskip-v4')
# ppo_pixel_atari('BreakoutNoFrameskip-v4')
# option_ciritc_pixel_atari('BreakoutNoFrameskip-v4')
# dqn_ram_atari('Breakout-ramNoFrameskip-v4')
# ddpg_low_dim_state()
# ddpg_pixel()
# ppo_continuous()
# action_conditional_video_prediction()
# plot()
| 44.709459 | 129 | 0.717949 | 2,667 | 19,851 | 5.04087 | 0.105362 | 0.055341 | 0.02767 | 0.036671 | 0.84216 | 0.802068 | 0.779679 | 0.755356 | 0.722032 | 0.67889 | 0 | 0.041038 | 0.175105 | 19,851 | 443 | 130 | 44.810384 | 0.779969 | 0.088157 | 0 | 0.658263 | 0 | 0 | 0.010889 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.056022 | false | 0 | 0.005602 | 0 | 0.061625 | 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 |
d49ef2660a3a0843c79f82e863b10a29d0cc79a9 | 50 | py | Python | big_sleep/__init__.py | filippocastelli/big-sleep | 39656dcb1f1d4f0e6973eec1ae17941adf9a1aba | [
"MIT"
] | 1,798 | 2021-01-18T21:34:17.000Z | 2022-03-31T18:49:52.000Z | big_sleep/__init__.py | filippocastelli/big-sleep | 39656dcb1f1d4f0e6973eec1ae17941adf9a1aba | [
"MIT"
] | 87 | 2021-01-19T05:18:29.000Z | 2022-03-25T05:18:36.000Z | big_sleep/__init__.py | filippocastelli/big-sleep | 39656dcb1f1d4f0e6973eec1ae17941adf9a1aba | [
"MIT"
] | 197 | 2021-01-19T09:07:42.000Z | 2022-03-31T14:30:08.000Z | from big_sleep.big_sleep import BigSleep, Imagine
| 25 | 49 | 0.86 | 8 | 50 | 5.125 | 0.75 | 0.390244 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 50 | 1 | 50 | 50 | 0.911111 | 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 |
d4a57414893d8cc061ce995ae7381a4933577665 | 85 | py | Python | crabageprediction/venv/Lib/site-packages/fontTools/ttLib/tables/G_D_E_F_.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 38,667 | 2015-01-01T00:15:34.000Z | 2022-03-31T22:57:03.000Z | crabageprediction/venv/Lib/site-packages/fontTools/ttLib/tables/G_D_E_F_.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 1,599 | 2016-09-27T09:07:36.000Z | 2022-03-31T23:04:51.000Z | crabageprediction/venv/Lib/site-packages/fontTools/ttLib/tables/G_D_E_F_.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 11,269 | 2015-01-01T08:41:17.000Z | 2022-03-31T16:12:52.000Z | from .otBase import BaseTTXConverter
class table_G_D_E_F_(BaseTTXConverter):
pass
| 14.166667 | 39 | 0.835294 | 12 | 85 | 5.5 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 85 | 5 | 40 | 17 | 0.88 | 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 |
d4f5d8118fe5150125ff4e060a34fdb505c4f20e | 11,872 | py | Python | test/test_epithelium.py | jbeezley/simulation-hello-world | b4e1258de9c7601af1701041fa39f8f6c5e5a61e | [
"Apache-2.0"
] | 4 | 2021-05-21T15:46:15.000Z | 2022-03-01T02:58:32.000Z | test/test_epithelium.py | jbeezley/simulation-hello-world | b4e1258de9c7601af1701041fa39f8f6c5e5a61e | [
"Apache-2.0"
] | 10 | 2020-11-10T23:20:37.000Z | 2022-03-12T01:34:47.000Z | test/test_epithelium.py | jbeezley/simulation-hello-world | b4e1258de9c7601af1701041fa39f8f6c5e5a61e | [
"Apache-2.0"
] | 2 | 2020-12-16T14:24:26.000Z | 2021-01-08T15:56:20.000Z | import numpy as np
from pytest import fixture
from nlisim.coordinates import Point
from nlisim.grid import RectangularGrid
from nlisim.oldmodules.epithelium import EpitheliumCellData, EpitheliumCellList
from nlisim.oldmodules.fungus import FungusCellData, FungusCellList
@fixture
def iron():
# a 10 x 10 x 10 grid with 10 iron
i = np.empty((10, 10, 10))
i.fill(10)
yield i
@fixture
def n_cyto():
# a 10 x 10 x 10 grid with 10 iron
i = np.empty((10, 10, 10))
i.fill(0)
yield i
@fixture
def m_cyto():
# a 10 x 10 x 10 grid with 10 iron
i = np.empty((10, 10, 10))
i.fill(0)
yield i
@fixture
def tissue():
# a 10 x 10 x 10 grid of blood
t = np.empty((10, 10, 10))
t.fill(3)
yield t
@fixture
def epithelium_list(grid: RectangularGrid):
epithelium = EpitheliumCellList(grid=grid)
yield epithelium
@fixture
def populated_epithelium(epithelium_list: EpitheliumCellList, grid: RectangularGrid):
epithelium_list.append(
EpitheliumCellData.create_cell(
point=Point(x=grid.x[3], y=grid.y[3], z=grid.z[3]),
)
)
yield epithelium_list
@fixture
def fungus_list(grid: RectangularGrid):
fungus = FungusCellList(grid=grid)
yield fungus
@fixture
def populated_fungus(fungus_list: FungusCellList, grid: RectangularGrid):
points = []
for i in range(int(grid.x[1]), int(grid.x[6]), 10):
points.append(Point(x=i, y=i, z=i))
for point in points:
fungus_list.append(
FungusCellData.create_cell(
point=point,
status=FungusCellData.Status.GROWABLE,
form=FungusCellData.Form.HYPHAE,
iron=0,
mobile=False,
)
)
yield fungus_list
# tests
# internalize_conidia
def test_internalize_conidia_none(
populated_epithelium: EpitheliumCellList,
grid: RectangularGrid,
fungus_list: FungusCellList,
):
cell = populated_epithelium[0]
vox = grid.get_voxel(cell['point'])
assert len(fungus_list.get_cells_in_voxel(vox)) == 0
populated_epithelium.internalize_conidia(0, 10, 1, grid, fungus_list)
assert populated_epithelium.len_phagosome(0) == 0
for v in cell['phagosome']:
assert v == -1
def test_internalize_conidia_1(
epithelium_list: EpitheliumCellList, grid: RectangularGrid, fungus_list: FungusCellList
):
point = Point(x=35, y=35, z=35)
epithelium_list.append(EpitheliumCellData.create_cell(point=point))
fungus_list.append(
FungusCellData.create_cell(point=point, status=FungusCellData.Status.RESTING)
)
vox = grid.get_voxel(epithelium_list[0]['point'])
epithelium_list.internalize_conidia(0, 10, 1, grid, fungus_list)
assert grid.get_voxel(fungus_list[0]['point']) == vox
assert epithelium_list.len_phagosome(0) == 1
assert 0 in epithelium_list[0]['phagosome']
def test_internalize_conidia_2(
epithelium_list: EpitheliumCellList, grid: RectangularGrid, fungus_list: FungusCellList
):
point = Point(x=35, y=35, z=35)
epithelium_list.append(EpitheliumCellData.create_cell(point=point))
fungus_list.append(
FungusCellData.create_cell(point=point, status=FungusCellData.Status.RESTING)
)
fungus_list.append(
FungusCellData.create_cell(point=point, status=FungusCellData.Status.RESTING)
)
vox = grid.get_voxel(epithelium_list[0]['point'])
epithelium_list.internalize_conidia(0, 10, 1, grid, fungus_list)
assert grid.get_voxel(fungus_list[0]['point']) == vox
assert epithelium_list.len_phagosome(0) == 2
assert 0 in epithelium_list[0]['phagosome']
assert 1 in epithelium_list[0]['phagosome']
def test_internalize_conidia_2b(
epithelium_list: EpitheliumCellList, grid: RectangularGrid, fungus_list: FungusCellList
):
point = Point(x=35, y=35, z=35)
epithelium_list.append(EpitheliumCellData.create_cell(point=point))
fungus_list.append(
FungusCellData.create_cell(point=point, status=FungusCellData.Status.RESTING)
)
fungus_list.append(
FungusCellData.create_cell(point=point, status=FungusCellData.Status.RESTING)
)
vox = grid.get_voxel(epithelium_list[0]['point'])
fungus_list[0]['internalized'] = True # say by macrophage
epithelium_list.internalize_conidia(0, 10, 1, grid, fungus_list)
assert grid.get_voxel(fungus_list[0]['point']) == vox
assert epithelium_list.len_phagosome(0) == 1
assert 0 not in epithelium_list[0]['phagosome']
assert 1 in epithelium_list[0]['phagosome']
def test_internalize_conidia_max(
epithelium_list: EpitheliumCellList, grid: RectangularGrid, fungus_list: FungusCellList
):
point = Point(x=35, y=35, z=35)
epithelium_list.append(EpitheliumCellData.create_cell(point=point))
fungus_list.append(
FungusCellData.create_cell(point=point, status=FungusCellData.Status.RESTING)
)
max_spores = 10
epithelium_list[0]['phagosome'][:max_spores] = 99 # artificially fill
epithelium_list.internalize_conidia(0, max_spores, 1, grid, fungus_list)
assert epithelium_list.len_phagosome(0) == max_spores
assert 0 not in epithelium_list[0]['phagosome']
assert not fungus_list[0]['internalized']
def test_dead_conidia_1(
epithelium_list: EpitheliumCellList, grid: RectangularGrid, fungus_list: FungusCellList
):
point = Point(x=35, y=35, z=35)
epithelium_list.append(EpitheliumCellData.create_cell(point=point))
fungus_list.append(
FungusCellData.create_cell(point=point, status=FungusCellData.Status.RESTING)
)
epithelium_list.internalize_conidia(0, 10, 1, grid, fungus_list)
fungus_list[0]['dead'] = True # simulate killing
epithelium_list.remove_dead_fungus(fungus_list)
assert epithelium_list.len_phagosome(0) == 0
assert 0 not in epithelium_list[0]['phagosome']
def test_produce_cytokines_0(
epithelium_list: EpitheliumCellList,
grid: RectangularGrid,
fungus_list: FungusCellList,
m_cyto,
n_cyto,
):
s_det = 0
h_det = 0
cyto_rate = 10
assert m_cyto[3, 3, 3] == 0
assert n_cyto[3, 3, 3] == 0
point = Point(x=35, y=35, z=35)
epithelium_list.append(EpitheliumCellData.create_cell(point=point))
fungus_list.append(
FungusCellData.create_cell(
point=point,
status=FungusCellData.Status.RESTING,
form=FungusCellData.Form.CONIDIA,
iron=0,
mobile=False,
)
)
# fungus is not swollen or germinated
epithelium_list.cytokine_update(s_det, h_det, cyto_rate, m_cyto, n_cyto, fungus_list, grid)
assert m_cyto[3, 3, 3] == 0
assert n_cyto[3, 3, 3] == 0
fungus_list[0]['status'] = FungusCellData.Status.SWOLLEN
epithelium_list.cytokine_update(s_det, h_det, cyto_rate, m_cyto, n_cyto, fungus_list, grid)
assert m_cyto[3, 3, 3] == 10
assert n_cyto[3, 3, 3] == 10
def test_produce_cytokines_0b(
epithelium_list: EpitheliumCellList,
grid: RectangularGrid,
fungus_list: FungusCellList,
m_cyto,
n_cyto,
):
s_det = 0
h_det = 0
cyto_rate = 10
assert m_cyto[3, 3, 3] == 0
assert n_cyto[3, 3, 3] == 0
point = Point(x=35, y=35, z=35)
epithelium_list.append(EpitheliumCellData.create_cell(point=point))
fungus_list.append(
FungusCellData.create_cell(
point=point,
status=FungusCellData.Status.SWOLLEN,
form=FungusCellData.Form.CONIDIA,
iron=0,
mobile=False,
)
)
epithelium_list.cytokine_update(s_det, h_det, cyto_rate, m_cyto, n_cyto, fungus_list, grid)
assert m_cyto[3, 3, 3] == 10
assert n_cyto[3, 3, 3] == 10
fungus_list.append(
FungusCellData.create_cell(
point=point,
status=FungusCellData.Status.GROWABLE,
form=FungusCellData.Form.HYPHAE,
iron=0,
mobile=False,
)
)
epithelium_list.cytokine_update(s_det, h_det, cyto_rate, m_cyto, n_cyto, fungus_list, grid)
assert m_cyto[3, 3, 3] == 20
assert n_cyto[3, 3, 3] == 30
def test_produce_cytokines_2(
epithelium_list: EpitheliumCellList,
grid: RectangularGrid,
fungus_list: FungusCellList,
m_cyto,
n_cyto,
):
s_det = 1
h_det = 2
cyto_rate = 10
assert m_cyto[3, 3, 3] == 0
assert n_cyto[3, 3, 3] == 0
point = Point(x=35, y=35, z=35)
epithelium_list.append(EpitheliumCellData.create_cell(point=point))
spoint = Point(x=15, y=35, z=35)
fungus_list.append(
FungusCellData.create_cell(
point=spoint,
status=FungusCellData.Status.SWOLLEN,
form=FungusCellData.Form.CONIDIA,
iron=0,
mobile=False,
)
)
epithelium_list.cytokine_update(s_det, h_det, cyto_rate, m_cyto, n_cyto, fungus_list, grid)
assert m_cyto[3, 3, 3] == 0
assert n_cyto[3, 3, 3] == 0
fungus_list.append(
FungusCellData.create_cell(
point=spoint,
status=FungusCellData.Status.GROWABLE,
form=FungusCellData.Form.HYPHAE,
iron=0,
mobile=False,
)
)
epithelium_list.cytokine_update(s_det, h_det, cyto_rate, m_cyto, n_cyto, fungus_list, grid)
assert m_cyto[3, 3, 3] == 0
assert n_cyto[3, 3, 3] == 10
def test_damage_conidia(
epithelium_list: EpitheliumCellList, grid: RectangularGrid, fungus_list: FungusCellList
):
kill = 2
t = 1
health = 100
point = Point(x=35, y=35, z=35)
epithelium_list.append(EpitheliumCellData.create_cell(point=point))
fungus_list.append(
FungusCellData.create_cell(point=point, status=FungusCellData.Status.RESTING)
)
epithelium_list.internalize_conidia(0, 10, 1, grid, fungus_list)
epithelium_list.damage(kill, t, health, fungus_list)
assert fungus_list.cell_data['health'][0] == 50
epithelium_list.damage(kill, t, health, fungus_list)
assert fungus_list.cell_data['health'][0] == 0
def test_kill_epithelium(
epithelium_list: EpitheliumCellList, grid: RectangularGrid, fungus_list: FungusCellList
):
# should release all conidia
point = Point(x=35, y=35, z=35)
epithelium_list.append(EpitheliumCellData.create_cell(point=point))
fungus_list.append(
FungusCellData.create_cell(point=point, status=FungusCellData.Status.RESTING)
)
fungus_list.cell_data['internalized'][0] = True
epithelium_list[0]['phagosome'][0] = 0 # internalized
epithelium_list.die_by_germination(fungus_list)
assert fungus_list.cell_data['internalized'][0]
assert epithelium_list.len_phagosome(0) == 1
fungus_list.cell_data['status'][0] = FungusCellData.Status.GERMINATED
epithelium_list.die_by_germination(fungus_list)
assert not fungus_list.cell_data['internalized'][0]
assert epithelium_list.len_phagosome(0) == 0
def test_kill_epithelium_n(
epithelium_list: EpitheliumCellList, grid: RectangularGrid, fungus_list: FungusCellList
):
# should release all conidia
point = Point(x=35, y=35, z=35)
epithelium_list.append(EpitheliumCellData.create_cell(point=point))
for _ in range(0, 10):
fungus_list.append(
FungusCellData.create_cell(point=point, status=FungusCellData.Status.RESTING)
)
epithelium_list.internalize_conidia(0, 10, 1, grid, fungus_list)
epithelium_list.die_by_germination(fungus_list)
for i in range(0, 10):
assert fungus_list.cell_data['internalized'][i]
assert epithelium_list.len_phagosome(0) == 10
fungus_list.cell_data['status'][6] = FungusCellData.Status.GERMINATED
epithelium_list.die_by_germination(fungus_list)
for i in range(0, 10):
assert not fungus_list.cell_data['internalized'][i]
assert epithelium_list.len_phagosome(0) == 0
| 28.470024 | 95 | 0.68691 | 1,561 | 11,872 | 5.014094 | 0.074952 | 0.088156 | 0.05366 | 0.066437 | 0.819727 | 0.807078 | 0.781525 | 0.776798 | 0.731826 | 0.711895 | 0 | 0.037329 | 0.207968 | 11,872 | 416 | 96 | 28.538462 | 0.795065 | 0.026028 | 0 | 0.651316 | 0 | 0 | 0.021041 | 0 | 0 | 0 | 0 | 0 | 0.154605 | 1 | 0.065789 | false | 0 | 0.019737 | 0 | 0.085526 | 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 |
be03972c3170322e4dcb8f784c67fd4870431c3c | 122 | py | Python | tests/utils/__init__.py | Arsh0023/netengine | dd0264cfdc03d630774c9e3bfb5c19310444837b | [
"X11"
] | 1 | 2020-08-06T06:38:11.000Z | 2020-08-06T06:38:11.000Z | tests/utils/__init__.py | shildenbrand/NetEngine | 86da540aa9f0aeb7448ac74829f4443af119b2b6 | [
"X11"
] | null | null | null | tests/utils/__init__.py | shildenbrand/NetEngine | 86da540aa9f0aeb7448ac74829f4443af119b2b6 | [
"X11"
] | null | null | null | from .ifconfig import *
from .iwconfig import *
from .manufacturer_lookup import *
from .parse_manufacturers import *
| 24.4 | 35 | 0.770492 | 14 | 122 | 6.571429 | 0.571429 | 0.326087 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.163934 | 122 | 4 | 36 | 30.5 | 0.901961 | 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 |
be144b31cdb8c955ec3624f299d577ac840ac941 | 2,300 | py | Python | epytope/Data/pssms/smmpmbec/mat/C_15_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/smmpmbec/mat/C_15_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/smmpmbec/mat/C_15_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | C_15_02_9 = {0: {'A': 0.027, 'C': 0.029, 'E': 0.079, 'D': 0.056, 'G': 0.043, 'F': -0.022, 'I': 0.09, 'H': -0.181, 'K': -0.241, 'M': 0.015, 'L': 0.144, 'N': 0.058, 'Q': 0.043, 'P': 0.084, 'S': -0.03, 'R': -0.431, 'T': 0.098, 'W': 0.051, 'V': 0.193, 'Y': -0.105}, 1: {'A': -1.081, 'C': -0.08, 'E': -0.177, 'D': -0.229, 'G': -0.317, 'F': 0.591, 'I': -0.839, 'H': 0.636, 'K': 1.34, 'M': -0.072, 'L': 0.311, 'N': -0.414, 'Q': 0.091, 'P': 0.342, 'S': -1.507, 'R': 1.984, 'T': -1.115, 'W': 0.545, 'V': -0.593, 'Y': 0.582}, 2: {'A': 0.212, 'C': 0.07, 'E': -0.002, 'D': 0.017, 'G': 0.089, 'F': 0.062, 'I': -0.159, 'H': 0.234, 'K': 0.525, 'M': -0.274, 'L': 0.059, 'N': -0.324, 'Q': -0.155, 'P': 0.113, 'S': -0.12, 'R': 0.36, 'T': -0.051, 'W': -0.237, 'V': -0.116, 'Y': -0.304}, 3: {'A': -0.059, 'C': -0.009, 'E': -0.051, 'D': -0.068, 'G': -0.07, 'F': 0.103, 'I': 0.129, 'H': 0.038, 'K': -0.018, 'M': 0.067, 'L': 0.074, 'N': -0.027, 'Q': -0.057, 'P': -0.117, 'S': -0.04, 'R': -0.013, 'T': -0.033, 'W': 0.05, 'V': 0.025, 'Y': 0.078}, 4: {'A': 0.004, 'C': 0.022, 'E': 0.001, 'D': -0.001, 'G': 0.03, 'F': 0.016, 'I': 0.029, 'H': -0.031, 'K': -0.008, 'M': 0.0, 'L': 0.002, 'N': -0.004, 'Q': -0.011, 'P': 0.0, 'S': -0.001, 'R': -0.039, 'T': 0.001, 'W': 0.001, 'V': 0.001, 'Y': -0.013}, 5: {'A': -0.509, 'C': -0.048, 'E': 0.03, 'D': -0.012, 'G': -0.338, 'F': -0.197, 'I': 0.389, 'H': -0.258, 'K': 0.268, 'M': 0.053, 'L': -0.059, 'N': -0.114, 'Q': -0.268, 'P': -0.434, 'S': -0.361, 'R': 0.301, 'T': 0.107, 'W': 0.582, 'V': 0.258, 'Y': 0.609}, 6: {'A': 0.209, 'C': 0.062, 'E': -0.084, 'D': 0.02, 'G': 0.108, 'F': 0.141, 'I': 0.341, 'H': -0.256, 'K': -0.119, 'M': -0.081, 'L': -0.21, 'N': -0.202, 'Q': -0.253, 'P': 0.199, 'S': 0.076, 'R': -0.111, 'T': 0.019, 'W': 0.052, 'V': 0.199, 'Y': -0.108}, 7: {'A': 0.265, 'C': -0.194, 'E': -0.404, 'D': -0.124, 'G': -0.192, 'F': 0.02, 'I': 0.481, 'H': 0.636, 'K': 0.06, 'M': 0.055, 'L': 0.099, 'N': -0.133, 'Q': 0.172, 'P': 0.006, 'S': 0.027, 'R': 0.247, 'T': 0.036, 'W': -0.115, 'V': -0.523, 'Y': -0.42}, 8: {'A': -0.234, 'C': 0.156, 'E': 0.015, 'D': 0.043, 'G': 0.095, 'F': 0.669, 'I': -0.44, 'H': 0.289, 'K': -0.008, 'M': -0.274, 'L': -0.275, 'N': 0.069, 'Q': -0.164, 'P': -0.19, 'S': -0.03, 'R': 0.178, 'T': -0.174, 'W': 0.247, 'V': -0.534, 'Y': 0.562}, -1: {'con': 3.65181}} | 2,300 | 2,300 | 0.393043 | 557 | 2,300 | 1.617594 | 0.310592 | 0.019978 | 0.008879 | 0.011099 | 0.055494 | 0 | 0 | 0 | 0 | 0 | 0 | 0.372081 | 0.162174 | 2,300 | 1 | 2,300 | 2,300 | 0.095485 | 0 | 0 | 0 | 0 | 0 | 0.079531 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
076d4ddaf5a113660c6c6598cf228756090d7743 | 159 | py | Python | test_lowest_sum_path.py | JB-Tellez/dsa-practice | 552931a9b967307fa06ce35f14972ada5c0ce638 | [
"MIT"
] | null | null | null | test_lowest_sum_path.py | JB-Tellez/dsa-practice | 552931a9b967307fa06ce35f14972ada5c0ce638 | [
"MIT"
] | null | null | null | test_lowest_sum_path.py | JB-Tellez/dsa-practice | 552931a9b967307fa06ce35f14972ada5c0ce638 | [
"MIT"
] | null | null | null | from lowest_sum_path import sum_lowest_path
def test_sum_lowest_path():
nums = [[1, 2, 3], [1, 2, 4], [6, 3, 5]]
assert sum_lowest_path(nums) == 12
| 19.875 | 44 | 0.647799 | 29 | 159 | 3.241379 | 0.551724 | 0.287234 | 0.414894 | 0.361702 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086614 | 0.201258 | 159 | 7 | 45 | 22.714286 | 0.653543 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.5 | 0 | 1 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
078ddeb21a0e56505a92f23bbc1f6b982b9aca3f | 74 | py | Python | ssod/datasets/pipelines/__init__.py | hattrickcr7/ctrst | 69cb26965ecd1637b6847892627018707fd36129 | [
"MIT"
] | null | null | null | ssod/datasets/pipelines/__init__.py | hattrickcr7/ctrst | 69cb26965ecd1637b6847892627018707fd36129 | [
"MIT"
] | null | null | null | ssod/datasets/pipelines/__init__.py | hattrickcr7/ctrst | 69cb26965ecd1637b6847892627018707fd36129 | [
"MIT"
] | null | null | null | from .formatting import *
from .rand_aug import *
from .moco_aug import *
| 18.5 | 25 | 0.756757 | 11 | 74 | 4.909091 | 0.545455 | 0.37037 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.162162 | 74 | 3 | 26 | 24.666667 | 0.870968 | 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 |
07ae91050095a5b1021ba829946c1a7a3c0105f3 | 121,174 | py | Python | pytests/tuqquery/tuq_UDF_N1QL.py | AnithaKuberan/testrunner | bc57e5b75f99e1fa76d410c6ef513294d3e5bacd | [
"Apache-2.0"
] | null | null | null | pytests/tuqquery/tuq_UDF_N1QL.py | AnithaKuberan/testrunner | bc57e5b75f99e1fa76d410c6ef513294d3e5bacd | [
"Apache-2.0"
] | null | null | null | pytests/tuqquery/tuq_UDF_N1QL.py | AnithaKuberan/testrunner | bc57e5b75f99e1fa76d410c6ef513294d3e5bacd | [
"Apache-2.0"
] | null | null | null | from .tuq import QueryTests
from deepdiff import DeepDiff
import requests
from membase.api.exception import CBQError
from collection.collections_n1ql_client import CollectionsN1QL
class QueryUDFN1QLTests(QueryTests):
ddls = {
'create_index': {
'pre': 'DROP INDEX udf_ix IF EXISTS on default',
'query': 'CREATE INDEX udf_ix ON default(a)',
'function_expected': [[]],
'post': 'SELECT name FROM system:indexes WHERE name = "udf_ix"',
'post_expected': [{"name": "udf_ix"}]
},
'create_scope': {
'pre': 'DROP SCOPE default.scope1 IF EXISTS',
'query': 'CREATE SCOPE default.scope1',
'function_expected': [[]],
'post': 'SELECT name FROM system:scopes WHERE `bucket` = "default" AND name = "scope1"',
'post_expected': [{"name": "scope1"}]
},
'create_collection': {
'pre': 'DROP COLLECTION default._default.collection1 IF EXISTS',
'query': 'CREATE COLLECTION default._default.collection1',
'function_expected': [[]],
'post': 'SELECT name FROM system:keyspaces WHERE `bucket` = "default" AND `scope` = "_default" AND name = "collection1"',
'post_expected': [{"name": "collection1"}]
},
'drop_index': {
'pre': 'CREATE INDEX udf_ix IF NOT EXISTS ON default(a)',
'query': 'DROP INDEX udf_ix on default',
'function_expected': [[]],
'post': 'SELECT name FROM system:indexes WHERE name = "udf_ix"',
'post_expected': []
},
'drop_scope': {
'pre': 'CREATE SCOPE default.scope1 IF NOT EXISTS',
'query': 'DROP SCOPE default.scope1',
'function_expected': [[]],
'post': 'SELECT name FROM system:scopes WHERE `bucket` = "default" AND name = "scope1"',
'post_expected': []
},
'drop_collection': {
'pre': 'CREATE COLLECTION default._default.collection1 IF NOT EXISTS',
'query': 'DROP COLLECTION default._default.collection1',
'function_expected': [[]],
'post': 'SELECT name FROM system:keyspaces WHERE `bucket` = "default" AND `scope` = "_default" AND name = "collection1"',
'post_expected': []
},
'create_inline_function': {
'pre': 'SELECT "noop"',
'query': 'CREATE OR REPLACE FUNCTION add(a,b) {a+b}',
'function_expected': [[]],
'post': 'SELECT identity.name FROM system:functions WHERE definition.`#language` = "inline" AND identity.name = "add"',
'post_expected': [{"name": "add"}]
},
'drop_inline_function': {
'pre': 'CREATE OR REPLACE FUNCTION add(a,b) {a+b}',
'query': 'DROP FUNCTION add',
'function_expected': [[]],
'post': 'SELECT identity.name FROM system:functions WHERE definition.`#language` = "inline" AND identity.name = "add"',
'post_expected': []
},
'execute_inline_function': {
'pre': 'CREATE OR REPLACE FUNCTION add(a,b) {a+b}',
'query': 'EXECUTE FUNCTION add(3,7)',
'function_expected': [[10]],
'post': 'EXECUTE FUNCTION add(3,7)',
'post_expected': [10]
},
'create_js_function': {
'pre': 'SELECT "noop"',
'query': 'CREATE OR REPLACE FUNCTION add(a,b) LANGUAGE JAVASCRIPT AS "add" AT "math"',
'function_expected': [[]],
'post': 'SELECT identity.name FROM system:functions WHERE definition.`#language` = "javascript" AND identity.name = "add"',
'post_expected': [{"name": "add"}]
},
'drop_js_function': {
'pre': 'CREATE OR REPLACE FUNCTION add(a,b) LANGUAGE JAVASCRIPT AS "add" AT "math"',
'query': 'DROP FUNCTION add',
'function_expected': [[]],
'post': 'SELECT identity.name FROM system:functions WHERE definition.`#language` = "javascript" AND identity.name = "add"',
'post_expected': []
},
'execute_js_function': {
'pre': 'CREATE OR REPLACE FUNCTION add(a,b) LANGUAGE JAVASCRIPT AS "add" AT "math"',
'query': 'EXECUTE FUNCTION add(3,7)',
'function_expected': [[10]],
'post': 'EXECUTE FUNCTION add(3,7)',
'post_expected': [10]
},
'update_statistics': {
'pre': 'UPDATE STATISTICS FOR default DELETE ALL',
'query': 'UPDATE STATISTICS FOR default(job_title)',
'function_expected': [[]],
'post': 'select `bucket`, `scope`, `collection`, `histogramKey` from `N1QL_SYSTEM_BUCKET`.`N1QL_SYSTEM_SCOPE`.`N1QL_CBO_STATS` data WHERE type = "histogram"',
'post_expected' : [{"bucket": "default", "collection": "_default", "histogramKey": "job_title", "scope": "_default"}]
},
'analyze': {
'pre': 'UPDATE STATISTICS FOR default DELETE ALL',
'query': 'ANALYZE default(job_title)',
'function_expected': [[]],
'post': 'select `bucket`, `scope`, `collection`, `histogramKey` from `N1QL_SYSTEM_BUCKET`.`N1QL_SYSTEM_SCOPE`.`N1QL_CBO_STATS` data WHERE type = "histogram"',
'post_expected' : [{"bucket": "default", "collection": "_default", "histogramKey": "job_title", "scope": "_default"}]
},
'grant': {
'pre': 'REVOKE query_select on default from jackdoe',
'query': 'GRANT query_select on default to jackdoe',
'function_expected': [[]],
'post': 'select roles from system:user_info where id = "jackdoe"',
'post_expected': [{'roles': [{'bucket_name': 'default', 'collection_name': '*', 'origins': [{'type': 'user'}], 'role': 'select', 'scope_name': '*'}]}]
},
'revoke': {
'pre': 'GRANT query_select on default to jackdoe',
'query': 'REVOKE query_select on default from jackdoe',
'function_expected': [[]],
'post': 'select roles from system:user_info where id = "jackdoe"',
'post_expected': [{'roles': []}]
}
}
dmls = {
'select': 'SELECT d.* FROM default d ORDER BY META(d).id LIMIT 1',
'select_with_comment': 'SELECT d.* FROM default d ORDER BY META(d).id LIMIT 1 -- some comment',
'select_with_comment2': 'SELECT d.* FROM default d /* some comment */ ORDER BY META(d).id LIMIT 1',
'update': 'UPDATE default SET job_title = "ENGINEER" WHERE join_yr = 2011 AND join_mo = 10 AND lower(job_title) = "engineer" RETURNING name, job_title',
'insert': 'INSERT INTO default (KEY, VALUE) VALUES ("key1", { "type" : "hotel", "name" : "new hotel" }) RETURNING *',
'upsert': 'UPSERT INTO default (KEY, VALUE) VALUES ("key1", { "type" : "hotel", "name" : "new hotel" }) RETURNING *',
'delete': 'DELETE FROM default WHERE job_title = "Engineer" AND join_yr = 2011 AND join_mo = 12 RETURNING *',
'merge': 'MERGE INTO default t USING [{"job_title":"Engineer"}] source ON t.job_title = source.job_title ' \
'WHEN MATCHED THEN UPDATE SET t.old_tile = "Engineer", t.job_title = "Ingenieur" ' \
'WHERE t.join_yr = 2011 AND t.join_mo = 11 LIMIT 2 RETURNING *',
'insert_from_select': 'INSERT INTO default._default.tmp (KEY UUID(), VALUE _employee) SELECT _employee FROM default _employee WHERE job_title = "Engineer" AND join_yr = 2011 AND join_mo = 10 RETURNING *',
'cte': 'WITH cte as (SELECT d.* FROM default d ORDER BY META(d).id LIMIT 1) SELECT * FROM cte',
'search': 'SELECT SEARCH_META() AS meta FROM default AS t1 WHERE SEARCH(t1, {"query": {"match": "ubuntu", "fields": "VMs.os", "analyzer": "standard"}, "includeLocations": true }) LIMIT 3'
}
def setUp(self):
super(QueryUDFN1QLTests, self).setUp()
self.log.info("============== QueryUDFN1QLTests setup has started ==============")
self.statement = self.input.param("statement", "statement")
self.params = self.input.param("params", "named")
self.inline_func = self.input.param("inline_func", False)
self.use_select = self.input.param("use_select", False)
self.test_sideeffect = self.input.param("test_sideeffect", False)
self.start_txn = self.input.param("start_txn", "BEGIN WORK")
self.end_txn = self.input.param("end_txn", "COMMIT WORK")
self.within_txn = self.input.param("within_txn", False)
self.explicit_close = self.input.param("explicit_close", False)
self.library_name = 'n1ql'
self.log.info("============== QueryUDFN1QLTests setup has completed ==============")
self.log_config_info()
def suite_setUp(self):
super(QueryUDFN1QLTests, self).suite_setUp()
self.log.info("============== QueryUDFN1QLTests suite_setup has started ==============")
functions = 'function add(a, b) { return a + b; }'
self.create_library('math', functions, 'add')
self.users = [{"id": "jackdoe", "name": "Jack Downing", "password": "password"}]
self.create_users()
self.collections_helper = CollectionsN1QL(self.master)
self.collections_helper.create_collection(bucket_name="default", scope_name="_default", collection_name="txn_scope")
self.sleep(10)
self.run_cbq_query("CREATE primary INDEX on default.`_default`.txn_scope")
self.log.info("============== QueryUDFN1QLTests suite_setup has completed ==============")
def tearDown(self):
self.log.info("============== QueryUDFN1QLTests tearDown has started ==============")
self.log.info("============== QueryUDFN1QLTests tearDown has completed ==============")
super(QueryUDFN1QLTests, self).tearDown()
def suite_tearDown(self):
self.log.info("============== QueryUDFN1QLTests suite_tearDown has started ==============")
self.log.info("============== QueryUDFN1QLTests suite_tearDown has completed ==============")
super(QueryUDFN1QLTests, self).suite_tearDown()
def create_n1ql_function(self, function_name, query):
function_names = [function_name]
functions = f'function {function_name}() {{\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
query.close();\
return acc;}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
def test_dml(self):
self.run_cbq_query("CREATE INDEX adv_job_title IF NOT EXISTS ON `default`(`job_title`)")
self.run_cbq_query("CREATE COLLECTION default._default.tmp IF NOT EXISTS")
function_name = f"{self.statement}_default"
query = self.dmls[self.statement]
self.create_n1ql_function(function_name, query)
# Run query in transaction for comparison
results = self.run_cbq_query(query='BEGIN WORK')
txid = results['results'][0]['txid']
query_result = self.run_cbq_query(query, txnid=txid)
self.run_cbq_query('ROLLBACK', txnid=txid)
# Execute function and check
if self.test_sideeffect:
try:
function_result = self.run_cbq_query(f'select {function_name}() from default')
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 5010)
self.assertTrue('not a readonly request' in str(error))
else:
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.assertEqual(function_result['results'][0], query_result['results'])
def test_explain(self):
function_name = "explain_default"
query = 'EXPLAIN SELECT * FROM default WHERE join_yr = 2011 AND join_mo = 10 AND lower(job_title) = "engineer";'
self.create_n1ql_function(function_name, query)
# Run query for comparison
query_result = self.run_cbq_query(query)
# Execute function and check
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
diffs = DeepDiff(function_result['results'][0], query_result['results'], ignore_order=True)
if diffs:
self.assertTrue(False, diffs)
def test_prepare(self):
self.run_cbq_query('DELETE FROM system:prepareds WHERE name = "engineer_count(default:)"')
function_name = 'prepare_default'
query = 'PREPARE engineer_count as SELECT COUNT(*) as count_engineer FROM default WHERE job_title = "Engineer"'
self.create_n1ql_function(function_name, query)
# Execute function and check
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.assertEqual(function_result['results'][0][0]['text'], f'{query};')
# Execute prepared statement outside of UDF
query_result = self.run_cbq_query('EXECUTE engineer_count', query_context='default:')
self.assertEqual(query_result['results'], [{'count_engineer': 672}])
def test_execute_prepared(self):
self.run_cbq_query('DELETE FROM system:prepareds WHERE name LIKE "engineer%"')
function_name = 'execute_prepare_default'
query = 'EXECUTE engineer_count'
self.create_n1ql_function(function_name, query)
# Prepare statement
self.run_cbq_query('PREPARE engineer_count as SELECT COUNT(*) as count_engineer FROM default WHERE job_title = "Engineer"', query_context="default:")
# Execute function and check
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.assertEqual(function_result['results'][0], [{'count_engineer': 672}])
def test_execute_prepared_using(self):
self.run_cbq_query('DELETE FROM system:prepareds WHERE name LIKE "engineer%"')
function_name = 'execute_prepare_using_default'
query = 'EXECUTE engineer_count using ["Engineer"]'
self.create_n1ql_function(function_name, query)
# Prepare statement
self.run_cbq_query('PREPARE engineer_count as SELECT COUNT(*) as count_engineer FROM default WHERE job_title = $1', query_context="default:")
# Execute function and check
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.assertEqual(function_result['results'][0], [{'count_engineer': 672}])
def test_infer(self):
function_name = "infer_default"
query = 'INFER default'
self.create_n1ql_function(function_name, query)
# Run query for comparison
query_result = self.run_cbq_query(query)
# Execute function and check
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.assertEqual(function_result['results'][0][0][0]['#docs'], query_result['results'][0][0]['#docs'])
def test_advise(self):
function_name = "advise_default"
query = 'ADVISE SELECT * FROM default WHERE lower(job_title) = "engineer"'
self.create_n1ql_function(function_name, query)
# Run query for comparison
query_result = self.run_cbq_query(query)
# Execute function and check
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
function_recommended_index = function_result['results'][0][0]['advice']['adviseinfo']['recommended_indexes']['indexes'][0]['index_statement']
query_recommended_index = query_result['results'][0]['advice']['adviseinfo']['recommended_indexes']['indexes'][0]['index_statement']
self.assertEqual(function_recommended_index, query_recommended_index)
def test_ddl(self):
function_name = f"{self.statement}_default"
query = self.ddls[self.statement]['query']
self.create_n1ql_function(function_name, query)
# Run pre-req prior to DDL
pre_query = self.ddls[self.statement]['pre']
self.run_cbq_query(pre_query)
self.sleep(5)
# Execute function
if self.test_sideeffect:
try:
function_result = self.run_cbq_query(f'select {function_name}() from default')
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 5010)
self.assertTrue('not a readonly request' in str(error))
else:
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.assertEqual(function_result['results'], self.ddls[self.statement]['function_expected'])
self.sleep(30)
# Run post check
post_query = self.ddls[self.statement]['post']
post_expected = self.ddls[self.statement]['post_expected']
post_actual = self.run_cbq_query(post_query)
self.assertEqual(post_expected, post_actual['results'])
def test_curl(self):
url = "https://jsonplaceholder.typicode.com/todos"
self.rest.create_whitelist(self.master, {"all_access": True})
function_name = 'curl_default'
query = f'SELECT CURL("{url}")'
self.create_n1ql_function(function_name, query)
# Get expected from curl
response = requests.get(url)
expected_curl = response.json()
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
actual_result = function_result['results'][0][0]['$1']
self.assertEqual(actual_result, expected_curl)
def test_flush_collection(self):
function_name = 'flush_default'
query = f'{self.statement} COLLECTION default'
self.create_n1ql_function(function_name, query)
# Execute function
try:
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.log.info(function_result)
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('Requested resource not found' in str(error))
def test_param_function_param(self):
functions = 'function add(a, b) { return a + b; }'
self.create_library('math', functions, 'add')
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION add(a, b) LANGUAGE JAVASCRIPT AS "add" AT "math"')
function_name = 'param_function_param_default'
functions = f'function {function_name}() {{\
var number = 10;\
var query = EXECUTE FUNCTION add(5, $number);\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(j, y, m) LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer", 2011, 10)')
expected_result = [15]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
def test_parameter_from_function(self):
function_name = 'param_from_function_default'
functions = f'function {function_name}(job, year, month) {{\
var query = SELECT name FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(j, y, m) LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer", 2011, 10)')
expected_result = [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
def test_parameter_from_var(self):
function_name = 'param_from_var_default'
functions = f'function {function_name}() {{\
var job = "Engineer";\
var year = 2011;\
var month = 10;\
var query = SELECT name FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
expected_result = [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
def test_execute_prepared_with_param(self):
self.run_cbq_query('DELETE FROM system:prepareds WHERE name LIKE "engineer%"')
function_name = 'execute_prepare_default'
if self.params == 'named':
param_val = '{"job": "Engineer"}'
param_var = "$job"
elif self.params == 'positional':
param_val = '["Engineer"]'
param_var = "$1"
functions = f'function {function_name}() {{\
var params = {param_val};\
var query = N1QL("EXECUTE engineer_count", params);\
var acc = [];\
for (const row of query) {{ acc.push(row); }}\
return acc;\
}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Prepare statement with named or postional parameter
self.run_cbq_query(f'PREPARE engineer_count as SELECT COUNT(*) as count_engineer FROM default WHERE job_title = {param_var}', query_context="default:")
# Execute function and check
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.assertEqual(function_result['results'][0], [{'count_engineer': 672}])
def test_rbac(self):
self.run_cbq_query("CREATE COLLECTION default._default.tmp IF NOT EXISTS")
self.run_cbq_query("CREATE INDEX adv_job_title IF NOT EXISTS ON `default`(`job_title`)")
# Create user with execute external function role only
self.users = [{"id": "jackDoe", "name": "Jack Downing", "password": "password1"}]
self.create_users()
role = 'query_execute_global_external_functions'
user_id = self.users[0]['id']
user_pwd = self.users[0]['password']
self.run_cbq_query(query=f"GRANT {role} to {user_id}")
# Create function
function_name = 'rbac_default'
if self.statement in self.dmls:
query = self.dmls[self.statement]
elif self.statement in self.ddls:
query = self.ddls[self.statement]['query']
pre_query = self.ddls[self.statement]['pre']
self.run_cbq_query(pre_query)
else:
self.log.error(f'Unknown statement: {self.statement}')
self.create_n1ql_function(function_name, query)
# Execute function as user
try:
self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()', username=user_id, password=user_pwd)
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('User does not have credentials to run' in str(error))
def test_circumvent_udf_rbac(self):
# Create user with execute external function role only
self.users = [{"id": "scope1", "name": "user1", "password": "password1"}]
self.create_users()
user_roles = ['query_manage_external_functions','query_execute_external_functions'
,'query_manage_functions','query_execute_functions']
user_id = self.users[0]['id']
user_pwd = self.users[0]['password']
for role in user_roles:
self.run_cbq_query(query=f"GRANT {role} ON default:default.test to {user_id}")
if self.inline_func:
# Create an inline function on scope that user does not have perms on
self.run_cbq_query(
"CREATE OR REPLACE FUNCTION default:default._default.celsius(degrees) LANGUAGE INLINE AS (degrees - 32) * 5/9")
else:
# Create a js function on the scope that the user does not have perms on
functions = 'function adder(a, b) { return a + b; } function multiplier(a, b) { return a * b; }'
function_names = ["adder", "multiplier"]
created = self.create_library("math2", functions, function_names)
self.run_cbq_query(query='CREATE OR REPLACE FUNCTION default:default._default.func1(a,b) LANGUAGE JAVASCRIPT AS "adder" AT "math2"')
# Create function
function_name = 'rbac_default'
if self.inline_func:
query = "EXECUTE FUNCTION default:default._default.celsius(10)"
else:
query = "EXECUTE FUNCTION default:default._default.func1(1,4)"
function_names = [function_name]
functions = f'function {function_name}() {{\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION default:default.test.{function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"') # Execute function as user
try:
self.run_cbq_query(f'EXECUTE FUNCTION default:default.test.{function_name}()', username=user_id, password=user_pwd)
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('User does not have credentials to run' in str(error), f"Error is not what we expected {str(ex)}")
def test_datetime_value(self):
function_name = 'datetime_value'
functions = f'function {function_name}() {{\
const date1 = new Date(Date.UTC(2018, 11, 24, 10, 33, 30, 3));\
const date2 = new Date(Date.UTC(2018, 11, 24, 10, 33, 30));\
const date3 = new Date(Date.UTC(2018, 11, 24, 10, 33));\
const date4 = new Date(Date.UTC(2018, 11, 24, 10));\
const date5 = new Date(2018, 11, 24);\
const date6 = new Date(2018, 11);\
const date7 = new Date(100000000000);\
const date8 = new Date("December 24, 2018 10:33:30");\
var query = SELECT $date1 as date_2018_12_24_10_33_30_3,\
$date2 as date_2018_12_24_10_33_30,\
$date3 as date_2018_12_24_10_33,\
$date4 as date_2018_12_24_10,\
$date5 as date_2018_12_24,\
$date6 as date_2018_12,\
$date7 as date_millis,\
$date8 as date_str;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;\
}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
expected_result = [ {
"date_2018_12": "2018-12-01T08:00:00.000Z",
"date_2018_12_24": "2018-12-24T08:00:00.000Z",
"date_2018_12_24_10": "2018-12-24T10:00:00.000Z",
"date_2018_12_24_10_33": "2018-12-24T10:33:00.000Z",
"date_2018_12_24_10_33_30": "2018-12-24T10:33:30.000Z",
"date_2018_12_24_10_33_30_3": "2018-12-24T10:33:30.003Z",
"date_millis": "1973-03-03T09:46:40.000Z",
"date_str": "2018-12-24T18:33:30.000Z"
}
]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
def test_datetime_function(self):
function_name = 'datetime_function'
functions = f'function {function_name}() {{\
const date1 = new Date(Date.UTC(2018, 11, 24, 10, 33, 30, 3));\
date_short = "2021-05-15";\
date_time = "01:15:45";\
var query = SELECT DATE_FORMAT_STR($date1, "1111-11-11") as full_to_short,\
DATE_FORMAT_STR($date_short, "1111-11-11T00:00:00+00:00") as short_to_full,\
DATE_FORMAT_STR($date_time, "1111-11-11T01:01:01Z") as time_to_full,\
DATE_PART_STR($date1, "day") as day_24,\
DATE_PART_STR($date1, "millisecond") as millisecond_3,\
DATE_PART_STR($date1, "second") as second_30,\
DATE_PART_STR($date1, "minute") as minute_33,\
DATE_PART_STR($date1, "hour") as hour_10,\
DATE_PART_STR($date1, "month") as month_12,\
DATE_PART_STR($date1, "week") as week_52,\
DATE_PART_STR($date1, "year") as year_2018;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;\
}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
expected_result = [ {
'day_24': 24,
'full_to_short': '2018-12-24',
'hour_10': 10,
'millisecond_3': 3,
'minute_33': 33,
'month_12': 12,
'second_30': 30,
'short_to_full': '2021-05-15T00:00:00-07:00',
'time_to_full': '0000-01-01T01:15:45-07',
'week_52': 52,
'year_2018': 2018
}
]
def test_udf_args(self):
function_name = 'param_from_var_default'
functions = f'function {function_name}(job, year, month) {{\
var job = job;\
var year = year;\
var month = month;\
var query = SELECT name FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(...) LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer",2011,10)')
expected_result = [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
# Execute function w/ extra params, should get ignored
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer", 2011, 10, "random", "extra")')
expected_result = [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
try:
# Execute function w/ not enough params should pass none to the last param required
self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer", 2011)')
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('Invalid data type for named parameters' in str(error), f"Error is not what we expected {str(ex)}")
def test_looped_calls(self):
# Create a js function that executes the js function that calls it
function_name = 'call_func2'
query = "EXECUTE FUNCTION call_func1()"
function_names = [function_name]
functions = f'function {function_name}() {{\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library("n1ql", functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "n1ql"')
self.create_n1ql_function(function_name, query)
# Create function that executes a function that will loop back and call it
function_name = 'call_func1'
query = "EXECUTE FUNCTION call_func2()"
function_names = [function_name]
functions = f'function {function_name}() {{\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library("n1ql2", functions, function_names)
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "n1ql2"')
# Execute function as user
try:
self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('nested javascript calls' in str(error), f"Error is not what we expected {str(ex)}")
def test_nested_loop_timeout(self):
# create a function that will just sleep so that we can hit the timeout instead of the nested loop limit
function_name = 'sleep'
function_names = [function_name]
function_sleep = 'function sleep(delay) { var start = new Date().getTime(); while (new Date().getTime() < start + delay); return delay; }'
self.create_library("sleep", function_sleep, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(t) LANGUAGE JAVASCRIPT AS "{function_name}" AT "sleep"')
sleep_query = f"EXECUTE FUNCTION {function_name}(30000)"
# Create a js function that executes the js function that calls it
function_name = 'call_func2'
query = "EXECUTE FUNCTION call_func1()"
function_names = [function_name]
functions = f'function {function_name}() {{\
var sleep_query = {sleep_query};\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library("n1ql", functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "n1ql"')
self.create_n1ql_function(function_name, query)
# Create function that executes a function that will loop back and call it
function_name = 'call_func1'
query = "EXECUTE FUNCTION call_func2()"
function_names = [function_name]
functions = f'function {function_name}() {{\
var sleep_query = {sleep_query};\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library("n1ql2", functions, function_names)
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "n1ql2"')
# Execute function as user
try:
self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('stopped after running beyond 120000 ms' in str(error), f"Error is not what we expected {str(ex)}")
def test_nested_udf_inline(self):
# Create an inline function on scope that user does not have perms on
self.run_cbq_query(
"CREATE OR REPLACE FUNCTION default:default._default.celsius(degrees) LANGUAGE INLINE AS (degrees - 32) * 5/9")
# Create function
function_name = 'rbac_default'
query = "EXECUTE FUNCTION default:default._default.celsius(10)"
function_names = [function_name]
functions = f'function {function_name}() {{\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION default:default.test.{function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function as user
results = self.run_cbq_query(f'EXECUTE FUNCTION default:default.test.{function_name}()')
self.assertEqual(results['results'], [[-12.222222222222221]], f"results mismatch {results}")
def test_nested_udf_recursion(self):
# Create function that executes a function that will loop back and call it
function_name = 'call_func1'
query = "EXECUTE FUNCTION call_func1($x)"
function_names = [function_name]
functions = f'function {function_name}(x) {{\
var levels = 1;\
if (x > 5){{ x = x - 1;\
levels = levels + 1; \
var query = {query};}}\
else{{ return levels; }}}}'
self.create_library("n1ql2", functions, function_names)
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION {function_name}(x) LANGUAGE JAVASCRIPT AS "{function_name}" AT "n1ql2"')
# Execute function as user
results = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(6)')
def test_query_context(self):
# Create an inline function on scope that user does not have perms on
self.run_cbq_query(
"CREATE OR REPLACE FUNCTION default:default.test.celsius(degrees) LANGUAGE INLINE AS (degrees - 32) * 5/9")
# Create function
function_name = 'execute_udf'
query = "EXECUTE FUNCTION default:default._default.celsius(10)"
function_names = [function_name]
functions = f'function {function_name}() {{\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"', query_context="default:default.test")
function_name = 'execute_udf'
functions = f'function {function_name}(job, year, month) {{\
var query = SELECT name FROM _default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library("library", functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(j, y, m) LANGUAGE JAVASCRIPT AS "{function_name}" AT "library"', query_context='default:default._default')
if self.use_select:
# call functions inside of a select statement w/query contexts passed
# Execute function w/ correct query context
function_result = self.run_cbq_query(f'select {function_name}("Engineer", 2011, 10)',
query_context='default:default._default')
expected_result = {'$1': [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]}
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result, f"The results are wrong, actual_result : {actual_result} , expected: {expected_result}")
# Execute function relative path should be picked up from the context of the udf
function_result = self.run_cbq_query(
f'select default:default._default.{function_name}("Engineer", 2011, 10)')
expected_result = {'$1': [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]}
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result, f"The results are wrong, actual_result : {actual_result} , expected: {expected_result}")
try:
# Execute function w/ incorrect query context, incorrect function should be used
function_result = self.run_cbq_query(f'select {function_name}("Engineer", 2011, 10)',
query_context='default:default.test')
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertTrue("10104" in str(error), f'Error code is wrong please check the error: {error}')
self.assertTrue('Incorrect number of arguments supplied' in str(error),
f"Error is not what we expected {str(ex)}")
else:
# Execute function w/ correct query context
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer", 2011, 10)', query_context='default:default._default')
expected_result = [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result, f"The results are wrong, actual_result : {actual_result} , expected: {expected_result}")
# Execute function relative path should be picked up from the context of the udf
function_result = self.run_cbq_query(f'EXECUTE FUNCTION default:default._default.{function_name}("Engineer", 2011, 10)')
expected_result = [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result, f"The results are wrong, actual_result : {actual_result} , expected: {expected_result}")
try:
# Execute function w/ incorrect query context, incorrect function should be used
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer", 2011, 10)', query_context='default:default.test')
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertTrue("10104" in str(error), f'Error code is wrong please check the error: {error}')
self.assertTrue('Incorrect number of arguments supplied' in str(error), f"Error is not what we expected {str(ex)}")
def test_letting_having_groupby(self):
string_functions = 'function concater(a,b) { var text = ""; var x; for (x in a) {if (x = b) { return x; }} return "n"; } function comparator(a, b) {if (a > b) { return "old hotel"; } else { return "new hotel" }}'
function_names2 = ["concater","comparator"]
created2 = self.create_library("strings",string_functions,function_names2)
self.run_cbq_query(query='CREATE OR REPLACE FUNCTION func1(a,b) LANGUAGE JAVASCRIPT AS "comparator" AT "strings"')
self.run_cbq_query("CREATE OR REPLACE FUNCTION func2(degrees) LANGUAGE INLINE AS (degrees - 32) ")
self.run_cbq_query(query='CREATE OR REPLACE FUNCTION func3(a,b) LANGUAGE JAVASCRIPT AS "concater" AT "strings"')
function_name = 'execute_udf'
functions = f'function {function_name}() {{\
var query = SELECT name FROM default:default.test.test1 LET maximum_no = func2(36) WHERE ANY v in test1.numbers SATISFIES v = maximum_no END GROUP BY name LETTING letter = func3("old hotel","o") HAVING name > letter;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library("library", functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "library"')
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.assertEqual(function_result['results'], [[{'name': 'old hotel'}]])
def test_global_query_context(self):
self.run_cbq_query(
"CREATE OR REPLACE FUNCTION default:default.test.celsius(degrees) LANGUAGE INLINE AS (degrees - 32) * 5/9")
function_name = 'execute_udf'
functions = f'function {function_name}(job, year, month) {{\
var query = SELECT name FROM _default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library("library", functions, [function_name])
# Create a global udf so that the relative path call fails, and create the proper scope udf
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(j, y, m) LANGUAGE JAVASCRIPT AS "{function_name}" AT "library"', query_context='default:default._default')
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(j, y, m) LANGUAGE JAVASCRIPT AS "{function_name}" AT "library"')
# Execute function w/ correct query context
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer", 2011, 10)', query_context='default:default._default')
expected_result = [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
try:
# Execute global function, relative path query should fail
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer", 2011, 10)')
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('No bucket named _default' in str(error), f"Error is not what we expected {str(ex)}")
def test_query_context_cross_scope(self):
# Create an inline function on scope that user does not have perms on
self.run_cbq_query(
"CREATE OR REPLACE FUNCTION default:default.test.celsius(degrees) LANGUAGE INLINE AS (degrees - 32) * 5/9")
# Create function
function_name = 'execute_udf'
query = "EXECUTE FUNCTION default:default.test.celsius(10)"
function_names = [function_name]
functions = f'function {function_name}() {{\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"', query_context="default:default.test")
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()', query_context='default:default.test')
self.assertEqual(function_result['results'], [[-12.222222222222221]], f"results mismatch {function_result}")
def test_query_context_absolute_path(self):
# Create a scope function, call that scope function w/absolute path and pass in an incorrect query context, absolute path should be used
self.run_cbq_query(
"CREATE OR REPLACE FUNCTION default:default.test.celsius(degrees) LANGUAGE INLINE AS (degrees - 32) * 5/9")
# Create function
function_name = 'execute_udf'
query = "EXECUTE FUNCTION celsius(10)"
function_names = [function_name]
functions = f'function {function_name}() {{\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"', query_context="default:default.test")
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(a,b) LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"', query_context="default:default._default")
function_result = self.run_cbq_query(f'EXECUTE FUNCTION default:default.test.{function_name}()', query_context='default:default._default')
self.assertEqual(function_result['results'], [[-12.222222222222221]], f"results mismatch {function_result}")
def test_query_context_negative(self):
function_name = 'execute_default'
query_context = '{"query_context": "default:default._default"}'
functions = f'function {function_name}() {{\
var params = {query_context};\
var query = N1QL("SELECT name FROM _default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3", params);\
var acc = [];\
for (const row of query) {{ acc.push(row); }}\
return acc;\
}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
# Execute function, you should not be able to pass query context to N1QL function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('No bucket named _default' in str(error), f"Error is not what we expected {str(ex)}")
def test_query_context_prepared(self):
self.run_cbq_query('DELETE FROM system:prepareds WHERE name LIKE "engineer%"')
function_name = 'execute_prepare_default'
param_val = '["Engineer"]'
param_var = "$1"
functions = f'function {function_name}() {{\
var params = {param_val};\
var query = N1QL("EXECUTE engineer_count", params);\
var acc = [];\
for (const row of query) {{ acc.push(row); }}\
return acc;\
}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION default:default._default.{function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION default:default.test.{function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Prepare statement with named or postional parameter
self.run_cbq_query(
f'PREPARE engineer_count as SELECT COUNT(*) as count_engineer FROM _default WHERE job_title = {param_var}',
query_context="default:default._default")
# Execute function and check
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()', query_context="default:default._default")
self.assertEqual(function_result['results'][0], [{'count_engineer': 672}])
# Execute global function should error
try:
# Execute function, you should not be able to pass query context to N1QL function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('No such prepared statement: engineer_count, context: default:' in str(error), f"Error is not what we expected {str(ex)}")
try:
#execute function in wrong scope should error
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()', query_context="default:default.test")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('No such prepared statement: engineer_count, context: default:default.test' in str(error), f"Error is not what we expected {str(ex)}")
def test_udf_prepare_query_context(self):
self.run_cbq_query('DELETE FROM system:prepareds WHERE name LIKE "engineer%"')
function_name = 'execute_prepare_default'
param_val = '["Engineer"]'
param_var = "$1"
functions = f'function {function_name}() {{\
var params = {param_val};\
var query = PREPARE engineer_count as SELECT COUNT(*) as count_engineer FROM _default WHERE job_title = {param_var}; \
var query1 = N1QL("EXECUTE engineer_count", params);\
var acc = [];\
for (const row of query1) {{ acc.push(row); }}\
return acc;\
}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION default:default._default.{function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION default:default.test.{function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function and check
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()', query_context="default:default._default")
self.assertEqual(function_result['results'][0], [{'count_engineer': 672}])
# Execute global function should error
try:
# Execute function, you should not be able to pass query context to N1QL function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('Keyspace not found in CB datastore: default:_default' in str(error), f"Error is not what we expected {str(ex)}")
try:
#execute function in wrong scope should error
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()', query_context="default:default.test")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('Keyspace not found in CB datastore: default:default.test._default' in str(error), f"Error is not what we expected {str(ex)}")
prepared_results = self.run_cbq_query(query="select * from system:prepareds")
self.assertEqual(prepared_results['results'][0]['prepareds']['name'],'engineer_count(default:default._default)', f"the prepared name is wrong please check prepareds {prepared_results}")
def test_global_udf_prepare_query_context(self):
self.run_cbq_query('DELETE FROM system:prepareds WHERE name LIKE "engineer%"')
function_name = 'execute_prepare_default'
param_val = '["Engineer"]'
param_var = "$1"
functions = f'function {function_name}() {{\
var params = {param_val};\
var query = PREPARE engineer_count as SELECT COUNT(*) as count_engineer FROM default WHERE job_title = {param_var}; \
var query1 = N1QL("EXECUTE engineer_count", params);\
var acc = [];\
for (const row of query1) {{ acc.push(row); }}\
return acc;\
}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION default:default._default.{function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION default:default.test.{function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function, you should not be able to pass query context to N1QL function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
self.assertEqual(function_result['results'][0], [{'count_engineer': 672}])
try:
#execute function in wrong scope should error
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()', query_context="default:default._default")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('Keyspace not found in CB datastore: default:default._default.default' in str(error), f"Error is not what we expected {str(ex)}")
try:
#execute function in wrong scope should error
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()', query_context="default:default.test")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('Keyspace not found in CB datastore: default:default.test.default' in str(error), f"Error is not what we expected {str(ex)}")
prepared_results = self.run_cbq_query(query="select * from system:prepareds")
self.assertEqual(prepared_results['results'][0]['prepareds']['name'],'engineer_count', f"the prepared name is wrong please check prepareds {prepared_results}")
def test_nested_udf_prepare_query_context(self):
self.run_cbq_query('DELETE FROM system:prepareds WHERE name LIKE "engineer%"')
self.run_cbq_query("CREATE PRIMARY INDEX ON default:default.test.test1")
function_name = 'execute_default'
param_val = '["Engineer"]'
param_var = "$1"
# Create a correct function to call for each scope, based on what scope will call it
functions = f'function {function_name}() {{\
var params = {param_val};\
var query = N1QL("SELECT COUNT(*) as count_engineer FROM _default WHERE job_title = {param_var}",params); \
var acc = [];\
for (const row of query) {{ acc.push(row); }}\
return acc;\
}}'
self.create_library(self.library_name, functions, [function_name])
functions = f'function {function_name}() {{\
var params = {param_val};\
var query = N1QL("SELECT COUNT(*) as count_engineer FROM default WHERE job_title = {param_var}",params); \
var acc = [];\
for (const row of query) {{ acc.push(row); }}\
return acc;\
}}'
self.create_library("global_library", functions, [function_name])
functions = f'function {function_name}() {{\
var query = SELECT * FROM test1; \
var acc = [];\
for (const row of query) {{ acc.push(row); }}\
return acc;\
}}'
self.create_library("test_library", functions, [function_name])
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "global_library"')
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION default:default._default.{function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION default:default.test.{function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "test_library"')
self.run_cbq_query(f'PREPARE engineer_count as SELECT {function_name}()', query_context="default:default._default")
self.run_cbq_query(f'PREPARE engineer_count as SELECT {function_name}()', query_context="default:default.test")
self.run_cbq_query(f'PREPARE engineer_count as SELECT {function_name}()', query_context="default:")
prepared_results = self.run_cbq_query(query="EXECUTE engineer_count", query_context="default:default._default")
self.assertEqual(prepared_results['results'], [{'$1': [{'count_engineer': 672}]}], f"Results are wrong {prepared_results}")
prepared_results = self.run_cbq_query(query="EXECUTE engineer_count", query_context="default:default.test")
self.assertEqual(prepared_results['results'], [{'$1': [{'test1': {'name': 'old hotel', 'type': 'hotel'}},
{'test1': {'name': 'new hotel', 'type': 'hotel'}},
{'test1': {'name': 'old hotel', 'nested': {'fields': 'fake'}}},
{'test1': {'name': 'old hotel', 'numbers': [1, 2, 3, 4]}}]}],
f"Results are wrong {prepared_results}")
prepared_results = self.run_cbq_query(query="EXECUTE engineer_count", query_context="default:")
self.assertEqual(prepared_results['results'], [{'$1': [{'count_engineer': 672}]}], f"Results are wrong {prepared_results}")
def test_nested_udf_prepare_query_context_scope_negative(self):
self.run_cbq_query('DELETE FROM system:prepareds WHERE name LIKE "engineer%"')
function_name = 'execute_default'
param_val = '["Engineer"]'
param_var = "$1"
functions = f'function {function_name}() {{\
var params = {param_val};\
var query = SELECT COUNT(*) as count_engineer FROM _default WHERE job_title = {param_var}; \
var query1 = N1QL("EXECUTE engineer_count", params);\
var acc = [];\
for (const row of query1) {{ acc.push(row); }}\
return acc;\
}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION default:default._default.{function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
self.run_cbq_query(f'PREPARE engineer_count as SELECT {function_name}()', query_context="default:default._default")
try:
prepared_results = self.run_cbq_query(query="EXECUTE engineer_count", query_context="default:default.test")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 4040)
self.assertTrue('No such prepared statement: engineer_count, context: default:default.test' in str(error), f"Error is not what we expected {str(ex)}")
try:
prepared_results = self.run_cbq_query(query="EXECUTE engineer_count", query_context="default:")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 4040)
self.assertTrue('No such prepared statement: engineer_count, context: default:' in str(error), f"Error is not what we expected {str(ex)}")
def test_nested_udf_prepare_query_context_global_negative(self):
self.run_cbq_query('DELETE FROM system:prepareds WHERE name LIKE "engineer%"')
function_name = 'execute_default'
functions = f'function {function_name}() {{\
var params = ["Engineer"];\
var query = SELECT COUNT(*) as count_engineer FROM default WHERE job_title = $1; \
var acc = [];\
for (const row of query) {{ acc.push(row); }}\
return acc;\
}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
self.run_cbq_query(f'PREPARE engineer_count as SELECT {function_name}()', query_context="default:default._default")
try:
prepared_results = self.run_cbq_query(query="EXECUTE engineer_count", query_context="default:default._default")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 5010)
self.assertTrue('Keyspace not found in CB datastore: default:default._default.default' in str(error), f"Error is not what we expected {str(ex)}")
try:
prepared_results = self.run_cbq_query(query="EXECUTE engineer_count", query_context="default:default.test")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 4040)
self.assertTrue('No such prepared statement: engineer_count, context: default:' in str(error), f"Error is not what we expected {str(ex)}")
def test_parameter_values(self):
function_name = 'param_values_default'
functions = f'function {function_name}() {{\
var num = 10;\
var str = "Hello World!";\
var obj = {{"Name": "Grogu", Age: 50}};\
var arr1 = ["a", "b", "c"];\
var arr2 = [1, 2, 3];\
var tru = true;\
var fal = false;\
var nul = null;\
var nan = NaN;\
var inf = Infinity;\
var query = SELECT $num as value_number, $str as value_string,$obj as value_object,\
$arr1 as value_array_1, $arr2 as value_array_2, $tru as value_true, $fal as value_false,\
$nan as value_nan, $inf as value_infinity, $nul as value_null;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
expected_result = [
{'value_array_1': ['a', 'b', 'c'],
'value_array_2': [1, 2, 3],
'value_false': False,
'value_infinity': None, 'value_nan': None, 'value_null': None,
'value_number': 10,
'value_object': {'Age': 50, 'Name': 'Grogu'},
'value_string': 'Hello World!',
'value_true': True}
]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
def test_comment(self):
function_name = 'success'
functions = f"""function {function_name}() {{
// some comment
query = SELECT "success" as res; // some other comment
var acc = [];
for (const row of query) {{
acc.push(row);
}}
return acc;
}}
"""
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
actual_result = function_result['results'][0]
self.assertEqual(actual_result, [{'res': 'success'}])
def test_comment2(self):
function_name = 'success'
functions = f"""function {function_name}() {{
// some comment
query = SELECT * FROM [1,2,3] as t // can i put a comment here?
WHERE t > 1; // and another one here?
var acc = [];
for (const row of query) {{
acc.push(row);
}}
return acc;
}}
"""
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
actual_result = function_result['results'][0]
self.assertEqual(actual_result, [{'t': 2}, {'t': 3}])
def test_make_statement(self):
function_name = 'param_from_var_default'
functions = f'function {function_name}(j, y, m) {{\
var job = j;\
var year = y;\
var month = m;\
var query = SELECT name FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(...) LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer",2011,10)')
expected_result = [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
def test_build_statement_strings(self):
function_name = 'param_from_var_default'
functions = f'function {function_name}(selector, j, y, m) {{\
var projection = "";\
if (selector){{ projection = "name";}} else {{ projection = "job_title"; }}\
var job = j;\
var year = y;\
var month = m;\
var query_string = "SELECT " + projection + " FROM default WHERE job_title = \\\"" + job + "\\\" AND join_yr = " + year + " AND join_mo = " + month + " ORDER by name LIMIT 3";\
var query = N1QL(query_string);\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(...) LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(1,"Engineer",2011,10)')
expected_result = [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(0,"Engineer",2011,10)')
expected_result = [{'job_title': 'Engineer'}, {'job_title': 'Engineer'}, {'job_title': 'Engineer'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
function_name = 'param_from_var_default'
functions = f'function {function_name}(selector, j, y, m) {{\
var projection = "";\
if (selector){{ projection = "name";}} else {{ projection = "job_title"; }}\
var job = j;\
var year = y;\
var month = m;\
var query_string = "SELECT " + projection + " FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3";\
var query = N1QL(query_string, {{"job":job, "month": month, "year": year}});\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, [function_name])
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(1,"Engineer",2011,10)')
expected_result = [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(0,"Engineer",2011,10)')
expected_result = [{'job_title': 'Engineer'}, {'job_title': 'Engineer'}, {'job_title': 'Engineer'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
def test_iterator(self):
function_name = 'param_from_var_default'
# once iterator is closed iter.next will no longer return a value
functions = f'function {function_name}(selector, j, y, m) {{\
var projection = "";\
if (selector){{ projection = "name";}} else {{ projection = "job_title"; }}\
var job = j;\
var year = y;\
var month = m;\
var query_string = "SELECT " + projection + " FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3";\
var query = N1QL(query_string, {{"job":job, "month": month, "year": year}});\
let iter = query[Symbol.iterator]();\
var firstrow = iter.next();\
query.close();\
var secondrow = iter.next();\
var thirdrow = iter.next();\
return {{"first_row": firstrow, "secondrow": secondrow, "thirdrow": thirdrow}};}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(...) LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(1,"Engineer",2011,10)')
expected_result = {'first_row': {'done': False, 'value': {'name': 'employee-1'}}, 'secondrow': {'done': True, 'value': None}, 'thirdrow': {'done': True, 'value': None}}
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(0,"Engineer",2011,10)')
expected_result = {'first_row': {'done': False, 'value': {'job_title': 'Engineer'}}, 'secondrow': {'done': True, 'value': None}, 'thirdrow': {'done': True, 'value': None}}
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
#if we do not close iterator we can get a subset of values
functions = f'function {function_name}(selector, j, y, m) {{\
var projection = "";\
if (selector){{ projection = "name";}} else {{ projection = "job_title"; }}\
var job = j;\
var year = y;\
var month = m;\
var query_string = "SELECT " + projection + " FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3";\
var query = N1QL(query_string, {{"job":job, "month": month, "year": year}});\
let iter = query[Symbol.iterator]();\
var firstrow = iter.next();\
var secondrow = iter.next();\
return {{"first_row": firstrow, "secondrow": secondrow}};}}'
self.create_library(self.library_name, functions, [function_name])
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(1,"Engineer",2011,10)')
expected_result = {'first_row': {'done': False, 'value': {'name': 'employee-1'}}, 'secondrow': {'done': False, 'value': {'name': 'employee-10'}}}
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(0,"Engineer",2011,10)')
expected_result = {'first_row': {'done': False, 'value': {'job_title': 'Engineer'}}, 'secondrow': {'done': False, 'value': {'job_title': 'Engineer'}}}
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
#if we do not close iterator we can get a subset of values
functions = f'function {function_name}(selector, j, y, m) {{\
var projection = "";\
if (selector){{ projection = "name";}} else {{ projection = "job_title"; }}\
var job = j;\
var year = y;\
var month = m;\
var query_string = "SELECT " + projection + " FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3";\
var query = N1QL(query_string, {{"job":job, "month": month, "year": year}});\
let iter = query[Symbol.iterator]();\
var firstrow = iter.next();\
var secondrow = iter.next();\
var thirdrow = iter.next();\
return {{"first_row": firstrow, "secondrow": secondrow, "thirdrow" : thirdrow}};}}'
self.create_library(self.library_name, functions, [function_name])
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(1,"Engineer",2011,10)')
expected_result = {'first_row': {'done': False, 'value': {'name': 'employee-1'}}, 'secondrow': {'done': False, 'value': {'name': 'employee-10'}}, 'thirdrow': {'done': False, 'value': {'name': 'employee-11'}}}
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(0,"Engineer",2011,10)')
expected_result = {'first_row': {'done': False, 'value': {'job_title': 'Engineer'}}, 'secondrow': {'done': False, 'value': {'job_title': 'Engineer'}}, 'thirdrow': {'done': False, 'value': {'job_title': 'Engineer'}}}
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
# We can iterate through the iterator with a for loop for as long as we have values to use
functions = f'function {function_name}(selector, j, y, m) {{\
var projection = "";\
if (selector){{ projection = "name";}} else {{ projection = "job_title"; }}\
var job = j;\
var year = y;\
var month = m;\
var query_string = "SELECT " + projection + " FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 10";\
var query = N1QL(query_string, {{"job":job, "month": month, "year": year}});\
let iter = query[Symbol.iterator]();\
var acc = [];\
for ( let i = 0; i < 5; i++) {{acc.push(iter.next());}}\
return acc;}}'
self.create_library(self.library_name, functions, [function_name])
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(1,"Engineer",2011,10)')
expected_result = [{'done': False, 'value': {'name': 'employee-1'}}, {'done': False, 'value': {'name': 'employee-10'}}, {'done': False, 'value': {'name': 'employee-11'}}, {'done': False, 'value': {'name': 'employee-12'}}, {'done': False, 'value': {'name': 'employee-13'}}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}(0,"Engineer",2011,10)')
expected_result = [{'done': False, 'value': {'job_title': 'Engineer'}}, {'done': False, 'value': {'job_title': 'Engineer'}}, {'done': False, 'value': {'job_title': 'Engineer'}}, {'done': False, 'value': {'job_title': 'Engineer'}}, {'done': False, 'value': {'job_title': 'Engineer'}}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
def test_multiple_iterator(self):
function_name = 'param_from_var_default'
functions = f'function {function_name}(j, y, m) {{\
var job = j;\
var year = y;\
var month = m;\
var inset = INSERT INTO default (KEY, VALUE) VALUES ("key1000", {{ "type" : "hotel", "name" : "new hotel" }}) RETURNING *;\
var query = SELECT name FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
query.close();\
var query2 = SELECT name FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 8;\
var acc2 = [];\
for (const row of query2) {{acc2.push(row);}}\
query2.close();\
return {{"query1": acc, "query2": acc2}};}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(...) LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer",2011,10)')
expected_result = {'query1': [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}],
'query2': [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'},
{'name': 'employee-12'}, {'name': 'employee-13'}, {'name': 'employee-14'},
{'name': 'employee-15'}, {'name': 'employee-16'}]}
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
def test_create_library_error(self):
function_name = 'param_function_param_default'
functions = f'function {function_name}() {{\
var number = 10;\
var query = EXECUTE FUNCTION add(5, $number);\
var acc = []\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, [function_name], error=True)
def test_syntax_error(self):
function_name = "syntax_error"
query = 'SELEC * FROM default WHERE lower(job_title) = "engineer"'
function_names = [function_name]
functions = f'function {function_name}() {{\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, function_names, error=True)
def test_timeout(self):
function_name = 'sleep'
function_names = [function_name]
function_sleep = 'function sleep(delay) { var start = new Date().getTime(); while (new Date().getTime() < start + delay); return delay; }'
self.create_library("sleep", function_sleep, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(t) LANGUAGE JAVASCRIPT AS "{function_name}" AT "sleep"')
sleep_query = f"EXECUTE FUNCTION {function_name}(300000)"
try:
self.run_cbq_query(sleep_query, query_params={'timeout':'10s'})
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex, 1)
self.assertEqual(error['code'], 10109)
self.assertTrue('sleep stopped after running beyond 10000 ms' in str(error), f"Error is not what we expected {str(ex)}")
try:
self.run_cbq_query(sleep_query, query_params={'timeout':'600s'})
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('sleep stopped after running beyond 120000 ms' in str(error), f"Error is not what we expected {str(ex)}")
def test_try_catch(self):
function_name = "syntax_error"
query = 'SELECT * FROM fake_bucket WHERE lower(job_title) = "engineer"'
function_names = [function_name]
functions = f'function {function_name}() {{\
try{{\
var query = {query};\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}}}catch(err){{throw "bucket does not exist"}}\
return acc;}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('bucket does not exist' in str(error), f"Error is not what we expected {str(ex)}")
def test_transaction_commit(self):
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
function_name = 'commit_default'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = {self.start_txn};\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
var query2 = SELECT * FROM default.`_default`.txn_scope;\
var acc = [];\
for (const row of query2) {{\
acc.push(row);\
}}\
var end_txn = {self.end_txn};\
return acc;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
self.sleep(10)
self.assertEqual(udf['results'][0], [{'txn_scope': {'a': 1, 'b': 2}}])
result = self.run_cbq_query("SELECT * FROM default.`_default`.txn_scope")
self.assertEqual(result['results'], [{'txn_scope': {'a': 1, 'b': 2}}])
def test_transaction_rollback(self):
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
self.run_cbq_query('INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {"a":1, "b":2})')
function_name = 'rollback_default'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = {self.start_txn};\
var query1 = DELETE FROM default.`_default`.txn_scope;\
var query2 = SELECT * FROM default.`_default`.txn_scope;\
var acc = [];\
for (const row of query2) {{\
acc.push(row);\
}}\
var end_txn = {self.end_txn};\
return acc;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
self.assertEqual(udf['results'][0], [])
result = self.run_cbq_query("SELECT * FROM default.`_default`.txn_scope")
self.assertEqual(result['results'], [{'txn_scope': {'a': 1, 'b': 2}}])
def test_transaction_savepoint(self):
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
function_name = 'savepoint_default'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = {self.start_txn};\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
var query2 = SAVEPOINT S1;\
var query3 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":2, "b":2}}) ;\
var query4 = SAVEPOINT S2;\
var query5 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":3, "b":2}}) ;\
var query6 = SELECT * FROM default.`_default`.txn_scope ORDER BY a;\
var acc = [];\
for (const row of query6) {{\
acc.push(row);\
}}\
var query7 = ROLLBACK TO SAVEPOINT S1;\
var end_txn = {self.end_txn};\
return acc;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
self.assertEqual(udf['results'][0], [{'txn_scope': {'a': 1, 'b': 2}}, {'txn_scope': {'a': 2, 'b': 2}}, {'txn_scope': {'a': 3, 'b': 2}}])
result = self.run_cbq_query("SELECT * FROM default.`_default`.txn_scope")
self.assertEqual(result['results'], [{'txn_scope': {'a': 1, 'b': 2}}])
def test_transaction_error_nest(self):
function_name = 'nested_default'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = BEGIN WORK;\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
var query2 = BEGIN WORK;\
var query3 = COMMIT;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('START_TRANSACTION statement is not supported within the transaction' in str(error), f"Error is not what we expected {str(ex)}")
def test_transaction_error_nostart(self):
function_name = 'nostart_default'
function_names = [function_name]
functions = f'function {function_name}() {{\
var query1 = SELECT * FROM default.`_default`.txn_scope;\
var query3 = {self.end_txn};\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue(f'{self.end_txn} statement is not supported outside the transaction' in str(error), f"Error is not what we expected {str(ex)}")
def test_transaction_dml(self):
self.run_cbq_query("CREATE INDEX adv_job_title IF NOT EXISTS ON `default`(`job_title`)")
function_name = 'transaction_dml'
function_names = [function_name]
query = self.dmls[self.statement]
functions = f'function {function_name}() {{\
var query1 = {self.start_txn};\
var query2 = {query};\
var query3 = ROLLBACK;\
return "Success";\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
self.assertEqual(udf['results'], ["Success"])
def test_transaction_active_transaction(self):
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
function_name = 'nested_txn'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = BEGIN WORK;\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
var query3 = COMMIT;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
results = self.run_cbq_query(query="START TRANSACTION", txtimeout="2m",server=self.master)
txid = results['results'][0]['txid']
if self.within_txn:
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()", txnid=txid,server=self.master)
self.fail("Query should have CBQ error'd")
else:
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()",server=self.master)
results = self.run_cbq_query("select * from default.`_default`.txn_scope")
expected_result = [{"txn_scope": {"a": 1, "b": 2}}]
self.assertEqual(results['results'], expected_result,
f"Results are not as expected, expected: {expected_result} , actual: {results}")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('START_TRANSACTION statement is not supported within the transaction' in str(error), f"Error is not what we expected {str(ex)}")
def test_transaction_timedout_transaction(self):
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
function_name = 'nested_txn'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = BEGIN WORK;\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
var query3 = COMMIT;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
results = self.run_cbq_query(query="START TRANSACTION", txtimeout="1m")
txid = results['results'][0]['txid']
self.sleep(60)
try:
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()", txnid=txid)
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 17010)
self.assertTrue('Transaction timeout' in str(error), f"Error is not what we expected {str(ex)}")
try:
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
results = self.run_cbq_query("select * from default.`_default`.txn_scope")
expected_result = [{"txn_scope": {"a": 1,"b": 2}}]
self.assertEqual(results['results'], expected_result,
f"Results are not as expected, expected: {expected_result} , actual: {results}")
except CBQError as ex:
error = self.process_CBQE(ex)
self.fail("Query should not have CBQ error'd")
def test_transaction_side_effect(self):
function_name = 'nested_txn'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = BEGIN WORK;\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
var query3 = COMMIT;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
udf = self.run_cbq_query(f"select {function_name}() from default")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 5010)
self.assertTrue('not a readonly request' in str(error), f"Error is not what we expected {str(ex)}")
def test_transaction_nested_no_side_effect(self):
function_name = 'nested_txn'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = BEGIN WORK;\
var query1 = SELECT * FROM default limit 10 ;\
var query3 = COMMIT;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
udf = self.run_cbq_query(f"select {function_name}() from default")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 5010)
self.assertTrue('not a readonly request' in str(error), f"Error is not what we expected {str(ex)}")
def test_multiple_transactions(self):
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
self.run_cbq_query("CREATE PRIMARY INDEX ON `default`:`default`.`test`.`test2`")
function_name = 'nested_txn'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn2 = START TRANSACTION;\
var query1 = DELETE FROM default.test.test2;\
var query2 = SELECT * FROM default.test.test2;\
var query3 = COMMIT;\
var start_txn = BEGIN WORK;\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
var query3 = COMMIT;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
results = self.run_cbq_query("SELECT * from default.test.test2;")
self.assertEqual(results['results'], [],
f"Results are not as expected, expected: [] , actual: {results}")
results = self.run_cbq_query("SELECT * FROM default.`_default`.txn_scope")
expected_result = [{"txn_scope": {"a": 1, "b": 2}}]
self.assertEqual(results['results'], expected_result,
f"Results are not as expected, expected: {expected_result} , actual: {results}")
def test_transaction_udf_timeout(self):
function_name = 'sleep'
function_names = [function_name]
function_sleep = 'function sleep(delay) { var start = new Date().getTime(); while (new Date().getTime() < start + delay); return delay; }'
self.create_library("sleep", function_sleep, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(t) LANGUAGE JAVASCRIPT AS "{function_name}" AT "sleep"')
sleep_query = f"EXECUTE FUNCTION {function_name}(300000)"
function_name = 'nested_txn'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = BEGIN WORK;\
var query1 = {sleep_query};\
var query3 = COMMIT;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('Function timed out' in str(error), f"Error is not what we expected {str(ex)}")
def test_transaction_with_udf(self):
function_name = 'param_from_var_default'
functions = f'function {function_name}(j, y, m) {{\
var job = j;\
var year = y;\
var month = m;\
var inset = INSERT INTO default (KEY, VALUE) VALUES ("key001", {{ "type" : "hotel", "name" : "new hotel" }}) RETURNING *;\
var query = SELECT name FROM default WHERE job_title = $job AND join_yr = $year AND join_mo = $month ORDER by name LIMIT 3;\
var acc = [];\
for (const row of query) {{\
acc.push(row);\
}}\
return acc;}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(...) LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
# Execute function
results = self.run_cbq_query(query="START TRANSACTION", txtimeout="2m")
txid = results['results'][0]['txid']
function_result = self.run_cbq_query(f'EXECUTE FUNCTION {function_name}("Engineer",2011,10)',txnid=txid)
expected_result = [{'name': 'employee-1'}, {'name': 'employee-10'}, {'name': 'employee-11'}]
actual_result = function_result['results'][0]
self.assertEqual(actual_result, expected_result)
self.run_cbq_query(query="COMMIT TRANSACTION", txtimeout="2m",txnid=txid)
results = self.run_cbq_query("SELECT * FROM default where type = 'hotel' and name = 'new hotel'")
expected_result = [{'default': {'name': 'new hotel', 'type': 'hotel'}}]
self.assertEqual(results['results'], expected_result, f"Results are not as expected, expected: {expected_result} , actual: {results}")
def test_transaction_with_multiple_dml(self):
self.run_cbq_query(query="DELETE from system:prepareds")
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
function_name = 'savepoint_default'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = BEGIN WORK;\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
query1.close();\
var query2 = SAVEPOINT S1;\
query2.close();\
var query3 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":2, "b":2}}) ;\
query3.close();\
var query4 = SAVEPOINT S2; \
query4.close(); \
var query5 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":3, "b":2}}) ; \
query5.close(); \
var query6 = SAVEPOINT S3;\
query6.close();\
var query7 = UPDATE default.`_default`.txn_scope SET c = 1 where b = 2; \
query7.close(); \
var query8 = SAVEPOINT S4;\
query8.close();\
var query9 = DELETE from default.`_default`.txn_scope where a = 1; \
query9.close(); \
var query10 = SAVEPOINT S5; \
query10.close(); \
var query11 = SELECT * FROM default.`_default`.txn_scope ORDER BY a;\
var acc = [];\
for (const row of query11) {{\
acc.push(row);\
}} \
query11.close(); \
var query12 = ROLLBACK TO SAVEPOINT S4;\
var end_txn = COMMIT WORK;\
return acc;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
self.assertEqual(udf['results'][0], [{'txn_scope': {'a': 2, 'b': 2, 'c': 1}}, {'txn_scope': {'a': 3, 'b': 2, 'c':1}}])
result = self.run_cbq_query("SELECT * FROM default.`_default`.txn_scope ORDER BY a")
self.assertEqual(result['results'], [{'txn_scope': {'a': 1, 'b': 2, 'c': 1}},{'txn_scope': {'a': 2, 'b': 2, 'c': 1}}, {'txn_scope': {'a': 3, 'b': 2, 'c':1}}])
def test_tximplicit_with_prepareds(self):
self.run_cbq_query(query="DELETE from system:prepareds")
prepare_beginwork = "PREPARE PAYMENT_beginWork as BEGIN WORK"
prepare_commitWork = "PREPARE PAYMENT_commitWork AS COMMIT"
prepare_getWarehouse = "PREPARE PAYMENT_getWarehouse AS SELECT * FROM default LIMIT 100"
self.run_cbq_query(prepare_beginwork)
self.run_cbq_query(prepare_commitWork)
self.run_cbq_query(prepare_getWarehouse)
function_name = 'doPayment'
functions = f'function doPayment(w_id,d_id,h_amount,c_w_id,c_d_id,c_id,c_last,h_date){{\
var query1 = N1QL("EXECUTE PAYMENT_beginWork");\
query1.close();\
params = [w_id];\
query1 = N1QL("EXECUTE PAYMENT_getWarehouse",params);\
var warehouse = [];\
for (const row of query1) {{warehouse.push(row);}}\
query1.close();\
var query1 = N1QL("EXECUTE PAYMENT_commitWork");\
query1.close();\
return [ warehouse];}}'
self.create_library(self.library_name, functions, [function_name])
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(...) LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
udf = self.run_cbq_query('EXECUTE FUNCTION doPayment(1,6,2873.55,1,6,"501","None","2022-01-10 11:07:34.823485")', query_params={"tximplicit":True})
self.assertEqual(udf['metrics']['resultCount'], 1)
def test_prepared_begin_commit_rollback(self):
self.run_cbq_query(query="DELETE from system:prepareds")
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
prepare_beginwork = "PREPARE beginWork as BEGIN WORK"
prepare_commitwork = "PREPARE commitWork as COMMIT"
prepare_rollback_savepoint = "PREPARE rollbackWork AS ROLLBACK TRANSACTION TO SAVEPOINT S2"
self.run_cbq_query(prepare_beginwork)
self.run_cbq_query(prepare_commitwork)
self.run_cbq_query(prepare_rollback_savepoint)
function_name = 'savepoint_default'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = EXECUTE beginWork;\
start_txn.close();\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
query1.close();\
var query2 = SAVEPOINT S1;\
query2.close();\
var query3 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":2, "b":2}}) ;\
query3.close();\
var query4 = SAVEPOINT S2; \
query4.close(); \
var query5 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":3, "b":2}}) ; \
query5.close(); \
var query6 = SELECT * FROM default.`_default`.txn_scope ORDER BY a;\
var acc = [];\
for (const row of query6) {{\
acc.push(row);\
}} \
query6.close(); \
var query7 = EXECUTE rollbackWork; \
query7.close(); \
var end_txn = EXECUTE commitWork;\
end_txn.close();\
return acc;}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
self.assertEqual(udf['results'][0], [{'txn_scope': {'a': 1, 'b': 2}}, {'txn_scope': {'a': 2, 'b': 2}}, {'txn_scope': {'a': 3, 'b': 2}}])
expected_result = [{'txn_scope': {'a': 1, 'b': 2}},{'txn_scope': {'a': 2, 'b': 2}}]
result = self.run_cbq_query("SELECT * FROM default.`_default`.txn_scope order by a")
self.assertEqual(result['results'], expected_result, f"Results are not as expected, expected: {expected_result}, actual: {result}")
self.run_cbq_query("DELETE FROM system:prepareds where name = 'rollbackWork'")
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
prepare_rollback_savepoint = "PREPARE rollbackWork AS ROLLBACK TRANSACTION TO SAVEPOINT S1"
self.run_cbq_query(prepare_rollback_savepoint)
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
self.assertEqual(udf['results'][0], [{'txn_scope': {'a': 1, 'b': 2}}, {'txn_scope': {'a': 2, 'b': 2}}, {'txn_scope': {'a': 3, 'b': 2}}])
expected_result = [{'txn_scope': {'a': 1, 'b': 2}}]
result = self.run_cbq_query("SELECT * FROM default.`_default`.txn_scope order by a")
self.assertEqual(result['results'], expected_result, f"Results are not as expected, expected: {expected_result}, actual: {result}")
def test_transaction_metrics(self):
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
function_name = 'txn'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = BEGIN WORK;\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
var query3 = COMMIT;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(
f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
self.assertTrue("transactionRemainingTime" not in str(udf), f"the field transactionRemainingTime should not appear since the transaction is now done {udf}")
results = self.run_cbq_query("select * from default.`_default`.txn_scope")
expected_result = [{"txn_scope": {"a": 1,"b": 2}}]
self.assertEqual(results['results'], expected_result,
f"Results are not as expected, expected: {expected_result} , actual: {results}")
except CBQError as ex:
error = self.process_CBQE(ex)
self.fail("Query should not have CBQ error'd")
def test_try_catch_rollback(self):
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
function_name = "syntax_error"
query = 'SELECT * FROM fake_bucket WHERE lower(job_title) = "engineer"'
function_names = [function_name]
functions = f'function {function_name}() {{\
try{{\
var beginWork = BEGIN WORK;\
var savepoint1 = SAVEPOINT S1;\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
var query2 = SELECT * FROM default.`_default`.txn_scope ORDER BY a;\
var acc = [];\
for (const row of query2) {{acc.push(row);}}\
var query = {query};\
}}catch(err){{ var query3 = ROLLBACK WORK; throw "bucket does not exist";}}\
return acc;}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('bucket does not exist' in str(error), f"Error is not what we expected {str(ex)}")
results = self.run_cbq_query("select * from default.`_default`.txn_scope")
self.assertEqual(results['results'], [],
f"Results are not as expected, expected: [] , actual: {results}")
def test_implicitly_pass_transaction_time(self):
function_name = 'sleep'
function_names = [function_name]
function_sleep = 'function sleep(delay) { var start = new Date().getTime(); while (new Date().getTime() < start + delay); return delay; }'
self.create_library("sleep", function_sleep, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}(t) LANGUAGE JAVASCRIPT AS "{function_name}" AT "sleep"')
sleep_query = f"EXECUTE FUNCTION {function_name}(300000)"
function_name = 'nested_txn'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = BEGIN WORK;\
var query1 = {sleep_query};\
var query3 = COMMIT;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()", txtimeout="1m")
self.fail("Query should have CBQ error'd")
except CBQError as ex:
error = self.process_CBQE(ex)
self.assertEqual(error['code'], 10109)
self.assertTrue('nested_txn stopped after running beyond 120000 ms' in str(error), f"Error is not what we expected {str(ex)}")
def test_transaction_multiple_node(self):
self.run_cbq_query("DELETE FROM default.`_default`.txn_scope")
function_name = 'nested_txn'
function_names = [function_name]
functions = f'function {function_name}() {{\
var start_txn = BEGIN WORK;\
var query1 = INSERT INTO default.`_default`.txn_scope(key, value) VALUES (UUID(), {{"a":1, "b":2}}) ;\
var query3 = COMMIT;\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
try:
results = self.run_cbq_query(query="START TRANSACTION", txtimeout="2m", server=self.master)
txid = results['results'][0]['txid']
udf = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()", server=self.servers[1])
results = self.run_cbq_query("select * from default.`_default`.txn_scope")
expected_result = [{"txn_scope": {"a": 1,"b": 2}}]
self.assertEqual(results['results'], expected_result,
f"Results are not as expected, expected: {expected_result} , actual: {results}")
except CBQError as ex:
error = self.process_CBQE(ex)
self.fail("Query should not have CBQ error'd")
def test_dml_consume(self):
function_name = 'consume_dml'
function_names = [function_name]
functions = f'function {function_name}() {{\
var query = UPDATE default SET a = "foo" WHERE job_title = "Engineer" RETURNING job_title;\
}}'
if self.explicit_close:
functions = f'function {function_name}() {{\
var query = UPDATE default SET a = "foo" WHERE job_title = "Engineer" RETURNING job_title;\
query.close();\
}}'
self.run_cbq_query('UPDATE default SET a = "" WHERE job_title = "Engineer"')
result = self.run_cbq_query('SELECT count(*) as count FROM default WHERE job_title = "Engineer"')
expected_count = result['results'][0]['count']
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
self.run_cbq_query(f'EXECUTE FUNCTION {function_name}()')
result = self.run_cbq_query('SELECT count(*) as count FROM default WHERE a = "foo"')
actual_count = result['results'][0]['count']
self.assertEqual(expected_count, actual_count)
def test_error_handling(self):
function_name = "error_handling"
function_names = [function_name]
functions = f'function {function_name}() {{\
try {{\
var query1 = INSERT INTO default (KEY, VALUE) VALUES ("k004", {{"col1": 10 }});\
var query2 = INSERT INTO default (KEY, VALUE) VALUES ("k004", {{"col1": 10 }});\
return "Success!";\
}} catch(error) {{\
n1ql_error = JSON.parse(error.message);\
return {{\
"caller": n1ql_error.caller,\
"code": n1ql_error.code,\
"reason": n1ql_error.cause,\
"icode": n1ql_error.icause,\
"key": n1ql_error.key,\
"message": n1ql_error.message,\
"retry": n1ql_error.retry,\
"stack": error.stack\
}};\
}}\
}}'
self.create_library(self.library_name, functions, function_names)
self.run_cbq_query(f'CREATE OR REPLACE FUNCTION {function_name}() LANGUAGE JAVASCRIPT AS "{function_name}" AT "{self.library_name}"')
result = self.run_cbq_query(f"EXECUTE FUNCTION {function_name}()")
expected_result = [
{
'caller': 'couchbase:2098', 'code': 12009, 'icode': 'Duplicate Key: k004',
'key': 'datastore.couchbase.DML_error',
'message': 'DML Error, possible causes include concurrent modification. Failed to perform INSERT on key k004',
'reason': {'caller': 'couchbase:1971', 'code': 17012, 'key': 'dml.statement.duplicatekey', 'message': 'Duplicate Key: k004'},
'retry': False,
'stack': 'Error\n at error_handling (functions/n1ql.js:1:190)'
}
]
self.assertEqual(result['results'], expected_result) | 56.649836 | 291 | 0.612351 | 14,568 | 121,174 | 4.900329 | 0.042628 | 0.078669 | 0.037821 | 0.056732 | 0.860075 | 0.843055 | 0.829271 | 0.815697 | 0.800821 | 0.786925 | 0 | 0.020399 | 0.256012 | 121,174 | 2,139 | 292 | 56.649836 | 0.771464 | 0.032845 | 0 | 0.694942 | 0 | 0.051106 | 0.333165 | 0.05287 | 0 | 0 | 0 | 0 | 0.076923 | 1 | 0.038462 | false | 0.004215 | 0.002634 | 0 | 0.071128 | 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 |
07f7d76efb0af1849305152278a098602ae46f9b | 4,426 | py | Python | tests/components/ozw/test_cover.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 6 | 2016-11-25T06:36:27.000Z | 2021-11-16T11:20:23.000Z | tests/components/ozw/test_cover.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 56 | 2020-08-03T07:30:54.000Z | 2022-03-31T06:02:04.000Z | tests/components/ozw/test_cover.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 10 | 2021-04-01T18:53:13.000Z | 2021-12-26T22:19:50.000Z | """Test Z-Wave Covers."""
from homeassistant.components.cover import ATTR_CURRENT_POSITION
from homeassistant.components.ozw.cover import VALUE_SELECTED_ID
from .common import setup_ozw
VALUE_ID = "Value"
async def test_cover(hass, cover_data, sent_messages, cover_msg):
"""Test setting up config entry."""
receive_message = await setup_ozw(hass, fixture=cover_data)
# Test loaded
state = hass.states.get("cover.roller_shutter_3_instance_1_level")
assert state is not None
assert state.state == "closed"
assert state.attributes[ATTR_CURRENT_POSITION] == 0
# Test opening
await hass.services.async_call(
"cover",
"open_cover",
{"entity_id": "cover.roller_shutter_3_instance_1_level"},
blocking=True,
)
assert len(sent_messages) == 1
msg = sent_messages[0]
assert msg["topic"] == "OpenZWave/1/command/setvalue/"
assert msg["payload"] == {"Value": 99, "ValueIDKey": 625573905}
# Feedback on state
cover_msg.decode()
cover_msg.payload["Value"] = 99
cover_msg.encode()
receive_message(cover_msg)
await hass.async_block_till_done()
state = hass.states.get("cover.roller_shutter_3_instance_1_level")
assert state is not None
assert state.state == "open"
assert state.attributes[ATTR_CURRENT_POSITION] == 100
# Test closing
await hass.services.async_call(
"cover",
"close_cover",
{"entity_id": "cover.roller_shutter_3_instance_1_level"},
blocking=True,
)
assert len(sent_messages) == 2
msg = sent_messages[1]
assert msg["topic"] == "OpenZWave/1/command/setvalue/"
assert msg["payload"] == {"Value": 0, "ValueIDKey": 625573905}
# Test setting position
await hass.services.async_call(
"cover",
"set_cover_position",
{"entity_id": "cover.roller_shutter_3_instance_1_level", "position": 50},
blocking=True,
)
assert len(sent_messages) == 3
msg = sent_messages[2]
assert msg["topic"] == "OpenZWave/1/command/setvalue/"
assert msg["payload"] == {"Value": 50, "ValueIDKey": 625573905}
# Test converting position to zwave range for position > 0
await hass.services.async_call(
"cover",
"set_cover_position",
{"entity_id": "cover.roller_shutter_3_instance_1_level", "position": 100},
blocking=True,
)
assert len(sent_messages) == 4
msg = sent_messages[3]
assert msg["topic"] == "OpenZWave/1/command/setvalue/"
assert msg["payload"] == {"Value": 99, "ValueIDKey": 625573905}
# Test converting position to zwave range for position = 0
await hass.services.async_call(
"cover",
"set_cover_position",
{"entity_id": "cover.roller_shutter_3_instance_1_level", "position": 0},
blocking=True,
)
assert len(sent_messages) == 5
msg = sent_messages[4]
assert msg["topic"] == "OpenZWave/1/command/setvalue/"
assert msg["payload"] == {"Value": 0, "ValueIDKey": 625573905}
async def test_barrier(hass, cover_gdo_data, sent_messages, cover_gdo_msg):
"""Test setting up config entry."""
receive_message = await setup_ozw(hass, fixture=cover_gdo_data)
# Test loaded
state = hass.states.get("cover.gd00z_4_barrier_state")
assert state is not None
assert state.state == "closed"
# Test opening
await hass.services.async_call(
"cover",
"open_cover",
{"entity_id": "cover.gd00z_4_barrier_state"},
blocking=True,
)
assert len(sent_messages) == 1
msg = sent_messages[0]
assert msg["topic"] == "OpenZWave/1/command/setvalue/"
assert msg["payload"] == {"Value": 4, "ValueIDKey": 281475083239444}
# Feedback on state
cover_gdo_msg.decode()
cover_gdo_msg.payload[VALUE_ID][VALUE_SELECTED_ID] = 4
cover_gdo_msg.encode()
receive_message(cover_gdo_msg)
await hass.async_block_till_done()
state = hass.states.get("cover.gd00z_4_barrier_state")
assert state is not None
assert state.state == "open"
# Test closing
await hass.services.async_call(
"cover",
"close_cover",
{"entity_id": "cover.gd00z_4_barrier_state"},
blocking=True,
)
assert len(sent_messages) == 2
msg = sent_messages[1]
assert msg["topic"] == "OpenZWave/1/command/setvalue/"
assert msg["payload"] == {"Value": 0, "ValueIDKey": 281475083239444}
| 33.029851 | 82 | 0.664257 | 560 | 4,426 | 5.008929 | 0.160714 | 0.068449 | 0.048128 | 0.047415 | 0.810339 | 0.790374 | 0.72656 | 0.72656 | 0.716578 | 0.709447 | 0 | 0.042012 | 0.209444 | 4,426 | 133 | 83 | 33.278195 | 0.759646 | 0.060551 | 0 | 0.637255 | 0 | 0 | 0.250737 | 0.143418 | 0 | 0 | 0 | 0 | 0.303922 | 1 | 0 | false | 0 | 0.029412 | 0 | 0.029412 | 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 |
ed06f9d4fe5e93fdb9250998368b2f490fa071e9 | 19 | py | Python | data.py | jshaffar/AIbiza | 1950345d39c8db0ac02eedf2c52f092e8717a9ab | [
"MIT"
] | null | null | null | data.py | jshaffar/AIbiza | 1950345d39c8db0ac02eedf2c52f092e8717a9ab | [
"MIT"
] | null | null | null | data.py | jshaffar/AIbiza | 1950345d39c8db0ac02eedf2c52f092e8717a9ab | [
"MIT"
] | 1 | 2018-05-24T06:07:46.000Z | 2018-05-24T06:07:46.000Z | import numpy as np | 19 | 19 | 0.789474 | 4 | 19 | 3.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.210526 | 19 | 1 | 19 | 19 | 1 | 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 |
ed5ccfda288734930d1cb4b4cd8f2d75a08d1faa | 42 | py | Python | fedcv/runner/__init__.py | FederalLab/openfed-cv | caef667989c5a1a2176b8d7d99b5e2f1c36f0a19 | [
"MIT"
] | null | null | null | fedcv/runner/__init__.py | FederalLab/openfed-cv | caef667989c5a1a2176b8d7d99b5e2f1c36f0a19 | [
"MIT"
] | null | null | null | fedcv/runner/__init__.py | FederalLab/openfed-cv | caef667989c5a1a2176b8d7d99b5e2f1c36f0a19 | [
"MIT"
] | null | null | null | from .openfed_runner_constructor import *
| 21 | 41 | 0.857143 | 5 | 42 | 6.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.095238 | 42 | 1 | 42 | 42 | 0.894737 | 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 |
ed742d3ac1f26556dc3314978c62fd18f3acd1a5 | 323 | py | Python | Leetcode/Python/_967.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | 1 | 2021-11-28T15:03:32.000Z | 2021-11-28T15:03:32.000Z | Leetcode/Python/_967.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | null | null | null | Leetcode/Python/_967.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | null | null | null | class Solution:
def transpose(self, matrix: List[List[int]]) -> List[List[int]]:
return [*map(list, zip(*matrix))]
class Solution:
def transpose(self, matrix: List[List[int]]) -> List[List[int]]:
output = []
for col in zip(*matrix):
output.append(col)
return output
| 29.363636 | 68 | 0.575851 | 40 | 323 | 4.65 | 0.4 | 0.172043 | 0.236559 | 0.268817 | 0.612903 | 0.612903 | 0.612903 | 0.612903 | 0.612903 | 0.612903 | 0 | 0 | 0.266254 | 323 | 10 | 69 | 32.3 | 0.78481 | 0 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0 | 0.111111 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 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 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 6 |
71fd3ece93e5abbbe2f67816d779ae5fadf8e810 | 2,232 | py | Python | test/test_spectrum_functions.py | vznncv/bouy-spectrum-resotring-demo | 4a86adbb6d59cef440bc7e35554df99371008392 | [
"MIT"
] | 2 | 2018-07-29T14:38:38.000Z | 2022-02-17T20:24:39.000Z | test/test_spectrum_functions.py | vznncv/bouy-spectrum-resotring-demo | 4a86adbb6d59cef440bc7e35554df99371008392 | [
"MIT"
] | null | null | null | test/test_spectrum_functions.py | vznncv/bouy-spectrum-resotring-demo | 4a86adbb6d59cef440bc7e35554df99371008392 | [
"MIT"
] | null | null | null | import numpy as np
from unittest import TestCase
from spectrum_processing_1d.spectrum_functions import pierson_moskowitz_s_fun, \
build_wave_spectrum_fun
class SpectrumFunctionTestCase(TestCase):
def test_wave_spectrum_fun(self):
omega = np.linspace(-np.pi, np.pi, 10)
s = pierson_moskowitz_s_fun(omega, omega_m=1.0, var=2.0)
np.testing.assert_allclose(
s,
[0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 2.8083, 0.5396, 0.1109, 0.0323],
atol=0.0001
)
def test_wave_spectrum_fun_mix(self):
omega = np.linspace(-np.pi, np.pi, 10)
s = pierson_moskowitz_s_fun(omega, omega_m=[-0.5, 1.0], var=[0.7, 1.2])
np.testing.assert_allclose(
s,
[0.0007, 0.0025, 0.0134, 0.1628, 0.2188, 0.0000, 1.6850, 0.3238, 0.0665, 0.0194],
atol=0.0001
)
def test_build_wave_spectrum_fun(self):
s_fun = build_wave_spectrum_fun(omega_m=[-0.5, 1.0], var=[0.7, 1.2])
omega = np.linspace(-np.pi, np.pi, 10)
s = s_fun(omega)
np.testing.assert_allclose(
s,
[0.0007, 0.0025, 0.0134, 0.1628, 0.2188, 0.0000, 1.6850, 0.3238, 0.0665, 0.0194],
atol=0.0001
)
def test_build_wave_spectrum_fun_var_1(self):
s_fun = build_wave_spectrum_fun(omega_m=[-0.3, 0.2, 0.4], var=[0.7, 1.2, 0.6])
omega = np.linspace(-10, 10, 20000)
s = s_fun(omega)
std_val = np.trapz(s, omega)
np.testing.assert_allclose(std_val, 2.5, atol=0.0001)
def test_build_wave_spectrum_fun_tail(self):
s_fun = build_wave_spectrum_fun(omega_m=[-0.3, 0.2, 0.4], var=[0.7, 1.2, 0.6])
omega = np.linspace(-2, 2, 20000)
s = s_fun(omega)
std_val = np.trapz(s, omega)
with self.assertRaises(AssertionError):
np.testing.assert_allclose(std_val, 2.5, atol=0.0001)
s_fun = build_wave_spectrum_fun(omega_m=[-0.3, 0.2, 0.4], var=[0.7, 1.2, 0.6],
omega_lim=1)
omega = np.linspace(-2, 2, 20000)
s = s_fun(omega)
std_val = np.trapz(s, omega)
np.testing.assert_allclose(std_val, 2.5, atol=0.0001)
| 32.823529 | 93 | 0.585573 | 373 | 2,232 | 3.300268 | 0.174263 | 0.035743 | 0.121852 | 0.129976 | 0.817222 | 0.770106 | 0.731113 | 0.731113 | 0.731113 | 0.688058 | 0 | 0.168098 | 0.269713 | 2,232 | 67 | 94 | 33.313433 | 0.587117 | 0 | 0 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.102041 | false | 0 | 0.061224 | 0 | 0.183673 | 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 |
9c30dabb1ea5464285a71f16d90de41560ae9f1e | 4,387 | py | Python | nuitka/nodes/shapes/ControlFlowDescriptions.py | em3ndez/Nuitka | a5a036a94c1842d1cd72f27c0c67461798fdf977 | [
"Apache-2.0"
] | 1 | 2019-09-09T19:27:43.000Z | 2019-09-09T19:27:43.000Z | nuitka/nodes/shapes/ControlFlowDescriptions.py | em3ndez/Nuitka | a5a036a94c1842d1cd72f27c0c67461798fdf977 | [
"Apache-2.0"
] | 1 | 2019-02-21T13:05:17.000Z | 2019-02-21T13:05:17.000Z | nuitka/nodes/shapes/ControlFlowDescriptions.py | em3ndez/Nuitka | a5a036a94c1842d1cd72f27c0c67461798fdf977 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# 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.
#
""" Objects use to describe control flow escapes.
Typically returned by shape operations to indicate what can and can not
have happened.
"""
class ControlFlowDescriptionBase(object):
@staticmethod
def isUnsupported():
return False
class ControlFlowDescriptionElementBasedEscape(ControlFlowDescriptionBase):
@staticmethod
def getExceptionExit():
return BaseException
@staticmethod
def isValueEscaping():
return True
@staticmethod
def isControlFlowEscape():
return True
class ControlFlowDescriptionFullEscape(ControlFlowDescriptionBase):
@staticmethod
def getExceptionExit():
return BaseException
@staticmethod
def isValueEscaping():
return True
@staticmethod
def isControlFlowEscape():
return True
class ControlFlowDescriptionNoEscape(ControlFlowDescriptionBase):
@staticmethod
def getExceptionExit():
return None
@staticmethod
def isValueEscaping():
return False
@staticmethod
def isControlFlowEscape():
return False
class ControlFlowDescriptionZeroDivisionNoEscape(ControlFlowDescriptionNoEscape):
@staticmethod
def getExceptionExit():
return ZeroDivisionError
class ControlFlowDescriptionValueErrorNoEscape(ControlFlowDescriptionNoEscape):
@staticmethod
def getExceptionExit():
return ValueError
class ControlFlowDescriptionComparisonUnorderable(ControlFlowDescriptionNoEscape):
@staticmethod
def getExceptionExit():
return TypeError
@staticmethod
def isUnsupported():
return True
class ControlFlowDescriptionFormatError(ControlFlowDescriptionFullEscape):
pass
class ControlFlowDescriptionOperationUnsupportedBase(ControlFlowDescriptionNoEscape):
@staticmethod
def getExceptionExit():
return TypeError
@staticmethod
def isUnsupported():
return True
class ControlFlowDescriptionAddUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionSubUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionMulUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionFloorDivUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionTrueDivUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionOldDivUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionModUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionDivmodUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionPowUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionBitorUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionBitandUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionBitxorUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionLshiftUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionRshiftUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
class ControlFlowDescriptionMatmultUnsupported(
ControlFlowDescriptionOperationUnsupportedBase
):
pass
| 22.156566 | 85 | 0.771598 | 304 | 4,387 | 11.134868 | 0.444079 | 0.070901 | 0.227474 | 0.076514 | 0.225997 | 0.167799 | 0.167799 | 0.167799 | 0.167799 | 0.167799 | 0 | 0.002234 | 0.183725 | 4,387 | 197 | 86 | 22.269036 | 0.943033 | 0.200593 | 0 | 0.771186 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.135593 | true | 0.135593 | 0 | 0.135593 | 0.474576 | 0 | 0 | 0 | 1 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 6 |
9c37fb6b460dad1f834063265d0cd98d2a416b11 | 48 | py | Python | scripts/makefile_creator.py | ColColty/Makefile_Completer | a1faf18da603015858d92a7b385cb81aab3696c2 | [
"MIT"
] | 1 | 2019-04-20T10:47:14.000Z | 2019-04-20T10:47:14.000Z | scripts/makefile_creator.py | ColColty/Makefile_Completer | a1faf18da603015858d92a7b385cb81aab3696c2 | [
"MIT"
] | 16 | 2019-04-21T20:32:00.000Z | 2019-06-08T12:54:57.000Z | scripts/makefile_creator.py | ColColty/Makefile_Completer | a1faf18da603015858d92a7b385cb81aab3696c2 | [
"MIT"
] | 1 | 2019-05-28T20:14:22.000Z | 2019-05-28T20:14:22.000Z | # TODO Make the functions to create the Makefile | 48 | 48 | 0.8125 | 8 | 48 | 4.875 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 48 | 1 | 48 | 48 | 0.975 | 0.958333 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 1 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
1315bb4ac7d9334876cd619bc56aeb04422897e6 | 130 | py | Python | slacker/service/__init__.py | jan-g/faastm | ad626678c06b70f6ec65a9a59ce3dce7475c51e1 | [
"Apache-2.0"
] | null | null | null | slacker/service/__init__.py | jan-g/faastm | ad626678c06b70f6ec65a9a59ce3dce7475c51e1 | [
"Apache-2.0"
] | null | null | null | slacker/service/__init__.py | jan-g/faastm | ad626678c06b70f6ec65a9a59ce3dce7475c51e1 | [
"Apache-2.0"
] | null | null | null | from .base import Agent, Channel, Notice
from .slack import Service as SlackService
from .txn import Service as CommittingService
| 32.5 | 45 | 0.823077 | 18 | 130 | 5.944444 | 0.666667 | 0.242991 | 0.280374 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.138462 | 130 | 3 | 46 | 43.333333 | 0.955357 | 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 |
1321761c42388021246b2688148b4770cf74c3ab | 78 | py | Python | webalyzer/analyzer/tests.py | mdn/webalyzer | 0b897d5df4a2c8d6881b5acefba707369b2f2b8c | [
"BSD-3-Clause"
] | 10 | 2015-04-28T17:27:19.000Z | 2019-08-16T08:30:30.000Z | webalyzer/analyzer/tests.py | mdn/webalyzer | 0b897d5df4a2c8d6881b5acefba707369b2f2b8c | [
"BSD-3-Clause"
] | 27 | 2015-04-03T15:59:34.000Z | 2017-07-25T16:43:58.000Z | webalyzer/analyzer/tests.py | mdn/webalyzer | 0b897d5df4a2c8d6881b5acefba707369b2f2b8c | [
"BSD-3-Clause"
] | 8 | 2015-04-06T17:37:15.000Z | 2022-02-19T01:33:42.000Z | from django.test import TestCase
class AnalyzerTestCase(TestCase):
pass
| 13 | 33 | 0.782051 | 9 | 78 | 6.777778 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 78 | 5 | 34 | 15.6 | 0.938462 | 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 |
133c3d262dafadaf5e56947567c42d8b29a1a3c2 | 43 | py | Python | parTopsis/__init__.py | parthsujalshah/pyTopsis | 14f3031883cc6de1495853d29fc3b5babfefcc72 | [
"MIT"
] | null | null | null | parTopsis/__init__.py | parthsujalshah/pyTopsis | 14f3031883cc6de1495853d29fc3b5babfefcc72 | [
"MIT"
] | null | null | null | parTopsis/__init__.py | parthsujalshah/pyTopsis | 14f3031883cc6de1495853d29fc3b5babfefcc72 | [
"MIT"
] | null | null | null | from parTopsis.parTopsis import topsis_main | 43 | 43 | 0.906977 | 6 | 43 | 6.333333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.069767 | 43 | 1 | 43 | 43 | 0.95 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.