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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c49d55529ad912ba69b64da40285b1bb366644d5
| 44
|
py
|
Python
|
tests/__init__.py
|
BorgwardtLab/Topf
|
9468bc40532b9b249de2c26ffb4f4a03b56008fe
|
[
"BSD-3-Clause"
] | 1
|
2021-09-07T04:42:29.000Z
|
2021-09-07T04:42:29.000Z
|
tests/__init__.py
|
BorgwardtLab/Topf
|
9468bc40532b9b249de2c26ffb4f4a03b56008fe
|
[
"BSD-3-Clause"
] | null | null | null |
tests/__init__.py
|
BorgwardtLab/Topf
|
9468bc40532b9b249de2c26ffb4f4a03b56008fe
|
[
"BSD-3-Clause"
] | 2
|
2021-06-25T18:44:19.000Z
|
2021-09-07T04:42:39.000Z
|
from .test_persistence_transformer import *
| 22
| 43
| 0.863636
| 5
| 44
| 7.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 44
| 1
| 44
| 44
| 0.9
| 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
|
c4a799c2d8a539e2a349574873170af90c934e0f
| 314
|
py
|
Python
|
timeapp/signals.py
|
iskenderunlu/jogging-time-management
|
1cf88bee2abe1f237a2e6f194264064ec89d6e4a
|
[
"MIT"
] | null | null | null |
timeapp/signals.py
|
iskenderunlu/jogging-time-management
|
1cf88bee2abe1f237a2e6f194264064ec89d6e4a
|
[
"MIT"
] | null | null | null |
timeapp/signals.py
|
iskenderunlu/jogging-time-management
|
1cf88bee2abe1f237a2e6f194264064ec89d6e4a
|
[
"MIT"
] | null | null | null |
from django.db.models.signals import post_save
from django.dispatch import receiver
from timeapp.models import *
#from timeapp.tasks import save_avgspeed_distance_to_models
# @receiver(post_save, sender=Post)
# def save_avgspeed_distance_to_model(sender, **kwargs):
# save_avgspeed_distance_to_models.delay()
| 34.888889
| 59
| 0.824841
| 45
| 314
| 5.444444
| 0.444444
| 0.146939
| 0.244898
| 0.269388
| 0.228571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095541
| 314
| 9
| 60
| 34.888889
| 0.862676
| 0.611465
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
c4eb3435f341feb393a16ece2e9cf2f417c1ad33
| 27
|
py
|
Python
|
mskpy/lib/__init__.py
|
mkelley/mskpy
|
41f41fd69bae71853abdfd2afbd535cd0b79c530
|
[
"BSD-3-Clause"
] | 10
|
2015-03-27T09:52:10.000Z
|
2021-01-07T22:29:51.000Z
|
mskpy/lib/__init__.py
|
mkelley/mskpy
|
41f41fd69bae71853abdfd2afbd535cd0b79c530
|
[
"BSD-3-Clause"
] | 7
|
2015-11-29T22:20:57.000Z
|
2019-11-01T21:15:07.000Z
|
mskpy/lib/__init__.py
|
mkelley/mskpy
|
41f41fd69bae71853abdfd2afbd535cd0b79c530
|
[
"BSD-3-Clause"
] | 2
|
2015-11-29T21:26:09.000Z
|
2016-05-24T08:53:43.000Z
|
from .davint import davint
| 13.5
| 26
| 0.814815
| 4
| 27
| 5.5
| 0.75
| 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
|
1eea975465911038de8a814d45ec05e7c753aeec
| 17,085
|
py
|
Python
|
vnet_manager/tests/actions/test_action_manager.py
|
gfokkema/vnet-manager
|
7650c58019a72a89a737c3a54cb320a623951410
|
[
"MIT"
] | 4
|
2020-11-03T13:52:31.000Z
|
2021-07-28T23:07:06.000Z
|
vnet_manager/tests/actions/test_action_manager.py
|
gfokkema/vnet-manager
|
7650c58019a72a89a737c3a54cb320a623951410
|
[
"MIT"
] | 26
|
2020-09-27T14:04:07.000Z
|
2022-03-05T20:16:09.000Z
|
vnet_manager/tests/actions/test_action_manager.py
|
gfokkema/vnet-manager
|
7650c58019a72a89a737c3a54cb320a623951410
|
[
"MIT"
] | 4
|
2020-10-20T13:38:47.000Z
|
2022-02-18T18:18:57.000Z
|
from os import EX_OK, EX_USAGE
from unittest.mock import MagicMock
from vnet_manager.tests import VNetTestCase
from vnet_manager.actions.manager import ActionManager
from vnet_manager.conf import settings
class TestActionManager(VNetTestCase):
def setUp(self) -> None:
self.get_config = self.set_up_patch("vnet_manager.actions.manager.get_config")
self.validator = MagicMock()
self.validate = self.set_up_patch("vnet_manager.actions.manager.ValidateConfig")
self.validate.return_value = self.validator
self.validator.updated_config = {}
self.show_version = self.set_up_patch("vnet_manager.actions.manager.show_version")
self.show_status = self.set_up_patch("vnet_manager.actions.manager.show_status")
self.show_status_interfaces = self.set_up_patch("vnet_manager.actions.manager.show_vnet_interface_status")
self.show_status_interfaces_veth = self.set_up_patch("vnet_manager.actions.manager.show_vnet_veth_interface_status")
self.bring_up_vnet_interfaces = self.set_up_patch("vnet_manager.actions.manager.bring_up_vnet_interfaces")
self.change_machine_status = self.set_up_patch("vnet_manager.actions.manager.change_machine_status")
self.bring_down_vnet_interfaces = self.set_up_patch("vnet_manager.actions.manager.bring_down_vnet_interfaces")
self.ensure_vnet_lxc_environment = self.set_up_patch("vnet_manager.actions.manager.ensure_vnet_lxc_environment")
self.create_machines = self.set_up_patch("vnet_manager.actions.manager.create_machines")
self.put_files_on_machine = self.set_up_patch("vnet_manager.actions.manager.put_files_on_machine")
self.generate_vnet_hosts_file = self.set_up_patch("vnet_manager.actions.manager.generate_vnet_hosts_file")
self.place_vnet_hosts_file_on_machines = self.set_up_patch("vnet_manager.actions.manager.place_vnet_hosts_file_on_machines")
self.enable_type_specific_machine_configuration = self.set_up_patch(
"vnet_manager.actions.manager.enable_type_specific_machine_configuration"
)
self.request_confirmation = self.set_up_patch("vnet_manager.actions.manager.request_confirmation")
self.destroy_lxc_image = self.set_up_patch("vnet_manager.actions.manager.destroy_lxc_image")
self.destroy_machines = self.set_up_patch("vnet_manager.actions.manager.destroy_machines")
self.delete_vnet_interfaces = self.set_up_patch("vnet_manager.actions.manager.delete_vnet_interfaces")
self.cleanup_vnet_lxc_environment = self.set_up_patch("vnet_manager.actions.manager.cleanup_vnet_lxc_environment")
self.display_help_for_action = self.set_up_patch("vnet_manager.actions.manager.display_help_for_action")
self.isfile = self.set_up_patch("vnet_manager.actions.manager.isfile")
self.isdir = self.set_up_patch("vnet_manager.actions.manager.isdir")
self.get_yaml_file_from_disk_path = self.set_up_patch("vnet_manager.actions.manager.get_yaml_files_from_disk_path")
self.get_yaml_file_from_disk_path.return_value = ["file1"]
def test_action_raises_not_implemented_error_if_unsupported_action(self):
manager = ActionManager()
with self.assertRaises(NotImplementedError):
manager.execute("not_working")
def test_action_manager_calls_show_version_with_version_action(self):
manager = ActionManager()
ret = manager.execute("version")
self.show_version.assert_called_once_with()
self.assertEqual(ret, EX_OK)
def test_action_manager_calls_display_help_for_action_when_action_has_been_called_with_help_as_second_parameter(self):
manager = ActionManager(config_path="help")
ret = manager.execute("start")
self.display_help_for_action.assert_called_once_with("start")
self.assertEqual(ret, EX_OK)
def test_action_manager_calls_get_config(self):
manager = ActionManager(config_path="blaap")
manager.execute("list")
self.get_config.assert_called_once_with("blaap")
def test_action_manager_calls_validate_config(self):
manager = ActionManager(config_path="blaap")
manager.execute("list")
self.validate.called_once_with()
def test_action_manager_called_validator_function(self):
manager = ActionManager(config_path="blaap")
manager.execute("list")
self.validator.validate.assert_called_once()
def test_action_manager_returns_usage_exit_code_if_validator_unsuccessful(self):
self.validator.config_validation_successful = False
manager = ActionManager(config_path="blaap")
ret = manager.execute("show")
self.assertEqual(ret, EX_USAGE)
self.assertFalse(self.show_status.called)
def test_action_manager_calls_show_status_with_list_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("list")
self.show_status.assert_called_once_with(self.validator.updated_config)
def test_action_manager_calls_show_vnet_interface_status_with_list_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("list")
self.show_status_interfaces.assert_called_once_with(self.validator.updated_config)
def test_action_manager_does_not_call_vnet_veth_interface_status_with_list_action_if_veths_config_not_present(self):
manager = ActionManager(config_path="blaap")
manager.execute("list")
self.assertFalse(self.show_status_interfaces_veth.called)
def test_action_manager_calls_show_vnet_veth_interface_status_with_list_action(self):
self.validator.updated_config["veths"] = "jajaja"
manager = ActionManager(config_path="blaap")
manager.execute("list")
self.show_status_interfaces_veth.assert_called_once_with(self.validator.updated_config)
def test_action_manager_calls_get_yaml_file_from_disk_path_with_list_action(self):
self.isfile.return_value = False
manager = ActionManager(config_path="blaap")
manager.execute("list")
self.get_yaml_file_from_disk_path.assert_called_once_with("blaap")
def test_action_manager_calls_show_status_with_return_values_of_get_yaml_files(self):
self.get_yaml_file_from_disk_path.return_value = ["file1", "file2", "file3"]
self.isfile.return_value = False
manager = ActionManager(config_path="blaap")
manager.execute("list")
self.assertEqual(3, self.show_status.call_count)
def test_action_manager_does_nothing_when_not_file_and_not_dir_with_list_action(self):
self.isfile.return_value = False
self.isdir.return_value = False
manager = ActionManager(config_path="blaap")
manager.execute("list")
self.assertFalse(self.get_yaml_file_from_disk_path.called)
self.assertFalse(self.show_status.called)
def test_action_manager_calls_show_status_with_show_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("show")
self.show_status.assert_called_once_with(self.validator.updated_config)
def test_action_manager_calls_show_vnet_interface_status_with_show_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("show")
self.show_status_interfaces.assert_called_once_with(self.validator.updated_config)
def test_action_manager_does_not_call_vnet_veth_interface_status_with_show_action_if_veths_config_not_present(self):
manager = ActionManager(config_path="blaap")
manager.execute("show")
self.assertFalse(self.show_status_interfaces_veth.called)
def test_action_manager_calls_show_vnet_veth_interface_status_with_show_action(self):
self.validator.updated_config["veths"] = "jajaja"
manager = ActionManager(config_path="blaap")
manager.execute("show")
self.show_status_interfaces_veth.assert_called_once_with(self.validator.updated_config)
def test_action_manager_returns_ex_ok_after_action_has_been_completed(self):
manager = ActionManager(config_path="blaap")
ret = manager.execute("list")
self.assertEqual(ret, EX_OK)
def test_action_manager_calls_bring_up_vnet_interfaces_with_start_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("start")
self.bring_up_vnet_interfaces.assert_called_once_with(self.validator.updated_config, sniffer=False)
self.assertFalse(self.bring_down_vnet_interfaces.called)
def test_action_manager_calls_bring_up_vnet_interfaces_with_start_action_and_sniffer(self):
manager = ActionManager(config_path="blaap", sniffer=True)
manager.execute("start")
self.bring_up_vnet_interfaces.assert_called_once_with(self.validator.updated_config, sniffer=True)
def test_action_manager_calls_change_machine_status_with_start_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("start")
self.change_machine_status.assert_called_once_with(self.validator.updated_config, machines=None, status="start")
def test_action_manager_calls_change_machine_status_with_start_action_and_machines(self):
manager = ActionManager(config_path="blaap")
manager.machines = ["machine"]
manager.execute("start")
self.change_machine_status.assert_called_once_with(self.validator.updated_config, machines=["machine"], status="start")
def test_action_manager_calls_change_machine_status_with_stop_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("stop")
self.change_machine_status.assert_called_once_with(self.validator.updated_config, machines=None, status="stop")
def test_action_manager_calls_change_machine_status_with_stop_action_and_machines(self):
manager = ActionManager(config_path="blaap")
manager.machines = ["machine"]
manager.execute("stop")
self.change_machine_status.assert_called_once_with(self.validator.updated_config, machines=["machine"], status="stop")
def test_action_manager_calls_bring_down_vnet_interfaces_with_stop_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("stop")
self.bring_down_vnet_interfaces.assert_called_once_with(self.validator.updated_config)
def test_action_manager_does_not_call_bring_down_vnet_interfaces_with_stop_action_and_machines(self):
manager = ActionManager(config_path="blaap")
manager.machines = ["machine"]
manager.execute("stop")
self.assertFalse(self.bring_down_vnet_interfaces.called)
def test_action_manager_calls_ensure_vnet_lxc_environment_with_create_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("create")
self.ensure_vnet_lxc_environment.assert_called_once_with(self.validator.updated_config)
def test_action_manager_calls_create_machines_with_create_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("create")
self.create_machines.assert_called_once_with(self.validator.updated_config, machines=None)
def test_action_manager_calls_create_machines_with_create_action_and_machines(self):
manager = ActionManager(config_path="blaap")
manager.machines = ["machine"]
manager.execute("create")
self.create_machines.assert_called_once_with(self.validator.updated_config, machines=["machine"])
def test_action_manager_calls_put_files_on_machine_with_create_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("create")
self.put_files_on_machine.assert_called_once_with(self.validator.updated_config)
def test_action_manager_calls_place_vnet_hosts_file_on_machines_with_create_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("create")
self.place_vnet_hosts_file_on_machines.assert_called_once_with(self.validator.updated_config)
def test_action_manager_calls_generate_vnet_hosts_file_with_create_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("create")
self.generate_vnet_hosts_file.assert_called_once_with(self.validator.updated_config)
def test_action_manager_calls_enable_type_specific_machine_configuration(self):
manager = ActionManager(config_path="blaap")
manager.execute("create")
self.enable_type_specific_machine_configuration.assert_called_once_with(self.validator.updated_config)
def test_action_manager_calls_ensure_vnet_lxc_environment_with_create_action_and_nohosts(self):
manager = ActionManager(config_path="blaap", no_hosts=True)
manager.execute("create")
self.ensure_vnet_lxc_environment.assert_called_once_with(self.validator.updated_config)
def test_action_manager_calls_create_machines_with_create_action_and_nohosts(self):
manager = ActionManager(config_path="blaap", no_hosts=True)
manager.execute("create")
self.create_machines.assert_called_once_with(self.validator.updated_config, machines=None)
def test_action_manager_calls_create_machines_with_create_action_and_machines_and_nohosts(self):
manager = ActionManager(config_path="blaap", no_hosts=True)
manager.machines = ["machine"]
manager.execute("create")
self.create_machines.assert_called_once_with(self.validator.updated_config, machines=["machine"])
def test_action_manager_calls_put_files_on_machine_with_create_action_and_nohosts(self):
manager = ActionManager(config_path="blaap", no_hosts=True)
manager.execute("create")
self.put_files_on_machine.assert_called_once_with(self.validator.updated_config)
def test_action_manager_calls_place_vnet_hosts_file_on_machines_with_create_action_and_nohosts(self):
manager = ActionManager(config_path="blaap", no_hosts=True)
manager.execute("create")
self.assertFalse(self.place_vnet_hosts_file_on_machines.called)
def test_action_manager_calls_generate_vnet_hosts_file_with_create_action_and_nohosts(self):
manager = ActionManager(config_path="blaap", no_hosts=True)
manager.execute("create")
self.assertFalse(self.generate_vnet_hosts_file.called)
def test_action_manager_calls_enable_type_specific_machine_configuration_and_nohosts(self):
manager = ActionManager(config_path="blaap", no_hosts=True)
manager.execute("create")
self.enable_type_specific_machine_configuration.assert_called_once_with(self.validator.updated_config)
def test_action_manager_calls_destroy_machines_with_destroy_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("destroy")
self.destroy_machines.assert_called_once_with(self.validator.updated_config, machines=None)
def test_action_manager_calls_cleanup_vnet_lxc_environment_with_clean_action(self):
manager = ActionManager()
manager.execute("clean")
self.cleanup_vnet_lxc_environment.assert_called_once_with()
def test_action_manager_calls_destroy_machines_with_destroy_action_and_machines(self):
manager = ActionManager(config_path="blaap")
manager.machines = ["machine"]
manager.execute("destroy")
self.destroy_machines.assert_called_once_with(self.validator.updated_config, machines=["machine"])
self.assertFalse(self.destroy_lxc_image.called)
def test_action_manager_calls_delete_vnet_interfaces_with_destroy_action(self):
manager = ActionManager(config_path="blaap")
manager.execute("destroy")
self.delete_vnet_interfaces.assert_called_once_with(self.validator.updated_config)
def test_action_manager_does_not_call_delete_vnet_interfaces_with_destroy_action_and_machines(self):
manager = ActionManager(config_path="blaap")
manager.machines = ["machine"]
manager.execute("destroy")
self.assertFalse(self.delete_vnet_interfaces.called)
def test_action_manager_calls_destroy_lxc_image_with_destroy_action_and_base_image(self):
manager = ActionManager(config_path="blaap", base_image=True)
manager.execute("destroy")
self.destroy_lxc_image.assert_called_once_with(settings.LXC_BASE_IMAGE_ALIAS, by_alias=True)
self.assertFalse(self.destroy_machines.called)
def test_action_manager_calls_request_confirmation_with_destroy_action_and_base_image(self):
manager = ActionManager(config_path="blaap", base_image=True)
manager.execute("destroy")
self.request_confirmation.assert_called_once_with(prompt="Are you sure you want to delete the VNet base images (y/n)? ")
def test_action_manager_has_machine_property(self):
manager = ActionManager()
manager.machines = ["1", "2", "3"]
self.assertEqual(manager.machines, ["1", "2", "3"])
self.assertIsInstance(ActionManager.machines, property)
| 55.291262
| 132
| 0.772549
| 2,182
| 17,085
| 5.576994
| 0.069203
| 0.028186
| 0.052346
| 0.078889
| 0.854138
| 0.808037
| 0.78248
| 0.75076
| 0.711727
| 0.671049
| 0
| 0.000751
| 0.142347
| 17,085
| 308
| 133
| 55.470779
| 0.829728
| 0
| 0
| 0.492188
| 0
| 0
| 0.111267
| 0.07012
| 0
| 0
| 0
| 0
| 0.21875
| 1
| 0.195313
| false
| 0
| 0.019531
| 0
| 0.21875
| 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
|
48471e2234ebf5598d41252cff1e6239dd686e29
| 5,106
|
py
|
Python
|
test/kernels/test_additive_kernel.py
|
orionr/gpytorch
|
b31a9907223e7b8793cc179b1d5d9e6fb1128a5b
|
[
"MIT"
] | null | null | null |
test/kernels/test_additive_kernel.py
|
orionr/gpytorch
|
b31a9907223e7b8793cc179b1d5d9e6fb1128a5b
|
[
"MIT"
] | null | null | null |
test/kernels/test_additive_kernel.py
|
orionr/gpytorch
|
b31a9907223e7b8793cc179b1d5d9e6fb1128a5b
|
[
"MIT"
] | 1
|
2018-11-15T10:03:40.000Z
|
2018-11-15T10:03:40.000Z
|
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import math
import torch
import unittest
from gpytorch.kernels import RBFKernel, AdditiveKernel, ProductKernel
class TestAdditiveKernel(unittest.TestCase):
def test_computes_product_of_radial_basis_function(self):
a = torch.Tensor([4, 2, 8]).view(3, 1)
b = torch.Tensor([0, 2]).view(2, 1)
lengthscale = 2
kernel_1 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel_2 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel = kernel_1 * kernel_2
actual = torch.Tensor([[16, 4], [4, 0], [64, 36]]).mul_(-0.5).div_(lengthscale ** 2).exp() ** 2
kernel.eval()
res = kernel(a, b).evaluate()
self.assertLess(torch.norm(res - actual), 2e-5)
def test_computes_sum_of_radial_basis_function(self):
a = torch.Tensor([4, 2, 8]).view(3, 1)
b = torch.Tensor([0, 2]).view(2, 1)
lengthscale = 2
kernel_1 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel_2 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel = kernel_1 + kernel_2
actual = torch.Tensor([[16, 4], [4, 0], [64, 36]]).mul_(-0.5).div_(lengthscale ** 2).exp() * 2
kernel.eval()
res = kernel(a, b).evaluate()
self.assertLess(torch.norm(res - actual), 2e-5)
def test_computes_product_of_three_radial_basis_function(self):
a = torch.Tensor([4, 2, 8]).view(3, 1)
b = torch.Tensor([0, 2]).view(2, 1)
lengthscale = 2
kernel_1 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel_2 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel_3 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel = ProductKernel(kernel_1, kernel_2, kernel_3)
actual = torch.Tensor([[16, 4], [4, 0], [64, 36]]).mul_(-0.5).div_(lengthscale ** 2).exp() ** 3
kernel.eval()
res = kernel(a, b).evaluate()
self.assertLess(torch.norm(res - actual), 2e-5)
def test_computes_sum_of_three_radial_basis_function(self):
a = torch.Tensor([4, 2, 8]).view(3, 1)
b = torch.Tensor([0, 2]).view(2, 1)
lengthscale = 2
kernel_1 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel_2 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel_3 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel = AdditiveKernel(kernel_1, kernel_2, kernel_3)
actual = torch.Tensor([[16, 4], [4, 0], [64, 36]]).mul_(-0.5).div_(lengthscale ** 2).exp() * 3
kernel.eval()
res = kernel(a, b).evaluate()
self.assertLess(torch.norm(res - actual), 2e-5)
def test_computes_sum_radial_basis_function_gradient(self):
a = torch.Tensor([4, 2, 8]).view(3, 1)
b = torch.Tensor([0, 2, 2]).view(3, 1)
lengthscale = 2
param = math.log(lengthscale) * torch.ones(3, 3)
param.requires_grad_()
diffs = a.expand(3, 3) - b.expand(3, 3).transpose(0, 1)
actual_output = (-0.5 * (diffs / param.exp()) ** 2).exp()
actual_output.backward(torch.eye(3))
actual_param_grad = param.grad.sum() * 2
kernel_1 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel_2 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel = kernel_1 + kernel_2
kernel.eval()
output = kernel(a, b).evaluate()
output.backward(gradient=torch.eye(3))
res = kernel.kernels[0].log_lengthscale.grad + kernel.kernels[1].log_lengthscale.grad
self.assertLess(torch.norm(res - actual_param_grad), 2e-5)
def test_computes_sum_three_radial_basis_function_gradient(self):
a = torch.Tensor([4, 2, 8]).view(3, 1)
b = torch.Tensor([0, 2, 2]).view(3, 1)
lengthscale = 2
param = math.log(lengthscale) * torch.ones(3, 3)
param.requires_grad_()
diffs = a.expand(3, 3) - b.expand(3, 3).transpose(0, 1)
actual_output = (-0.5 * (diffs / param.exp()) ** 2).exp()
actual_output.backward(torch.eye(3))
actual_param_grad = param.grad.sum() * 3
kernel_1 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel_2 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel_3 = RBFKernel().initialize(log_lengthscale=math.log(lengthscale))
kernel = AdditiveKernel(kernel_1, kernel_2, kernel_3)
kernel.eval()
output = kernel(a, b).evaluate()
output.backward(gradient=torch.eye(3))
res = (
kernel.kernels[0].log_lengthscale.grad
+ kernel.kernels[1].log_lengthscale.grad
+ kernel.kernels[2].log_lengthscale.grad
)
self.assertLess(torch.norm(res - actual_param_grad), 2e-5)
if __name__ == "__main__":
unittest.main()
| 40.204724
| 103
| 0.638073
| 684
| 5,106
| 4.55848
| 0.105263
| 0.166132
| 0.09814
| 0.158756
| 0.906671
| 0.893201
| 0.887428
| 0.887428
| 0.887428
| 0.887428
| 0
| 0.047203
| 0.215825
| 5,106
| 126
| 104
| 40.52381
| 0.731518
| 0
| 0
| 0.683673
| 0
| 0
| 0.001567
| 0
| 0
| 0
| 0
| 0
| 0.061224
| 1
| 0.061224
| false
| 0
| 0.081633
| 0
| 0.153061
| 0.010204
| 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
|
4856b69b5f7d69bf000748482fefc47e10865c3b
| 30
|
py
|
Python
|
rlberry/agents/mbqvi/__init__.py
|
riccardodv/rlberry
|
8bb03772cda1e13c57de0e1da7bc7356a3014cfb
|
[
"MIT"
] | 86
|
2020-11-20T21:02:27.000Z
|
2022-03-07T14:57:40.000Z
|
rlberry/agents/mbqvi/__init__.py
|
riccardodv/rlberry
|
8bb03772cda1e13c57de0e1da7bc7356a3014cfb
|
[
"MIT"
] | 103
|
2020-11-17T12:31:21.000Z
|
2022-03-28T13:46:16.000Z
|
rlberry/agents/mbqvi/__init__.py
|
riccardodv/rlberry
|
8bb03772cda1e13c57de0e1da7bc7356a3014cfb
|
[
"MIT"
] | 20
|
2020-11-23T01:47:50.000Z
|
2022-03-25T07:45:24.000Z
|
from .mbqvi import MBQVIAgent
| 15
| 29
| 0.833333
| 4
| 30
| 6.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 30
| 1
| 30
| 30
| 0.961538
| 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
|
6f845b6fff3cfe82d2a824bfda3f99385128dd2f
| 6,293
|
py
|
Python
|
nova/tests/functional/db/test_compute_node.py
|
ebalduf/nova-backports
|
6bf97ec73467de522d34ab7a17ca0e0874baa7f9
|
[
"Apache-2.0"
] | null | null | null |
nova/tests/functional/db/test_compute_node.py
|
ebalduf/nova-backports
|
6bf97ec73467de522d34ab7a17ca0e0874baa7f9
|
[
"Apache-2.0"
] | null | null | null |
nova/tests/functional/db/test_compute_node.py
|
ebalduf/nova-backports
|
6bf97ec73467de522d34ab7a17ca0e0874baa7f9
|
[
"Apache-2.0"
] | 1
|
2020-07-24T01:18:44.000Z
|
2020-07-24T01:18:44.000Z
|
# 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 mock
from nova import context
from nova import db
from nova import objects
from nova.objects import fields
from nova import test
class ComputeNodeTestCase(test.TestCase):
def setUp(self):
super(ComputeNodeTestCase, self).setUp()
self.context = context.RequestContext('fake-user', 'fake-project')
self.cn = objects.ComputeNode(context=self.context,
memory_mb=512, local_gb=1000, vcpus=8,
vcpus_used=0, local_gb_used=0,
memory_mb_used=0, free_ram_mb=0,
free_disk_gb=0, hypervisor_type='danvm',
hypervisor_version=1, cpu_info='barf',
cpu_allocation_ratio=1.0,
ram_allocation_ratio=1.0,
disk_allocation_ratio=1.0)
@mock.patch('nova.objects.Service.get_minimum_version_multi')
def test_create_creates_inventories(self, mock_minver):
mock_minver.return_value = 10
self.cn.create()
self.assertEqual(512, self.cn.memory_mb)
self.assertEqual(1000, self.cn.local_gb)
self.assertEqual(8, self.cn.vcpus)
db_cn = db.compute_node_get(self.context, self.cn.id)
self.assertEqual(0, db_cn['memory_mb'])
self.assertEqual(0, db_cn['local_gb'])
self.assertEqual(0, db_cn['vcpus'])
inventories = objects.InventoryList.get_all_by_resource_provider_uuid(
self.context, self.cn.uuid)
self.assertEqual(3, len(inventories))
inv = {i.resource_class: i.total for i in inventories}
expected = {
fields.ResourceClass.DISK_GB: 1000,
fields.ResourceClass.MEMORY_MB: 512,
fields.ResourceClass.VCPU: 8,
}
self.assertEqual(expected, inv)
@mock.patch('nova.objects.Service.get_minimum_version_multi')
def test_save_updates_inventories(self, mock_minver):
mock_minver.return_value = 10
self.cn.create()
self.cn.memory_mb = 2048
self.cn.local_gb = 2000
self.cn.save()
self.assertEqual(2048, self.cn.memory_mb)
self.assertEqual(2000, self.cn.local_gb)
self.assertEqual(8, self.cn.vcpus)
db_cn = db.compute_node_get(self.context, self.cn.id)
self.assertEqual(0, db_cn['memory_mb'])
self.assertEqual(0, db_cn['local_gb'])
self.assertEqual(0, db_cn['vcpus'])
inventories = objects.InventoryList.get_all_by_resource_provider_uuid(
self.context, self.cn.uuid)
self.assertEqual(3, len(inventories))
inv = {i.resource_class: i.total for i in inventories}
expected = {
fields.ResourceClass.DISK_GB: 2000,
fields.ResourceClass.MEMORY_MB: 2048,
fields.ResourceClass.VCPU: 8,
}
self.assertEqual(expected, inv)
@mock.patch('nova.objects.Service.get_minimum_version_multi')
def test_save_creates_inventories(self, mock_minver):
mock_minver.return_value = 7
self.cn.create()
inventories = objects.InventoryList.get_all_by_resource_provider_uuid(
self.context, self.cn.uuid)
self.assertEqual(0, len(inventories))
mock_minver.return_value = 10
self.cn.memory_mb = 2048
self.cn.local_gb = 2000
self.cn.save()
self.assertEqual(2048, self.cn.memory_mb)
self.assertEqual(2000, self.cn.local_gb)
self.assertEqual(8, self.cn.vcpus)
db_cn = db.compute_node_get(self.context, self.cn.id)
self.assertEqual(0, db_cn['memory_mb'])
self.assertEqual(0, db_cn['local_gb'])
self.assertEqual(0, db_cn['vcpus'])
inventories = objects.InventoryList.get_all_by_resource_provider_uuid(
self.context, self.cn.uuid)
self.assertEqual(3, len(inventories))
inv = {i.resource_class: i.total for i in inventories}
expected = {
fields.ResourceClass.DISK_GB: 2000,
fields.ResourceClass.MEMORY_MB: 2048,
fields.ResourceClass.VCPU: 8,
}
self.assertEqual(expected, inv)
@mock.patch('nova.objects.Service.get_minimum_version_multi')
def test_create_honors_version(self, mock_minver):
mock_minver.return_value = 7
self.cn.create()
self.assertEqual(512, self.cn.memory_mb)
self.assertEqual(1000, self.cn.local_gb)
self.assertEqual(8, self.cn.vcpus)
db_cn = db.compute_node_get(self.context, self.cn.id)
self.assertEqual(512, db_cn['memory_mb'])
self.assertEqual(1000, db_cn['local_gb'])
self.assertEqual(8, db_cn['vcpus'])
inventories = objects.InventoryList.get_all_by_resource_provider_uuid(
self.context, self.cn.uuid)
self.assertEqual(0, len(inventories))
@mock.patch('nova.objects.Service.get_minimum_version_multi')
def test_save_honors_version(self, mock_minver):
mock_minver.return_value = 7
self.cn.create()
self.cn.memory_mb = 2048
self.cn.local_gb = 2000
self.cn.save()
self.assertEqual(2048, self.cn.memory_mb)
self.assertEqual(2000, self.cn.local_gb)
self.assertEqual(8, self.cn.vcpus)
db_cn = db.compute_node_get(self.context, self.cn.id)
self.assertEqual(2048, db_cn['memory_mb'])
self.assertEqual(2000, db_cn['local_gb'])
self.assertEqual(8, db_cn['vcpus'])
inventories = objects.InventoryList.get_all_by_resource_provider_uuid(
self.context, self.cn.uuid)
self.assertEqual(0, len(inventories))
| 43.701389
| 78
| 0.641824
| 811
| 6,293
| 4.780518
| 0.168927
| 0.063451
| 0.033531
| 0.048233
| 0.756513
| 0.756513
| 0.740521
| 0.73562
| 0.73562
| 0.729172
| 0
| 0.033732
| 0.255681
| 6,293
| 143
| 79
| 44.006993
| 0.79398
| 0.086763
| 0
| 0.731707
| 0
| 0
| 0.06455
| 0.040126
| 0
| 0
| 0
| 0
| 0.317073
| 1
| 0.04878
| false
| 0
| 0.04878
| 0
| 0.105691
| 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
|
6f862b892b72cd31dc5a05670b3ad49bd3cc617e
| 278
|
py
|
Python
|
parser/parser/data_collection/ok_spider.py
|
MADE-realtime/realtime_news
|
0a63687cad0ccefd772b2c28d7138d8db52d5f20
|
[
"MIT"
] | null | null | null |
parser/parser/data_collection/ok_spider.py
|
MADE-realtime/realtime_news
|
0a63687cad0ccefd772b2c28d7138d8db52d5f20
|
[
"MIT"
] | null | null | null |
parser/parser/data_collection/ok_spider.py
|
MADE-realtime/realtime_news
|
0a63687cad0ccefd772b2c28d7138d8db52d5f20
|
[
"MIT"
] | null | null | null |
"""
Application ID: 512001308941.
Публичный ключ приложения: COAKPIKGDIHBABABA.
Секретный ключ приложения: 95C3FB547F430B544E82D448.
Вечный session_key:tkn14YgWQ279xMzvjdfJtJuRajPvJtttKSCdawotwIt7ECm6L0PzFZLqwEpBQVe3xGYr7
Session_secret_key:b2208fc58999b290093183f6fdfa6804
"""
| 39.714286
| 88
| 0.892086
| 19
| 278
| 12.894737
| 0.789474
| 0.114286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.236641
| 0.057554
| 278
| 7
| 89
| 39.714286
| 0.698473
| 0.971223
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
6facafcb5a0d62cd58a446a3a414c19dcb549cf6
| 523
|
py
|
Python
|
Python/OOP/game2/monsters.py
|
sug5806/TIL
|
2309d8a270e4a7b8961268a40b6492c5db317e37
|
[
"MIT"
] | null | null | null |
Python/OOP/game2/monsters.py
|
sug5806/TIL
|
2309d8a270e4a7b8961268a40b6492c5db317e37
|
[
"MIT"
] | 102
|
2020-02-12T00:10:33.000Z
|
2022-03-11T23:58:41.000Z
|
Python/OOP/game2/monsters.py
|
sug5806/TIL
|
2309d8a270e4a7b8961268a40b6492c5db317e37
|
[
"MIT"
] | null | null | null |
from character import Monster
# 게임 개발 초기의 몬스터 종류는 두 가지
class FireMonster(Monster):
def generate_gold(self):
return 10
class IceMonster(Monster):
def __init__(self):
super().__init__()
self.hp=100
def generate_gold(self):
return 20
# 게임 규모가 커지면서 추가된 몬스터
class StoneMonster(Monster):
def generate_gold(self):
return 0
class KungfuMonster(Monster):
def generate_gold(self):
return 1000
# 추가 확장 클래스
# 몬스터 종류가 늘면 이 아래에 추가 하세요.
| 19.37037
| 30
| 0.621415
| 70
| 523
| 4.471429
| 0.571429
| 0.127796
| 0.191693
| 0.242812
| 0.386581
| 0.306709
| 0
| 0
| 0
| 0
| 0
| 0.032967
| 0.304015
| 523
| 27
| 31
| 19.37037
| 0.826923
| 0.14914
| 0
| 0.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.3125
| false
| 0
| 0.0625
| 0.25
| 0.875
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 6
|
6fb2a27e0549165b7efae6ef04d932aa7bcab73e
| 50,327
|
py
|
Python
|
pybind/slxos/v17r_2_00/interface_vlan/vlan/ipv6/mldVlan/snooping/__init__.py
|
extremenetworks/pybind
|
44c467e71b2b425be63867aba6e6fa28b2cfe7fb
|
[
"Apache-2.0"
] | null | null | null |
pybind/slxos/v17r_2_00/interface_vlan/vlan/ipv6/mldVlan/snooping/__init__.py
|
extremenetworks/pybind
|
44c467e71b2b425be63867aba6e6fa28b2cfe7fb
|
[
"Apache-2.0"
] | null | null | null |
pybind/slxos/v17r_2_00/interface_vlan/vlan/ipv6/mldVlan/snooping/__init__.py
|
extremenetworks/pybind
|
44c467e71b2b425be63867aba6e6fa28b2cfe7fb
|
[
"Apache-2.0"
] | 1
|
2021-11-05T22:15:42.000Z
|
2021-11-05T22:15:42.000Z
|
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitarray
import __builtin__
import querier
import mrouter
import static_group
class snooping(PybindBase):
"""
This class was auto-generated by the PythonClass plugin for PYANG
from YANG module brocade-interface - based on the path /interface-vlan/vlan/ipv6/mldVlan/snooping. Each member element of
the container is represented as a class variable - with a specific
YANG type.
"""
__slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__last_member_query_interval','__last_member_query_count','__startup_query_interval','__startup_query_count','__query_max_response_time','__query_interval','__mldVersion','__enable','__fast_leave','__robustness_variable','__querier','__mrouter','__static_group',)
_yang_name = 'snooping'
_rest_name = 'snooping'
_pybind_generated_by = 'container'
def __init__(self, *args, **kwargs):
path_helper_ = kwargs.pop("path_helper", None)
if path_helper_ is False:
self._path_helper = False
elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper):
self._path_helper = path_helper_
elif hasattr(self, "_parent"):
path_helper_ = getattr(self._parent, "_path_helper", False)
self._path_helper = path_helper_
else:
self._path_helper = False
extmethods = kwargs.pop("extmethods", None)
if extmethods is False:
self._extmethods = False
elif extmethods is not None and isinstance(extmethods, dict):
self._extmethods = extmethods
elif hasattr(self, "_parent"):
extmethods = getattr(self._parent, "_extmethods", None)
self._extmethods = extmethods
else:
self._extmethods = False
self.__startup_query_interval = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..450']}), is_leaf=True, yang_name="startup-query-interval", rest_name="startup-query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Startup Query Interval', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='sqi-type', is_config=True)
self.__last_member_query_interval = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'100..25500']}), is_leaf=True, yang_name="last-member-query-interval", rest_name="last-member-query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Last Member Query Interval', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='lmqt-type', is_config=True)
self.__enable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enable", rest_name="enable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLDS Enable', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='empty', is_config=True)
self.__mrouter = YANGDynClass(base=mrouter.mrouter, is_container='container', presence=False, yang_name="mrouter", rest_name="mrouter", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Multicast Router', u'callpoint': u'MldsMrtrVlan', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='container', is_config=True)
self.__robustness_variable = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2..10']}), is_leaf=True, yang_name="robustness-variable", rest_name="robustness-variable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Robustness Variable', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='rob-type', is_config=True)
self.__startup_query_count = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..10']}), is_leaf=True, yang_name="startup-query-count", rest_name="startup-query-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Startup Query Count', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='sqc-type', is_config=True)
self.__query_max_response_time = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..25']}), is_leaf=True, yang_name="query-max-response-time", rest_name="query-max-response-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLDS Max Query Response Time', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='qmrt-type', is_config=True)
self.__mldVersion = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..2']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(1), is_leaf=True, yang_name="mldVersion", rest_name="version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLD Version [1|2]', u'cli-full-command': None, u'alt-name': u'version'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='version-type', is_config=True)
self.__querier = YANGDynClass(base=querier.querier, is_container='container', presence=False, yang_name="querier", rest_name="querier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Querier', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='container', is_config=True)
self.__fast_leave = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fast-leave", rest_name="fast-leave", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Fast Leave Processing', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='empty', is_config=True)
self.__query_interval = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..18000']}), is_leaf=True, yang_name="query-interval", rest_name="query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Query Interval', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='qi-type', is_config=True)
self.__last_member_query_count = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2..10']}), is_leaf=True, yang_name="last-member-query-count", rest_name="last-member-query-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Last Member Query Count', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='lmqc-type', is_config=True)
self.__static_group = YANGDynClass(base=YANGListType("mcast_address interface if_type value",static_group.static_group, yang_name="static-group", rest_name="static-group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='mcast-address interface if-type value', extensions={u'tailf-common': {u'info': u'Static Group to be Joined', u'cli-suppress-mode': None, u'callpoint': u'MldsSgVlan', u'cli-suppress-list-no': None}}), is_container='list', yang_name="static-group", rest_name="static-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Static Group to be Joined', u'cli-suppress-mode': None, u'callpoint': u'MldsSgVlan', u'cli-suppress-list-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='list', is_config=True)
load = kwargs.pop("load", None)
if args:
if len(args) > 1:
raise TypeError("cannot create a YANG container with >1 argument")
all_attr = True
for e in self._pyangbind_elements:
if not hasattr(args[0], e):
all_attr = False
break
if not all_attr:
raise ValueError("Supplied object did not have the correct attributes")
for e in self._pyangbind_elements:
nobj = getattr(args[0], e)
if nobj._changed() is False:
continue
setmethod = getattr(self, "_set_%s" % e)
if load is None:
setmethod(getattr(args[0], e))
else:
setmethod(getattr(args[0], e), load=load)
def _path(self):
if hasattr(self, "_parent"):
return self._parent._path()+[self._yang_name]
else:
return [u'interface-vlan', u'vlan', u'ipv6', u'mldVlan', u'snooping']
def _rest_path(self):
if hasattr(self, "_parent"):
if self._rest_name:
return self._parent._rest_path()+[self._rest_name]
else:
return self._parent._rest_path()
else:
return [u'vlan', u'ipv6', u'mld', u'snooping']
def _get_last_member_query_interval(self):
"""
Getter method for last_member_query_interval, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/last_member_query_interval (lmqt-type)
"""
return self.__last_member_query_interval
def _set_last_member_query_interval(self, v, load=False):
"""
Setter method for last_member_query_interval, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/last_member_query_interval (lmqt-type)
If this variable is read-only (config: false) in the
source YANG file, then _set_last_member_query_interval is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_last_member_query_interval() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'100..25500']}), is_leaf=True, yang_name="last-member-query-interval", rest_name="last-member-query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Last Member Query Interval', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='lmqt-type', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """last_member_query_interval must be of a type compatible with lmqt-type""",
'defined-type': "brocade-mld-snooping:lmqt-type",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'100..25500']}), is_leaf=True, yang_name="last-member-query-interval", rest_name="last-member-query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Last Member Query Interval', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='lmqt-type', is_config=True)""",
})
self.__last_member_query_interval = t
if hasattr(self, '_set'):
self._set()
def _unset_last_member_query_interval(self):
self.__last_member_query_interval = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'100..25500']}), is_leaf=True, yang_name="last-member-query-interval", rest_name="last-member-query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Last Member Query Interval', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='lmqt-type', is_config=True)
def _get_last_member_query_count(self):
"""
Getter method for last_member_query_count, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/last_member_query_count (lmqc-type)
"""
return self.__last_member_query_count
def _set_last_member_query_count(self, v, load=False):
"""
Setter method for last_member_query_count, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/last_member_query_count (lmqc-type)
If this variable is read-only (config: false) in the
source YANG file, then _set_last_member_query_count is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_last_member_query_count() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2..10']}), is_leaf=True, yang_name="last-member-query-count", rest_name="last-member-query-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Last Member Query Count', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='lmqc-type', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """last_member_query_count must be of a type compatible with lmqc-type""",
'defined-type': "brocade-mld-snooping:lmqc-type",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2..10']}), is_leaf=True, yang_name="last-member-query-count", rest_name="last-member-query-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Last Member Query Count', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='lmqc-type', is_config=True)""",
})
self.__last_member_query_count = t
if hasattr(self, '_set'):
self._set()
def _unset_last_member_query_count(self):
self.__last_member_query_count = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2..10']}), is_leaf=True, yang_name="last-member-query-count", rest_name="last-member-query-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Last Member Query Count', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='lmqc-type', is_config=True)
def _get_startup_query_interval(self):
"""
Getter method for startup_query_interval, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/startup_query_interval (sqi-type)
"""
return self.__startup_query_interval
def _set_startup_query_interval(self, v, load=False):
"""
Setter method for startup_query_interval, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/startup_query_interval (sqi-type)
If this variable is read-only (config: false) in the
source YANG file, then _set_startup_query_interval is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_startup_query_interval() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..450']}), is_leaf=True, yang_name="startup-query-interval", rest_name="startup-query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Startup Query Interval', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='sqi-type', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """startup_query_interval must be of a type compatible with sqi-type""",
'defined-type': "brocade-mld-snooping:sqi-type",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..450']}), is_leaf=True, yang_name="startup-query-interval", rest_name="startup-query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Startup Query Interval', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='sqi-type', is_config=True)""",
})
self.__startup_query_interval = t
if hasattr(self, '_set'):
self._set()
def _unset_startup_query_interval(self):
self.__startup_query_interval = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..450']}), is_leaf=True, yang_name="startup-query-interval", rest_name="startup-query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Startup Query Interval', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='sqi-type', is_config=True)
def _get_startup_query_count(self):
"""
Getter method for startup_query_count, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/startup_query_count (sqc-type)
"""
return self.__startup_query_count
def _set_startup_query_count(self, v, load=False):
"""
Setter method for startup_query_count, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/startup_query_count (sqc-type)
If this variable is read-only (config: false) in the
source YANG file, then _set_startup_query_count is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_startup_query_count() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..10']}), is_leaf=True, yang_name="startup-query-count", rest_name="startup-query-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Startup Query Count', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='sqc-type', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """startup_query_count must be of a type compatible with sqc-type""",
'defined-type': "brocade-mld-snooping:sqc-type",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..10']}), is_leaf=True, yang_name="startup-query-count", rest_name="startup-query-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Startup Query Count', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='sqc-type', is_config=True)""",
})
self.__startup_query_count = t
if hasattr(self, '_set'):
self._set()
def _unset_startup_query_count(self):
self.__startup_query_count = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..10']}), is_leaf=True, yang_name="startup-query-count", rest_name="startup-query-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Startup Query Count', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='sqc-type', is_config=True)
def _get_query_max_response_time(self):
"""
Getter method for query_max_response_time, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/query_max_response_time (qmrt-type)
"""
return self.__query_max_response_time
def _set_query_max_response_time(self, v, load=False):
"""
Setter method for query_max_response_time, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/query_max_response_time (qmrt-type)
If this variable is read-only (config: false) in the
source YANG file, then _set_query_max_response_time is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_query_max_response_time() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..25']}), is_leaf=True, yang_name="query-max-response-time", rest_name="query-max-response-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLDS Max Query Response Time', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='qmrt-type', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """query_max_response_time must be of a type compatible with qmrt-type""",
'defined-type': "brocade-mld-snooping:qmrt-type",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..25']}), is_leaf=True, yang_name="query-max-response-time", rest_name="query-max-response-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLDS Max Query Response Time', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='qmrt-type', is_config=True)""",
})
self.__query_max_response_time = t
if hasattr(self, '_set'):
self._set()
def _unset_query_max_response_time(self):
self.__query_max_response_time = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..25']}), is_leaf=True, yang_name="query-max-response-time", rest_name="query-max-response-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLDS Max Query Response Time', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='qmrt-type', is_config=True)
def _get_query_interval(self):
"""
Getter method for query_interval, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/query_interval (qi-type)
"""
return self.__query_interval
def _set_query_interval(self, v, load=False):
"""
Setter method for query_interval, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/query_interval (qi-type)
If this variable is read-only (config: false) in the
source YANG file, then _set_query_interval is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_query_interval() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..18000']}), is_leaf=True, yang_name="query-interval", rest_name="query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Query Interval', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='qi-type', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """query_interval must be of a type compatible with qi-type""",
'defined-type': "brocade-mld-snooping:qi-type",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..18000']}), is_leaf=True, yang_name="query-interval", rest_name="query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Query Interval', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='qi-type', is_config=True)""",
})
self.__query_interval = t
if hasattr(self, '_set'):
self._set()
def _unset_query_interval(self):
self.__query_interval = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..18000']}), is_leaf=True, yang_name="query-interval", rest_name="query-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Query Interval', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='qi-type', is_config=True)
def _get_mldVersion(self):
"""
Getter method for mldVersion, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/mldVersion (version-type)
"""
return self.__mldVersion
def _set_mldVersion(self, v, load=False):
"""
Setter method for mldVersion, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/mldVersion (version-type)
If this variable is read-only (config: false) in the
source YANG file, then _set_mldVersion is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_mldVersion() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..2']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(1), is_leaf=True, yang_name="mldVersion", rest_name="version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLD Version [1|2]', u'cli-full-command': None, u'alt-name': u'version'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='version-type', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """mldVersion must be of a type compatible with version-type""",
'defined-type': "brocade-mld-snooping:version-type",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..2']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(1), is_leaf=True, yang_name="mldVersion", rest_name="version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLD Version [1|2]', u'cli-full-command': None, u'alt-name': u'version'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='version-type', is_config=True)""",
})
self.__mldVersion = t
if hasattr(self, '_set'):
self._set()
def _unset_mldVersion(self):
self.__mldVersion = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..2']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(1), is_leaf=True, yang_name="mldVersion", rest_name="version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLD Version [1|2]', u'cli-full-command': None, u'alt-name': u'version'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='version-type', is_config=True)
def _get_enable(self):
"""
Getter method for enable, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/enable (empty)
"""
return self.__enable
def _set_enable(self, v, load=False):
"""
Setter method for enable, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/enable (empty)
If this variable is read-only (config: false) in the
source YANG file, then _set_enable is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_enable() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enable", rest_name="enable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLDS Enable', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='empty', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """enable must be of a type compatible with empty""",
'defined-type': "empty",
'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enable", rest_name="enable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLDS Enable', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='empty', is_config=True)""",
})
self.__enable = t
if hasattr(self, '_set'):
self._set()
def _unset_enable(self):
self.__enable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enable", rest_name="enable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'MLDS Enable', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='empty', is_config=True)
def _get_fast_leave(self):
"""
Getter method for fast_leave, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/fast_leave (empty)
"""
return self.__fast_leave
def _set_fast_leave(self, v, load=False):
"""
Setter method for fast_leave, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/fast_leave (empty)
If this variable is read-only (config: false) in the
source YANG file, then _set_fast_leave is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_fast_leave() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="fast-leave", rest_name="fast-leave", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Fast Leave Processing', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='empty', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """fast_leave must be of a type compatible with empty""",
'defined-type': "empty",
'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fast-leave", rest_name="fast-leave", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Fast Leave Processing', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='empty', is_config=True)""",
})
self.__fast_leave = t
if hasattr(self, '_set'):
self._set()
def _unset_fast_leave(self):
self.__fast_leave = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fast-leave", rest_name="fast-leave", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Fast Leave Processing', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='empty', is_config=True)
def _get_robustness_variable(self):
"""
Getter method for robustness_variable, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/robustness_variable (rob-type)
"""
return self.__robustness_variable
def _set_robustness_variable(self, v, load=False):
"""
Setter method for robustness_variable, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/robustness_variable (rob-type)
If this variable is read-only (config: false) in the
source YANG file, then _set_robustness_variable is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_robustness_variable() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2..10']}), is_leaf=True, yang_name="robustness-variable", rest_name="robustness-variable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Robustness Variable', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='rob-type', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """robustness_variable must be of a type compatible with rob-type""",
'defined-type': "brocade-mld-snooping:rob-type",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2..10']}), is_leaf=True, yang_name="robustness-variable", rest_name="robustness-variable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Robustness Variable', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='rob-type', is_config=True)""",
})
self.__robustness_variable = t
if hasattr(self, '_set'):
self._set()
def _unset_robustness_variable(self):
self.__robustness_variable = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2..10']}), is_leaf=True, yang_name="robustness-variable", rest_name="robustness-variable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Robustness Variable', u'cli-full-command': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='rob-type', is_config=True)
def _get_querier(self):
"""
Getter method for querier, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/querier (container)
"""
return self.__querier
def _set_querier(self, v, load=False):
"""
Setter method for querier, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/querier (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_querier is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_querier() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=querier.querier, is_container='container', presence=False, yang_name="querier", rest_name="querier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Querier', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='container', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """querier must be of a type compatible with container""",
'defined-type': "container",
'generated-type': """YANGDynClass(base=querier.querier, is_container='container', presence=False, yang_name="querier", rest_name="querier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Querier', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='container', is_config=True)""",
})
self.__querier = t
if hasattr(self, '_set'):
self._set()
def _unset_querier(self):
self.__querier = YANGDynClass(base=querier.querier, is_container='container', presence=False, yang_name="querier", rest_name="querier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Querier', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='container', is_config=True)
def _get_mrouter(self):
"""
Getter method for mrouter, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/mrouter (container)
"""
return self.__mrouter
def _set_mrouter(self, v, load=False):
"""
Setter method for mrouter, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/mrouter (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_mrouter is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_mrouter() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=mrouter.mrouter, is_container='container', presence=False, yang_name="mrouter", rest_name="mrouter", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Multicast Router', u'callpoint': u'MldsMrtrVlan', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='container', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """mrouter must be of a type compatible with container""",
'defined-type': "container",
'generated-type': """YANGDynClass(base=mrouter.mrouter, is_container='container', presence=False, yang_name="mrouter", rest_name="mrouter", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Multicast Router', u'callpoint': u'MldsMrtrVlan', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='container', is_config=True)""",
})
self.__mrouter = t
if hasattr(self, '_set'):
self._set()
def _unset_mrouter(self):
self.__mrouter = YANGDynClass(base=mrouter.mrouter, is_container='container', presence=False, yang_name="mrouter", rest_name="mrouter", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Multicast Router', u'callpoint': u'MldsMrtrVlan', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='container', is_config=True)
def _get_static_group(self):
"""
Getter method for static_group, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/static_group (list)
"""
return self.__static_group
def _set_static_group(self, v, load=False):
"""
Setter method for static_group, mapped from YANG variable /interface_vlan/vlan/ipv6/mldVlan/snooping/static_group (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_static_group is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_static_group() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGListType("mcast_address interface if_type value",static_group.static_group, yang_name="static-group", rest_name="static-group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='mcast-address interface if-type value', extensions={u'tailf-common': {u'info': u'Static Group to be Joined', u'cli-suppress-mode': None, u'callpoint': u'MldsSgVlan', u'cli-suppress-list-no': None}}), is_container='list', yang_name="static-group", rest_name="static-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Static Group to be Joined', u'cli-suppress-mode': None, u'callpoint': u'MldsSgVlan', u'cli-suppress-list-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='list', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """static_group must be of a type compatible with list""",
'defined-type': "list",
'generated-type': """YANGDynClass(base=YANGListType("mcast_address interface if_type value",static_group.static_group, yang_name="static-group", rest_name="static-group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='mcast-address interface if-type value', extensions={u'tailf-common': {u'info': u'Static Group to be Joined', u'cli-suppress-mode': None, u'callpoint': u'MldsSgVlan', u'cli-suppress-list-no': None}}), is_container='list', yang_name="static-group", rest_name="static-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Static Group to be Joined', u'cli-suppress-mode': None, u'callpoint': u'MldsSgVlan', u'cli-suppress-list-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='list', is_config=True)""",
})
self.__static_group = t
if hasattr(self, '_set'):
self._set()
def _unset_static_group(self):
self.__static_group = YANGDynClass(base=YANGListType("mcast_address interface if_type value",static_group.static_group, yang_name="static-group", rest_name="static-group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='mcast-address interface if-type value', extensions={u'tailf-common': {u'info': u'Static Group to be Joined', u'cli-suppress-mode': None, u'callpoint': u'MldsSgVlan', u'cli-suppress-list-no': None}}), is_container='list', yang_name="static-group", rest_name="static-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Static Group to be Joined', u'cli-suppress-mode': None, u'callpoint': u'MldsSgVlan', u'cli-suppress-list-no': None}}, namespace='urn:brocade.com:mgmt:brocade-mld-snooping', defining_module='brocade-mld-snooping', yang_type='list', is_config=True)
last_member_query_interval = __builtin__.property(_get_last_member_query_interval, _set_last_member_query_interval)
last_member_query_count = __builtin__.property(_get_last_member_query_count, _set_last_member_query_count)
startup_query_interval = __builtin__.property(_get_startup_query_interval, _set_startup_query_interval)
startup_query_count = __builtin__.property(_get_startup_query_count, _set_startup_query_count)
query_max_response_time = __builtin__.property(_get_query_max_response_time, _set_query_max_response_time)
query_interval = __builtin__.property(_get_query_interval, _set_query_interval)
mldVersion = __builtin__.property(_get_mldVersion, _set_mldVersion)
enable = __builtin__.property(_get_enable, _set_enable)
fast_leave = __builtin__.property(_get_fast_leave, _set_fast_leave)
robustness_variable = __builtin__.property(_get_robustness_variable, _set_robustness_variable)
querier = __builtin__.property(_get_querier, _set_querier)
mrouter = __builtin__.property(_get_mrouter, _set_mrouter)
static_group = __builtin__.property(_get_static_group, _set_static_group)
_pyangbind_elements = {'last_member_query_interval': last_member_query_interval, 'last_member_query_count': last_member_query_count, 'startup_query_interval': startup_query_interval, 'startup_query_count': startup_query_count, 'query_max_response_time': query_max_response_time, 'query_interval': query_interval, 'mldVersion': mldVersion, 'enable': enable, 'fast_leave': fast_leave, 'robustness_variable': robustness_variable, 'querier': querier, 'mrouter': mrouter, 'static_group': static_group, }
| 92.173993
| 935
| 0.746379
| 6,983
| 50,327
| 5.140198
| 0.032508
| 0.035103
| 0.043684
| 0.028083
| 0.91383
| 0.894857
| 0.87243
| 0.86137
| 0.854572
| 0.836296
| 0
| 0.014321
| 0.107855
| 50,327
| 545
| 936
| 92.343119
| 0.785118
| 0.135474
| 0
| 0.465257
| 0
| 0.039275
| 0.408697
| 0.175192
| 0
| 0
| 0
| 0
| 0
| 1
| 0.126888
| false
| 0
| 0.033233
| 0
| 0.271903
| 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
|
b50a0b2f52807696a2b6defb4e74fb9e5500e4b1
| 150
|
py
|
Python
|
api/admin.py
|
AntonioAlfrz/SecuredHome
|
a3c06c81c20a0b3b00af1cc34296b9256cb00138
|
[
"MIT"
] | null | null | null |
api/admin.py
|
AntonioAlfrz/SecuredHome
|
a3c06c81c20a0b3b00af1cc34296b9256cb00138
|
[
"MIT"
] | null | null | null |
api/admin.py
|
AntonioAlfrz/SecuredHome
|
a3c06c81c20a0b3b00af1cc34296b9256cb00138
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from django.contrib import admin
from .models import Log, User
admin.site.register(Log)
admin.site.register(User)
| 16.666667
| 32
| 0.8
| 23
| 150
| 5.217391
| 0.434783
| 0.166667
| 0.283333
| 0.383333
| 0.5
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12
| 150
| 8
| 33
| 18.75
| 0.909091
| 0
| 0
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.6
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 6
|
d23162f00e7226000fdccfeeb9d25bbe047ad419
| 22,498
|
py
|
Python
|
test_onnx2keras.py
|
95hali74/onnx-to-keras
|
b2286fbf9492f11a30ef955273cb4ec46a96e191
|
[
"MIT"
] | 19
|
2019-12-17T03:11:04.000Z
|
2021-12-09T09:44:08.000Z
|
test_onnx2keras.py
|
95hali74/onnx-to-keras
|
b2286fbf9492f11a30ef955273cb4ec46a96e191
|
[
"MIT"
] | 21
|
2020-05-05T21:44:21.000Z
|
2021-11-09T13:51:04.000Z
|
test_onnx2keras.py
|
95hali74/onnx-to-keras
|
b2286fbf9492f11a30ef955273cb4ec46a96e191
|
[
"MIT"
] | 8
|
2020-05-20T16:37:40.000Z
|
2021-08-19T03:25:53.000Z
|
import warnings
from io import BytesIO
from tempfile import NamedTemporaryFile
import onnx
import torch.nn
from torch.nn import Module
import torch.nn.functional as F
from torchvision import models
from numpy.testing import assert_almost_equal
import numpy as np
import tensorflow as tf
from onnx2keras import onnx2keras, compatible_data_format, OnnxConstant, OnnxTensor, InterleavedImageBatch, \
ensure_data_format, OptimizationMissingWarning
def make_onnx_model(net, indata, opset_version=None):
fd = BytesIO()
torch.onnx.export(net, indata, fd, opset_version=opset_version)
# with open("/tmp/t.onnx", "wb") as debug: torch.onnx.export(net, indata, debug, opset_version=opset_version)
fd.seek(0)
return onnx.load(fd)
def convert_and_compare_output(net, indata, precition=5, image_out=True, savable=True, missing_optimizations=False, opset_version=None):
try:
return _convert_and_compare_output(net, indata, precition, image_out, savable, missing_optimizations, opset_version)
except AssertionError:
return _convert_and_compare_output(net, indata, precition, image_out, savable, missing_optimizations, opset_version)
def _convert_and_compare_output(net, indata, precition=5, image_out=True, savable=True, missing_optimizations=False, opset_version=None):
torch_indata = torch.tensor(indata)
y1 = net(torch_indata).detach().numpy()
onnx_model = make_onnx_model(net, torch.zeros_like(torch_indata), opset_version)
with warnings.catch_warnings(record=True) as warns:
warnings.simplefilter("always")
kernas_net = onnx2keras(onnx_model)
warns = [w for w in warns if w.category is OptimizationMissingWarning]
if not missing_optimizations:
assert len(warns) == 0
if savable:
with NamedTemporaryFile() as f:
f.close()
kernas_net.save(f.name)
y2 = kernas_net.predict(indata.transpose(0, 2, 3, 1))
if image_out:
y2 = y2.transpose(0, 3, 1, 2)
assert_almost_equal(y1, y2, precition)
return kernas_net
class GlobalAvgPool(Module):
def forward(self, x):
return x.mean([2, 3])
class TestUtils:
def test_compatible_data_format(self):
assert compatible_data_format(OnnxConstant, OnnxConstant)
assert compatible_data_format(OnnxTensor, OnnxTensor)
assert compatible_data_format(OnnxConstant, OnnxTensor)
assert compatible_data_format(OnnxTensor, OnnxConstant)
assert compatible_data_format(InterleavedImageBatch, InterleavedImageBatch)
assert not compatible_data_format(OnnxTensor, InterleavedImageBatch)
assert not compatible_data_format(OnnxConstant, InterleavedImageBatch)
assert not compatible_data_format(InterleavedImageBatch, OnnxTensor)
assert not compatible_data_format(InterleavedImageBatch, OnnxConstant)
class TestOnnx:
def test_conv(self):
net = torch.nn.Sequential(torch.nn.Conv2d(3, 16, 7), torch.nn.ReLU())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_conv_no_bias(self):
net = torch.nn.Sequential(torch.nn.Conv2d(3, 16, 7, bias=False), torch.nn.ReLU())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_conv_padding(self):
net = torch.nn.Sequential(torch.nn.Conv2d(1, 16, 3, padding=1), torch.nn.ReLU())
x = np.random.rand(1, 1, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_prelu(self):
net = torch.nn.Sequential(torch.nn.Conv2d(3, 16, 7), torch.nn.PReLU())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_prelu_per_channel(self):
act = torch.nn.PReLU(num_parameters=16)
with torch.no_grad():
act.weight[:] = torch.tensor(range(16))
net = torch.nn.Sequential(torch.nn.Conv2d(3, 16, 7), act)
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x, 5)
def test_maxpool(self):
net = torch.nn.Sequential(torch.nn.MaxPool2d(2))
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_maxpool_resnet(self):
net = torch.nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
x = np.random.rand(1, 192, 272, 64).astype(np.float32)
convert_and_compare_output(net, x)
def test_concat(self):
for axis in range(1,4):
class Dbl(torch.nn.Module):
def forward(self, x):
return torch.cat((x, x), axis)
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(Dbl(), x)
def test_conv_transpose(self):
net = torch.nn.Sequential(torch.nn.ConvTranspose2d(3, 16, 5, 2), torch.nn.ReLU())
x = np.random.rand(1, 3, 112, 112).astype(np.float32)
convert_and_compare_output(net, x)
def test_conv_transpose_padding(self):
net = torch.nn.Sequential(torch.nn.ConvTranspose2d(3, 16, 4, 2, padding=1), torch.nn.ReLU())
x = np.random.rand(1, 3, 112, 112).astype(np.float32)
convert_and_compare_output(net, x)
def test_conv_different_padding(self):
net = torch.nn.Sequential(torch.nn.Conv2d(3, 64, kernel_size=7, stride=1, padding=(3, 4)))
x = np.random.rand(1, 3, 384, 544).astype(np.float32)
convert_and_compare_output(net, x)
def test_conv_transpose_no_bias(self):
net = torch.nn.Sequential(torch.nn.ConvTranspose2d(3, 16, 5, 2, bias=False), torch.nn.ReLU())
x = np.random.rand(1, 3, 112, 112).astype(np.float32)
convert_and_compare_output(net, x)
def test_conv_transpose_grouped_no_bias(self):
net = torch.nn.Sequential(torch.nn.ConvTranspose2d(16, 16, 5, 2, groups=2, bias=False), torch.nn.ReLU())
x = np.random.rand(1, 16, 112, 112).astype(np.float32)
convert_and_compare_output(net, x)
def test_conv_transpose_grouped_bias(self):
net = torch.nn.Sequential(torch.nn.ConvTranspose2d(16, 16, 5, 2, groups=2), torch.nn.ReLU())
x = np.random.rand(1, 16, 112, 112).astype(np.float32)
convert_and_compare_output(net, x)
def test_conv_transpose_grouped_fully(self):
net = torch.nn.Sequential(torch.nn.ConvTranspose2d(16, 16, 5, 2, groups=16), torch.nn.ReLU())
x = np.random.rand(1, 16, 112, 112).astype(np.float32)
convert_and_compare_output(net, x)
def test_conv_transpose_output_padding(self):
net = torch.nn.Sequential(torch.nn.ConvTranspose2d(16, 16, 3, 2, output_padding=1), torch.nn.ReLU())
x = np.random.rand(1, 16, 112, 112).astype(np.float32)
convert_and_compare_output(net, x)
def test_conv_stride2_padding_strange(self):
net = torch.nn.Sequential(torch.nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3))
x = np.random.rand(1, 3, 384, 544).astype(np.float32)
convert_and_compare_output(net, x)
def test_conv_stride2_padding_simple_odd(self):
net = torch.nn.Sequential(torch.nn.Conv2d(3, 64, kernel_size=3, stride=2, padding=1))
x = np.random.rand(1, 3, 223, 223).astype(np.float32)
kernas_net = convert_and_compare_output(net, x)
assert [l.__class__.__name__ for l in kernas_net.layers] == ['InputLayer', 'Conv2D']
def test_conv_stride2_padding_simple_even(self):
net = torch.nn.Sequential(torch.nn.Conv2d(3, 64, kernel_size=3, stride=2, padding=1))
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
kernas_net = convert_and_compare_output(net, x)
# assert [l.__class__.__name__ for l in kernas_net.layers] == ['InputLayer', 'Conv2D']
def test_batchnorm(self):
bn = torch.nn.BatchNorm2d(3)
bn.running_mean.uniform_()
bn.running_var.uniform_()
net = torch.nn.Sequential(bn, torch.nn.ReLU())
net.eval()
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_batchnorm1d(self):
bn = torch.nn.BatchNorm1d(3)
bn.running_mean.uniform_()
bn.running_var.uniform_()
net = torch.nn.Sequential(GlobalAvgPool(), bn, torch.nn.ReLU())
net.eval()
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
def test_clamp(self):
class Clamp(Module):
def forward(self, x):
return torch.clamp(x, 0.3, 0.7)
net = torch.nn.Sequential(torch.nn.ReLU(), Clamp(), torch.nn.ReLU())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x, savable=False)
def test_relu6(self):
class Clamp(Module):
def forward(self, x):
return torch.clamp(x, 0, 6)
net = torch.nn.Sequential(torch.nn.ReLU(), Clamp(), torch.nn.ReLU())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_leaky_relu(self):
net = torch.nn.Sequential(torch.nn.Conv2d(3, 3, 3), torch.nn.LeakyReLU(), torch.nn.Conv2d(3, 3, 3))
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_depthwise(self):
net = torch.nn.Sequential(torch.nn.Conv2d(3, 3, 7, groups=3), torch.nn.ReLU())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_groupwise(self):
net = torch.nn.Conv2d(8, 8, 7, groups=4)
x = np.random.rand(1, 8, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_depthwise_no_bias(self):
net = torch.nn.Sequential(torch.nn.Conv2d(3, 3, 7, groups=3, bias=False), torch.nn.ReLU())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_add(self):
class AddTst(Module):
def __init__(self):
Module.__init__(self)
self.conv1 = torch.nn.Conv2d(3, 3, 7)
self.conv2 = torch.nn.Conv2d(3, 3, 7)
def forward(self, x):
return self.conv1(x).relu_() + self.conv2(x).relu_()
net = torch.nn.Sequential(AddTst(), torch.nn.ReLU())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_global_avrage_pooling(self):
net = torch.nn.Sequential(GlobalAvgPool(), torch.nn.ReLU())
x = np.random.rand(1, 3, 16, 16).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
def test_dropout(self):
net = torch.nn.Sequential(GlobalAvgPool(), torch.nn.Dropout(), torch.nn.ReLU())
net.eval()
x = np.random.rand(1, 3, 16, 16).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
def test_linear(self):
net = torch.nn.Sequential(GlobalAvgPool(), torch.nn.Linear(3, 8), torch.nn.ReLU())
net.eval()
x = np.random.rand(5, 3, 16, 16).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
def test_linear_no_bias(self):
net = torch.nn.Sequential(GlobalAvgPool(), torch.nn.Linear(3, 8, bias=False), torch.nn.ReLU())
net.eval()
x = np.random.rand(5, 3, 16, 16).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
def test_mobilenet_v2(self):
net = models.mobilenet_v2()
net.eval()
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
def test_avg_pool_pad(self):
class PadTst(Module):
def forward(self, x):
return F.avg_pool2d(x, kernel_size=3, stride=1, padding=1)
net = torch.nn.Sequential(PadTst(), torch.nn.ReLU())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_avg_pool_pad_asym(self):
class PadTst(Module):
def forward(self, x):
return F.avg_pool2d(x, kernel_size=(3, 6), stride=(1, 2), padding=(1, 2))
net = torch.nn.Sequential(PadTst(), torch.nn.ReLU())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_gloabl_avg_pool(self):
class AvgTst(Module):
def forward(self, x):
return F.adaptive_avg_pool2d(x, (1, 1))
net = torch.nn.Sequential(AvgTst(), torch.nn.ReLU())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_flatten(self):
class Tst(Module):
def forward(self, x):
return torch.flatten(x, 1)
net = torch.nn.Sequential(Tst(), torch.nn.ReLU())
x = np.random.rand(1, 3, 1, 1).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
def test_vector_pad(self):
class VectorPad2D(Module):
def forward(self, x):
tt = [torch.nn.functional.pad(x[:, i:i + 1], [1,1,1,1], 'constant', [1,2,3][i])
for i in range(x.shape[1])]
return torch.cat(tt, 1)
net = torch.nn.Sequential(VectorPad2D(), torch.nn.ReLU())
x = np.random.rand(2, 3, 5, 5).astype(np.float32)
convert_and_compare_output(net, x)
def test_vector_pad_addhack(self):
class VectorPad2D(Module):
def forward(self, x):
c = torch.tensor([1,2,3]).reshape(1, 3, 1, 1)
return torch.nn.functional.pad(x - c, [1,1,1,1]) + c
net = torch.nn.Sequential(VectorPad2D(), torch.nn.ReLU())
x = np.random.rand(1, 3, 5, 5).astype(np.float32)
convert_and_compare_output(net, x)
def test_vector_pad_addhack_asym(self):
class VectorPad2D(Module):
def forward(self, x):
c = torch.tensor([1,2,3]).reshape(1, 3, 1, 1)
return torch.nn.functional.pad(x - c, [1,0,1,0]) + c
net = torch.nn.Sequential(VectorPad2D(), torch.nn.ReLU())
x = np.random.rand(1, 3, 5, 5).astype(np.float32)
convert_and_compare_output(net, x)
def test_sigmoid(self):
net = torch.nn.Sequential(torch.nn.Conv2d(3, 16, 7), torch.nn.Sigmoid())
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
convert_and_compare_output(net, x)
def test_upsample_nearest(self):
net = torch.nn.Sequential(torch.nn.UpsamplingNearest2d(scale_factor=2), torch.nn.ReLU())
x = np.random.rand(1, 3, 32, 32).astype(np.float32)
convert_and_compare_output(net, x)
def test_upsample_nearest_v11(self):
net = torch.nn.Sequential(torch.nn.UpsamplingNearest2d(scale_factor=2), torch.nn.ReLU())
x = np.random.rand(1, 3, 32, 32).astype(np.float32)
convert_and_compare_output(net, x, opset_version=11)
def test_upsample_bilinear(self):
net = torch.nn.Sequential(torch.nn.UpsamplingBilinear2d(scale_factor=2), torch.nn.ReLU())
x = np.random.rand(1, 3, 32, 32).astype(np.float32)
convert_and_compare_output(net, x, opset_version=11)
def test_interpolate_nearest(self):
class Net(Module):
def forward(self, x):
return F.interpolate(x, scale_factor=2, mode="nearest")
net = torch.nn.Sequential(Net(), torch.nn.ReLU())
x = np.random.rand(1, 3, 32, 32).astype(np.float32)
convert_and_compare_output(net, x)
def test_interpolate_bilinear(self):
class Net(Module):
def forward(self, x):
return F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=True)
net = torch.nn.Sequential(Net(), torch.nn.ReLU())
x = np.random.rand(1, 3, 32, 32).astype(np.float32)
convert_and_compare_output(net, x, opset_version=11)
def test_eq_mul(self):
class EqProd(Module):
def forward(self, x):
maxmap = F.max_pool2d(x, 3, 1, 1, 1, False, False)
return x * (maxmap == x)
net = torch.nn.Sequential(EqProd(), torch.nn.ReLU())
x = np.random.rand(1, 3, 5, 5).astype(np.float32)
convert_and_compare_output(net, x)
def test_adaptive_avgpool_reshape(self):
class Net(Module):
def forward(self, x):
return F.adaptive_avg_pool2d(x, 1).reshape(x.shape[0], -1)
net = torch.nn.Sequential(Net(), torch.nn.ReLU())
x = np.random.rand(1, 3, 16, 16).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
x = np.random.rand(4, 3, 16, 16).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
def test_bmm(self):
class Net(Module):
def forward(self, x):
x = x.reshape(1, 16, 16)
return torch.bmm(x, x)
net = torch.nn.Sequential(Net(), torch.nn.ReLU())
x = np.random.rand(1, 1, 16, 16).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
def test_matmul(self):
class Net(Module):
def forward(self, x):
x = x.reshape(1, 1, 16, 16)
return torch.matmul(x, x)
net = torch.nn.Sequential(Net(), torch.nn.ReLU())
x = np.random.rand(1, 1, 16, 16).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
def test_unsupported_optimasation(self):
class Reshape(Module):
def forward(self, x):
return x.reshape(4, 4, 16, 16)
net = torch.nn.Sequential(GlobalAvgPool(), torch.nn.Linear(3, 4 * 16 * 16), Reshape(),
torch.nn.Conv2d(4, 3, 3), torch.nn.ReLU())
net.eval()
x = np.random.rand(4, 3, 16, 16).astype(np.float32)
convert_and_compare_output(net, x, missing_optimizations=True)
def test_sqrt(self):
class Sq(Module):
def forward(self, x):
return torch.sqrt(x)
net = torch.nn.Sequential(Sq(), torch.nn.ReLU())
x = np.random.rand(4, 3, 16, 16).astype(np.float32)
is_tf1 = tuple(map(int, tf.__version__.split('.'))) < (2, 0, 0)
convert_and_compare_output(net, x, savable=(not is_tf1))
def test_abs(self):
class Abs(Module):
def forward(self, x):
return torch.abs(x)
net = torch.nn.Sequential(Abs(), torch.nn.ReLU())
x = np.random.rand(4, 3, 16, 16).astype(np.float32)
convert_and_compare_output(net, x)
def test_neg(self):
class Neg(Module):
def forward(self, x):
return -x
net = torch.nn.Sequential(Neg(), torch.nn.ReLU())
x = np.random.rand(4, 3, 16, 16).astype(np.float32)
convert_and_compare_output(net, x)
def test_center_crop(self):
class CenterCrop8x8(Module):
def forward(self, x):
n, c, h, w = x.shape
dx = (w - 8) // 2
dy = (h - 8) // 2
crop = x[:, :, dy:dy+8, dx:dx+8]
return crop
net = torch.nn.Sequential(CenterCrop8x8(), torch.nn.ReLU())
x = np.random.rand(4, 3, 16, 32).astype(np.float32)
convert_and_compare_output(net, x, opset_version=11)
def test_mul(self):
class Mul(Module):
def forward(self, x):
return x * x
net = torch.nn.Sequential(Mul(), torch.nn.ReLU())
x = np.random.rand(4, 3, 16, 32).astype(np.float32)
convert_and_compare_output(net, x, opset_version=11)
def test_mul_const(self):
class Mul(Module):
def forward(self, x):
return (2 * x) * (x * 2)
net = torch.nn.Sequential(Mul(), torch.nn.ReLU())
x = np.random.rand(4, 3, 16, 32).astype(np.float32)
convert_and_compare_output(net, x, opset_version=11)
def test_concat_for_OnnxTensor(self):
batch = 4
class Net(Module):
def __init__(self):
super().__init__()
self.conv1 = torch.nn.Conv2d(3, 4, 5)
self.conv2 = torch.nn.Conv2d(3, 4, 5)
self.ClassHead = torch.nn.ModuleList([torch.nn.Conv2d(4, 16, 3), torch.nn.Conv2d(4, 16, 3)])
def forward(self, x):
features = [self.conv1(x), self.conv2(x)]
classifications = torch.cat([self.ClassHead[i](feature).reshape(batch, -1, 2) for i, feature in enumerate(features)], dim=1)
return classifications
x = np.random.rand(batch, 3, 16, 32).astype(np.float32)
convert_and_compare_output(Net(), x, missing_optimizations=True, image_out=False)
def test_transpose_to_onnx_testor(self):
class Net(Module):
def forward(self, x):
return x.permute(0,2,3,1)
x = np.random.rand(2, 3, 16, 32).astype(np.float32)
convert_and_compare_output(Net(), x, image_out=False)
def test_concat_for_OnnxTensor_optimized(self):
batch = 4
class Net(Module):
def __init__(self):
super().__init__()
self.conv1 = torch.nn.Conv2d(3, 4, 5)
self.conv2 = torch.nn.Conv2d(3, 4, 5)
self.ClassHead = torch.nn.ModuleList([torch.nn.Conv2d(4, 16, 3), torch.nn.Conv2d(4, 16, 3)])
def forward(self, x):
features = [self.conv1(x), self.conv2(x)]
classifications = torch.cat([self.ClassHead[i](feature).permute(0,2,3,1).reshape(batch, -1, 2) for i, feature in enumerate(features)], dim=1)
return classifications
x = np.random.rand(batch, 3, 16, 32).astype(np.float32)
convert_and_compare_output(Net(), x, image_out=False)
def test_gather(self):
class Net(Module):
def forward(self, x):
return x.permute(0,2,3,1).select(2,1)
net = torch.nn.Sequential(Net(), torch.nn.ReLU())
x = np.random.rand(2, 3, 16, 32).astype(np.float32)
convert_and_compare_output(net, x, image_out=False)
# def test_inception_v3(self):
# net = models.Inception3(aux_logits=False)
# net.eval()
# x = np.random.rand(1, 3, 299, 299).astype(np.float32)
# convert_and_compare_output(net, x, image_out=False)
| 43.600775
| 157
| 0.622366
| 3,246
| 22,498
| 4.153728
| 0.083487
| 0.082029
| 0.084477
| 0.114292
| 0.80798
| 0.756953
| 0.732181
| 0.708151
| 0.697471
| 0.679967
| 0
| 0.056649
| 0.241266
| 22,498
| 515
| 158
| 43.685437
| 0.733216
| 0.017602
| 0
| 0.483871
| 0
| 0
| 0.002082
| 0
| 0
| 0
| 0
| 0
| 0.032258
| 1
| 0.223502
| false
| 0
| 0.02765
| 0.046083
| 0.398618
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 0
| 0
| 0
|
0
| 6
|
d27b46639a651842c5c352055f9757ae6c49a525
| 151
|
py
|
Python
|
users/models.py
|
titan-65/django_experimth
|
e877098c69c026e6ca000d0ae51636163e989637
|
[
"MIT"
] | 2
|
2020-12-18T01:25:21.000Z
|
2020-12-25T17:45:35.000Z
|
users/models.py
|
titan-65/django_experimth
|
e877098c69c026e6ca000d0ae51636163e989637
|
[
"MIT"
] | null | null | null |
users/models.py
|
titan-65/django_experimth
|
e877098c69c026e6ca000d0ae51636163e989637
|
[
"MIT"
] | null | null | null |
from django.contrib.auth.models import AbstractUser
from django.db import models
# Create your models here.
class CustomUser(AbstractUser):
pass
| 18.875
| 51
| 0.794702
| 20
| 151
| 6
| 0.7
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145695
| 151
| 7
| 52
| 21.571429
| 0.930233
| 0.15894
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.25
| 0.5
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 6
|
964b0ce910f027dfb48790b49e2360dcd806ad7c
| 106
|
py
|
Python
|
numba/testing/__main__.py
|
auderson/numba
|
3d67c9850ab56457f418cf40af6245fd9c337705
|
[
"BSD-2-Clause"
] | 6,620
|
2015-01-04T08:51:04.000Z
|
2022-03-31T12:52:18.000Z
|
numba/testing/__main__.py
|
auderson/numba
|
3d67c9850ab56457f418cf40af6245fd9c337705
|
[
"BSD-2-Clause"
] | 6,457
|
2015-01-04T03:18:41.000Z
|
2022-03-31T17:38:42.000Z
|
numba/testing/__main__.py
|
auderson/numba
|
3d67c9850ab56457f418cf40af6245fd9c337705
|
[
"BSD-2-Clause"
] | 930
|
2015-01-25T02:33:03.000Z
|
2022-03-30T14:10:32.000Z
|
import sys
from numba.testing import run_tests
sys.exit(0 if run_tests(sys.argv).wasSuccessful() else 1)
| 21.2
| 57
| 0.792453
| 19
| 106
| 4.315789
| 0.736842
| 0.195122
| 0.268293
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021277
| 0.113208
| 106
| 4
| 58
| 26.5
| 0.851064
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
9654c38792c126772e4c199cab5ee1e0d91d8101
| 43
|
py
|
Python
|
scripts/deploy.py
|
rigidus/et
|
11cc30260f9aa7587a06c84ab9e0895e2c068875
|
[
"Xnet",
"X11"
] | null | null | null |
scripts/deploy.py
|
rigidus/et
|
11cc30260f9aa7587a06c84ab9e0895e2c068875
|
[
"Xnet",
"X11"
] | null | null | null |
scripts/deploy.py
|
rigidus/et
|
11cc30260f9aa7587a06c84ab9e0895e2c068875
|
[
"Xnet",
"X11"
] | 1
|
2021-04-19T08:07:09.000Z
|
2021-04-19T08:07:09.000Z
|
from brownie import ZERO_ADDRESS, accounts
| 21.5
| 42
| 0.860465
| 6
| 43
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116279
| 43
| 1
| 43
| 43
| 0.947368
| 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
|
9685e509cb8d029c094159536c0f4f52457ea7ae
| 95,767
|
py
|
Python
|
test/integration/plugins/solidfire/TestVolumes.py
|
saliven1970/cloudstack
|
4617be458387421bbbfc120c1f054c9939ba52eb
|
[
"Apache-2.0"
] | 2
|
2021-10-31T01:04:26.000Z
|
2021-11-08T09:43:30.000Z
|
test/integration/plugins/solidfire/TestVolumes.py
|
saliven1970/cloudstack
|
4617be458387421bbbfc120c1f054c9939ba52eb
|
[
"Apache-2.0"
] | 20
|
2020-12-19T22:32:23.000Z
|
2022-02-01T01:07:06.000Z
|
test/integration/plugins/solidfire/TestVolumes.py
|
saliven1970/cloudstack
|
4617be458387421bbbfc120c1f054c9939ba52eb
|
[
"Apache-2.0"
] | 2
|
2016-11-10T16:29:26.000Z
|
2019-05-20T12:23:35.000Z
|
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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 logging
import random
import SignedAPICall
import time
import XenAPI
from solidfire.factory import ElementFactory
from util import sf_util
# All tests inherit from cloudstackTestCase
from marvin.cloudstackTestCase import cloudstackTestCase
# Import Integration Libraries
# base - contains all resources as entities and defines create, delete, list operations on them
from marvin.lib.base import Account, DiskOffering, ServiceOffering, Snapshot, StoragePool, Template, User, VirtualMachine, Volume
# common - commonly used methods for all tests are listed here
from marvin.lib.common import get_domain, get_template, get_zone, list_clusters, list_hosts, list_virtual_machines, \
list_volumes
# utils - utility classes for common cleanup, external library wrappers, etc.
from marvin.lib.utils import cleanup_resources
# Prerequisites:
# Only one zone
# Only one pod
# Only one cluster
#
# Running the tests:
# Change the "hypervisor_type" variable to control which hypervisor type to test.
# If using XenServer, verify the "xen_server_hostname" variable is correct.
# If using XenServer, change the "supports_cloning" variable to True or False as desired.
#
# Note:
# If you do have more than one cluster, you might need to change this line: cls.cluster = list_clusters(cls.apiClient)[0] and
# this variable's value: TestData.clusterId.
class TestData():
# constants
account = "account"
capacityBytes = "capacitybytes"
capacityIops = "capacityiops"
clusterId = "clusterId"
computeOffering = "computeoffering"
diskName = "diskname"
diskOffering = "diskoffering"
domainId = "domainId"
hypervisor = "hypervisor"
kvm = "kvm"
login = "login"
mvip = "mvip"
one_GB_in_bytes = 1073741824
password = "password"
port = "port"
primaryStorage = "primarystorage"
provider = "provider"
scope = "scope"
solidFire = "solidfire"
storageTag = "SolidFire_SAN_1"
tags = "tags"
templateCacheNameKvm = "centos55-x86-64"
templateCacheNameXenServer = "centos56-x86-64-xen"
# templateCacheNameXenServer = "centos65-x86-64-XenServer"
testAccount = "testaccount"
url = "url"
user = "user"
username = "username"
virtualMachine = "virtualmachine"
virtualMachine2 = "virtualmachine2"
volume_1 = "volume_1"
volume_2 = "volume_2"
xenServer = "xenserver"
zoneId = "zoneId"
# modify to control which hypervisor type to test
hypervisor_type = xenServer
xen_server_hostname = "XenServer-6.5-1"
def __init__(self):
self.testdata = {
TestData.solidFire: {
TestData.mvip: "10.117.78.225",
TestData.username: "admin",
TestData.password: "admin",
TestData.port: 443,
TestData.url: "https://10.117.78.225:443"
},
TestData.kvm: {
TestData.username: "root",
TestData.password: "solidfire"
},
TestData.xenServer: {
TestData.username: "root",
TestData.password: "solidfire"
},
TestData.account: {
"email": "test@test.com",
"firstname": "John",
"lastname": "Doe",
"username": "test",
"password": "test"
},
TestData.testAccount: {
"email": "test2@test2.com",
"firstname": "Jane",
"lastname": "Doe",
"username": "test2",
"password": "test"
},
TestData.user: {
"email": "user@test.com",
"firstname": "Jane",
"lastname": "Doe",
"username": "testuser",
"password": "password"
},
TestData.primaryStorage: {
"name": "SolidFire-%d" % random.randint(0, 100),
TestData.scope: "ZONE",
"url": "MVIP=10.117.78.225;SVIP=10.117.94.225;" +
"clusterAdminUsername=admin;clusterAdminPassword=admin;" +
"clusterDefaultMinIops=10000;clusterDefaultMaxIops=15000;" +
"clusterDefaultBurstIopsPercentOfMaxIops=1.5;",
TestData.provider: "SolidFire",
TestData.tags: TestData.storageTag,
TestData.capacityIops: 4500000,
TestData.capacityBytes: 2251799813685248,
TestData.hypervisor: "Any"
},
TestData.virtualMachine: {
"name": "TestVM",
"displayname": "Test VM"
},
TestData.virtualMachine2: {
"name": "TestVM2",
"displayname": "Test VM 2"
},
TestData.computeOffering: {
"name": "SF_CO_1",
"displaytext": "SF_CO_1 (Min IOPS = 10,000; Max IOPS = 15,000)",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 128,
"storagetype": "shared",
"customizediops": False,
"miniops": "10000",
"maxiops": "15000",
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag
},
TestData.diskOffering: {
"name": "SF_DO_1",
"displaytext": "SF_DO_1 (Min IOPS = 300; Max IOPS = 500)",
"disksize": 128,
"customizediops": False,
"miniops": 300,
"maxiops": 500,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
},
TestData.volume_1: {
TestData.diskName: "test-volume",
},
TestData.volume_2: {
TestData.diskName: "test-volume-2",
},
TestData.zoneId: 1,
TestData.clusterId: 1,
TestData.domainId: 1,
TestData.url: "10.117.40.114"
}
class TestVolumes(cloudstackTestCase):
_should_only_be_one_vm_in_list_err_msg = "There should only be one VM in this list."
_should_only_be_one_volume_in_list_err_msg = "There should only be one volume in this list."
_should_only_be_one_host_in_list_err_msg = "There should only be one host in this list."
_should_only_be_two_volumes_in_list_err_msg = "There should only be two volumes in this list."
_sf_account_id_should_be_non_zero_int_err_msg = "The SolidFire account ID should be a non-zero integer."
_volume_size_should_be_non_zero_int_err_msg = "The SolidFire volume size should be a non-zero integer."
_volume_vm_id_and_vm_id_do_not_match_err_msg = "The volume's VM ID and the VM's ID do not match."
_vm_not_in_running_state_err_msg = "The VM is not in the 'Running' state."
_vm_not_in_stopped_state_err_msg = "The VM is not in the 'Stopped' state."
_volume_response_should_not_be_zero_err_msg = "The length of the response for the SolidFire-volume query should not be zero."
_volume_should_not_be_in_a_vag = "The volume should not be in a volume access group."
_volume_size_not_an_int = "'volume_size_in_GB' is not of type 'int'"
_only_data_volumes_err_msg = "Only data volumes can be resized via a new disk offering."
_to_change_volume_size_err_msg = "To change a volume's size without providing a new disk offering, its current " \
"disk offering must be customizable or it must be a root volume (if providing a disk offering, make sure it is " \
"different from the current disk offering)."
_min_iops_err_msg = "The current disk offering does not support customization of the 'Min IOPS' parameter."
_this_kind_of_disk_err_msg = "This kind of KVM disk cannot be resized while it is connected to a VM that's not in the Stopped state."
_template_creation_did_not_fail_err_msg = "The template creation did not fail (as expected)."
_volume_resize_did_not_fail_err_msg = "The volume resize did not fail (as expected)."
_volume_attached_to_non_stopped_vm_err_msg = "volume is attached to a non-stopped VM"
@classmethod
def setUpClass(cls):
# Set up API client
testclient = super(TestVolumes, cls).getClsTestClient()
cls.apiClient = testclient.getApiClient()
cls.configData = testclient.getParsedTestDataConfig()
cls.dbConnection = testclient.getDbConnection()
cls.testdata = TestData().testdata
cls._handle_supports_cloning()
cls._connect_to_hypervisor()
# Set up SolidFire connection
solidfire = cls.testdata[TestData.solidFire]
cls.sfe = ElementFactory.create(solidfire[TestData.mvip], solidfire[TestData.username], solidfire[TestData.password])
# Get Resources from Cloud Infrastructure
cls.zone = get_zone(cls.apiClient, zone_id=cls.testdata[TestData.zoneId])
cls.cluster = list_clusters(cls.apiClient)[0]
cls.template = get_template(cls.apiClient, cls.zone.id, hypervisor=TestData.hypervisor_type)
cls.domain = get_domain(cls.apiClient, cls.testdata[TestData.domainId])
# Create test account
cls.account = Account.create(
cls.apiClient,
cls.testdata["account"],
admin=1
)
# Set up connection to make customized API calls
cls.user = User.create(
cls.apiClient,
cls.testdata["user"],
account=cls.account.name,
domainid=cls.domain.id
)
url = cls.testdata[TestData.url]
api_url = "http://" + url + ":8080/client/api"
userkeys = User.registerUserKeys(cls.apiClient, cls.user.id)
cls.cs_api = SignedAPICall.CloudStack(api_url, userkeys.apikey, userkeys.secretkey)
primarystorage = cls.testdata[TestData.primaryStorage]
cls.primary_storage = StoragePool.create(
cls.apiClient,
primarystorage,
scope=primarystorage[TestData.scope],
zoneid=cls.zone.id,
provider=primarystorage[TestData.provider],
tags=primarystorage[TestData.tags],
capacityiops=primarystorage[TestData.capacityIops],
capacitybytes=primarystorage[TestData.capacityBytes],
hypervisor=primarystorage[TestData.hypervisor]
)
cls.compute_offering = ServiceOffering.create(
cls.apiClient,
cls.testdata[TestData.computeOffering]
)
cls.disk_offering = DiskOffering.create(
cls.apiClient,
cls.testdata[TestData.diskOffering]
)
# Create VM and volume for tests
cls.virtual_machine = VirtualMachine.create(
cls.apiClient,
cls.testdata[TestData.virtualMachine],
accountid=cls.account.name,
zoneid=cls.zone.id,
serviceofferingid=cls.compute_offering.id,
templateid=cls.template.id,
domainid=cls.domain.id,
startvm=False
)
TestVolumes._start_vm(cls.virtual_machine)
cls.volume = Volume.create(
cls.apiClient,
cls.testdata[TestData.volume_1],
account=cls.account.name,
domainid=cls.domain.id,
zoneid=cls.zone.id,
diskofferingid=cls.disk_offering.id
)
# Resources that are to be destroyed
cls._cleanup = [
cls.volume,
cls.virtual_machine,
cls.compute_offering,
cls.disk_offering,
cls.user,
cls.account
]
@classmethod
def tearDownClass(cls):
try:
cleanup_resources(cls.apiClient, cls._cleanup)
cls.primary_storage.delete(cls.apiClient)
sf_util.purge_solidfire_volumes(cls.sfe)
except Exception as e:
logging.debug("Exception in tearDownClass(cls): %s" % e)
def setUp(self):
self.attached = False
self.cleanup = []
def tearDown(self):
if self.attached:
self.virtual_machine.detach_volume(self.apiClient, self.volume)
cleanup_resources(self.apiClient, self.cleanup)
def test_00_check_template_cache(self):
if self._supports_cloning == False:
return
sf_volumes = self._get_active_sf_volumes()
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, self._get_template_cache_name(), self)
self.assertEqual(
len(sf_volume.volume_access_groups),
0,
"The volume should not be in a VAG."
)
sf_account_id = sf_volume.account_id
sf_account = self.sfe.get_account_by_id(sf_account_id).account
sf_account_name = sf_account.username
self.assertEqual(
sf_account_name.endswith("_1"),
True,
"The template cache volume's account does not end with '_1'."
)
def test_01_attach_new_volume_to_stopped_VM(self):
'''Attach a volume to a stopped virtual machine, then start VM'''
self.virtual_machine.stop(self.apiClient)
new_volume = Volume.create(
self.apiClient,
self.testdata[TestData.volume_2],
account=self.account.name,
domainid=self.domain.id,
zoneid=self.zone.id,
diskofferingid=self.disk_offering.id
)
self.cleanup.append(new_volume)
sf_util.check_and_get_cs_volume(self, new_volume.id, self.testdata[TestData.volume_2][TestData.diskName], self)
new_volume = self.virtual_machine.attach_volume(
self.apiClient,
new_volume
)
newvolume = sf_util.check_and_get_cs_volume(self, new_volume.id, self.testdata[TestData.volume_2][TestData.diskName], self)
TestVolumes._start_vm(self.virtual_machine)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
newvolume.virtualmachineid,
vm.id,
TestVolumes._volume_vm_id_and_vm_id_do_not_match_err_msg
)
self.assertEqual(
vm.state.lower(),
"running",
TestVolumes._vm_not_in_running_state_err_msg
)
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, new_volume, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, self.primary_storage.id, self)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, new_volume, self)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, newvolume.name, self)
sf_util.check_size_and_iops(sf_volume, newvolume, sf_volume_size, self)
sf_util.check_vag(sf_volume, sf_vag_id, self)
self._check_host_side(sf_iscsi_name, vm.hostid)
# Detach volume
new_volume = self.virtual_machine.detach_volume(
self.apiClient,
new_volume
)
def test_02_attach_detach_attach_volume(self):
'''Attach, detach, and attach volume to a running VM'''
TestVolumes._start_vm(self.virtual_machine)
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, self.primary_storage.id, self)
sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
#######################################
#######################################
# STEP 1: Attach volume to running VM #
#######################################
#######################################
self.volume = self.virtual_machine.attach_volume(
self.apiClient,
self.volume
)
self.attached = True
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
vm.id,
TestVolumes._volume_vm_id_and_vm_id_do_not_match_err_msg
)
self.assertEqual(
vm.state.lower(),
'running',
TestVolumes._vm_not_in_running_state_err_msg
)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, self.volume, self)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, self.volume, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
sf_util.check_vag(sf_volume, sf_vag_id, self)
self._check_host_side(sf_iscsi_name, vm.hostid)
#########################################
#########################################
# STEP 2: Detach volume from running VM #
#########################################
#########################################
self.volume = self.virtual_machine.detach_volume(
self.apiClient,
self.volume
)
self.attached = False
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
None,
"The volume should not be attached to a VM."
)
self.assertEqual(
vm.state.lower(),
'running',
str(vm.state)
)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
self.assertEqual(
len(sf_volume.volume_access_groups),
0,
"The volume should not be in a VAG."
)
self._check_host_side(sf_iscsi_name, vm.hostid, False)
#######################################
#######################################
# STEP 3: Attach volume to running VM #
#######################################
#######################################
self.volume = self.virtual_machine.attach_volume(
self.apiClient,
self.volume
)
self.attached = True
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
vm.id,
TestVolumes._volume_vm_id_and_vm_id_do_not_match_err_msg
)
self.assertEqual(
vm.state.lower(),
'running',
TestVolumes._vm_not_in_running_state_err_msg
)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_vag(sf_volume, sf_vag_id, self)
self._check_host_side(sf_iscsi_name, vm.hostid)
def test_03_attached_volume_reboot_VM(self):
'''Attach volume to running VM, then reboot.'''
TestVolumes._start_vm(self.virtual_machine)
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, self.primary_storage.id, self)
sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
#######################################
#######################################
# STEP 1: Attach volume to running VM #
#######################################
#######################################
self.volume = self.virtual_machine.attach_volume(
self.apiClient,
self.volume
)
self.attached = True
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
vm.id,
TestVolumes._volume_vm_id_and_vm_id_do_not_match_err_msg
)
self.assertEqual(
vm.state.lower(),
'running',
TestVolumes._vm_not_in_running_state_err_msg
)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, self.volume, self)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, self.volume, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
sf_util.check_vag(sf_volume, sf_vag_id, self)
self._check_host_side(sf_iscsi_name, vm.hostid)
#######################################
#######################################
# STEP 2: Reboot VM with attached vol #
#######################################
#######################################
TestVolumes._reboot_vm(self.virtual_machine)
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, self.volume, self)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, self.volume, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
sf_util.check_vag(sf_volume, sf_vag_id, self)
self._check_host_side(sf_iscsi_name, vm.hostid)
def test_04_detach_volume_reboot(self):
'''Detach volume from a running VM, then reboot.'''
TestVolumes._start_vm(self.virtual_machine)
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, self.primary_storage.id, self)
sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
#######################################
#######################################
# STEP 1: Attach volume to running VM #
#######################################
#######################################
self.volume = self.virtual_machine.attach_volume(
self.apiClient,
self.volume
)
self.attached = True
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
vm.id,
TestVolumes._volume_vm_id_and_vm_id_do_not_match_err_msg
)
self.assertEqual(
vm.state.lower(),
'running',
TestVolumes._vm_not_in_running_state_err_msg
)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, self.volume, self)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, self.volume, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
sf_util.check_vag(sf_volume, sf_vag_id, self)
self._check_host_side(sf_iscsi_name, vm.hostid)
#########################################
#########################################
# STEP 2: Detach volume from running VM #
#########################################
#########################################
self.volume = self.virtual_machine.detach_volume(
self.apiClient,
self.volume
)
self.attached = False
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
None,
"The volume should not be attached to a VM."
)
self.assertEqual(
vm.state.lower(),
'running',
TestVolumes._vm_not_in_running_state_err_msg
)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
self.assertEqual(
len(sf_volume.volume_access_groups),
0,
TestVolumes._volume_should_not_be_in_a_vag
)
self._check_host_side(sf_iscsi_name, vm.hostid, False)
#######################################
#######################################
# STEP 3: Reboot VM with detached vol #
#######################################
#######################################
self.virtual_machine.reboot(self.apiClient)
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
self.assertEqual(
len(sf_volume.volume_access_groups),
0,
TestVolumes._volume_should_not_be_in_a_vag
)
self._check_host_side(sf_iscsi_name, vm.hostid, False)
def test_05_detach_vol_stopped_VM_start(self):
'''Detach volume from a stopped VM, then start.'''
TestVolumes._start_vm(self.virtual_machine)
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, self.primary_storage.id, self)
sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
#######################################
#######################################
# STEP 1: Attach volume to running VM #
#######################################
#######################################
self.volume = self.virtual_machine.attach_volume(
self.apiClient,
self.volume
)
self.attached = True
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
vm.id,
TestVolumes._volume_vm_id_and_vm_id_do_not_match_err_msg
)
self.assertEqual(
vm.state.lower(),
'running',
TestVolumes._vm_not_in_running_state_err_msg
)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, self.volume, self)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, self.volume, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
sf_util.check_vag(sf_volume, sf_vag_id, self)
self._check_host_side(sf_iscsi_name, vm.hostid)
hostid = vm.hostid
#########################################
#########################################
# STEP 2: Detach volume from stopped VM #
#########################################
#########################################
self.virtual_machine.stop(self.apiClient)
self.volume = self.virtual_machine.detach_volume(
self.apiClient,
self.volume
)
self.attached = False
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
None,
"The volume should not be attached to a VM."
)
self.assertEqual(
vm.state.lower(),
'stopped',
TestVolumes._vm_not_in_stopped_state_err_msg
)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
self.assertEqual(
len(sf_volume.volume_access_groups),
0,
TestVolumes._volume_should_not_be_in_a_vag
)
self._check_host_side(sf_iscsi_name, hostid, False)
#######################################
#######################################
# STEP 3: Start VM with detached vol #
#######################################
#######################################
TestVolumes._start_vm(self.virtual_machine)
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
self.assertEqual(
len(sf_volume.volume_access_groups),
0,
TestVolumes._volume_should_not_be_in_a_vag
)
self._check_host_side(sf_iscsi_name, vm.hostid, False)
def test_06_attach_volume_to_stopped_VM(self):
'''Attach a volume to a stopped virtual machine, then start VM'''
self.virtual_machine.stop(self.apiClient)
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, self.primary_storage.id, self)
sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
#######################################
#######################################
# STEP 1: Attach volume to stopped VM #
#######################################
#######################################
self.volume = self.virtual_machine.attach_volume(
self.apiClient,
self.volume
)
self.attached = True
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
vm.id,
TestVolumes._volume_vm_id_and_vm_id_do_not_match_err_msg
)
self.assertEqual(
vm.state.lower(),
'stopped',
TestVolumes._vm_not_in_stopped_state_err_msg
)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, self.volume, self)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, self.volume, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
sf_util.check_vag(sf_volume, sf_vag_id, self)
if TestData.hypervisor_type == TestData.kvm:
self._check_host_side(sf_iscsi_name, None, False)
elif TestData.hypervisor_type == TestData.xenServer:
self._check_host_side(sf_iscsi_name)
TestVolumes._start_vm(self.virtual_machine)
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
vm.id,
TestVolumes._volume_vm_id_and_vm_id_do_not_match_err_msg
)
self.assertEqual(
vm.state.lower(),
'running',
TestVolumes._vm_not_in_running_state_err_msg
)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, self.volume, self)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, self.volume, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
sf_util.check_vag(sf_volume, sf_vag_id, self)
self._check_host_side(sf_iscsi_name, vm.hostid)
def test_07_destroy_expunge_VM_with_volume(self):
'''Destroy and expunge VM with attached volume'''
#######################################
#######################################
# STEP 1: Create VM and attach volume #
#######################################
#######################################
test_virtual_machine = VirtualMachine.create(
self.apiClient,
self.testdata[TestData.virtualMachine2],
accountid=self.account.name,
zoneid=self.zone.id,
serviceofferingid=self.compute_offering.id,
templateid=self.template.id,
domainid=self.domain.id,
startvm=False
)
TestVolumes._start_vm(test_virtual_machine)
self.volume = test_virtual_machine.attach_volume(
self.apiClient,
self.volume
)
self.attached = True
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(test_virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
vm.id,
TestVolumes._volume_vm_id_and_vm_id_do_not_match_err_msg
)
self.assertEqual(
vm.state.lower(),
'running',
TestVolumes._vm_not_in_running_state_err_msg
)
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, self.volume, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, self.primary_storage.id, self)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, self.volume, self)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
sf_util.check_vag(sf_volume, sf_vag_id, self)
self._check_host_side(sf_iscsi_name, vm.hostid)
hostid = vm.hostid
#######################################
#######################################
# STEP 2: Destroy and Expunge VM #
#######################################
#######################################
test_virtual_machine.delete(self.apiClient, True)
self.attached = False
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
self.assertEqual(
vol.virtualmachineid,
None,
"Check if attached to virtual machine"
)
self.assertEqual(
vol.vmname,
None,
"Check if VM was expunged"
)
list_virtual_machine_response = list_virtual_machines(
self.apiClient,
id=test_virtual_machine.id
)
self.assertEqual(
list_virtual_machine_response,
None,
"Check if VM was actually expunged"
)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
self.assertEqual(
len(sf_volume.volume_access_groups),
0,
TestVolumes._volume_should_not_be_in_a_vag
)
self._check_host_side(sf_iscsi_name, hostid, False)
def test_08_delete_volume_was_attached(self):
'''Delete volume that was attached to a VM and is detached now'''
TestVolumes._start_vm(self.virtual_machine)
#######################################
#######################################
# STEP 1: Create vol and attach to VM #
#######################################
#######################################
new_volume = Volume.create(
self.apiClient,
self.testdata[TestData.volume_2],
account=self.account.name,
domainid=self.domain.id,
zoneid=self.zone.id,
diskofferingid=self.disk_offering.id
)
volume_to_delete_later = new_volume
sf_util.check_and_get_cs_volume(self, new_volume.id, self.testdata[TestData.volume_2][TestData.diskName], self)
new_volume = self.virtual_machine.attach_volume(
self.apiClient,
new_volume
)
vol = sf_util.check_and_get_cs_volume(self, new_volume.id, self.testdata[TestData.volume_2][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
vm.id,
"Check if attached to virtual machine"
)
self.assertEqual(
vm.state.lower(),
'running',
str(vm.state)
)
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, new_volume, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, self.primary_storage.id, self)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, new_volume, self)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
sf_util.check_vag(sf_volume, sf_vag_id, self)
self._check_host_side(sf_iscsi_name, vm.hostid)
#######################################
#######################################
# STEP 2: Detach and delete volume #
#######################################
#######################################
new_volume = self.virtual_machine.detach_volume(
self.apiClient,
new_volume
)
vol = sf_util.check_and_get_cs_volume(self, new_volume.id, self.testdata[TestData.volume_2][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
None,
"Check if attached to virtual machine"
)
self.assertEqual(
vm.state.lower(),
'running',
str(vm.state)
)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
self.assertEqual(
len(sf_volume.volume_access_groups),
0,
TestVolumes._volume_should_not_be_in_a_vag
)
self._check_host_side(sf_iscsi_name, vm.hostid, False)
volume_to_delete_later.delete(self.apiClient)
list_volumes_response = list_volumes(
self.apiClient,
id=new_volume.id
)
self.assertEqual(
list_volumes_response,
None,
"Check volume was deleted"
)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self, False)
def test_09_attach_volumes_multiple_accounts(self):
'''Attach a data disk to a VM in one account and attach another data disk to a VM in another account'''
TestVolumes._start_vm(self.virtual_machine)
#######################################
#######################################
# STEP 1: Create account, VM, and vol #
#######################################
#######################################
test_account = Account.create(
self.apiClient,
self.testdata[TestData.testAccount],
admin=1
)
self.cleanup.append(test_account)
test_virtual_machine = VirtualMachine.create(
self.apiClient,
self.testdata[TestData.virtualMachine2],
accountid=test_account.name,
zoneid=self.zone.id,
serviceofferingid=self.compute_offering.id,
templateid=self.template.id,
domainid=self.domain.id,
startvm=False
)
TestVolumes._start_vm(test_virtual_machine)
test_volume = Volume.create(
self.apiClient,
self.testdata[TestData.volume_2],
zoneid=self.zone.id,
account=test_account.name,
domainid=self.domain.id,
diskofferingid=self.disk_offering.id
)
sf_util.check_and_get_cs_volume(self, test_volume.id, self.testdata[TestData.volume_2][TestData.diskName], self)
#######################################
#######################################
# STEP 2: Attach volumes to VMs #
#######################################
#######################################
self.volume = self.virtual_machine.attach_volume(
self.apiClient,
self.volume
)
self.attached = True
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
vm = self._get_vm(self.virtual_machine.id)
self.assertEqual(
vol.virtualmachineid,
vm.id,
"Check if attached to virtual machine"
)
self.assertEqual(
vm.state.lower(),
'running',
str(vm.state)
)
test_volume = test_virtual_machine.attach_volume(
self.apiClient,
test_volume
)
test_vol = sf_util.check_and_get_cs_volume(self, test_volume.id, self.testdata[TestData.volume_2][TestData.diskName], self)
test_vm = self._get_vm(test_virtual_machine.id)
self.assertEqual(
test_vol.virtualmachineid,
test_vm.id,
"Check if attached to virtual machine of other acct"
)
self.assertEqual(
test_vm.state.lower(),
'running',
str(test_vm.state)
)
sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, self.primary_storage.id, self)
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, vol, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, self.volume, self)
self._check_host_side(sf_iscsi_name, vm.hostid)
sf_util.check_vag(sf_volume, sf_vag_id, self)
sf_test_account_id = sf_util.get_sf_account_id(self.cs_api, test_account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
sf_test_volumes = self._get_active_sf_volumes(sf_test_account_id)
sf_test_volume = sf_util.check_and_get_sf_volume(sf_test_volumes, test_vol.name, self)
sf_test_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, test_vol, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_test_volume_size)
sf_util.check_size_and_iops(sf_test_volume, test_vol, sf_test_volume_size, self)
sf_test_iscsi_name = sf_util.get_iqn(self.cs_api, test_volume, self)
self._check_host_side(sf_test_iscsi_name, test_vm.hostid)
sf_util.check_vag(sf_test_volume, sf_vag_id, self)
def test_10_attach_more_than_one_disk_to_VM(self):
'''Attach more than one disk to a VM'''
TestVolumes._start_vm(self.virtual_machine)
volume_2 = Volume.create(
self.apiClient,
self.testdata[TestData.volume_2],
zoneid=self.zone.id,
account=self.account.name,
domainid=self.domain.id,
diskofferingid=self.disk_offering.id
)
self.cleanup.append(volume_2)
sf_util.check_and_get_cs_volume(self, volume_2.id, self.testdata[TestData.volume_2][TestData.diskName], self)
#######################################
#######################################
# Step 1: Attach volumes to VM #
#######################################
#######################################
self.virtual_machine.attach_volume(
self.apiClient,
self.volume
)
self.attached = True
vol = sf_util.check_and_get_cs_volume(self, self.volume.id, self.testdata[TestData.volume_1][TestData.diskName], self)
self.virtual_machine.attach_volume(
self.apiClient,
volume_2
)
vol_2 = sf_util.check_and_get_cs_volume(self, volume_2.id, self.testdata[TestData.volume_2][TestData.diskName], self)
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, self.volume, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_size)
sf_volume_2_size = sf_util.get_volume_size_with_hsr(self.cs_api, volume_2, self)
self._verify_hsr(self.disk_offering.disksize, self.disk_offering.hypervisorsnapshotreserve, sf_volume_2_size)
sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, self.primary_storage.id, self)
sf_volumes = self._get_active_sf_volumes(sf_account_id)
sf_volume = sf_util.check_and_get_sf_volume(sf_volumes, vol.name, self)
sf_util.check_size_and_iops(sf_volume, vol, sf_volume_size, self)
sf_iscsi_name = sf_util.get_iqn(self.cs_api, self.volume, self)
vm = self._get_vm(self.virtual_machine.id)
self._check_host_side(sf_iscsi_name, vm.hostid)
sf_util.check_vag(sf_volume, sf_vag_id, self)
sf_volume_2 = sf_util.check_and_get_sf_volume(sf_volumes, vol_2.name, self)
sf_util.check_size_and_iops(sf_volume_2, vol_2, sf_volume_2_size, self)
sf_iscsi_name_2 = sf_util.get_iqn(self.cs_api, volume_2, self)
self._check_host_side(sf_iscsi_name_2, vm.hostid)
sf_util.check_vag(sf_volume_2, sf_vag_id, self)
self.virtual_machine.detach_volume(self.apiClient, volume_2)
def test_11_template_from_volume(self):
if TestData.hypervisor_type != TestData.kvm:
return
list_volumes_response = list_volumes(
self.apiClient,
virtualmachineid=self.virtual_machine.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
vm_1_root_volume = list_volumes_response[0]
services = {"displaytext": "Template-1", "name": "Template-1-name", "ostypeid": self.template.ostypeid, "ispublic": "true"}
try:
Template.create_from_volume(self.apiClient, vm_1_root_volume, services)
raise Exception(TestVolumes._template_creation_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._volume_attached_to_non_stopped_vm_err_msg not in e.errorMsg:
raise
self.virtual_machine.stop(self.apiClient)
template = Template.create_from_volume(self.apiClient, vm_1_root_volume, services)
self.cleanup.append(template)
vol_snap = Snapshot.create(self.apiClient, volume_id=vm_1_root_volume.id)
self.cleanup.append(vol_snap)
TestVolumes._start_vm(self.virtual_machine)
self._create_vm_using_template_and_destroy_vm(template)
services = {"diskname": "Vol-1", "zoneid": self.testdata[TestData.zoneId], "ispublic": True}
volume_created_from_snapshot = Volume.create_from_snapshot(self.apiClient, vol_snap.id, services, account=self.account.name, domainid=self.domain.id)
self.cleanup.append(volume_created_from_snapshot)
services = {"displaytext": "Template-2", "name": "Template-2-name", "ostypeid": self.template.ostypeid, "ispublic": "true"}
template = Template.create_from_volume(self.apiClient, volume_created_from_snapshot, services)
self.cleanup.append(template)
self._create_vm_using_template_and_destroy_vm(template)
volume_created_from_snapshot = self.virtual_machine.attach_volume(
self.apiClient,
volume_created_from_snapshot
)
services = {"displaytext": "Template-3", "name": "Template-3-name", "ostypeid": self.template.ostypeid, "ispublic": "true"}
try:
Template.create_from_volume(self.apiClient, volume_created_from_snapshot, services)
raise Exception(TestVolumes._template_creation_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._volume_attached_to_non_stopped_vm_err_msg not in e.errorMsg:
raise
self.virtual_machine.stop(self.apiClient)
template = Template.create_from_volume(self.apiClient, volume_created_from_snapshot, services)
self.cleanup.append(template)
volume_created_from_snapshot = self.virtual_machine.detach_volume(
self.apiClient,
volume_created_from_snapshot
)
TestVolumes._start_vm(self.virtual_machine)
self._create_vm_using_template_and_destroy_vm(template)
services = {"displaytext": "Template-4", "name": "Template-4-name", "ostypeid": self.template.ostypeid, "ispublic": "true"}
template = Template.create_from_volume(self.apiClient, volume_created_from_snapshot, services)
self.cleanup.append(template)
self._create_vm_using_template_and_destroy_vm(template)
def test_12_resize_volume_on_running_vm(self):
if TestData.hypervisor_type != TestData.kvm:
return
test_virtual_machine = VirtualMachine.create(
self.apiClient,
self.testdata[TestData.virtualMachine2],
accountid=self.account.name,
zoneid=self.zone.id,
serviceofferingid=self.compute_offering.id,
templateid=self.template.id,
domainid=self.domain.id,
startvm=True
)
self.cleanup.append(test_virtual_machine)
list_volumes_response = list_volumes(
self.apiClient,
virtualmachineid=test_virtual_machine.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
test_vm_root_volume = Volume(list_volumes_response[0].__dict__)
self._handle_root_volume_with_started_vm(test_vm_root_volume)
volume_name = {
TestData.diskName: "test-volume-a",
}
test_vm_data_volume = Volume.create(
self.apiClient,
volume_name,
account=self.account.name,
domainid=self.domain.id,
zoneid=self.zone.id,
diskofferingid=self.disk_offering.id
)
self.cleanup.append(test_vm_data_volume)
test_vm_data_volume = test_virtual_machine.attach_volume(
self.apiClient,
test_vm_data_volume
)
test_vm_data_volume = Volume(test_vm_data_volume.__dict__)
self._handle_data_volume_with_started_vm(test_vm_data_volume)
custom_disk_offering = {
"name": "SF_DO_A",
"displaytext": "SF_DO_A (Custom)",
"customized": True,
"customizediops": True,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
custom_disk_offering = DiskOffering.create(
self.apiClient,
custom_disk_offering,
custom=True
)
self.cleanup.append(custom_disk_offering)
services = {
TestData.diskName: "test-volume-custom-a",
"customdisksize": 100,
"customminiops": 1000,
"custommaxiops": 2000,
"zoneid": self.testdata[TestData.zoneId]
}
test_vm_data_volume = Volume.create_custom_disk(
self.apiClient,
services,
account=self.account.name,
domainid=self.domain.id,
diskofferingid=custom_disk_offering.id
)
self.cleanup.append(test_vm_data_volume)
test_vm_data_volume = test_virtual_machine.attach_volume(
self.apiClient,
test_vm_data_volume
)
test_vm_data_volume = Volume(test_vm_data_volume.__dict__)
self._handle_custom_data_volume_with_started_vm(test_vm_data_volume)
def test_13_resize_volume_on_stopped_vm(self):
if TestData.hypervisor_type != TestData.kvm:
return
test_virtual_machine = VirtualMachine.create(
self.apiClient,
self.testdata[TestData.virtualMachine2],
accountid=self.account.name,
zoneid=self.zone.id,
serviceofferingid=self.compute_offering.id,
templateid=self.template.id,
domainid=self.domain.id,
startvm=False
)
self.cleanup.append(test_virtual_machine)
list_volumes_response = list_volumes(
self.apiClient,
virtualmachineid=test_virtual_machine.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
test_vm_root_volume = Volume(list_volumes_response[0].__dict__)
err_msg = "Check if SF volume was created in correct account"
try:
# This should fail because there should not be an equivalent SolidFire volume in the cluster yet.
self._verify_volume(test_vm_root_volume)
raise Exception("The volume verification did not fail (as expected).")
except Exception as e:
if err_msg not in str(e):
raise
# Starting the up the should create its root disk on the SolidFire cluster.
test_virtual_machine.start(self.apiClient)
test_virtual_machine.stop(self.apiClient)
self._handle_root_volume_with_stopped_vm(test_vm_root_volume)
volume_name = {
TestData.diskName: "test-volume-a",
}
test_vm_data_volume = Volume.create(
self.apiClient,
volume_name,
account=self.account.name,
domainid=self.domain.id,
zoneid=self.zone.id,
diskofferingid=self.disk_offering.id
)
self.cleanup.append(test_vm_data_volume)
test_vm_data_volume = test_virtual_machine.attach_volume(
self.apiClient,
test_vm_data_volume
)
test_vm_data_volume = Volume(test_vm_data_volume.__dict__)
self._handle_data_volume_with_stopped_vm(test_vm_data_volume)
custom_disk_offering = {
"name": "SF_DO_A",
"displaytext": "SF_DO_A (Custom)",
"customized": True,
"customizediops": True,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
custom_disk_offering = DiskOffering.create(
self.apiClient,
custom_disk_offering,
custom=True
)
self.cleanup.append(custom_disk_offering)
services = {
TestData.diskName: "test-volume-custom-a",
"customdisksize": 100,
"customminiops": 1000,
"custommaxiops": 2000,
"zoneid": self.testdata[TestData.zoneId]
}
test_vm_data_volume = Volume.create_custom_disk(
self.apiClient,
services,
account=self.account.name,
domainid=self.domain.id,
diskofferingid=custom_disk_offering.id
)
self.cleanup.append(test_vm_data_volume)
test_vm_data_volume = test_virtual_machine.attach_volume(
self.apiClient,
test_vm_data_volume
)
test_vm_data_volume = Volume(test_vm_data_volume.__dict__)
self._handle_custom_data_volume_with_stopped_vm(test_vm_data_volume)
test_vm_data_volume = test_virtual_machine.detach_volume(
self.apiClient,
test_vm_data_volume
)
test_vm_data_volume = Volume(test_vm_data_volume.__dict__)
self._handle_custom_data_volume_with_stopped_vm(test_vm_data_volume)
def _handle_root_volume_with_started_vm(self, volume):
self._verify_volume(volume)
volume_size_in_GB = volume.size / TestData.one_GB_in_bytes
self.assertTrue(
type(volume_size_in_GB) == int,
TestVolumes._volume_size_not_an_int
)
new_size = volume_size_in_GB + 10
new_min_iops = volume.miniops + 100
new_max_iops = volume.maxiops + 200
sf_volume_size = self._get_sf_volume(volume.name).total_size
try:
# Try to change the size and IOPS of a volume attached to a running VM (should fail).
volume.resize(self.apiClient, size=new_size, miniops=new_min_iops, maxiops=new_max_iops)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._this_kind_of_disk_err_msg not in str(e):
raise
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
try:
# Try to change the size of a volume attached to a running VM (should fail).
volume.resize(self.apiClient, size=new_size)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._this_kind_of_disk_err_msg not in str(e):
raise
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
disk_offering = {
"name": "SF_DO_A",
"displaytext": "SF_DO_A (Min IOPS = " + str(new_min_iops) + "; Max IOPS = " + str(new_max_iops) + ")",
"disksize": new_size,
"customizediops": False,
"miniops": new_min_iops,
"maxiops": new_max_iops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
try:
# Try to change the size and IOPS of a volume attached to a running VM (should fail).
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._only_data_volumes_err_msg not in str(e):
raise
disk_offering.delete(self.apiClient)
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
disk_offering = {
"name": "SF_DO_B",
"displaytext": "SF_DO_B (Min IOPS = " + str(volume.miniops) + "; Max IOPS = " + str(volume.maxiops) + ")",
"disksize": new_size,
"customizediops": False,
"miniops": volume.miniops,
"maxiops": volume.maxiops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
try:
# Try to change the size of a volume attached to a running VM (should fail).
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._only_data_volumes_err_msg not in str(e):
raise
disk_offering.delete(self.apiClient)
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
disk_offering = {
"name": "SF_DO_C",
"displaytext": "SF_DO_C (Min IOPS = " + str(new_min_iops) + "; Max IOPS = " + str(new_max_iops) + ")",
"disksize": volume_size_in_GB,
"customizediops": False,
"miniops": new_min_iops,
"maxiops": new_max_iops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
disk_offering.delete(self.apiClient)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
new_min_iops = new_min_iops + 10
new_max_iops = new_max_iops + 20
volume.resize(self.apiClient, miniops=new_min_iops, maxiops=new_max_iops)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
def _handle_root_volume_with_stopped_vm(self, volume):
self._verify_volume(volume)
volume_size_in_GB = volume.size / TestData.one_GB_in_bytes
self.assertTrue(
type(volume_size_in_GB) == int,
TestVolumes._volume_size_not_an_int
)
new_size = volume_size_in_GB + 10
new_min_iops = volume.miniops + 100
new_max_iops = volume.maxiops + 200
volume.resize(self.apiClient, size=new_size, miniops=new_min_iops, maxiops=new_max_iops)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
sf_volume_size = self._get_sf_volume(volume.name).total_size
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
new_size = new_size + 10
volume.resize(self.apiClient, size=new_size)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
sf_volume_size = self._get_sf_volume(volume.name).total_size
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
new_min_iops = new_min_iops + 100
new_max_iops = new_max_iops + 200
volume.resize(self.apiClient, miniops=new_min_iops, maxiops=new_max_iops)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
new_size = new_size + 10
new_min_iops = new_min_iops + 100
new_max_iops = new_max_iops + 200
disk_offering = {
"name": "SF_DO_A",
"displaytext": "SF_DO_A (Min IOPS = " + str(new_min_iops) + "; Max IOPS = " + str(new_max_iops) + ")",
"disksize": new_size,
"customizediops": False,
"miniops": new_min_iops,
"maxiops": new_max_iops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
try:
# Try to change the size and IOPS of a volume attached to a stopped VM (should fail).
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._only_data_volumes_err_msg not in str(e):
raise
disk_offering.delete(self.apiClient)
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
disk_offering = {
"name": "SF_DO_B",
"displaytext": "SF_DO_B (Min IOPS = " + str(volume.miniops) + "; Max IOPS = " + str(volume.maxiops) + ")",
"disksize": new_size,
"customizediops": False,
"miniops": volume.miniops,
"maxiops": volume.maxiops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
try:
# Try to change the size of a volume attached to a stopped VM (should fail).
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._only_data_volumes_err_msg not in str(e):
raise
disk_offering.delete(self.apiClient)
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
volume_size_in_GB = volume.size / TestData.one_GB_in_bytes
self.assertTrue(
type(volume_size_in_GB) == int,
TestVolumes._volume_size_not_an_int
)
disk_offering = {
"name": "SF_DO_C",
"displaytext": "SF_DO_C (Min IOPS = " + str(new_min_iops) + "; Max IOPS = " + str(new_max_iops) + ")",
"disksize": volume_size_in_GB,
"customizediops": False,
"miniops": new_min_iops,
"maxiops": new_max_iops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
disk_offering.delete(self.apiClient)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
def _handle_data_volume_with_started_vm(self, volume):
self._verify_volume(volume)
volume_size_in_GB = volume.size / TestData.one_GB_in_bytes
self.assertTrue(
type(volume_size_in_GB) == int,
TestVolumes._volume_size_not_an_int
)
new_size = volume_size_in_GB + 10
new_min_iops = volume.miniops + 100
new_max_iops = volume.maxiops + 200
sf_volume_size = self._get_sf_volume(volume.name).total_size
try:
# Try to change the size and IOPS of a volume attached to a running VM (should fail).
volume.resize(self.apiClient, size=new_size, miniops=new_min_iops, maxiops=new_max_iops)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._to_change_volume_size_err_msg not in str(e):
raise
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
try:
# Try to change the size of a volume attached to a running VM (should fail).
volume.resize(self.apiClient, size=new_size)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._to_change_volume_size_err_msg not in str(e):
raise
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
disk_offering = {
"name": "SF_DO_A",
"displaytext": "SF_DO_A (Min IOPS = " + str(new_min_iops) + "; Max IOPS = " + str(new_max_iops) + ")",
"disksize": new_size,
"customizediops": False,
"miniops": new_min_iops,
"maxiops": new_max_iops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
try:
# Try to change the size and IOPS of a volume attached to a running VM (should fail).
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._this_kind_of_disk_err_msg not in str(e):
raise
disk_offering.delete(self.apiClient)
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
disk_offering = {
"name": "SF_DO_B",
"displaytext": "SF_DO_B (Min IOPS = " + str(volume.miniops) + "; Max IOPS = " + str(volume.maxiops) + ")",
"disksize": new_size,
"customizediops": False,
"miniops": volume.miniops,
"maxiops": volume.maxiops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
try:
# Try to change the size of a volume attached to a running VM (should fail).
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._this_kind_of_disk_err_msg not in str(e):
raise
disk_offering.delete(self.apiClient)
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
try:
# Try to change the IOPS of a volume attached to a running VM (should fail).
volume.resize(self.apiClient, miniops=new_min_iops, maxiops=new_max_iops)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._min_iops_err_msg not in str(e):
raise
disk_offering.delete(self.apiClient)
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
disk_offering = {
"name": "SF_DO_C",
"displaytext": "SF_DO_C (Min IOPS = " + str(new_min_iops) + "; Max IOPS = " + str(new_max_iops) + ")",
"disksize": volume_size_in_GB,
"customizediops": False,
"miniops": new_min_iops,
"maxiops": new_max_iops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
disk_offering.delete(self.apiClient)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
def _handle_data_volume_with_stopped_vm(self, volume):
self._verify_volume(volume)
volume_size_in_GB = volume.size / TestData.one_GB_in_bytes
self.assertTrue(
type(volume_size_in_GB) == int,
TestVolumes._volume_size_not_an_int
)
new_size = volume_size_in_GB + 10
new_min_iops = volume.miniops + 100
new_max_iops = volume.maxiops + 200
sf_volume_size = self._get_sf_volume(volume.name).total_size
try:
# Try to change the size and IOPS of a volume attached to a stopped VM (should fail).
volume.resize(self.apiClient, size=new_size, miniops=new_min_iops, maxiops=new_max_iops)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._to_change_volume_size_err_msg not in str(e):
raise
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
try:
# Try to change the size of a volume attached to a stopped VM (should fail).
volume.resize(self.apiClient, size=new_size)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._to_change_volume_size_err_msg not in str(e):
raise
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
try:
# Try to change the IOPS of a volume attached to a stopped VM (should fail).
volume.resize(self.apiClient, miniops=new_min_iops, maxiops=new_max_iops)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._min_iops_err_msg not in str(e):
raise
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
disk_offering = {
"name": "SF_DO_A",
"displaytext": "SF_DO_A (Min IOPS = " + str(new_min_iops) + "; Max IOPS = " + str(new_max_iops) + ")",
"disksize": new_size,
"customizediops": False,
"miniops": new_min_iops,
"maxiops": new_max_iops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
disk_offering.delete(self.apiClient)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
sf_volume_size = self._get_sf_volume(volume.name).total_size
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
new_size = new_size + 10
disk_offering = {
"name": "SF_DO_B",
"displaytext": "SF_DO_B (Min IOPS = " + str(volume.miniops) + "; Max IOPS = " + str(volume.maxiops) + ")",
"disksize": new_size,
"customizediops": False,
"miniops": volume.miniops,
"maxiops": volume.maxiops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
disk_offering.delete(self.apiClient)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
sf_volume_size = self._get_sf_volume(volume.name).total_size
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
volume_size_in_GB = volume.size / TestData.one_GB_in_bytes
self.assertTrue(
type(volume_size_in_GB) == int,
TestVolumes._volume_size_not_an_int
)
new_min_iops = new_min_iops + 100
new_max_iops = new_max_iops + 200
disk_offering = {
"name": "SF_DO_C",
"displaytext": "SF_DO_C (Min IOPS = " + str(new_min_iops) + "; Max IOPS = " + str(new_max_iops) + ")",
"disksize": volume_size_in_GB,
"customizediops": False,
"miniops": new_min_iops,
"maxiops": new_max_iops,
"hypervisorsnapshotreserve": 200,
TestData.tags: TestData.storageTag,
"storagetype": "shared"
}
disk_offering = DiskOffering.create(
self.apiClient,
disk_offering
)
volume.resize(self.apiClient, diskofferingid=disk_offering.id)
disk_offering.delete(self.apiClient)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
def _handle_custom_data_volume_with_started_vm(self, volume):
self._verify_volume(volume)
volume_size_in_GB = volume.size / TestData.one_GB_in_bytes
self.assertTrue(
type(volume_size_in_GB) == int,
TestVolumes._volume_size_not_an_int
)
new_size = volume_size_in_GB + 10
new_min_iops = volume.miniops + 100
new_max_iops = volume.maxiops + 200
sf_volume_size = self._get_sf_volume(volume.name).total_size
try:
# Try to change the size and IOPS of a volume attached to a running VM (should fail).
volume.resize(self.apiClient, size=new_size, miniops=new_min_iops, maxiops=new_max_iops)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._this_kind_of_disk_err_msg not in str(e):
raise
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
try:
# Try to change the size of a volume attached to a running VM (should fail).
volume.resize(self.apiClient, size=new_size)
raise Exception(TestVolumes._volume_resize_did_not_fail_err_msg)
except Exception as e:
if TestVolumes._this_kind_of_disk_err_msg not in str(e):
raise
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
volume.resize(self.apiClient, miniops=new_min_iops, maxiops=new_max_iops)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
def _handle_custom_data_volume_with_stopped_vm(self, volume):
self._verify_volume(volume)
volume_size_in_GB = volume.size / TestData.one_GB_in_bytes
self.assertTrue(
type(volume_size_in_GB) == int,
TestVolumes._volume_size_not_an_int
)
new_size = volume_size_in_GB + 10
new_min_iops = volume.miniops + 100
new_max_iops = volume.maxiops + 200
volume.resize(self.apiClient, size=new_size, miniops=new_min_iops, maxiops=new_max_iops)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
sf_volume_size = self._get_sf_volume(volume.name).total_size
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
new_size = new_size + 10
volume.resize(self.apiClient, size=new_size)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
sf_volume_size = self._get_sf_volume(volume.name).total_size
self._verify_volume(volume, volume.miniops, volume.maxiops, sf_volume_size)
new_min_iops = volume.miniops + 10
new_max_iops = volume.maxiops + 20
volume.resize(self.apiClient, miniops=new_min_iops, maxiops=new_max_iops)
list_volumes_response = list_volumes(
self.apiClient,
id=volume.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
volume = Volume(list_volumes_response[0].__dict__)
self._verify_volume(volume, new_min_iops, new_max_iops, sf_volume_size)
def _get_sf_volume(self, volume_name):
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, "The SolidFire account ID should be a non-zero integer.")
sf_volumes = sf_util.get_active_sf_volumes(self.sfe, sf_account_id)
self.assertNotEqual(
len(sf_volumes),
0,
"The length of the response for the SolidFire-volume query should not be zero."
)
return sf_util.check_and_get_sf_volume(sf_volumes, volume_name, self)
def _verify_volume(self, cs_volume, expected_min_iops=None, expected_max_iops=None, expected_size=None):
sf_volume = self._get_sf_volume(cs_volume.name)
sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, cs_volume, self)
sf_util.check_size_and_iops(sf_volume, cs_volume, sf_volume_size, self)
if expected_min_iops is not None:
self.assertEqual(
cs_volume.miniops,
expected_min_iops,
"Unexpected Min IOPS value (CloudStack volume has " + str(cs_volume.miniops) + "; expected " + str(expected_min_iops) + ")"
)
if expected_max_iops is not None:
self.assertEqual(
cs_volume.maxiops,
expected_max_iops,
"Unexpected Max IOPS value (CloudStack volume has " + str(cs_volume.maxiops) + "; expected " + str(expected_max_iops) + ")"
)
if expected_size is not None:
self.assertEqual(
sf_volume_size,
expected_size,
"Unexpected size value (CloudStack volume (with HSR) has " + str(sf_volume_size) + "; expected " + str(expected_size) + ")"
)
def _create_vm_using_template_and_destroy_vm(self, template):
vm_name = "VM-%d" % random.randint(0, 100)
virtual_machine_dict = {"name": vm_name, "displayname": vm_name}
virtual_machine = VirtualMachine.create(
self.apiClient,
virtual_machine_dict,
accountid=self.account.name,
zoneid=self.zone.id,
serviceofferingid=self.compute_offering.id,
templateid=template.id,
domainid=self.domain.id,
startvm=True
)
list_volumes_response = list_volumes(
self.apiClient,
virtualmachineid=virtual_machine.id,
listall=True
)
sf_util.check_list(list_volumes_response, 1, self, TestVolumes._should_only_be_one_volume_in_list_err_msg)
vm_root_volume = list_volumes_response[0]
vm_root_volume_name = vm_root_volume.name
sf_account_id = sf_util.get_sf_account_id(self.cs_api, self.account.id, self.primary_storage.id, self, TestVolumes._sf_account_id_should_be_non_zero_int_err_msg)
# Get volume information from SolidFire cluster
sf_volumes = sf_util.get_active_sf_volumes(self.sfe, sf_account_id)
sf_util.get_sf_volume_by_name(self, sf_volumes, vm_root_volume_name)
virtual_machine.delete(self.apiClient, True)
def _verify_hsr(self, cs_volume_size_in_gb, hsr, sf_volume_size_in_bytes):
cs_volume_size_including_hsr_in_bytes = self._get_cs_volume_size_including_hsr_in_bytes(cs_volume_size_in_gb, hsr)
self.assertTrue(
cs_volume_size_including_hsr_in_bytes == sf_volume_size_in_bytes,
"HSR does not add up correctly."
)
def _get_cs_volume_size_including_hsr_in_bytes(self, cs_volume_size_in_gb, hsr):
if TestData.hypervisor_type == TestData.kvm:
return self._get_bytes_from_gb(cs_volume_size_in_gb)
lowest_hsr = 10
if hsr < lowest_hsr:
hsr = lowest_hsr
return self._get_bytes_from_gb(cs_volume_size_in_gb + (cs_volume_size_in_gb * (hsr / 100)))
def _get_bytes_from_gb(self, number_in_gb):
return number_in_gb * 1024 * 1024 * 1024
def _get_vm(self, vm_id):
list_vms_response = list_virtual_machines(self.apiClient, id=vm_id)
sf_util.check_list(list_vms_response, 1, self, TestVolumes._should_only_be_one_vm_in_list_err_msg)
return list_vms_response[0]
def _check_xen_sr(self, xen_sr_name, should_exist=True):
sf_util.check_xen_sr(xen_sr_name, self.xen_session, self, should_exist)
def _get_active_sf_volumes(self, sf_account_id=None):
sf_volumes = sf_util.get_active_sf_volumes(self.sfe, sf_account_id)
self.assertNotEqual(
len(sf_volumes),
0,
TestVolumes._volume_response_should_not_be_zero_err_msg
)
return sf_volumes
def _get_template_cache_name(self):
if TestData.hypervisor_type == TestData.kvm:
return TestData.templateCacheNameKvm
elif TestData.hypervisor_type == TestData.xenServer:
return TestData.templateCacheNameXenServer
self.assert_(False, "Invalid hypervisor type")
def _get_modified_iscsi_name(self, sf_iscsi_name):
sf_iscsi_name = sf_iscsi_name.replace("/", "")
return sf_iscsi_name[:-1]
def _check_host_side(self, sf_iscsi_name, vm_hostid=None, should_exist=True):
if TestData.hypervisor_type == TestData.kvm:
self._check_kvm_host_side(self._get_modified_iscsi_name(sf_iscsi_name), vm_hostid, should_exist)
elif TestData.hypervisor_type == TestData.xenServer:
self._check_xen_sr(sf_iscsi_name, should_exist)
def _check_kvm_host_side(self, sf_iscsi_name, vm_hostid, should_exist=True):
if vm_hostid is None:
list_hosts_response = list_hosts(
self.apiClient,
type="Routing"
)
else:
list_hosts_response = list_hosts(
self.apiClient,
id=vm_hostid
)
sf_util.check_list(list_hosts_response, 1, self, TestVolumes._should_only_be_one_host_in_list_err_msg)
kvm_login = self.testdata[TestData.kvm]
for cs_host in list_hosts_response:
ssh_connection = sf_util.get_ssh_connection(cs_host.ipaddress, kvm_login[TestData.username], kvm_login[TestData.password])
stdout = ssh_connection.exec_command("ls /dev/disk/by-path | grep " + sf_iscsi_name)[1]
result = stdout.read()
ssh_connection.close()
if should_exist:
self.assertFalse(result is None, "Unable to locate 'by-path' field on the KVM host (None)")
self.assertFalse(len(result.strip()) <= len(sf_iscsi_name), "Unable to locate the 'by-path' field on the KVM host (Zero-length string)")
else:
self.assertTrue(result is None or len(result.strip()) == 0, "Found the 'by-path' field on the KVM host, but did not expect to")
@classmethod
def _start_vm(cls, vm):
vm_for_check = list_virtual_machines(
cls.apiClient,
id=vm.id
)[0]
if vm_for_check.state == VirtualMachine.STOPPED:
vm.start(cls.apiClient)
# Libvirt appears to have an issue detaching a volume from a VM while the VM is booting up.
# The XML sent to update the VM seems correct, but it doesn't appear to update the XML that describes the VM.
# For KVM, just give it 90 seconds to boot up.
if TestData.hypervisor_type == TestData.kvm:
time.sleep(90)
@classmethod
def _reboot_vm(cls, vm):
vm.reboot(cls.apiClient)
# Libvirt appears to have an issue detaching a volume from a VM while the VM is booting up.
# The XML sent to update the VM seems correct, but it doesn't appear to update the XML that describes the VM.
# For KVM, just give it 90 seconds to boot up.
if TestData.hypervisor_type == TestData.kvm:
time.sleep(90)
@classmethod
def _handle_supports_cloning(cls):
if TestData.hypervisor_type == TestData.kvm:
cls._supports_cloning = True
elif TestData.hypervisor_type == TestData.xenServer:
# For XenServer, it is OK to set this to True or False depending on what you'd like tested
cls._supports_cloning = True
sf_util.set_supports_resign(cls._supports_cloning, cls.dbConnection)
@classmethod
def _connect_to_hypervisor(cls):
if TestData.hypervisor_type == TestData.kvm:
pass
elif TestData.hypervisor_type == TestData.xenServer:
host_ip = "https://" + \
list_hosts(cls.apiClient, clusterid=cls.testdata[TestData.clusterId], name=TestData.xen_server_hostname)[0].ipaddress
cls.xen_session = XenAPI.Session(host_ip)
xen_server = cls.testdata[TestData.xenServer]
cls.xen_session.xenapi.login_with_password(xen_server[TestData.username], xen_server[TestData.password])
| 35.286293
| 174
| 0.625518
| 11,635
| 95,767
| 4.778771
| 0.044951
| 0.02705
| 0.021564
| 0.0141
| 0.811568
| 0.794374
| 0.773439
| 0.750202
| 0.722091
| 0.708081
| 0
| 0.007922
| 0.263149
| 95,767
| 2,713
| 175
| 35.2993
| 0.780007
| 0.054372
| 0
| 0.671692
| 0
| 0.001117
| 0.069613
| 0.006773
| 0
| 0
| 0
| 0
| 0.035176
| 1
| 0.023451
| false
| 0.0067
| 0.006142
| 0.000558
| 0.068118
| 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
|
969557c0cbb75b3ea3399d8730a38c72f4e3fd81
| 18
|
py
|
Python
|
_net/__init__.py
|
devsetup/devsetup_framework
|
6ccd59dab83bc4305e8ff18321bfc14a4e7e79ca
|
[
"BSD-3-Clause"
] | null | null | null |
_net/__init__.py
|
devsetup/devsetup_framework
|
6ccd59dab83bc4305e8ff18321bfc14a4e7e79ca
|
[
"BSD-3-Clause"
] | null | null | null |
_net/__init__.py
|
devsetup/devsetup_framework
|
6ccd59dab83bc4305e8ff18321bfc14a4e7e79ca
|
[
"BSD-3-Clause"
] | null | null | null |
from . import http
| 18
| 18
| 0.777778
| 3
| 18
| 4.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 18
| 1
| 18
| 18
| 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
|
96bc1e81781668cb507adfdba0520e20cbef6775
| 46
|
py
|
Python
|
jionlp/algorithm/__init__.py
|
wzf9/JioNLP
|
63ec32d6c409849d38f275a513b1c02493d85f86
|
[
"Apache-2.0"
] | 1
|
2020-06-27T02:58:18.000Z
|
2020-06-27T02:58:18.000Z
|
jionlp/algorithm/__init__.py
|
wzf9/JioNLP
|
63ec32d6c409849d38f275a513b1c02493d85f86
|
[
"Apache-2.0"
] | null | null | null |
jionlp/algorithm/__init__.py
|
wzf9/JioNLP
|
63ec32d6c409849d38f275a513b1c02493d85f86
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding=utf-8 -*-
from . import ner
| 5.75
| 22
| 0.5
| 6
| 46
| 3.833333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.030303
| 0.282609
| 46
| 7
| 23
| 6.571429
| 0.666667
| 0.434783
| 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
|
96c16b85a9b99fa57819531d8a1028c439413439
| 1,662
|
py
|
Python
|
sdk/python/pulumi_aws_native/iot/__init__.py
|
pulumi/pulumi-aws-native
|
1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3
|
[
"Apache-2.0"
] | 29
|
2021-09-30T19:32:07.000Z
|
2022-03-22T21:06:08.000Z
|
sdk/python/pulumi_aws_native/iot/__init__.py
|
pulumi/pulumi-aws-native
|
1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3
|
[
"Apache-2.0"
] | 232
|
2021-09-30T19:26:26.000Z
|
2022-03-31T23:22:06.000Z
|
sdk/python/pulumi_aws_native/iot/__init__.py
|
pulumi/pulumi-aws-native
|
1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3
|
[
"Apache-2.0"
] | 4
|
2021-11-10T19:42:01.000Z
|
2022-02-05T10:15:49.000Z
|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from .. import _utilities
import typing
# Export this package's modules as members:
from ._enums import *
from .account_audit_configuration import *
from .authorizer import *
from .certificate import *
from .custom_metric import *
from .dimension import *
from .domain_configuration import *
from .fleet_metric import *
from .get_account_audit_configuration import *
from .get_authorizer import *
from .get_certificate import *
from .get_custom_metric import *
from .get_dimension import *
from .get_domain_configuration import *
from .get_fleet_metric import *
from .get_job_template import *
from .get_logging import *
from .get_mitigation_action import *
from .get_policy import *
from .get_policy_principal_attachment import *
from .get_provisioning_template import *
from .get_resource_specific_logging import *
from .get_scheduled_audit import *
from .get_security_profile import *
from .get_thing import *
from .get_thing_principal_attachment import *
from .get_topic_rule import *
from .get_topic_rule_destination import *
from .job_template import *
from .logging import *
from .mitigation_action import *
from .policy import *
from .policy_principal_attachment import *
from .provisioning_template import *
from .resource_specific_logging import *
from .scheduled_audit import *
from .security_profile import *
from .thing import *
from .thing_principal_attachment import *
from .topic_rule import *
from .topic_rule_destination import *
from ._inputs import *
from . import outputs
| 32.588235
| 80
| 0.802046
| 227
| 1,662
| 5.603524
| 0.295154
| 0.330189
| 0.204403
| 0.091195
| 0.322327
| 0
| 0
| 0
| 0
| 0
| 0
| 0.000693
| 0.131167
| 1,662
| 50
| 81
| 33.24
| 0.880194
| 0.122142
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
7369bdd32ea9ed14310331f20caec8ccdd9be5af
| 47,462
|
py
|
Python
|
rmgpy/rmg/output.py
|
faribas/RMG-Py
|
6149e29b642bf8da9537e2db98f15121f0e040c7
|
[
"MIT"
] | 1
|
2019-10-16T15:03:45.000Z
|
2019-10-16T15:03:45.000Z
|
rmgpy/rmg/output.py
|
faribas/RMG-Py
|
6149e29b642bf8da9537e2db98f15121f0e040c7
|
[
"MIT"
] | null | null | null |
rmgpy/rmg/output.py
|
faribas/RMG-Py
|
6149e29b642bf8da9537e2db98f15121f0e040c7
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the 'Software'),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
################################################################################
"""
This module contains functionality for saving the output of RMG jobs to output
files.
"""
import os.path
import logging
import re
################################################################################
class OutputError(Exception):
"""
This exception is raised whenever an error occurs while saving output
information. Pass a string describing the circumstances of the exceptional
behavior.
"""
pass
################################################################################
def saveOutputHTML(path, reactionModel, partCoreEdge='core'):
"""
Save the current set of species and reactions of `reactionModel` to
an HTML file `path` on disk. As part of this process, drawings of all
species are created in the species folder (if they don't already exist)
using the :mod:`rmgpy.molecule.draw` module. The :mod:`jinja`
package is used to generate the HTML; if this package is not found, no
HTML will be generated (but the program will carry on).
"""
from model import PDepReaction
from rmgpy.molecule.draw import MoleculeDrawer
from rmgpy.chemkin import getSpeciesIdentifier
try:
import jinja2
except ImportError:
logging.warning("jinja2 package not found; HTML output will not be saved.")
return
path = os.path.abspath(path)
dirname = os.path.dirname(path)
# Prepare parameters to pass to jinja template
title = 'RMG Output'
if partCoreEdge == 'core':
species = reactionModel.core.species[:] + reactionModel.outputSpeciesList
if not os.path.isdir(os.path.join(dirname,'species')):
os.makedirs(os.path.join(dirname,'species'))
elif partCoreEdge == 'edge':
species = reactionModel.edge.species[:] + reactionModel.outputSpeciesList
if not os.path.isdir(os.path.join(dirname,'species_edge')):
os.makedirs(os.path.join(dirname,'species_edge'))
re_index_search = re.compile(r'\((\d+)\)$').search
for spec in species:
# if the species dictionary came from an RMG-Java job, make them prettier
# We use the presence of a trailing index on the label to discern this
# (A single open parenthesis is not enough (e.g. when using SMILES strings as labels!)
match = re_index_search(spec.label)
if match:
spec.index = int(match.group(0)[1:-1])
spec.label = spec.label[0:match.start()]
# Draw molecules if necessary
if partCoreEdge == 'core':
fstr = os.path.join(dirname, 'species', '{0}.png'.format(spec))
elif partCoreEdge == 'edge':
fstr = os.path.join(dirname, 'species_edge', '{0}.png'.format(spec))
if not os.path.exists(fstr):
try:
MoleculeDrawer().draw(spec.molecule[0], 'png', fstr)
except IndexError:
raise OutputError("{0} species could not be drawn because it did not contain a molecular structure. Please recheck your files.".format(getSpeciesIdentifier(spec)))
# We want to keep species sorted in the original order in which they were added to the RMG core.
# Rather than ordered by index
# species.sort(key=lambda x: x.index)
if partCoreEdge == 'core':
reactions = [rxn for rxn in reactionModel.core.reactions ] + reactionModel.outputReactionList
elif partCoreEdge == 'edge':
reactions = [rxn for rxn in reactionModel.edge.reactions ] + reactionModel.outputReactionList
# We want to keep reactions sorted in original order in which they were added to core
# rather than ordered by index
#reactions.sort(key=lambda x: x.index)
familyCount = {}
for rxn in reactions:
if isinstance(rxn, PDepReaction):
family = "PDepNetwork"
else:
family = rxn.getSource().label
if family in familyCount:
familyCount[family] += 1
else:
familyCount[family] = 1
families = familyCount.keys()
families.sort()
## jinja2 filters etc.
to_remove_from_css_names = re.compile('[/.\-+,]')
def csssafe(input):
"Replace unsafe CSS class name characters with an underscore."
return to_remove_from_css_names.sub('_',input)
environment = jinja2.Environment()
environment.filters['csssafe'] = csssafe
# Make HTML file
if partCoreEdge == 'core':
template = environment.from_string(
"""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>{{ title }}</title>
<style type="text/css">
body {
font-family: sans-serif;
}
a {
color: #993333;
text-decoration: none;
}
a:visited {
color: #993333;
}
a:hover {
text-decoration: underline;
}
table.speciesList, table.reactionList {
width: 100%;
border-collapse: collapse;
}
table.speciesList th, table.reactionList th {
text-align: left;
}
tr.reaction td {
border-top: 1px solid #808080;
}
td.reactants {
text-align: right;
}
td.products {
text-align: left;
}
td.reactionArrow {
text-align: center;
font-size: 16px;
}
td.species img, td.reactants img, td.products img {
vertical-align: middle;
}
tr.comment {
font-size: small;
}
tr.kinetics {
font-size: small;
}
.KineticsData {
# border: 1px solid gray;
}
.KineticsData th {
width: 15em;
word-wrap: none;
}
.KineticsData td {
width: 3em;
}
.chemkin, .KineticsData_repr {
white-space: pre-wrap;
font-size: x-small;
font-family: "Andale Mono", monospace;
}
.hide_comment .comment{
display: none !important;
}
.hide_kinetics .kinetics{
display: none !important;
}
.hide_chemkin .chemkin{
display: none !important;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="../../../external/jquery.min.js"></script>
<script type="text/javascript">
function updateFamily(family) {
if (family.checked) {
$("."+family.value).show();
} else {
$("."+family.value).hide();
}
}
function updateDetails(type) {
if (type.checked) {
$(".reactionList").removeClass("hide_"+type.value);
} else {
$(".reactionList").addClass("hide_"+type.value);
}
}
function checkAllFamilies() {
$("#familySelector").find("[name='family']").each(function() { this.checked = true; updateFamily(this); });
return false;
}
function uncheckAllFamilies() {
$("#familySelector").find("[name='family']").each(function() { this.checked = false; updateFamily(this); });
return false;
}
function checkAllDetails() {
$("#familySelector").find("[name='detail']").each(function() { this.checked = true; updateDetails(this); });
return false;
}
function uncheckAllDetails() {
$("#familySelector").find("[name='detail']").each(function() { this.checked = false; updateDetails(this); });
return false;
}
$(document).ready(function() {
checkAllFamilies();
uncheckAllDetails();
});
</script>
</head>
<body>
<h1>{{ title }}</h1>
<h2>Species ({{ species|length }})</h2>
<table class="speciesList">
<tr><th>Index</th><th>Structure</th><th>Label</th><th>Mol. Wt. (g/mol)</th></tr>
{% for spec in species %}
<tr class="species">
<td class="index">
{{ spec.index }}.</td>
<td class="structure"><a href={{ spec.molecule[0].getURL() }}><img src="species/{{ spec|replace('#','%23') }}.png" alt="{{ spec }}" title="{{ spec }}"></a></td>
<td class="label">{{ spec.label }}</td>
<td>{{ "%.2f"|format(spec.molecule[0].getMolecularWeight() * 1000) }}</td>
</tr>
{% if spec.thermo %}
<tr>
<td>
<table align="center">
<tr>
<th>H298</th>
<th>S298</th>
<th>Cp300</th>
<th>Cp500</th>
<th>Cp1000</th>
<th>Cp1500</th>
</tr>
<tr>
<td>
{% if spec.thermo.Tmin.value_si <= 298 %}
{{ "%.2f"|format(spec.thermo.getEnthalpy(298) / 4184) }}
{% endif %} </td>
<td>{% if spec.thermo.Tmin.value_si <= 298 %}
{{ "%.2f"|format(spec.thermo.getEntropy(298) / 4.184) }}
{% endif %}</td>
<td>{{ "%.2f"|format(spec.thermo.getHeatCapacity(300) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec.thermo.getHeatCapacity(500) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec.thermo.getHeatCapacity(1000) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec.thermo.getHeatCapacity(1500) / 4.184) }}</td>
</tr>
</table>
</td></tr>
{% endif %}
{% endfor %}
</table>
<h2>Reactions ({{ reactions|length }})</h2>
<form id='familySelector' action="">
<h4>Reaction families:</h4>
{% for family in families %} <input type="checkbox" id="{{ family|csssafe }}" name="family" value="{{ family|csssafe }}" checked="checked" onclick="updateFamily(this);"><label for="{{ family|csssafe }}">{{ family }} ({{ familyCount[family] }} rxn{{ 's' if familyCount[family] != 1 }})</label><br>
{% endfor %}
<a href="javascript:checkAllFamilies();" onclick="checkAllFamilies()">check all</a> <a href="javascript:uncheckAllFamilies();" onclick="uncheckAllFamilies();">uncheck all</a><br>
<h4>Reaction Details:</h4>
<input type="checkbox" id="kinetics" name="detail" value="kinetics" onclick="updateDetails(this);"><label for="kinetics">Kinetics</label><br>
<input type="checkbox" id="comment" name="detail" value="comment" onclick="updateDetails(this);"><label for="comment">Comments</label><br>
<input type="checkbox" id="chemkin" name="detail" value="chemkin" onclick="updateDetails(this);"><label for="chemkin">Chemkin strings</label><br>
<a href="javascript:checkAllDetails();" onclick="checkAllDetails()">check all</a> <a href="javascript:uncheckAllDetails();" onclick="uncheckAllDetails();">uncheck all</a>
</form>
<h4>Reaction List:</h4>
<table class="reactionList hide_comment hide_kinetics hide_chemkin">
<tr><th>Index</th><th colspan="3" style="text-align: center;">Reaction</th><th>Family</th></tr>
{% for rxn in reactions %}
<tr class="reaction {{ rxn.getSource().label|csssafe }}">
<td class="index"><a href="{{ rxn.getURL() }}" title="Search on RMG website" class="searchlink">{{ rxn.index }}.</a></td>
<td class="reactants">{% for reactant in rxn.reactants %}<a href="{{ reactant.molecule[0].getURL() }}"><img src="species/{{ reactant|replace('#','%23') }}.png" alt="{{ reactant }}" title="{{ reactant }}, MW = {{ "%.2f g/mol"|format(reactant.molecule[0].getMolecularWeight() * 1000) }}"></a>{% if not loop.last %} + {% endif %}{% endfor %}</td>
<td class="reactionArrow">{% if rxn.reversible %}⇔{% else %}→{% endif %}</td>
<td class="products">{% for product in rxn.products %}<a href="{{ product.molecule[0].getURL() }}"><img src="species/{{ product|replace('#','%23') }}.png" alt="{{ product }}" title="{{ product }}, MW = {{ "%.2f g/mol"|format(product.molecule[0].getMolecularWeight() * 1000) }}"></a>{% if not loop.last %} + {% endif %}{% endfor %}</td>
<td class="family">{{ rxn.getSource().label }}</td>
</tr>
<tr class="kinetics {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.kinetics.toHTML() }}</td>
</tr>
<tr class="chemkin {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.toChemkin(species) }}</td>
</tr>
<tr class="comment {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.kinetics.comment }}</td>
</tr>
{% endfor %}
</table>
</body>
</html>
""")
elif partCoreEdge == 'edge':
template = environment.from_string(
"""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>{{ title }}</title>
<style type="text/css">
body {
font-family: sans-serif;
}
a {
color: #993333;
text-decoration: none;
}
a:visited {
color: #993333;
}
a:hover {
text-decoration: underline;
}
table.speciesList, table.reactionList {
width: 100%;
border-collapse: collapse;
}
table.speciesList th, table.reactionList th {
text-align: left;
}
tr.reaction td {
border-top: 1px solid #808080;
}
td.reactants {
text-align: right;
}
td.products {
text-align: left;
}
td.reactionArrow {
text-align: center;
font-size: 16px;
}
td.species img, td.reactants img, td.products img {
vertical-align: middle;
}
tr.comment {
font-size: small;
}
tr.kinetics {
font-size: small;
}
.KineticsData {
# border: 1px solid gray;
}
.KineticsData th {
width: 15em;
word-wrap: none;
}
.KineticsData td {
width: 3em;
}
.chemkin, .KineticsData_repr {
white-space: pre-wrap;
font-size: x-small;
font-family: "Andale Mono", monospace;
}
.hide_comment .comment{
display: none !important;
}
.hide_kinetics .kinetics{
display: none !important;
}
.hide_chemkin .chemkin{
display: none !important;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="../../../external/jquery.min.js"></script>
<script type="text/javascript">
function updateFamily(family) {
if (family.checked) {
$("."+family.value).show();
} else {
$("."+family.value).hide();
}
}
function updateDetails(type) {
if (type.checked) {
$(".reactionList").removeClass("hide_"+type.value);
} else {
$(".reactionList").addClass("hide_"+type.value);
}
}
function checkAllFamilies() {
$("#familySelector").find("[name='family']").each(function() { this.checked = true; updateFamily(this); });
return false;
}
function uncheckAllFamilies() {
$("#familySelector").find("[name='family']").each(function() { this.checked = false; updateFamily(this); });
return false;
}
function checkAllDetails() {
$("#familySelector").find("[name='detail']").each(function() { this.checked = true; updateDetails(this); });
return false;
}
function uncheckAllDetails() {
$("#familySelector").find("[name='detail']").each(function() { this.checked = false; updateDetails(this); });
return false;
}
$(document).ready(function() {
checkAllFamilies();
uncheckAllDetails();
});
</script>
</head>
<body>
<h1>{{ title }}</h1>
<h2>Species ({{ species|length }})</h2>
<table class="speciesList">
<tr><th>Index</th><th>Structure</th><th>Label</th><th>Mol. Wt. (g/mol)</th></tr>
{% for spec in species %}
<tr class="species">
<td class="index">
{{ spec.index }}.</td>
<td class="structure"><a href={{ spec.molecule[0].getURL() }}><img src="species_edge/{{ spec|replace('#','%23') }}.png" alt="{{ spec }}" title="{{ spec }}"></a></td>
<td class="label">{{ spec.label }}</td>
<td>{{ "%.2f"|format(spec.molecule[0].getMolecularWeight() * 1000) }}</td>
</tr>
{% if spec.thermo %}
<tr>
<td>
<table align="center">
<tr>
<th>H298</th>
<th>S298</th>
<th>Cp300</th>
<th>Cp500</th>
<th>Cp1000</th>
<th>Cp1500</th>
</tr>
<tr>
<td>
{% if spec.thermo.Tmin.value_si <= 298 %}
{{ "%.2f"|format(spec.thermo.getEnthalpy(298) / 4184) }}
{% endif %} </td>
<td>{% if spec.thermo.Tmin.value_si <= 298 %}
{{ "%.2f"|format(spec.thermo.getEntropy(298) / 4.184) }}
{% endif %}</td>
<td>{{ "%.2f"|format(spec.thermo.getHeatCapacity(300) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec.thermo.getHeatCapacity(500) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec.thermo.getHeatCapacity(1000) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec.thermo.getHeatCapacity(1500) / 4.184) }}</td>
</tr>
</table>
</td></tr>
{% endif %}
{% endfor %}
</table>
<h2>Reactions ({{ reactions|length }})</h2>
<form id='familySelector' action="">
<h4>Reaction families:</h4>
{% for family in families %} <input type="checkbox" id="{{ family|csssafe }}" name="family" value="{{ family|csssafe }}" checked="checked" onclick="updateFamily(this);"><label for="{{ family|csssafe }}">{{ family }} ({{ familyCount[family] }} rxn{{ 's' if familyCount[family] != 1 }})</label><br>
{% endfor %}
<a href="javascript:checkAllFamilies();" onclick="checkAllFamilies()">check all</a> <a href="javascript:uncheckAllFamilies();" onclick="uncheckAllFamilies();">uncheck all</a><br>
<h4>Reaction Details:</h4>
<input type="checkbox" id="kinetics" name="detail" value="kinetics" onclick="updateDetails(this);"><label for="kinetics">Kinetics</label><br>
<input type="checkbox" id="comment" name="detail" value="comment" onclick="updateDetails(this);"><label for="comment">Comments</label><br>
<input type="checkbox" id="chemkin" name="detail" value="chemkin" onclick="updateDetails(this);"><label for="chemkin">Chemkin strings</label><br>
<a href="javascript:checkAllDetails();" onclick="checkAllDetails()">check all</a> <a href="javascript:uncheckAllDetails();" onclick="uncheckAllDetails();">uncheck all</a>
</form>
<h4>Reaction List:</h4>
<table class="reactionList hide_comment hide_kinetics hide_chemkin">
<tr><th>Index</th><th colspan="3" style="text-align: center;">Reaction</th><th>Family</th></tr>
{% for rxn in reactions %}
<tr class="reaction {{ rxn.getSource().label|csssafe }}">
<td class="index"><a href="{{ rxn.getURL() }}" title="Search on RMG website" class="searchlink">{{ rxn.index }}.</a></td>
<td class="reactants">{% for reactant in rxn.reactants %}<a href="{{ reactant.molecule[0].getURL() }}"><img src="species_edge/{{ reactant|replace('#','%23') }}.png" alt="{{ reactant }}" title="{{ reactant }}, MW = {{ "%.2f g/mol"|format(reactant.molecule[0].getMolecularWeight() * 1000) }}"></a>{% if not loop.last %} + {% endif %}{% endfor %}</td>
<td class="reactionArrow">{% if rxn.reversible %}⇔{% else %}→{% endif %}</td>
<td class="products">{% for product in rxn.products %}<a href="{{ product.molecule[0].getURL() }}"><img src="species_edge/{{ product|replace('#','%23') }}.png" alt="{{ product }}" title="{{ product }}, MW = {{ "%.2f g/mol"|format(product.molecule[0].getMolecularWeight() * 1000) }}"></a>{% if not loop.last %} + {% endif %}{% endfor %}</td>
<td class="family">{{ rxn.getSource().label }}</td>
</tr>
<tr class="kinetics {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.kinetics.toHTML() }}</td>
</tr>
<tr class="chemkin {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.toChemkin(species) }}</td>
</tr>
<tr class="comment {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.kinetics.comment }}</td>
</tr>
{% endfor %}
</table>
</body>
</html>
""")
f = open(path, 'w')
f.write(template.render(title=title, species=species, reactions=reactions, families=families, familyCount=familyCount))
f.close()
def saveDiffHTML(path, commonSpeciesList, speciesList1, speciesList2, commonReactions, uniqueReactions1, uniqueReactions2):
"""
This function outputs the species and reactions on an HTML page
for the comparison of two RMG models.
"""
from model import PDepReaction
from rmgpy.kinetics import Arrhenius, MultiArrhenius, MultiPDepArrhenius
from rmgpy.molecule.draw import MoleculeDrawer
try:
import jinja2
except ImportError:
logging.warning("jinja package not found; HTML output will not be saved.")
return
path = os.path.abspath(path)
dirname = os.path.dirname(path)
# Prepare parameters to pass to jinja template
title = 'RMG Model Comparison'
speciesList = [spec1 for spec1, spec2 in commonSpeciesList] + [spec2 for spec1, spec2 in commonSpeciesList] + speciesList1 + speciesList2
re_index = re.compile(r'\((\d+)\)$')
if not os.path.isdir(os.path.join(dirname,'species1')):
os.makedirs(os.path.join(dirname,'species1'))
if not os.path.isdir(os.path.join(dirname,'species2')):
os.makedirs(os.path.join(dirname,'species2'))
for spec1, spec2 in commonSpeciesList:
# if the species dictionary came from an RMG-Java job, make them prettier
# We use the presence of a trailing index on the label to discern this
# (A single open parenthesis is not enough (e.g. when using SMILES strings as labels!)
match1 = re_index.search(spec1.label)
if match1:
spec1.index = int(match1.group(0)[1:-1])
spec1.label = spec1.label[0:match1.start()]
match2 = re_index.search(spec2.label)
if match2:
spec2.index = int(match2.group(0)[1:-1])
spec2.label = spec2.label[0:match2.start()]
# Draw molecules if necessary
fstr = os.path.join(dirname, 'species1', '{0}.png'.format(spec1))
if not os.path.exists(fstr):
try:
MoleculeDrawer().draw(spec1.molecule[0], 'png', fstr)
except IndexError:
raise OutputError('{0} species could not be drawn because it did not contain a molecular structure. Please recheck your files.'.format(getSpeciesIdentifier(spec1)))
fstr = os.path.join(dirname, 'species2', '{0}.png'.format(spec2))
if not os.path.exists(fstr):
try:
MoleculeDrawer().draw(spec2.molecule[0], 'png', fstr)
except IndexError:
raise OutputError('{0} species could not be drawn because it did not contain a molecular structure. Please recheck your files.'.format(getSpeciesIdentifier(spec2)))
for spec in speciesList1:
match = re_index.search(spec.label)
if match:
spec.index = int(match.group(0)[1:-1])
spec.label = spec.label[0:match.start()]
# Draw molecules if necessary
fstr = os.path.join(dirname, 'species1', '{0}.png'.format(spec))
if not os.path.exists(fstr):
try:
MoleculeDrawer().draw(spec.molecule[0], 'png', fstr)
except IndexError:
raise OutputError('{0} species could not be drawn because it did not contain a molecular structure. Please recheck your files.'.format(getSpeciesIdentifier(spec)))
for spec in speciesList2:
match = re_index.search(spec.label)
if match:
spec.index = int(match.group(0)[1:-1])
spec.label = spec.label[0:match.start()]
# Draw molecules if necessary
fstr = os.path.join(dirname, 'species2', '{0}.png'.format(spec))
if not os.path.exists(fstr):
try:
MoleculeDrawer().draw(spec.molecule[0], 'png', fstr)
except IndexError:
raise OutputError('{0} species could not be drawn because it did not contain a molecular structure. Please recheck your files.'.format(getSpeciesIdentifier(spec)))
familyCount1 = {}
familyCount2 = {}
for rxn1, rxn2 in commonReactions:
if isinstance(rxn2.kinetics, (MultiArrhenius,MultiPDepArrhenius)):
rxn2.duplicate = True
if isinstance(rxn1, PDepReaction):
family = "PDepNetwork"
else:
family = rxn1.getSource().label
if family in familyCount1:
familyCount1[family] += 1
familyCount2[family] += 1
else:
familyCount1[family] = 1
familyCount2[family] = 1
for rxn in uniqueReactions1:
if isinstance(rxn, PDepReaction):
family = "PDepNetwork"
else:
family = rxn.getSource().label
if family in familyCount1:
familyCount1[family] += 1
else:
familyCount1[family] = 1
for rxn in uniqueReactions2:
if isinstance(rxn, PDepReaction):
family = "PDepNetwork"
else:
family = rxn.getSource().label
if family in familyCount2:
familyCount2[family] += 1
else:
familyCount2[family] = 1
families1 = familyCount1.keys()
families2 = familyCount2.keys()
families1.sort()
families2.sort()
## jinja2 filters etc.
to_remove_from_css_names = re.compile('[/.\-+,]')
def csssafe(input):
"Replace unsafe CSS class name characters with an underscore."
return to_remove_from_css_names.sub('_',input)
environment = jinja2.Environment()
environment.filters['csssafe'] = csssafe
# Make HTML file
template = environment.from_string(
"""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>{{ title }}</title>
<style type="text/css">
body {
font-family: sans-serif;
}
a {
color: #993333;
text-decoration: none;
}
a:visited {
color: #993333;
}
a:hover {
text-decoration: underline;
}
table.speciesList, table.reactionList {
width: 100%;
border-collapse: collapse;
}
table.speciesList th, table.reactionList th {
text-align: left;
}
tr.reaction td {
border-top: 1px solid #808080;
}
td.reactants {
text-align: right;
}
td.products {
text-align: left;
}
td.reactionArrow {
text-align: center;
font-size: 16px;
}
td.species img, td.reactants img, td.products img {
vertical-align: middle;
}
tr.comment {
font-size: small;
}
tr.kinetics {
font-size: small;
}
.KineticsData {
# border: 1px solid gray;
}
.KineticsData th {
width: 15em;
word-wrap: none;
}
.KineticsData td {
width: 3em;
}
.chemkin, .KineticsData_repr {
white-space: pre-wrap;
font-size: x-small;
font-family: "Andale Mono", monospace;
}
.hide_comment .comment{
display: none !important;
}
.hide_kinetics .kinetics{
display: none !important;
}
.hide_chemkin .chemkin{
display: none !important;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="../../../external/jquery.min.js"></script>
<script type="text/javascript">
function updateFamily(family) {
if (family.checked) {
$("."+family.value).show();
} else {
$("."+family.value).hide();
}
}
function updateDetails(type) {
if (type.checked) {
$(".reactionList").removeClass("hide_"+type.value);
} else {
$(".reactionList").addClass("hide_"+type.value);
}
}
function checkAllFamilies() {
$("#familySelector").find("[name='family']").each(function() { this.checked = true; updateFamily(this); });
return false;
}
function uncheckAllFamilies() {
$("#familySelector").find("[name='family']").each(function() { this.checked = false; updateFamily(this); });
return false;
}
function checkAllDetails() {
$("#familySelector").find("[name='detail']").each(function() { this.checked = true; updateDetails(this); });
return false;
}
function uncheckAllDetails() {
$("#familySelector").find("[name='detail']").each(function() { this.checked = false; updateDetails(this); });
return false;
}
$(document).ready(function() {
checkAllFamilies();
uncheckAllDetails();
});
</script>
</head>
<body>
<h1>{{ title }}</h1>
<h2 align="center">Common Species ({{ commonSpecies|length }})</h2>
<table width="100%">
{% for spec1, spec2 in commonSpecies %}
<tr>
<td width="100%" colspan="4">
<table align="center">
<tr class="species">
<td>{{ spec1.label }}</td>
<td class="structure" align="center"><a href="{{spec1.molecule[0].getURL()}}"><img src="species1/{{ spec1|replace('#','%23') }}.png" alt="{{ spec1 }}" title="{{ spec1 }}"></a></td>
<td>{{ "%.2f"|format(spec1.molecule[0].getMolecularWeight() * 1000) }}</td>
</tr>
</table>
</td>
</tr>
{% if spec1.thermo and spec2.thermo %}
{% if spec1.thermo.isIdenticalTo(spec2.thermo) %}
<tr width=100%>
<td colspan="4" valign="top" width=50%><div align="center"><font color="blue">IDENTICAL THERMO WAS FOUND FOR THIS SPECIES.</font></div>
</tr>
{% elif spec1.thermo.isSimilarTo(spec2.thermo) %}
<tr width=100%>
<td colspan="4" valign="top" width=50%><div align="center"><font color="green">SIMILAR THERMO WAS FOUND FOR THIS SPECIES.</font></div>
</tr>
{% else %}
<tr width=100%>
<td colspan="4" valign="top" width=50%><div align="center"><font color="red">DIFFERENT THERMO WAS FOUND FOR THIS SPECIES.</font></div>
</tr>
{% endif%}
<tr>
<td width="10%">{{ spec1.index }}. </td>
<td width="40%">
<table width="100%">
<tr>
<th>H300</th>
<th>S300</th>
<th>Cp300</th>
<th>Cp500</th>
<th>Cp1000</th>
<th>Cp1500</th>
</tr>
<tr>
<td>{% if spec1.thermo.Tmin.value_si <= 300 %}
{{ "%.2f"|format(spec1.thermo.getEnthalpy(300) / 4184) }}
{% endif %}</td>
<td>
{% if spec1.thermo.Tmin.value_si <= 300 %}
{{ "%.2f"|format(spec1.thermo.getEntropy(300) / 4.184) }}
{% endif %}</td>
<td>{{ "%.2f"|format(spec1.thermo.getHeatCapacity(300) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec1.thermo.getHeatCapacity(500) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec1.thermo.getHeatCapacity(1000) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec1.thermo.getHeatCapacity(1500) / 4.184) }}</td>
</tr>
</table>
</td>
<td width="10%">{{ spec2.index }}.</td>
<td width="40%">
<table width="100%">
<tr>
<th>H300</th>
<th>S300</th>
<th>Cp300</th>
<th>Cp500</th>
<th>Cp1000</th>
<th>Cp1500</th>
</tr>
<tr>
<td>{% if spec2.thermo.Tmin.value_si <= 300 %}
{{ "%.2f"|format(spec2.thermo.getEnthalpy(300) / 4184) }}
{% endif %}</td>
<td>{% if spec2.thermo.Tmin.value_si <= 300 %}
{{ "%.2f"|format(spec2.thermo.getEntropy(300) / 4.184) }}
{% endif %}</td>
<td>{{ "%.2f"|format(spec2.thermo.getHeatCapacity(300) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec2.thermo.getHeatCapacity(500) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec2.thermo.getHeatCapacity(1000) / 4.184) }}</td>
<td>{{ "%.2f"|format(spec2.thermo.getHeatCapacity(1500) / 4.184) }}</td>
</tr>
</table>
</td>
</tr>
{% endif %}
<tr>
<td width="100%" colspan="4"><hr/></td>
</tr>
{% endfor %}
</table>
<table width=100%>
<tr colspan="2">
<td width=50% valign="top">
<h2>Model 1: Unique Species ({{ speciesList1|length }})</h2>
<table class="speciesList">
<tr><th>Index</th><th>Structure</th><th>Label</th><th>Mol. Wt. (g/mol)</th></tr>
{% for spec in speciesList1 %}
<tr class="species">
<td class="index">
{{ spec.index }}.</td>
<td class="structure"><a href="{{ spec.molecule[0].getURL() }}"><img src="species1/{{ spec|replace('#','%23') }}.png" alt="{{ spec }}" title="{{ spec }}"></a></td>
<td class="label">{{ spec.label }}</td>
<td>{{ "%.2f"|format(spec.molecule[0].getMolecularWeight() * 1000) }}</td>
</tr>
{% endfor %}
</table>
</td>
<td width=50% valign="top">
<h2>Model 2: Unique Species ({{ speciesList2|length }})</h2>
<table class="speciesList">
<tr><th>Index</th><th>Structure</th><th>Label</th><th>Mol. Wt. (g/mol)</th></tr>
{% for spec in speciesList2 %}
<tr class="species">
<td class="index">
{{ spec.index }}.</td>
<td class="structure"><a href="{{ spec.molecule[0].getURL() }}"><img src="species2/{{ spec|replace('#','%23') }}.png" alt="{{ spec }}" title="{{ spec }}"></a></td>
<td class="label">{{ spec.label }}</td>
<td>{{ "%.2f"|format(spec.molecule[0].getMolecularWeight() * 1000) }}</td>
</tr>
{% endfor %}
</table>
</td></tr>
<tr colspan="2">
<td width=50% valign="top">
<h2>Model 1 Reactions ({{ commonReactions|length + uniqueReactions1|length}})</h2>
<form id='familySelector' action="">
<h4>Reaction families:</h4>
{% for family in families1 %} <input type="checkbox" id="{{ family|csssafe }}" name="family" value="{{ family|csssafe }}" checked="checked" onclick="updateFamily(this);"><label for="{{ family|csssafe }}">{{ family }} ({{ familyCount1[family] }} rxn{{ 's' if familyCount1[family] != 1 }})</label><br>
{% endfor %}
<a href="javascript:checkAllFamilies();" onclick="checkAllFamilies()">check all</a> <a href="javascript:uncheckAllFamilies();" onclick="uncheckAllFamilies();">uncheck all</a><br>
<h4>Reaction Details:</h4>
<input type="checkbox" id="kinetics" name="detail" value="kinetics" onclick="updateDetails(this);"><label for="kinetics">Kinetics</label><br>
<input type="checkbox" id="comment" name="detail" value="comment" onclick="updateDetails(this);"><label for="comment">Comments</label><br>
<input type="checkbox" id="chemkin" name="detail" value="chemkin" onclick="updateDetails(this);"><label for="chemkin">Chemkin strings</label><br>
<a href="javascript:checkAllDetails();" onclick="checkAllDetails()">check all</a> <a href="javascript:uncheckAllDetails();" onclick="uncheckAllDetails();">uncheck all</a>
</form>
</td>
<td width=50% valign="top">
<h2>Model 2 Reactions ({{ commonReactions|length +uniqueReactions2|length}})</h2>
<form id='familySelector' action="">
<h4>Reaction families:</h4>
{% for family in families2 %} <input type="checkbox" id="{{ family|csssafe }}" name="family" value="{{ family|csssafe }}" checked="checked" onclick="updateFamily(this);"><label for="{{ family|csssafe }}">{{ family }} ({{ familyCount2[family] }} rxn{{ 's' if familyCount2[family] != 1 }})</label><br>
{% endfor %}
<a href="javascript:checkAllFamilies();" onclick="checkAllFamilies()">check all</a> <a href="javascript:uncheckAllFamilies();" onclick="uncheckAllFamilies();">uncheck all</a><br>
<h4>Reaction Details:</h4>
<input type="checkbox" id="kinetics" name="detail" value="kinetics" onclick="updateDetails(this);"><label for="kinetics">Kinetics</label><br>
<input type="checkbox" id="comment" name="detail" value="comment" onclick="updateDetails(this);"><label for="comment">Comments</label><br>
<input type="checkbox" id="chemkin" name="detail" value="chemkin" onclick="updateDetails(this);"><label for="chemkin">Chemkin strings</label><br>
<a href="javascript:checkAllDetails();" onclick="checkAllDetails()">check all</a> <a href="javascript:uncheckAllDetails();" onclick="uncheckAllDetails();">uncheck all</a>
</form>
</td>
</tr>
</table>
<table width=100%>
<tr><td width=100% align="center">
<h2>Common Reactions ({{ commonReactions|length}})</h2></td></tr>
<tr colspan="1"><td width=100%>
<table class="reactionList hide_comment hide_kinetics hide_chemkin" width=100% cellpadding="10">
<tr colspan="4" width=100%><th>Index.</th><th>Family</th><th>Index.</th><th>Family</th></tr>
{% for rxn1, rxn2 in commonReactions %}
<tr>
<td width=100% colspan="4"><hr>
<table align="center">
<tr>
<td class="reactants" align="right">{% for reactant in rxn1.reactants %}<a href="{{reactant.molecule[0].getURL() }}"><img src="species1/{{ reactant|replace('#','%23') }}.png" alt="{{ reactant }}" title="{{ reactant }}, MW = {{ "%.2f"|format(reactant.molecule[0].getMolecularWeight() * 1000) }}"></a>{% if not loop.last %} + {% endif %}{% endfor %}</td>
<td class="reactionArrow" align="center">{% if rxn1.reversible %}⇔{% else %}→{% endif %}</td>
<td class="products" align="left">{% for product in rxn1.products %}<a href="{{product.molecule[0].getURL()}}"><img src="species1/{{ product|replace('#','%23') }}.png" alt="{{ product }}" title="{{ product }}, MW = {{ "%.2f"|format(product.molecule[0].getMolecularWeight() * 1000) }}"></a>{% if not loop.last %} + {% endif %}{% endfor %}</td>
</tr>
</table>
</td>
</tr>
{% if rxn1.kinetics.isIdenticalTo(rxn2.kinetics) %}
<tr width=100%>
<td colspan="4" valign="top" width=50%><div align="center"><font color="blue">IDENTICAL KINETICS WERE FOUND FOR THIS REACTION.</font></div>
</tr>
{% elif rxn1.kinetics.isSimilarTo(rxn2.kinetics) %}
<tr width=100%>
<td colspan="4" valign="top" width=50%><div align="center"><font color="green">SIMILAR KINETICS WERE FOUND FOR THIS REACTION.</font></div>
</tr>
{% else %}
<tr width=100%>
<td colspan="4" valign="top" width=50%><div align="center"><font color="red">DIFFERENT KINETICS WERE FOUND FOR THIS REACTION.</font></div>
</tr>
{% endif%}
<tr width=100%>
<td class="index" width=10%><a href="{{ rxn1.getURL() }}" title="Search on RMG website" class="searchlink">{{ rxn1.index }}.</a></td>
<td class="family" width=40%>{{ rxn1.getSource().label }}</td>
<td class="index" width=10%><a href="{{ rxn2.getURL() }}" title="Search on RMG website" class="searchlink">{{ rxn2.index }}.</a></td>
<td class="family" width=40%>{{ rxn2.getSource().label }}</td>
</tr>
<tr width=100%>{% if not rxn1.isIsomorphic(rxn2, eitherDirection=False) %}
<td colspan="2" width=50%></td>
<td colspan="2" width=50%>* Reaction was found in reverse
{% if not rxn2.duplicate %}
<P><b>Fitted Reverse Kinetics:</b>
{% if not rxn2.kinetics.isPressureDependent() %}
{{rxn2.generateReverseRateCoefficient().toHTML() }}
{% else %} Pressure dependent
{% endif %}
{% endif %}
<P><b>Original Kinetics:</b>
{% endif %}</td>
</tr>
<tr width=100%>
<td colspan="2" valign="top" width=50%>
{{ rxn1.kinetics.toHTML() }}</td>
<td colspan="2" valign="top" width=50%>
{{ rxn2.kinetics.toHTML() }}</td>
</tr>
<tr width=100%>
<td colspan="2" valign="top" width=50%><font size="1pt" face="courier">{{ rxn1.toChemkin(speciesList) }}</font></td>
<td colspan="2" valign="top" width=50%><font size="1pt" face="courier">{{ rxn2.toChemkin(speciesList) }}</font></td>
</tr>
<tr width=100%>
<td colspan="2" valign="top" width=50%><font size="1pt">{{ rxn1.kinetics.comment }}</font></td>
<td colspan="2" valign="top" width=50%><font size="1pt">{{ rxn2.kinetics.comment }}</font></td>
</tr>
{% endfor %}
</table>
</td></tr></table>
<table>
<tr>
<td width=50% valign="top">
<h2>Model 1: Unique Reactions ({{ uniqueReactions1|length}})</h2>
<table class="reactionList hide_comment hide_kinetics hide_chemkin">
<tr><th>Index</th><th colspan="3" style="text-align: center;">Reaction</th><th>Family</th></tr>
{% for rxn in uniqueReactions1 %}
<tr class="reaction {{ rxn.getSource().label|csssafe }}">
<td class="index"><a href="{{ rxn.getURL() }}" title="Search on RMG website" class="searchlink">{{ rxn.index }}.</a></td>
<td class="reactants">{% for reactant in rxn.reactants %}<a href="{{ reactant.molecule[0].getURL() }}"><img src="species1/{{ reactant|replace('#','%23') }}.png" alt="{{ reactant }}" title="{{ reactant }}, MW = {{ "%.2f"|format(reactant.molecule[0].getMolecularWeight() * 1000) }}"></a>{% if not loop.last %} + {% endif %}{% endfor %}</td>
<td class="reactionArrow">{% if rxn.reversible %}⇔{% else %}→{% endif %}</td>
<td class="products">{% for product in rxn.products %}<a href="{{ product.molecule[0].getURL() }}"><img src="species1/{{ product|replace('#','%23') }}.png" alt="{{ product }}" title="{{ product }}, MW = {{ "%.2f"|format(product.molecule[0].getMolecularWeight() * 1000) }}"></a>{% if not loop.last %} + {% endif %}{% endfor %}</td>
<td class="family">{{ rxn.getSource().label }}</td>
</tr>
<tr class="kinetics {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.kinetics.toHTML() }}</td>
</tr>
<tr class="chemkin {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.toChemkin(species) }}</td>
</tr>
<tr class="comment {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.kinetics.comment }}</td>
</tr>
{% endfor %}
</table>
</td>
<td width=50% valign="top">
<h2>Model 2: Unique Reactions ({{ uniqueReactions2|length}})</h2>
<table class="reactionList hide_comment hide_kinetics hide_chemkin">
<tr><th>Index</th><th colspan="3" style="text-align: center;">Reaction</th><th>Family</th></tr>
{% for rxn in uniqueReactions2 %}
<tr class="reaction {{ rxn.getSource().label|csssafe }}">
<td class="index"><a href="{{ rxn.getURL() }}" title="Search on RMG website" class="searchlink">{{ rxn.index }}.</a></td>
<td class="reactants">{% for reactant in rxn.reactants %}<a href="{{ reactant.molecule[0].getURL() }}"><img src="species2/{{ reactant|replace('#','%23') }}.png" alt="{{ reactant }}" title="{{ reactant }}, MW = {{ "%.2f"|format(reactant.molecule[0].getMolecularWeight() * 1000) }}"></a>{% if not loop.last %} + {% endif %}{% endfor %}</td>
<td class="reactionArrow">{% if rxn.reversible %}⇔{% else %}→{% endif %}</td>
<td class="products">{% for product in rxn.products %}<a href="{{ product.molecule[0].getURL() }}"><img src="species2/{{ product|replace('#','%23') }}.png" alt="{{ product }}" title="{{ product }}, MW = {{ "%.2f"|format(product.molecule[0].getMolecularWeight() * 1000) }}"></a>{% if not loop.last %} + {% endif %}{% endfor %}</td>
<td class="family">{{ rxn.getSource().label }}</td>
</tr>
<tr class="kinetics {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.kinetics.toHTML() }}</td>
</tr>
<tr class="chemkin {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.toChemkin(species) }}</td>
</tr>
<tr class="comment {{ rxn.getSource().label|csssafe }}">
<td></td>
<td colspan="4">{{ rxn.kinetics.comment }}</td>
</tr>
{% endfor %}
</table>
</td>
</table>
</body>
</html>
""")
f = open(path, 'w')
f.write(template.render(title=title, commonSpecies=commonSpeciesList, speciesList1=speciesList1, speciesList2 = speciesList2, commonReactions=commonReactions, uniqueReactions1=uniqueReactions1, uniqueReactions2=uniqueReactions2, families1=families1, families2=families2, familyCount1=familyCount1,familyCount2=familyCount2, speciesList=speciesList))
f.close()
| 40.290323
| 356
| 0.565168
| 5,307
| 47,462
| 5.039759
| 0.099114
| 0.01331
| 0.010095
| 0.009422
| 0.823338
| 0.808831
| 0.782023
| 0.771779
| 0.760861
| 0.724407
| 0
| 0.028229
| 0.246892
| 47,462
| 1,177
| 357
| 40.324554
| 0.720037
| 0.066011
| 0
| 0.566667
| 0
| 0.027778
| 0.126455
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.022222
| false
| 0.005556
| 0.072222
| 0
| 0.122222
| 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
|
7371d21f48d1725ef195513f68a4b8320495fa73
| 30
|
py
|
Python
|
robots/small/strategies/2019/test/rozi_test_dj/init.py
|
memristor/mep2
|
bc5cddacba3d740f791f3454b8cb51bda83ce202
|
[
"MIT"
] | 5
|
2018-11-27T15:15:00.000Z
|
2022-02-10T21:44:13.000Z
|
robots/small/strategies/2019/test/rozi_test_dj/init.py
|
memristor/mep2
|
bc5cddacba3d740f791f3454b8cb51bda83ce202
|
[
"MIT"
] | 2
|
2018-10-20T15:48:40.000Z
|
2018-11-20T05:11:33.000Z
|
robots/small/strategies/2019/test/rozi_test_dj/init.py
|
memristor/mep2
|
bc5cddacba3d740f791f3454b8cb51bda83ce202
|
[
"MIT"
] | 1
|
2020-02-07T12:44:47.000Z
|
2020-02-07T12:44:47.000Z
|
def run():
r.setpos(0,0,0)
| 6
| 16
| 0.533333
| 7
| 30
| 2.285714
| 0.714286
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 0.2
| 30
| 4
| 17
| 7.5
| 0.541667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
737f5c6dfbab05bcb783835b262a0f8d11eea86c
| 48
|
py
|
Python
|
helloworld.py
|
gti-bing/E71-2021-bing-yue
|
1d824fe28818b6fa1fa59e501260ed6af48f08d1
|
[
"Apache-2.0"
] | null | null | null |
helloworld.py
|
gti-bing/E71-2021-bing-yue
|
1d824fe28818b6fa1fa59e501260ed6af48f08d1
|
[
"Apache-2.0"
] | null | null | null |
helloworld.py
|
gti-bing/E71-2021-bing-yue
|
1d824fe28818b6fa1fa59e501260ed6af48f08d1
|
[
"Apache-2.0"
] | null | null | null |
import sys
print("Hello, %s!" % (sys.argv[1]))
| 12
| 35
| 0.583333
| 8
| 48
| 3.5
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02439
| 0.145833
| 48
| 3
| 36
| 16
| 0.658537
| 0
| 0
| 0
| 0
| 0
| 0.208333
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 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
| 0
| 1
|
0
| 6
|
73ea41db410921c8c568ecc7ce5ebf5bf0cc94e4
| 211
|
py
|
Python
|
notifier.py
|
daflippingarnold864/Computer_Science_Academy
|
a809b1cd514b38543aa1fe92a9093601ccd5f047
|
[
"MIT"
] | 1
|
2017-08-15T15:58:40.000Z
|
2017-08-15T15:58:40.000Z
|
notifier.py
|
daflippingarnold864/Computer_Science_Academy
|
a809b1cd514b38543aa1fe92a9093601ccd5f047
|
[
"MIT"
] | null | null | null |
notifier.py
|
daflippingarnold864/Computer_Science_Academy
|
a809b1cd514b38543aa1fe92a9093601ccd5f047
|
[
"MIT"
] | null | null | null |
class Notifier:
def __init(self):
pass
def notify(self, msg):
print(msg)
def message(self, msg):
print(msg)
def message2(self, msg2):
print(msg2)
| 17.583333
| 30
| 0.507109
| 24
| 211
| 4.375
| 0.5
| 0.133333
| 0.228571
| 0.285714
| 0.342857
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023256
| 0.388626
| 211
| 12
| 31
| 17.583333
| 0.790698
| 0
| 0
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.444444
| false
| 0.111111
| 0
| 0
| 0.555556
| 0.333333
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 6
|
fbbc573e918419a58c39dd9dc3ae4b58ae5516ce
| 800
|
py
|
Python
|
venv/Lib/site-packages/tensorflow/profiler/__init__.py
|
caiovini/Image_reader_api
|
7fae630a17195d3415eb739278ef21a3b58cae76
|
[
"MIT"
] | null | null | null |
venv/Lib/site-packages/tensorflow/profiler/__init__.py
|
caiovini/Image_reader_api
|
7fae630a17195d3415eb739278ef21a3b58cae76
|
[
"MIT"
] | null | null | null |
venv/Lib/site-packages/tensorflow/profiler/__init__.py
|
caiovini/Image_reader_api
|
7fae630a17195d3415eb739278ef21a3b58cae76
|
[
"MIT"
] | null | null | null |
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/tools/api/generator/create_python_api.py script.
"""Public API for tf.profiler namespace.
"""
from __future__ import print_function
from tensorflow.python.profiler.model_analyzer import Profiler
from tensorflow.python.profiler.model_analyzer import advise
from tensorflow.python.profiler.model_analyzer import profile
from tensorflow.python.profiler.option_builder import ProfileOptionBuilder
from tensorflow.python.profiler.profiler import AdviceProto
from tensorflow.python.profiler.profiler import GraphNodeProto
from tensorflow.python.profiler.profiler import MultiGraphNodeProto
from tensorflow.python.profiler.profiler import OpLogProto
from tensorflow.python.profiler.profiler import write_op_log
del print_function
| 42.105263
| 75
| 0.86125
| 102
| 800
| 6.617647
| 0.411765
| 0.186667
| 0.266667
| 0.373333
| 0.52
| 0.52
| 0.208889
| 0
| 0
| 0
| 0
| 0
| 0.08125
| 800
| 18
| 76
| 44.444444
| 0.918367
| 0.19625
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.909091
| 0
| 0.909091
| 0.181818
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
83b3c48a7622307f3b7a44bf43fec1c7f7ca2ce7
| 21,126
|
py
|
Python
|
dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Core/test_variable.py
|
aleasims/Peach
|
bb56841e943d719d5101fee0a503ed34308eda04
|
[
"MIT"
] | null | null | null |
dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Core/test_variable.py
|
aleasims/Peach
|
bb56841e943d719d5101fee0a503ed34308eda04
|
[
"MIT"
] | null | null | null |
dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Core/test_variable.py
|
aleasims/Peach
|
bb56841e943d719d5101fee0a503ed34308eda04
|
[
"MIT"
] | 1
|
2020-07-26T03:57:45.000Z
|
2020-07-26T03:57:45.000Z
|
from Xml.Xslt import test_harness
from Ft.Xml.Xslt import XsltException, Error
from Ft.Xml.XPath import RuntimeException
sheet_1 = """<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:n="http://spam.com"
version="1.0"
>
<xsl:template match="/">
<HTML>
<HEAD><TITLE>Address Book</TITLE>
</HEAD>
<BODY>
<TABLE><xsl:apply-templates/></TABLE>
</BODY>
</HTML>
</xsl:template>
<xsl:variable name='a'>1</xsl:variable>
<xsl:variable name='width' select='100'></xsl:variable>
<xsl:variable name='c'></xsl:variable>
<xsl:template match="ENTRY">
<!-- Make sure shadowing check isn't overzealous -->
<xsl:param name='n:a' select='ok'/>
<!-- Tests legal shadowing -->
<xsl:variable name='a'>boo</xsl:variable>
<xsl:element name='TR'>
<xsl:apply-templates select='NAME'/>
</xsl:element>
</xsl:template>
<xsl:template match="NAME">
<xsl:variable name='d' select='.'></xsl:variable>
<TD WIDTH='{$d}'>
<B><xsl:apply-templates/></B>
</TD>
</xsl:template>
</xsl:stylesheet>
"""
sheet_2 = """<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name='override' select='"abc"'/>
<xsl:param name='list' select='foo'/>
<xsl:template match="/">
<doc>
<overridden><xsl:value-of select='$override'/></overridden>
<list><xsl:apply-templates select="$list"/></list>
</doc>
</xsl:template>
<xsl:template match="text()">
<item><xsl:value-of select="."/></item>
</xsl:template>
</xsl:stylesheet>
"""
sheet_2a = """<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:x="urn:bogus:x"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:param name='x:override' select='"abc"'/>
<xsl:template match="/">
<overridden><xsl:value-of select='$x:override'/></overridden>
</xsl:template>
</xsl:stylesheet>
"""
sheet_2b = """<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:x="urn:bogus:x"
xmlns:y="urn:bogus:y"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:param name='x:override' select='"abc"'/>
<xsl:param name='y:override' select='"abc"'/>
<xsl:template match="/">
<overridden1><xsl:value-of select='$x:override'/></overridden1>
<overridden2><xsl:value-of select='$y:override'/></overridden2>
</xsl:template>
</xsl:stylesheet>
"""
sheet_2c = """<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:param xmlns:x="urn:bogus:x" name='x:override' select='"abc"'/>
<xsl:param xmlns:x="urn:bogus:xxx" name='x:override' select='"abc"'/>
<xsl:template match="/">
<overridden1><xsl:value-of xmlns:x="urn:bogus:x" select='$x:override'/></overridden1>
<overridden2><xsl:value-of xmlns:x="urn:bogus:xxx" select='$x:override'/></overridden2>
</xsl:template>
</xsl:stylesheet>
"""
sheet_3a = """<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name='a' select='"foo"'/>
<xsl:variable name='b' select='concat($a, "bar")'/>
<xsl:template match="/">
<doc>
<a><xsl:value-of select='$a'/></a>
<b><xsl:value-of select='$b'/></b>
</doc>
</xsl:template>
</xsl:stylesheet>
"""
sheet_3b = """<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name='a' select='"foo"'/>
<xsl:param name='b' select='concat($a, "bar")'/>
<xsl:template match="/">
<doc>
<a><xsl:value-of select='$a'/></a>
<b><xsl:value-of select='$b'/></b>
</doc>
</xsl:template>
</xsl:stylesheet>"""
sheet_3c = """<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="color" select="'red'"/>
<xsl:param name="type" select="'ink'"/>
<xsl:param name="top-level-params">
<p><xsl:value-of select="$color"/></p>
<p><xsl:value-of select="$type"/></p>
</xsl:param>
<xsl:template match="/">
<foo>
<xsl:copy-of select="$top-level-params"/>
</foo>
</xsl:template>
</xsl:stylesheet>"""
sheet_3d = """<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="color" select="'red'"/>
<xsl:param name="type" select="'ink'"/>
<xsl:variable name="top-level-params">
<p><xsl:value-of select="$color"/></p>
<p><xsl:value-of select="$type"/></p>
</xsl:variable>
<xsl:template match="/">
<foo>
<xsl:copy-of select="$top-level-params"/>
</foo>
</xsl:template>
</xsl:stylesheet>"""
sheet_4 = """<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name='a' select='"foo"'/>
<xsl:variable name='b'>
<xsl:value-of select='$a'/>
</xsl:variable>
<xsl:variable name='c'>
<x y='{$a}'/>
</xsl:variable>
<xsl:variable name='d'>
<xsl:for-each select="/">
<xsl:if test=".">
<x y='{$a}'/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:template match="/">
<doc>
<a><xsl:value-of select='$a'/></a>
<b><xsl:value-of select='$b'/></b>
<c><xsl:copy-of select='$c'/></c>
<d><xsl:copy-of select='$d'/></d>
</doc>
</xsl:template>
</xsl:stylesheet>
"""
sheet_5 = """<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<xsl:variable name="a">
<!-- OK because outer binding not yet visible -->
<xsl:variable name="a" select="'foo'"/>
<!-- inner binding now 'foo' -->
<!-- now create value for outer binding -->
<xsl:choose>
<xsl:when test="$a = 'foo'">hello</xsl:when>
<xsl:otherwise>world</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- outer binding now visible; should be 'hello' -->
<doc>
<a><xsl:value-of select='$a'/></a>
</doc>
</xsl:template>
</xsl:stylesheet>
"""
#This is a global variable binding which depends on other global variable
#bindings by reference in an invoked template
sheet_6 = """<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:variable name="a" select="1"/>
<xsl:variable name="b">
<a><xsl:value-of select='$a'/></a>
<b>
<xsl:apply-templates select='document("")/*/xsl:variable'/>
</b>
</xsl:variable>
<xsl:template match="xsl:variable">
<var>
<a><xsl:value-of select='$a'/></a>
</var>
</xsl:template>
<xsl:template match="/">
<doc>
<xsl:copy-of select='$b'/>
</doc>
</xsl:template>
</xsl:stylesheet>
"""
invalid_sheet_1 = """\
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:variable name='x' select='a'/>
<xsl:template match="/">
<xsl:variable name='x' select='b'/>
<xsl:value-of select='$x'/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ENTRY">
<xsl:variable name='x' select='c'/>
<doc>
<xsl:variable name='x' select='d'/>
<xsl:value-of select='$x'/>
</doc>
</xsl:template>
</xsl:stylesheet>
"""
invalid_sheet_2 = """\
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:variable name='x' select='a'/>
<xsl:template match="/">
<xsl:variable name='x' select='b'/>
<xsl:value-of select='$x'/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ENTRY">
<xsl:variable name='x' select='c'/>
<xsl:variable name='x' select='d'/>
<doc>
<xsl:value-of select='$x'/>
</doc>
</xsl:template>
</xsl:stylesheet>
"""
invalid_sheet_3 = """\
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:variable name='image-name' select='a'/>
<xsl:template name="dummy">
<xsl:param name="p1"/>
<xsl:param name="p2" select="1"/>
<xsl:variable name="image-name" select="''"/>
<a href='{$image-name}'>
<img height="24" width="32" border="0" src="{$image-name}.gif" name="{$image-name}"/>
</a>
<img height="24" width="32" border="0" src="{$image-name}.gif" name="{$image-name}"/>
<xsl:variable name="image-name" select="'a'"/>
<xsl:variable name="image-name" select="'b'"/>
<img height="24" width="32" border="0" src="{$image-name}.gif" name="{$image-name}"/>
</xsl:template>
</xsl:stylesheet>
"""
invalid_sheet_4 = """\
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:variable name='x' select='a'/>
<xsl:variable name='x' select='b'/>
<xsl:template match="/">
<xsl:variable name='y' select='b'/>
<xsl:value-of select='$x'/>
</xsl:template>
</xsl:stylesheet>
"""
invalid_sheet_5 = """\
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:variable name='x' select='a'/>
<xsl:param name='x' select='b'/>
<xsl:template match="/">
<xsl:variable name='y' select='b'/>
<xsl:value-of select='$x'/>
</xsl:template>
</xsl:stylesheet>
"""
invalid_sheet_6 = """\
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name='x' select='a'/>
<xsl:param name='x' select='b'/>
<xsl:template match="/">
<xsl:variable name='y' select='b'/>
<xsl:value-of select='$x'/>
</xsl:template>
</xsl:stylesheet>
"""
invalid_sheet_7 = """<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<!-- can't have both select and content -->
<xsl:variable name="a" select="'hello'">world</xsl:variable>
<doc>
<a><xsl:value-of select='$a'/></a>
</doc>
</xsl:template>
</xsl:stylesheet>
"""
invalid_sheet_8 = """\
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:variable name='x' select='a'/>
<xsl:template match="/">
<xsl:variable name='x' select='b'/>
<xsl:value-of select='$x'/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template name="ENTRY">
<xsl:variable name='x' select='c'/>
<doc>
<xsl:variable name='x' select='d'/>
<xsl:value-of select='$x'/>
</doc>
</xsl:template>
</xsl:stylesheet>
"""
invalid_sheet_9 = """<?xml version="1.0" encoding="utf-8"?>
<xsl:transform
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<xsl:variable name="invisible">Am I invisible?</xsl:variable>
<xsl:apply-templates select="." mode="another"/>
<xsl:call-template name="another"/>
</xsl:template>
<xsl:template match="*" mode="another">
apply-templates: <xsl:value-of select="$invisible"/>
</xsl:template>
<xsl:template name="another">
call-template: <xsl:value-of select="$invisible"/>
</xsl:template>
</xsl:transform>"""
# SourceForge bug #659626
invalid_sheet_10 = """<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:variable name="foo">
<xsl:call-template name="bar">
<xsl:with-param name="path" select="'/a/b/c'"/>
</xsl:call-template>
</xsl:variable>
<xsl:template match="/">
foo: <xsl:value-of select="$foo"/>
path: <xsl:value-of select="$path"/>
</xsl:template>
<xsl:template name="bar">
<xsl:param name="path"/>
<xsl:value-of select="translate($path,'abc','ABC')"/>
</xsl:template>
</xsl:stylesheet>"""
# variation on previous
invalid_sheet_11 = """<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<xsl:variable name="foo">
<xsl:call-template name="bar">
<xsl:with-param name="path" select="'/a/b/c'"/>
</xsl:call-template>
</xsl:variable>
foo: <xsl:value-of select="$foo"/>
path: <xsl:value-of select="$path"/>
</xsl:template>
<xsl:template name="bar">
<xsl:param name="path"/>
<xsl:value-of select="translate($path,'abc','ABC')"/>
</xsl:template>
</xsl:stylesheet>"""
source_2 = """
<dummy/>
"""
expected_1 = """<HTML xmlns:n='http://spam.com'>
<HEAD>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<TITLE>Address Book</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD WIDTH='Pieter Aaron'><B>Pieter Aaron</B></TD>
</TR>
<TR>
<TD WIDTH='Emeka Ndubuisi'><B>Emeka Ndubuisi</B></TD>
</TR>
<TR>
<TD WIDTH='Vasia Zhugenev'><B>Vasia Zhugenev</B></TD>
</TR>
</TABLE>
</BODY>
</HTML>"""
expected_2 = """<?xml version='1.0' encoding='UTF-8'?>
<doc><overridden>xyz</overridden><list><item>a</item><item>b</item><item>c</item></list></doc>"""
expected_2a = """<?xml version="1.0" encoding="UTF-8"?>\n<overridden xmlns:x="urn:foo">xyz</overridden>"""
expected_2b = """<?xml version="1.0" encoding="UTF-8"?>\n<overridden1 xmlns:y="urn:bogus:y" xmlns:x="urn:bogus:x">xyz</overridden1><overridden2 xmlns:y="urn:bogus:y" xmlns:x="urn:bogus:x">abc</overridden2>"""
expected_2c = """<?xml version="1.0" encoding="UTF-8"?>\n<overridden1>xyz</overridden1><overridden2>abc</overridden2>"""
expected_3 = """<?xml version='1.0' encoding='UTF-8'?>
<doc><a>foo</a><b>foobar</b></doc>"""
expected_3c = """<?xml version='1.0' encoding='UTF-8'?>
<foo><p>red</p><p>ink</p></foo>"""
expected_3d = """<?xml version='1.0' encoding='UTF-8'?>
<foo><p>red</p><p>ink</p></foo>"""
expected_4 = """<?xml version='1.0' encoding='UTF-8'?>
<doc><a>foo</a><b>foo</b><c><x y='foo'/></c><d><x y='foo'/></d></doc>"""
expected_5 = """<?xml version='1.0' encoding='UTF-8'?>
<doc><a>hello</a></doc>"""
expected_6 = """<?xml version='1.0' encoding='UTF-8'?>
<doc><a>1</a><b><var><a>1</a></var><var><a>1</a></var></b></doc>"""
def Test(tester):
source = test_harness.FileInfo(uri="Xml/Xslt/Core/addr_book1.xml")
sheet = test_harness.FileInfo(string=sheet_1)
test_harness.XsltTest(tester, source, [sheet], expected_1,
title='Usage')
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=sheet_2)
test_harness.XsltTest(tester, source, [sheet], expected_2,
topLevelParams={'override' : 'xyz',
'list' : ['a', 'b', 'c']},
title="Top-level param override")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=sheet_2a)
test_harness.XsltTest(tester, source, [sheet], expected_2a,
topLevelParams={'x:override' : 'xyz'},
title="Top-level param override using QName")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=sheet_2b)
test_harness.XsltTest(tester, source, [sheet], expected_2b,
topLevelParams={'x:override' : 'xyz'},
title="Top-level param override using QName 2")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=sheet_2c)
test_harness.XsltTest(tester, source, [sheet], expected_2c,
topLevelParams={('urn:bogus:x', u'override'): 'xyz'},
title="Top-level param override using QName with prefix ambiguity")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=sheet_3a)
test_harness.XsltTest(tester, source, [sheet], expected_3,
title="Top-level variable depends on top-level param 1")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=sheet_3b)
test_harness.XsltTest(tester, source, [sheet], expected_3,
title="Top-level param depends on top-level param 1")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=sheet_3c)
test_harness.XsltTest(tester, source, [sheet], expected_3c,
title="Top-level param w/RTF depends on top-level param 1")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=sheet_3d)
test_harness.XsltTest(tester, source, [sheet], expected_3d,
title="Top-level variable w/RTF depends on 2 top-level params 1")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=sheet_4)
test_harness.XsltTest(tester, source, [sheet], expected_4,
title="Top-level variable depends on top-level param 2")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=sheet_5)
test_harness.XsltTest(tester, source, [sheet], expected_5,
title="Binding not visible until following sibling")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=sheet_6)
test_harness.XsltTest(tester, source, [sheet], expected_6,
title="Global dependence through an applied template")
source = test_harness.FileInfo(uri="Xml/Xslt/Core/addr_book1.xml")
sheet = test_harness.FileInfo(string=invalid_sheet_1)
test_harness.XsltTest(tester, source, [sheet], None,
exceptionCode=Error.ILLEGAL_SHADOWING,
title="Illegal shadowing 1")
source = test_harness.FileInfo(uri="Xml/Xslt/Core/addr_book1.xml")
sheet = test_harness.FileInfo(string=invalid_sheet_2)
test_harness.XsltTest(tester, source, [sheet], None,
exceptionCode=Error.ILLEGAL_SHADOWING,
title="Illegal shadowing 2")
source = test_harness.FileInfo(uri="Xml/Xslt/Core/addr_book1.xml")
sheet = test_harness.FileInfo(string=invalid_sheet_3)
test_harness.XsltTest(tester, source, [sheet], None,
exceptionCode=Error.ILLEGAL_SHADOWING,
title="Illegal shadowing 3")
source = test_harness.FileInfo(uri="Xml/Xslt/Core/addr_book1.xml")
sheet = test_harness.FileInfo(string=invalid_sheet_4)
test_harness.XsltTest(tester, source, [sheet], None,
exceptionCode=Error.DUPLICATE_TOP_LEVEL_VAR,
title="Illegal shadowing 4")
source = test_harness.FileInfo(uri="Xml/Xslt/Core/addr_book1.xml")
sheet = test_harness.FileInfo(string=invalid_sheet_5)
test_harness.XsltTest(tester, source, [sheet], None,
exceptionCode=Error.DUPLICATE_TOP_LEVEL_VAR,
title="Illegal shadowing 5")
source = test_harness.FileInfo(uri="Xml/Xslt/Core/addr_book1.xml")
sheet = test_harness.FileInfo(string=invalid_sheet_6)
test_harness.XsltTest(tester, source, [sheet], None,
exceptionCode=Error.DUPLICATE_TOP_LEVEL_VAR,
title="Illegal shadowing 6")
source = test_harness.FileInfo(uri="Xml/Xslt/Core/addr_book1.xml")
sheet = test_harness.FileInfo(string=invalid_sheet_8)
test_harness.XsltTest(tester, source, [sheet], None,
exceptionCode=Error.ILLEGAL_SHADOWING,
title="Illegal shadowing 7")
source = test_harness.FileInfo(uri="Xml/Xslt/Core/addr_book1.xml")
sheet = test_harness.FileInfo(string=invalid_sheet_7)
test_harness.XsltTest(tester, source, [sheet], None,
exceptionCode=Error.VAR_WITH_CONTENT_AND_SELECT,
title="Illegal content when select attribute present")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=invalid_sheet_9)
test_harness.XsltTest(tester, source, [sheet], None,
exceptionClass=RuntimeException,
exceptionCode=RuntimeException.UNDEFINED_VARIABLE,
title="Visibility of variables across templates")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=invalid_sheet_10)
test_harness.XsltTest(tester, source, [sheet], None,
exceptionClass=RuntimeException,
exceptionCode=RuntimeException.UNDEFINED_VARIABLE,
title="Param visibility when evaluating top-level variable")
source = test_harness.FileInfo(string=source_2)
sheet = test_harness.FileInfo(string=invalid_sheet_11)
test_harness.XsltTest(tester, source, [sheet], None,
exceptionClass=RuntimeException,
exceptionCode=RuntimeException.UNDEFINED_VARIABLE,
title="Param visibility")
return
| 29.260388
| 208
| 0.610149
| 2,807
| 21,126
| 4.519059
| 0.081226
| 0.060702
| 0.039732
| 0.035948
| 0.819945
| 0.777375
| 0.750808
| 0.702326
| 0.661175
| 0.636973
| 0
| 0.023675
| 0.188251
| 21,126
| 721
| 209
| 29.300971
| 0.716018
| 0.007621
| 0
| 0.612132
| 0
| 0.055147
| 0.676288
| 0.11083
| 0
| 0
| 0
| 0
| 0
| 1
| 0.001838
| false
| 0
| 0.005515
| 0
| 0.009191
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
83f3bb47809ef551af7a69077d3c5902650180d1
| 7,929
|
py
|
Python
|
venv/lib/python3.8/site-packages/validation/number.py
|
julio9246/hg-poker-api
|
56805601bc26bf8bb80e05235ae22a59a174af09
|
[
"Apache-2.0"
] | 9
|
2017-12-01T21:31:12.000Z
|
2019-08-30T15:36:41.000Z
|
venv/lib/python3.8/site-packages/validation/number.py
|
julio9246/hg-poker-api
|
56805601bc26bf8bb80e05235ae22a59a174af09
|
[
"Apache-2.0"
] | 41
|
2017-09-06T15:18:06.000Z
|
2022-01-03T23:10:54.000Z
|
venv/lib/python3.8/site-packages/validation/number.py
|
julio9246/hg-poker-api
|
56805601bc26bf8bb80e05235ae22a59a174af09
|
[
"Apache-2.0"
] | 4
|
2019-01-02T21:17:38.000Z
|
2021-01-25T10:48:01.000Z
|
import math
import six
from .core import _validate_bool
from .common import make_optional_argument_default
_undefined = make_optional_argument_default()
def _validate_int(value, min_value=None, max_value=None, required=True):
if value is None:
if required:
raise TypeError("required value is None")
return
if not isinstance(value, six.integer_types):
raise TypeError((
"expected 'int', but value is of type {cls!r}"
).format(cls=value.__class__.__name__))
if min_value is not None and value < min_value:
raise ValueError((
"expected value less than {min}, but got {value}"
).format(value=value, min=min_value))
if max_value is not None and value > max_value:
raise ValueError((
"expected value greater than {max}, but got {value}"
).format(value=value, max=max_value))
class _int_validator(object):
def __init__(self, min_value, max_value, required):
_validate_int(min_value, required=False)
_validate_int(max_value, required=False)
if (
min_value is not None and max_value is not None and
min_value > max_value
):
raise ValueError((
'minimum value {min!r} is greater than maximum value {max!r}'
).format(min=min_value, max=max_value))
self.__min_value = min_value
self.__max_value = max_value
_validate_bool(required)
self.__required = required
def __call__(self, value):
_validate_int(
value,
min_value=self.__min_value, max_value=self.__max_value,
required=self.__required,
)
def __repr__(self):
args = []
if self.__min_value is not None:
args.append('min_value={min_value!r}'.format(
min_value=self.__min_value,
))
if self.__max_value is not None:
args.append('max_value={max_value!r}'.format(
max_value=self.__max_value,
))
if not self.__required:
args.append('required={required!r}'.format(
required=self.__required,
))
return 'validate_int({args})'.format(args=', '.join(args))
def validate_int(
value=_undefined,
min_value=None, max_value=None,
required=True,
):
"""
Checks that the target value is a valid integer, and that it fits in the
requested bounds.
Does not accept integer values encoded as ``floats``.
Adding a value to a ``float`` will result in a loss of precision if the
total is greater than ``2**53``.
The division operator also behaves differently in python 2.
:param int value:
The number to be validated.
:param int min_value:
The minimum acceptable value for the number.
:param int max_value:
The maximum acceptable value for the number.
:param bool required:
Whether the value can be `None`. Defaults to `True`.
:raises TypeError:
If the value is not an integer, or if it was marked as `required` but
`None` was passed in.
:raises ValueError:
If the value is not within bounds.
"""
validate = _int_validator(
min_value=min_value, max_value=max_value,
required=required,
)
if value is not _undefined:
validate(value)
else:
return validate
def _validate_float(
value,
min_value=None, max_value=None,
allow_infinite=False, allow_nan=False,
required=True,
):
if value is None:
if required:
raise TypeError("required value is None")
return
if not isinstance(value, float):
raise TypeError((
"expected 'float', but value is of type {cls!r}"
).format(cls=value.__class__.__name__))
if not allow_infinite and math.isinf(value):
raise ValueError((
"expected finite value, but got {value}"
).format(value=value))
if not allow_nan and math.isnan(value):
raise ValueError((
"expected valid float, but got {value}"
).format(value=value))
if min_value is not None and value < min_value:
raise ValueError((
"expected value less than {min}, but got {value}"
).format(value=value, min=min_value))
if max_value is not None and value > max_value:
raise ValueError((
"expected value greater than {max}, but got {value}"
).format(value=value, max=max_value))
class _float_validator(object):
def __init__(
self,
min_value, max_value,
allow_infinite, allow_nan,
required,
):
_validate_float(
min_value, allow_infinite=True, required=False,
)
_validate_float(
max_value, allow_infinite=True, required=False,
)
if (
min_value is not None and max_value is not None and
min_value > max_value
):
raise ValueError((
'minimum value {min!r} is greater than maximum value {max!r}'
).format(min=min_value, max=max_value))
self.__min_value = min_value
self.__max_value = max_value
_validate_bool(allow_infinite)
self.__allow_infinite = allow_infinite
_validate_bool(allow_nan)
self.__allow_nan = allow_nan
_validate_bool(required)
self.__required = required
def __call__(self, value):
_validate_float(
value,
min_value=self.__min_value, max_value=self.__max_value,
allow_infinite=self.__allow_infinite, allow_nan=self.__allow_nan,
required=self.__required,
)
def __repr__(self):
args = []
if self.__min_value is not None:
args.append('min_value={min_value!r}'.format(
min_value=self.__min_value,
))
if self.__max_value is not None:
args.append('max_value={max_value!r}'.format(
max_value=self.__max_value,
))
if self.__allow_infinite:
args.append('allow_infinite={allow_infinite!r}'.format(
allow_infinite=self.__allow_infinite,
))
if self.__allow_nan:
args.append('allow_nan={allow_nan!r}'.format(
allow_nan=self.__allow_nan,
))
if not self.__required:
args.append('required={required!r}'.format(
required=self.__required,
))
return 'validate_float({args})'.format(args=', '.join(args))
def validate_float(
value=_undefined,
min_value=None, max_value=None,
allow_infinite=False, allow_nan=False,
required=True,
):
"""
Checks that the target value is a valid floating point number and that it
fits in the requested bounds.
:param int value:
The number to be validated.
:param int min_value:
The minimum acceptable value for the number.
:param int max_value:
The maximum acceptable value for the number.
:param bool allow_infinite:
Whether or not to accept positive or negative infinities. Defaults to
``False``.
:param bool allow_nan:
Whether or not to accept NaNs. Defaults to ``False``.
:param bool required:
Whether the value can be ``None``. Defaults to ``True``.
:raises TypeError:
If the value is not an integer, or if it was marked as ``required`` but
``None`` was passed in.
:raises ValueError:
If the value is not within bounds.
"""
validate = _float_validator(
min_value=min_value, max_value=max_value,
allow_infinite=allow_infinite, allow_nan=allow_nan,
required=required,
)
if value is not _undefined:
validate(value)
else:
return validate
| 29.585821
| 79
| 0.612561
| 992
| 7,929
| 4.615927
| 0.11996
| 0.076873
| 0.03931
| 0.036689
| 0.810657
| 0.767853
| 0.732256
| 0.703429
| 0.672418
| 0.636165
| 0
| 0.000721
| 0.300164
| 7,929
| 267
| 80
| 29.696629
| 0.824473
| 0.192458
| 0
| 0.701149
| 0
| 0
| 0.121626
| 0.034062
| 0
| 0
| 0
| 0
| 0
| 1
| 0.057471
| false
| 0
| 0.022989
| 0
| 0.126437
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 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
|
f7dbfbae2ac4cfccdbf78cfd210ad7325c6f747d
| 25,269
|
py
|
Python
|
src/datashare/azext_datashare/manual/_params.py
|
Mannan2812/azure-cli-extensions
|
e2b34efe23795f6db9c59100534a40f0813c3d95
|
[
"MIT"
] | 207
|
2017-11-29T06:59:41.000Z
|
2022-03-31T10:00:53.000Z
|
src/datashare/azext_datashare/manual/_params.py
|
Mannan2812/azure-cli-extensions
|
e2b34efe23795f6db9c59100534a40f0813c3d95
|
[
"MIT"
] | 4,061
|
2017-10-27T23:19:56.000Z
|
2022-03-31T23:18:30.000Z
|
src/datashare/azext_datashare/manual/_params.py
|
Mannan2812/azure-cli-extensions
|
e2b34efe23795f6db9c59100534a40f0813c3d95
|
[
"MIT"
] | 802
|
2017-10-11T17:36:26.000Z
|
2022-03-31T22:24:32.000Z
|
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long
# pylint: disable=too-many-lines
# pylint: disable=too-many-statements
# pylint: disable=unused-import
from knack.arguments import CLIArgumentType
from azure.cli.core.commands.parameters import (
tags_type,
get_enum_type,
resource_group_name_type,
get_location_type,
get_datetime_type
)
from azure.cli.core.commands.validators import get_default_location_from_resource_group, validate_file_or_dict
from azext_datashare.vendored_sdks.datashare.models._data_share_management_client_enums import ShareKind, Kind, SynchronizationMode, SynchronizationKind, RecurrenceInterval
from azext_datashare.manual._validators import invitation_id_validator
def load_arguments(self, _):
with self.argument_context('datashare account list') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
with self.argument_context('datashare account show') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', options_list=['--name', '-n'], id_part='name', help='The name of the share account.') # modified
with self.argument_context('datashare account create') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', options_list=['--name', '-n'], help='The name of the share account.') # modified
c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) # modified
c.argument('tags', tags_type) # modified
c.ignore('identity') # Only system assigned identity is supported, we can omit this option
with self.argument_context('datashare account update') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', options_list=['--name', '-n'], id_part='name', help='The name of the share account.') # modified
c.argument('tags', tags_type) # modified
with self.argument_context('datashare account delete') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', options_list=['--name', '-n'], id_part='name', help='The name of the share account.')
with self.argument_context('datashare account wait') as c:
c.argument('account_name', options_list=['--name', '-n'], id_part='name', help='The name of the share account.') # modified
with self.argument_context('datashare list') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
with self.argument_context('datashare show') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share.') # modified
with self.argument_context('datashare create') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_name', options_list=['--name', '-n'], help='The name of the share.') # modified
c.argument('description', help='Share description.') # modified
c.argument('share_kind', arg_type=get_enum_type(ShareKind), help='Share kind.') # modified
c.argument('terms', help='Share terms.') # modified
with self.argument_context('datashare delete') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share.') # modified
with self.argument_context('datashare wait') as c:
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share.') # modified
with self.argument_context('datashare dataset list') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_name', help='The name of the share.')
with self.argument_context('datashare dataset show') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('data_set_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the dataset.') # modified
with self.argument_context('datashare dataset create') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_name', help='The name of the share.')
c.argument('data_set_name', options_list=['--name', '-n'], help='The name of the dataset.') # modified
c.argument('data_set', options_list=['--dataset'], type=validate_file_or_dict, help='Dataset parameters in JSON string or path to JSON file.') # modified
with self.argument_context('datashare dataset delete') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('data_set_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the dataset.') # modified
with self.argument_context('datashare dataset wait') as c:
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('data_set_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the dataset.') # modified
with self.argument_context('datashare invitation list') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_name', help='The name of the share.')
with self.argument_context('datashare invitation show') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('invitation_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the invitation.') # modified
with self.argument_context('datashare invitation create') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_name', help='The name of the share.')
c.argument('invitation_name', options_list=['--name', '-n'], help='The name of the invitation.') # modified
c.argument('target_active_directory_id', help='The target Azure AD Id. Can\'t be combined with email.') # modified
c.argument('target_email', help='The email the invitation is directed to.') # modified
c.argument('target_object_id', help='The target user or application Id that invitation is being sent to. Must be specified along TargetActiveDirectoryId. This enables sending invitations to specific users or applications in an AD tenant.') # modified
with self.argument_context('datashare invitation delete') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('invitation_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the invitation.') # modified
with self.argument_context('datashare synchronization-setting list') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_name', help='The name of the share.')
with self.argument_context('datashare synchronization-setting show') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('synchronization_setting_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the synchronizationSetting.') # modified
with self.argument_context('datashare synchronization-setting create') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_name', help='The name of the share.')
c.argument('synchronization_setting_name', options_list=['--name', '-n'], help='The name of the synchronizationSetting.') # modified
c.argument('recurrence_interval', arg_type=get_enum_type(RecurrenceInterval), arg_group='Synchronization Setting', help='Synchronization Recurrence Interval.')
c.argument('synchronization_time', arg_group='Synchronization Setting', arg_type=get_datetime_type(help='Synchronization time.'))
c.argument('kind', arg_type=get_enum_type(SynchronizationKind), arg_group='Synchronization Setting', default='ScheduleBased', help='Kind of synchronization.')
with self.argument_context('datashare synchronization-setting delete') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('synchronization_setting_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the synchronizationSetting.') # modified
with self.argument_context('datashare synchronization-setting wait') as c:
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('synchronization_setting_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the synchronizationSetting.') # modified
with self.argument_context('datashare synchronization list-detail') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.') # modified
c.argument('share_name', help='The name of the share.') # modified
c.argument('synchronization_id', help='The synchronization GUID.')
with self.argument_context('datashare synchronization list') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.') # modified
c.argument('share_name', help='The name of the share.') # modified
with self.argument_context('datashare provider-share-subscription list') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_name', help='The name of the share.')
with self.argument_context('datashare provider-share-subscription show') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('provider_share_subscription_id', options_list=['--share-subscription'], id_part='child_name_2', help='To locate share subscription') # modified TODO validator
with self.argument_context('datashare provider-share-subscription revoke') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('provider_share_subscription_id', options_list=['--share-subscription'], id_part='child_name_2', help='To locate share subscription') # modified
with self.argument_context('datashare provider-share-subscription reinstate') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('provider_share_subscription_id', options_list=['--share-subscription'], id_part='child_name_2', help='To locate share subscription') # modified
with self.argument_context('datashare provider-share-subscription wait') as c:
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified
c.argument('provider_share_subscription_id', options_list=['--share-subscription'], id_part='child_name_2', help='To locate share subscription') # modified
with self.argument_context('datashare consumer invitation list') as c:
pass
with self.argument_context('datashare consumer invitation show') as c:
c.argument('location', arg_type=get_location_type(self.cli_ctx)) # modified
c.argument('invitation_id', validator=invitation_id_validator, help='An invitation id')
with self.argument_context('datashare consumer invitation reject') as c:
c.argument('location', arg_type=get_location_type(self.cli_ctx)) # modified
c.argument('invitation_id', validator=invitation_id_validator, help='An invitation id') # modified
with self.argument_context('datashare consumer share-subscription list') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
with self.argument_context('datashare consumer share-subscription show') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_subscription_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share subscription.') # modified
with self.argument_context('datashare consumer share-subscription create') as c:
from azure.cli.core.commands.parameters import get_location_name_type, get_location_completion_list
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', options_list=['--name', '-n'], help='The name of the share subscription.') # modified
c.argument('invitation_id', validator=invitation_id_validator, help='The invitation id.') # modified
c.argument('source_share_location', type=get_location_name_type(self.cli_ctx), help='Source share location.', completer=get_location_completion_list) # modified
with self.argument_context('datashare consumer share-subscription delete') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_subscription_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share subscription.') # modified
with self.argument_context('datashare consumer share-subscription list-source-share-synchronization-setting') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', help='The name of the share subscription.')
with self.argument_context('datashare consumer share-subscription list-source-dataset') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', help='The name of the share subscription.')
with self.argument_context('datashare consumer share-subscription wait') as c:
c.argument('account_name', id_part='name', help='The name of the share account.')
c.argument('share_subscription_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share subscription.') # modified
with self.argument_context('datashare consumer share-subscription synchronization start') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', help='The name of the share subscription.')
c.argument('synchronization_mode', arg_type=get_enum_type(SynchronizationMode), help='Synchronization mode') # modified
with self.argument_context('datashare consumer share-subscription synchronization cancel') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', help='The name of the share subscription.')
c.argument('synchronization_id', help='The synchronization GUID')
with self.argument_context('datashare consumer share-subscription synchronization wait') as c:
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', help='The name of the share subscription.')
c.argument('synchronization_id', help='The synchronization GUID')
with self.argument_context('datashare consumer share-subscription synchronization list') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', help='The name of the share subscription.')
with self.argument_context('datashare consumer share-subscription synchronization list-detail') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', help='The name of the share subscription.')
c.argument('synchronization_id', help='Synchronization id')
with self.argument_context('datashare consumer dataset-mapping list') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', help='The name of the share subscription.')
with self.argument_context('datashare consumer dataset-mapping show') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.')
c.argument('share_subscription_name', id_part='child_name_1', help='The name of the share subscription.')
c.argument('data_set_mapping_name', id_part='child_name_2', options_list=['--name', '-n'], help='The name of the datasetMapping.') # modified
with self.argument_context('datashare consumer dataset-mapping create') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', help='The name of the share subscription.')
c.argument('data_set_mapping_name', options_list=['--name', '-n'], help='The name of the datasetMapping.') # modified
c.argument('data_set_mapping', options_list=['--mapping'], type=validate_file_or_dict, help='Dataset mapping in JSON string or path to JSON file.') # modified
with self.argument_context('datashare consumer dataset-mapping delete') as c: # modified
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.')
c.argument('share_subscription_name', id_part='child_name_1', help='The name of the share subscription.')
c.argument('data_set_mapping_name', id_part='child_name_2', options_list=['--name', '-n'], help='The name of the datasetMapping.') # modified
with self.argument_context('datashare consumer dataset-mapping wait') as c:
c.argument('account_name', id_part='name', help='The name of the share account.')
c.argument('share_subscription_name', id_part='child_name_1', help='The name of the share subscription.')
c.argument('data_set_mapping_name', id_part='child_name_2', options_list=['--name', '-n'], help='The name of the datasetMapping.') # modified
with self.argument_context('datashare consumer trigger list') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', help='The name of the share subscription.')
with self.argument_context('datashare consumer trigger show') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.')
c.argument('share_subscription_name', id_part='child_name_1', help='The name of the share subscription.')
c.argument('trigger_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the trigger.')
with self.argument_context('datashare consumer trigger create') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', help='The name of the share account.')
c.argument('share_subscription_name', help='The name of the share subscription.')
c.argument('trigger_name', options_list=['--name', '-n'], help='The name of the trigger.') # modified
c.argument('recurrence_interval', arg_type=get_enum_type(RecurrenceInterval), arg_group='Synchronization Setting', help='Synchronization Recurrence Interval.')
c.argument('synchronization_time', arg_group='Synchronization Setting', arg_type=get_datetime_type(help='Synchronization time.'))
c.argument('kind', arg_type=get_enum_type(SynchronizationKind), arg_group='Synchronization Setting', default='ScheduleBased', help='Kind of synchronization.')
with self.argument_context('datashare consumer trigger delete') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
c.argument('account_name', id_part='name', help='The name of the share account.') # modified
c.argument('share_subscription_name', id_part='child_name_1', help='The name of the share subscription.') # modified
c.argument('trigger_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the trigger.') # modified
with self.argument_context('datashare consumer trigger wait') as c:
c.argument('trigger_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the trigger.') # modified
| 75.655689
| 259
| 0.712494
| 3,412
| 25,269
| 5.053048
| 0.050117
| 0.100748
| 0.07401
| 0.087466
| 0.91062
| 0.905516
| 0.891712
| 0.857027
| 0.83864
| 0.829998
| 0
| 0.001924
| 0.156635
| 25,269
| 333
| 260
| 75.882883
| 0.807095
| 0.072539
| 0
| 0.645283
| 0
| 0
| 0.446936
| 0.052828
| 0
| 0
| 0
| 0.003003
| 0
| 1
| 0.003774
| false
| 0.003774
| 0.022642
| 0
| 0.026415
| 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
|
f7e02ecc4e1d250cfd96792b10f94b01f8e36e52
| 103
|
py
|
Python
|
wingedsheep/carcassonne/objects/actions/pass_action.py
|
SuryaVikram/CarcassonneMaster
|
cc0201638dfea05b254833097329729e9b8a410c
|
[
"MIT"
] | 11
|
2020-05-19T17:29:18.000Z
|
2022-03-24T06:22:50.000Z
|
wingedsheep/carcassonne/objects/actions/pass_action.py
|
SuryaVikram/CarcassonneMaster
|
cc0201638dfea05b254833097329729e9b8a410c
|
[
"MIT"
] | 6
|
2020-05-18T09:24:26.000Z
|
2022-03-12T00:30:21.000Z
|
wingedsheep/carcassonne/objects/actions/pass_action.py
|
SuryaVikram/CarcassonneMaster
|
cc0201638dfea05b254833097329729e9b8a410c
|
[
"MIT"
] | 5
|
2021-09-16T11:53:26.000Z
|
2022-03-30T12:08:56.000Z
|
from wingedsheep.carcassonne.objects.actions.action import Action
class PassAction(Action):
pass
| 17.166667
| 65
| 0.805825
| 12
| 103
| 6.916667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.126214
| 103
| 5
| 66
| 20.6
| 0.922222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.666667
| 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
|
f7e44cd84956c7de2ab45a19cfa45cd29872f6e9
| 52
|
py
|
Python
|
data/typing/numpy.random.bit_generator.py
|
pydata-apis/python-api-record
|
684cffbbb6dc6e81f9de4e02619c8b0ebc557b2b
|
[
"MIT"
] | 67
|
2020-08-17T11:53:26.000Z
|
2021-11-08T20:16:06.000Z
|
data/typing/numpy.random.bit_generator.py
|
data-apis/python-record-api
|
684cffbbb6dc6e81f9de4e02619c8b0ebc557b2b
|
[
"MIT"
] | 36
|
2020-08-17T11:09:51.000Z
|
2021-12-15T18:09:47.000Z
|
data/typing/numpy.random.bit_generator.py
|
pydata-apis/python-api-record
|
684cffbbb6dc6e81f9de4e02619c8b0ebc557b2b
|
[
"MIT"
] | 7
|
2020-08-19T05:06:47.000Z
|
2020-11-04T05:10:38.000Z
|
from typing import *
class SeedSequence:
pass
| 8.666667
| 20
| 0.711538
| 6
| 52
| 6.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 52
| 5
| 21
| 10.4
| 0.948718
| 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
|
f7efd926a5afa6b51089e40fdd84e4254fc56f73
| 173
|
py
|
Python
|
utm/setup.py
|
jn89b/UTM
|
cced37217708499d5b0dbe9106722b039ef935ac
|
[
"MIT"
] | null | null | null |
utm/setup.py
|
jn89b/UTM
|
cced37217708499d5b0dbe9106722b039ef935ac
|
[
"MIT"
] | null | null | null |
utm/setup.py
|
jn89b/UTM
|
cced37217708499d5b0dbe9106722b039ef935ac
|
[
"MIT"
] | null | null | null |
from disutils.core import setup
from catkin_pkg.python_setup import generate_disutils_setup
d = generate_disutils_setup(
packages=["utm"],
package_dir={"":"src"}
)
| 24.714286
| 60
| 0.757225
| 23
| 173
| 5.391304
| 0.652174
| 0.258065
| 0.33871
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.132948
| 173
| 7
| 61
| 24.714286
| 0.826667
| 0
| 0
| 0
| 1
| 0
| 0.034483
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 6
|
79298c213a0e10cb4109405258adb427ca98eac0
| 34
|
py
|
Python
|
utilities/autoware_launcher/src/autoware_launcher/gui/__init__.py
|
alanjclark/autoware.ai
|
ba97edbbffb6f22e78912bf96400a59ef6a13daf
|
[
"Apache-2.0"
] | 20
|
2019-05-21T06:14:17.000Z
|
2021-11-03T04:36:09.000Z
|
ros/src/util/packages/autoware_launcher/src/autoware_launcher/gui/__init__.py
|
anhnv3991/autoware
|
d5b2ed9dc309193c8a2a7c77a2b6c88104c28328
|
[
"Apache-2.0"
] | 40
|
2019-06-24T16:56:15.000Z
|
2022-02-28T13:41:58.000Z
|
ros/src/util/packages/autoware_launcher/src/autoware_launcher/gui/__init__.py
|
anhnv3991/autoware
|
d5b2ed9dc309193c8a2a7c77a2b6c88104c28328
|
[
"Apache-2.0"
] | 31
|
2020-05-29T07:51:58.000Z
|
2022-03-26T05:46:33.000Z
|
from .client import AwQtGuiClient
| 34
| 34
| 0.852941
| 4
| 34
| 7.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 34
| 1
| 34
| 34
| 0.966667
| 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
|
f70b478d5085a5ad29d7c5f1433e9a5dcace1aa8
| 488
|
py
|
Python
|
bark/runtime/scenario/scenario_generation/config_readers/__init__.py
|
GAIL-4-BARK/bark
|
1cfda9ba6e9ec5318fbf01af6b67c242081b516e
|
[
"MIT"
] | null | null | null |
bark/runtime/scenario/scenario_generation/config_readers/__init__.py
|
GAIL-4-BARK/bark
|
1cfda9ba6e9ec5318fbf01af6b67c242081b516e
|
[
"MIT"
] | null | null | null |
bark/runtime/scenario/scenario_generation/config_readers/__init__.py
|
GAIL-4-BARK/bark
|
1cfda9ba6e9ec5318fbf01af6b67c242081b516e
|
[
"MIT"
] | 1
|
2020-08-12T17:09:05.000Z
|
2020-08-12T17:09:05.000Z
|
# Copyright (c) 2020 Julian Bernhard, Klemens Esterle, Patrick Hart and
# Tobias Kessler
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
from .agent_state_geometry_config_readers import *
from .behavior_model_config_readers import *
from .controlled_agents_config_readers import *
from .dynamic_model_config_readers import *
from .execution_model_config_readers import *
from .goal_definition_config_readers import *
| 40.666667
| 71
| 0.817623
| 69
| 488
| 5.507246
| 0.652174
| 0.205263
| 0.3
| 0.302632
| 0.221053
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009281
| 0.116803
| 488
| 12
| 72
| 40.666667
| 0.87239
| 0.403689
| 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
|
e390771eb7dc9add9eb50aa94ca16ed62011a4a1
| 592
|
py
|
Python
|
python/testData/buildout/django-script.py
|
truthiswill/intellij-community
|
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/buildout/django-script.py
|
truthiswill/intellij-community
|
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/buildout/django-script.py
|
truthiswill/intellij-community
|
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
#!"C:\Python26\python.exe"
import sys
sys.path[0:0] = [
'c:\\src\\django\\buildout15\\src',
'c:\\src\\django\\buildout15\\eggs\\djangorecipe-0.20-py2.6.egg',
'c:\\src\\django\\buildout15\\eggs\\zc.recipe.egg-1.3.2-py2.6.egg',
'c:\\src\\django\\buildout15\\eggs\\zc.buildout-1.5.2-py2.6.egg',
'c:\\src\\django\\buildout15\\eggs\\setuptools-0.6c12dev_r88124-py2.6.egg',
'c:\\src\\django\\buildout15\\parts\\django',
'c:\\src\\django\\buildout15',
]
import djangorecipe.manage
if __name__ == '__main__':
djangorecipe.manage.main('shorturls.testsettings')
| 31.157895
| 79
| 0.652027
| 86
| 592
| 4.383721
| 0.395349
| 0.074271
| 0.185676
| 0.371353
| 0.397878
| 0.334218
| 0.334218
| 0.262599
| 0.262599
| 0
| 0
| 0.082863
| 0.103041
| 592
| 18
| 80
| 32.888889
| 0.627119
| 0.04223
| 0
| 0
| 0
| 0.307692
| 0.690813
| 0.676678
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.153846
| 0
| 0.153846
| 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
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
e3a8c8e95b8e9ccad0e51b677751ff7a7d7b7de9
| 147
|
py
|
Python
|
trn.py
|
pkipjames/emotional-chatbot_gpt2
|
063b2f755d27a2522ea7cf35a274e6eaaa01a09e
|
[
"MIT"
] | null | null | null |
trn.py
|
pkipjames/emotional-chatbot_gpt2
|
063b2f755d27a2522ea7cf35a274e6eaaa01a09e
|
[
"MIT"
] | null | null | null |
trn.py
|
pkipjames/emotional-chatbot_gpt2
|
063b2f755d27a2522ea7cf35a274e6eaaa01a09e
|
[
"MIT"
] | null | null | null |
import os;
os.system("cd models/345M_org;wget https://drive.google.com/u/0/uc?export=download&confirm=GEU2&id=1CzCNAuaXiaQsdCMTiki2X9XuyCwowQY3");
| 49
| 135
| 0.809524
| 22
| 147
| 5.363636
| 0.954545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.06338
| 0.034014
| 147
| 2
| 136
| 73.5
| 0.767606
| 0
| 0
| 0
| 0
| 0.5
| 0.823129
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 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
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 6
|
e3d73d0da292353c20267d7e42f9a80ee80297b8
| 124
|
py
|
Python
|
tests/test_install.py
|
Utagai/spice
|
a2604ad01c12138067eeb2036258437e0f8e4b82
|
[
"MIT"
] | 41
|
2016-08-01T04:57:24.000Z
|
2022-02-13T01:38:04.000Z
|
tests/test_install.py
|
Utagai/spice
|
a2604ad01c12138067eeb2036258437e0f8e4b82
|
[
"MIT"
] | 32
|
2016-07-13T18:10:22.000Z
|
2018-06-05T22:58:48.000Z
|
tests/test_install.py
|
Utagai/spice
|
a2604ad01c12138067eeb2036258437e0f8e4b82
|
[
"MIT"
] | 14
|
2016-08-25T23:09:03.000Z
|
2018-05-06T19:33:32.000Z
|
import spice_api as spice
def test_install():
assert spice.user_agent == 'spice API (https://github.com/Utagai/spice)'
| 24.8
| 76
| 0.733871
| 19
| 124
| 4.631579
| 0.736842
| 0.181818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137097
| 124
| 4
| 77
| 31
| 0.82243
| 0
| 0
| 0
| 0
| 0
| 0.346774
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.333333
| true
| 0
| 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
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
e3fb0ca541fa1e19ebd401c701fa1d8873735cb3
| 96
|
py
|
Python
|
venv/lib/python3.8/site-packages/wheel/__main__.py
|
GiulianaPola/select_repeats
|
17a0d053d4f874e42cf654dd142168c2ec8fbd11
|
[
"MIT"
] | 2
|
2022-03-13T01:58:52.000Z
|
2022-03-31T06:07:54.000Z
|
venv/lib/python3.8/site-packages/wheel/__main__.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | 19
|
2021-11-20T04:09:18.000Z
|
2022-03-23T15:05:55.000Z
|
venv/lib/python3.8/site-packages/wheel/__main__.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | null | null | null |
/home/runner/.cache/pip/pool/94/5f/98/2cee217509a85ae87879665df182f553de5149d9bbeac34b0576b4be31
| 96
| 96
| 0.895833
| 9
| 96
| 9.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.4375
| 0
| 96
| 1
| 96
| 96
| 0.458333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
5897597165bae97f38fe359d6b0a320ea74f5e81
| 26
|
py
|
Python
|
pyi2c/__init__.py
|
newini/pyi2c
|
9c98b83cd8f199f3706bffd9ff09cbf5f4ca7a9f
|
[
"MIT"
] | null | null | null |
pyi2c/__init__.py
|
newini/pyi2c
|
9c98b83cd8f199f3706bffd9ff09cbf5f4ca7a9f
|
[
"MIT"
] | null | null | null |
pyi2c/__init__.py
|
newini/pyi2c
|
9c98b83cd8f199f3706bffd9ff09cbf5f4ca7a9f
|
[
"MIT"
] | null | null | null |
from pyi2c.pyi2c import *
| 13
| 25
| 0.769231
| 4
| 26
| 5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 0.153846
| 26
| 1
| 26
| 26
| 0.818182
| 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
|
5452b9ac260cf94e180e6cb50cc1c6d8c89839a7
| 356
|
py
|
Python
|
optimus/engines/cudf/rows.py
|
ironmussa/Optimus
|
fbaea6e0957f0bc016280a85ff021904faac20c5
|
[
"Apache-2.0"
] | 1,045
|
2017-07-17T17:59:46.000Z
|
2021-06-15T07:06:48.000Z
|
optimus/engines/cudf/rows.py
|
ironmussa/Optimus
|
fbaea6e0957f0bc016280a85ff021904faac20c5
|
[
"Apache-2.0"
] | 955
|
2017-07-14T15:47:58.000Z
|
2021-05-27T14:16:24.000Z
|
optimus/engines/cudf/rows.py
|
ironmussa/Optimus
|
fbaea6e0957f0bc016280a85ff021904faac20c5
|
[
"Apache-2.0"
] | 226
|
2017-08-04T20:41:33.000Z
|
2021-05-21T08:28:33.000Z
|
import functools
import operator
from optimus.engines.base.cudf.rows import CUDFBaseRows
import cudf
import pandas as pd
from optimus.engines.base.dataframe.rows import DataFrameBaseRows
from optimus.engines.base.cudf.rows import CUDFBaseRows
from optimus.engines.base.rows import BaseRows
class Rows(DataFrameBaseRows, CUDFBaseRows, BaseRows):
pass
| 27.384615
| 65
| 0.839888
| 47
| 356
| 6.361702
| 0.382979
| 0.147157
| 0.240803
| 0.294314
| 0.32107
| 0.32107
| 0.32107
| 0.32107
| 0
| 0
| 0
| 0
| 0.103933
| 356
| 13
| 66
| 27.384615
| 0.937304
| 0
| 0
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.1
| 0.8
| 0
| 0.9
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 6
|
547b70acfb24dc6dfbd82a1d376cf5f06be1c85b
| 44
|
py
|
Python
|
ninja/openapi/__init__.py
|
Stamper/django-ninja
|
39479db2937b0a8a918cfe1c0790ad7016db7edc
|
[
"MIT"
] | 1
|
2021-05-03T15:38:41.000Z
|
2021-05-03T15:38:41.000Z
|
ninja/openapi/__init__.py
|
Stamper/django-ninja
|
39479db2937b0a8a918cfe1c0790ad7016db7edc
|
[
"MIT"
] | null | null | null |
ninja/openapi/__init__.py
|
Stamper/django-ninja
|
39479db2937b0a8a918cfe1c0790ad7016db7edc
|
[
"MIT"
] | null | null | null |
from ninja.openapi.schema import get_schema
| 22
| 43
| 0.863636
| 7
| 44
| 5.285714
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 44
| 1
| 44
| 44
| 0.925
| 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
|
549977c6d5650932c1dff0e6838a7c35b5ec512a
| 205,919
|
py
|
Python
|
lib_pypy/cffi/_pycparser/yacctab.py
|
nanjekyejoannah/pypy
|
e80079fe13c29eda7b2a6b4cd4557051f975a2d9
|
[
"Apache-2.0",
"OpenSSL"
] | null | null | null |
lib_pypy/cffi/_pycparser/yacctab.py
|
nanjekyejoannah/pypy
|
e80079fe13c29eda7b2a6b4cd4557051f975a2d9
|
[
"Apache-2.0",
"OpenSSL"
] | 1
|
2022-02-22T00:59:49.000Z
|
2022-02-22T00:59:49.000Z
|
lib_pypy/cffi/_pycparser/yacctab.py
|
nanjekyejoannah/pypy
|
e80079fe13c29eda7b2a6b4cd4557051f975a2d9
|
[
"Apache-2.0",
"OpenSSL"
] | 1
|
2022-03-30T11:42:37.000Z
|
2022-03-30T11:42:37.000Z
|
# yacctab.py
# This file is automatically generated. Do not edit.
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMODAUTO BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM EXTERN FLOAT FOR GOTO IF INLINE INT LONG REGISTER OFFSETOF RESTRICT RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH TYPEDEF UNION UNSIGNED VOID VOLATILE WHILE __INT128 _BOOL _COMPLEX _NORETURN _THREAD_LOCAL _STATIC_ASSERT _ATOMIC _ALIGNOF _ALIGNAS ID TYPEID INT_CONST_DEC INT_CONST_OCT INT_CONST_HEX INT_CONST_BIN INT_CONST_CHAR FLOAT_CONST HEX_FLOAT_CONST CHAR_CONST WCHAR_CONST U8CHAR_CONST U16CHAR_CONST U32CHAR_CONST STRING_LITERAL WSTRING_LITERAL U8STRING_LITERAL U16STRING_LITERAL U32STRING_LITERAL PLUS MINUS TIMES DIVIDE MOD OR AND NOT XOR LSHIFT RSHIFT LOR LAND LNOT LT LE GT GE EQ NE EQUALS TIMESEQUAL DIVEQUAL MODEQUAL PLUSEQUAL MINUSEQUAL LSHIFTEQUAL RSHIFTEQUAL ANDEQUAL XOREQUAL OREQUAL PLUSPLUS MINUSMINUS ARROW CONDOP LPAREN RPAREN LBRACKET RBRACKET LBRACE RBRACE COMMA PERIOD SEMI COLON ELLIPSIS PPHASH PPPRAGMA PPPRAGMASTRabstract_declarator_opt : empty\n| abstract_declaratorassignment_expression_opt : empty\n| assignment_expressionblock_item_list_opt : empty\n| block_item_listdeclaration_list_opt : empty\n| declaration_listdeclaration_specifiers_no_type_opt : empty\n| declaration_specifiers_no_typedesignation_opt : empty\n| designationexpression_opt : empty\n| expressionid_init_declarator_list_opt : empty\n| id_init_declarator_listidentifier_list_opt : empty\n| identifier_listinit_declarator_list_opt : empty\n| init_declarator_listinitializer_list_opt : empty\n| initializer_listparameter_type_list_opt : empty\n| parameter_type_liststruct_declarator_list_opt : empty\n| struct_declarator_listtype_qualifier_list_opt : empty\n| type_qualifier_list direct_id_declarator : ID\n direct_id_declarator : LPAREN id_declarator RPAREN\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_id_declarator : direct_id_declarator LPAREN parameter_type_list RPAREN\n | direct_id_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_declarator : TYPEID\n direct_typeid_declarator : LPAREN typeid_declarator RPAREN\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_noparen_declarator : TYPEID\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN\n id_declarator : direct_id_declarator\n id_declarator : pointer direct_id_declarator\n typeid_declarator : direct_typeid_declarator\n typeid_declarator : pointer direct_typeid_declarator\n typeid_noparen_declarator : direct_typeid_noparen_declarator\n typeid_noparen_declarator : pointer direct_typeid_noparen_declarator\n translation_unit_or_empty : translation_unit\n | empty\n translation_unit : external_declaration\n translation_unit : translation_unit external_declaration\n external_declaration : function_definition\n external_declaration : declaration\n external_declaration : pp_directive\n | pppragma_directive\n external_declaration : SEMI\n external_declaration : static_assert\n static_assert : _STATIC_ASSERT LPAREN constant_expression COMMA unified_string_literal RPAREN\n | _STATIC_ASSERT LPAREN constant_expression RPAREN\n pp_directive : PPHASH\n pppragma_directive : PPPRAGMA\n | PPPRAGMA PPPRAGMASTR\n function_definition : id_declarator declaration_list_opt compound_statement\n function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement\n statement : labeled_statement\n | expression_statement\n | compound_statement\n | selection_statement\n | iteration_statement\n | jump_statement\n | pppragma_directive\n | static_assert\n pragmacomp_or_statement : pppragma_directive statement\n | statement\n decl_body : declaration_specifiers init_declarator_list_opt\n | declaration_specifiers_no_type id_init_declarator_list_opt\n declaration : decl_body SEMI\n declaration_list : declaration\n | declaration_list declaration\n declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : atomic_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : alignment_specifier declaration_specifiers_no_type_opt\n declaration_specifiers : declaration_specifiers type_qualifier\n declaration_specifiers : declaration_specifiers storage_class_specifier\n declaration_specifiers : declaration_specifiers function_specifier\n declaration_specifiers : declaration_specifiers type_specifier_no_typeid\n declaration_specifiers : type_specifier\n declaration_specifiers : declaration_specifiers_no_type type_specifier\n declaration_specifiers : declaration_specifiers alignment_specifier\n storage_class_specifier : AUTO\n | REGISTER\n | STATIC\n | EXTERN\n | TYPEDEF\n | _THREAD_LOCAL\n function_specifier : INLINE\n | _NORETURN\n type_specifier_no_typeid : VOID\n | _BOOL\n | CHAR\n | SHORT\n | INT\n | LONG\n | FLOAT\n | DOUBLE\n | _COMPLEX\n | SIGNED\n | UNSIGNED\n | __INT128\n type_specifier : typedef_name\n | enum_specifier\n | struct_or_union_specifier\n | type_specifier_no_typeid\n | atomic_specifier\n atomic_specifier : _ATOMIC LPAREN type_name RPAREN\n type_qualifier : CONST\n | RESTRICT\n | VOLATILE\n | _ATOMIC\n init_declarator_list : init_declarator\n | init_declarator_list COMMA init_declarator\n init_declarator : declarator\n | declarator EQUALS initializer\n id_init_declarator_list : id_init_declarator\n | id_init_declarator_list COMMA init_declarator\n id_init_declarator : id_declarator\n | id_declarator EQUALS initializer\n specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid\n specifier_qualifier_list : specifier_qualifier_list type_qualifier\n specifier_qualifier_list : type_specifier\n specifier_qualifier_list : type_qualifier_list type_specifier\n specifier_qualifier_list : alignment_specifier\n specifier_qualifier_list : specifier_qualifier_list alignment_specifier\n struct_or_union_specifier : struct_or_union ID\n | struct_or_union TYPEID\n struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close\n | struct_or_union brace_open brace_close\n struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close\n | struct_or_union ID brace_open brace_close\n | struct_or_union TYPEID brace_open struct_declaration_list brace_close\n | struct_or_union TYPEID brace_open brace_close\n struct_or_union : STRUCT\n | UNION\n struct_declaration_list : struct_declaration\n | struct_declaration_list struct_declaration\n struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI\n struct_declaration : SEMI\n struct_declaration : pppragma_directive\n struct_declarator_list : struct_declarator\n | struct_declarator_list COMMA struct_declarator\n struct_declarator : declarator\n struct_declarator : declarator COLON constant_expression\n | COLON constant_expression\n enum_specifier : ENUM ID\n | ENUM TYPEID\n enum_specifier : ENUM brace_open enumerator_list brace_close\n enum_specifier : ENUM ID brace_open enumerator_list brace_close\n | ENUM TYPEID brace_open enumerator_list brace_close\n enumerator_list : enumerator\n | enumerator_list COMMA\n | enumerator_list COMMA enumerator\n alignment_specifier : _ALIGNAS LPAREN type_name RPAREN\n | _ALIGNAS LPAREN constant_expression RPAREN\n enumerator : ID\n | ID EQUALS constant_expression\n declarator : id_declarator\n | typeid_declarator\n pointer : TIMES type_qualifier_list_opt\n | TIMES type_qualifier_list_opt pointer\n type_qualifier_list : type_qualifier\n | type_qualifier_list type_qualifier\n parameter_type_list : parameter_list\n | parameter_list COMMA ELLIPSIS\n parameter_list : parameter_declaration\n | parameter_list COMMA parameter_declaration\n parameter_declaration : declaration_specifiers id_declarator\n | declaration_specifiers typeid_noparen_declarator\n parameter_declaration : declaration_specifiers abstract_declarator_opt\n identifier_list : identifier\n | identifier_list COMMA identifier\n initializer : assignment_expression\n initializer : brace_open initializer_list_opt brace_close\n | brace_open initializer_list COMMA brace_close\n initializer_list : designation_opt initializer\n | initializer_list COMMA designation_opt initializer\n designation : designator_list EQUALS\n designator_list : designator\n | designator_list designator\n designator : LBRACKET constant_expression RBRACKET\n | PERIOD identifier\n type_name : specifier_qualifier_list abstract_declarator_opt\n abstract_declarator : pointer\n abstract_declarator : pointer direct_abstract_declarator\n abstract_declarator : direct_abstract_declarator\n direct_abstract_declarator : LPAREN abstract_declarator RPAREN direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET\n direct_abstract_declarator : LBRACKET TIMES RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN\n direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN\n block_item : declaration\n | statement\n block_item_list : block_item\n | block_item_list block_item\n compound_statement : brace_open block_item_list_opt brace_close labeled_statement : ID COLON pragmacomp_or_statement labeled_statement : CASE constant_expression COLON pragmacomp_or_statement labeled_statement : DEFAULT COLON pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement jump_statement : GOTO ID SEMI jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI\n | RETURN SEMI\n expression_statement : expression_opt SEMI expression : assignment_expression\n | expression COMMA assignment_expression\n assignment_expression : LPAREN compound_statement RPAREN typedef_name : TYPEID assignment_expression : conditional_expression\n | unary_expression assignment_operator assignment_expression\n assignment_operator : EQUALS\n | XOREQUAL\n | TIMESEQUAL\n | DIVEQUAL\n | MODEQUAL\n | PLUSEQUAL\n | MINUSEQUAL\n | LSHIFTEQUAL\n | RSHIFTEQUAL\n | ANDEQUAL\n | OREQUAL\n constant_expression : conditional_expression conditional_expression : binary_expression\n | binary_expression CONDOP expression COLON conditional_expression\n binary_expression : cast_expression\n | binary_expression TIMES binary_expression\n | binary_expression DIVIDE binary_expression\n | binary_expression MOD binary_expression\n | binary_expression PLUS binary_expression\n | binary_expression MINUS binary_expression\n | binary_expression RSHIFT binary_expression\n | binary_expression LSHIFT binary_expression\n | binary_expression LT binary_expression\n | binary_expression LE binary_expression\n | binary_expression GE binary_expression\n | binary_expression GT binary_expression\n | binary_expression EQ binary_expression\n | binary_expression NE binary_expression\n | binary_expression AND binary_expression\n | binary_expression OR binary_expression\n | binary_expression XOR binary_expression\n | binary_expression LAND binary_expression\n | binary_expression LOR binary_expression\n cast_expression : unary_expression cast_expression : LPAREN type_name RPAREN cast_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression\n | MINUSMINUS unary_expression\n | unary_operator cast_expression\n unary_expression : SIZEOF unary_expression\n | SIZEOF LPAREN type_name RPAREN\n | _ALIGNOF LPAREN type_name RPAREN\n unary_operator : AND\n | TIMES\n | PLUS\n | MINUS\n | NOT\n | LNOT\n postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN\n | postfix_expression LPAREN RPAREN\n postfix_expression : postfix_expression PERIOD ID\n | postfix_expression PERIOD TYPEID\n | postfix_expression ARROW ID\n | postfix_expression ARROW TYPEID\n postfix_expression : postfix_expression PLUSPLUS\n | postfix_expression MINUSMINUS\n postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close\n | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close\n primary_expression : identifier primary_expression : constant primary_expression : unified_string_literal\n | unified_wstring_literal\n primary_expression : LPAREN expression RPAREN primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN\n offsetof_member_designator : identifier\n | offsetof_member_designator PERIOD identifier\n | offsetof_member_designator LBRACKET expression RBRACKET\n argument_expression_list : assignment_expression\n | argument_expression_list COMMA assignment_expression\n identifier : ID constant : INT_CONST_DEC\n | INT_CONST_OCT\n | INT_CONST_HEX\n | INT_CONST_BIN\n | INT_CONST_CHAR\n constant : FLOAT_CONST\n | HEX_FLOAT_CONST\n constant : CHAR_CONST\n | WCHAR_CONST\n | U8CHAR_CONST\n | U16CHAR_CONST\n | U32CHAR_CONST\n unified_string_literal : STRING_LITERAL\n | unified_string_literal STRING_LITERAL\n unified_wstring_literal : WSTRING_LITERAL\n | U8STRING_LITERAL\n | U16STRING_LITERAL\n | U32STRING_LITERAL\n | unified_wstring_literal WSTRING_LITERAL\n | unified_wstring_literal U8STRING_LITERAL\n | unified_wstring_literal U16STRING_LITERAL\n | unified_wstring_literal U32STRING_LITERAL\n brace_open : LBRACE\n brace_close : RBRACE\n empty : '
_lr_action_items = {'$end':([0,1,2,3,4,5,6,7,8,9,10,14,15,63,89,90,125,205,248,262,351,493,],[-337,0,-58,-59,-60,-62,-63,-64,-65,-66,-67,-70,-71,-61,-87,-72,-73,-336,-74,-69,-218,-68,]),'SEMI':([0,2,4,5,6,7,8,9,10,12,13,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,68,69,70,71,72,73,74,75,76,77,78,80,82,83,84,85,86,87,88,89,90,95,96,97,98,99,100,101,102,103,104,105,106,108,109,110,115,116,117,119,120,121,122,125,126,128,130,138,139,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,200,201,202,203,204,205,206,207,208,209,211,217,218,219,220,221,222,223,224,225,226,227,228,229,230,233,236,239,242,243,244,245,246,247,248,249,250,251,252,262,263,287,288,289,291,292,293,296,297,298,299,307,308,322,323,326,329,330,331,332,333,334,335,336,337,338,339,340,341,342,344,345,349,350,351,352,353,354,356,357,365,366,367,368,369,370,371,372,398,399,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,434,435,454,455,458,459,460,463,464,465,466,468,470,474,475,476,477,478,479,480,487,488,491,493,495,496,499,500,502,503,516,517,518,519,520,521,523,524,525,529,530,532,546,547,548,549,551,554,556,563,564,567,572,573,575,577,578,579,],[9,9,-60,-62,-63,-64,-65,-66,-67,-337,89,-70,-71,-52,-337,-337,-337,-125,-99,-337,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,-337,-337,-126,-131,-178,-95,-96,-97,-98,-101,-85,-131,-19,-20,-132,-134,-179,-54,-37,-87,-72,-53,-90,-9,-10,-337,-91,-92,-100,-86,-126,-15,-16,-136,-138,-94,-93,-166,-167,-335,-146,-147,207,-73,-337,-178,-55,-303,-252,-253,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-30,207,207,207,-149,-156,-336,-337,-159,-160,-142,-144,-13,-337,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-312,357,-14,-337,369,370,372,-235,-239,-274,-74,-38,-133,-135,-193,-69,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-35,-36,-137,-139,-168,207,-151,207,-153,-148,-157,460,-140,-141,-145,-25,-26,-161,-163,-143,-127,-174,-175,-218,-217,-13,-337,-337,-234,-81,-84,-337,477,-230,-231,478,-233,-43,-44,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-292,-293,-294,-295,-296,-31,-34,-169,-170,-150,-152,-158,-165,-219,-337,-221,-237,-236,-83,523,-337,-229,-232,-240,-194,-39,-42,-275,-68,-290,-291,-281,-282,-32,-33,-162,-164,-220,-337,-337,-337,-337,552,-195,-40,-41,-254,-222,-84,-224,-225,565,-299,-306,-337,573,-300,-223,-226,-337,-337,-228,-227,]),'PPHASH':([0,2,4,5,6,7,8,9,10,14,15,63,89,90,125,205,248,262,351,493,],[14,14,-60,-62,-63,-64,-65,-66,-67,-70,-71,-61,-87,-72,-73,-336,-74,-69,-218,-68,]),'PPPRAGMA':([0,2,4,5,6,7,8,9,10,14,15,63,89,90,119,122,125,126,200,201,202,204,205,207,208,218,219,220,221,222,223,224,225,226,227,228,229,239,248,262,329,331,334,351,352,354,356,357,365,366,369,370,372,460,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[15,15,-60,-62,-63,-64,-65,-66,-67,-70,-71,-61,-87,-72,-335,15,-73,15,15,15,15,-156,-336,-159,-160,15,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,15,-74,-69,15,15,-157,-218,-217,15,15,-234,15,-84,-230,-231,-233,-158,-219,15,-221,-83,-229,-232,-68,-220,15,15,15,-222,-84,-224,-225,15,-223,-226,15,15,-228,-227,]),'_STATIC_ASSERT':([0,2,4,5,6,7,8,9,10,14,15,63,89,90,119,125,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,248,262,351,352,354,356,357,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[16,16,-60,-62,-63,-64,-65,-66,-67,-70,-71,-61,-87,-72,-335,-73,16,-336,16,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,16,-74,-69,-218,-217,16,16,-234,16,-84,-230,-231,-233,-219,16,-221,-83,-229,-232,-68,-220,16,16,16,-222,-84,-224,-225,16,-223,-226,16,16,-228,-227,]),'ID':([0,2,4,5,6,7,8,9,10,12,14,15,17,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,61,62,63,68,69,70,71,73,74,75,76,77,79,80,81,89,90,91,93,94,96,97,98,99,100,101,102,104,110,111,112,113,114,115,116,117,118,119,120,121,124,125,126,132,133,134,135,136,142,143,144,145,148,149,150,151,155,156,179,180,181,189,191,192,193,194,195,196,203,205,206,209,211,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,241,244,248,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,290,294,302,305,306,310,314,318,319,326,327,328,330,332,333,336,337,338,343,344,345,349,350,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,393,395,396,397,400,443,444,447,450,452,454,455,458,459,461,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,501,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,557,558,563,565,572,573,575,577,578,579,],[27,27,-60,-62,-63,-64,-65,-66,-67,27,-70,-71,27,27,-337,-337,-337,-125,-99,27,-337,-104,-337,-122,-123,-124,-126,-238,116,120,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-154,-155,-61,27,27,-126,-131,-95,-96,-97,-98,-101,27,-131,27,-87,-72,154,-337,154,-90,-9,-10,-337,-91,-92,-100,-126,-94,-180,-27,-28,-182,-93,-166,-167,199,-335,-146,-147,154,-73,230,27,154,-337,154,154,-284,-285,-286,-283,154,154,154,154,-287,-288,154,-337,-28,27,27,154,-181,-183,199,199,-149,-336,27,-142,-144,230,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,154,154,230,368,154,-74,-337,154,-337,-28,-69,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,426,428,154,154,-284,154,154,154,27,27,-337,-168,199,154,-151,-153,-148,-140,-141,-145,154,-143,-127,-174,-175,-218,-217,230,230,-234,154,154,154,154,230,-84,154,-230,-231,-233,154,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,154,-12,154,154,-284,154,154,154,-337,154,27,154,154,-169,-170,-150,-152,27,154,-219,230,-221,154,-83,154,-229,-232,-337,-198,-337,-68,154,154,154,154,-337,-28,-284,-220,230,230,230,154,154,154,-11,-284,154,154,-222,-84,-224,-225,154,-337,154,154,230,154,-223,-226,230,230,-228,-227,]),'LPAREN':([0,2,4,5,6,7,8,9,10,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,63,68,69,70,71,73,74,75,76,77,79,80,81,87,88,89,90,91,93,95,96,97,98,99,100,101,102,104,107,110,111,112,113,114,115,116,117,119,120,121,124,125,126,130,132,133,134,136,138,142,143,144,145,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,189,191,192,193,194,203,205,206,209,211,213,218,219,220,221,222,223,224,225,226,227,228,229,230,231,234,235,237,238,239,240,244,248,249,253,254,255,256,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,287,288,290,294,296,297,298,299,302,305,306,307,308,314,315,318,319,320,321,326,328,330,332,333,336,337,338,343,344,345,347,348,349,350,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,398,399,400,401,424,426,427,428,429,434,435,441,442,443,447,450,452,454,455,458,459,461,462,464,465,466,469,473,474,476,477,478,481,483,487,488,492,493,494,495,496,497,502,503,504,505,506,509,510,512,514,518,519,520,521,522,523,526,527,529,530,537,538,539,540,541,542,543,544,545,546,547,548,549,552,554,555,556,558,559,560,563,565,567,570,571,572,573,575,577,578,579,],[17,17,-60,-62,-63,-64,-65,-66,-67,81,-70,-71,91,17,94,17,-337,-337,-337,-125,-99,17,-337,-29,-104,-337,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,123,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,124,-61,81,17,-126,123,-95,-96,-97,-98,-101,81,-131,81,135,-37,-87,-72,136,-337,94,-90,-9,-10,-337,-91,-92,-100,-126,123,-94,-180,-27,-28,-182,-93,-166,-167,-335,-146,-147,136,-73,235,135,81,235,-337,235,-303,-284,-285,-286,-283,284,290,290,136,294,295,-289,-312,-287,-288,-301,-302,-304,300,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-30,235,-337,-28,318,81,235,-181,-183,-149,-336,81,-142,-144,347,235,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-312,136,358,235,362,363,235,367,235,-74,-38,-337,235,-337,-28,-69,-326,235,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,235,235,-297,-298,235,235,-331,-332,-333,-334,-284,235,235,-35,-36,318,444,318,-337,-45,453,-168,136,-151,-153,-148,-140,-141,-145,136,-143,-127,347,347,-174,-175,-218,-217,235,235,-234,235,235,235,235,235,-84,235,-230,-231,-233,235,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,235,-12,136,-284,235,235,-43,-44,136,-305,-292,-293,-294,-295,-296,-31,-34,444,453,-337,318,235,235,-169,-170,-150,-152,81,136,-219,235,-221,136,522,-83,235,-229,-232,-337,-198,-39,-42,-337,-68,136,-290,-291,235,-32,-33,235,-337,-28,-207,-213,-211,-284,-220,235,235,235,235,235,235,-11,-40,-41,-284,235,235,-50,-51,-209,-208,-210,-212,-222,-84,-224,-225,235,-299,-337,-306,235,-46,-49,235,235,-300,-47,-48,-223,-226,235,235,-228,-227,]),'TIMES':([0,2,4,5,6,7,8,9,10,12,14,15,17,20,21,22,23,24,25,26,28,29,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,68,69,70,71,73,74,75,76,77,80,81,89,90,91,93,96,97,98,99,100,101,102,104,110,111,112,113,114,115,116,117,119,120,121,124,125,126,132,133,134,136,138,140,141,142,143,144,145,146,147,148,149,150,151,153,154,155,156,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,189,191,192,194,203,205,206,209,211,213,218,219,220,221,222,223,224,225,226,227,228,229,230,231,235,239,244,247,248,253,254,255,256,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,287,288,289,290,291,292,293,294,296,297,298,299,302,305,306,318,319,326,328,330,332,333,336,337,338,343,344,345,347,349,350,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,443,450,452,454,455,458,459,461,462,464,465,466,469,474,476,477,478,481,483,491,492,493,494,495,496,497,499,500,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,554,555,556,558,563,565,567,572,573,575,577,578,579,],[29,29,-60,-62,-63,-64,-65,-66,-67,29,-70,-71,29,-337,-337,-337,-125,-99,29,-337,-104,-337,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,29,29,-126,-131,-95,-96,-97,-98,-101,-131,29,-87,-72,142,-337,-90,-9,-10,-337,-91,-92,-100,-126,-94,29,-27,-28,-182,-93,-166,-167,-335,-146,-147,142,-73,142,29,142,-337,142,-303,265,-255,-284,-285,-286,-283,-274,-276,142,142,142,142,-289,-312,-287,-288,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,302,-337,-28,29,29,142,-183,-149,-336,29,-142,-144,29,142,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-312,142,142,142,142,-274,-74,-337,395,-337,-28,-69,-326,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,-297,-298,-277,142,-278,-279,-280,142,-331,-332,-333,-334,-284,142,142,29,451,-168,142,-151,-153,-148,-140,-141,-145,142,-143,-127,29,-174,-175,-218,-217,142,142,-234,142,142,142,142,142,-84,142,-230,-231,-233,142,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,142,-12,142,-284,142,142,142,-305,-256,-257,-258,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,-292,-293,-294,-295,-296,-337,142,514,-169,-170,-150,-152,29,142,-219,142,-221,142,-83,142,-229,-232,-337,-198,-275,-337,-68,142,-290,-291,142,-281,-282,537,-337,-28,-284,-220,142,142,142,142,142,142,-11,-284,142,142,-222,-84,-224,-225,142,-299,-337,-306,142,142,142,-300,-223,-226,142,142,-228,-227,]),'TYPEID':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,61,62,63,66,67,68,69,70,71,72,73,74,75,76,77,79,80,81,89,90,94,95,96,97,98,99,100,101,102,104,110,111,112,113,114,115,116,117,119,120,121,122,123,124,125,126,127,132,135,136,178,189,190,191,193,194,200,201,202,203,204,205,206,207,208,209,210,211,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,285,286,290,294,295,300,307,308,309,314,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,461,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[34,34,-60,-62,-63,-64,-65,-66,-67,34,88,-70,-71,-52,-337,-337,-337,-125,-99,34,-337,-29,-104,-337,-122,-123,-124,-126,-238,117,121,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-154,-155,-61,34,-88,88,34,-126,-131,34,-95,-96,-97,-98,-101,88,-131,88,-87,-72,34,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-180,-27,-28,-182,-93,-166,-167,-335,-146,-147,34,34,34,-73,34,-89,88,34,34,-30,320,34,88,-181,-183,34,34,34,-149,-156,-336,88,-159,-160,-142,34,-144,34,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,34,-74,-69,427,429,34,34,34,34,-35,-36,34,320,34,-168,34,-151,34,-153,-148,-157,-140,-141,-145,-143,-127,34,-174,-175,-218,-217,-234,-81,-84,34,-230,-231,-233,-31,-34,34,34,-169,-170,-150,-152,-158,88,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'ENUM':([0,2,4,5,6,7,8,9,10,11,14,15,18,20,21,22,25,26,27,28,33,49,50,51,52,53,54,55,56,57,58,59,63,66,67,69,70,71,72,89,90,94,95,96,97,98,99,100,101,110,114,115,119,122,123,124,125,126,127,135,136,178,190,194,200,201,202,204,205,207,208,210,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,329,331,334,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[35,35,-60,-62,-63,-64,-65,-66,-67,35,-70,-71,-52,-337,-337,-337,35,-337,-29,-104,-337,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,35,-88,35,-337,-131,35,-87,-72,35,-53,-90,-9,-10,-337,-91,-92,-94,-182,-93,-335,35,35,35,-73,35,-89,35,35,-30,35,-183,35,35,35,-156,-336,-159,-160,35,35,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,35,-74,-69,35,35,35,35,-35,-36,35,35,35,35,-157,-127,35,-174,-175,-218,-217,-234,-81,-84,35,-230,-231,-233,-31,-34,35,35,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'VOID':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[37,37,-60,-62,-63,-64,-65,-66,-67,37,37,-70,-71,-52,-337,-337,-337,-125,-99,37,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,37,-88,37,37,-126,-131,37,-95,-96,-97,-98,-101,-131,-87,-72,37,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,37,37,37,-73,37,-89,37,37,-30,37,37,-183,37,37,37,-149,-156,-336,37,-159,-160,-142,37,-144,37,37,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,37,-74,-69,37,37,37,37,-35,-36,37,37,-168,37,-151,37,-153,-148,-157,-140,-141,-145,-143,-127,37,-174,-175,-218,-217,-234,-81,-84,37,-230,-231,-233,-31,-34,37,37,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'_BOOL':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[38,38,-60,-62,-63,-64,-65,-66,-67,38,38,-70,-71,-52,-337,-337,-337,-125,-99,38,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,38,-88,38,38,-126,-131,38,-95,-96,-97,-98,-101,-131,-87,-72,38,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,38,38,38,-73,38,-89,38,38,-30,38,38,-183,38,38,38,-149,-156,-336,38,-159,-160,-142,38,-144,38,38,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,38,-74,-69,38,38,38,38,-35,-36,38,38,-168,38,-151,38,-153,-148,-157,-140,-141,-145,-143,-127,38,-174,-175,-218,-217,-234,-81,-84,38,-230,-231,-233,-31,-34,38,38,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'CHAR':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[39,39,-60,-62,-63,-64,-65,-66,-67,39,39,-70,-71,-52,-337,-337,-337,-125,-99,39,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,39,-88,39,39,-126,-131,39,-95,-96,-97,-98,-101,-131,-87,-72,39,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,39,39,39,-73,39,-89,39,39,-30,39,39,-183,39,39,39,-149,-156,-336,39,-159,-160,-142,39,-144,39,39,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,39,-74,-69,39,39,39,39,-35,-36,39,39,-168,39,-151,39,-153,-148,-157,-140,-141,-145,-143,-127,39,-174,-175,-218,-217,-234,-81,-84,39,-230,-231,-233,-31,-34,39,39,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'SHORT':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[40,40,-60,-62,-63,-64,-65,-66,-67,40,40,-70,-71,-52,-337,-337,-337,-125,-99,40,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,40,-88,40,40,-126,-131,40,-95,-96,-97,-98,-101,-131,-87,-72,40,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,40,40,40,-73,40,-89,40,40,-30,40,40,-183,40,40,40,-149,-156,-336,40,-159,-160,-142,40,-144,40,40,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,40,-74,-69,40,40,40,40,-35,-36,40,40,-168,40,-151,40,-153,-148,-157,-140,-141,-145,-143,-127,40,-174,-175,-218,-217,-234,-81,-84,40,-230,-231,-233,-31,-34,40,40,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'INT':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[41,41,-60,-62,-63,-64,-65,-66,-67,41,41,-70,-71,-52,-337,-337,-337,-125,-99,41,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,41,-88,41,41,-126,-131,41,-95,-96,-97,-98,-101,-131,-87,-72,41,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,41,41,41,-73,41,-89,41,41,-30,41,41,-183,41,41,41,-149,-156,-336,41,-159,-160,-142,41,-144,41,41,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,41,-74,-69,41,41,41,41,-35,-36,41,41,-168,41,-151,41,-153,-148,-157,-140,-141,-145,-143,-127,41,-174,-175,-218,-217,-234,-81,-84,41,-230,-231,-233,-31,-34,41,41,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'LONG':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[42,42,-60,-62,-63,-64,-65,-66,-67,42,42,-70,-71,-52,-337,-337,-337,-125,-99,42,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,42,-88,42,42,-126,-131,42,-95,-96,-97,-98,-101,-131,-87,-72,42,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,42,42,42,-73,42,-89,42,42,-30,42,42,-183,42,42,42,-149,-156,-336,42,-159,-160,-142,42,-144,42,42,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,42,-74,-69,42,42,42,42,-35,-36,42,42,-168,42,-151,42,-153,-148,-157,-140,-141,-145,-143,-127,42,-174,-175,-218,-217,-234,-81,-84,42,-230,-231,-233,-31,-34,42,42,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'FLOAT':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[43,43,-60,-62,-63,-64,-65,-66,-67,43,43,-70,-71,-52,-337,-337,-337,-125,-99,43,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,43,-88,43,43,-126,-131,43,-95,-96,-97,-98,-101,-131,-87,-72,43,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,43,43,43,-73,43,-89,43,43,-30,43,43,-183,43,43,43,-149,-156,-336,43,-159,-160,-142,43,-144,43,43,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,43,-74,-69,43,43,43,43,-35,-36,43,43,-168,43,-151,43,-153,-148,-157,-140,-141,-145,-143,-127,43,-174,-175,-218,-217,-234,-81,-84,43,-230,-231,-233,-31,-34,43,43,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'DOUBLE':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[44,44,-60,-62,-63,-64,-65,-66,-67,44,44,-70,-71,-52,-337,-337,-337,-125,-99,44,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,44,-88,44,44,-126,-131,44,-95,-96,-97,-98,-101,-131,-87,-72,44,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,44,44,44,-73,44,-89,44,44,-30,44,44,-183,44,44,44,-149,-156,-336,44,-159,-160,-142,44,-144,44,44,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,44,-74,-69,44,44,44,44,-35,-36,44,44,-168,44,-151,44,-153,-148,-157,-140,-141,-145,-143,-127,44,-174,-175,-218,-217,-234,-81,-84,44,-230,-231,-233,-31,-34,44,44,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'_COMPLEX':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[45,45,-60,-62,-63,-64,-65,-66,-67,45,45,-70,-71,-52,-337,-337,-337,-125,-99,45,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,45,-88,45,45,-126,-131,45,-95,-96,-97,-98,-101,-131,-87,-72,45,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,45,45,45,-73,45,-89,45,45,-30,45,45,-183,45,45,45,-149,-156,-336,45,-159,-160,-142,45,-144,45,45,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,45,-74,-69,45,45,45,45,-35,-36,45,45,-168,45,-151,45,-153,-148,-157,-140,-141,-145,-143,-127,45,-174,-175,-218,-217,-234,-81,-84,45,-230,-231,-233,-31,-34,45,45,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'SIGNED':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[46,46,-60,-62,-63,-64,-65,-66,-67,46,46,-70,-71,-52,-337,-337,-337,-125,-99,46,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,46,-88,46,46,-126,-131,46,-95,-96,-97,-98,-101,-131,-87,-72,46,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,46,46,46,-73,46,-89,46,46,-30,46,46,-183,46,46,46,-149,-156,-336,46,-159,-160,-142,46,-144,46,46,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,46,-74,-69,46,46,46,46,-35,-36,46,46,-168,46,-151,46,-153,-148,-157,-140,-141,-145,-143,-127,46,-174,-175,-218,-217,-234,-81,-84,46,-230,-231,-233,-31,-34,46,46,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'UNSIGNED':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[47,47,-60,-62,-63,-64,-65,-66,-67,47,47,-70,-71,-52,-337,-337,-337,-125,-99,47,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,47,-88,47,47,-126,-131,47,-95,-96,-97,-98,-101,-131,-87,-72,47,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,47,47,47,-73,47,-89,47,47,-30,47,47,-183,47,47,47,-149,-156,-336,47,-159,-160,-142,47,-144,47,47,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,47,-74,-69,47,47,47,47,-35,-36,47,47,-168,47,-151,47,-153,-148,-157,-140,-141,-145,-143,-127,47,-174,-175,-218,-217,-234,-81,-84,47,-230,-231,-233,-31,-34,47,47,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'__INT128':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,94,95,96,97,98,99,100,101,102,104,110,114,115,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[48,48,-60,-62,-63,-64,-65,-66,-67,48,48,-70,-71,-52,-337,-337,-337,-125,-99,48,-337,-29,-104,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,48,-88,48,48,-126,-131,48,-95,-96,-97,-98,-101,-131,-87,-72,48,-53,-90,-9,-10,-337,-91,-92,-100,-126,-94,-182,-93,-166,-167,-335,-146,-147,48,48,48,-73,48,-89,48,48,-30,48,48,-183,48,48,48,-149,-156,-336,48,-159,-160,-142,48,-144,48,48,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,48,-74,-69,48,48,48,48,-35,-36,48,48,-168,48,-151,48,-153,-148,-157,-140,-141,-145,-143,-127,48,-174,-175,-218,-217,-234,-81,-84,48,-230,-231,-233,-31,-34,48,48,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'_ATOMIC':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,69,70,71,72,73,74,75,76,77,80,89,90,93,94,95,96,97,98,99,100,101,102,104,110,113,114,115,116,117,119,120,121,122,123,124,125,126,127,134,135,136,178,180,181,189,190,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,255,256,262,290,294,295,300,307,308,309,318,319,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,443,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,505,506,518,546,547,548,549,572,573,578,579,],[49,49,-60,-62,-63,-64,-65,-66,-67,71,80,-70,-71,-52,71,71,71,-125,-99,107,71,-29,-104,80,-122,-123,-124,71,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,71,-88,80,107,71,-131,71,-95,-96,-97,-98,-101,-131,-87,-72,80,49,-53,-90,-9,-10,71,-91,-92,-100,-126,-94,80,-182,-93,-166,-167,-335,-146,-147,49,49,49,-73,71,-89,80,49,49,-30,80,80,80,107,-183,49,49,49,-149,-156,-336,80,-159,-160,-142,71,-144,80,71,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,49,-74,80,80,-69,49,49,49,49,-35,-36,49,49,80,-168,49,-151,49,-153,-148,-157,-140,-141,-145,-143,-127,49,-174,-175,-218,-217,-234,-81,-84,71,-230,-231,-233,-31,-34,80,49,49,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,80,80,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'CONST':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,29,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,93,94,95,99,102,104,113,114,116,117,119,120,121,122,123,124,125,126,127,134,135,136,178,180,181,189,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,255,256,262,290,294,295,300,307,308,309,318,319,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,443,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,505,506,518,546,547,548,549,572,573,578,579,],[50,50,-60,-62,-63,-64,-65,-66,-67,50,50,-70,-71,-52,50,50,50,-125,-99,50,-29,-104,50,-122,-123,-124,50,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,50,-88,50,50,-131,50,-95,-96,-97,-98,-101,-131,-87,-72,50,50,-53,50,-100,-126,50,-182,-166,-167,-335,-146,-147,50,50,50,-73,50,-89,50,50,50,-30,50,50,50,-183,50,50,50,-149,-156,-336,50,-159,-160,-142,50,-144,50,50,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,50,-74,50,50,-69,50,50,50,50,-35,-36,50,50,50,-168,50,-151,50,-153,-148,-157,-140,-141,-145,-143,-127,50,-174,-175,-218,-217,-234,-81,-84,50,-230,-231,-233,-31,-34,50,50,50,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,50,50,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'RESTRICT':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,29,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,93,94,95,99,102,104,113,114,116,117,119,120,121,122,123,124,125,126,127,134,135,136,178,180,181,189,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,255,256,262,290,294,295,300,307,308,309,318,319,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,443,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,505,506,518,546,547,548,549,572,573,578,579,],[51,51,-60,-62,-63,-64,-65,-66,-67,51,51,-70,-71,-52,51,51,51,-125,-99,51,-29,-104,51,-122,-123,-124,51,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,51,-88,51,51,-131,51,-95,-96,-97,-98,-101,-131,-87,-72,51,51,-53,51,-100,-126,51,-182,-166,-167,-335,-146,-147,51,51,51,-73,51,-89,51,51,51,-30,51,51,51,-183,51,51,51,-149,-156,-336,51,-159,-160,-142,51,-144,51,51,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,51,-74,51,51,-69,51,51,51,51,-35,-36,51,51,51,-168,51,-151,51,-153,-148,-157,-140,-141,-145,-143,-127,51,-174,-175,-218,-217,-234,-81,-84,51,-230,-231,-233,-31,-34,51,51,51,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,51,51,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'VOLATILE':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,29,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,93,94,95,99,102,104,113,114,116,117,119,120,121,122,123,124,125,126,127,134,135,136,178,180,181,189,194,200,201,202,203,204,205,206,207,208,209,210,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,255,256,262,290,294,295,300,307,308,309,318,319,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,443,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,505,506,518,546,547,548,549,572,573,578,579,],[52,52,-60,-62,-63,-64,-65,-66,-67,52,52,-70,-71,-52,52,52,52,-125,-99,52,-29,-104,52,-122,-123,-124,52,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,52,-88,52,52,-131,52,-95,-96,-97,-98,-101,-131,-87,-72,52,52,-53,52,-100,-126,52,-182,-166,-167,-335,-146,-147,52,52,52,-73,52,-89,52,52,52,-30,52,52,52,-183,52,52,52,-149,-156,-336,52,-159,-160,-142,52,-144,52,52,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,52,-74,52,52,-69,52,52,52,52,-35,-36,52,52,52,-168,52,-151,52,-153,-148,-157,-140,-141,-145,-143,-127,52,-174,-175,-218,-217,-234,-81,-84,52,-230,-231,-233,-31,-34,52,52,52,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,52,52,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'AUTO':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,94,95,99,102,104,116,117,119,120,121,125,126,127,135,178,189,203,205,218,219,220,221,222,223,224,225,226,227,228,229,248,262,307,308,309,318,326,330,332,333,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[53,53,-60,-62,-63,-64,-65,-66,-67,53,53,-70,-71,-52,53,53,53,-125,-99,53,-29,-104,-122,-123,-124,53,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,53,-88,53,53,-131,53,-95,-96,-97,-98,-101,-131,-87,-72,53,-53,53,-100,-126,-166,-167,-335,-146,-147,-73,53,-89,53,-30,53,-149,-336,53,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-74,-69,-35,-36,53,53,-168,-151,-153,-148,-127,53,-174,-175,-218,-217,-234,-81,-84,53,-230,-231,-233,-31,-34,53,53,-169,-170,-150,-152,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'REGISTER':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,94,95,99,102,104,116,117,119,120,121,125,126,127,135,178,189,203,205,218,219,220,221,222,223,224,225,226,227,228,229,248,262,307,308,309,318,326,330,332,333,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[54,54,-60,-62,-63,-64,-65,-66,-67,54,54,-70,-71,-52,54,54,54,-125,-99,54,-29,-104,-122,-123,-124,54,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,54,-88,54,54,-131,54,-95,-96,-97,-98,-101,-131,-87,-72,54,-53,54,-100,-126,-166,-167,-335,-146,-147,-73,54,-89,54,-30,54,-149,-336,54,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-74,-69,-35,-36,54,54,-168,-151,-153,-148,-127,54,-174,-175,-218,-217,-234,-81,-84,54,-230,-231,-233,-31,-34,54,54,-169,-170,-150,-152,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'STATIC':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,93,94,95,99,102,104,114,116,117,119,120,121,125,126,127,134,135,178,181,189,194,203,205,218,219,220,221,222,223,224,225,226,227,228,229,248,256,262,307,308,309,318,326,330,332,333,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,443,444,453,454,455,458,459,464,466,474,477,478,493,502,503,506,518,546,547,548,549,572,573,578,579,],[28,28,-60,-62,-63,-64,-65,-66,-67,28,28,-70,-71,-52,28,28,28,-125,-99,28,-29,-104,-122,-123,-124,28,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,28,-88,28,28,-131,28,-95,-96,-97,-98,-101,-131,-87,-72,180,28,-53,28,-100,-126,-182,-166,-167,-335,-146,-147,-73,28,-89,255,28,-30,306,28,-183,-149,-336,28,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-74,397,-69,-35,-36,28,28,-168,-151,-153,-148,-127,28,-174,-175,-218,-217,-234,-81,-84,28,-230,-231,-233,-31,-34,505,28,28,-169,-170,-150,-152,-219,-221,-83,-229,-232,-68,-32,-33,539,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'EXTERN':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,94,95,99,102,104,116,117,119,120,121,125,126,127,135,178,189,203,205,218,219,220,221,222,223,224,225,226,227,228,229,248,262,307,308,309,318,326,330,332,333,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[55,55,-60,-62,-63,-64,-65,-66,-67,55,55,-70,-71,-52,55,55,55,-125,-99,55,-29,-104,-122,-123,-124,55,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,55,-88,55,55,-131,55,-95,-96,-97,-98,-101,-131,-87,-72,55,-53,55,-100,-126,-166,-167,-335,-146,-147,-73,55,-89,55,-30,55,-149,-336,55,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-74,-69,-35,-36,55,55,-168,-151,-153,-148,-127,55,-174,-175,-218,-217,-234,-81,-84,55,-230,-231,-233,-31,-34,55,55,-169,-170,-150,-152,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'TYPEDEF':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,94,95,99,102,104,116,117,119,120,121,125,126,127,135,178,189,203,205,218,219,220,221,222,223,224,225,226,227,228,229,248,262,307,308,309,318,326,330,332,333,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[56,56,-60,-62,-63,-64,-65,-66,-67,56,56,-70,-71,-52,56,56,56,-125,-99,56,-29,-104,-122,-123,-124,56,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,56,-88,56,56,-131,56,-95,-96,-97,-98,-101,-131,-87,-72,56,-53,56,-100,-126,-166,-167,-335,-146,-147,-73,56,-89,56,-30,56,-149,-336,56,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-74,-69,-35,-36,56,56,-168,-151,-153,-148,-127,56,-174,-175,-218,-217,-234,-81,-84,56,-230,-231,-233,-31,-34,56,56,-169,-170,-150,-152,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'_THREAD_LOCAL':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,94,95,99,102,104,116,117,119,120,121,125,126,127,135,178,189,203,205,218,219,220,221,222,223,224,225,226,227,228,229,248,262,307,308,309,318,326,330,332,333,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[57,57,-60,-62,-63,-64,-65,-66,-67,57,57,-70,-71,-52,57,57,57,-125,-99,57,-29,-104,-122,-123,-124,57,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,57,-88,57,57,-131,57,-95,-96,-97,-98,-101,-131,-87,-72,57,-53,57,-100,-126,-166,-167,-335,-146,-147,-73,57,-89,57,-30,57,-149,-336,57,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-74,-69,-35,-36,57,57,-168,-151,-153,-148,-127,57,-174,-175,-218,-217,-234,-81,-84,57,-230,-231,-233,-31,-34,57,57,-169,-170,-150,-152,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'INLINE':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,94,95,99,102,104,116,117,119,120,121,125,126,127,135,178,189,203,205,218,219,220,221,222,223,224,225,226,227,228,229,248,262,307,308,309,318,326,330,332,333,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[58,58,-60,-62,-63,-64,-65,-66,-67,58,58,-70,-71,-52,58,58,58,-125,-99,58,-29,-104,-122,-123,-124,58,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,58,-88,58,58,-131,58,-95,-96,-97,-98,-101,-131,-87,-72,58,-53,58,-100,-126,-166,-167,-335,-146,-147,-73,58,-89,58,-30,58,-149,-336,58,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-74,-69,-35,-36,58,58,-168,-151,-153,-148,-127,58,-174,-175,-218,-217,-234,-81,-84,58,-230,-231,-233,-31,-34,58,58,-169,-170,-150,-152,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'_NORETURN':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,94,95,99,102,104,116,117,119,120,121,125,126,127,135,178,189,203,205,218,219,220,221,222,223,224,225,226,227,228,229,248,262,307,308,309,318,326,330,332,333,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[59,59,-60,-62,-63,-64,-65,-66,-67,59,59,-70,-71,-52,59,59,59,-125,-99,59,-29,-104,-122,-123,-124,59,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,59,-88,59,59,-131,59,-95,-96,-97,-98,-101,-131,-87,-72,59,-53,59,-100,-126,-166,-167,-335,-146,-147,-73,59,-89,59,-30,59,-149,-336,59,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-74,-69,-35,-36,59,59,-168,-151,-153,-148,-127,59,-174,-175,-218,-217,-234,-81,-84,59,-230,-231,-233,-31,-34,59,59,-169,-170,-150,-152,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'_ALIGNAS':([0,2,4,5,6,7,8,9,10,11,12,14,15,18,20,21,22,23,24,26,27,28,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,63,66,67,68,70,71,72,73,74,75,76,77,80,89,90,94,95,99,102,104,116,117,119,120,121,122,123,124,125,126,127,135,136,178,189,200,201,202,203,204,205,206,207,208,209,211,213,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,326,329,330,331,332,333,334,336,337,338,344,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,454,455,458,459,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[60,60,-60,-62,-63,-64,-65,-66,-67,60,60,-70,-71,-52,60,60,60,-125,-99,60,-29,-104,-122,-123,-124,60,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,60,-88,60,60,-131,60,-95,-96,-97,-98,-101,-131,-87,-72,60,-53,60,-100,-126,-166,-167,-335,-146,-147,60,60,60,-73,60,-89,60,60,-30,60,60,60,60,-149,-156,-336,60,-159,-160,-142,-144,60,60,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,60,-74,-69,60,60,60,60,-35,-36,60,60,-168,60,-151,60,-153,-148,-157,-140,-141,-145,-143,-127,60,-174,-175,-218,-217,-234,-81,-84,60,-230,-231,-233,-31,-34,60,60,-169,-170,-150,-152,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'STRUCT':([0,2,4,5,6,7,8,9,10,11,14,15,18,20,21,22,25,26,27,28,33,49,50,51,52,53,54,55,56,57,58,59,63,66,67,69,70,71,72,89,90,94,95,96,97,98,99,100,101,110,114,115,119,122,123,124,125,126,127,135,136,178,190,194,200,201,202,204,205,207,208,210,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,329,331,334,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[61,61,-60,-62,-63,-64,-65,-66,-67,61,-70,-71,-52,-337,-337,-337,61,-337,-29,-104,-337,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,61,-88,61,-337,-131,61,-87,-72,61,-53,-90,-9,-10,-337,-91,-92,-94,-182,-93,-335,61,61,61,-73,61,-89,61,61,-30,61,-183,61,61,61,-156,-336,-159,-160,61,61,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,61,-74,-69,61,61,61,61,-35,-36,61,61,61,61,-157,-127,61,-174,-175,-218,-217,-234,-81,-84,61,-230,-231,-233,-31,-34,61,61,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'UNION':([0,2,4,5,6,7,8,9,10,11,14,15,18,20,21,22,25,26,27,28,33,49,50,51,52,53,54,55,56,57,58,59,63,66,67,69,70,71,72,89,90,94,95,96,97,98,99,100,101,110,114,115,119,122,123,124,125,126,127,135,136,178,190,194,200,201,202,204,205,207,208,210,218,219,220,221,222,223,224,225,226,227,228,229,235,248,262,290,294,295,300,307,308,309,318,329,331,334,345,347,349,350,351,352,357,365,366,367,369,370,372,434,435,444,453,460,464,466,474,477,478,493,502,503,518,546,547,548,549,572,573,578,579,],[62,62,-60,-62,-63,-64,-65,-66,-67,62,-70,-71,-52,-337,-337,-337,62,-337,-29,-104,-337,-131,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-61,62,-88,62,-337,-131,62,-87,-72,62,-53,-90,-9,-10,-337,-91,-92,-94,-182,-93,-335,62,62,62,-73,62,-89,62,62,-30,62,-183,62,62,62,-156,-336,-159,-160,62,62,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,62,-74,-69,62,62,62,62,-35,-36,62,62,62,62,-157,-127,62,-174,-175,-218,-217,-234,-81,-84,62,-230,-231,-233,-31,-34,62,62,-158,-219,-221,-83,-229,-232,-68,-32,-33,-220,-222,-84,-224,-225,-223,-226,-228,-227,]),'LBRACE':([11,15,18,27,35,36,61,62,64,65,66,67,72,89,90,95,116,117,119,120,121,126,127,129,133,178,192,205,218,219,220,221,222,223,224,225,226,227,228,229,235,239,253,262,307,308,351,352,354,356,357,365,366,369,370,372,387,388,389,400,434,435,464,465,466,469,474,477,478,481,483,492,493,498,499,502,503,518,519,520,521,526,527,546,547,548,549,555,563,572,573,575,577,578,579,],[-337,-71,-52,-29,119,119,-154,-155,119,-7,-8,-88,-337,-87,-72,-53,119,119,-335,119,119,119,-89,119,119,-30,119,-336,119,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,119,119,-337,-69,-35,-36,-218,-217,119,119,-234,119,-84,-230,-231,-233,-11,119,-12,119,-31,-34,-219,119,-221,119,-83,-229,-232,-337,-198,-337,-68,119,119,-32,-33,-220,119,119,119,119,-11,-222,-84,-224,-225,-337,119,-223,-226,119,119,-228,-227,]),'RBRACE':([15,89,90,119,122,126,138,139,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,197,198,199,200,201,202,204,205,207,208,216,217,218,219,220,221,222,223,224,225,226,227,228,229,246,247,252,253,262,263,287,288,289,291,292,293,296,297,298,299,324,325,327,329,331,334,351,352,357,365,366,369,370,372,385,386,387,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,456,457,460,464,466,468,474,477,478,479,480,481,482,491,493,495,496,499,500,518,525,531,532,546,547,548,549,553,554,555,556,567,572,573,578,579,],[-71,-87,-72,-335,205,-337,-303,-252,-253,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,205,-171,-176,205,205,205,-156,-336,-159,-160,205,-5,-6,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-239,-274,-193,-337,-69,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,205,205,-172,205,205,-157,-218,-217,-234,-81,-84,-230,-231,-233,205,-22,-21,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-292,-293,-294,-295,-296,-173,-177,-158,-219,-221,-237,-83,-229,-232,-240,-194,205,-196,-275,-68,-290,-291,-281,-282,-220,-195,205,-254,-222,-84,-224,-225,-197,-299,205,-306,-300,-223,-226,-228,-227,]),'CASE':([15,89,90,119,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,262,351,352,354,356,357,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[-71,-87,-72,-335,231,-336,231,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,231,-69,-218,-217,231,231,-234,231,-84,-230,-231,-233,-219,231,-221,-83,-229,-232,-68,-220,231,231,231,-222,-84,-224,-225,231,-223,-226,231,231,-228,-227,]),'DEFAULT':([15,89,90,119,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,262,351,352,354,356,357,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[-71,-87,-72,-335,232,-336,232,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,232,-69,-218,-217,232,232,-234,232,-84,-230,-231,-233,-219,232,-221,-83,-229,-232,-68,-220,232,232,232,-222,-84,-224,-225,232,-223,-226,232,232,-228,-227,]),'IF':([15,89,90,119,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,262,351,352,354,356,357,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[-71,-87,-72,-335,234,-336,234,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,234,-69,-218,-217,234,234,-234,234,-84,-230,-231,-233,-219,234,-221,-83,-229,-232,-68,-220,234,234,234,-222,-84,-224,-225,234,-223,-226,234,234,-228,-227,]),'SWITCH':([15,89,90,119,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,262,351,352,354,356,357,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[-71,-87,-72,-335,237,-336,237,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,237,-69,-218,-217,237,237,-234,237,-84,-230,-231,-233,-219,237,-221,-83,-229,-232,-68,-220,237,237,237,-222,-84,-224,-225,237,-223,-226,237,237,-228,-227,]),'WHILE':([15,89,90,119,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,262,351,352,354,356,357,364,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[-71,-87,-72,-335,238,-336,238,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,238,-69,-218,-217,238,238,-234,473,238,-84,-230,-231,-233,-219,238,-221,-83,-229,-232,-68,-220,238,238,238,-222,-84,-224,-225,238,-223,-226,238,238,-228,-227,]),'DO':([15,89,90,119,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,262,351,352,354,356,357,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[-71,-87,-72,-335,239,-336,239,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,239,-69,-218,-217,239,239,-234,239,-84,-230,-231,-233,-219,239,-221,-83,-229,-232,-68,-220,239,239,239,-222,-84,-224,-225,239,-223,-226,239,239,-228,-227,]),'FOR':([15,89,90,119,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,262,351,352,354,356,357,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[-71,-87,-72,-335,240,-336,240,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,240,-69,-218,-217,240,240,-234,240,-84,-230,-231,-233,-219,240,-221,-83,-229,-232,-68,-220,240,240,240,-222,-84,-224,-225,240,-223,-226,240,240,-228,-227,]),'GOTO':([15,89,90,119,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,262,351,352,354,356,357,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[-71,-87,-72,-335,241,-336,241,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,241,-69,-218,-217,241,241,-234,241,-84,-230,-231,-233,-219,241,-221,-83,-229,-232,-68,-220,241,241,241,-222,-84,-224,-225,241,-223,-226,241,241,-228,-227,]),'BREAK':([15,89,90,119,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,262,351,352,354,356,357,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[-71,-87,-72,-335,242,-336,242,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,242,-69,-218,-217,242,242,-234,242,-84,-230,-231,-233,-219,242,-221,-83,-229,-232,-68,-220,242,242,242,-222,-84,-224,-225,242,-223,-226,242,242,-228,-227,]),'CONTINUE':([15,89,90,119,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,262,351,352,354,356,357,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[-71,-87,-72,-335,243,-336,243,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,243,-69,-218,-217,243,243,-234,243,-84,-230,-231,-233,-219,243,-221,-83,-229,-232,-68,-220,243,243,243,-222,-84,-224,-225,243,-223,-226,243,243,-228,-227,]),'RETURN':([15,89,90,119,126,205,218,219,220,221,222,223,224,225,226,227,228,229,239,262,351,352,354,356,357,365,366,369,370,372,464,465,466,474,477,478,493,518,519,520,521,546,547,548,549,563,572,573,575,577,578,579,],[-71,-87,-72,-335,244,-336,244,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,244,-69,-218,-217,244,244,-234,244,-84,-230,-231,-233,-219,244,-221,-83,-229,-232,-68,-220,244,244,244,-222,-84,-224,-225,244,-223,-226,244,244,-228,-227,]),'PLUSPLUS':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,138,142,143,144,145,147,148,149,150,151,153,154,155,156,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,230,231,235,239,244,253,254,255,256,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,287,288,290,294,296,297,298,299,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,401,424,426,427,428,429,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,495,496,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,554,555,556,558,563,565,567,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,148,-337,-27,-28,-182,-335,148,148,148,-337,148,-303,-284,-285,-286,-283,287,148,148,148,148,-289,-312,-287,-288,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,148,-337,-28,148,-183,-336,148,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-312,148,148,148,148,-337,148,-337,-28,-69,-326,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,-297,-298,148,148,-331,-332,-333,-334,-284,148,148,-337,148,148,-218,-217,148,148,-234,148,148,148,148,148,-84,148,-230,-231,-233,148,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,148,-12,148,-284,148,148,148,-305,-292,-293,-294,-295,-296,-337,148,148,148,-219,148,-221,148,-83,148,-229,-232,-337,-198,-337,-68,148,-290,-291,148,148,-337,-28,-284,-220,148,148,148,148,148,148,-11,-284,148,148,-222,-84,-224,-225,148,-299,-337,-306,148,148,148,-300,-223,-226,148,148,-228,-227,]),'MINUSMINUS':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,138,142,143,144,145,147,148,149,150,151,153,154,155,156,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,230,231,235,239,244,253,254,255,256,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,287,288,290,294,296,297,298,299,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,401,424,426,427,428,429,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,495,496,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,554,555,556,558,563,565,567,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,149,-337,-27,-28,-182,-335,149,149,149,-337,149,-303,-284,-285,-286,-283,288,149,149,149,149,-289,-312,-287,-288,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,149,-337,-28,149,-183,-336,149,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-312,149,149,149,149,-337,149,-337,-28,-69,-326,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,-297,-298,149,149,-331,-332,-333,-334,-284,149,149,-337,149,149,-218,-217,149,149,-234,149,149,149,149,149,-84,149,-230,-231,-233,149,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,149,-12,149,-284,149,149,149,-305,-292,-293,-294,-295,-296,-337,149,149,149,-219,149,-221,149,-83,149,-229,-232,-337,-198,-337,-68,149,-290,-291,149,149,-337,-28,-284,-220,149,149,149,149,149,149,-11,-284,149,149,-222,-84,-224,-225,149,-299,-337,-306,149,149,149,-300,-223,-226,149,149,-228,-227,]),'SIZEOF':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,151,-337,-27,-28,-182,-335,151,151,151,-337,151,-284,-285,-286,-283,151,151,151,151,-287,-288,151,-337,-28,151,-183,-336,151,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,151,151,151,151,-337,151,-337,-28,-69,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,-284,151,151,-337,151,151,-218,-217,151,151,-234,151,151,151,151,151,-84,151,-230,-231,-233,151,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,151,-12,151,-284,151,151,151,-337,151,151,151,-219,151,-221,151,-83,151,-229,-232,-337,-198,-337,-68,151,151,151,-337,-28,-284,-220,151,151,151,151,151,151,-11,-284,151,151,-222,-84,-224,-225,151,-337,151,151,151,-223,-226,151,151,-228,-227,]),'_ALIGNOF':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,152,-337,-27,-28,-182,-335,152,152,152,-337,152,-284,-285,-286,-283,152,152,152,152,-287,-288,152,-337,-28,152,-183,-336,152,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,152,152,152,152,-337,152,-337,-28,-69,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,-284,152,152,-337,152,152,-218,-217,152,152,-234,152,152,152,152,152,-84,152,-230,-231,-233,152,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,152,-12,152,-284,152,152,152,-337,152,152,152,-219,152,-221,152,-83,152,-229,-232,-337,-198,-337,-68,152,152,152,-337,-28,-284,-220,152,152,152,152,152,152,-11,-284,152,152,-222,-84,-224,-225,152,-337,152,152,152,-223,-226,152,152,-228,-227,]),'AND':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,138,140,141,142,143,144,145,146,147,148,149,150,151,153,154,155,156,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,230,231,235,239,244,247,253,254,255,256,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,287,288,289,290,291,292,293,294,296,297,298,299,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,443,450,452,462,464,465,466,469,474,476,477,478,481,483,491,492,493,494,495,496,497,499,500,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,554,555,556,558,563,565,567,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,145,-337,-27,-28,-182,-335,145,145,145,-337,145,-303,278,-255,-284,-285,-286,-283,-274,-276,145,145,145,145,-289,-312,-287,-288,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,145,-337,-28,145,-183,-336,145,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-312,145,145,145,145,-274,-337,145,-337,-28,-69,-326,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,-297,-298,-277,145,-278,-279,-280,145,-331,-332,-333,-334,-284,145,145,-337,145,145,-218,-217,145,145,-234,145,145,145,145,145,-84,145,-230,-231,-233,145,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,145,-12,145,-284,145,145,145,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,278,278,278,278,-292,-293,-294,-295,-296,-337,145,145,145,-219,145,-221,145,-83,145,-229,-232,-337,-198,-275,-337,-68,145,-290,-291,145,-281,-282,145,-337,-28,-284,-220,145,145,145,145,145,145,-11,-284,145,145,-222,-84,-224,-225,145,-299,-337,-306,145,145,145,-300,-223,-226,145,145,-228,-227,]),'PLUS':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,138,140,141,142,143,144,145,146,147,148,149,150,151,153,154,155,156,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,230,231,235,239,244,247,253,254,255,256,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,287,288,289,290,291,292,293,294,296,297,298,299,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,443,450,452,462,464,465,466,469,474,476,477,478,481,483,491,492,493,494,495,496,497,499,500,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,554,555,556,558,563,565,567,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,143,-337,-27,-28,-182,-335,143,143,143,-337,143,-303,268,-255,-284,-285,-286,-283,-274,-276,143,143,143,143,-289,-312,-287,-288,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,143,-337,-28,143,-183,-336,143,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-312,143,143,143,143,-274,-337,143,-337,-28,-69,-326,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,-297,-298,-277,143,-278,-279,-280,143,-331,-332,-333,-334,-284,143,143,-337,143,143,-218,-217,143,143,-234,143,143,143,143,143,-84,143,-230,-231,-233,143,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,143,-12,143,-284,143,143,143,-305,-256,-257,-258,-259,-260,268,268,268,268,268,268,268,268,268,268,268,268,268,-292,-293,-294,-295,-296,-337,143,143,143,-219,143,-221,143,-83,143,-229,-232,-337,-198,-275,-337,-68,143,-290,-291,143,-281,-282,143,-337,-28,-284,-220,143,143,143,143,143,143,-11,-284,143,143,-222,-84,-224,-225,143,-299,-337,-306,143,143,143,-300,-223,-226,143,143,-228,-227,]),'MINUS':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,138,140,141,142,143,144,145,146,147,148,149,150,151,153,154,155,156,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,230,231,235,239,244,247,253,254,255,256,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,287,288,289,290,291,292,293,294,296,297,298,299,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,443,450,452,462,464,465,466,469,474,476,477,478,481,483,491,492,493,494,495,496,497,499,500,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,554,555,556,558,563,565,567,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,144,-337,-27,-28,-182,-335,144,144,144,-337,144,-303,269,-255,-284,-285,-286,-283,-274,-276,144,144,144,144,-289,-312,-287,-288,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,144,-337,-28,144,-183,-336,144,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,-312,144,144,144,144,-274,-337,144,-337,-28,-69,-326,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,-297,-298,-277,144,-278,-279,-280,144,-331,-332,-333,-334,-284,144,144,-337,144,144,-218,-217,144,144,-234,144,144,144,144,144,-84,144,-230,-231,-233,144,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,144,-12,144,-284,144,144,144,-305,-256,-257,-258,-259,-260,269,269,269,269,269,269,269,269,269,269,269,269,269,-292,-293,-294,-295,-296,-337,144,144,144,-219,144,-221,144,-83,144,-229,-232,-337,-198,-275,-337,-68,144,-290,-291,144,-281,-282,144,-337,-28,-284,-220,144,144,144,144,144,144,-11,-284,144,144,-222,-84,-224,-225,144,-299,-337,-306,144,144,144,-300,-223,-226,144,144,-228,-227,]),'NOT':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,155,-337,-27,-28,-182,-335,155,155,155,-337,155,-284,-285,-286,-283,155,155,155,155,-287,-288,155,-337,-28,155,-183,-336,155,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,155,155,155,155,-337,155,-337,-28,-69,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,-284,155,155,-337,155,155,-218,-217,155,155,-234,155,155,155,155,155,-84,155,-230,-231,-233,155,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,155,-12,155,-284,155,155,155,-337,155,155,155,-219,155,-221,155,-83,155,-229,-232,-337,-198,-337,-68,155,155,155,-337,-28,-284,-220,155,155,155,155,155,155,-11,-284,155,155,-222,-84,-224,-225,155,-337,155,155,155,-223,-226,155,155,-228,-227,]),'LNOT':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,156,-337,-27,-28,-182,-335,156,156,156,-337,156,-284,-285,-286,-283,156,156,156,156,-287,-288,156,-337,-28,156,-183,-336,156,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,156,156,156,156,-337,156,-337,-28,-69,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,-284,156,156,-337,156,156,-218,-217,156,156,-234,156,156,156,156,156,-84,156,-230,-231,-233,156,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,156,-12,156,-284,156,156,156,-337,156,156,156,-219,156,-221,156,-83,156,-229,-232,-337,-198,-337,-68,156,156,156,-337,-28,-284,-220,156,156,156,156,156,156,-11,-284,156,156,-222,-84,-224,-225,156,-337,156,156,156,-223,-226,156,156,-228,-227,]),'OFFSETOF':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,160,-337,-27,-28,-182,-335,160,160,160,-337,160,-284,-285,-286,-283,160,160,160,160,-287,-288,160,-337,-28,160,-183,-336,160,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,160,160,160,160,-337,160,-337,-28,-69,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,-284,160,160,-337,160,160,-218,-217,160,160,-234,160,160,160,160,160,-84,160,-230,-231,-233,160,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,160,-12,160,-284,160,160,160,-337,160,160,160,-219,160,-221,160,-83,160,-229,-232,-337,-198,-337,-68,160,160,160,-337,-28,-284,-220,160,160,160,160,160,160,-11,-284,160,160,-222,-84,-224,-225,160,-337,160,160,160,-223,-226,160,160,-228,-227,]),'INT_CONST_DEC':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,161,-337,-27,-28,-182,-335,161,161,161,-337,161,-284,-285,-286,-283,161,161,161,161,-287,-288,161,-337,-28,161,-183,-336,161,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,161,161,161,161,-337,161,-337,-28,-69,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,-284,161,161,-337,161,161,-218,-217,161,161,-234,161,161,161,161,161,-84,161,-230,-231,-233,161,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,161,-12,161,-284,161,161,161,-337,161,161,161,-219,161,-221,161,-83,161,-229,-232,-337,-198,-337,-68,161,161,161,-337,-28,-284,-220,161,161,161,161,161,161,-11,-284,161,161,-222,-84,-224,-225,161,-337,161,161,161,-223,-226,161,161,-228,-227,]),'INT_CONST_OCT':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,162,-337,-27,-28,-182,-335,162,162,162,-337,162,-284,-285,-286,-283,162,162,162,162,-287,-288,162,-337,-28,162,-183,-336,162,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,162,162,162,162,-337,162,-337,-28,-69,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,-284,162,162,-337,162,162,-218,-217,162,162,-234,162,162,162,162,162,-84,162,-230,-231,-233,162,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,162,-12,162,-284,162,162,162,-337,162,162,162,-219,162,-221,162,-83,162,-229,-232,-337,-198,-337,-68,162,162,162,-337,-28,-284,-220,162,162,162,162,162,162,-11,-284,162,162,-222,-84,-224,-225,162,-337,162,162,162,-223,-226,162,162,-228,-227,]),'INT_CONST_HEX':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,163,-337,-27,-28,-182,-335,163,163,163,-337,163,-284,-285,-286,-283,163,163,163,163,-287,-288,163,-337,-28,163,-183,-336,163,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,163,163,163,163,-337,163,-337,-28,-69,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,-284,163,163,-337,163,163,-218,-217,163,163,-234,163,163,163,163,163,-84,163,-230,-231,-233,163,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,163,-12,163,-284,163,163,163,-337,163,163,163,-219,163,-221,163,-83,163,-229,-232,-337,-198,-337,-68,163,163,163,-337,-28,-284,-220,163,163,163,163,163,163,-11,-284,163,163,-222,-84,-224,-225,163,-337,163,163,163,-223,-226,163,163,-228,-227,]),'INT_CONST_BIN':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,164,-337,-27,-28,-182,-335,164,164,164,-337,164,-284,-285,-286,-283,164,164,164,164,-287,-288,164,-337,-28,164,-183,-336,164,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,164,164,164,164,-337,164,-337,-28,-69,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,-284,164,164,-337,164,164,-218,-217,164,164,-234,164,164,164,164,164,-84,164,-230,-231,-233,164,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,164,-12,164,-284,164,164,164,-337,164,164,164,-219,164,-221,164,-83,164,-229,-232,-337,-198,-337,-68,164,164,164,-337,-28,-284,-220,164,164,164,164,164,164,-11,-284,164,164,-222,-84,-224,-225,164,-337,164,164,164,-223,-226,164,164,-228,-227,]),'INT_CONST_CHAR':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,165,-337,-27,-28,-182,-335,165,165,165,-337,165,-284,-285,-286,-283,165,165,165,165,-287,-288,165,-337,-28,165,-183,-336,165,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,165,165,165,165,-337,165,-337,-28,-69,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,-284,165,165,-337,165,165,-218,-217,165,165,-234,165,165,165,165,165,-84,165,-230,-231,-233,165,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,165,-12,165,-284,165,165,165,-337,165,165,165,-219,165,-221,165,-83,165,-229,-232,-337,-198,-337,-68,165,165,165,-337,-28,-284,-220,165,165,165,165,165,165,-11,-284,165,165,-222,-84,-224,-225,165,-337,165,165,165,-223,-226,165,165,-228,-227,]),'FLOAT_CONST':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,166,-337,-27,-28,-182,-335,166,166,166,-337,166,-284,-285,-286,-283,166,166,166,166,-287,-288,166,-337,-28,166,-183,-336,166,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,166,166,166,166,-337,166,-337,-28,-69,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,-284,166,166,-337,166,166,-218,-217,166,166,-234,166,166,166,166,166,-84,166,-230,-231,-233,166,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,166,-12,166,-284,166,166,166,-337,166,166,166,-219,166,-221,166,-83,166,-229,-232,-337,-198,-337,-68,166,166,166,-337,-28,-284,-220,166,166,166,166,166,166,-11,-284,166,166,-222,-84,-224,-225,166,-337,166,166,166,-223,-226,166,166,-228,-227,]),'HEX_FLOAT_CONST':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,167,-337,-27,-28,-182,-335,167,167,167,-337,167,-284,-285,-286,-283,167,167,167,167,-287,-288,167,-337,-28,167,-183,-336,167,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,167,167,167,167,-337,167,-337,-28,-69,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,-284,167,167,-337,167,167,-218,-217,167,167,-234,167,167,167,167,167,-84,167,-230,-231,-233,167,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,167,-12,167,-284,167,167,167,-337,167,167,167,-219,167,-221,167,-83,167,-229,-232,-337,-198,-337,-68,167,167,167,-337,-28,-284,-220,167,167,167,167,167,167,-11,-284,167,167,-222,-84,-224,-225,167,-337,167,167,167,-223,-226,167,167,-228,-227,]),'CHAR_CONST':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,168,-337,-27,-28,-182,-335,168,168,168,-337,168,-284,-285,-286,-283,168,168,168,168,-287,-288,168,-337,-28,168,-183,-336,168,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,168,168,168,168,-337,168,-337,-28,-69,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,-284,168,168,-337,168,168,-218,-217,168,168,-234,168,168,168,168,168,-84,168,-230,-231,-233,168,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,168,-12,168,-284,168,168,168,-337,168,168,168,-219,168,-221,168,-83,168,-229,-232,-337,-198,-337,-68,168,168,168,-337,-28,-284,-220,168,168,168,168,168,168,-11,-284,168,168,-222,-84,-224,-225,168,-337,168,168,168,-223,-226,168,168,-228,-227,]),'WCHAR_CONST':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,169,-337,-27,-28,-182,-335,169,169,169,-337,169,-284,-285,-286,-283,169,169,169,169,-287,-288,169,-337,-28,169,-183,-336,169,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,169,169,169,169,-337,169,-337,-28,-69,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,-284,169,169,-337,169,169,-218,-217,169,169,-234,169,169,169,169,169,-84,169,-230,-231,-233,169,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,169,-12,169,-284,169,169,169,-337,169,169,169,-219,169,-221,169,-83,169,-229,-232,-337,-198,-337,-68,169,169,169,-337,-28,-284,-220,169,169,169,169,169,169,-11,-284,169,169,-222,-84,-224,-225,169,-337,169,169,169,-223,-226,169,169,-228,-227,]),'U8CHAR_CONST':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,170,-337,-27,-28,-182,-335,170,170,170,-337,170,-284,-285,-286,-283,170,170,170,170,-287,-288,170,-337,-28,170,-183,-336,170,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,170,170,170,170,-337,170,-337,-28,-69,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,-284,170,170,-337,170,170,-218,-217,170,170,-234,170,170,170,170,170,-84,170,-230,-231,-233,170,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,170,-12,170,-284,170,170,170,-337,170,170,170,-219,170,-221,170,-83,170,-229,-232,-337,-198,-337,-68,170,170,170,-337,-28,-284,-220,170,170,170,170,170,170,-11,-284,170,170,-222,-84,-224,-225,170,-337,170,170,170,-223,-226,170,170,-228,-227,]),'U16CHAR_CONST':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,171,-337,-27,-28,-182,-335,171,171,171,-337,171,-284,-285,-286,-283,171,171,171,171,-287,-288,171,-337,-28,171,-183,-336,171,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,171,171,171,171,-337,171,-337,-28,-69,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,-284,171,171,-337,171,171,-218,-217,171,171,-234,171,171,171,171,171,-84,171,-230,-231,-233,171,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,171,-12,171,-284,171,171,171,-337,171,171,171,-219,171,-221,171,-83,171,-229,-232,-337,-198,-337,-68,171,171,171,-337,-28,-284,-220,171,171,171,171,171,171,-11,-284,171,171,-222,-84,-224,-225,171,-337,171,171,171,-223,-226,171,171,-228,-227,]),'U32CHAR_CONST':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,172,-337,-27,-28,-182,-335,172,172,172,-337,172,-284,-285,-286,-283,172,172,172,172,-287,-288,172,-337,-28,172,-183,-336,172,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,172,172,172,172,-337,172,-337,-28,-69,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,-284,172,172,-337,172,172,-218,-217,172,172,-234,172,172,172,172,172,-84,172,-230,-231,-233,172,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,172,-12,172,-284,172,172,172,-337,172,172,172,-219,172,-221,172,-83,172,-229,-232,-337,-198,-337,-68,172,172,172,-337,-28,-284,-220,172,172,172,172,172,172,-11,-284,172,172,-222,-84,-224,-225,172,-337,172,172,172,-223,-226,172,172,-228,-227,]),'STRING_LITERAL':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,138,142,143,144,145,148,149,150,151,155,156,173,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,402,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,173,-337,-27,-28,-182,-335,173,173,173,-337,173,263,-284,-285,-286,-283,173,173,173,173,-287,-288,-325,173,-337,-28,173,-183,-336,173,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,173,173,173,173,-337,173,-337,-28,173,-69,-326,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,-284,173,173,-337,173,173,-218,-217,173,173,-234,173,173,173,173,173,-84,173,-230,-231,-233,173,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,173,-12,173,-284,173,173,173,263,-337,173,173,173,-219,173,-221,173,-83,173,-229,-232,-337,-198,-337,-68,173,173,173,-337,-28,-284,-220,173,173,173,173,173,173,-11,-284,173,173,-222,-84,-224,-225,173,-337,173,173,173,-223,-226,173,173,-228,-227,]),'WSTRING_LITERAL':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,159,174,175,176,177,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,296,297,298,299,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,174,-337,-27,-28,-182,-335,174,174,174,-337,174,-284,-285,-286,-283,174,174,174,174,-287,-288,296,-327,-328,-329,-330,174,-337,-28,174,-183,-336,174,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,174,174,174,174,-337,174,-337,-28,-69,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,-331,-332,-333,-334,-284,174,174,-337,174,174,-218,-217,174,174,-234,174,174,174,174,174,-84,174,-230,-231,-233,174,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,174,-12,174,-284,174,174,174,-337,174,174,174,-219,174,-221,174,-83,174,-229,-232,-337,-198,-337,-68,174,174,174,-337,-28,-284,-220,174,174,174,174,174,174,-11,-284,174,174,-222,-84,-224,-225,174,-337,174,174,174,-223,-226,174,174,-228,-227,]),'U8STRING_LITERAL':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,159,174,175,176,177,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,296,297,298,299,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,175,-337,-27,-28,-182,-335,175,175,175,-337,175,-284,-285,-286,-283,175,175,175,175,-287,-288,297,-327,-328,-329,-330,175,-337,-28,175,-183,-336,175,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,175,175,175,175,-337,175,-337,-28,-69,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,-331,-332,-333,-334,-284,175,175,-337,175,175,-218,-217,175,175,-234,175,175,175,175,175,-84,175,-230,-231,-233,175,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,175,-12,175,-284,175,175,175,-337,175,175,175,-219,175,-221,175,-83,175,-229,-232,-337,-198,-337,-68,175,175,175,-337,-28,-284,-220,175,175,175,175,175,175,-11,-284,175,175,-222,-84,-224,-225,175,-337,175,175,175,-223,-226,175,175,-228,-227,]),'U16STRING_LITERAL':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,159,174,175,176,177,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,296,297,298,299,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,176,-337,-27,-28,-182,-335,176,176,176,-337,176,-284,-285,-286,-283,176,176,176,176,-287,-288,298,-327,-328,-329,-330,176,-337,-28,176,-183,-336,176,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,176,176,176,176,-337,176,-337,-28,-69,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,-331,-332,-333,-334,-284,176,176,-337,176,176,-218,-217,176,176,-234,176,176,176,176,176,-84,176,-230,-231,-233,176,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,176,-12,176,-284,176,176,176,-337,176,176,176,-219,176,-221,176,-83,176,-229,-232,-337,-198,-337,-68,176,176,176,-337,-28,-284,-220,176,176,176,176,176,176,-11,-284,176,176,-222,-84,-224,-225,176,-337,176,176,176,-223,-226,176,176,-228,-227,]),'U32STRING_LITERAL':([15,50,51,52,80,89,90,91,93,112,113,114,119,124,126,133,134,136,142,143,144,145,148,149,150,151,155,156,159,174,175,176,177,179,180,181,192,194,205,218,219,220,221,222,223,224,225,226,227,228,229,231,235,239,244,253,254,255,256,262,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,296,297,298,299,302,305,306,319,328,343,351,352,354,356,357,358,361,362,363,365,366,367,369,370,372,373,374,375,376,377,378,379,380,381,382,383,384,387,388,389,392,395,396,397,400,443,450,452,462,464,465,466,469,474,476,477,478,481,483,492,493,494,497,504,505,506,514,518,519,520,521,522,523,526,527,537,538,539,546,547,548,549,552,555,558,563,565,572,573,575,577,578,579,],[-71,-128,-129,-130,-131,-87,-72,177,-337,-27,-28,-182,-335,177,177,177,-337,177,-284,-285,-286,-283,177,177,177,177,-287,-288,299,-327,-328,-329,-330,177,-337,-28,177,-183,-336,177,-216,-214,-215,-75,-76,-77,-78,-79,-80,-81,-82,177,177,177,177,-337,177,-337,-28,-69,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,-331,-332,-333,-334,-284,177,177,-337,177,177,-218,-217,177,177,-234,177,177,177,177,177,-84,177,-230,-231,-233,177,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-11,177,-12,177,-284,177,177,177,-337,177,177,177,-219,177,-221,177,-83,177,-229,-232,-337,-198,-337,-68,177,177,177,-337,-28,-284,-220,177,177,177,177,177,177,-11,-284,177,177,-222,-84,-224,-225,177,-337,177,177,177,-223,-226,177,177,-228,-227,]),'ELSE':([15,90,205,222,223,224,225,226,227,228,229,262,351,357,365,366,369,370,372,464,466,474,477,478,493,518,546,547,548,549,572,573,578,579,],[-71,-72,-336,-75,-76,-77,-78,-79,-80,-81,-82,-69,-218,-234,-81,-84,-230,-231,-233,-219,-221,-83,-229,-232,-68,-220,-222,563,-224,-225,-223,-226,-228,-227,]),'PPPRAGMASTR':([15,],[90,]),'EQUALS':([18,27,72,85,86,87,88,95,109,128,130,138,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,199,205,230,247,249,263,287,288,289,291,292,293,296,297,298,299,307,308,390,391,398,399,401,424,426,427,428,429,434,435,484,486,487,488,491,495,496,499,500,502,503,528,529,530,554,556,567,],[-52,-29,-178,133,-179,-54,-37,-53,192,-178,-55,-303,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-30,328,-336,-312,374,-38,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-35,-36,483,-199,-43,-44,-305,-292,-293,-294,-295,-296,-31,-34,-200,-202,-39,-42,-275,-290,-291,-281,-282,-32,-33,-201,-40,-41,-299,-306,-300,]),'COMMA':([18,23,24,27,28,29,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,50,51,52,53,54,55,56,57,58,59,72,73,74,75,76,77,80,83,84,85,86,87,88,95,102,104,106,108,109,111,112,113,114,116,117,120,121,128,130,137,138,139,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,184,186,187,188,189,193,194,197,198,199,203,205,209,211,213,230,236,245,246,247,249,250,251,252,260,263,287,288,289,291,292,293,296,297,298,299,307,308,311,312,313,314,315,316,317,320,321,322,323,324,325,326,327,330,332,333,336,337,338,340,341,342,344,345,346,348,349,350,371,386,398,399,401,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,433,434,435,439,440,441,442,454,455,456,457,458,459,463,467,468,470,471,472,479,480,482,487,488,491,495,496,499,500,502,503,509,510,512,516,517,525,529,530,531,532,533,540,541,542,543,544,545,550,553,554,556,559,560,567,569,570,571,],[-52,-125,-99,-29,-104,-337,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-178,-95,-96,-97,-98,-101,-131,132,-132,-134,-179,-54,-37,-53,-100,-126,191,-136,-138,-180,-27,-28,-182,-166,-167,-146,-147,-178,-55,261,-303,-252,-253,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-30,309,310,-186,-191,-337,-181,-183,327,-171,-176,-149,-336,-142,-144,-337,-312,361,-235,-239,-274,-38,-133,-135,-193,361,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-35,-36,-188,-189,-190,-204,-56,-1,-2,-45,-206,-137,-139,327,327,-168,-172,-151,-153,-148,-140,-141,-145,461,-161,-163,-143,-127,-203,-204,-174,-175,361,481,-43,-44,-305,361,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,361,497,-292,-310,-293,-294,-295,-296,501,-31,-34,-187,-192,-57,-205,-169,-170,-173,-177,-150,-152,-165,361,-237,-236,361,361,-240,-194,-196,-39,-42,-275,-290,-291,-281,-282,-32,-33,-207,-213,-211,-162,-164,-195,-40,-41,555,-254,-311,-50,-51,-209,-208,-210,-212,361,-197,-299,-306,-46,-49,-300,361,-47,-48,]),'RPAREN':([18,23,24,27,28,29,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,50,51,52,53,54,55,56,57,58,59,73,74,75,76,77,80,87,88,92,94,95,102,104,111,112,113,114,116,117,120,121,130,131,135,137,138,139,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,182,183,184,185,186,187,188,189,193,194,203,205,209,211,212,213,214,215,236,245,246,247,249,257,258,259,260,263,284,287,288,289,291,292,293,296,297,298,299,307,308,311,312,313,314,315,316,317,318,320,321,326,330,332,333,336,337,338,344,345,346,347,348,349,350,351,353,359,360,398,399,401,402,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,423,424,425,426,427,428,429,430,431,432,434,435,438,439,440,441,442,444,445,446,447,448,449,453,454,455,458,459,467,468,470,471,472,479,487,488,491,495,496,499,500,502,503,507,508,509,510,512,515,529,530,532,533,534,535,540,541,542,543,544,545,550,552,554,556,559,560,565,566,567,568,570,571,574,576,],[-52,-125,-99,-29,-104,-337,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-95,-96,-97,-98,-101,-131,-54,-37,178,-337,-53,-100,-126,-180,-27,-28,-182,-166,-167,-146,-147,-55,249,-337,262,-303,-252,-253,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-30,307,308,-184,-17,-18,-186,-191,-337,-181,-183,-149,-336,-142,-144,345,-337,349,350,-14,-235,-239,-274,-38,398,399,400,401,-326,424,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-35,-36,-188,-189,-190,-204,-56,-1,-2,-337,-45,-206,-168,-151,-153,-148,-140,-141,-145,-143,-127,-203,-337,-204,-174,-175,-218,-13,468,469,-43,-44,-305,493,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,496,-292,-310,-293,-294,-295,-296,498,499,500,-31,-34,-185,-187,-192,-57,-205,-337,509,510,-204,-23,-24,-337,-169,-170,-150,-152,519,-237,-236,520,521,-240,-39,-42,-275,-290,-291,-281,-282,-32,-33,540,541,-207,-213,-211,545,-40,-41,-254,-311,556,-307,-50,-51,-209,-208,-210,-212,564,-337,-299,-306,-46,-49,-337,575,-300,-308,-47,-48,577,-309,]),'COLON':([18,23,27,30,31,32,34,37,38,39,40,41,42,43,44,45,46,47,48,50,51,52,80,86,87,88,95,104,116,117,120,121,128,130,138,139,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,203,205,206,209,211,230,232,245,246,247,249,263,287,288,289,291,292,293,296,297,298,299,307,308,326,330,332,333,336,337,338,342,344,345,349,350,355,398,399,401,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,434,435,454,455,458,459,461,468,470,479,487,488,491,495,496,499,500,502,503,529,530,532,554,556,567,],[-52,-125,-29,-122,-123,-124,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-128,-129,-130,-131,-179,-54,-37,-53,-126,-166,-167,-146,-147,-178,-55,-303,-252,-253,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-30,-149,-336,343,-142,-144,354,356,-235,-239,-274,-38,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-35,-36,-168,-151,-153,-148,-140,-141,-145,462,-143,-127,-174,-175,465,-43,-44,-305,494,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-292,-293,-294,-295,-296,-31,-34,-169,-170,-150,-152,343,-237,-236,-240,-39,-42,-275,-290,-291,-281,-282,-32,-33,-40,-41,-254,-299,-306,-300,]),'LBRACKET':([18,23,24,27,28,29,30,31,32,33,34,37,38,39,40,41,42,43,44,45,46,47,48,50,51,52,53,54,55,56,57,58,59,73,74,75,76,77,80,87,88,95,102,104,111,112,113,114,116,117,119,120,121,130,138,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,189,193,194,203,205,209,211,213,230,249,253,263,287,288,296,297,298,299,307,308,314,315,318,320,321,326,330,332,333,336,337,338,344,345,347,348,349,350,390,391,398,399,401,424,426,427,428,429,434,435,441,442,447,454,455,458,459,481,484,486,487,488,492,495,496,502,503,509,510,512,528,529,530,534,535,540,541,542,543,544,545,554,555,556,559,560,567,568,570,571,576,],[93,-125,-99,-29,-104,-337,-122,-123,-124,-126,-238,-110,-111,-112,-113,-114,-115,-116,-117,-118,-119,-120,-121,-128,-129,-130,-102,-103,-105,-106,-107,-108,-109,-95,-96,-97,-98,-101,-131,134,-37,93,-100,-126,-180,-27,-28,-182,-166,-167,-335,-146,-147,134,-303,283,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-30,319,-181,-183,-149,-336,-142,-144,319,-312,-38,392,-326,-297,-298,-331,-332,-333,-334,-35,-36,319,443,319,-45,452,-168,-151,-153,-148,-140,-141,-145,-143,-127,319,319,-174,-175,392,-199,-43,-44,-305,-292,-293,-294,-295,-296,-31,-34,443,452,319,-169,-170,-150,-152,392,-200,-202,-39,-42,392,-290,-291,-32,-33,-207,-213,-211,-201,-40,-41,558,-307,-50,-51,-209,-208,-210,-212,-299,392,-306,-46,-49,-300,-308,-47,-48,-309,]),'RBRACKET':([50,51,52,80,93,112,113,114,134,138,139,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,181,194,205,245,246,247,254,256,263,287,288,289,291,292,293,296,297,298,299,301,302,303,304,319,394,395,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,424,426,427,428,429,436,437,443,450,451,452,468,470,479,485,489,490,491,495,496,499,500,504,506,511,513,514,532,536,537,554,556,561,562,567,569,],[-128,-129,-130,-131,-337,-27,-28,-182,-337,-303,-252,-253,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-337,-28,-183,-336,-235,-239,-274,-337,-28,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,434,435,-3,-4,-337,487,488,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,495,-292,-293,-294,-295,-296,502,503,-337,-337,512,-337,-237,-236,-240,528,529,530,-275,-290,-291,-281,-282,-337,-28,542,543,544,-254,559,560,-299,-306,570,571,-300,576,]),'PERIOD':([119,138,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,253,263,287,288,296,297,298,299,390,391,401,424,426,427,428,429,481,484,486,492,495,496,528,534,535,554,555,556,567,568,576,],[-335,-303,285,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,393,-326,-297,-298,-331,-332,-333,-334,393,-199,-305,-292,-293,-294,-295,-296,393,-200,-202,393,-290,-291,-201,557,-307,-299,393,-306,-300,-308,-309,]),'ARROW':([138,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,263,287,288,296,297,298,299,401,424,426,427,428,429,495,496,554,556,567,],[-303,286,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-326,-297,-298,-331,-332,-333,-334,-305,-292,-293,-294,-295,-296,-290,-291,-299,-306,-300,]),'CONDOP':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,264,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'DIVIDE':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,266,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,266,266,266,266,266,266,266,266,266,266,266,266,266,266,266,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'MOD':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,267,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,267,267,267,267,267,267,267,267,267,267,267,267,267,267,267,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'RSHIFT':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,270,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,270,270,270,270,270,270,270,270,270,270,270,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'LSHIFT':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,271,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,271,271,271,271,271,271,271,271,271,271,271,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'LT':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,272,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,272,272,272,272,272,272,272,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'LE':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,273,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,273,273,273,273,273,273,273,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'GE':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,274,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,274,274,274,274,274,274,274,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'GT':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,275,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,275,275,275,275,275,275,275,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'EQ':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,276,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,276,276,276,276,276,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'NE':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,277,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,277,277,277,277,277,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'OR':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,279,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,279,279,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'XOR':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,280,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,280,-271,280,280,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'LAND':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,281,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,281,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'LOR':([138,140,141,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,282,-255,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,-274,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-256,-257,-258,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'XOREQUAL':([138,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,375,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'TIMESEQUAL':([138,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,376,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'DIVEQUAL':([138,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,377,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'MODEQUAL':([138,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,378,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'PLUSEQUAL':([138,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,379,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'MINUSEQUAL':([138,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,380,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'LSHIFTEQUAL':([138,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,381,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'RSHIFTEQUAL':([138,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,382,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'ANDEQUAL':([138,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,383,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'OREQUAL':([138,146,147,153,154,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,205,230,247,263,287,288,289,291,292,293,296,297,298,299,401,424,426,427,428,429,491,495,496,499,500,554,556,567,],[-303,-274,-276,-289,-312,-301,-302,-304,-313,-314,-315,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-327,-328,-329,-330,-336,-312,384,-326,-297,-298,-277,-278,-279,-280,-331,-332,-333,-334,-305,-292,-293,-294,-295,-296,-275,-290,-291,-281,-282,-299,-306,-300,]),'ELLIPSIS':([309,],[438,]),}
_lr_action = {}
for _k, _v in _lr_action_items.items():
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_action: _lr_action[_x] = {}
_lr_action[_x][_k] = _y
del _lr_action_items
_lr_goto_items = {'translation_unit_or_empty':([0,],[1,]),'translation_unit':([0,],[2,]),'empty':([0,11,12,20,21,22,25,26,29,33,68,69,70,72,93,94,99,126,134,135,179,180,189,206,213,218,239,253,254,255,318,319,347,354,356,365,367,443,444,450,452,453,465,476,481,492,504,505,519,520,521,523,552,555,563,565,575,577,],[3,65,82,97,97,97,105,97,112,97,82,105,97,65,112,185,97,217,112,185,303,112,316,339,316,353,353,387,303,112,448,112,448,353,353,353,353,112,185,303,303,448,353,353,527,527,303,112,353,353,353,353,353,527,353,353,353,353,]),'external_declaration':([0,2,],[4,63,]),'function_definition':([0,2,],[5,5,]),'declaration':([0,2,11,66,72,126,218,367,],[6,6,67,127,67,220,220,476,]),'pp_directive':([0,2,],[7,7,]),'pppragma_directive':([0,2,122,126,200,201,202,218,239,329,331,354,356,365,465,519,520,521,563,575,577,],[8,8,208,228,208,208,208,228,365,208,208,365,365,228,365,365,365,365,365,365,365,]),'static_assert':([0,2,126,218,239,354,356,365,465,519,520,521,563,575,577,],[10,10,229,229,229,229,229,229,229,229,229,229,229,229,229,]),'id_declarator':([0,2,12,17,25,68,69,81,132,189,191,206,318,461,],[11,11,72,92,109,128,109,92,128,311,128,128,92,128,]),'declaration_specifiers':([0,2,11,66,72,94,126,135,218,309,318,347,367,444,453,],[12,12,68,68,68,189,68,189,68,189,189,189,68,189,189,]),'decl_body':([0,2,11,66,72,126,218,367,],[13,13,13,13,13,13,13,13,]),'direct_id_declarator':([0,2,12,17,19,25,68,69,79,81,132,189,191,206,314,318,447,461,],[18,18,18,18,95,18,18,18,95,18,18,18,18,18,95,18,95,18,]),'pointer':([0,2,12,17,25,68,69,81,111,132,189,191,206,213,318,347,461,],[19,19,79,19,19,79,19,79,193,79,314,79,79,348,447,348,79,]),'type_qualifier':([0,2,11,12,20,21,22,26,29,33,66,68,70,72,93,94,99,113,122,123,124,126,134,135,136,180,181,189,200,201,202,206,210,213,218,235,255,256,290,294,295,300,309,318,319,329,331,347,367,443,444,453,505,506,],[20,20,20,73,20,20,20,20,114,20,20,73,20,20,114,20,20,194,114,114,114,20,114,20,114,114,194,73,114,114,114,337,194,337,20,114,114,194,114,114,114,114,20,20,114,114,114,20,20,114,20,20,114,194,]),'storage_class_specifier':([0,2,11,12,20,21,22,26,33,66,68,70,72,94,99,126,135,189,218,309,318,347,367,444,453,],[21,21,21,74,21,21,21,21,21,21,74,21,21,21,21,21,21,74,21,21,21,21,21,21,21,]),'function_specifier':([0,2,11,12,20,21,22,26,33,66,68,70,72,94,99,126,135,189,218,309,318,347,367,444,453,],[22,22,22,75,22,22,22,22,22,22,75,22,22,22,22,22,22,75,22,22,22,22,22,22,22,]),'type_specifier_no_typeid':([0,2,11,12,25,66,68,69,72,94,122,123,124,126,135,136,189,190,200,201,202,206,210,213,218,235,290,294,295,300,309,318,329,331,347,367,444,453,],[23,23,23,76,23,23,76,23,23,23,23,23,23,23,23,23,76,23,23,23,23,336,23,336,23,23,23,23,23,23,23,23,23,23,23,23,23,23,]),'type_specifier':([0,2,11,25,66,69,72,94,122,123,124,126,135,136,190,200,201,202,210,218,235,290,294,295,300,309,318,329,331,347,367,444,453,],[24,24,24,102,24,102,24,24,209,209,209,24,24,209,102,209,209,209,344,24,209,209,209,209,209,24,24,209,209,24,24,24,24,]),'declaration_specifiers_no_type':([0,2,11,20,21,22,26,33,66,70,72,94,99,126,135,218,309,318,347,367,444,453,],[25,25,69,98,98,98,98,98,69,98,69,190,98,69,190,69,190,190,190,69,190,190,]),'alignment_specifier':([0,2,11,12,20,21,22,26,33,66,68,70,72,94,99,122,123,124,126,135,136,189,200,201,202,206,213,218,235,290,294,295,300,309,318,329,331,347,367,444,453,],[26,26,26,77,26,26,26,26,26,26,77,26,26,26,26,211,211,211,26,26,211,77,211,211,211,338,338,26,211,211,211,211,211,26,26,211,211,26,26,26,26,]),'typedef_name':([0,2,11,25,66,69,72,94,122,123,124,126,135,136,190,200,201,202,210,218,235,290,294,295,300,309,318,329,331,347,367,444,453,],[30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,]),'enum_specifier':([0,2,11,25,66,69,72,94,122,123,124,126,135,136,190,200,201,202,210,218,235,290,294,295,300,309,318,329,331,347,367,444,453,],[31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,]),'struct_or_union_specifier':([0,2,11,25,66,69,72,94,122,123,124,126,135,136,190,200,201,202,210,218,235,290,294,295,300,309,318,329,331,347,367,444,453,],[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,]),'atomic_specifier':([0,2,11,20,21,22,25,26,33,66,69,70,72,94,99,122,123,124,126,135,136,190,200,201,202,210,218,235,290,294,295,300,309,318,329,331,347,367,444,453,],[33,33,70,99,99,99,104,99,99,70,104,99,70,33,99,104,104,104,70,33,104,104,104,104,104,104,70,104,104,104,104,104,33,33,104,104,33,70,33,33,]),'struct_or_union':([0,2,11,25,66,69,72,94,122,123,124,126,135,136,190,200,201,202,210,218,235,290,294,295,300,309,318,329,331,347,367,444,453,],[36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,]),'declaration_list_opt':([11,72,],[64,129,]),'declaration_list':([11,72,],[66,66,]),'init_declarator_list_opt':([12,68,],[78,78,]),'init_declarator_list':([12,68,],[83,83,]),'init_declarator':([12,68,132,191,],[84,84,250,322,]),'declarator':([12,68,132,191,206,461,],[85,85,85,85,342,342,]),'typeid_declarator':([12,68,81,132,191,206,461,],[86,86,131,86,86,86,86,]),'direct_typeid_declarator':([12,68,79,81,132,191,206,461,],[87,87,130,87,87,87,87,87,]),'declaration_specifiers_no_type_opt':([20,21,22,26,33,70,99,],[96,100,101,110,115,115,115,]),'id_init_declarator_list_opt':([25,69,],[103,103,]),'id_init_declarator_list':([25,69,],[106,106,]),'id_init_declarator':([25,69,],[108,108,]),'type_qualifier_list_opt':([29,93,134,180,255,319,443,505,],[111,179,254,305,396,450,504,538,]),'type_qualifier_list':([29,93,122,123,124,134,136,180,200,201,202,235,255,290,294,295,300,319,329,331,443,505,],[113,181,210,210,210,256,210,113,210,210,210,210,113,210,210,210,210,113,210,210,506,113,]),'brace_open':([35,36,64,116,117,120,121,126,129,133,192,218,235,239,354,356,365,388,400,465,469,498,499,519,520,521,526,563,575,577,],[118,122,126,195,196,200,201,126,126,253,253,126,126,126,126,126,126,253,492,126,492,492,492,126,126,126,253,126,126,126,]),'compound_statement':([64,126,129,218,235,239,354,356,365,465,519,520,521,563,575,577,],[125,224,248,224,359,224,224,224,224,224,224,224,224,224,224,224,]),'constant_expression':([91,124,231,328,343,392,462,],[137,215,355,457,463,485,517,]),'unified_string_literal':([91,124,126,133,136,148,149,150,151,179,192,218,231,235,239,244,254,261,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,305,306,328,343,354,356,358,361,362,363,365,367,373,388,392,396,397,400,450,452,462,465,469,476,494,497,504,519,520,521,522,523,526,538,539,552,558,563,565,575,577,],[138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,402,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,]),'conditional_expression':([91,124,126,133,136,179,192,218,231,235,239,244,254,264,283,284,290,294,305,306,328,343,354,356,358,361,362,363,365,367,373,388,392,396,397,450,452,462,465,476,494,497,504,519,520,521,522,523,526,538,539,552,558,563,565,575,577,],[139,139,246,246,246,246,246,246,139,246,246,246,246,246,246,246,246,246,246,246,139,139,246,246,246,246,246,246,246,246,246,246,139,246,246,246,246,139,246,246,532,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,]),'binary_expression':([91,124,126,133,136,179,192,218,231,235,239,244,254,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,305,306,328,343,354,356,358,361,362,363,365,367,373,388,392,396,397,450,452,462,465,476,494,497,504,519,520,521,522,523,526,538,539,552,558,563,565,575,577,],[140,140,140,140,140,140,140,140,140,140,140,140,140,140,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,]),'cast_expression':([91,124,126,133,136,150,179,192,218,231,235,239,244,254,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,305,306,328,343,354,356,358,361,362,363,365,367,373,388,392,396,397,400,450,452,462,465,469,476,494,497,504,519,520,521,522,523,526,538,539,552,558,563,565,575,577,],[141,141,141,141,141,292,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,491,141,141,141,141,491,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,]),'unary_expression':([91,124,126,133,136,148,149,150,151,179,192,218,231,235,239,244,254,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,305,306,328,343,354,356,358,361,362,363,365,367,373,388,392,396,397,400,450,452,462,465,469,476,494,497,504,519,520,521,522,523,526,538,539,552,558,563,565,575,577,],[146,146,247,247,247,289,291,146,293,247,247,247,146,247,247,247,247,247,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,247,247,247,247,247,247,146,146,247,247,247,247,247,247,247,247,247,247,146,247,247,146,247,247,146,247,146,247,146,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,]),'postfix_expression':([91,124,126,133,136,148,149,150,151,179,192,218,231,235,239,244,254,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,305,306,328,343,354,356,358,361,362,363,365,367,373,388,392,396,397,400,450,452,462,465,469,476,494,497,504,519,520,521,522,523,526,538,539,552,558,563,565,575,577,],[147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,]),'unary_operator':([91,124,126,133,136,148,149,150,151,179,192,218,231,235,239,244,254,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,305,306,328,343,354,356,358,361,362,363,365,367,373,388,392,396,397,400,450,452,462,465,469,476,494,497,504,519,520,521,522,523,526,538,539,552,558,563,565,575,577,],[150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,]),'primary_expression':([91,124,126,133,136,148,149,150,151,179,192,218,231,235,239,244,254,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,305,306,328,343,354,356,358,361,362,363,365,367,373,388,392,396,397,400,450,452,462,465,469,476,494,497,504,519,520,521,522,523,526,538,539,552,558,563,565,575,577,],[153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,]),'identifier':([91,94,124,126,133,135,136,148,149,150,151,179,192,218,231,235,239,244,254,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,305,306,310,328,343,354,356,358,361,362,363,365,367,373,388,392,393,396,397,400,444,450,452,462,465,469,476,494,497,501,504,519,520,521,522,523,526,538,539,552,557,558,563,565,575,577,],[157,188,157,157,157,188,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,440,157,157,157,157,157,157,157,157,157,157,157,157,157,486,157,157,157,188,157,157,157,157,157,157,157,157,535,157,157,157,157,157,157,157,157,157,157,568,157,157,157,157,157,]),'constant':([91,124,126,133,136,148,149,150,151,179,192,218,231,235,239,244,254,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,305,306,328,343,354,356,358,361,362,363,365,367,373,388,392,396,397,400,450,452,462,465,469,476,494,497,504,519,520,521,522,523,526,538,539,552,558,563,565,575,577,],[158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,]),'unified_wstring_literal':([91,124,126,133,136,148,149,150,151,179,192,218,231,235,239,244,254,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,290,294,305,306,328,343,354,356,358,361,362,363,365,367,373,388,392,396,397,400,450,452,462,465,469,476,494,497,504,519,520,521,522,523,526,538,539,552,558,563,565,575,577,],[159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,]),'parameter_type_list':([94,135,318,347,444,453,],[182,257,449,449,507,449,]),'identifier_list_opt':([94,135,444,],[183,258,508,]),'parameter_list':([94,135,318,347,444,453,],[184,184,184,184,184,184,]),'identifier_list':([94,135,444,],[186,186,186,]),'parameter_declaration':([94,135,309,318,347,444,453,],[187,187,439,187,187,187,187,]),'enumerator_list':([118,195,196,],[197,324,325,]),'enumerator':([118,195,196,327,],[198,198,198,456,]),'struct_declaration_list':([122,200,201,],[202,329,331,]),'brace_close':([122,197,200,201,202,216,324,325,329,331,385,481,531,555,],[203,326,330,332,333,351,454,455,458,459,480,525,554,567,]),'struct_declaration':([122,200,201,202,329,331,],[204,204,204,334,334,334,]),'specifier_qualifier_list':([122,123,124,136,200,201,202,235,290,294,295,300,329,331,],[206,213,213,213,206,206,206,213,213,213,213,213,206,206,]),'type_name':([123,124,136,235,290,294,295,300,],[212,214,259,360,430,431,432,433,]),'block_item_list_opt':([126,],[216,]),'block_item_list':([126,],[218,]),'block_item':([126,218,],[219,352,]),'statement':([126,218,239,354,356,365,465,519,520,521,563,575,577,],[221,221,366,366,366,474,366,547,366,366,366,366,366,]),'labeled_statement':([126,218,239,354,356,365,465,519,520,521,563,575,577,],[222,222,222,222,222,222,222,222,222,222,222,222,222,]),'expression_statement':([126,218,239,354,356,365,465,519,520,521,563,575,577,],[223,223,223,223,223,223,223,223,223,223,223,223,223,]),'selection_statement':([126,218,239,354,356,365,465,519,520,521,563,575,577,],[225,225,225,225,225,225,225,225,225,225,225,225,225,]),'iteration_statement':([126,218,239,354,356,365,465,519,520,521,563,575,577,],[226,226,226,226,226,226,226,226,226,226,226,226,226,]),'jump_statement':([126,218,239,354,356,365,465,519,520,521,563,575,577,],[227,227,227,227,227,227,227,227,227,227,227,227,227,]),'expression_opt':([126,218,239,354,356,365,367,465,476,519,520,521,523,552,563,565,575,577,],[233,233,233,233,233,233,475,233,524,233,233,233,551,566,233,574,233,233,]),'expression':([126,136,218,235,239,244,264,283,290,294,354,356,358,362,363,365,367,465,476,519,520,521,522,523,552,558,563,565,575,577,],[236,260,236,260,236,371,403,422,260,260,236,236,467,471,472,236,236,236,236,236,236,236,550,236,236,569,236,236,236,236,]),'assignment_expression':([126,133,136,179,192,218,235,239,244,254,264,283,284,290,294,305,306,354,356,358,361,362,363,365,367,373,388,396,397,450,452,465,476,497,504,519,520,521,522,523,526,538,539,552,558,563,565,575,577,],[245,252,245,304,252,245,245,245,245,304,245,245,425,245,245,436,437,245,245,245,470,245,245,245,245,479,252,489,490,304,304,245,245,533,304,245,245,245,245,245,252,561,562,245,245,245,245,245,245,]),'initializer':([133,192,388,526,],[251,323,482,553,]),'assignment_expression_opt':([179,254,450,452,504,],[301,394,511,513,536,]),'typeid_noparen_declarator':([189,],[312,]),'abstract_declarator_opt':([189,213,],[313,346,]),'direct_typeid_noparen_declarator':([189,314,],[315,441,]),'abstract_declarator':([189,213,318,347,],[317,317,445,445,]),'direct_abstract_declarator':([189,213,314,318,347,348,447,],[321,321,442,321,321,442,442,]),'struct_declarator_list_opt':([206,],[335,]),'struct_declarator_list':([206,],[340,]),'struct_declarator':([206,461,],[341,516,]),'pragmacomp_or_statement':([239,354,356,465,519,520,521,563,575,577,],[364,464,466,518,546,548,549,572,578,579,]),'assignment_operator':([247,],[373,]),'initializer_list_opt':([253,],[385,]),'initializer_list':([253,492,],[386,531,]),'designation_opt':([253,481,492,555,],[388,526,388,526,]),'designation':([253,481,492,555,],[389,389,389,389,]),'designator_list':([253,481,492,555,],[390,390,390,390,]),'designator':([253,390,481,492,555,],[391,484,391,391,391,]),'argument_expression_list':([284,],[423,]),'parameter_type_list_opt':([318,347,453,],[446,446,515,]),'offsetof_member_designator':([501,],[534,]),}
_lr_goto = {}
for _k, _v in _lr_goto_items.items():
for _x, _y in zip(_v[0], _v[1]):
if not _x in _lr_goto: _lr_goto[_x] = {}
_lr_goto[_x][_k] = _y
del _lr_goto_items
_lr_productions = [
("S' -> translation_unit_or_empty","S'",1,None,None,None),
('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',43),
('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',44),
('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',43),
('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',44),
('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',43),
('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',44),
('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',43),
('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',44),
('declaration_specifiers_no_type_opt -> empty','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',43),
('declaration_specifiers_no_type_opt -> declaration_specifiers_no_type','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',44),
('designation_opt -> empty','designation_opt',1,'p_designation_opt','plyparser.py',43),
('designation_opt -> designation','designation_opt',1,'p_designation_opt','plyparser.py',44),
('expression_opt -> empty','expression_opt',1,'p_expression_opt','plyparser.py',43),
('expression_opt -> expression','expression_opt',1,'p_expression_opt','plyparser.py',44),
('id_init_declarator_list_opt -> empty','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',43),
('id_init_declarator_list_opt -> id_init_declarator_list','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',44),
('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',43),
('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',44),
('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',43),
('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',44),
('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',43),
('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',44),
('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',43),
('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',44),
('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',43),
('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',44),
('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',43),
('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',44),
('direct_id_declarator -> ID','direct_id_declarator',1,'p_direct_id_declarator_1','plyparser.py',126),
('direct_id_declarator -> LPAREN id_declarator RPAREN','direct_id_declarator',3,'p_direct_id_declarator_2','plyparser.py',126),
('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_3','plyparser.py',126),
('direct_id_declarator -> direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',126),
('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',127),
('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_5','plyparser.py',126),
('direct_id_declarator -> direct_id_declarator LPAREN parameter_type_list RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',126),
('direct_id_declarator -> direct_id_declarator LPAREN identifier_list_opt RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',127),
('direct_typeid_declarator -> TYPEID','direct_typeid_declarator',1,'p_direct_typeid_declarator_1','plyparser.py',126),
('direct_typeid_declarator -> LPAREN typeid_declarator RPAREN','direct_typeid_declarator',3,'p_direct_typeid_declarator_2','plyparser.py',126),
('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_3','plyparser.py',126),
('direct_typeid_declarator -> direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',126),
('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',127),
('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_5','plyparser.py',126),
('direct_typeid_declarator -> direct_typeid_declarator LPAREN parameter_type_list RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',126),
('direct_typeid_declarator -> direct_typeid_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',127),
('direct_typeid_noparen_declarator -> TYPEID','direct_typeid_noparen_declarator',1,'p_direct_typeid_noparen_declarator_1','plyparser.py',126),
('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_3','plyparser.py',126),
('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',126),
('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',127),
('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_5','plyparser.py',126),
('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',126),
('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',127),
('id_declarator -> direct_id_declarator','id_declarator',1,'p_id_declarator_1','plyparser.py',126),
('id_declarator -> pointer direct_id_declarator','id_declarator',2,'p_id_declarator_2','plyparser.py',126),
('typeid_declarator -> direct_typeid_declarator','typeid_declarator',1,'p_typeid_declarator_1','plyparser.py',126),
('typeid_declarator -> pointer direct_typeid_declarator','typeid_declarator',2,'p_typeid_declarator_2','plyparser.py',126),
('typeid_noparen_declarator -> direct_typeid_noparen_declarator','typeid_noparen_declarator',1,'p_typeid_noparen_declarator_1','plyparser.py',126),
('typeid_noparen_declarator -> pointer direct_typeid_noparen_declarator','typeid_noparen_declarator',2,'p_typeid_noparen_declarator_2','plyparser.py',126),
('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',509),
('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',510),
('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','c_parser.py',518),
('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','c_parser.py',524),
('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','c_parser.py',534),
('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','c_parser.py',539),
('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',544),
('external_declaration -> pppragma_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',545),
('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','c_parser.py',550),
('external_declaration -> static_assert','external_declaration',1,'p_external_declaration_5','c_parser.py',555),
('static_assert -> _STATIC_ASSERT LPAREN constant_expression COMMA unified_string_literal RPAREN','static_assert',6,'p_static_assert_declaration','c_parser.py',560),
('static_assert -> _STATIC_ASSERT LPAREN constant_expression RPAREN','static_assert',4,'p_static_assert_declaration','c_parser.py',561),
('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','c_parser.py',569),
('pppragma_directive -> PPPRAGMA','pppragma_directive',1,'p_pppragma_directive','c_parser.py',575),
('pppragma_directive -> PPPRAGMA PPPRAGMASTR','pppragma_directive',2,'p_pppragma_directive','c_parser.py',576),
('function_definition -> id_declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','c_parser.py',586),
('function_definition -> declaration_specifiers id_declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','c_parser.py',604),
('statement -> labeled_statement','statement',1,'p_statement','c_parser.py',619),
('statement -> expression_statement','statement',1,'p_statement','c_parser.py',620),
('statement -> compound_statement','statement',1,'p_statement','c_parser.py',621),
('statement -> selection_statement','statement',1,'p_statement','c_parser.py',622),
('statement -> iteration_statement','statement',1,'p_statement','c_parser.py',623),
('statement -> jump_statement','statement',1,'p_statement','c_parser.py',624),
('statement -> pppragma_directive','statement',1,'p_statement','c_parser.py',625),
('statement -> static_assert','statement',1,'p_statement','c_parser.py',626),
('pragmacomp_or_statement -> pppragma_directive statement','pragmacomp_or_statement',2,'p_pragmacomp_or_statement','c_parser.py',674),
('pragmacomp_or_statement -> statement','pragmacomp_or_statement',1,'p_pragmacomp_or_statement','c_parser.py',675),
('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',694),
('decl_body -> declaration_specifiers_no_type id_init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',695),
('declaration -> decl_body SEMI','declaration',2,'p_declaration','c_parser.py',755),
('declaration_list -> declaration','declaration_list',1,'p_declaration_list','c_parser.py',764),
('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','c_parser.py',765),
('declaration_specifiers_no_type -> type_qualifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_1','c_parser.py',775),
('declaration_specifiers_no_type -> storage_class_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_2','c_parser.py',780),
('declaration_specifiers_no_type -> function_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_3','c_parser.py',785),
('declaration_specifiers_no_type -> atomic_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_4','c_parser.py',792),
('declaration_specifiers_no_type -> alignment_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_5','c_parser.py',797),
('declaration_specifiers -> declaration_specifiers type_qualifier','declaration_specifiers',2,'p_declaration_specifiers_1','c_parser.py',802),
('declaration_specifiers -> declaration_specifiers storage_class_specifier','declaration_specifiers',2,'p_declaration_specifiers_2','c_parser.py',807),
('declaration_specifiers -> declaration_specifiers function_specifier','declaration_specifiers',2,'p_declaration_specifiers_3','c_parser.py',812),
('declaration_specifiers -> declaration_specifiers type_specifier_no_typeid','declaration_specifiers',2,'p_declaration_specifiers_4','c_parser.py',817),
('declaration_specifiers -> type_specifier','declaration_specifiers',1,'p_declaration_specifiers_5','c_parser.py',822),
('declaration_specifiers -> declaration_specifiers_no_type type_specifier','declaration_specifiers',2,'p_declaration_specifiers_6','c_parser.py',827),
('declaration_specifiers -> declaration_specifiers alignment_specifier','declaration_specifiers',2,'p_declaration_specifiers_7','c_parser.py',832),
('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',837),
('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',838),
('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',839),
('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',840),
('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',841),
('storage_class_specifier -> _THREAD_LOCAL','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',842),
('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','c_parser.py',847),
('function_specifier -> _NORETURN','function_specifier',1,'p_function_specifier','c_parser.py',848),
('type_specifier_no_typeid -> VOID','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',853),
('type_specifier_no_typeid -> _BOOL','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',854),
('type_specifier_no_typeid -> CHAR','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',855),
('type_specifier_no_typeid -> SHORT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',856),
('type_specifier_no_typeid -> INT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',857),
('type_specifier_no_typeid -> LONG','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',858),
('type_specifier_no_typeid -> FLOAT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',859),
('type_specifier_no_typeid -> DOUBLE','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',860),
('type_specifier_no_typeid -> _COMPLEX','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',861),
('type_specifier_no_typeid -> SIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',862),
('type_specifier_no_typeid -> UNSIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',863),
('type_specifier_no_typeid -> __INT128','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',864),
('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier','c_parser.py',869),
('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier','c_parser.py',870),
('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier','c_parser.py',871),
('type_specifier -> type_specifier_no_typeid','type_specifier',1,'p_type_specifier','c_parser.py',872),
('type_specifier -> atomic_specifier','type_specifier',1,'p_type_specifier','c_parser.py',873),
('atomic_specifier -> _ATOMIC LPAREN type_name RPAREN','atomic_specifier',4,'p_atomic_specifier','c_parser.py',879),
('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','c_parser.py',886),
('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','c_parser.py',887),
('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','c_parser.py',888),
('type_qualifier -> _ATOMIC','type_qualifier',1,'p_type_qualifier','c_parser.py',889),
('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list','c_parser.py',894),
('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list','c_parser.py',895),
('init_declarator -> declarator','init_declarator',1,'p_init_declarator','c_parser.py',903),
('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','c_parser.py',904),
('id_init_declarator_list -> id_init_declarator','id_init_declarator_list',1,'p_id_init_declarator_list','c_parser.py',909),
('id_init_declarator_list -> id_init_declarator_list COMMA init_declarator','id_init_declarator_list',3,'p_id_init_declarator_list','c_parser.py',910),
('id_init_declarator -> id_declarator','id_init_declarator',1,'p_id_init_declarator','c_parser.py',915),
('id_init_declarator -> id_declarator EQUALS initializer','id_init_declarator',3,'p_id_init_declarator','c_parser.py',916),
('specifier_qualifier_list -> specifier_qualifier_list type_specifier_no_typeid','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','c_parser.py',923),
('specifier_qualifier_list -> specifier_qualifier_list type_qualifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','c_parser.py',928),
('specifier_qualifier_list -> type_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_3','c_parser.py',933),
('specifier_qualifier_list -> type_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_4','c_parser.py',938),
('specifier_qualifier_list -> alignment_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_5','c_parser.py',943),
('specifier_qualifier_list -> specifier_qualifier_list alignment_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_6','c_parser.py',948),
('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',956),
('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',957),
('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','c_parser.py',967),
('struct_or_union_specifier -> struct_or_union brace_open brace_close','struct_or_union_specifier',3,'p_struct_or_union_specifier_2','c_parser.py',968),
('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',985),
('struct_or_union_specifier -> struct_or_union ID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',986),
('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',987),
('struct_or_union_specifier -> struct_or_union TYPEID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',988),
('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','c_parser.py',1004),
('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','c_parser.py',1005),
('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','c_parser.py',1012),
('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','c_parser.py',1013),
('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','c_parser.py',1021),
('struct_declaration -> SEMI','struct_declaration',1,'p_struct_declaration_2','c_parser.py',1059),
('struct_declaration -> pppragma_directive','struct_declaration',1,'p_struct_declaration_3','c_parser.py',1064),
('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','c_parser.py',1069),
('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','c_parser.py',1070),
('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','c_parser.py',1078),
('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','c_parser.py',1083),
('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','c_parser.py',1084),
('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1092),
('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1093),
('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','c_parser.py',1098),
('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1103),
('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1104),
('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','c_parser.py',1109),
('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','c_parser.py',1110),
('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','c_parser.py',1111),
('alignment_specifier -> _ALIGNAS LPAREN type_name RPAREN','alignment_specifier',4,'p_alignment_specifier','c_parser.py',1122),
('alignment_specifier -> _ALIGNAS LPAREN constant_expression RPAREN','alignment_specifier',4,'p_alignment_specifier','c_parser.py',1123),
('enumerator -> ID','enumerator',1,'p_enumerator','c_parser.py',1128),
('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','c_parser.py',1129),
('declarator -> id_declarator','declarator',1,'p_declarator','c_parser.py',1144),
('declarator -> typeid_declarator','declarator',1,'p_declarator','c_parser.py',1145),
('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','c_parser.py',1257),
('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','c_parser.py',1258),
('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','c_parser.py',1287),
('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','c_parser.py',1288),
('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','c_parser.py',1293),
('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','c_parser.py',1294),
('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','c_parser.py',1302),
('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','c_parser.py',1303),
('parameter_declaration -> declaration_specifiers id_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1322),
('parameter_declaration -> declaration_specifiers typeid_noparen_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1323),
('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','c_parser.py',1334),
('identifier_list -> identifier','identifier_list',1,'p_identifier_list','c_parser.py',1366),
('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','c_parser.py',1367),
('initializer -> assignment_expression','initializer',1,'p_initializer_1','c_parser.py',1376),
('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','c_parser.py',1381),
('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','c_parser.py',1382),
('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','c_parser.py',1390),
('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','c_parser.py',1391),
('designation -> designator_list EQUALS','designation',2,'p_designation','c_parser.py',1402),
('designator_list -> designator','designator_list',1,'p_designator_list','c_parser.py',1410),
('designator_list -> designator_list designator','designator_list',2,'p_designator_list','c_parser.py',1411),
('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','c_parser.py',1416),
('designator -> PERIOD identifier','designator',2,'p_designator','c_parser.py',1417),
('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','c_parser.py',1422),
('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','c_parser.py',1434),
('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','c_parser.py',1442),
('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','c_parser.py',1447),
('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','c_parser.py',1457),
('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','c_parser.py',1461),
('direct_abstract_declarator -> LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_3','c_parser.py',1472),
('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','c_parser.py',1482),
('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','c_parser.py',1493),
('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','c_parser.py',1502),
('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','c_parser.py',1512),
('block_item -> declaration','block_item',1,'p_block_item','c_parser.py',1523),
('block_item -> statement','block_item',1,'p_block_item','c_parser.py',1524),
('block_item_list -> block_item','block_item_list',1,'p_block_item_list','c_parser.py',1531),
('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','c_parser.py',1532),
('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','c_parser.py',1538),
('labeled_statement -> ID COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_1','c_parser.py',1544),
('labeled_statement -> CASE constant_expression COLON pragmacomp_or_statement','labeled_statement',4,'p_labeled_statement_2','c_parser.py',1548),
('labeled_statement -> DEFAULT COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_3','c_parser.py',1552),
('selection_statement -> IF LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_1','c_parser.py',1556),
('selection_statement -> IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement','selection_statement',7,'p_selection_statement_2','c_parser.py',1560),
('selection_statement -> SWITCH LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_3','c_parser.py',1564),
('iteration_statement -> WHILE LPAREN expression RPAREN pragmacomp_or_statement','iteration_statement',5,'p_iteration_statement_1','c_parser.py',1569),
('iteration_statement -> DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','c_parser.py',1573),
('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',9,'p_iteration_statement_3','c_parser.py',1577),
('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',8,'p_iteration_statement_4','c_parser.py',1581),
('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','c_parser.py',1586),
('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','c_parser.py',1590),
('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','c_parser.py',1594),
('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','c_parser.py',1598),
('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','c_parser.py',1599),
('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','c_parser.py',1604),
('expression -> assignment_expression','expression',1,'p_expression','c_parser.py',1611),
('expression -> expression COMMA assignment_expression','expression',3,'p_expression','c_parser.py',1612),
('assignment_expression -> LPAREN compound_statement RPAREN','assignment_expression',3,'p_parenthesized_compound_expression','c_parser.py',1624),
('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','c_parser.py',1628),
('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','c_parser.py',1632),
('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','c_parser.py',1633),
('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','c_parser.py',1646),
('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1647),
('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1648),
('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1649),
('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1650),
('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1651),
('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1652),
('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1653),
('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1654),
('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1655),
('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1656),
('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','c_parser.py',1661),
('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','c_parser.py',1665),
('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','c_parser.py',1666),
('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','c_parser.py',1674),
('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1675),
('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1676),
('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1677),
('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1678),
('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1679),
('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1680),
('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1681),
('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1682),
('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1683),
('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1684),
('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1685),
('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1686),
('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1687),
('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1688),
('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1689),
('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1690),
('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1691),
('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1692),
('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','c_parser.py',1700),
('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','c_parser.py',1704),
('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','c_parser.py',1708),
('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1712),
('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1713),
('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1714),
('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','c_parser.py',1719),
('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1720),
('unary_expression -> _ALIGNOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1721),
('unary_operator -> AND','unary_operator',1,'p_unary_operator','c_parser.py',1729),
('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','c_parser.py',1730),
('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','c_parser.py',1731),
('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','c_parser.py',1732),
('unary_operator -> NOT','unary_operator',1,'p_unary_operator','c_parser.py',1733),
('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','c_parser.py',1734),
('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','c_parser.py',1739),
('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','c_parser.py',1743),
('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','c_parser.py',1747),
('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','c_parser.py',1748),
('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1753),
('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1754),
('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1755),
('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1756),
('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1762),
('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1763),
('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','c_parser.py',1768),
('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','c_parser.py',1769),
('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','c_parser.py',1774),
('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','c_parser.py',1778),
('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1782),
('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1783),
('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','c_parser.py',1788),
('primary_expression -> OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN','primary_expression',6,'p_primary_expression_5','c_parser.py',1792),
('offsetof_member_designator -> identifier','offsetof_member_designator',1,'p_offsetof_member_designator','c_parser.py',1800),
('offsetof_member_designator -> offsetof_member_designator PERIOD identifier','offsetof_member_designator',3,'p_offsetof_member_designator','c_parser.py',1801),
('offsetof_member_designator -> offsetof_member_designator LBRACKET expression RBRACKET','offsetof_member_designator',4,'p_offsetof_member_designator','c_parser.py',1802),
('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','c_parser.py',1814),
('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','c_parser.py',1815),
('identifier -> ID','identifier',1,'p_identifier','c_parser.py',1824),
('constant -> INT_CONST_DEC','constant',1,'p_constant_1','c_parser.py',1828),
('constant -> INT_CONST_OCT','constant',1,'p_constant_1','c_parser.py',1829),
('constant -> INT_CONST_HEX','constant',1,'p_constant_1','c_parser.py',1830),
('constant -> INT_CONST_BIN','constant',1,'p_constant_1','c_parser.py',1831),
('constant -> INT_CONST_CHAR','constant',1,'p_constant_1','c_parser.py',1832),
('constant -> FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1851),
('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1852),
('constant -> CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1868),
('constant -> WCHAR_CONST','constant',1,'p_constant_3','c_parser.py',1869),
('constant -> U8CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1870),
('constant -> U16CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1871),
('constant -> U32CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1872),
('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','c_parser.py',1883),
('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','c_parser.py',1884),
('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1894),
('unified_wstring_literal -> U8STRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1895),
('unified_wstring_literal -> U16STRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1896),
('unified_wstring_literal -> U32STRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1897),
('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1898),
('unified_wstring_literal -> unified_wstring_literal U8STRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1899),
('unified_wstring_literal -> unified_wstring_literal U16STRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1900),
('unified_wstring_literal -> unified_wstring_literal U32STRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1901),
('brace_open -> LBRACE','brace_open',1,'p_brace_open','c_parser.py',1911),
('brace_close -> RBRACE','brace_close',1,'p_brace_close','c_parser.py',1917),
('empty -> <empty>','empty',0,'p_empty','c_parser.py',1923),
]
| 561.087193
| 124,055
| 0.694734
| 41,922
| 205,919
| 3.31926
| 0.025285
| 0.014086
| 0.01811
| 0.006727
| 0.783126
| 0.716709
| 0.664628
| 0.628293
| 0.591642
| 0.563737
| 0
| 0.478781
| 0.045197
| 205,919
| 366
| 124,056
| 562.620219
| 0.228959
| 0.000296
| 0
| 0.005602
| 1
| 0.002801
| 0.284575
| 0.097773
| 0
| 0
| 0
| 0
| 0.019608
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
54a6b3ea6d72bd69d6b03fd24a416abf39794666
| 30
|
py
|
Python
|
modules/relay/__init__.py
|
ffroehling/fuse_module_driver_framework
|
e5805fb52fee41de3be1a2369106ddbf79cdbdd8
|
[
"MIT"
] | null | null | null |
modules/relay/__init__.py
|
ffroehling/fuse_module_driver_framework
|
e5805fb52fee41de3be1a2369106ddbf79cdbdd8
|
[
"MIT"
] | null | null | null |
modules/relay/__init__.py
|
ffroehling/fuse_module_driver_framework
|
e5805fb52fee41de3be1a2369106ddbf79cdbdd8
|
[
"MIT"
] | null | null | null |
from . import relay as module
| 15
| 29
| 0.766667
| 5
| 30
| 4.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 30
| 1
| 30
| 30
| 0.958333
| 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
|
54b9146165b15d35ab20c030f7f09ea85818371a
| 33,283
|
py
|
Python
|
cottonformation/res/connect.py
|
MacHu-GWU/cottonformation-project
|
23e28c08cfb5a7cc0db6dbfdb1d7e1585c773f3b
|
[
"BSD-2-Clause"
] | 5
|
2021-07-22T03:45:59.000Z
|
2021-12-17T21:07:14.000Z
|
cottonformation/res/connect.py
|
MacHu-GWU/cottonformation-project
|
23e28c08cfb5a7cc0db6dbfdb1d7e1585c773f3b
|
[
"BSD-2-Clause"
] | 1
|
2021-06-25T18:01:31.000Z
|
2021-06-25T18:01:31.000Z
|
cottonformation/res/connect.py
|
MacHu-GWU/cottonformation-project
|
23e28c08cfb5a7cc0db6dbfdb1d7e1585c773f3b
|
[
"BSD-2-Clause"
] | 2
|
2021-06-27T03:08:21.000Z
|
2021-06-28T22:15:51.000Z
|
# -*- coding: utf-8 -*-
"""
This module
"""
import attr
import typing
from ..core.model import (
Property, Resource, Tag, GetAtt, TypeHint, TypeCheck,
)
from ..core.constant import AttrMeta
#--- Property declaration ---
@attr.s
class PropUserUserIdentityInfo(Property):
"""
AWS Object Type = "AWS::Connect::User.UserIdentityInfo"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-useridentityinfo.html
Property Document:
- ``p_Email``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-useridentityinfo.html#cfn-connect-user-useridentityinfo-email
- ``p_FirstName``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-useridentityinfo.html#cfn-connect-user-useridentityinfo-firstname
- ``p_LastName``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-useridentityinfo.html#cfn-connect-user-useridentityinfo-lastname
"""
AWS_OBJECT_TYPE = "AWS::Connect::User.UserIdentityInfo"
p_Email: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "Email"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-useridentityinfo.html#cfn-connect-user-useridentityinfo-email"""
p_FirstName: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "FirstName"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-useridentityinfo.html#cfn-connect-user-useridentityinfo-firstname"""
p_LastName: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "LastName"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-useridentityinfo.html#cfn-connect-user-useridentityinfo-lastname"""
@attr.s
class PropQuickConnectQueueQuickConnectConfig(Property):
"""
AWS Object Type = "AWS::Connect::QuickConnect.QueueQuickConnectConfig"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-queuequickconnectconfig.html
Property Document:
- ``rp_ContactFlowArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-queuequickconnectconfig.html#cfn-connect-quickconnect-queuequickconnectconfig-contactflowarn
- ``rp_QueueArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-queuequickconnectconfig.html#cfn-connect-quickconnect-queuequickconnectconfig-queuearn
"""
AWS_OBJECT_TYPE = "AWS::Connect::QuickConnect.QueueQuickConnectConfig"
rp_ContactFlowArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "ContactFlowArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-queuequickconnectconfig.html#cfn-connect-quickconnect-queuequickconnectconfig-contactflowarn"""
rp_QueueArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "QueueArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-queuequickconnectconfig.html#cfn-connect-quickconnect-queuequickconnectconfig-queuearn"""
@attr.s
class PropQuickConnectUserQuickConnectConfig(Property):
"""
AWS Object Type = "AWS::Connect::QuickConnect.UserQuickConnectConfig"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-userquickconnectconfig.html
Property Document:
- ``rp_ContactFlowArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-userquickconnectconfig.html#cfn-connect-quickconnect-userquickconnectconfig-contactflowarn
- ``rp_UserArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-userquickconnectconfig.html#cfn-connect-quickconnect-userquickconnectconfig-userarn
"""
AWS_OBJECT_TYPE = "AWS::Connect::QuickConnect.UserQuickConnectConfig"
rp_ContactFlowArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "ContactFlowArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-userquickconnectconfig.html#cfn-connect-quickconnect-userquickconnectconfig-contactflowarn"""
rp_UserArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "UserArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-userquickconnectconfig.html#cfn-connect-quickconnect-userquickconnectconfig-userarn"""
@attr.s
class PropUserUserPhoneConfig(Property):
"""
AWS Object Type = "AWS::Connect::User.UserPhoneConfig"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-userphoneconfig.html
Property Document:
- ``rp_PhoneType``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-userphoneconfig.html#cfn-connect-user-userphoneconfig-phonetype
- ``p_AfterContactWorkTimeLimit``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-userphoneconfig.html#cfn-connect-user-userphoneconfig-aftercontactworktimelimit
- ``p_AutoAccept``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-userphoneconfig.html#cfn-connect-user-userphoneconfig-autoaccept
- ``p_DeskPhoneNumber``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-userphoneconfig.html#cfn-connect-user-userphoneconfig-deskphonenumber
"""
AWS_OBJECT_TYPE = "AWS::Connect::User.UserPhoneConfig"
rp_PhoneType: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "PhoneType"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-userphoneconfig.html#cfn-connect-user-userphoneconfig-phonetype"""
p_AfterContactWorkTimeLimit: int = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(int)),
metadata={AttrMeta.PROPERTY_NAME: "AfterContactWorkTimeLimit"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-userphoneconfig.html#cfn-connect-user-userphoneconfig-aftercontactworktimelimit"""
p_AutoAccept: bool = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(bool)),
metadata={AttrMeta.PROPERTY_NAME: "AutoAccept"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-userphoneconfig.html#cfn-connect-user-userphoneconfig-autoaccept"""
p_DeskPhoneNumber: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "DeskPhoneNumber"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-user-userphoneconfig.html#cfn-connect-user-userphoneconfig-deskphonenumber"""
@attr.s
class PropQuickConnectPhoneNumberQuickConnectConfig(Property):
"""
AWS Object Type = "AWS::Connect::QuickConnect.PhoneNumberQuickConnectConfig"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-phonenumberquickconnectconfig.html
Property Document:
- ``rp_PhoneNumber``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-phonenumberquickconnectconfig.html#cfn-connect-quickconnect-phonenumberquickconnectconfig-phonenumber
"""
AWS_OBJECT_TYPE = "AWS::Connect::QuickConnect.PhoneNumberQuickConnectConfig"
rp_PhoneNumber: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "PhoneNumber"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-phonenumberquickconnectconfig.html#cfn-connect-quickconnect-phonenumberquickconnectconfig-phonenumber"""
@attr.s
class PropHoursOfOperationHoursOfOperationTimeSlice(Property):
"""
AWS Object Type = "AWS::Connect::HoursOfOperation.HoursOfOperationTimeSlice"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationtimeslice.html
Property Document:
- ``rp_Hours``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationtimeslice.html#cfn-connect-hoursofoperation-hoursofoperationtimeslice-hours
- ``rp_Minutes``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationtimeslice.html#cfn-connect-hoursofoperation-hoursofoperationtimeslice-minutes
"""
AWS_OBJECT_TYPE = "AWS::Connect::HoursOfOperation.HoursOfOperationTimeSlice"
rp_Hours: int = attr.ib(
default=None,
validator=attr.validators.instance_of(int),
metadata={AttrMeta.PROPERTY_NAME: "Hours"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationtimeslice.html#cfn-connect-hoursofoperation-hoursofoperationtimeslice-hours"""
rp_Minutes: int = attr.ib(
default=None,
validator=attr.validators.instance_of(int),
metadata={AttrMeta.PROPERTY_NAME: "Minutes"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationtimeslice.html#cfn-connect-hoursofoperation-hoursofoperationtimeslice-minutes"""
@attr.s
class PropHoursOfOperationHoursOfOperationConfig(Property):
"""
AWS Object Type = "AWS::Connect::HoursOfOperation.HoursOfOperationConfig"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationconfig.html
Property Document:
- ``rp_Day``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationconfig.html#cfn-connect-hoursofoperation-hoursofoperationconfig-day
- ``rp_EndTime``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationconfig.html#cfn-connect-hoursofoperation-hoursofoperationconfig-endtime
- ``rp_StartTime``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationconfig.html#cfn-connect-hoursofoperation-hoursofoperationconfig-starttime
"""
AWS_OBJECT_TYPE = "AWS::Connect::HoursOfOperation.HoursOfOperationConfig"
rp_Day: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "Day"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationconfig.html#cfn-connect-hoursofoperation-hoursofoperationconfig-day"""
rp_EndTime: typing.Union['PropHoursOfOperationHoursOfOperationTimeSlice', dict] = attr.ib(
default=None,
converter=PropHoursOfOperationHoursOfOperationTimeSlice.from_dict,
validator=attr.validators.instance_of(PropHoursOfOperationHoursOfOperationTimeSlice),
metadata={AttrMeta.PROPERTY_NAME: "EndTime"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationconfig.html#cfn-connect-hoursofoperation-hoursofoperationconfig-endtime"""
rp_StartTime: typing.Union['PropHoursOfOperationHoursOfOperationTimeSlice', dict] = attr.ib(
default=None,
converter=PropHoursOfOperationHoursOfOperationTimeSlice.from_dict,
validator=attr.validators.instance_of(PropHoursOfOperationHoursOfOperationTimeSlice),
metadata={AttrMeta.PROPERTY_NAME: "StartTime"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-hoursofoperation-hoursofoperationconfig.html#cfn-connect-hoursofoperation-hoursofoperationconfig-starttime"""
@attr.s
class PropQuickConnectQuickConnectConfig(Property):
"""
AWS Object Type = "AWS::Connect::QuickConnect.QuickConnectConfig"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-quickconnectconfig.html
Property Document:
- ``rp_QuickConnectType``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-quickconnectconfig.html#cfn-connect-quickconnect-quickconnectconfig-quickconnecttype
- ``p_PhoneConfig``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-quickconnectconfig.html#cfn-connect-quickconnect-quickconnectconfig-phoneconfig
- ``p_QueueConfig``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-quickconnectconfig.html#cfn-connect-quickconnect-quickconnectconfig-queueconfig
- ``p_UserConfig``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-quickconnectconfig.html#cfn-connect-quickconnect-quickconnectconfig-userconfig
"""
AWS_OBJECT_TYPE = "AWS::Connect::QuickConnect.QuickConnectConfig"
rp_QuickConnectType: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "QuickConnectType"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-quickconnectconfig.html#cfn-connect-quickconnect-quickconnectconfig-quickconnecttype"""
p_PhoneConfig: typing.Union['PropQuickConnectPhoneNumberQuickConnectConfig', dict] = attr.ib(
default=None,
converter=PropQuickConnectPhoneNumberQuickConnectConfig.from_dict,
validator=attr.validators.optional(attr.validators.instance_of(PropQuickConnectPhoneNumberQuickConnectConfig)),
metadata={AttrMeta.PROPERTY_NAME: "PhoneConfig"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-quickconnectconfig.html#cfn-connect-quickconnect-quickconnectconfig-phoneconfig"""
p_QueueConfig: typing.Union['PropQuickConnectQueueQuickConnectConfig', dict] = attr.ib(
default=None,
converter=PropQuickConnectQueueQuickConnectConfig.from_dict,
validator=attr.validators.optional(attr.validators.instance_of(PropQuickConnectQueueQuickConnectConfig)),
metadata={AttrMeta.PROPERTY_NAME: "QueueConfig"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-quickconnectconfig.html#cfn-connect-quickconnect-quickconnectconfig-queueconfig"""
p_UserConfig: typing.Union['PropQuickConnectUserQuickConnectConfig', dict] = attr.ib(
default=None,
converter=PropQuickConnectUserQuickConnectConfig.from_dict,
validator=attr.validators.optional(attr.validators.instance_of(PropQuickConnectUserQuickConnectConfig)),
metadata={AttrMeta.PROPERTY_NAME: "UserConfig"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-connect-quickconnect-quickconnectconfig.html#cfn-connect-quickconnect-quickconnectconfig-userconfig"""
#--- Resource declaration ---
@attr.s
class QuickConnect(Resource):
"""
AWS Object Type = "AWS::Connect::QuickConnect"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html
Property Document:
- ``rp_InstanceArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html#cfn-connect-quickconnect-instancearn
- ``rp_Name``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html#cfn-connect-quickconnect-name
- ``rp_QuickConnectConfig``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html#cfn-connect-quickconnect-quickconnectconfig
- ``p_Description``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html#cfn-connect-quickconnect-description
- ``p_Tags``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html#cfn-connect-quickconnect-tags
"""
AWS_OBJECT_TYPE = "AWS::Connect::QuickConnect"
rp_InstanceArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "InstanceArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html#cfn-connect-quickconnect-instancearn"""
rp_Name: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "Name"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html#cfn-connect-quickconnect-name"""
rp_QuickConnectConfig: typing.Union['PropQuickConnectQuickConnectConfig', dict] = attr.ib(
default=None,
converter=PropQuickConnectQuickConnectConfig.from_dict,
validator=attr.validators.instance_of(PropQuickConnectQuickConnectConfig),
metadata={AttrMeta.PROPERTY_NAME: "QuickConnectConfig"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html#cfn-connect-quickconnect-quickconnectconfig"""
p_Description: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "Description"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html#cfn-connect-quickconnect-description"""
p_Tags: typing.List[typing.Union[Tag, dict]] = attr.ib(
default=None,
converter=Tag.from_list,
validator=attr.validators.optional(attr.validators.deep_iterable(member_validator=attr.validators.instance_of(Tag), iterable_validator=attr.validators.instance_of(list))),
metadata={AttrMeta.PROPERTY_NAME: "Tags"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html#cfn-connect-quickconnect-tags"""
@property
def rv_QuickConnectArn(self) -> GetAtt:
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-quickconnect.html#aws-resource-connect-quickconnect-return-values"""
return GetAtt(resource=self, attr_name="QuickConnectArn")
@attr.s
class HoursOfOperation(Resource):
"""
AWS Object Type = "AWS::Connect::HoursOfOperation"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html
Property Document:
- ``rp_Config``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-config
- ``rp_InstanceArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-instancearn
- ``rp_Name``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-name
- ``rp_TimeZone``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-timezone
- ``p_Description``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-description
- ``p_Tags``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-tags
"""
AWS_OBJECT_TYPE = "AWS::Connect::HoursOfOperation"
rp_Config: typing.List[typing.Union['PropHoursOfOperationHoursOfOperationConfig', dict]] = attr.ib(
default=None,
converter=PropHoursOfOperationHoursOfOperationConfig.from_list,
validator=attr.validators.deep_iterable(member_validator=attr.validators.instance_of(PropHoursOfOperationHoursOfOperationConfig), iterable_validator=attr.validators.instance_of(list)),
metadata={AttrMeta.PROPERTY_NAME: "Config"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-config"""
rp_InstanceArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "InstanceArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-instancearn"""
rp_Name: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "Name"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-name"""
rp_TimeZone: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "TimeZone"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-timezone"""
p_Description: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "Description"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-description"""
p_Tags: typing.List[typing.Union[Tag, dict]] = attr.ib(
default=None,
converter=Tag.from_list,
validator=attr.validators.optional(attr.validators.deep_iterable(member_validator=attr.validators.instance_of(Tag), iterable_validator=attr.validators.instance_of(list))),
metadata={AttrMeta.PROPERTY_NAME: "Tags"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#cfn-connect-hoursofoperation-tags"""
@property
def rv_HoursOfOperationArn(self) -> GetAtt:
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-hoursofoperation.html#aws-resource-connect-hoursofoperation-return-values"""
return GetAtt(resource=self, attr_name="HoursOfOperationArn")
@attr.s
class UserHierarchyGroup(Resource):
"""
AWS Object Type = "AWS::Connect::UserHierarchyGroup"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-userhierarchygroup.html
Property Document:
- ``rp_InstanceArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-userhierarchygroup.html#cfn-connect-userhierarchygroup-instancearn
- ``rp_Name``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-userhierarchygroup.html#cfn-connect-userhierarchygroup-name
- ``p_ParentGroupArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-userhierarchygroup.html#cfn-connect-userhierarchygroup-parentgrouparn
"""
AWS_OBJECT_TYPE = "AWS::Connect::UserHierarchyGroup"
rp_InstanceArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "InstanceArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-userhierarchygroup.html#cfn-connect-userhierarchygroup-instancearn"""
rp_Name: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "Name"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-userhierarchygroup.html#cfn-connect-userhierarchygroup-name"""
p_ParentGroupArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "ParentGroupArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-userhierarchygroup.html#cfn-connect-userhierarchygroup-parentgrouparn"""
@property
def rv_UserHierarchyGroupArn(self) -> GetAtt:
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-userhierarchygroup.html#aws-resource-connect-userhierarchygroup-return-values"""
return GetAtt(resource=self, attr_name="UserHierarchyGroupArn")
@attr.s
class User(Resource):
"""
AWS Object Type = "AWS::Connect::User"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html
Property Document:
- ``rp_InstanceArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-instancearn
- ``rp_PhoneConfig``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-phoneconfig
- ``rp_RoutingProfileArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-routingprofilearn
- ``rp_SecurityProfileArns``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-securityprofilearns
- ``rp_Username``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-username
- ``p_DirectoryUserId``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-directoryuserid
- ``p_HierarchyGroupArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-hierarchygrouparn
- ``p_IdentityInfo``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-identityinfo
- ``p_Password``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-password
- ``p_Tags``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-tags
"""
AWS_OBJECT_TYPE = "AWS::Connect::User"
rp_InstanceArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "InstanceArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-instancearn"""
rp_PhoneConfig: typing.Union['PropUserUserPhoneConfig', dict] = attr.ib(
default=None,
converter=PropUserUserPhoneConfig.from_dict,
validator=attr.validators.instance_of(PropUserUserPhoneConfig),
metadata={AttrMeta.PROPERTY_NAME: "PhoneConfig"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-phoneconfig"""
rp_RoutingProfileArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "RoutingProfileArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-routingprofilearn"""
rp_SecurityProfileArns: typing.List[TypeHint.intrinsic_str] = attr.ib(
default=None,
validator=attr.validators.deep_iterable(member_validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type), iterable_validator=attr.validators.instance_of(list)),
metadata={AttrMeta.PROPERTY_NAME: "SecurityProfileArns"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-securityprofilearns"""
rp_Username: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "Username"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-username"""
p_DirectoryUserId: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "DirectoryUserId"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-directoryuserid"""
p_HierarchyGroupArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "HierarchyGroupArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-hierarchygrouparn"""
p_IdentityInfo: typing.Union['PropUserUserIdentityInfo', dict] = attr.ib(
default=None,
converter=PropUserUserIdentityInfo.from_dict,
validator=attr.validators.optional(attr.validators.instance_of(PropUserUserIdentityInfo)),
metadata={AttrMeta.PROPERTY_NAME: "IdentityInfo"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-identityinfo"""
p_Password: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "Password"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-password"""
p_Tags: typing.List[typing.Union[Tag, dict]] = attr.ib(
default=None,
converter=Tag.from_list,
validator=attr.validators.optional(attr.validators.deep_iterable(member_validator=attr.validators.instance_of(Tag), iterable_validator=attr.validators.instance_of(list))),
metadata={AttrMeta.PROPERTY_NAME: "Tags"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#cfn-connect-user-tags"""
@property
def rv_UserArn(self) -> GetAtt:
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-user.html#aws-resource-connect-user-return-values"""
return GetAtt(resource=self, attr_name="UserArn")
| 62.327715
| 225
| 0.76853
| 3,512
| 33,283
| 7.189066
| 0.034738
| 0.033587
| 0.046182
| 0.071372
| 0.902012
| 0.901695
| 0.880862
| 0.840067
| 0.832977
| 0.830759
| 0
| 0.000034
| 0.103506
| 33,283
| 533
| 226
| 62.444653
| 0.846136
| 0.336779
| 0
| 0.450172
| 0
| 0
| 0.094545
| 0.05985
| 0
| 0
| 0
| 0
| 0
| 1
| 0.013746
| false
| 0.006873
| 0.013746
| 0
| 0.278351
| 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
|
49ac893e19b5d78522118a5eae937e8eb1cb7d8b
| 186
|
py
|
Python
|
huskar_api/models/infra/__init__.py
|
mowangdk/huskar
|
7692fbc5672a5ae6e2a33616c493466a7137f8cd
|
[
"MIT"
] | 59
|
2019-10-31T10:50:10.000Z
|
2021-11-26T04:32:25.000Z
|
huskar_api/models/infra/__init__.py
|
mowangdk/huskar
|
7692fbc5672a5ae6e2a33616c493466a7137f8cd
|
[
"MIT"
] | 5
|
2019-10-31T10:37:30.000Z
|
2020-03-02T06:45:46.000Z
|
huskar_api/models/infra/__init__.py
|
mowangdk/huskar
|
7692fbc5672a5ae6e2a33616c493466a7137f8cd
|
[
"MIT"
] | 9
|
2019-10-31T10:35:00.000Z
|
2019-12-01T14:13:58.000Z
|
from __future__ import absolute_import
from .downstream import InfraDownstream
from .utils import extract_application_names
__all__ = ['extract_application_names', 'InfraDownstream']
| 23.25
| 58
| 0.844086
| 20
| 186
| 7.2
| 0.55
| 0.25
| 0.319444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102151
| 186
| 7
| 59
| 26.571429
| 0.862275
| 0
| 0
| 0
| 0
| 0
| 0.215054
| 0.134409
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
49b13de44c938876f497a35fe393936282bd886b
| 6,948
|
py
|
Python
|
savu/test/jenkins/dawn_runner_tests/i08_pymca_runner_test.py
|
malte-storm/Savu
|
16291e8a22464c50c511af01fbc648860c1236e6
|
[
"Apache-2.0"
] | 1
|
2021-04-18T09:30:54.000Z
|
2021-04-18T09:30:54.000Z
|
savu/test/jenkins/dawn_runner_tests/i08_pymca_runner_test.py
|
malte-storm/Savu
|
16291e8a22464c50c511af01fbc648860c1236e6
|
[
"Apache-2.0"
] | null | null | null |
savu/test/jenkins/dawn_runner_tests/i08_pymca_runner_test.py
|
malte-storm/Savu
|
16291e8a22464c50c511af01fbc648860c1236e6
|
[
"Apache-2.0"
] | 1
|
2021-05-20T16:31:29.000Z
|
2021-05-20T16:31:29.000Z
|
# Copyright 2014 Diamond Light Source 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.
"""
.. module:: nx_xrd_loader_test
:platform: Unix
:synopsis: testing the nx_xrd loader
.. moduleauthor:: Aaron Parsons <scientificsoftware@diamond.ac.uk>
"""
import unittest
from savu.test import test_utils as tu
from scripts.dawn_runner import run_savu
import h5py as h5
import os
import scripts.config_generator.config_utils as cu
import savu.plugins.utils as pu
from savu.plugins.utils import dawn_plugins
import threading
class I08PymcaRunnerTest(unittest.TestCase):
'''
This test runs and checks the savu-side code for the runner in dawn. The rest should just be GUI
'''
def runSavu(self, path2plugin, params, metaOnly, inputs):
'''
this is copy paste of how it is implemented in org.dawnsci.python.rpc source code.
'''
print("running savu")
result = run_savu.runSavu(path2plugin, params, metaOnly, inputs, self.persistence)
print("done")
return result
def test_i08(self):
cu.populate_plugins()
data_file = tu.get_test_big_data_path('pymca_live_processing_test/i08-10471.nxs')
data = h5.File(data_file,'r')['/entry/xmapMca/data']
inputs = {}
inputs['data'] = data[0,0,0,:]
inputs['dataset_name'] = ''
inputs['xaxis_title'] = None
metaOnly = True
self.persistence = {}
self.persistence['sys_path_0_lock'] = threading.Lock()
self.persistence['sys_path_0_set'] = False
self.persistence['plugin_object'] = None
self.persistence['axis_labels'] = None
self.persistence['axis_values'] = None
self.persistence['string_key'] = None
self.persistence['parameters'] = None
self.persistence['aux'] = {}
params={}
params['config']={}
params['config']['value'] = tu.get_test_big_data_path('pymca_live_processing_test/10471.cfg')
path2plugin = pu.dawn_plugins['Pymca']['path2plugin']# set by dawn-side code
self.runSavu(path2plugin, params, metaOnly, inputs)
def test_i08_REGRESSION(self):
cu.populate_plugins()
data_file = h5.File(tu.get_test_big_data_path('pymca_live_processing_test/dawn_test_result/result.nxs'),'r')
data = data_file['/raw_entry/xmapMca/data']
inputs = {}
inputs['dataset_name'] = ''
inputs['xaxis_title'] = None
metaOnly = True
self.persistence = {}
self.persistence['sys_path_0_lock'] = threading.Lock()
self.persistence['sys_path_0_set'] = False
self.persistence['plugin_object'] = None
self.persistence['axis_labels'] = None
self.persistence['axis_values'] = None
self.persistence['string_key'] = None
self.persistence['parameters'] = None
self.persistence['aux'] = {}
params={}
params['config']={}
params['config']['value'] = tu.get_test_big_data_path('pymca_live_processing_test/10471.cfg')
path2plugin = pu.dawn_plugins['Pymca']['path2plugin']# set by dawn-side code
pts = [(39,51),
(45,25),
(18,29),
(37,96),
(8,110)] # just do 5 points for now, is full regression necessary?
for y,x in pts:
inputs['data'] = data[x,y,0,:]
out = self.runSavu(path2plugin, params, metaOnly, inputs)
aux = out['auxiliary']
entry = 'entry/auxiliary/0-Python Script - Savu/'
for key in aux.keys():
print(key,x,y)
foo=data_file[entry+key+'/data'][x,y]
self.assertAlmostEqual(aux[key],foo,delta=0.5)
def test_i08_notaux(self):
cu.populate_plugins()
data_file = tu.get_test_big_data_path('pymca_live_processing_test/i08-10471.nxs')
data = h5.File(data_file,'r')['/entry/xmapMca/data']
inputs = {}
inputs['data'] = data[0,0,0,:]
inputs['dataset_name'] = ''
inputs['xaxis_title'] = None
metaOnly = False
self.persistence = {}
self.persistence['sys_path_0_lock'] = threading.Lock()
self.persistence['sys_path_0_set'] = False
self.persistence['plugin_object'] = None
self.persistence['axis_labels'] = None
self.persistence['axis_values'] = None
self.persistence['string_key'] = None
self.persistence['parameters'] = None
self.persistence['aux'] = {}
params={}
params['config']={}
params['config']['value'] = tu.get_test_big_data_path('pymca_live_processing_test/10471.cfg')
path2plugin = pu.dawn_plugins['Pymca']['path2plugin']# set by dawn-side code
self.runSavu(path2plugin, params, metaOnly, inputs)
def test_i08_notaux_REGRESSION(self):
cu.populate_plugins()
data_file = h5.File(tu.get_test_big_data_path('pymca_live_processing_test/dawn_test_result/result.nxs'),'r')
data = data_file['/raw_entry/xmapMca/data']
inputs = {}
inputs['dataset_name'] = ''
inputs['xaxis_title'] = None
metaOnly = True
self.persistence = {}
self.persistence['sys_path_0_lock'] = threading.Lock()
self.persistence['sys_path_0_set'] = False
self.persistence['plugin_object'] = None
self.persistence['axis_labels'] = None
self.persistence['axis_values'] = None
self.persistence['string_key'] = None
self.persistence['parameters'] = None
self.persistence['aux'] = {}
params={}
params['config']={}
params['config']['value'] = tu.get_test_big_data_path('pymca_live_processing_test/10471.cfg')
path2plugin = pu.dawn_plugins['Pymca']['path2plugin']# set by dawn-side code
pts = [(39,51),
(45,25),
(18,29),
(37,96),
(8,110)] # just do 5 points for now, is full regression necessary?
for y,x in pts:
inputs['data'] = data[x,y,0,:]
out = self.runSavu(path2plugin, params, metaOnly, inputs)
aux = out['auxiliary']
entry = 'entry/auxiliary/0-Python Script - Savu/'
for key in aux.keys():
print(key,x,y)
foo=data_file[entry+key+'/data'][x,y]
self.assertAlmostEqual(aux[key],foo,delta=0.5)
if __name__ == "__main__":
unittest.main()
| 40.395349
| 116
| 0.623489
| 865
| 6,948
| 4.828902
| 0.227746
| 0.13287
| 0.090974
| 0.022983
| 0.727795
| 0.718698
| 0.718698
| 0.718698
| 0.718698
| 0.718698
| 0
| 0.026049
| 0.248561
| 6,948
| 171
| 117
| 40.631579
| 0.77399
| 0.158463
| 0
| 0.834586
| 0
| 0
| 0.196818
| 0.073677
| 0
| 0
| 0
| 0
| 0.015038
| 1
| 0.037594
| false
| 0
| 0.067669
| 0
| 0.120301
| 0.030075
| 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
|
49fdbc0b878f5006c0dadae8f786c822fa71b599
| 93
|
py
|
Python
|
blinkwink/bookmark/__init__.py
|
imajunryou/blinkwink
|
5facec23d9b79c84004243f68ca26b651bca368d
|
[
"MIT"
] | null | null | null |
blinkwink/bookmark/__init__.py
|
imajunryou/blinkwink
|
5facec23d9b79c84004243f68ca26b651bca368d
|
[
"MIT"
] | 2
|
2019-04-19T06:19:29.000Z
|
2019-06-10T05:26:06.000Z
|
blinkwink/bookmark/__init__.py
|
imajunryou/blinkwink
|
5facec23d9b79c84004243f68ca26b651bca368d
|
[
"MIT"
] | null | null | null |
from flask import Blueprint
bookmark = Blueprint("bookmark", __name__)
from . import views
| 15.5
| 42
| 0.774194
| 11
| 93
| 6.181818
| 0.636364
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150538
| 93
| 5
| 43
| 18.6
| 0.860759
| 0
| 0
| 0
| 0
| 0
| 0.086022
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0.666667
| 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
| 0
| 0
| 1
| 0
| 1
| 1
|
0
| 6
|
b729d784acb7b5e4e6369b12b1d27c56f61dc22c
| 42
|
py
|
Python
|
books/python-3-oop-packt/Chapter12/12_06_simplestpytest.py
|
phiratio/lpthw
|
a32240d4355fb331805d515f96e1d009914e5c47
|
[
"MIT"
] | 73
|
2016-09-15T23:07:04.000Z
|
2022-03-05T15:09:48.000Z
|
books/python-3-oop-packt/Chapter12/12_06_simplestpytest.py
|
phiratio/lpthw
|
a32240d4355fb331805d515f96e1d009914e5c47
|
[
"MIT"
] | 34
|
2019-12-16T16:53:24.000Z
|
2022-01-13T02:29:30.000Z
|
books/python-3-oop-packt/Chapter12/12_06_simplestpytest.py
|
phiratio/lpthw
|
a32240d4355fb331805d515f96e1d009914e5c47
|
[
"MIT"
] | 51
|
2016-10-07T20:47:51.000Z
|
2021-12-22T21:00:24.000Z
|
def test_int_float():
assert 1 == 1.0
| 14
| 21
| 0.619048
| 8
| 42
| 3
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09375
| 0.238095
| 42
| 2
| 22
| 21
| 0.65625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0.5
| true
| 0
| 0
| 0
| 0.5
| 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
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
3f7ec1336b090839622ac17edd25ba0bc9ce3f3c
| 146
|
py
|
Python
|
facebook_hateful_memes_detector/models/MultiModal/__init__.py
|
faizanahemad/facebook-hateful-memes
|
1f7febf65f5fc4ed4aeb476d5383437f677fbc19
|
[
"MIT"
] | 9
|
2020-07-28T20:33:04.000Z
|
2022-01-28T16:51:40.000Z
|
facebook_hateful_memes_detector/models/MultiModal/__init__.py
|
faizanahemad/facebook-hateful-memes
|
1f7febf65f5fc4ed4aeb476d5383437f677fbc19
|
[
"MIT"
] | 3
|
2021-06-08T21:36:37.000Z
|
2021-09-08T02:03:07.000Z
|
facebook_hateful_memes_detector/models/MultiModal/__init__.py
|
faizanahemad/facebook-hateful-memes
|
1f7febf65f5fc4ed4aeb476d5383437f677fbc19
|
[
"MIT"
] | 1
|
2020-08-26T08:13:25.000Z
|
2020-08-26T08:13:25.000Z
|
from .VilBertVisualBert import VilBertVisualBertModel
from .VilBertVisualBertV2 import VilBertVisualBertModelV2, MLMSimCLR, MLMOnlyV2, make_plots
| 48.666667
| 91
| 0.890411
| 12
| 146
| 10.75
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022222
| 0.075342
| 146
| 2
| 92
| 73
| 0.933333
| 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
|
b206220572a6f5f52b27fcba826eabd9038e1bc7
| 32
|
py
|
Python
|
tests/test_app.py
|
bomodot/software
|
6547d98d57119eff0e9a8e5b65be41dbe68867f5
|
[
"MIT"
] | null | null | null |
tests/test_app.py
|
bomodot/software
|
6547d98d57119eff0e9a8e5b65be41dbe68867f5
|
[
"MIT"
] | null | null | null |
tests/test_app.py
|
bomodot/software
|
6547d98d57119eff0e9a8e5b65be41dbe68867f5
|
[
"MIT"
] | null | null | null |
def test_run():
assert True
| 10.666667
| 15
| 0.65625
| 5
| 32
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 32
| 2
| 16
| 16
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0.5
| true
| 0
| 0
| 0
| 0.5
| 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
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
b761b73d4dd75706d1a7c1de20ea372c97d167d9
| 8,820
|
py
|
Python
|
dynamodb/profile_dynamo.py
|
nikhilphatak1/datastore-profiling
|
d20a3d9959d8a220fa405a7ec741dc54b0abcaad
|
[
"MIT"
] | null | null | null |
dynamodb/profile_dynamo.py
|
nikhilphatak1/datastore-profiling
|
d20a3d9959d8a220fa405a7ec741dc54b0abcaad
|
[
"MIT"
] | null | null | null |
dynamodb/profile_dynamo.py
|
nikhilphatak1/datastore-profiling
|
d20a3d9959d8a220fa405a7ec741dc54b0abcaad
|
[
"MIT"
] | 1
|
2020-03-12T16:04:59.000Z
|
2020-03-12T16:04:59.000Z
|
import boto3
import numpy as np
import time
import matplotlib.pyplot as plt
# docker run -p 8000:8000 -v $(pwd)/local/dynamodb:/data/ amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb -dbPath /data
def main():
dynamodb=boto3.client(
'dynamodb',
endpoint_url='http://localhost:8000',
aws_access_key_id='foo',
aws_secret_access_key='bar',
verify=False
)
try:
dynamodb.delete_table(TableName='values')
except dynamodb.exceptions.ResourceNotFoundException:
print("Table does not exist yet, creating...")
resource = boto3.resource(
'dynamodb',
endpoint_url='http://localhost:8000',
aws_access_key_id='foo',
aws_secret_access_key='bar',
verify=False
)
t = resource.Table('values')
dynamodb.create_table(
TableName='values',
KeySchema=[
{
'AttributeName': 'key',
'KeyType': 'HASH'
}
],
AttributeDefinitions=[
{
'AttributeName': 'key',
'AttributeType': 'S'
}
],
ProvisionedThroughput={
'ReadCapacityUnits': 5,
'WriteCapacityUnits': 5
}
)
# # Test job size vs job time
N = 1000
memory_set = {}
memory_get = {}
time_table_set = {}
time_table_get = {}
time_complete_set = {}
time_complete_get = {}
# memory issues around size 256 ...
# 9
array_sizes = 2**np.arange(9)
for size in array_sizes:
print("size {}".format(size**2 * 8))
t_set = []
t_get = []
t_set_complete = []
t_get_complete =[]
# store values
for i in range(N):
#t_start = r.time()
t_start = time.time_ns()
key = "{0:015b}".format(i)
x = np.random.uniform(0,1,size=(size,size))
#r.set(key,x.tobytes())
t.put_item(Item={'key': key})
#t_end = r.time()
t_end = time.time_ns()
#job_time = (t_end[0] + t_end[1]*1e-6)-(t_start[0] + t_start[1]*1e-6)
job_time = t_end - t_start
t_set.append(job_time)
#t_set_complete.append(t_end[0] + t_end[1]*1e-6)
t_set_complete.append(t_end)
# get values
for i in range(N):
#t_start = r.time()
t_start = time.time_ns()
key = "{0:015b}".format(i)
#r.get(key)
t.get_item(Key={'key': key})
#t_end = r.time()
t_end = time.time_ns()
#job_time = (t_end[0] + t_end[1]*1e-6)-(t_start[0] + t_start[1]*1e-6)
job_time = t_end - t_start
t_get.append(job_time)
#t_get_complete.append(t_end[0] + t_end[1]*1e-6)
t_set_complete.append(t_end)
#breakpoint()
# clear keys
for i in range(N):
#r.delete("{0:015b}".format(i))
t.delete_item(Key={'key': "{0:015b}".format(i)})
memory_set[str(size**2 * 8)] = np.mean(t_set)
time_table_set[str(size**2 * 8)] = t_set
memory_get[str(size**2 * 8)] = np.mean(t_get)
time_table_get[str(size**2 * 8)] = t_get
time_complete_set[str(size**2 * 8)] = time_complete_set
time_complete_get[str(size**2 * 8)] = time_complete_get
plt.plot(np.array(list(memory_set.keys())),np.array(list(memory_set.values())))
plt.plot(np.array(list(memory_get.keys())),np.array(list(memory_get.values())))
plt.xlabel("Memory (bytes)")
plt.ylabel("Average Time")
plt.legend(["Set","Get"])
plt.plot(np.array(list(memory_get.keys())),np.array(list(memory_get.values()))-np.array(list(memory_set.values())))
plt.xlabel("Memory (bytes)")
plt.ylabel("Average Time")
plt.title("Set - Get as memory increased")
plt.show()
plt.figure(figsize=(10,5))
for size in array_sizes:
key = size**2 * 8
t = time_table_set[str(key)]
num_bins = int(np.sqrt(len(t)))#int(np.floor(5/3 * (len(t)**(1/3))))
counts, bin_edges = np.histogram (t, bins=num_bins, normed=True)
cdf = np.cumsum (counts)
plt.plot (np.hstack((np.zeros((1,)),bin_edges[1:])), np.hstack((np.zeros(1,),cdf/cdf[-1])))
plt.xlabel("t"); plt.ylabel("f(t)");
plt.xlim([0,0.005])
plt.legend(array_sizes**2 * 8)
plt.show()
plt.figure(figsize=(10,5))
for size in array_sizes:
key = size**2 * 8
ti = time_table_get[str(key)]
num_bins = int(np.sqrt(len(ti)))#int(np.floor(5/3 * (len(t)**(1/3))))
counts, bin_edges = np.histogram (ti, bins=num_bins, normed=True)
cdf = np.cumsum (counts)
plt.plot (np.hstack((np.zeros((1,)),bin_edges[1:])), np.hstack((np.zeros(1,),cdf/cdf[-1])))
plt.xlabel("t"); plt.ylabel("f(t)");
plt.xlim([0,0.0015])
plt.legend(array_sizes**2 * 8)
plt.show()
# clear keys
for i in range(N):
#r.delete("{0:015b}".format(i))
t.delete_item(Key={'key': "{0:015b}".format(i)})
"""
## job vs total time
N = 100
memory_set = {}
memory_get = {}
time_table_set = {}
time_table_get = {}
time_complete_set = {}
time_complete_get = {}
#pipeline = r.pipeline(transaction=True)
batcher = boto3.client('batch')
job_size = np.array([1,10,100,1000,10000,100000])
for size in job_size:
print("N jobs {}".format(size))
t_set = []
t_get = []
t_set_complete = []
t_get_complete =[]
# store values
for _ in range(N):
for i in range(size):
key = "{0:015b}".format(i)
x = np.random.uniform(0,1,size=(8,8))
pipeline.set(key,x.tobytes())
t_start = r.time()
pipeline.execute()
t_end = r.time()
job_time = (t_end[0] + t_end[1]*1e-6)-(t_start[0] + t_start[1]*1e-6)
t_set.append(job_time)
t_set_complete.append(t_end[0] + t_end[1]*1e-6)
# get values
for _ in range(N):
for i in range(size):
key = "{0:015b}".format(i)
pipeline.get(key)
t_start = r.time()
pipeline.execute()
t_end = r.time()
job_time = (t_end[0] + t_end[1]*1e-6)-(t_start[0] + t_start[1]*1e-6)
t_get.append(job_time)
t_get_complete.append(t_end[0] + t_end[1]*1e-6)
# clear keys
for i in range(N):
r.delete("{0:015b}".format(i))
memory_set[str(size)] = np.mean(t_set)
time_table_set[str(size)] = t_set
memory_get[str(size)] = np.mean(t_get)
time_table_get[str(size)] = t_get
plt.plot(np.array(list(memory_set.keys())),np.array(list(memory_set.values())))
plt.plot(np.array(list(memory_get.keys())),np.array(list(memory_get.values())))
plt.xlabel("Memory (bytes)")
plt.ylabel("Average Time")
plt.legend(["Set","Get"])
plt.show()
plt.plot(np.array(list(memory_get.keys())),np.array(list(memory_get.values()))-np.array(list(memory_set.values())))
plt.xlabel("Memory (bytes)")
plt.ylabel("Average Time")
plt.title("Set - Get as memory increased")
plt.show()
plt.figure(figsize=(10,5))
for size in job_size:
key = size
t = time_table_set[str(key)]
num_bins = int(np.sqrt(len(t))) #int(np.floor(5/3 * (len(t)**(1/3))))
counts, bin_edges = np.histogram (t, bins=num_bins, normed=True)
cdf = np.cumsum (counts)
plt.plot (np.hstack((np.zeros((1,)),bin_edges[1:])), np.hstack((np.zeros(1,),cdf/cdf[-1])))
plt.xlabel("t"); plt.ylabel("f(t)");
plt.xlim([0,5])
plt.legend(job_size)
plt.show()
plt.figure(figsize=(10,5))
for size in job_size:
key = size
t = time_table_get[str(key)]
num_bins = int(np.sqrt(len(t)))#int(np.floor(5/3 * (len(t)**(1/3))))
counts, bin_edges = np.histogram (t, bins=num_bins, normed=True)
cdf = np.cumsum (counts)
plt.plot (np.hstack((np.zeros((1,)),bin_edges[1:])), np.hstack((np.zeros(1,),cdf/cdf[-1])))
plt.xlabel("t"); plt.ylabel("f(t)");
plt.xlim()
plt.legend(job_size)
plt.show()
# clear keys
for i in range(N):
r.delete("{0:015b}".format(i))
"""
if __name__ == "__main__":
main()
| 26.727273
| 126
| 0.519388
| 1,220
| 8,820
| 3.581148
| 0.131148
| 0.023804
| 0.035248
| 0.054475
| 0.802701
| 0.784848
| 0.756237
| 0.753719
| 0.736782
| 0.710231
| 0
| 0.037864
| 0.314286
| 8,820
| 330
| 127
| 26.727273
| 0.684524
| 0.080499
| 0
| 0.433333
| 0
| 0
| 0.08006
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.008333
| false
| 0
| 0.033333
| 0
| 0.041667
| 0.016667
| 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
|
b76935e5f91eed2c96db58335d1603b34919c7d6
| 10,919
|
py
|
Python
|
dosa/tests/test_firewall_actions.py
|
bunop/dosa
|
1271cce47d672b615d125110c0aa4379843ed63b
|
[
"MIT"
] | null | null | null |
dosa/tests/test_firewall_actions.py
|
bunop/dosa
|
1271cce47d672b615d125110c0aa4379843ed63b
|
[
"MIT"
] | null | null | null |
dosa/tests/test_firewall_actions.py
|
bunop/dosa
|
1271cce47d672b615d125110c0aa4379843ed63b
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 2 14:51:50 2019
@author: Paolo Cozzi <cozzi@ibba.cnr.it>
"""
import json
import os.path
from unittest import TestCase
from unittest.mock import patch
import dosa
endpoint = 'https://api.digitalocean.com/%s' % dosa.API_VERSION
api_sample_data = os.path.join(os.path.dirname(__file__), 'api_sample_data')
class TestDosaClientFirewallActions(TestCase):
@classmethod
def setUp(self):
self.api_key = 'my_fake_api_key'
self.client = dosa.Client(self.api_key)
# to see all differences in assertEqual
self.maxDiff = None
@classmethod
def tearDown(self):
pass
def test_dosa_client_created(self):
client = dosa.Client(self.api_key)
self.assertIsInstance(client, dosa.Client)
@patch('dosa.requests.get')
def test_dosa_firewall_list(self, mock_get):
mock_get.return_value.status_code = 200
mock_get.return_value.json.return_value = json.loads(
self._get_sample_data('firewalls'))
status, result = self.client.firewalls.list()
self.assertEqual(2, len(result['firewalls']))
self.assertTrue(mock_get.called)
expected_headers = {
'Content-Type': 'application/json',
'authorization': 'Bearer {}'.format(self.api_key)
}
expected_params = {}
expected_data = '{}'
url, data = mock_get.call_args
self.assertEqual(url[0], '{}/firewalls'.format(endpoint))
self.assertDictEqual(data['headers'], expected_headers)
self.assertDictEqual(data['params'], expected_params)
self.assertEqual(data['data'], expected_data)
@patch('dosa.requests.get')
def test_dosa_firewall_search(self, mock_get):
mock_get.return_value.status_code = 200
mock_get.return_value.json.return_value = json.loads(
self._get_sample_data('firewalls'))
firewall = self.client.firewalls.get_by_name('webserver')
# a firewall is an object
self.assertIsInstance(firewall, dosa.Firewall)
# assert method called
self.assertTrue(mock_get.called)
expected_headers = {
'Content-Type': 'application/json',
'authorization': 'Bearer {}'.format(self.api_key)
}
expected_params = {}
expected_data = '{}'
url, data = mock_get.call_args
self.assertEqual(url[0], '{}/firewalls'.format(endpoint))
self.assertDictEqual(data['headers'], expected_headers)
self.assertDictEqual(data['params'], expected_params)
self.assertEqual(data['data'], expected_data)
@patch('dosa.requests.post')
def test_dosa_firewall_create(self, mock_post):
mock_post.return_value.status_code = 202
mock_post.return_value.json.return_value = json.loads(
self._get_sample_data('firewall_create'))
# set firewall data
params = {
'droplet_ids': [],
'inbound_rules': [{'ports': '22',
'protocol': 'tcp',
'sources': {
'addresses': ['0.0.0.0/0', '::/0']}},
{'ports': '80',
'protocol': 'tcp',
'sources': {
'addresses': ['0.0.0.0/0', '::/0']}}],
'name': 'firewall',
'outbound_rules': [{'destinations': {
'addresses': ['0.0.0.0/0', '::/0']},
'ports': 'all',
'protocol': 'tcp'}],
'tags': []}
firewall = self.client.firewalls.create(**params)
self.assertTrue(mock_post.called)
self.assertIsInstance(firewall, dosa.Firewall)
expected_headers = {
'Content-Type': 'application/json',
'authorization': 'Bearer {}'.format(self.api_key)
}
expected_params = {}
url, data = mock_post.call_args
self.assertEqual(url[0], '{}/firewalls'.format(endpoint))
self.assertDictEqual(data['headers'], expected_headers)
self.assertDictEqual(data['params'], expected_params)
data_json = json.loads(data['data'])
self.assertEqual(data_json['name'], params['name'])
@patch('dosa.requests.delete')
def test_dosa_firewall_delete(self, mock_delete):
mock_delete.return_value.status_code = 204
# there's no response for delete firewall (No Content)
mock_delete.return_value.text = None
firewall_id = '99d5ef9c-2aa5-40ad-8507-2af7d65d099a'
status, result = self.client.firewalls.delete(firewall_id)
self.assertTrue(mock_delete.called)
self.assertEqual(result, None)
self.assertEqual(status, 204)
expected_headers = {
'Content-Type': 'application/json',
'authorization': 'Bearer {}'.format(self.api_key)
}
expected_params = {}
url, data = mock_delete.call_args
self.assertEqual(url[0], '{}/firewalls/{}'.format(
endpoint, firewall_id))
self.assertDictEqual(data['headers'], expected_headers)
self.assertDictEqual(data['params'], expected_params)
@patch('dosa.requests.get')
@patch('dosa.requests.post')
def test_dosa_firewall_add_droplet(self, mock_post, mock_get):
# get a droplet and firewall id
droplet_id = 12345
firewall_id = '99d5ef9c-2aa5-40ad-8507-2af7d65d099a'
# prepare a response for a firewall object
mock_get.return_value.status_code = 200
mock_get.return_value.json.return_value = json.loads(
self._get_sample_data('firewall'))
mock_post.return_value.status_code = 204
# there's no response for adding droplet (No Content)
mock_post.return_value.text = None
# get a firewall object
firewall = dosa.Firewall(
self.api_key, 'firewalls/{id}', id=firewall_id)
# add a droplet to firewall
status, result = firewall.add_droplet(droplet_id)
self.assertTrue(mock_get.called)
self.assertTrue(mock_post.called)
self.assertEqual(result, None)
self.assertEqual(status, 204)
expected_headers = {
'Content-Type': 'application/json',
'authorization': 'Bearer {}'.format(self.api_key)
}
expected_params = {}
url, data = mock_post.call_args
self.assertEqual(url[0], '{}/firewalls/{}/droplets'.format(
endpoint, firewall_id))
self.assertDictEqual(data['headers'], expected_headers)
self.assertDictEqual(data['params'], expected_params)
@patch('dosa.requests.get')
@patch('dosa.requests.post')
def test_dosa_firewall_add_droplet_already(self, mock_post, mock_get):
"""Test adding a droplet to firewall, which already have such
droplet"""
# get a droplet and firewall id
droplet_id = 12345
firewall_id = '99d5ef9c-2aa5-40ad-8507-2af7d65d099a'
# prepare a response for a firewall object
mock_get.return_value.status_code = 200
# read data from file and update data with droplet_id
firewall_data = json.loads(self._get_sample_data('firewall'))
firewall_data['firewall']['droplet_ids'] = [droplet_id]
# assign data to response
mock_get.return_value.json.return_value = firewall_data
mock_post.return_value.status_code = 204
# there's no response for adding droplet (No Content)
mock_post.return_value.text = None
# get a firewall object
firewall = dosa.Firewall(
self.api_key, 'firewalls/{id}', id=firewall_id)
# add a droplet to firewall
result = firewall.add_droplet(droplet_id)
self.assertTrue(mock_get.called)
self.assertFalse(mock_post.called)
self.assertEqual(result, None)
@patch('dosa.requests.get')
@patch('dosa.requests.delete')
def test_dosa_firewall_delete_droplet(self, mock_delete, mock_get):
# get a droplet and firewall id
droplet_id = 12345
firewall_id = '99d5ef9c-2aa5-40ad-8507-2af7d65d099a'
# prepare a response for a firewall object
mock_get.return_value.status_code = 200
# read data from file and update data with droplet_id
firewall_data = json.loads(self._get_sample_data('firewall'))
firewall_data['firewall']['droplet_ids'] = [droplet_id]
# assign data to response
mock_get.return_value.json.return_value = firewall_data
mock_delete.return_value.status_code = 204
# there's no response for deleting droplet (No Content)
mock_delete.return_value.text = None
# get a firewall object
firewall = dosa.Firewall(
self.api_key, 'firewalls/{id}', id=firewall_id)
# add a droplet to firewall
status, result = firewall.remove_droplet(droplet_id)
self.assertTrue(mock_get.called)
self.assertTrue(mock_delete.called)
self.assertEqual(result, None)
self.assertEqual(status, 204)
expected_headers = {
'Content-Type': 'application/json',
'authorization': 'Bearer {}'.format(self.api_key)
}
expected_params = {}
url, data = mock_delete.call_args
self.assertEqual(url[0], '{}/firewalls/{}/droplets'.format(
endpoint, firewall_id))
self.assertDictEqual(data['headers'], expected_headers)
self.assertDictEqual(data['params'], expected_params)
@patch('dosa.requests.get')
@patch('dosa.requests.delete')
def test_dosa_firewall_delete_droplet_error(self, mock_delete, mock_get):
"""Test adding a droplet to firewall, which already have such
droplet"""
# get a droplet and firewall id
droplet_id = 12345
firewall_id = '99d5ef9c-2aa5-40ad-8507-2af7d65d099a'
# prepare a response for a firewall object
mock_get.return_value.status_code = 200
mock_get.return_value.json.return_value = json.loads(
self._get_sample_data('firewall'))
mock_delete.return_value.status_code = 204
# there's no response for adding droplet (No Content)
mock_delete.return_value.text = None
# get a firewall object
firewall = dosa.Firewall(
self.api_key, 'firewalls/{id}', id=firewall_id)
# add a droplet to firewall
result = firewall.remove_droplet(droplet_id)
self.assertTrue(mock_get.called)
self.assertFalse(mock_delete.called)
self.assertEqual(result, None)
def _get_sample_data(self, path):
filename = '{}.json'.format(path)
with open(os.path.join(api_sample_data, filename)) as handle:
data = handle.read()
return data
| 35.917763
| 77
| 0.626248
| 1,264
| 10,919
| 5.204114
| 0.125
| 0.051839
| 0.019763
| 0.032837
| 0.841289
| 0.812405
| 0.803132
| 0.776072
| 0.753725
| 0.746427
| 0
| 0.025003
| 0.260097
| 10,919
| 303
| 78
| 36.036304
| 0.789207
| 0.114205
| 0
| 0.681373
| 0
| 0
| 0.139779
| 0.02373
| 0
| 0
| 0
| 0
| 0.220588
| 1
| 0.058824
| false
| 0.004902
| 0.02451
| 0
| 0.093137
| 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
|
b77f40e453a022d13cc6954285a86025cee5d7ba
| 21,182
|
py
|
Python
|
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/fts/fts_transitions/fts_transitions.py
|
sridhargoudrangu/gpdb
|
0783892116708662d7fe7ef4f307197de40ecc04
|
[
"PostgreSQL",
"Apache-2.0"
] | null | null | null |
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/fts/fts_transitions/fts_transitions.py
|
sridhargoudrangu/gpdb
|
0783892116708662d7fe7ef4f307197de40ecc04
|
[
"PostgreSQL",
"Apache-2.0"
] | null | null | null |
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/fts/fts_transitions/fts_transitions.py
|
sridhargoudrangu/gpdb
|
0783892116708662d7fe7ef4f307197de40ecc04
|
[
"PostgreSQL",
"Apache-2.0"
] | null | null | null |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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 tinctest
from mpp.lib.filerep_util import Filerepe2e_Util
from mpp.lib.config import GPDBConfig
from tinctest.models.scenario import ScenarioTestCase
from mpp.models import MPPTestCase
class FTSTestCase(ScenarioTestCase, MPPTestCase):
''' FTS transitions with filerep_faults and other cluster changes'''
def __init__(self, methodName):
super(FTSTestCase,self).__init__(methodName)
def setUp(self):
self.fileutil = Filerepe2e_Util()
self.fileutil.inject_fault(f='all', m='async', y='reset', r='primary_mirror', H='ALL')
super(FTSTestCase, self).setUp()
def tearDown(self):
super(FTSTestCase, self).tearDown()
def check_system(self):
'''
Check state of system and exit if not in sync & up state
'''
test_case_list0 = []
test_case_list0.append('mpp.gpdb.tests.storage.lib.dbstate.DbStateClass.check_system')
self.test_case_scenario.append(test_case_list0)
def run_gprecover_and_validation(self):
'''
Run gprecover and validation
'''
test_case_list0 = []
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.incremental_recoverseg')
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.wait_till_insync')
self.test_case_scenario.append(test_case_list0, serial=True)
test_case_list1 = []
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_validation')
self.test_case_scenario.append(test_case_list1)
def fts_test_run(self, filerep_role, filerep_state):
test_case_list1 = []
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_trigger_sql')
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.wait_till_change_tracking')
self.test_case_scenario.append(test_case_list1, serial=True)
test_case_list2 = []
test_case_list2.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_fts_test_ddl_dml')
self.test_case_scenario.append(test_case_list2)
test_case_list3 = []
test_case_list3.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_gpstate', [filerep_role, filerep_state]))
self.test_case_scenario.append(test_case_list3)
self.run_gprecover_and_validation()
def filerep_sync_ct(self, fault_name, fault_type, fault_role, filerep_state, filerep_role):
'''
sync_ct_tests with fierep faults
'''
self.check_system()
test_case_list0 = []
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', [fault_name, fault_type, fault_role]))
self.test_case_scenario.append(test_case_list0)
self.fts_test_run(filerep_role, filerep_state)
if fault_name == 'postmaster':
test_case_list6 = []
test_case_list6.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.restart_db')
self.test_case_scenario.append(test_case_list6)
def sync_postmaster_reset(self, fault_name, fault_type, fault_role, filerep_state, filerep_role):
'''
sync_postmaster_reset_tests with fierep faults
'''
self.check_system()
test_case_list0 = []
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', [fault_name, fault_type, fault_role]))
self.test_case_scenario.append(test_case_list0)
test_case_list1 = []
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_trigger_sql')
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_fts_test_ddl_dml')
self.test_case_scenario.append(test_case_list1, serial=True)
test_case_list2 = []
test_case_list2.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_recoverseg_if_ct')
test_case_list2.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.wait_till_insync')
self.test_case_scenario.append(test_case_list2, serial=True)
test_case_list3 = []
test_case_list3.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_gpstate', [filerep_role, filerep_state]))
self.test_case_scenario.append(test_case_list3)
if fault_name == 'checkpoint':
test_case_list3_1 = []
test_case_list3_1.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', [fault_name, 'reset', fault_role]))
self.test_case_scenario.append(test_case_list3_1)
test_case_list4 = []
test_case_list4.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_validation')
self.test_case_scenario.append(test_case_list4)
def gpconfig_alter(self, filerep_role):
'''
fts transitions after gpconfig alter
'''
self.check_system()
test_case_list0 = []
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.gpconfig_alter', [filerep_role, 'true']))
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.restart_db_with_no_rc_check')
self.test_case_scenario.append(test_case_list0, serial=True)
test_case_list1 = []
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.wait_till_change_tracking')
self.test_case_scenario.append(test_case_list1)
test_case_list2 = []
test_case_list2.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_fts_test_ddl_dml')
self.test_case_scenario.append(test_case_list2)
test_case_list3 = []
test_case_list3.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_gpstate', [filerep_role, 'ct']))
self.test_case_scenario.append(test_case_list3)
test_case_list4 = []
test_case_list4.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.incremental_recoverseg')
self.test_case_scenario.append(test_case_list4)
test_case_list5 = []
test_case_list5.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.gpconfig_alter', [filerep_role, 'false']))
test_case_list5.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.restart_db')
self.test_case_scenario.append(test_case_list5, serial=True)
self.run_gprecover_and_validation()
def primary_sync_mirror_cannot_keepup_failover(self):
self.check_system()
test_case_list01 = []
test_case_list01.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_gpconfig', ['gp_segment_connect_timeout','10s']))
self.test_case_scenario.append(test_case_list01)
test_case_list0 = []
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_receiver', 'suspend', 'primary']))
self.test_case_scenario.append(test_case_list0)
test_case_list1 = []
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_sql_in_background')
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.sleep_for_transition')
self.test_case_scenario.append(test_case_list1, serial=True)
test_case_list2 = []
test_case_list2.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.resume_faults', ['filerep_receiver', 'primary']))
self.test_case_scenario.append(test_case_list2)
test_case_list3 = []
test_case_list3.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.wait_till_change_tracking')
test_case_list3.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_fts_test_ddl_dml')
self.test_case_scenario.append(test_case_list3, serial=True)
test_case_list4 = []
test_case_list4.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_gpstate', ['primary','ct']))
self.test_case_scenario.append(test_case_list4)
self.run_gprecover_and_validation()
test_case_list5 = []
test_case_list5.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_gpconfig', ['gp_segment_connect_timeout','600']))
self.test_case_scenario.append(test_case_list5)
def change_tracking_transition_failover(self):
self.check_system()
test_case_list0 = []
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_consumer', 'fault', 'primary']))
self.test_case_scenario.append(test_case_list0)
test_case_list1 = []
test_case_list1.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_transition_to_change_tracking', 'panic', 'primary']))
self.test_case_scenario.append(test_case_list1)
self.fts_test_run('primary','ct')
def gpstate_resync_object_count(self):
self.check_system()
config = GPDBConfig()
db_id = config.get_dbid(0,'p')
test_case_list0 = []
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_fts_test_ddl_dml_before_ct')
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_transition_to_resync', 'suspend', 'primary']))
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_transition_to_resync_mark_recreate', 'suspend', 'primary']))
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_consumer', 'fault', 'primary']))
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_trigger_sql')
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.wait_till_change_tracking')
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_fts_test_ddl_dml_ct')
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.incremental_recoverseg', [True]))
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.check_fault_status', ['filerep_transition_to_resync'], {'seg_id': db_id}))
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_gpprimarymirror')
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_gpstate_shell_cmd', ['-e']))
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.verify_gpstate_output')
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.resume_faults', ['filerep_transition_to_resync', 'primary']))
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.check_fault_status', ['filerep_transition_to_resync_mark_recreate'], {'seg_id': db_id}))
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_gpprimarymirror')
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_gpstate_shell_cmd', ['-e']))
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.verify_gpstate_output')
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.resume_faults', ['filerep_transition_to_resync_mark_recreate', 'primary']))
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.wait_till_insync')
test_case_list0.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.restart_db')
self.test_case_scenario.append(test_case_list0, serial=True)
def mirror_resync_postmaster_reset_filerep_fault(self, filerep_fault):
self.check_system()
test_case_list0 = []
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_consumer', 'fault', 'primary']))
self.test_case_scenario.append(test_case_list0)
test_case_list1 = []
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_trigger_sql')
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.wait_till_change_tracking')
self.test_case_scenario.append(test_case_list1, serial=True)
test_case_list3 = []
test_case_list3.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_resync', 'suspend', 'primary']))
self.test_case_scenario.append(test_case_list3)
test_case_list4 = []
test_case_list4.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.incremental_recoverseg')
self.test_case_scenario.append(test_case_list4)
test_case_list5 = []
test_case_list5.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', [filerep_fault, 'panic', 'mirror']))
test_case_list5.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.resume_faults', ['filerep_resync', 'primary']))
self.test_case_scenario.append(test_case_list5, serial=True)
self.fts_test_run('primary','ct')
def primary_resync_postmaster_reset_with_faults(self, filerep_fault, fault_type, filerep_role, gpstate_role, gprecover='no'):
self.check_system()
test_case_list0 = []
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_consumer', 'fault', 'primary']))
self.test_case_scenario.append(test_case_list0)
test_case_list1 = []
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_trigger_sql')
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.wait_till_change_tracking')
self.test_case_scenario.append(test_case_list1, serial=True)
test_case_list2 = []
test_case_list2.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_resync', 'suspend', 'primary']))
self.test_case_scenario.append(test_case_list2)
test_case_list3 = []
test_case_list3.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.incremental_recoverseg')
self.test_case_scenario.append(test_case_list3)
test_case_list4 = []
test_case_list4.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_gpstate', [gpstate_role,'resync_incr']))
self.test_case_scenario.append(test_case_list4)
if filerep_fault == 'filerep_consumer' and filerep_role == 'primary':
test_case_list5_0 = []
test_case_list5_0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', [filerep_fault, 'reset', filerep_role]))
self.test_case_scenario.append(test_case_list5_0)
test_case_list5 = []
test_case_list5.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', [filerep_fault, fault_type, filerep_role]))
self.test_case_scenario.append(test_case_list5)
if filerep_fault == 'postmaster' and filerep_role == 'primary' :
tinctest.logger.info('When its postmaster no need to resume filerep_resync')
else:
test_case_list5_2 = []
test_case_list5_2.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.resume_faults', ['filerep_resync', 'primary']))
self.test_case_scenario.append(test_case_list5_2)
test_case_list6 = []
test_case_list6.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_trigger_sql')
self.test_case_scenario.append(test_case_list6)
if filerep_fault == 'postmaster' and filerep_role == 'primary' :
test_case_list7_1 = []
test_case_list7_1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.restart_db')
test_case_list7_1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.incremental_recoverseg')
self.test_case_scenario.append(test_case_list7_1, serial=True)
test_case_list7 = []
test_case_list7.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_fts_test_ddl_dml')
self.test_case_scenario.append(test_case_list7)
test_case_list8 = []
test_case_list8.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_gpstate', [gpstate_role,'ct']))
self.test_case_scenario.append(test_case_list8)
if gprecover == 'yes':
test_case_list9_1 = []
test_case_list9_1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.incremental_recoverseg')
self.test_case_scenario.append(test_case_list9_1)
test_case_list9 = []
test_case_list9.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.wait_till_insync')
self.test_case_scenario.append(test_case_list9)
test_case_list10 = []
test_case_list10.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_validation')
self.test_case_scenario.append(test_case_list10)
def mirror_resync_postmaster_reset_with_faults(self):
self.check_system()
test_case_list0 = []
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_consumer', 'fault', 'primary']))
self.test_case_scenario.append(test_case_list0)
test_case_list1 = []
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.run_trigger_sql')
test_case_list1.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.wait_till_change_tracking')
self.test_case_scenario.append(test_case_list1, serial=True)
test_case_list2 = []
test_case_list2.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_resync', 'suspend', 'primary']))
self.test_case_scenario.append(test_case_list2)
test_case_list3 = []
test_case_list3.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.incremental_recoverseg')
self.test_case_scenario.append(test_case_list3)
test_case_list4 = []
test_case_list4.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_consumer', 'panic', 'mirror']))
test_case_list4.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.resume_faults', ['filerep_resync', 'primary']))
self.test_case_scenario.append(test_case_list4, serial=True)
self.fts_test_run('primary', 'ct')
def wait_for_shutdown_before_commit(self):
self.check_system()
config = GPDBConfig()
db_id = config.get_dbid(-1,'p')
test_case_list0 = []
test_case_list0.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['fts_wait_for_shutdown', 'infinite_loop'], {'seg_id': db_id}))
self.test_case_scenario.append(test_case_list0)
test_case_list1 = []
test_case_list1.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.set_faults', ['filerep_consumer', 'fault', 'primary']))
self.test_case_scenario.append(test_case_list1)
test_case_list2 = []
test_case_list2.append(('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.check_fault_status', ['fts_wait_for_shutdown'], {'seg_id': db_id}))
self.test_case_scenario.append(test_case_list2)
test_case_list3 = []
test_case_list3.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.restart_db_with_no_rc_check')
self.test_case_scenario.append(test_case_list3)
test_case_list4 = []
test_case_list4.append('mpp.gpdb.tests.storage.fts.fts_transitions.FtsTransitions.cluster_state')
self.test_case_scenario.append(test_case_list4)
| 52.044226
| 179
| 0.73638
| 2,755
| 21,182
| 5.288929
| 0.081307
| 0.149887
| 0.082973
| 0.114886
| 0.866173
| 0.859035
| 0.841603
| 0.824171
| 0.79768
| 0.784503
| 0
| 0.014261
| 0.152535
| 21,182
| 406
| 180
| 52.172414
| 0.797449
| 0.043905
| 0
| 0.565056
| 0
| 0
| 0.394822
| 0.357899
| 0
| 0
| 0
| 0
| 0
| 1
| 0.05948
| false
| 0
| 0.018587
| 0
| 0.081784
| 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
|
b7a64d9a162a263dca24d4481052a244c76dc0a8
| 40,280
|
py
|
Python
|
datahub/dnb_api/test/test_tasks.py
|
uktrade/data-hub-api-actions-test
|
a72439dfeb34e4179491db42fea290b9c2afadb1
|
[
"MIT"
] | null | null | null |
datahub/dnb_api/test/test_tasks.py
|
uktrade/data-hub-api-actions-test
|
a72439dfeb34e4179491db42fea290b9c2afadb1
|
[
"MIT"
] | 16
|
2020-04-01T15:25:35.000Z
|
2020-04-14T14:07:30.000Z
|
datahub/dnb_api/test/test_tasks.py
|
uktrade/data-hub-api-actions-test
|
a72439dfeb34e4179491db42fea290b9c2afadb1
|
[
"MIT"
] | null | null | null |
from datetime import timedelta
from unittest import mock
from urllib.parse import urljoin
import pytest
from celery.exceptions import Retry
from django.conf import settings
from django.forms.models import model_to_dict
from django.test.utils import override_settings
from django.utils.timezone import now
from freezegun import freeze_time
from rest_framework import status
from reversion.models import Version
from datahub.company.models import Company
from datahub.company.test.factories import CompanyFactory
from datahub.dnb_api.tasks import (
get_company_updates,
sync_company_with_dnb,
sync_outdated_companies_with_dnb,
update_company_from_dnb_data,
)
from datahub.dnb_api.test.utils import model_to_dict_company
from datahub.dnb_api.utils import (
DNBServiceConnectionError,
DNBServiceError,
DNBServiceTimeoutError,
)
from datahub.interaction.test.factories import CompanyInteractionFactory
from datahub.metadata.models import Country
pytestmark = pytest.mark.django_db
DNB_SEARCH_URL = urljoin(f'{settings.DNB_SERVICE_BASE_URL}/', 'companies/search/')
@pytest.mark.parametrize(
'update_descriptor',
(
None,
'command:foo:bar',
),
)
@freeze_time('2019-01-01 11:12:13')
def test_sync_company_with_dnb_all_fields(
requests_mock,
dnb_response_uk,
base_company_dict,
update_descriptor,
):
"""
Test the sync_company_with_dnb task when all fields should be synced.
"""
requests_mock.post(
DNB_SEARCH_URL,
json=dnb_response_uk,
)
company = CompanyFactory(duns_number='123456789')
original_company = Company.objects.get(id=company.id)
task_result = sync_company_with_dnb.apply_async(
args=[company.id],
kwargs={'update_descriptor': update_descriptor},
)
assert task_result.successful()
company.refresh_from_db()
uk_country = Country.objects.get(iso_alpha2_code='GB')
assert model_to_dict_company(company) == {
**base_company_dict,
'address_1': 'Unit 10, Ockham Drive',
'address_2': '',
'address_country': uk_country.id,
'address_county': '',
'address_postcode': 'UB6 0F2',
'address_town': 'GREENFORD',
'archived_documents_url_path': original_company.archived_documents_url_path,
'business_type': original_company.business_type_id,
'company_number': '01261539',
'created_by': original_company.created_by_id,
'duns_number': '123456789',
'employee_range': original_company.employee_range_id,
'export_experience_category': original_company.export_experience_category_id,
'global_ultimate_duns_number': '291332174',
'id': original_company.id,
'is_number_of_employees_estimated': True,
'modified_by': original_company.modified_by_id,
'name': 'FOO BICYCLE LIMITED',
'number_of_employees': 260,
'sector': original_company.sector_id,
'turnover': 50651895,
'turnover_range': original_company.turnover_range_id,
'uk_region': original_company.uk_region_id,
'dnb_modified_on': now(),
}
versions = list(Version.objects.get_for_object(company))
assert len(versions) == 1
version = versions[0]
expected_update_descriptor = f'celery:sync_company_with_dnb:{task_result.id}'
if update_descriptor:
expected_update_descriptor = update_descriptor
assert version.revision.comment == f'Updated from D&B [{expected_update_descriptor}]'
assert version.revision.user is None
@freeze_time('2019-01-01 11:12:13')
def test_sync_company_with_dnb_partial_fields(
requests_mock,
dnb_response_uk,
base_company_dict,
):
"""
Test the sync_company_with_dnb task when only a subset of fields should be synced.
"""
requests_mock.post(
DNB_SEARCH_URL,
json=dnb_response_uk,
)
company = CompanyFactory(duns_number='123456789')
original_company = Company.objects.get(id=company.id)
task_result = sync_company_with_dnb.apply_async(
args=[company.id],
kwargs={'fields_to_update': ['global_ultimate_duns_number']},
)
assert task_result.successful()
company.refresh_from_db()
assert model_to_dict(company) == {
**base_company_dict,
'address_1': original_company.address_1,
'address_2': original_company.address_2,
'address_country': original_company.address_country_id,
'address_county': original_company.address_county,
'address_postcode': original_company.address_postcode,
'address_town': original_company.address_town,
'archived_documents_url_path': original_company.archived_documents_url_path,
'business_type': original_company.business_type_id,
'created_by': original_company.created_by_id,
'duns_number': original_company.duns_number,
'employee_range': original_company.employee_range_id,
'export_experience_category': original_company.export_experience_category_id,
'global_ultimate_duns_number': '291332174',
'id': original_company.id,
'is_number_of_employees_estimated': original_company.is_number_of_employees_estimated,
'is_turnover_estimated': original_company.is_turnover_estimated,
'modified_by': original_company.modified_by_id,
'name': original_company.name,
'number_of_employees': original_company.number_of_employees,
'registered_address_1': original_company.registered_address_1,
'registered_address_2': original_company.registered_address_2,
'registered_address_country': original_company.registered_address_country_id,
'registered_address_county': original_company.registered_address_county,
'registered_address_postcode': original_company.registered_address_postcode,
'registered_address_town': original_company.registered_address_town,
'sector': original_company.sector_id,
'trading_names': original_company.trading_names,
'turnover': original_company.turnover,
'turnover_range': original_company.turnover_range_id,
'uk_region': original_company.uk_region_id,
'website': original_company.website,
'dnb_modified_on': now(),
}
@pytest.mark.parametrize(
'error,expect_retry',
(
(DNBServiceError('An error occurred', status_code=504), True),
(DNBServiceError('An error occurred', status_code=503), True),
(DNBServiceError('An error occurred', status_code=502), True),
(DNBServiceError('An error occurred', status_code=500), True),
(DNBServiceError('An error occurred', status_code=403), False),
(DNBServiceError('An error occurred', status_code=400), False),
(DNBServiceConnectionError('An error occurred'), True),
(DNBServiceTimeoutError('An error occurred'), True),
),
)
def test_sync_company_with_dnb_retries_errors(monkeypatch, error, expect_retry):
"""
Test the sync_company_with_dnb task retries server errors.
"""
company = CompanyFactory(duns_number='123456789')
# Set up a DNBServiceError with the parametrized status code
mocked_get_company = mock.Mock()
mocked_get_company.side_effect = error
monkeypatch.setattr('datahub.dnb_api.tasks.sync.get_company', mocked_get_company)
# Mock the task's retry method
retry_mock = mock.Mock(side_effect=Retry(exc=error))
monkeypatch.setattr('datahub.dnb_api.tasks.sync_company_with_dnb.retry', retry_mock)
if expect_retry:
expected_exception_class = Retry
else:
expected_exception_class = DNBServiceError
with pytest.raises(expected_exception_class):
sync_company_with_dnb(company.id)
@pytest.mark.parametrize(
'error',
(
DNBServiceError('An error occurred', status_code=504),
DNBServiceError('An error occurred', status_code=503),
DNBServiceError('An error occurred', status_code=502),
DNBServiceError('An error occurred', status_code=500),
DNBServiceConnectionError('An error occurred'),
DNBServiceTimeoutError('An error occurred'),
),
)
def test_sync_company_with_dnb_respects_retry_failures_flag(monkeypatch, error):
"""
Test the sync_company_with_dnb task retries server errors.
"""
company = CompanyFactory(duns_number='123456789')
# Set up a DNBServiceError with the parametrized status code
mocked_get_company = mock.Mock()
mocked_get_company.side_effect = error
monkeypatch.setattr('datahub.dnb_api.tasks.sync.get_company', mocked_get_company)
with pytest.raises(error.__class__):
sync_company_with_dnb(company.id, retry_failures=False)
@pytest.mark.usefixtures('dnb_company_updates_feature_flag')
class TestGetCompanyUpdates:
"""
Tests for the get_company_updates task and the associated _get_company_updates function.
"""
@pytest.mark.parametrize(
'error, expect_retry',
(
(
DNBServiceError(
'An error occurred',
status_code=status.HTTP_504_GATEWAY_TIMEOUT,
),
True,
),
(
DNBServiceError(
'An error occurred',
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
),
True,
),
(
DNBServiceError(
'An error occurred',
status_code=status.HTTP_502_BAD_GATEWAY,
),
True,
),
(
DNBServiceError(
'An error occurred',
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
),
True,
),
(
DNBServiceError(
'An error occurred',
status_code=403,
),
False,
),
(
DNBServiceError(
'An error occurred',
status_code=400,
),
False,
),
(
DNBServiceConnectionError(
'An error occurred',
),
True,
),
(
DNBServiceTimeoutError(
'An error occurred',
),
True,
),
),
)
def test_errors(self, monkeypatch, error, expect_retry):
"""
Test the get_company_updates task retries server errors.
"""
mocked_get_company_update_page = mock.Mock(side_effect=error)
monkeypatch.setattr(
'datahub.dnb_api.tasks.update.get_company_update_page',
mocked_get_company_update_page,
)
mock_retry = mock.Mock(side_effect=Retry(exc=error))
monkeypatch.setattr(
'datahub.dnb_api.tasks.get_company_updates.retry',
mock_retry,
)
expected_exception_class = Retry if expect_retry else DNBServiceError
with pytest.raises(expected_exception_class):
get_company_updates()
@pytest.mark.parametrize(
'data',
(
{
None: {
'next': 'http://foo.bar/companies?cursor=page2',
'previous': None,
'count': 3,
'results': [
{'foo': 1},
{'bar': 2},
],
},
'http://foo.bar/companies?cursor=page2': {
'next': None,
'previous': 'http://foo.bar/companies',
'count': 3,
'results': [
{'baz': 3},
],
},
},
),
)
@pytest.mark.parametrize(
'fields_to_update',
(
None,
['foo', 'bar'],
),
)
@freeze_time('2019-01-02T2:00:00')
def test_updates(self, monkeypatch, caplog, data, fields_to_update):
"""
Test if the update_company task is called with the right parameters for all the records
spread across pages.
"""
caplog.set_level('INFO')
mock_get_company_update_page = mock.Mock(
side_effect=lambda _, next_page: data[next_page],
)
monkeypatch.setattr(
'datahub.dnb_api.tasks.update.get_company_update_page',
mock_get_company_update_page,
)
mock_update_company = mock.Mock()
monkeypatch.setattr(
'datahub.dnb_api.tasks.update.update_company_from_dnb_data',
mock_update_company,
)
task_result = get_company_updates.apply(kwargs={'fields_to_update': fields_to_update})
assert mock_get_company_update_page.call_count == 2
mock_get_company_update_page.assert_any_call(
'2019-01-01T00:00:00',
None,
)
mock_get_company_update_page.assert_any_call(
'2019-01-01T00:00:00',
'http://foo.bar/companies?cursor=page2',
)
assert mock_update_company.apply_async.call_count == 3
expected_kwargs = {
'fields_to_update': fields_to_update,
'update_descriptor': f'celery:get_company_updates:{task_result.id}',
}
mock_update_company.apply_async.assert_any_call(
args=({'foo': 1},),
kwargs=expected_kwargs,
)
mock_update_company.apply_async.assert_any_call(
args=({'bar': 2},),
kwargs=expected_kwargs,
)
mock_update_company.apply_async.assert_any_call(
args=({'baz': 3},),
kwargs=expected_kwargs,
)
assert 'get_company_updates total update count: 3' in caplog.text
@pytest.mark.parametrize(
'lock_acquired, call_count',
(
(False, 0),
(True, 1),
),
)
def test_lock(self, monkeypatch, lock_acquired, call_count):
"""
Test that the task doesn't run if it cannot acquire
the advisory_lock.
"""
mock_advisory_lock = mock.MagicMock()
mock_advisory_lock.return_value.__enter__.return_value = lock_acquired
monkeypatch.setattr(
'datahub.dnb_api.tasks.update.advisory_lock',
mock_advisory_lock,
)
mock_get_company_updates = mock.Mock()
monkeypatch.setattr(
'datahub.dnb_api.tasks.update._get_company_updates',
mock_get_company_updates,
)
get_company_updates()
assert mock_get_company_updates.call_count == call_count
@pytest.mark.parametrize(
'data',
(
# Test limit works correctly on the first page
{
None: {
'next': None,
'previous': None,
'count': 3,
'results': [
{'foo': 1},
{'bar': 2},
{'baz': 3},
],
},
},
# Test limit works correctly on the second page
{
None: {
'next': 'http://foo.bar/companies?cursor=page2',
'previous': None,
'count': 3,
'results': [
{'foo': 1},
],
},
'http://foo.bar/companies?cursor=page2': {
'next': None,
'previous': 'http://foo.bar/companies',
'count': 3,
'results': [
{'bar': 2},
{'baz': 3},
],
},
},
),
)
@freeze_time('2019-01-02T2:00:00')
@override_settings(DNB_AUTOMATIC_UPDATE_LIMIT=2)
def test_updates_max_update_limit(self, monkeypatch, data):
"""
Test if the update_company task is called with the
right parameters for all the records spread across
pages.
"""
mock_get_company_update_page = mock.Mock(
side_effect=lambda _, next_page: data[next_page],
)
monkeypatch.setattr(
'datahub.dnb_api.tasks.update.get_company_update_page',
mock_get_company_update_page,
)
mock_update_company = mock.Mock()
monkeypatch.setattr(
'datahub.dnb_api.tasks.update.update_company_from_dnb_data',
mock_update_company,
)
task_result = get_company_updates.apply()
assert mock_update_company.apply_async.call_count == 2
expected_kwargs = {
'fields_to_update': None,
'update_descriptor': f'celery:get_company_updates:{task_result.id}',
}
mock_update_company.apply_async.assert_any_call(
args=({'foo': 1},),
kwargs=expected_kwargs,
)
mock_update_company.apply_async.assert_any_call(
args=({'bar': 2},),
kwargs=expected_kwargs,
)
@mock.patch('datahub.dnb_api.tasks.update.log_to_sentry')
@freeze_time('2019-01-02T2:00:00')
def test_updates_with_update_company_from_dnb_data(
self,
mocked_log_to_sentry,
caplog,
monkeypatch,
dnb_company_updates_response_uk,
):
"""
Test full integration for the `get_company_updates` task with the
`update_company_from_dnb_data` task when all fields are updated.
"""
caplog.set_level('INFO')
company = CompanyFactory(duns_number='123456789')
mock_get_company_update_page = mock.Mock(
return_value=dnb_company_updates_response_uk,
)
monkeypatch.setattr(
'datahub.dnb_api.tasks.update.get_company_update_page',
mock_get_company_update_page,
)
task_result = get_company_updates.apply_async()
company.refresh_from_db()
dnb_company = dnb_company_updates_response_uk['results'][0]
assert company.name == dnb_company['primary_name']
expected_gu_number = dnb_company['global_ultimate_duns_number']
assert company.global_ultimate_duns_number == expected_gu_number
mocked_log_to_sentry.assert_called_with(
'get_company_updates task completed.',
extra={
'success_count': 1,
'failure_count': 0,
'updated_company_ids': [str(company.pk)],
'producer_task_id': task_result.id,
'start_time': '2019-01-02T02:00:00+00:00',
'end_time': '2019-01-02T02:00:00+00:00',
},
)
assert 'get_company_updates total update count: 1' in caplog.text
@mock.patch('datahub.dnb_api.tasks.update.log_to_sentry')
@freeze_time('2019-01-02T2:00:00')
def test_updates_with_update_company_from_dnb_data_partial_fields(
self,
mocked_log_to_sentry,
monkeypatch,
dnb_company_updates_response_uk,
):
"""
Test full integration for the `get_company_updates` task with the
`update_company_from_dnb_data` task when the fields are only partially updated.
"""
company = CompanyFactory(duns_number='123456789')
mock_get_company_update_page = mock.Mock(
return_value=dnb_company_updates_response_uk,
)
monkeypatch.setattr(
'datahub.dnb_api.tasks.update.get_company_update_page',
mock_get_company_update_page,
)
task_result = get_company_updates.apply(kwargs={'fields_to_update': ['name']})
company.refresh_from_db()
dnb_company = dnb_company_updates_response_uk['results'][0]
assert company.name == dnb_company['primary_name']
assert company.global_ultimate_duns_number == ''
mocked_log_to_sentry.assert_called_with(
'get_company_updates task completed.',
extra={
'success_count': 1,
'failure_count': 0,
'updated_company_ids': [str(company.pk)],
'producer_task_id': task_result.id,
'start_time': '2019-01-02T02:00:00+00:00',
'end_time': '2019-01-02T02:00:00+00:00',
},
)
@mock.patch('datahub.dnb_api.tasks.update.log_to_sentry')
@freeze_time('2019-01-02T2:00:00')
def test_updates_with_update_company_from_dnb_data_with_failure(
self,
mocked_log_to_sentry,
monkeypatch,
dnb_company_updates_response_uk,
):
"""
Test full integration for the `get_company_updates` task with the
`update_company_from_dnb_data` task when all fields are updated and one company in the
dnb-service result does not exist in Data Hub.
"""
company = CompanyFactory(duns_number='123456789')
missing_dnb_company = {
**dnb_company_updates_response_uk['results'][0],
'duns_number': '999999999',
}
dnb_company_updates_response_uk['results'].append(missing_dnb_company)
mock_get_company_update_page = mock.Mock(
return_value=dnb_company_updates_response_uk,
)
monkeypatch.setattr(
'datahub.dnb_api.tasks.update.get_company_update_page',
mock_get_company_update_page,
)
task_result = get_company_updates.apply()
company.refresh_from_db()
dnb_company = dnb_company_updates_response_uk['results'][0]
assert company.name == dnb_company['primary_name']
expected_gu_number = dnb_company['global_ultimate_duns_number']
assert company.global_ultimate_duns_number == expected_gu_number
mocked_log_to_sentry.assert_called_with(
'get_company_updates task completed.',
extra={
'success_count': 1,
'failure_count': 1,
'updated_company_ids': [str(company.pk)],
'producer_task_id': task_result.id,
'start_time': '2019-01-02T02:00:00+00:00',
'end_time': '2019-01-02T02:00:00+00:00',
},
)
def test_get_company_updates_feature_flag_inactive_no_updates(
monkeypatch,
):
"""
Test that when the DNB company updates feature flag is inactive, the task does not proceed.
"""
mocked_get_company_update_page = mock.Mock()
monkeypatch.setattr(
'datahub.dnb_api.tasks.update.get_company_update_page',
mocked_get_company_update_page,
)
get_company_updates()
assert mocked_get_company_update_page.call_count == 0
@freeze_time('2019-01-01 11:12:13')
def test_update_company_from_dnb_data(dnb_response_uk, base_company_dict):
"""
Test the update_company_from_dnb_data command when all DNB fields are updated.
"""
company = CompanyFactory(duns_number='123456789')
original_company = Company.objects.get(id=company.id)
update_descriptor = 'foobar'
task_result = update_company_from_dnb_data.apply_async(
args=[dnb_response_uk['results'][0]],
kwargs={'update_descriptor': update_descriptor},
)
assert task_result.successful()
company.refresh_from_db()
uk_country = Country.objects.get(iso_alpha2_code='GB')
assert model_to_dict_company(company) == {
**base_company_dict,
'address_1': 'Unit 10, Ockham Drive',
'address_2': '',
'address_country': uk_country.id,
'address_county': '',
'address_postcode': 'UB6 0F2',
'address_town': 'GREENFORD',
'archived_documents_url_path': original_company.archived_documents_url_path,
'business_type': original_company.business_type_id,
'company_number': '01261539',
'created_by': original_company.created_by_id,
'duns_number': '123456789',
'employee_range': original_company.employee_range_id,
'export_experience_category': original_company.export_experience_category_id,
'global_ultimate_duns_number': '291332174',
'id': original_company.id,
'is_number_of_employees_estimated': True,
'modified_by': original_company.modified_by_id,
'name': 'FOO BICYCLE LIMITED',
'number_of_employees': 260,
'sector': original_company.sector_id,
'turnover': 50651895,
'turnover_range': original_company.turnover_range_id,
'uk_region': original_company.uk_region_id,
'dnb_modified_on': now(),
}
versions = list(Version.objects.get_for_object(company))
assert len(versions) == 1
version = versions[0]
assert version.revision.comment == f'Updated from D&B [{update_descriptor}]'
@freeze_time('2019-01-01 11:12:13')
def test_update_company_from_dnb_data_partial_fields(dnb_response_uk, base_company_dict):
"""
Test the update_company_from_dnb_data command when a subset of DNB fields are updated.
"""
company = CompanyFactory(duns_number='123456789')
original_company = Company.objects.get(id=company.id)
task_result = update_company_from_dnb_data.apply_async(
args=[dnb_response_uk['results'][0]],
kwargs={'fields_to_update': ['global_ultimate_duns_number']},
)
assert task_result.successful()
company.refresh_from_db()
assert model_to_dict(company) == {
**base_company_dict,
'address_1': original_company.address_1,
'address_2': original_company.address_2,
'address_country': original_company.address_country_id,
'address_county': original_company.address_county,
'address_postcode': original_company.address_postcode,
'address_town': original_company.address_town,
'archived_documents_url_path': original_company.archived_documents_url_path,
'business_type': original_company.business_type_id,
'created_by': original_company.created_by_id,
'duns_number': original_company.duns_number,
'employee_range': original_company.employee_range_id,
'export_experience_category': original_company.export_experience_category_id,
'global_ultimate_duns_number': '291332174',
'id': original_company.id,
'is_number_of_employees_estimated': original_company.is_number_of_employees_estimated,
'is_turnover_estimated': original_company.is_turnover_estimated,
'modified_by': original_company.modified_by_id,
'name': original_company.name,
'number_of_employees': original_company.number_of_employees,
'registered_address_1': original_company.registered_address_1,
'registered_address_2': original_company.registered_address_2,
'registered_address_country': original_company.registered_address_country_id,
'registered_address_county': original_company.registered_address_county,
'registered_address_postcode': original_company.registered_address_postcode,
'registered_address_town': original_company.registered_address_town,
'sector': original_company.sector_id,
'trading_names': original_company.trading_names,
'turnover': original_company.turnover,
'turnover_range': original_company.turnover_range_id,
'uk_region': original_company.uk_region_id,
'website': original_company.website,
'dnb_modified_on': now(),
}
@freeze_time('2019-01-01 11:12:13')
def test_update_company_from_dnb_data_does_not_exist(dnb_response_uk, caplog):
"""
Test the update_company_from_dnb_data command when the company does not exist in Data Hub.
"""
task_result = update_company_from_dnb_data.apply_async(args=[dnb_response_uk['results'][0]])
assert not task_result.successful()
assert 'Company matching duns_number was not found' in caplog.text
@freeze_time('2019-01-01 11:12:13')
def test_update_company_from_dnb_data_fails_validation(dnb_response_uk, caplog):
"""
Test the update_company_from_dnb_data command when the company data does not pass validation
checks.
"""
CompanyFactory(duns_number='123456789')
dnb_response_uk['results'][0]['primary_name'] = 'a' * 9999
task_result = update_company_from_dnb_data.apply_async(args=[dnb_response_uk['results'][0]])
assert not task_result.successful()
assert 'Data from D&B did not pass the Data Hub validation checks.' in caplog.text
@pytest.mark.parametrize(
'existing_company_dnb_modified_on',
(
now,
None,
),
)
@freeze_time('2019-01-01 11:12:13')
def test_sync_outdated_companies_with_dnb_all_fields(
requests_mock,
dnb_response_uk,
base_company_dict,
existing_company_dnb_modified_on,
caplog,
):
"""
Test the sync_outdated_companies_with_dnb task when all fields should be synced.
"""
caplog.set_level('INFO')
if callable(existing_company_dnb_modified_on):
existing_company_dnb_modified_on = existing_company_dnb_modified_on()
requests_mock.post(
DNB_SEARCH_URL,
json=dnb_response_uk,
)
company = CompanyFactory(
duns_number='123456789',
dnb_modified_on=existing_company_dnb_modified_on,
)
original_company = Company.objects.get(id=company.id)
task_result = sync_outdated_companies_with_dnb.apply_async(
kwargs={
'dnb_modified_on_before': now() + timedelta(days=1),
'simulate': False,
},
)
assert task_result.successful()
company.refresh_from_db()
uk_country = Country.objects.get(iso_alpha2_code='GB')
assert model_to_dict_company(company) == {
**base_company_dict,
'address_1': 'Unit 10, Ockham Drive',
'address_2': '',
'address_country': uk_country.id,
'address_county': '',
'address_postcode': 'UB6 0F2',
'address_town': 'GREENFORD',
'archived_documents_url_path': original_company.archived_documents_url_path,
'business_type': original_company.business_type_id,
'company_number': '01261539',
'created_by': original_company.created_by_id,
'duns_number': '123456789',
'employee_range': original_company.employee_range_id,
'export_experience_category': original_company.export_experience_category_id,
'global_ultimate_duns_number': '291332174',
'id': original_company.id,
'is_number_of_employees_estimated': True,
'modified_by': original_company.modified_by_id,
'name': 'FOO BICYCLE LIMITED',
'number_of_employees': 260,
'sector': original_company.sector_id,
'turnover': 50651895,
'turnover_range': original_company.turnover_range_id,
'uk_region': original_company.uk_region_id,
'dnb_modified_on': now(),
}
expected_message = f'Syncing dnb-linked company "{company.id}" Succeeded'
assert expected_message in caplog.text
@pytest.mark.parametrize(
'existing_company_dnb_modified_on',
(
now,
None,
),
)
@freeze_time('2019-01-01 11:12:13')
def test_sync_outdated_companies_with_dnb_partial_fields(
requests_mock,
dnb_response_uk,
base_company_dict,
existing_company_dnb_modified_on,
caplog,
):
"""
Test the sync_outdated_companies_with_dnb task when only a subset of fields should be synced.
"""
caplog.set_level('INFO')
if callable(existing_company_dnb_modified_on):
existing_company_dnb_modified_on = existing_company_dnb_modified_on()
requests_mock.post(
DNB_SEARCH_URL,
json=dnb_response_uk,
)
company = CompanyFactory(
duns_number='123456789',
dnb_modified_on=existing_company_dnb_modified_on,
)
original_company = Company.objects.get(id=company.id)
task_result = sync_outdated_companies_with_dnb.apply_async(
kwargs={
'fields_to_update': ['global_ultimate_duns_number'],
'dnb_modified_on_before': now() + timedelta(days=1),
'simulate': False,
},
)
assert task_result.successful()
company.refresh_from_db()
assert model_to_dict(company) == {
**base_company_dict,
'address_1': original_company.address_1,
'address_2': original_company.address_2,
'address_country': original_company.address_country_id,
'address_county': original_company.address_county,
'address_postcode': original_company.address_postcode,
'address_town': original_company.address_town,
'archived_documents_url_path': original_company.archived_documents_url_path,
'business_type': original_company.business_type_id,
'company_number': original_company.company_number,
'created_by': original_company.created_by_id,
'duns_number': original_company.duns_number,
'employee_range': original_company.employee_range_id,
'export_experience_category': original_company.export_experience_category_id,
'global_ultimate_duns_number': '291332174',
'id': original_company.id,
'is_number_of_employees_estimated': original_company.is_number_of_employees_estimated,
'is_turnover_estimated': original_company.is_turnover_estimated,
'modified_by': original_company.modified_by_id,
'name': original_company.name,
'number_of_employees': original_company.number_of_employees,
'registered_address_1': original_company.registered_address_1,
'registered_address_2': original_company.registered_address_2,
'registered_address_country': original_company.registered_address_country_id,
'registered_address_county': original_company.registered_address_county,
'registered_address_postcode': original_company.registered_address_postcode,
'registered_address_town': original_company.registered_address_town,
'sector': original_company.sector_id,
'trading_names': original_company.trading_names,
'turnover': original_company.turnover,
'turnover_range': original_company.turnover_range_id,
'uk_region': original_company.uk_region_id,
'website': original_company.website,
'dnb_modified_on': now(),
}
expected_message = f'Syncing dnb-linked company "{company.id}" Succeeded'
assert expected_message in caplog.text
@freeze_time('2019-01-01 11:12:13')
def test_sync_outdated_companies_limit_least_recently_synced_is_updated(
requests_mock,
dnb_response_uk,
):
"""
Test that running sync_outdated_companies_with_dnb with a limit will update
the least recently synced company.
"""
requests_mock.post(
DNB_SEARCH_URL,
json=dnb_response_uk,
)
company_1 = CompanyFactory(
duns_number='123456788',
dnb_modified_on=now() - timedelta(days=1),
)
original_company_1 = Company.objects.get(id=company_1.id)
company_2 = CompanyFactory(
duns_number='123456789',
dnb_modified_on=now() - timedelta(days=2),
)
task_result = sync_outdated_companies_with_dnb.apply_async(
kwargs={
'fields_to_update': ['global_ultimate_duns_number'],
'dnb_modified_on_before': now() + timedelta(days=1),
'simulate': False,
'limit': 1,
},
)
assert task_result.successful()
company_1.refresh_from_db()
company_2.refresh_from_db()
# We expect company_1 to be unmodified
assert company_1.dnb_modified_on == original_company_1.dnb_modified_on
# We expect company_2 to be modified, as it was least recently synced with D&B
assert company_2.dnb_modified_on == now()
@freeze_time('2019-01-01 11:12:13')
def test_sync_outdated_companies_limit_most_recently_interacted_updated(
requests_mock,
dnb_response_uk,
):
"""
Test that running sync_outdated_companies_with_dnb with a limit will update
the most recently interacted company.
"""
requests_mock.post(
DNB_SEARCH_URL,
json=dnb_response_uk,
)
company_most_recent_interaction = CompanyFactory(
duns_number='123456789',
dnb_modified_on=now() - timedelta(days=1),
)
CompanyInteractionFactory(company=company_most_recent_interaction, date=now())
company_least_recent_interaction = CompanyFactory(
duns_number='123456788',
dnb_modified_on=now() - timedelta(days=1),
)
CompanyInteractionFactory(
company=company_least_recent_interaction,
date=now() - timedelta(days=1),
)
task_result = sync_outdated_companies_with_dnb.apply_async(
kwargs={
'fields_to_update': ['global_ultimate_duns_number'],
'dnb_modified_on_before': now() + timedelta(days=1),
'simulate': False,
'limit': 1,
},
)
company_least_recent_interaction.refresh_from_db()
company_most_recent_interaction.refresh_from_db()
assert task_result.successful()
# We expect the least recently interacted company to be unmodified
assert company_least_recent_interaction.dnb_modified_on == now() - timedelta(days=1)
# We expect most recently interacted company to be modified
assert company_most_recent_interaction.dnb_modified_on == now()
@freeze_time('2019-01-01 11:12:13')
def test_sync_outdated_companies_nothing_to_update(
requests_mock,
dnb_response_uk,
):
"""
Add two companies (one with dnb_modified_on>dnb_modified_on_before) and
assert that only the outdated one is synced.
"""
company = CompanyFactory(
duns_number='123456789',
dnb_modified_on=now() - timedelta(days=5),
)
original_company = Company.objects.get(id=company.id)
task_result = sync_outdated_companies_with_dnb.apply_async(
kwargs={
'fields_to_update': ['global_ultimate_duns_number'],
'dnb_modified_on_before': now() - timedelta(days=1),
'simulate': False,
'limit': 1,
},
)
assert task_result.successful()
company.refresh_from_db()
# We expect the company to be unmodified
assert company.dnb_modified_on == original_company.dnb_modified_on
@freeze_time('2019-01-01 11:12:13')
def test_sync_outdated_companies_simulation(caplog):
"""
Test that using simulation mode does not modify companies and logs correctly.
"""
caplog.set_level('INFO')
company = CompanyFactory(
duns_number='123456789',
dnb_modified_on=now() - timedelta(days=5),
)
original_company = Company.objects.get(id=company.id)
task_result = sync_outdated_companies_with_dnb.apply_async(
kwargs={
'fields_to_update': ['global_ultimate_duns_number'],
'dnb_modified_on_before': now() - timedelta(days=1),
},
)
assert task_result.successful()
company.refresh_from_db()
# We expect the company to be unmodified
assert company.dnb_modified_on == original_company.dnb_modified_on
expected_message = f'[SIMULATION] Syncing dnb-linked company "{company.id}" Succeeded'
assert expected_message in caplog.text
@freeze_time('2019-01-01 11:12:13')
def test_sync_outdated_companies_sync_task_failure_logs_error(caplog, monkeypatch):
"""
Test that when the sync_company_with_dnb sub-task fails, an error log is
generated.
"""
caplog.set_level('WARNING')
company = CompanyFactory(
duns_number='123456789',
dnb_modified_on=now() - timedelta(days=5),
)
mocked_sync_company_with_dnb = mock.Mock(side_effect=Exception())
monkeypatch.setattr(
'datahub.dnb_api.tasks.sync_company_with_dnb.apply',
mocked_sync_company_with_dnb,
)
task_result = sync_outdated_companies_with_dnb.apply_async(
kwargs={
'fields_to_update': ['global_ultimate_duns_number'],
'dnb_modified_on_before': now() - timedelta(days=1),
'simulate': False,
},
)
assert task_result.successful()
expected_message = f'Syncing dnb-linked company "{company.id}" Failed'
assert expected_message in caplog.text
| 37.192982
| 97
| 0.657522
| 4,604
| 40,280
| 5.355995
| 0.0745
| 0.080904
| 0.023724
| 0.020277
| 0.864025
| 0.831137
| 0.804818
| 0.773957
| 0.767549
| 0.749382
| 0
| 0.029165
| 0.248361
| 40,280
| 1,082
| 98
| 37.227357
| 0.785309
| 0.071127
| 0
| 0.693495
| 0
| 0
| 0.199193
| 0.076902
| 0
| 0
| 0
| 0
| 0.06505
| 1
| 0.025358
| false
| 0.001103
| 0.020948
| 0
| 0.047409
| 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
|
b7da3fe30b4e183542a4534ffa1fb592f0ca447a
| 4,441
|
py
|
Python
|
panel/tests/template/test_vanilla_manual.py
|
datalayer-contrib/holoviz-panel
|
c97b57e8eaff4b5f542add41f496395da2483b23
|
[
"BSD-3-Clause"
] | 1,130
|
2019-11-23T09:53:37.000Z
|
2022-03-31T11:30:07.000Z
|
panel/tests/template/test_vanilla_manual.py
|
datalayer-contrib/holoviz-panel
|
c97b57e8eaff4b5f542add41f496395da2483b23
|
[
"BSD-3-Clause"
] | 2,265
|
2019-11-20T17:09:09.000Z
|
2022-03-31T22:09:38.000Z
|
panel/tests/template/test_vanilla_manual.py
|
datalayer-contrib/holoviz-panel
|
c97b57e8eaff4b5f542add41f496395da2483b23
|
[
"BSD-3-Clause"
] | 215
|
2019-11-26T11:49:04.000Z
|
2022-03-30T10:23:11.000Z
|
import panel as pn
import numpy as np
import holoviews as hv
LOGO = "https://panel.holoviz.org/_static/logo_horizontal.png"
def test_vanilla_with_sidebar():
"""Returns an app that uses the vanilla template in various ways.
Inspect the app and verify that the issues of [Issue 1641]\
(https://github.com/holoviz/panel/issues/1641) have been solved
- Navbar is "sticky"/ fixed to the top
- Navbar supports adding header items to left, center and right
- There is a nice padding/ margin everywhere
- Independent scroll for sidebar and main
- Only vertical scrollbars
"""
vanilla = pn.template.VanillaTemplate(
title="Vanilla Template",
logo=LOGO,
)
xs = np.linspace(0, np.pi)
freq = pn.widgets.FloatSlider(name="Frequency", start=0, end=10, value=2)
phase = pn.widgets.FloatSlider(name="Phase", start=0, end=np.pi)
@pn.depends(freq=freq, phase=phase)
def sine(freq, phase):
return hv.Curve((xs, np.sin(xs * freq + phase))).opts(responsive=True, min_height=400)
@pn.depends(freq=freq, phase=phase)
def cosine(freq, phase):
return hv.Curve((xs, np.cos(xs * freq + phase))).opts(responsive=True, min_height=400)
vanilla.sidebar.append(freq)
vanilla.sidebar.append(phase)
vanilla.sidebar.append(pn.pane.Markdown(test_vanilla_with_sidebar.__doc__))
vanilla.sidebar.append(pn.pane.Markdown("## Sidebar Item\n" * 50))
vanilla.main.append(
pn.Row(
pn.Card(hv.DynamicMap(sine), title="Sine"),
pn.Card(hv.DynamicMap(cosine), title="Cosine"),
)
)
vanilla.main.append(
pn.Row(
pn.Card(hv.DynamicMap(sine), title="Sine"),
pn.Card(hv.DynamicMap(cosine), title="Cosine"),
)
)
vanilla.header[:] = [
pn.Row(
pn.widgets.Button(name="Left", sizing_mode="fixed", width=50),
pn.layout.HSpacer(),
pn.widgets.Button(name="Center", sizing_mode="fixed", width=50),
pn.layout.HSpacer(),
pn.widgets.Button(name="Right", sizing_mode="fixed", width=50),
)
]
vanilla.main_max_width = "600px"
return vanilla
def test_vanilla_with_no_sidebar():
"""Returns an app that uses the vanilla template in various ways.
Inspect the app and verify that the issues of [Issue 1641]\
(https://github.com/holoviz/panel/issues/1641) have been solved
- Navbar is "sticky"/ fixed to the top
- Navbar supports adding header items to left, center and right
- There is a nice padding/ margin everywhere
- Independent scroll for sidebar and main
- Only vertical scrollbars
"""
vanilla = pn.template.VanillaTemplate(
title="Vanilla Template",
logo=LOGO,
favicon="https://raw.githubusercontent.com/MarcSkovMadsen/awesome-panel/2781d86d4ed141889d633748879a120d7d8e777a/assets/images/favicon.ico",
)
xs = np.linspace(0, np.pi)
freq = pn.widgets.FloatSlider(name="Frequency", start=0, end=10, value=2)
phase = pn.widgets.FloatSlider(name="Phase", start=0, end=np.pi)
@pn.depends(freq=freq, phase=phase)
def sine(freq, phase):
return hv.Curve((xs, np.sin(xs * freq + phase))).opts(responsive=True, min_height=400)
@pn.depends(freq=freq, phase=phase)
def cosine(freq, phase):
return hv.Curve((xs, np.cos(xs * freq + phase))).opts(responsive=True, min_height=400)
vanilla.main.append(freq)
vanilla.main.append(phase)
vanilla.main.append(pn.pane.Markdown(test_vanilla_with_no_sidebar.__doc__))
vanilla.main.append(
pn.Row(
pn.Card(hv.DynamicMap(sine), title="Sine"),
pn.Card(hv.DynamicMap(cosine), title="Cosine"),
)
)
vanilla.main.append(
pn.Row(
pn.Card(hv.DynamicMap(sine), title="Sine"),
pn.Card(hv.DynamicMap(cosine), title="Cosine"),
)
)
vanilla.header[:] = [
pn.Row(
pn.widgets.Button(name="Left", sizing_mode="fixed", width=50),
pn.layout.HSpacer(),
pn.widgets.Button(name="Center", sizing_mode="fixed", width=50),
pn.layout.HSpacer(),
pn.widgets.Button(name="Right", sizing_mode="fixed", width=50),
)
]
vanilla.main_max_width = "600px"
return vanilla
if __name__.startswith("bokeh"):
pn.extension(sizing_mode="stretch_width")
test_vanilla_with_sidebar().servable()
# test_vanilla_with_no_sidebar().servable()
| 34.426357
| 148
| 0.653231
| 591
| 4,441
| 4.822335
| 0.22335
| 0.037895
| 0.022456
| 0.050526
| 0.842807
| 0.825263
| 0.808421
| 0.78386
| 0.78386
| 0.78386
| 0
| 0.025612
| 0.208737
| 4,441
| 128
| 149
| 34.695313
| 0.78543
| 0.191398
| 0
| 0.651685
| 0
| 0.011236
| 0.108282
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.067416
| false
| 0
| 0.033708
| 0.044944
| 0.168539
| 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
|
b7f134c6a936100819550db26ef9de3764c1ebf8
| 18
|
py
|
Python
|
acq4/devices/PMT/__init__.py
|
aleonlein/acq4
|
4b1fcb9ad2c5e8d4595a2b9cf99d50ece0c0f555
|
[
"MIT"
] | 1
|
2020-06-04T17:04:53.000Z
|
2020-06-04T17:04:53.000Z
|
acq4/devices/PMT/__init__.py
|
aleonlein/acq4
|
4b1fcb9ad2c5e8d4595a2b9cf99d50ece0c0f555
|
[
"MIT"
] | 24
|
2016-09-27T17:25:24.000Z
|
2017-03-02T21:00:11.000Z
|
acq4/devices/PMT/__init__.py
|
sensapex/acq4
|
9561ba73caff42c609bd02270527858433862ad8
|
[
"MIT"
] | 4
|
2016-10-19T06:39:36.000Z
|
2019-09-30T21:06:45.000Z
|
from PMT import *
| 9
| 17
| 0.722222
| 3
| 18
| 4.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 18
| 1
| 18
| 18
| 0.928571
| 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
|
4d1df5a163e1ba467850998180e7b324cde3a88a
| 45
|
py
|
Python
|
petalisp/__init__.py
|
marcoheisig/petalisp-for-python
|
6e388d8bbd3dd2b22650a232064b0783bc6048e7
|
[
"MIT"
] | 7
|
2019-12-21T07:26:47.000Z
|
2021-09-28T19:11:23.000Z
|
petalisp/__init__.py
|
marcoheisig/petalisp-for-python
|
6e388d8bbd3dd2b22650a232064b0783bc6048e7
|
[
"MIT"
] | null | null | null |
petalisp/__init__.py
|
marcoheisig/petalisp-for-python
|
6e388d8bbd3dd2b22650a232064b0783bc6048e7
|
[
"MIT"
] | null | null | null |
from .ndarray import ndarray, array, compute
| 22.5
| 44
| 0.8
| 6
| 45
| 6
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 45
| 1
| 45
| 45
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
4d3460ada3eb577619d40d3bc1fa717cbd046ec0
| 31
|
py
|
Python
|
module2/snippets/__init__.py
|
newnativeabq/DS-Unit-2-Kaggle-Challenge
|
cc57b171c0b0ec031f63446be67cbffc1600ae10
|
[
"MIT"
] | 1
|
2019-08-13T15:22:14.000Z
|
2019-08-13T15:22:14.000Z
|
module2/snippets/__init__.py
|
newnativeabq/DS-Unit-2-Kaggle-Challenge
|
cc57b171c0b0ec031f63446be67cbffc1600ae10
|
[
"MIT"
] | null | null | null |
module2/snippets/__init__.py
|
newnativeabq/DS-Unit-2-Kaggle-Challenge
|
cc57b171c0b0ec031f63446be67cbffc1600ae10
|
[
"MIT"
] | null | null | null |
from os import path
import wget
| 15.5
| 19
| 0.83871
| 6
| 31
| 4.333333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16129
| 31
| 2
| 20
| 15.5
| 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
|
4d3b8b0d6b6cf2fbb5048096488f39dd16ae9e94
| 89
|
py
|
Python
|
tests/test_script.py
|
mikhailshaganov/pyscript
|
4e27e02adc3069004ffbfee697d3b2de9d214207
|
[
"MIT"
] | null | null | null |
tests/test_script.py
|
mikhailshaganov/pyscript
|
4e27e02adc3069004ffbfee697d3b2de9d214207
|
[
"MIT"
] | null | null | null |
tests/test_script.py
|
mikhailshaganov/pyscript
|
4e27e02adc3069004ffbfee697d3b2de9d214207
|
[
"MIT"
] | 1
|
2022-02-16T10:09:00.000Z
|
2022-02-16T10:09:00.000Z
|
def main():
return "foo"
def failure():
raise RuntimeError("This is an error")
| 12.714286
| 42
| 0.629213
| 12
| 89
| 4.666667
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.235955
| 89
| 6
| 43
| 14.833333
| 0.823529
| 0
| 0
| 0
| 0
| 0
| 0.213483
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0
| 0
| 0.25
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 1
| 0
|
0
| 6
|
4dbe216a1749c292d85ec471a4f3142bb7d4a572
| 260
|
py
|
Python
|
emtex_common_utils/__init__.py
|
am1ty9d9v/emtex_common_utils
|
deb46b44a649563483473a0bb799be8158035e23
|
[
"BSD-3-Clause"
] | null | null | null |
emtex_common_utils/__init__.py
|
am1ty9d9v/emtex_common_utils
|
deb46b44a649563483473a0bb799be8158035e23
|
[
"BSD-3-Clause"
] | null | null | null |
emtex_common_utils/__init__.py
|
am1ty9d9v/emtex_common_utils
|
deb46b44a649563483473a0bb799be8158035e23
|
[
"BSD-3-Clause"
] | null | null | null |
from threading import local
__version__ = '0.4'
__thread_locals = local()
def get_current_user():
return getattr(__thread_locals, 'emtex_user', 'AnonymousUser')
def set_current_user(user_email):
setattr(__thread_locals, 'emtex_user', user_email)
| 18.571429
| 66
| 0.761538
| 34
| 260
| 5.205882
| 0.588235
| 0.20339
| 0.19209
| 0.237288
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008889
| 0.134615
| 260
| 13
| 67
| 20
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0.138462
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0.142857
| 0.571429
| 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
|
4dc4676cc1d84267195c4ef0af83df15ed9f6217
| 21
|
py
|
Python
|
evesso/__init__.py
|
mobiusxs/evesso
|
802cd257336d35a171293b5812c5367afdbcbd85
|
[
"MIT"
] | null | null | null |
evesso/__init__.py
|
mobiusxs/evesso
|
802cd257336d35a171293b5812c5367afdbcbd85
|
[
"MIT"
] | null | null | null |
evesso/__init__.py
|
mobiusxs/evesso
|
802cd257336d35a171293b5812c5367afdbcbd85
|
[
"MIT"
] | null | null | null |
from .sso import SSO
| 10.5
| 20
| 0.761905
| 4
| 21
| 4
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.190476
| 21
| 1
| 21
| 21
| 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
|
4dde454130ab8a7a87896a83023a53721de84f3e
| 850
|
py
|
Python
|
alpyro_msgs/tf/tfmessage.py
|
rho2/alpyro_msgs
|
b5a680976c40c83df70d61bb2db1de32a1cde8d3
|
[
"MIT"
] | 1
|
2020-12-13T13:07:10.000Z
|
2020-12-13T13:07:10.000Z
|
alpyro_msgs/tf/tfmessage.py
|
rho2/alpyro_msgs
|
b5a680976c40c83df70d61bb2db1de32a1cde8d3
|
[
"MIT"
] | null | null | null |
alpyro_msgs/tf/tfmessage.py
|
rho2/alpyro_msgs
|
b5a680976c40c83df70d61bb2db1de32a1cde8d3
|
[
"MIT"
] | null | null | null |
from typing import List
from typing_extensions import Annotated
from alpyro_msgs import RosMessage
from alpyro_msgs.geometry_msgs.transformstamped import TransformStamped
class tfMessage(RosMessage):
__msg_typ__ = "tf/tfMessage"
__msg_def__ = "Z2VvbWV0cnlfbXNncy9UcmFuc2Zvcm1TdGFtcGVkW10gdHJhbnNmb3JtcwogIHN0ZF9tc2dzL0hlYWRlciBoZWFkZXIKICAgIHVpbnQzMiBzZXEKICAgIHRpbWUgc3RhbXAKICAgIHN0cmluZyBmcmFtZV9pZAogIHN0cmluZyBjaGlsZF9mcmFtZV9pZAogIGdlb21ldHJ5X21zZ3MvVHJhbnNmb3JtIHRyYW5zZm9ybQogICAgZ2VvbWV0cnlfbXNncy9WZWN0b3IzIHRyYW5zbGF0aW9uCiAgICAgIGZsb2F0NjQgeAogICAgICBmbG9hdDY0IHkKICAgICAgZmxvYXQ2NCB6CiAgICBnZW9tZXRyeV9tc2dzL1F1YXRlcm5pb24gcm90YXRpb24KICAgICAgZmxvYXQ2NCB4CiAgICAgIGZsb2F0NjQgeQogICAgICBmbG9hdDY0IHoKICAgICAgZmxvYXQ2NCB3Cgo="
__md5_sum__ = "94810edda583a504dfda3829e70d7eec"
transforms: Annotated[List[TransformStamped], 0, 0]
| 65.384615
| 510
| 0.923529
| 41
| 850
| 18.682927
| 0.560976
| 0.02611
| 0.036554
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.101485
| 0.049412
| 850
| 12
| 511
| 70.833333
| 0.846535
| 0
| 0
| 0
| 0
| 0
| 0.630588
| 0.616471
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.444444
| 0
| 1
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
1290c49aa10f380de2235fa6bc74327e05622e0d
| 204
|
py
|
Python
|
test/python/utils.py
|
adonmo/meos
|
123d138f1fda8a65a4e09b5e74d51cfd4e69287e
|
[
"MIT"
] | 13
|
2020-09-14T07:02:50.000Z
|
2022-03-31T08:07:33.000Z
|
test/python/utils.py
|
adonmo/meos
|
123d138f1fda8a65a4e09b5e74d51cfd4e69287e
|
[
"MIT"
] | 25
|
2020-07-11T21:10:18.000Z
|
2020-11-10T20:32:56.000Z
|
test/python/utils.py
|
adonmo/meos
|
123d138f1fda8a65a4e09b5e74d51cfd4e69287e
|
[
"MIT"
] | 1
|
2020-09-17T14:31:05.000Z
|
2020-09-17T14:31:05.000Z
|
import datetime
def unix_dt(year, month, day, hour=0, minute=0, second=0, microsecond=0):
return datetime.datetime(year, month, day, hour, minute, second, microsecond, tzinfo=datetime.timezone.utc)
| 34
| 111
| 0.75
| 30
| 204
| 5.066667
| 0.566667
| 0.118421
| 0.157895
| 0.210526
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022346
| 0.122549
| 204
| 5
| 112
| 40.8
| 0.826816
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 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
| 1
| 1
| 1
| 0
|
0
| 6
|
12b7945cae9cdab5f76e1805410f924956d5df84
| 18,605
|
py
|
Python
|
thor/testing/orbit_testing.py
|
B612-Asteroid-Institute/thor
|
d3d1dcbe86f67a62c90b4cde3fc577e414825cf2
|
[
"BSD-3-Clause"
] | null | null | null |
thor/testing/orbit_testing.py
|
B612-Asteroid-Institute/thor
|
d3d1dcbe86f67a62c90b4cde3fc577e414825cf2
|
[
"BSD-3-Clause"
] | null | null | null |
thor/testing/orbit_testing.py
|
B612-Asteroid-Institute/thor
|
d3d1dcbe86f67a62c90b4cde3fc577e414825cf2
|
[
"BSD-3-Clause"
] | null | null | null |
import numpy as np
from astropy import units as u
__all__ = [
"testCartesianOrbits",
"testKeplerianOrbits",
"testCometaryOrbits",
"testOrbits",
]
def __statsToErrorMessage(stats, message):
"""
Helper function that adds the stats derived from _evaluateDifference
to an error message.
"""
for stat, value in stats.items():
message += (" {:<7}: {}\n".format(stat, value.T))
message += "\n"
return message
def _evaluateDifference(
actual,
desired,
unit,
tol,
magnitude=False
):
"""
Calculate the absolute difference between actual and desired
and return it in the same units of the given tolerance with
some summary statistics on the absolute difference.
Paramters
---------
actual : `~numpy.ndarray` (N, M)
Array of computed values.
desired : `~numpy.ndarray` (N, M)
Array of desired values.
unit : `astropy.units.core.Unit`
Units in which both arrays are expressed. Must be the same.
tol : `~astropy.units.quantity.Quantity` (1)
The tolerance to which the absolute difference will be evaluated
to. Used purely to convert the absolute differences to the same
units as the tolerance.
Returns
-------
diff : `~astropy.units.quantity.Quantity` (N, M)
|actual - desired| in units of the given tolerance.
stats : dict
"Mean" : mean difference per M dimension
"Median" : median difference per M dimension
"Min" : minimum difference per M dimension
"Max" : maximum difference per M dimension
"Argmin" : location of minimum difference per M dimension
"Argmax" : location of maximum difference per M dimension
error : bool
True if diff is not within the desired tolerance.
"""
error = False
diff = np.abs(actual - desired) * unit
diff = diff.to(tol.unit)
if magnitude:
diff = np.linalg.norm(diff, axis=1)
diff = diff[:, np.newaxis]
tol_ = np.empty_like(diff)
tol_.fill(tol)
stats = {
"Mean" : np.mean(diff, axis=0),
"Median" : np.median(diff, axis=0),
"Std" : np.std(diff, axis=0),
"Min" : np.min(diff, axis=0),
"Max" : np.max(diff, axis=0),
"Argmin" : np.argmin(diff, axis=0),
"Argmax" : np.argmax(diff, axis=0)
}
try:
np.testing.assert_array_less(
diff.to(tol.unit),
tol_.to(tol.unit),
)
except AssertionError as e:
error = True
return diff, stats, error
def testCartesianOrbits(
orbits_actual,
orbits_desired,
position_tol=1*u.m,
velocity_tol=(1*u.mm/u.s),
magnitude=True,
raise_error=True
):
"""
Tests that the two sets of cartesian orbits are within the desired absolute tolerances
of each other. The absolute difference is calculated as |actual - desired|.
Parameters
----------
orbits_actual : `~numpy.ndarray` (N, 6)
Array of orbits to compare to the desired orbits.
Assumed units for:
positions : AU,
velocities : AU per day
orbits_desired : `~numpy.ndarray` (N, 6)
Array of desired orbits to which to compare the actual orbits to.
Assumed units for:
positions : AU,
velocities : AU per day
orbit_type : {'cartesian', 'keplerian', 'cometary'}
Type of the input orbits. Both actual and desired orbits must be of the same
type.
position_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance positions need to satisfy (x, y, z, r).
velocity_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance velocity need to satisfy. (vx, vy, vz, v).
magnitude : bool
Test the magnitude of the position difference
and velocity difference vectors as opposed to testing per individual coordinate.
Raises
------
AssertionError:
If |orbits_actual - orbits_desired| > tolerance.
Returns
-------
None
"""
any_error = False
error_message = "\n"
differences = {}
statistics = {}
# Test positions
if magnitude:
names = ["r"]
else:
names = ["x", "y", "z"]
diff, stats, error = _evaluateDifference(
orbits_actual[:, :3],
orbits_desired[:, :3],
u.AU,
position_tol,
magnitude=magnitude
)
for i, n in enumerate(names):
differences[n] = diff[:, i]
statistics[n] = {k : v[i] for k, v in stats.items()}
# If any of the differences between desired and actual are
# greater than the allowed tolerance set any_error to True
# and build the error message
if error:
any_error = True
error_message += "{} difference (|actual - desired|) is not within {}.\n".format(", ".join(names), position_tol)
error_message = __statsToErrorMessage(
stats,
error_message
)
# Test velocities
if magnitude:
names = ["v"]
else:
names = ["vx", "vy", "vz"]
diff, stats, error = _evaluateDifference(
orbits_actual[:, 3:],
orbits_desired[:, 3:],
(u.AU / u.d),
velocity_tol,
magnitude=magnitude
)
for i, n in enumerate(names):
differences[n] = diff[:, i]
statistics[n] = {k : v[i] for k, v in stats.items()}
# If any of the differences between desired and actual are
# greater than the allowed tolerance set any_error to True
# and build the error message
if error:
any_error = True
error_message += "{} difference (|actual - desired|) is not within {}.\n".format(", ".join(names), velocity_tol)
error_message = __statsToErrorMessage(
stats,
error_message
)
if any_error and raise_error:
raise AssertionError(error_message)
return differences, statistics, error
def testKeplerianOrbits(
orbits_actual,
orbits_desired,
position_tol=1*u.m,
unitless_tol=1e-10*u.dimensionless_unscaled,
angle_tol=1e-10*u.degree,
raise_error=True
):
"""
Tests that the two sets of keplerian orbits are within the desired absolute tolerances
of each other. The absolute difference is calculated as |actual - desired|.
Parameters
----------
orbits_actual : `~numpy.ndarray` (N, 6)
Array of orbits to compare to the desired orbits.
Assumed units for:
positions : AU,
angles : degrees
orbits_desired : `~numpy.ndarray` (N, 6)
Array of desired orbits to which to compare the actual orbits to.
Assumed units for:
positions : AU,
angles : degrees
position_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance positions need to satisfy (a).
unitless_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance unitless quantities need to satisfy (e).
angle_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance angle quantities need to satisfy (i, ascNode, argPeri, meanAnom).
Raises
------
AssertionError:
If |orbits_actual - orbits_desired| > tolerance.
Returns
-------
None
"""
any_error = False
error_message = "\n"
differences = {}
statistics = {}
# Test positions
names = ["a"]
diff, stats, error = _evaluateDifference(
orbits_actual[:, :1],
orbits_desired[:, :1],
u.AU,
position_tol,
magnitude=False
)
for i, n in enumerate(names):
differences[n] = diff[:, i]
statistics[n] = {k : v[i] for k, v in stats.items()}
# If any of the differences between desired and actual are
# greater than the allowed tolerance set any_error to True
# and build the error message
if error:
any_error = True
error_message += "{} difference (|actual - desired|) is not within {}.\n".format(", ".join(names), position_tol)
error_message = __statsToErrorMessage(
stats,
error_message
)
# Test unitless (eccentricity)
names = ["e"]
diff, stats, error = _evaluateDifference(
orbits_actual[:, 1:2],
orbits_desired[:, 1:2],
u.dimensionless_unscaled,
unitless_tol,
magnitude=False
)
for i, n in enumerate(names):
differences[n] = diff[:, i]
statistics[n] = {k : v[i] for k, v in stats.items()}
# If any of the differences between desired and actual are
# greater than the allowed tolerance set any_error to True
# and build the error message
if error:
any_error = True
error_message += "{} difference (|actual - desired|) is not within {}.\n".format(", ".join(names), unitless_tol)
error_message = __statsToErrorMessage(
stats,
error_message
)
# Test angles
names = ["i", "ascNode", "argPeri", "meanAnom"]
diff, stats, error = _evaluateDifference(
orbits_actual[:, 2:],
orbits_desired[:, 2:],
u.degree,
angle_tol,
magnitude=False
)
for i, n in enumerate(names):
differences[n] = diff[:, i]
statistics[n] = {k : v[i] for k, v in stats.items()}
# If any of the differences between desired and actual are
# greater than the allowed tolerance set any_error to True
# and build the error message
if error:
any_error = True
error_message += "{} difference (|actual - desired|) is not within {}.\n".format(", ".join(names), angle_tol)
error_message = __statsToErrorMessage(
stats,
error_message
)
if any_error and raise_error:
raise AssertionError(error_message)
return diff, stats, error
def testCometaryOrbits(
orbits_actual,
orbits_desired,
position_tol=1*u.m,
unitless_tol=1e-10*u.dimensionless_unscaled,
angle_tol=1e-10*u.degree,
time_tol=1e-6*u.s,
raise_error=True
):
"""
Tests that the two sets of cometary orbits are within the desired absolute tolerances
of each other. The absolute difference is calculated as |actual - desired|.
Parameters
----------
orbits_actual : `~numpy.ndarray` (N, 6)
Array of orbits to compare to the desired orbits.
Assumed units for:
positions : AU,
velocities : AU per day,
angles : degrees,
times : days
orbits_desired : `~numpy.ndarray` (N, 6)
Array of desired orbits to which to compare the actual orbits to.
Assumed units for:
positions : AU,
velocities : AU per day,
angles : degrees,
times : days
position_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance positions need to satisfy (q).
unitless_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance unitless quantities need to satisfy (e).
angle_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance angle quantities need to satisfy (i, ascNode, argPeri).
time_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance time quantities need to satisfy (tPeri).
Raises
------
AssertionError:
If |orbits_actual - orbits_desired| > tolerance.
Returns
-------
None
"""
any_error = False
error_message = "\n"
differences = {}
statistics = {}
# Test positions
names = ["q"]
diff, stats, error = _evaluateDifference(
orbits_actual[:, :1],
orbits_desired[:, :1],
u.AU,
position_tol,
magnitude=False
)
for i, n in enumerate(names):
differences[n] = diff[:, i]
statistics[n] = {k : v[i] for k, v in stats.items()}
# If any of the differences between desired and actual are
# greater than the allowed tolerance set any_error to True
# and build the error message
if error:
any_error = True
error_message += "{} difference (|actual - desired|) is not within {}.\n".format(", ".join(names), position_tol)
error_message = __statsToErrorMessage(
stats,
error_message
)
# Test unitless (eccentricity)
names = ["e"]
diff, stats, error = _evaluateDifference(
orbits_actual[:, 1:2],
orbits_desired[:, 1:2],
u.dimensionless_unscaled,
unitless_tol,
magnitude=False
)
for i, n in enumerate(names):
differences[n] = diff[:, i]
statistics[n] = {k : v[i] for k, v in stats.items()}
# If any of the differences between desired and actual are
# greater than the allowed tolerance set any_error to True
# and build the error message
if error:
any_error = True
error_message += "{} difference (|actual - desired|) is not within {}.\n".format(", ".join(names), unitless_tol)
error_message = __statsToErrorMessage(
stats,
error_message
)
# Test angles
names = ["i", "ascNode", "argPeri"]
diff, stats, error = _evaluateDifference(
orbits_actual[:, 2:5],
orbits_desired[:, 2:5],
u.degree,
angle_tol,
magnitude=False
)
for i, n in enumerate(names):
differences[n] = diff[:, i]
statistics[n] = {k : v[i] for k, v in stats.items()}
# If any of the differences between desired and actual are
# greater than the allowed tolerance set any_error to True
# and build the error message
if error:
any_error = True
error_message += "{} difference (|actual - desired|) is not within {}.\n".format(", ".join(names), angle_tol)
error_message = __statsToErrorMessage(
stats,
error_message
)
# Test time (time of perihelion passage)
names = ["tPeri"]
diff, stats, error = _evaluateDifference(
orbits_actual[:, 5:],
orbits_desired[:, 5:],
u.d,
time_tol,
magnitude=False
)
for i, n in enumerate(names):
differences[n] = diff[:, i]
statistics[n] = {k : v[i] for k, v in stats.items()}
# If any of the differences between desired and actual are
# greater than the allowed tolerance set any_error to True
# and build the error message
if error:
any_error = True
error_message += "{} difference (|actual - desired|) is not within {}.\n".format(", ".join(names), time_tol)
error_message = __statsToErrorMessage(
stats,
error_message
)
if any_error and raise_error:
raise AssertionError(error_message)
return diff, stats, error
def testOrbits(
orbits_actual,
orbits_desired,
orbit_type="cartesian",
position_tol=1*u.m,
velocity_tol=(1*u.m / u.s),
unitless_tol=1e-10*u.dimensionless_unscaled,
angle_tol=1e-10*u.degree,
time_tol=1e-6*u.s,
magnitude=True,
raise_error=True
):
"""
Tests that the two sets of orbits are within the desired absolute tolerances
of each other. The absolute difference is calculated as |actual - desired|.
Parameters
----------
orbits_actual : `~numpy.ndarray` (N, 6)
Array of orbits to compare to the desired orbits.
Assumed units for:
positions : AU,
velocities : AU per day,
angles : degrees,
times : days
orbits_desired : `~numpy.ndarray` (N, 6)
Array of desired orbits to which to compare the actual orbits to.
Assumed units for:
positions : AU,
velocities : AU per day,
angles : degrees,
times : days
orbit_type : {'cartesian', 'keplerian', 'cometary'}
Type of the input orbits. Both actual and desired orbits must be of the same
type.
position_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance positions need to satisfy (a, q, x, y, z, r).
velocity_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance velocity need to satisfy. (vx, vy, vz, v).
unitless_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance unitless quantities need to satisfy (e).
angle_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance angle quantities need to satisfy (i, ascNode, argPeri, meanAnom).
time_tol : `~astropy.units.quantity.Quantity` (1)
Absolute tolerance time quantities need to satisfy (tPeri).
magnitude : bool
Applies to cartesian orbits only. Test the magnitude of the position difference
and velocity difference vectors as opposed to testing per individual coordinate.
Raises
------
AssertionError:
If |orbits_actual - orbits_desired| > tolerance.
ValueError:
If orbit_type is not one of 'cartesian', 'keplerian' or 'cometary'.
Returns
-------
None
"""
if orbit_type == "cartesian":
diff, stats, error = testCartesianOrbits(
orbits_actual,
orbits_desired,
position_tol=position_tol,
velocity_tol=velocity_tol,
magnitude=magnitude,
raise_error=raise_error
)
elif orbit_type == "keplerian":
diff, stats, error = testKeplerianOrbits(
orbits_actual,
orbits_desired,
position_tol=position_tol,
unitless_tol=unitless_tol,
angle_tol=angle_tol,
raise_error=raise_error
)
elif orbit_type == "cometary":
diff, stats, error = testCometaryOrbits(
orbits_actual,
orbits_desired,
position_tol=position_tol,
unitless_tol=unitless_tol,
angle_tol=angle_tol,
time_tol=time_tol,
raise_error=raise_error
)
else:
err = "orbit_type should be one of {'cartesian', 'keplerian', 'cometary'}"
raise ValueError(err)
return diff, stats, error
| 32.412892
| 120
| 0.58968
| 2,156
| 18,605
| 4.979128
| 0.096011
| 0.048067
| 0.029809
| 0.041733
| 0.819003
| 0.798323
| 0.787331
| 0.759944
| 0.755193
| 0.741313
| 0
| 0.006566
| 0.312335
| 18,605
| 574
| 121
| 32.412892
| 0.8325
| 0.426713
| 0
| 0.650165
| 0
| 0
| 0.079297
| 0
| 0
| 0
| 0
| 0
| 0.016502
| 1
| 0.019802
| false
| 0
| 0.006601
| 0
| 0.046205
| 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
|
12d488a01f4a218078e7f7ef565f61d526cd6624
| 130
|
py
|
Python
|
29/00/0.py
|
pylangstudy/201709
|
53d868786d7327a83bfa7f4149549c6f9855a6c6
|
[
"CC0-1.0"
] | null | null | null |
29/00/0.py
|
pylangstudy/201709
|
53d868786d7327a83bfa7f4149549c6f9855a6c6
|
[
"CC0-1.0"
] | 32
|
2017-09-01T00:52:17.000Z
|
2017-10-01T00:30:02.000Z
|
29/00/0.py
|
pylangstudy/201709
|
53d868786d7327a83bfa7f4149549c6f9855a6c6
|
[
"CC0-1.0"
] | null | null | null |
from decimal import *
getcontext().prec = 6
print(Decimal(1) / Decimal(7))
getcontext().prec = 28
print(Decimal(1) / Decimal(7))
| 18.571429
| 30
| 0.692308
| 19
| 130
| 4.736842
| 0.526316
| 0.311111
| 0.288889
| 0.444444
| 0.466667
| 0
| 0
| 0
| 0
| 0
| 0
| 0.061947
| 0.130769
| 130
| 6
| 31
| 21.666667
| 0.734513
| 0
| 0
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.2
| 0
| 0.2
| 0.4
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
12e25d8c5423a121c67fb76110c061493287d288
| 6,589
|
py
|
Python
|
zunclient/tests/unit/v1/test_client.py
|
slimit/python-zunclient
|
711d28902812178de73d44b06b2ab326026b644b
|
[
"Apache-2.0"
] | null | null | null |
zunclient/tests/unit/v1/test_client.py
|
slimit/python-zunclient
|
711d28902812178de73d44b06b2ab326026b644b
|
[
"Apache-2.0"
] | null | null | null |
zunclient/tests/unit/v1/test_client.py
|
slimit/python-zunclient
|
711d28902812178de73d44b06b2ab326026b644b
|
[
"Apache-2.0"
] | null | null | null |
# Copyright (c) 2015 Thales Services SAS
#
# 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 mock
import testtools
from zunclient.v1 import client
class ClientTest(testtools.TestCase):
@mock.patch('zunclient.common.httpclient.SessionClient')
@mock.patch('keystoneauth1.session.Session')
def test_init_with_session(self, mock_session, http_client):
session = mock.Mock()
client.Client(session=session)
mock_session.assert_not_called()
http_client.assert_called_once_with(
interface='public',
region_name=None,
service_name=None,
service_type='container',
session=session,
api_version=None)
@mock.patch('zunclient.common.httpclient.SessionClient')
@mock.patch('keystoneauth1.token_endpoint.Token')
@mock.patch('keystoneauth1.session.Session')
def test_init_with_token_and_url(
self, mock_session, mock_token, http_client):
mock_auth_plugin = mock.Mock()
mock_token.return_value = mock_auth_plugin
session = mock.Mock()
mock_session.return_value = session
client.Client(auth_token='mytoken',
endpoint_override='http://myurl/')
mock_session.assert_called_once_with(
auth=mock_auth_plugin, cert=None, verify=True)
http_client.assert_called_once_with(
endpoint_override='http://myurl/',
interface='public',
region_name=None,
service_name=None,
service_type='container',
session=session,
api_version=None)
@mock.patch('zunclient.common.httpclient.SessionClient')
@mock.patch('keystoneauth1.loading.get_plugin_loader')
@mock.patch('keystoneauth1.session.Session')
def test_init_with_token(
self, mock_session, mock_loader, http_client):
mock_plugin = mock.Mock()
mock_loader.return_value = mock_plugin
client.Client(auth_token='mytoken', auth_url='authurl')
mock_loader.assert_called_once_with('token')
mock_plugin.load_from_options.assert_called_once_with(
auth_url='authurl',
project_id=None,
project_name=None,
project_domain_id=None,
project_domain_name=None,
user_domain_id=None,
user_domain_name=None,
token='mytoken')
http_client.assert_called_once_with(
interface='public',
region_name=None,
service_name=None,
service_type='container',
session=mock.ANY,
api_version=None)
@mock.patch('zunclient.common.httpclient.SessionClient')
@mock.patch('keystoneauth1.loading.get_plugin_loader')
@mock.patch('keystoneauth1.session.Session')
def test_init_with_user(
self, mock_session, mock_loader, http_client):
mock_plugin = mock.Mock()
mock_loader.return_value = mock_plugin
client.Client(username='myuser', auth_url='authurl')
mock_loader.assert_called_once_with('password')
mock_plugin.load_from_options.assert_called_once_with(
auth_url='authurl',
username='myuser',
password=None,
project_domain_id=None,
project_domain_name=None,
user_domain_id=None,
user_domain_name=None,
project_id=None,
project_name=None)
http_client.assert_called_once_with(
interface='public',
region_name=None,
service_name=None,
service_type='container',
session=mock.ANY,
api_version=None)
@mock.patch('zunclient.common.httpclient.SessionClient')
@mock.patch('keystoneauth1.loading.get_plugin_loader')
@mock.patch('keystoneauth1.session.Session')
def test_init_unauthorized(
self, mock_session, mock_loader, http_client):
mock_plugin = mock.Mock()
mock_loader.return_value = mock_plugin
mock_session_obj = mock.Mock()
mock_session.return_value = mock_session_obj
mock_session_obj.get_endpoint.side_effect = Exception()
self.assertRaises(
RuntimeError,
client.Client, username='myuser', auth_url='authurl')
mock_loader.assert_called_once_with('password')
mock_plugin.load_from_options.assert_called_once_with(
auth_url='authurl',
username='myuser',
password=None,
project_domain_id=None,
project_domain_name=None,
user_domain_id=None,
user_domain_name=None,
project_id=None,
project_name=None)
http_client.assert_not_called()
@mock.patch('zunclient.common.httpclient.SessionClient')
@mock.patch('keystoneauth1.session.Session')
def test_init_with_endpoint_override(self, mock_session, http_client):
session = mock.Mock()
client.Client(session=session, endpoint_override='zunurl')
mock_session.assert_not_called()
http_client.assert_called_once_with(
interface='public',
region_name=None,
service_name=None,
service_type='container',
session=session,
endpoint_override='zunurl',
api_version=None)
@mock.patch('zunclient.common.httpclient.SessionClient')
@mock.patch('keystoneauth1.session.Session')
def test_init_with_zun_url_and_endpoint_override(self, mock_session,
http_client):
session = mock.Mock()
client.Client(session=session, zun_url='zunurl',
endpoint_override='zunurl')
mock_session.assert_not_called()
http_client.assert_called_once_with(
interface='public',
region_name=None,
service_name=None,
service_type='container',
session=session,
endpoint_override='zunurl',
api_version=None)
| 38.988166
| 78
| 0.646836
| 738
| 6,589
| 5.4729
| 0.178862
| 0.041594
| 0.051498
| 0.064372
| 0.771726
| 0.75489
| 0.726665
| 0.726665
| 0.726665
| 0.715771
| 0
| 0.00412
| 0.263318
| 6,589
| 168
| 79
| 39.220238
| 0.827977
| 0.08924
| 0
| 0.736111
| 0
| 0
| 0.149491
| 0.107065
| 0
| 0
| 0
| 0
| 0.125
| 1
| 0.048611
| false
| 0.027778
| 0.020833
| 0
| 0.076389
| 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
|
12ee0a341e21bd37ddae43bcc71c372808cc151d
| 7,728
|
py
|
Python
|
lenstronomy/GalKin/aperture_types.py
|
heather999/lenstronomy
|
8102fe026c1f3ba6e81d8a1f59cceb90e68430b4
|
[
"MIT"
] | 107
|
2017-08-25T20:03:51.000Z
|
2022-03-30T19:52:21.000Z
|
lenstronomy/GalKin/aperture_types.py
|
heather999/lenstronomy
|
8102fe026c1f3ba6e81d8a1f59cceb90e68430b4
|
[
"MIT"
] | 235
|
2017-06-07T13:30:53.000Z
|
2022-03-28T12:44:04.000Z
|
lenstronomy/GalKin/aperture_types.py
|
heather999/lenstronomy
|
8102fe026c1f3ba6e81d8a1f59cceb90e68430b4
|
[
"MIT"
] | 68
|
2018-02-01T15:47:20.000Z
|
2022-03-27T12:44:32.000Z
|
__author__ = 'sibirrer'
import numpy as np
from lenstronomy.Util.package_util import exporter
export, __all__ = exporter()
@export
class Slit(object):
"""
Slit aperture description
"""
def __init__(self, length, width, center_ra=0, center_dec=0, angle=0):
"""
:param length: length of slit
:param width: width of slit
:param center_ra: center of slit
:param center_dec: center of slit
:param angle: orientation angle of slit, angle=0 corresponds length in RA direction
"""
self._length = length
self._width = width
self._center_ra, self._center_dec = center_ra, center_dec
self._angle = angle
def aperture_select(self, ra, dec):
"""
:param ra: angular coordinate of photon/ray
:param dec: angular coordinate of photon/ray
:return: bool, True if photon/ray is within the slit, False otherwise
"""
return slit_select(ra, dec, self._length, self._width, self._center_ra, self._center_dec, self._angle), 0
@property
def num_segments(self):
"""
number of segments with separate measurements of the velocity dispersion
:return: int
"""
return 1
@export
def slit_select(ra, dec, length, width, center_ra=0, center_dec=0, angle=0):
"""
:param ra: angular coordinate of photon/ray
:param dec: angular coordinate of photon/ray
:param length: length of slit
:param width: width of slit
:param center_ra: center of slit
:param center_dec: center of slit
:param angle: orientation angle of slit, angle=0 corresponds length in RA direction
:return: bool, True if photon/ray is within the slit, False otherwise
"""
ra_ = ra - center_ra
dec_ = dec - center_dec
x = np.cos(angle) * ra_ + np.sin(angle) * dec_
y = - np.sin(angle) * ra_ + np.cos(angle) * dec_
if abs(x) < length / 2. and abs(y) < width / 2.:
return True
else:
return False
@export
class Frame(object):
"""
rectangular box with a hole in the middle (also rectangular), effectively a frame
"""
def __init__(self, width_outer, width_inner, center_ra=0, center_dec=0, angle=0):
"""
:param width_outer: width of box to the outer parts
:param width_inner: width of inner removed box
:param center_ra: center of slit
:param center_dec: center of slit
:param angle: orientation angle of slit, angle=0 corresponds length in RA direction
"""
self._width_outer = width_outer
self._width_inner = width_inner
self._center_ra, self._center_dec = center_ra, center_dec
self._angle = angle
def aperture_select(self, ra, dec):
"""
:param ra: angular coordinate of photon/ray
:param dec: angular coordinate of photon/ray
:return: bool, True if photon/ray is within the slit, False otherwise
"""
return frame_select(ra, dec, self._width_outer, self._width_inner, self._center_ra, self._center_dec, self._angle), 0
@property
def num_segments(self):
"""
number of segments with separate measurements of the velocity dispersion
:return: int
"""
return 1
@export
def frame_select(ra, dec, width_outer, width_inner, center_ra=0, center_dec=0, angle=0):
"""
:param ra: angular coordinate of photon/ray
:param dec: angular coordinate of photon/ray
:param width_outer: width of box to the outer parts
:param width_inner: width of inner removed box
:param center_ra: center of slit
:param center_dec: center of slit
:param angle: orientation angle of slit, angle=0 corresponds length in RA direction
:return: bool, True if photon/ray is within the box with a hole, False otherwise
"""
ra_ = ra - center_ra
dec_ = dec - center_dec
x = np.cos(angle) * ra_ + np.sin(angle) * dec_
y = - np.sin(angle) * ra_ + np.cos(angle) * dec_
if abs(x) < width_outer / 2. and abs(y) < width_outer / 2.:
if abs(x) < width_inner / 2. and abs(y) < width_inner / 2.:
return False
else:
return True
return False
@export
class Shell(object):
"""
Shell aperture
"""
def __init__(self, r_in, r_out, center_ra=0, center_dec=0):
"""
:param r_in: innermost radius to be selected
:param r_out: outermost radius to be selected
:param center_ra: center of the sphere
:param center_dec: center of the sphere
"""
self._r_in, self._r_out = r_in, r_out
self._center_ra, self._center_dec = center_ra, center_dec
def aperture_select(self, ra, dec):
"""
:param ra: angular coordinate of photon/ray
:param dec: angular coordinate of photon/ray
:return: bool, True if photon/ray is within the slit, False otherwise
"""
return shell_select(ra, dec, self._r_in, self._r_out, self._center_ra, self._center_dec), 0
@property
def num_segments(self):
"""
number of segments with separate measurements of the velocity dispersion
:return: int
"""
return 1
@export
def shell_select(ra, dec, r_in, r_out, center_ra=0, center_dec=0):
"""
:param ra: angular coordinate of photon/ray
:param dec: angular coordinate of photon/ray
:param r_in: innermost radius to be selected
:param r_out: outermost radius to be selected
:param center_ra: center of the sphere
:param center_dec: center of the sphere
:return: boolean, True if within the radial range, False otherwise
"""
x = ra - center_ra
y = dec - center_dec
R = np.sqrt(x ** 2 + y ** 2)
if (R >= r_in) and (R < r_out):
return True
else:
return False
@export
class IFUShells(object):
"""
class for an Integral Field Unit spectrograph with azimuthal shells where the kinematics are measured
"""
def __init__(self, r_bins, center_ra=0, center_dec=0):
"""
:param r_bins: array of radial bins to average the dispersion spectra in ascending order.
It starts with the inner-most edge to the outermost edge.
:param center_ra: center of the sphere
:param center_dec: center of the sphere
"""
self._r_bins = r_bins
self._center_ra, self._center_dec = center_ra, center_dec
def aperture_select(self, ra, dec):
"""
:param ra: angular coordinate of photon/ray
:param dec: angular coordinate of photon/ray
:return: bool, True if photon/ray is within the slit, False otherwise, index of shell
"""
return shell_ifu_select(ra, dec, self._r_bins, self._center_ra, self._center_dec)
@property
def num_segments(self):
"""
number of segments with separate measurements of the velocity dispersion
:return: int
"""
return len(self._r_bins) - 1
@export
def shell_ifu_select(ra, dec, r_bin, center_ra=0, center_dec=0):
"""
:param ra: angular coordinate of photon/ray
:param dec: angular coordinate of photon/ray
:param r_bin: array of radial bins to average the dispersion spectra in ascending order.
It starts with the inner-most edge to the outermost edge.
:param center_ra: center of the sphere
:param center_dec: center of the sphere
:return: boolean, True if within the radial range, False otherwise
"""
x = ra - center_ra
y = dec - center_dec
R = np.sqrt(x ** 2 + y ** 2)
for i in range(0, len(r_bin) - 1):
if (R >= r_bin[i]) and (R < r_bin[i+1]):
return True, i
return False, None
| 31.802469
| 125
| 0.640399
| 1,107
| 7,728
| 4.290876
| 0.110208
| 0.053895
| 0.064
| 0.084211
| 0.840421
| 0.813053
| 0.808632
| 0.791368
| 0.767579
| 0.767579
| 0
| 0.007815
| 0.27148
| 7,728
| 242
| 126
| 31.933884
| 0.835879
| 0.462733
| 0
| 0.602273
| 0
| 0
| 0.002332
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.181818
| false
| 0
| 0.022727
| 0
| 0.443182
| 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
|
42a30d3b080731c1b09661da2d8e4fe98f15c6b5
| 36
|
py
|
Python
|
day23/data.py
|
ogun/advent-of-code-2020
|
1dcf268f9f1f6cd7c46d442b6aaa9b19ec5b2cf1
|
[
"MIT"
] | 4
|
2020-12-03T13:22:12.000Z
|
2020-12-22T21:51:49.000Z
|
day23/data.py
|
ogun/advent-of-code-2020
|
1dcf268f9f1f6cd7c46d442b6aaa9b19ec5b2cf1
|
[
"MIT"
] | null | null | null |
day23/data.py
|
ogun/advent-of-code-2020
|
1dcf268f9f1f6cd7c46d442b6aaa9b19ec5b2cf1
|
[
"MIT"
] | 1
|
2020-12-12T13:41:12.000Z
|
2020-12-12T13:41:12.000Z
|
INPUT = [2, 5, 3, 1, 4, 9, 8, 6, 7]
| 18
| 35
| 0.388889
| 10
| 36
| 1.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.36
| 0.305556
| 36
| 1
| 36
| 36
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
c42271cfd5cc6293f5f27295a3b3b5344b4efe90
| 70
|
py
|
Python
|
pynemo/core/base/__init__.py
|
SSripilaipong/pynemo
|
f4dedd2599ec78b2ffe73f55b1d2b8b5da1b1e7f
|
[
"MIT"
] | null | null | null |
pynemo/core/base/__init__.py
|
SSripilaipong/pynemo
|
f4dedd2599ec78b2ffe73f55b1d2b8b5da1b1e7f
|
[
"MIT"
] | null | null | null |
pynemo/core/base/__init__.py
|
SSripilaipong/pynemo
|
f4dedd2599ec78b2ffe73f55b1d2b8b5da1b1e7f
|
[
"MIT"
] | null | null | null |
from .model import *
from .statement import *
from .property import *
| 17.5
| 24
| 0.742857
| 9
| 70
| 5.777778
| 0.555556
| 0.384615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.171429
| 70
| 3
| 25
| 23.333333
| 0.896552
| 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
|
c42d9414508e5f1e2149a0e02694000022c112e3
| 158
|
py
|
Python
|
nerf/__init__.py
|
SauravMaheshkar/NeRF
|
4d3a346ec1ca50fdd99c60d4559ecea61ced1599
|
[
"MIT"
] | 2
|
2022-01-31T11:06:11.000Z
|
2022-01-31T13:43:56.000Z
|
nerf/__init__.py
|
SauravMaheshkar/NeRF
|
4d3a346ec1ca50fdd99c60d4559ecea61ced1599
|
[
"MIT"
] | 1
|
2022-01-19T10:10:35.000Z
|
2022-01-19T10:10:35.000Z
|
nerf/__init__.py
|
SauravMaheshkar/NeRF
|
4d3a346ec1ca50fdd99c60d4559ecea61ced1599
|
[
"MIT"
] | null | null | null |
from nerf.datasets import LLFF, Blender, Dataset # noqa: F401
from nerf.model_utils import MLP # noqa: F401
from nerf.models import NerfModel # noqa: F401
| 39.5
| 62
| 0.765823
| 24
| 158
| 5
| 0.583333
| 0.2
| 0.2
| 0.266667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068182
| 0.164557
| 158
| 3
| 63
| 52.666667
| 0.840909
| 0.202532
| 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
| 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
|
c452b294491289a80c1da6c76b645009b765ffcf
| 23,907
|
py
|
Python
|
hanibal/ans_reporte/crear_informe_cobros_automaticos_excel.py
|
Christian-Castro/castro_odoo8
|
8247fdb20aa39e043b6fa0c4d0af509462ab3e00
|
[
"Unlicense"
] | null | null | null |
hanibal/ans_reporte/crear_informe_cobros_automaticos_excel.py
|
Christian-Castro/castro_odoo8
|
8247fdb20aa39e043b6fa0c4d0af509462ab3e00
|
[
"Unlicense"
] | null | null | null |
hanibal/ans_reporte/crear_informe_cobros_automaticos_excel.py
|
Christian-Castro/castro_odoo8
|
8247fdb20aa39e043b6fa0c4d0af509462ab3e00
|
[
"Unlicense"
] | null | null | null |
# -*- coding: utf-8 -*-
import openpyxl
from openpyxl import Workbook
import openpyxl.worksheet
import unicodedata
from copy import deepcopy
from openpyxl.chart import (
Reference,
Series,
BarChart
)
from openpyxl.chart.marker import DataPoint
from openpyxl.drawing.fill import PatternFillProperties, ColorChoice
from openpyxl import Workbook
from openpyxl.styles import PatternFill, Border, Side, Alignment, Protection, Font
from openpyxl.styles.borders import Border, Side
from openpyxl.drawing.image import Image
from datetime import datetime, date, timedelta
import time
import locale
global root
def crear_wb_informe():
wb = openpyxl.Workbook()
return wb
def unicodeText(text):
try:
text = unicodedata.unicode(text, 'utf-8')
except TypeError:
return text
def crea_hoja_info(wb, title, flag):
sheet = wb.active
if(flag == 0):
#sheet.page_setup.paperSize = sheet.PAPERSIZE_A4_SMALL
#sheet.print_options.scale = 100
sheet.page_margins.left = 0.1
sheet.page_margins.right = 0.1
sheet.page_margins.top = 0.5
sheet.page_margins.bottom = 0.5
#sheet.page_setup.orientation = sheet.ORIENTATION_PORTRAIT
#sheet.sheet_properties.pageSetUpPr.fitToPage = True
sheet.page_setup.fitToWidht = False
#sheet.print_options.horizontalCentered = True
if(flag == 1):
#sheet.page_setup.paperSize = sheet.PAPERSIZE_A4_SMALL
#sheet.print_options.scale = 100
#sheet.sheet_properties.pageSetUpPr.fitToPage = True
sheet.page_setup.fitToWidth = False
sheet.page_margins.left = 0.1
sheet.page_margins.right = 0.1
sheet.page_margins.top = 0.5
sheet.page_margins.bottom = 0.5
#sheet.page_setup.orientation = sheet.ORIENTATION_PORTRAIT
#sheet.print_options.horizontalCentered = True
sheet.title = title
return sheet
def crea_hoja_info_pdf(wb, title, flag):
sheet = wb.active
if(flag == 0):
#sheet.page_setup.paperSize = sheet.PAPERSIZE_A4_SMALL
#sheet.print_options.scale = 100
sheet.page_margins.left = 0.1
sheet.page_margins.right = 0.1
sheet.page_margins.top = 0.5
sheet.page_margins.bottom = 0.5
#sheet.page_setup.orientation = sheet.ORIENTATION_PORTRAIT
#sheet.sheet_properties.pageSetUpPr.fitToPage = True
sheet.page_setup.fitToWidht = False
#sheet.print_options.horizontalCentered = True
if(flag == 1):
#sheet.page_setup.paperSize = sheet.PAPERSIZE_A4_SMALL
#sheet.print_options.scale = 100
#sheet.sheet_properties.pageSetUpPr.fitToPage = True
sheet.page_setup.fitToWidth = False
sheet.page_margins.left = 0.1
sheet.page_margins.right = 0.1
sheet.page_margins.top = 0.5
sheet.page_margins.bottom = 0.5
#sheet.page_setup.orientation = sheet.ORIENTATION_PORTRAIT
#sheet.print_options.horizontalCentered = True
sheet.title = title
return sheet
def border_tabla(sheet, col, colfin, fil, filfin, styleleft, styletop, styleright, stylebottom):
colfin=colfin+1
filfin=filfin+2
border_cell = Border(left=Side(style=styleleft), top=Side(style=styletop), right=Side(style=styleright), bottom=Side(style=stylebottom))
for i in range(fil, filfin-1):
for j in range(col, colfin):
sheet.cell(row=i, column=j).border = border_cell
def columnas_filas(sheet, flag, celda, value):
if (flag == 0):
sheet.column_dimensions[celda].width = value
if (flag == 1):
sheet.row_dimensions[int(celda)].height = value
def poner_border(sheet, fil, col, styleleft, styletop, styleright, stylebottom):
border_cell = Border(left=Side(style=styleleft), top=Side(style=styletop), right=Side(style=styleright), bottom=Side(style=stylebottom))
sheet.cell(row=fil, column=col).border = border_cell
def Informe(sheet, dic,lista_alumnos):
columnas_filas(sheet, 0, 'A', 10.00)
columnas_filas(sheet, 0, 'B', 5.00)
columnas_filas(sheet, 0, 'C', 10.00)
columnas_filas(sheet, 0, 'D', 7.00)
columnas_filas(sheet, 0, 'E', 12.00)
columnas_filas(sheet, 0, 'F', 10.00)
columnas_filas(sheet, 0, 'G', 10.00)
columnas_filas(sheet, 0, 'H', 7.00)
columnas_filas(sheet, 0, 'I', 10.00)
alignment_title = Alignment(horizontal='center', vertical='center')
fuente = Font(bold=False, size=6, name='arial')
fuente3 = Font(bold=True, size=8, name='arial')
fuente2 = Font(bold=True, size=6, name='arial')
fila = 3
fila1 = 2
acum=1
cont=0
col=2
col1=4
fil=4
coli=2
colf=2
sheet.merge_cells('A2:I2')
sheet['A2'].alignment = alignment_title.copy(wrapText=True,horizontal='center', vertical='top')
sheet['A2'].font = fuente3
sheet['A2']= 'Listado de Cheques y Ordenes de Pago'
sheet['H1'].alignment = alignment_title.copy(wrapText=True,horizontal='right', vertical='top')
sheet['H1'].font = fuente2
sheet['H1']= 'Usuario'
usuario_id=str(dic['usuario_id'].encode('utf-8'))
sheet.merge_cells('B1:C1')
sheet['I1'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['I1'].font = fuente
sheet['I1']= str(dic['usuario_id'].encode('utf-8'))
sheet['A1'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A1'].font = fuente2
sheet['A1']= 'Compañia'
sheet.merge_cells('B1:C1')
sheet['B1'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['B1'].font = fuente
sheet['B1']= str(dic['company_id'].encode('utf-8'))
sheet['A4'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A4'].font = fuente2
sheet['A4']= 'Fecha Emisión:'
#fecha_actual = datetime.strftime(datetime.now(), '%d-%m-%Y %H:%M:%S')
fecha_actual = dic['fecha_corte']
sheet.merge_cells('B4:C4')
sheet['B4'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['B4'].font = fuente
sheet['B4']= fecha_actual
sheet['A5'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A5'].font = fuente2
sheet['A5']= 'Metodos de Pagos:'
sheet.merge_cells('B5:E5')
sheet['B5'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['B5'].font = fuente
if filtro==0:
sheet['B5']= "Todos los metodos de pagos"
else:
sheet['B5']= filtro
sheet['F5'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['F5'].font = fuente2
sheet['F5']= 'Estados de Pagos:'
sheet.merge_cells('G5:G5')
sheet['G5'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['G5'].font = fuente
if filtro1==0:
sheet['G5']= "Todos"
else:
sheet['G5']= filtro1
poner_border(sheet,1,1,'medium','medium','none','none')
poner_border(sheet,1,2,'none','medium','none','none')
poner_border(sheet,1,3,'none','medium','none','none')
poner_border(sheet,1,4,'none','medium','none','none')
poner_border(sheet,1,5,'none','medium','none','none')
poner_border(sheet,1,5,'none','medium','none','none')
poner_border(sheet,1,6,'none','medium','none','none')
poner_border(sheet,1,7,'none','medium','none','none')
poner_border(sheet,1,8,'none','medium','none','none')
poner_border(sheet,1,9,'none','medium','medium','none')
poner_border(sheet,2,1,'medium','none','none','none')
poner_border(sheet,2,9,'none','none','medium','none')
poner_border(sheet,3,1,'medium','none','none','medium')
poner_border(sheet,3,2,'none','none','none','medium')
poner_border(sheet,3,3,'none','none','none','medium')
poner_border(sheet,3,4,'none','none','none','medium')
poner_border(sheet,3,5,'none','none','none','medium')
poner_border(sheet,3,6,'none','none','none','medium')
poner_border(sheet,3,7,'none','none','none','medium')
poner_border(sheet,3,8,'none','none','none','medium')
poner_border(sheet,3,9,'none','none','medium','medium')
fecha_ini=dic['fecha_desde']
fecha_fin=dic['fecha_hasta']
fecha=str(" Desde: "+dic['fecha_desde']+" Hasta: "+dic['fecha_hasta'])
sheet.merge_cells('D3:F3')
sheet['D3'].alignment = alignment_title.copy(wrapText=True,horizontal='center', vertical='top')
sheet['D3'].font = fuente2
sheet['D3']= str(" Desde: "+dic['fecha_desde']+" Hasta: "+dic['fecha_hasta'])
sheet['A6'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A6'].font = fuente2
sheet['A6']= 'Fecha Emisión'
sheet.merge_cells('B6:C6')
sheet['B6'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['B6'].font = fuente2
sheet['B6']= 'Egreso #'
sheet.merge_cells('D6:E6')
sheet['D6'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['D6'].font = fuente2
sheet['D6']= 'Cheque #'
sheet['F6'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['F6'].font = fuente2
sheet['F6']= 'Beneficiario'
sheet.merge_cells('G6:H6')
sheet['G6'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['G6'].font = fuente2
sheet['G6']= 'Observación'
sheet['I6'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['I6'].font = fuente2
sheet['I6']= 'Valor'
fila=7
total_general=0.0
saldo_general=0.0
saldo=0.0
total=0.0
dic={}
lista_datos=[]
for recorrer in lista_alumnos:
sheet['A'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A'+str(fila)].font = fuente
sheet['A'+str(fila)]= recorrer['fecha_emision']
#poner_border(sheet,fila,1,'none','none','none','medium')
sheet.merge_cells('B'+str(fila)+':C'+str(fila))
sheet['B'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['B'+str(fila)].font = fuente
if recorrer['egreso']==0:
sheet['B'+str(fila)]= ""
else:
sheet['B'+str(fila)]= recorrer['egreso']
sheet.merge_cells('D'+str(fila)+':E'+str(fila))
sheet['D'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['D'+str(fila)].font = fuente
if recorrer['cheque']==0:
sheet['D'+str(fila)]= ""
else:
sheet['D'+str(fila)]= recorrer['cheque']
sheet['F'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['F'+str(fila)].font = fuente
sheet['F'+str(fila)]= recorrer['beneficiario']
sheet.merge_cells('G'+str(fila)+':H'+str(fila))
sheet['G'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['G'+str(fila)].font = fuente
if recorrer['observacion']==0:
sheet['G'+str(fila)]= ""
else:
sheet['G'+str(fila)]= recorrer['observacion']
sheet['I'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='right', vertical='top')
sheet['I'+str(fila)].font = fuente
sheet['I'+str(fila)]= "{:,}".format(float(recorrer['valor'])).replace(',','~').replace('.',',').replace('~','.')
total_general=total_general+float(recorrer['valor'])
fila=fila+1
sheet['G'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['G'+str(fila)].font = fuente2
sheet['G'+str(fila)]= 'TOTAL'
sheet.merge_cells('H'+str(fila)+':I'+str(fila))
sheet['H'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='right', vertical='top')
sheet['H'+str(fila)].font = fuente2
sheet['H'+str(fila)]= "{:,}".format(float(total_general)).replace(',','~').replace('.',',').replace('~','.')
columnas_filas(sheet, 1, str(fila+5), 10.00)
sheet.merge_cells('D'+str(fila+5)+':F'+str(fila+5))
sheet['D'+str(fila+5)].alignment = alignment_title.copy(wrapText=True,horizontal='center', vertical='center')
sheet['D'+str(fila+5)].font = fuente2
sheet['D'+str(fila+5)]= usuario_id
poner_border(sheet,fila+5,4,'none','thin','none','none')
poner_border(sheet,fila+5,5,'none','thin','none','none')
poner_border(sheet,fila+5,6,'none','thin','none','none')
def Informe_pdf(sheet, dic,lista_alumnos):
columnas_filas(sheet, 0, 'A', 5.00)
columnas_filas(sheet, 0, 'B', 5.00)
columnas_filas(sheet, 0, 'C', 2.00)
columnas_filas(sheet, 0, 'D', 7.00)
columnas_filas(sheet, 0, 'E', 18.00)
columnas_filas(sheet, 0, 'F', 8.00)
columnas_filas(sheet, 0, 'G', 5.00)
columnas_filas(sheet, 0, 'H', 8.00)
columnas_filas(sheet, 0, 'I', 5.00)
columnas_filas(sheet, 0, 'J', 5.00)
columnas_filas(sheet, 0, 'K', 10.00)
columnas_filas(sheet, 0, 'L', 3.00)
alignment_title = Alignment(horizontal='center', vertical='center')
fuente = Font(bold=False, size=6, name='arial')
fuente3 = Font(bold=True, size=8, name='arial')
fuente2 = Font(bold=True, size=6, name='arial')
fila = 3
fila1 = 2
acum=1
cont=0
col=2
col1=4
fil=4
coli=2
colf=2
sheet.merge_cells('A2:I2')
sheet['A2'].alignment = alignment_title.copy(wrapText=True,horizontal='center', vertical='top')
sheet['A2'].font = fuente3
sheet['A2']= 'Cobros Automaticos'
sheet.merge_cells('G1:H1')
sheet['G1'].alignment = alignment_title.copy(wrapText=True,horizontal='right', vertical='top')
sheet['G1'].font = fuente2
sheet['G1']= 'Usuario'
usuario_id=str(dic['usuario_id'].encode('utf-8'))
sheet.merge_cells('I1:J1')
sheet['I1'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['I1'].font = fuente
sheet['I1']= str(dic['usuario_id'].encode('utf-8'))
sheet.merge_cells('A1:C1')
sheet['A1'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A1'].font = fuente2
sheet['A1']= 'Compañia '+str(dic['company_id'].encode('utf-8'))
poner_border(sheet,1,1,'medium','medium','none','none')
poner_border(sheet,1,2,'none','medium','none','none')
poner_border(sheet,1,3,'none','medium','none','none')
poner_border(sheet,1,4,'none','medium','none','none')
poner_border(sheet,1,5,'none','medium','none','none')
poner_border(sheet,1,5,'none','medium','none','none')
poner_border(sheet,1,6,'none','medium','none','none')
poner_border(sheet,1,7,'none','medium','none','none')
poner_border(sheet,1,8,'none','medium','none','none')
poner_border(sheet,1,9,'none','medium','none','none')
poner_border(sheet,1,10,'none','medium','none','none')
poner_border(sheet,1,11,'none','medium','none','none')
poner_border(sheet,1,12,'none','medium','medium','none')
#poner_border(sheet,3,12,'none','none','medium','none')
poner_border(sheet,2,1,'medium','none','none','none')
poner_border(sheet,2,12,'none','none','medium','none')
poner_border(sheet,3,1,'none','medium','none','none')
poner_border(sheet,3,2,'none','medium','none','none')
poner_border(sheet,3,3,'none','medium','none','none')
poner_border(sheet,3,4,'none','medium','none','none')
poner_border(sheet,3,5,'none','medium','none','none')
poner_border(sheet,3,6,'none','medium','none','none')
poner_border(sheet,3,7,'none','medium','none','none')
poner_border(sheet,3,8,'none','medium','none','none')
poner_border(sheet,3,9,'none','medium','none','none')
poner_border(sheet,3,10,'none','medium','none','none')
poner_border(sheet,3,11,'none','medium','none','none')
poner_border(sheet,3,12,'none','medium','none','none')
sheet['A4'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A4'].font = fuente2
sheet['A4']= 'Fecha Emisión:'
fecha_actual = dic['fecha_emision']
sheet.merge_cells('B4:D4')
sheet['B4'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['B4'].font = fuente
sheet['B4']= fecha_actual
sheet['F4'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['F4'].font = fuente2
sheet['F4']= 'Estado:'
sheet.merge_cells('G4:J4')
sheet['G4'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['G4'].font = fuente
sheet['G4']= dic['estado']
sheet['A5'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A5'].font = fuente2
sheet['A5']= 'Codigo:'
sheet.merge_cells('B5:E5')
sheet['B5'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['B5'].font = fuente
sheet['B5']= dic['codigo']
sheet['F5'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['F5'].font = fuente2
sheet['F5']= 'Metodo de Pago:'
sheet.merge_cells('G5:J5')
sheet['G5'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['G5'].font = fuente
sheet['G5']= dic['met_pago']
sheet['A6'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A6'].font = fuente2
sheet['A6']= 'Banco'
sheet.merge_cells('B6:E6')
sheet['B6'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['B6'].font = fuente
sheet['B6']= dic['banco']
sheet['F6'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['F6'].font = fuente2
sheet['F6']= 'Cuenta Bancaria:'
sheet.merge_cells('G6:J6')
sheet['G6'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['G6'].font = fuente
sheet['G6']= dic['cuenta_bancaria']
sheet['A7'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A7'].font = fuente2
sheet['A7']= 'Caja'
sheet.merge_cells('B7:E7')
sheet['B7'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['B7'].font = fuente
sheet['B7']= dic['caja']
sheet['F7'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['F7'].font = fuente2
sheet['F7']= 'Fecha de Cobro:'
sheet.merge_cells('G7:J7')
sheet['G7'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['G7'].font = fuente
sheet['G7']= dic['fecha_cobro']
sheet['A8'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A8'].font = fuente2
sheet['A8']= 'Tipo'
sheet.merge_cells('B8:C8')
sheet['B8'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['B8'].font = fuente2
sheet['B8']= 'No. Factura'
sheet['D8'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['D8'].font = fuente2
sheet['D8']= 'Codigo del Alumno'
sheet['E8'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['E8'].font = fuente2
sheet['E8']= 'Alumno'
sheet['F8'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['F8'].font = fuente2
sheet['F8']= 'Codigo del Pago'
sheet['G8'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['G8'].font = fuente2
sheet['G8']= 'Valor'
sheet.merge_cells('H8:I8')
sheet['H8'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['H8'].font = fuente2
sheet['H8']= 'Curso'
sheet['J8'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['J8'].font = fuente2
sheet['J8']= 'Fecha Factura'
sheet.merge_cells('K8:L8')
sheet['K8'].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['K8'].font = fuente2
sheet['K8']= 'Observacion'
fila=9
total_general=0.0
saldo_general=0.0
saldo=0.0
total=0.0
dic={}
lista_datos=[]
for recorrer in lista_alumnos:
sheet['A'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['A'+str(fila)].font = fuente
sheet['A'+str(fila)]= recorrer['tipo']
#poner_border(sheet,fila,1,'none','none','none','medium')
sheet.merge_cells('B'+str(fila)+':C'+str(fila))
sheet['B'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['B'+str(fila)].font = fuente
sheet['B'+str(fila)]= recorrer['numero_factura']
sheet['D'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['D'+str(fila)].font = fuente
sheet['D'+str(fila)]= recorrer['codigo_alumno']
sheet['E'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['E'+str(fila)].font = fuente
sheet['E'+str(fila)]= recorrer['alumno']
sheet['F'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['F'+str(fila)].font = fuente
sheet['F'+str(fila)]= recorrer['numero_pago']
sheet['G'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='right', vertical='top')
sheet['G'+str(fila)].font = fuente
sheet['G'+str(fila)]= "{:,}".format(float(recorrer['valor'])).replace(',','~').replace('.',',').replace('~','.')
sheet.merge_cells('H'+str(fila)+':I'+str(fila))
sheet['H'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='right', vertical='top')
sheet['H'+str(fila)].font = fuente
sheet['H'+str(fila)]= recorrer['jornada']+'/'+recorrer['curso']+'/'+recorrer['paralelo']
sheet['J'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='right', vertical='top')
sheet['J'+str(fila)].font = fuente
sheet['J'+str(fila)]= recorrer['fecha_factura']
sheet.merge_cells('K'+str(fila)+':L'+str(fila))
sheet['K'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='justify', vertical='top')
sheet['K'+str(fila)].font = fuente
sheet['K'+str(fila)]= recorrer['observacion']
total_general=total_general+float(recorrer['valor'])
fila=fila+1
sheet['E'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='left', vertical='top')
sheet['E'+str(fila)].font = fuente2
sheet['E'+str(fila)]= 'TOTAL'
sheet['G'+str(fila)].alignment = alignment_title.copy(wrapText=True,horizontal='right', vertical='top')
sheet['G'+str(fila)].font = fuente2
sheet['G'+str(fila)]= "{:,}".format(float(total_general)).replace(',','~').replace('.',',').replace('~','.')
columnas_filas(sheet, 1, str(fila+5), 10.00)
sheet.merge_cells('D'+str(fila+5)+':F'+str(fila+5))
sheet['D'+str(fila+5)].alignment = alignment_title.copy(wrapText=True,horizontal='center', vertical='center')
sheet['D'+str(fila+5)].font = fuente2
sheet['D'+str(fila+5)]= usuario_id
poner_border(sheet,fila+5,4,'none','thin','none','none')
poner_border(sheet,fila+5,5,'none','thin','none','none')
poner_border(sheet,fila+5,6,'none','thin','none','none')
| 40.658163
| 140
| 0.647007
| 3,226
| 23,907
| 4.701178
| 0.085865
| 0.039694
| 0.103125
| 0.12106
| 0.802585
| 0.784188
| 0.760781
| 0.752605
| 0.702163
| 0.68159
| 0
| 0.029277
| 0.157067
| 23,907
| 587
| 141
| 40.727428
| 0.723303
| 0.050362
| 0
| 0.476087
| 0
| 0
| 0.130441
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.019565
| false
| 0
| 0.032609
| 0
| 0.06087
| 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
|
6705976f96280a0c9267782dd7ba9b91bbc952e7
| 340
|
py
|
Python
|
analyst_recommendation_performance/__intit__.py
|
dbondi/analyst_recommendation_performance
|
1f5852095032a9f338014b32f25f8beb65970d46
|
[
"MIT"
] | 1
|
2021-04-06T20:33:48.000Z
|
2021-04-06T20:33:48.000Z
|
analyst_recommendation_performance/__intit__.py
|
dbondi/analyst_recommendation_performance
|
1f5852095032a9f338014b32f25f8beb65970d46
|
[
"MIT"
] | null | null | null |
analyst_recommendation_performance/__intit__.py
|
dbondi/analyst_recommendation_performance
|
1f5852095032a9f338014b32f25f8beb65970d46
|
[
"MIT"
] | null | null | null |
from analyst_recommendation_performance.analyze_recommendations import measure_firm_performance,graph_performance
from analyst_recommendation_performance.get_tickers import get_tickers,get_tickers_filtered,get_biggest_n_tickers
from analyst_recommendation_performance.get_recommendations import get_recommendations,normalize_recommendations
| 113.333333
| 113
| 0.947059
| 39
| 340
| 7.74359
| 0.410256
| 0.109272
| 0.248344
| 0.357616
| 0.258278
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.032353
| 340
| 3
| 114
| 113.333333
| 0.917933
| 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
| 1
| 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
| 0
| 0
|
0
| 6
|
675899cb00eb7ceeed1a619ccc0dca21e743068b
| 94
|
py
|
Python
|
nata/plugins/plot/__init__.py
|
ahelm/nata
|
c8231b8a15c748e3f71720bc4655c212cc26ffb5
|
[
"MIT"
] | null | null | null |
nata/plugins/plot/__init__.py
|
ahelm/nata
|
c8231b8a15c748e3f71720bc4655c212cc26ffb5
|
[
"MIT"
] | null | null | null |
nata/plugins/plot/__init__.py
|
ahelm/nata
|
c8231b8a15c748e3f71720bc4655c212cc26ffb5
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from .grid import *
from .particle import *
from .collection import *
| 18.8
| 25
| 0.659574
| 12
| 94
| 5.166667
| 0.666667
| 0.322581
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012987
| 0.180851
| 94
| 4
| 26
| 23.5
| 0.792208
| 0.223404
| 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
|
67797f155c2d4189b848820bf1022dd8c544b356
| 1,063
|
py
|
Python
|
backend/posts/views.py
|
Soumithri/website
|
de813cfd20f3b9e28b92c089524f998956ced3d9
|
[
"MIT"
] | 2
|
2019-08-07T03:28:51.000Z
|
2019-08-07T07:32:25.000Z
|
backend/posts/views.py
|
Soumithri/website
|
de813cfd20f3b9e28b92c089524f998956ced3d9
|
[
"MIT"
] | 7
|
2019-12-04T23:54:04.000Z
|
2022-02-10T10:57:58.000Z
|
backend/posts/views.py
|
Soumithri/website
|
de813cfd20f3b9e28b92c089524f998956ced3d9
|
[
"MIT"
] | null | null | null |
from rest_framework import generics
from .models import Post, Project, Author
from .serializers import PostSerializer, ProjectSerializer, AuthorSerializer
class PostList(generics.ListAPIView):
# Generic class based view for displaying all the posts
queryset = Post.objects.all()
serializer_class = PostSerializer
class PostDetail(generics.RetrieveAPIView):
# Generic class based view for retrieving all the posts
queryset = Post.objects.all()
serializer_class = PostSerializer
class ProjectList(generics.ListAPIView):
# Generic class based view for displaying all the posts
queryset = Project.objects.all()
serializer_class = ProjectSerializer
class ProjectDetail(generics.RetrieveAPIView):
# Generic class based view for retrieving all the posts
queryset = Project.objects.all()
serializer_class = ProjectSerializer
class AuthorDetail(generics.RetrieveAPIView):
# Generic class based view for retrieving all the posts
queryset = Author.objects.all()
serializer_class = AuthorSerializer
| 26.575
| 76
| 0.771402
| 117
| 1,063
| 6.957265
| 0.282051
| 0.07371
| 0.104423
| 0.128993
| 0.707617
| 0.707617
| 0.707617
| 0.707617
| 0.707617
| 0.707617
| 0
| 0
| 0.171214
| 1,063
| 39
| 77
| 27.25641
| 0.92395
| 0.253057
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 1
| 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
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 6
|
679907d3867fa57810ef576405fb3bc69a50bf8c
| 64
|
py
|
Python
|
py_tdlib/constructors/network_type_wi_fi.py
|
Mr-TelegramBot/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 24
|
2018-10-05T13:04:30.000Z
|
2020-05-12T08:45:34.000Z
|
py_tdlib/constructors/network_type_wi_fi.py
|
MrMahdi313/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 3
|
2019-06-26T07:20:20.000Z
|
2021-05-24T13:06:56.000Z
|
py_tdlib/constructors/network_type_wi_fi.py
|
MrMahdi313/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 5
|
2018-10-05T14:29:28.000Z
|
2020-08-11T15:04:10.000Z
|
from ..factory import Type
class networkTypeWiFi(Type):
pass
| 10.666667
| 28
| 0.765625
| 8
| 64
| 6.125
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15625
| 64
| 5
| 29
| 12.8
| 0.907407
| 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
|
67de8337b673c0cb1c5d58969c1527d8876b61e7
| 2,286
|
py
|
Python
|
recognition/symbol/symbol_seblock.py
|
994374821/face-recognition-
|
e5cdc04bc88cc9630e25050888f17c059b790be0
|
[
"MIT"
] | 6
|
2019-09-22T11:46:00.000Z
|
2019-12-26T02:51:09.000Z
|
recognition/symbol/symbol_seblock.py
|
994374821/face-recognition-
|
e5cdc04bc88cc9630e25050888f17c059b790be0
|
[
"MIT"
] | 1
|
2019-10-24T10:32:51.000Z
|
2019-10-24T10:32:51.000Z
|
recognition/symbol/symbol_seblock.py
|
994374821/face-recognition-
|
e5cdc04bc88cc9630e25050888f17c059b790be0
|
[
"MIT"
] | null | null | null |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
__all__ = ['SE_Block',
]
'''see: Squeeze-and-Excitation Networks'''
def SE_Block(sym, data, num_out, name):
if type(num_out) is tuple:
num_mid = (int(sum(num_out)/16), 0)
else:
num_mid = int(num_out/16)
# global pooling
out = sym.Pooling(data=data, pool_type='avg', kernel=(1, 1), global_pool=True, stride=(1, 1), name=('%s_pool' % name))
# fc1
out = sym.FullyConnected(data=out, num_hidden=num_mid, no_bias=False, name=('%s_fc1' % name))
out = sym.Activation(data=out, act_type='relu', name=('%s_relu' % name))
# fc2
out = sym.FullyConnected(data=out, num_hidden=num_out, no_bias=False, name=('%s_fc2' % name))
out = sym.Activation(data=out, act_type='sigmoid', name=('%s_sigmoid' % name))
# rescale
out = sym.expand_dims(out, axis=2, name=('%s_expend1' % name))
out = sym.expand_dims(out, axis=3, name=('%s_expend2' % name)) # add spatial dims back
output = sym.broadcast_mul(data, out, name=('%s_mul' % name))
return output
# import mxnet as mx
#
# def SE_Block(sym, data, num_out, name):
# if type(num_out) is tuple:
# num_mid = (int(sum(num_out) / 16), 0)
# else:
# num_mid = int(num_out / 16)
#
# # global pooling
# out = sym.Pooling(data=data, pool_type='avg', kernel=(1, 1), global_pool=True, stride=(1, 1),
# name=('%s_pool' % name))
#
# # fc1
# out = mx.sym.Convolution(data=out, num_filter=num_mid, kernel=(1,1), stride=(1,1), pad=(0,0), name=('%s_fc1' % name))
# out = sym.Activation(data=out, act_type='relu', name=('%s_relu' % name))
#
# # fc2
# out = mx.sym.Convolution(data=out, num_filter=num_out, kernel=(1,1), stride=(1,1), pad=(0,0), name=('%s_fc2' % name))
# out = sym.Activation(data=out, act_type='sigmoid', name=('%s_sigmoid' % name))
#
# # rescale
# # out = sym.expand_dims(out, axis=2, name=('%s_expend1' % name))
# # out = sym.expand_dims(out, axis=3, name=('%s_expend2' % name)) # add spatial dims back
# output = sym.broadcast_mul(data, out, name=('%s_mul' % name))
#
# return output
| 36.285714
| 123
| 0.614611
| 353
| 2,286
| 3.813031
| 0.246459
| 0.059435
| 0.044577
| 0.059435
| 0.849926
| 0.833581
| 0.833581
| 0.833581
| 0.780089
| 0.728083
| 0
| 0.025303
| 0.204724
| 2,286
| 62
| 124
| 36.870968
| 0.715072
| 0.545494
| 0
| 0
| 0
| 0
| 0.088143
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.0625
| false
| 0
| 0
| 0
| 0.125
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
db3200396cb4bc973a5343e13243448f2426ec16
| 7,744
|
py
|
Python
|
pymaster/covariance.py
|
EiffL/NaMaster
|
41cc7839083511fe6be2eb20e93b8916c5c1f1f3
|
[
"BSD-3-Clause"
] | null | null | null |
pymaster/covariance.py
|
EiffL/NaMaster
|
41cc7839083511fe6be2eb20e93b8916c5c1f1f3
|
[
"BSD-3-Clause"
] | null | null | null |
pymaster/covariance.py
|
EiffL/NaMaster
|
41cc7839083511fe6be2eb20e93b8916c5c1f1f3
|
[
"BSD-3-Clause"
] | null | null | null |
from pymaster import nmtlib as lib
import numpy as np
class NmtCovarianceWorkspace(object) :
"""
NmtCovarianceWorkspace objects are used to compute and store the coupling coefficients needed to calculate the Gaussian covariance matrix under the Efstathiou approximation (astro-ph/0307515). When initialized, this object is practically empty. The information describing the coupling coefficients must be computed or read from a file afterwards.
"""
def __init__(self) :
self.wsp=None
def __del__(self) :
if(self.wsp is not None) :
lib.covar_workspace_free(self.wsp)
self.wsp=None
def read_from(self,fname) :
"""
Reads the contents of an NmtCovarianceWorkspace object from a file (encoded using an internal binary format).
:param str fname: input file name
"""
if self.wsp is not None :
lib.covar_workspace_free(self.wsp)
self.wsp=None
self.wsp=lib.read_covar_workspace(fname);
def compute_coupling_coefficients(self,wa,wb) :
"""
Computes coupling coefficients of the Gaussian covariance between the power spectra computed using wa and wb (two NmtWorkspace objects).
:param NmtWorkspace wa,wb: workspaces used to compute the two power spectra whose covariance matrix you want to compute.
"""
if self.wsp is not None :
lib.covar_workspace_free(self.wsp)
self.wsp=None
ns=wa.wsp.nside;
if(wa.wsp.nside!=wb.wsp.nside) :
raise ValueError("Everything should have the same resolution!")
if((wa.wsp.ncls!=1) or (wb.wsp.ncls!=1)) :
raise ValueError("Gaussian covariances only supported for spin-0 fields")
self.wsp=lib.covar_workspace_init_py(wa.wsp,wb.wsp)
def write_to(self,fname) :
"""
Writes the contents of an NmtCovarianceWorkspace object to a file (encoded using an internal binary format).
:param str fname: output file name
"""
if self.wsp is None :
raise ValueError("Must initialize workspace before writing")
lib.write_covar_workspace(self.wsp,fname)
class NmtCovarianceWorkspaceFlat(object) :
"""
NmtCovarianceWorkspaceFlat objects are used to compute and store the coupling coefficients needed to calculate the Gaussian covariance matrix under a flat-sky version the Efstathiou approximation (astro-ph/0307515). When initialized, this object is practically empty. The information describing the coupling coefficients must be computed or read from a file afterwards.
"""
def __init__(self) :
self.wsp=None
def __del__(self) :
if(self.wsp is not None) :
lib.covar_workspace_flat_free(self.wsp)
self.wsp=None
def read_from(self,fname) :
"""
Reads the contents of an NmtCovarianceWorkspaceFlat object from a file (encoded using an internal binary format).
:param str fname: input file name
"""
if self.wsp is not None :
lib.covar_workspace_flat_free(self.wsp)
self.wsp=None
self.wsp=lib.read_covar_workspace_flat(fname);
def compute_coupling_coefficients(self,wa,wb) :
"""
Computes coupling coefficients of the Gaussian covariance between the power spectra computed using wa and wb (two NmtWorkspaceFlat objects).
:param NmtWorkspaceFlat wa,wb: workspaces used to compute the two power spectra whose covariance matrix you want to compute.
"""
if((wa.wsp.fs.nx!=wb.wsp.fs.nx) or (wa.wsp.fs.ny!=wb.wsp.fs.ny)) :
raise ValueError("Everything should have the same resolution!")
if((wa.wsp.ncls!=1) or (wb.wsp.ncls!=1)) :
raise ValueError("Gaussian covariances only supported for spin-0 fields")
if self.wsp is not None :
lib.covar_workspace_flat_free(self.wsp)
self.wsp=None
self.wsp=lib.covar_workspace_flat_init_py(wa.wsp,wb.wsp)
def write_to(self,fname) :
"""
Writes the contents of an NmtCovarianceWorkspaceFlat object to a file (encoded using an internal binary format).
:param str fname: output file name
"""
if self.wsp is None :
raise ValueError("Must initialize workspace before writing")
lib.write_covar_workspace_flat(self.wsp,fname)
def gaussian_covariance(cw,cla1b1,cla1b2,cla2b1,cla2b2) :
"""
Computes Gaussian covariance matrix for power spectra using the information precomputed in cw (a NmtCovarianceWorkspace object). cw should have been initialized using the two NmtWorkspace objects used to compute these power spectra. The notation above assumes that these two NmtWorkspace objects, wa and wb, were used to compute the power spectra of four fields: a1 and a2 for wa, b1 and b2 for wb. Then, claXbY above should be a prediction for the power spectrum between fields aX and bY. These predicted input power spectra should be defined for all ells <=3*nside (where nside is the HEALPix resolution parameter of the fields that were correlated).
:param NmtCovarianceWorkspace cw: workspaces containing the precomputed coupling coefficients.
:param cla1b1: prediction for the cross-power spectrum between a1 and b1.
:param cla1b2: prediction for the cross-power spectrum between a1 and b2.
:param cla2b1: prediction for the cross-power spectrum between a2 and b1.
:param cla2b2: prediction for the cross-power spectrum between a2 and b2.
"""
if((len(cla1b1)!=cw.wsp.lmax_a+1) or (len(cla1b2)!=cw.wsp.lmax_a+1) or (len(cla2b1)!=cw.wsp.lmax_a+1) or (len(cla2b2)!=cw.wsp.lmax_a+1)) :
raise ValueError("Input C_ls have a weird length")
len_a=cw.wsp.ncls_a*cw.wsp.bin_a.n_bands
len_b=cw.wsp.ncls_b*cw.wsp.bin_b.n_bands
covar1d=lib.comp_gaussian_covariance(cw.wsp,cla1b1,cla1b2,cla2b1,cla2b2,len_a*len_b)
covar=np.reshape(covar1d,[len_a,len_b])
return covar
def gaussian_covariance_flat(cw,larr,cla1b1,cla1b2,cla2b1,cla2b2) :
"""
Computes Gaussian covariance matrix for flat-sky power spectra using the information precomputed in cw (a NmtCovarianceWorkspaceFlat object). cw should have been initialized using the two NmtWorkspaceFlat objects used to compute these power spectra. The notation above assumes that these two NmtWorkspaceFlat objects, wa and wb, were used to compute the power spectra of four fields: a1 and a2 for wa, b1 and b2 for wb. Then, claXbY above should be a prediction for the power spectrum between fields aX and bY. These predicted input power spectra should be defined in a sufficiently well sampled range of ells given themap properties from which the power spectra were computed. The values of ell at which they are sampled are given by larr.
:param NmtCovarianceWorkspaceFlat cw: workspaces containing the precomputed coupling coefficients.
:param larr: values of ell at which the following power spectra are computed.
:param cla1b1: prediction for the cross-power spectrum between a1 and b1.
:param cla1b2: prediction for the cross-power spectrum between a1 and b2.
:param cla2b1: prediction for the cross-power spectrum between a2 and b1.
:param cla2b2: prediction for the cross-power spectrum between a2 and b2.
"""
if((len(cla1b1)!=len(larr)) or (len(cla1b2)!=len(larr)) or (len(cla2b1)!=len(larr)) or (len(cla2b2)!=len(larr))) :
raise ValueError("Input C_ls have a weird length")
len_a=cw.wsp.ncls_a*cw.wsp.bin.n_bands
len_b=cw.wsp.ncls_b*cw.wsp.bin.n_bands
covar1d=lib.comp_gaussian_covariance_flat(cw.wsp,larr,cla1b1,cla1b2,cla2b1,cla2b2,len_a*len_b)
covar=np.reshape(covar1d,[len_a,len_b])
return covar
| 55.71223
| 744
| 0.713456
| 1,125
| 7,744
| 4.829333
| 0.161778
| 0.036076
| 0.02945
| 0.016197
| 0.829008
| 0.81189
| 0.794221
| 0.771397
| 0.749862
| 0.694644
| 0
| 0.019155
| 0.21126
| 7,744
| 138
| 745
| 56.115942
| 0.870334
| 0.528151
| 0
| 0.666667
| 0
| 0
| 0.098721
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.173913
| false
| 0
| 0.028986
| 0
| 0.26087
| 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
|
e1e9a93f9f28cfc461b99018fb7102066c47781f
| 58
|
py
|
Python
|
tests/__init__.py
|
hinihatetsu/protreim
|
01d9a2183399d6e9848cb7110af0e2220e1fe0fd
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
hinihatetsu/protreim
|
01d9a2183399d6e9848cb7110af0e2220e1fe0fd
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
hinihatetsu/protreim
|
01d9a2183399d6e9848cb7110af0e2220e1fe0fd
|
[
"MIT"
] | null | null | null |
from .test_config import *
from .test_interface import *
| 14.5
| 29
| 0.775862
| 8
| 58
| 5.375
| 0.625
| 0.372093
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155172
| 58
| 3
| 30
| 19.333333
| 0.877551
| 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
|
c017fc817dc705421f00942b065ccf6ae0ab1af0
| 157
|
py
|
Python
|
ostrawling/__init__.py
|
JacobRawling/OstrawlingMC
|
d87c12c8502a12c150ece0eac0fbe2c829062f6e
|
[
"MIT"
] | null | null | null |
ostrawling/__init__.py
|
JacobRawling/OstrawlingMC
|
d87c12c8502a12c150ece0eac0fbe2c829062f6e
|
[
"MIT"
] | null | null | null |
ostrawling/__init__.py
|
JacobRawling/OstrawlingMC
|
d87c12c8502a12c150ece0eac0fbe2c829062f6e
|
[
"MIT"
] | null | null | null |
from .generator import Generator
from .processes import *
from .argument_parser import *
from .saver import *
from .event import *
from .parameters import *
| 26.166667
| 32
| 0.77707
| 20
| 157
| 6.05
| 0.45
| 0.330579
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152866
| 157
| 6
| 33
| 26.166667
| 0.909774
| 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
|
c02e57424ba08060e6f67316e8741adf7b7fd653
| 537
|
py
|
Python
|
umbral-docker/tests/test.py
|
BigG-DSC/umbral-rs-client
|
7fc16b381551c420bc799f4a2f4c3e120028a192
|
[
"MIT"
] | null | null | null |
umbral-docker/tests/test.py
|
BigG-DSC/umbral-rs-client
|
7fc16b381551c420bc799f4a2f4c3e120028a192
|
[
"MIT"
] | null | null | null |
umbral-docker/tests/test.py
|
BigG-DSC/umbral-rs-client
|
7fc16b381551c420bc799f4a2f4c3e120028a192
|
[
"MIT"
] | null | null | null |
import requests
node_url = 'http://localhost:8022'
plaintext = 'Hello World!'
#alice = requests.get(node_url+"/stateless/keypair", timeout=None)
#signer = requests.get(node_url+"/stateless/signer", timeout=None)
#bob = requests.get(node_url+"/stateless/keypair", timeout=None)
alice = requests.get(node_url+"/stateless/keypair", timeout=None).json()
signer = requests.get(node_url+"/stateless/signer", timeout=None).json()
bob = requests.get(node_url+"/stateless/keypair", timeout=None).json()
print(alice)
print(signer)
print(bob)
| 29.833333
| 72
| 0.746741
| 73
| 537
| 5.39726
| 0.273973
| 0.124365
| 0.228426
| 0.274112
| 0.771574
| 0.771574
| 0.771574
| 0.771574
| 0.771574
| 0
| 0
| 0.008065
| 0.07635
| 537
| 17
| 73
| 31.588235
| 0.78629
| 0.359404
| 0
| 0
| 0
| 0
| 0.252199
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.111111
| 0
| 0.111111
| 0.333333
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 1
| 1
| 0
| 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
|
c035ea4046931e65892320ef3d0929ec6f3c2485
| 5,654
|
py
|
Python
|
unbalancedgw/vanilla_ugw_solver.py
|
6Ulm/unbalanced_gromov_wasserstein
|
be23571f653dab16fd0722cb1ec2c3412a1e3f30
|
[
"MIT"
] | 22
|
2020-09-10T21:57:02.000Z
|
2022-03-16T14:42:47.000Z
|
unbalancedgw/vanilla_ugw_solver.py
|
6Ulm/unbalanced_gromov_wasserstein
|
be23571f653dab16fd0722cb1ec2c3412a1e3f30
|
[
"MIT"
] | null | null | null |
unbalancedgw/vanilla_ugw_solver.py
|
6Ulm/unbalanced_gromov_wasserstein
|
be23571f653dab16fd0722cb1ec2c3412a1e3f30
|
[
"MIT"
] | 8
|
2020-09-11T00:59:31.000Z
|
2022-03-29T22:19:08.000Z
|
import torch
from ._vanilla_utils import init_plan, compute_local_cost, \
log_sinkhorn, exp_sinkhorn
def log_ugw_sinkhorn(a, dx, b, dy, init=None, eps=1.0,
rho=float("Inf"), rho2=None,
nits_plan=3000, tol_plan=1e-6,
nits_sinkhorn=3000, tol_sinkhorn=1e-6,
two_outputs=False):
"""Solves the regularized UGW problem, keeps only one plan as output.
the algorithm is run as much as possible in log-scale.
Parameters
----------
a: torch.Tensor of size [Batch, size_X]
Input measure of the first mm-space.
dx: torch.Tensor of size [Batch, size_X, size_X]
Input metric of the first mm-space.
b: torch.Tensor of size [Batch, size_Y]
Input measure of the second mm-space.
dy: torch.Tensor of size [Batch, size_Y, size_Y]
Input metric of the second mm-space.
init: torch.Tensor of size [Batch, size_X, size_Y]
Transport plan at initialization. Defaults to None and initializes
with tensor plan.
eps: float
Strength of entropic regularization.
rho: float
Strength of penalty on the first marginal of pi.
rho2: float
Strength of penalty on the first marginal of pi. If set to None it is
equal to rho.
nits_plan: int
Maximum number of iterations to update the plan pi.
tol_plan: float
Tolerance on convergence of plan.
nits_sinkhorn: int
Maximum number of iterations to update Sinkhorn potentials in inner loop.
tol_sinkhorn: float
Tolerance on convergence of Sinkhorn potentials.
two_outputs: bool
If set to True, outputs the two plans of the alternate minimization of UGW.
Returns
----------
pi: torch.Tensor of size [Batch, size_X, size_Y]
Transport plan
which is a stationary point of UGW. The output is not
in log-scale.
"""
if rho2 is None:
rho2 = rho
# Initialize plan and local cost
logpi = (init_plan(a, b, init=init) + 1e-30).log()
logpi_prev = torch.zeros_like(logpi)
up, vp = None, None
for i in range(nits_plan):
logpi_prev = logpi.clone()
lcost = compute_local_cost(logpi.exp(), a, dx, b, dy, eps, rho, rho2)
logmp = logpi.logsumexp(dim=(0, 1))
up, vp, logpi = log_sinkhorn(
lcost, up, vp, a, b, logmp.exp() + 1e-10, eps, rho, rho2,
nits_sinkhorn, tol_sinkhorn
)
if torch.any(torch.isnan(logpi)):
raise Exception(
f"Solver got NaN plan with params (eps, rho, rho2) "
f" = {eps, rho, rho2}. Try increasing argument eps."
)
logpi = (
0.5 * (logmp - logpi.logsumexp(dim=(0, 1)))
+ logpi
)
if (logpi - logpi_prev).abs().max().item() < tol_plan:
break
if two_outputs:
return logpi.exp(), logpi_prev.exp()
return logpi.exp()
def exp_ugw_sinkhorn(a, dx, b, dy, init=None, eps=1.0,
rho=float("Inf"), rho2=None,
nits_plan=3000, tol_plan=1e-6,
nits_sinkhorn=3000, tol_sinkhorn=1e-6,
two_outputs=False):
"""Solves the regularized UGW problem, keeps only one plan as output.
the algorithm is run as much as possible in log-scale.
Parameters
----------
a: torch.Tensor of size [Batch, size_X]
Input measure of the first mm-space.
dx: torch.Tensor of size [Batch, size_X, size_X]
Input metric of the first mm-space.
b: torch.Tensor of size [Batch, size_Y]
Input measure of the second mm-space.
dy: torch.Tensor of size [Batch, size_Y, size_Y]
Input metric of the second mm-space.
init: torch.Tensor of size [Batch, size_X, size_Y]
Transport plan at initialization. Defaults to None and initializes
with tensor plan.
eps: float
Strength of entropic regularization.
rho: float
Strength of penalty on the first marginal of pi.
rho2: float
Strength of penalty on the first marginal of pi. If set to None it is
equal to rho.
nits_plan: int
Maximum number of iterations to update the plan pi.
tol_plan: float
Tolerance on convergence of plan.
nits_sinkhorn: int
Maximum number of iterations to update Sinkhorn potentials in inner loop.
tol_sinkhorn: float
Tolerance on convergence of Sinkhorn potentials.
two_outputs: bool
If set to True, outputs the two plans of the alternate minimization of UGW.
Returns
----------
pi: torch.Tensor of size [Batch, size_X, size_Y]
Transport plan
which is a stationary point of UGW. The output is not
in log-scale.
"""
if rho2 is None:
rho2 = rho
# Initialize plan and local cost
pi = init_plan(a, b, init=init)
pi_prev = torch.zeros_like(pi)
up, vp = None, None
for i in range(nits_plan):
pi_prev = pi.clone()
mp = pi.sum()
ecost = (-compute_local_cost(pi, a, dx, b, dy, eps, rho, rho2) /
(mp * eps)).exp()
up, vp, pi = exp_sinkhorn(
ecost, up, vp, a, b, mp, eps, rho, rho2,
nits_sinkhorn, tol_sinkhorn
)
if torch.any(torch.isnan(pi)):
raise Exception(
f"Solver got NaN plan with params (eps, rho, rho2) "
f" = {eps, rho, rho2}. Try increasing argument eps or switch"
f" to log_ugw_sinkhorn method."
)
pi = (mp / pi.sum()).sqrt() * pi
if (pi - pi_prev).abs().max().item() < tol_plan:
break
if two_outputs:
return pi, pi_prev
return pi
| 30.896175
| 79
| 0.610364
| 823
| 5,654
| 4.094775
| 0.1774
| 0.039169
| 0.046291
| 0.060534
| 0.863501
| 0.863501
| 0.838576
| 0.82908
| 0.82908
| 0.82908
| 0
| 0.014145
| 0.299788
| 5,654
| 182
| 80
| 31.065934
| 0.83708
| 0.48815
| 0
| 0.393939
| 0
| 0
| 0.09278
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.030303
| false
| 0
| 0.030303
| 0
| 0.121212
| 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
|
c037b341a6c5ee43a37df5cb6dcd117bb46bab39
| 39
|
py
|
Python
|
based_latex/__init__.py
|
wircho/based_latex
|
3992eaacd4aa66b0a9d10cbf7bc73b848cdd8ce8
|
[
"MIT"
] | null | null | null |
based_latex/__init__.py
|
wircho/based_latex
|
3992eaacd4aa66b0a9d10cbf7bc73b848cdd8ce8
|
[
"MIT"
] | null | null | null |
based_latex/__init__.py
|
wircho/based_latex
|
3992eaacd4aa66b0a9d10cbf7bc73b848cdd8ce8
|
[
"MIT"
] | null | null | null |
from .formula import get_latex_svg_data
| 39
| 39
| 0.897436
| 7
| 39
| 4.571429
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 39
| 1
| 39
| 39
| 0.888889
| 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
|
c0569ff95ee01850b110eb1b5fb82c06c32731a4
| 8,891
|
py
|
Python
|
lib/smplify/losses.py
|
omidrk/computervisionPanopticToSMPLAuto
|
b84b60f0ec4ffdb4ae61348919a95f7bb2eab926
|
[
"MIT"
] | 6
|
2021-12-01T10:17:26.000Z
|
2022-01-18T11:48:18.000Z
|
lib/smplify/losses.py
|
omidrk/computervisionPanopticToSMPLAuto
|
b84b60f0ec4ffdb4ae61348919a95f7bb2eab926
|
[
"MIT"
] | 1
|
2021-12-09T02:29:50.000Z
|
2021-12-10T11:42:53.000Z
|
lib/smplify/losses.py
|
omidrk/computervisionPanopticToSMPLAuto
|
b84b60f0ec4ffdb4ae61348919a95f7bb2eab926
|
[
"MIT"
] | 1
|
2021-12-01T16:33:36.000Z
|
2021-12-01T16:33:36.000Z
|
# This script is the extended version of https://github.com/nkolot/SPIN/blob/master/smplify/losses.py to deal with
# sequences inputs.
import torch
from lib.models.spin import perspective_projection
from lib.models.smpl import JOINT_IDS
def gmof(x, sigma):
"""
Geman-McClure error function
"""
x_squared = x ** 2
sigma_squared = sigma ** 2
return (sigma_squared * x_squared) / (sigma_squared + x_squared)
def angle_prior(pose):
"""
Angle prior that penalizes unnatural bending of the knees and elbows
"""
# We subtract 3 because pose does not include the global rotation of the model
return torch.exp(
pose[:, [55 - 3, 58 - 3, 12 - 3, 15 - 3]] * torch.tensor([1., -1., -1, -1.], device=pose.device)) ** 2
def body_fitting_loss(body_pose, betas, model_joints, camera_t, camera_center,
joints_2d, joints_conf, pose_prior,
focal_length=5000, sigma=100, pose_prior_weight=4.78,
shape_prior_weight=5, angle_prior_weight=15.2,
output='sum'):
"""
Loss function for body fitting
"""
# pose_prior_weight = 1.
# shape_prior_weight = 1.
# angle_prior_weight = 1.
# sigma = 10.
batch_size = body_pose.shape[0]
rotation = torch.eye(3, device=body_pose.device).unsqueeze(0).expand(batch_size, -1, -1)
projected_joints = perspective_projection(model_joints, rotation, camera_t,
focal_length, camera_center)
# Weighted robust reprojection error
reprojection_error = gmof(projected_joints - joints_2d, sigma)
reprojection_loss = (joints_conf ** 2) * reprojection_error.sum(dim=-1)
# Pose prior loss
pose_prior_loss = (pose_prior_weight ** 2) * pose_prior(body_pose, betas)
# Angle prior for knees and elbows
angle_prior_loss = (angle_prior_weight ** 2) * angle_prior(body_pose).sum(dim=-1)
# Regularizer to prevent betas from taking large values
shape_prior_loss = (shape_prior_weight ** 2) * (betas ** 2).sum(dim=-1)
total_loss = reprojection_loss.sum(dim=-1) + pose_prior_loss + angle_prior_loss + shape_prior_loss
print(f'joints: {reprojection_loss[0].sum().item():.2f}, '
f'pose_prior: {pose_prior_loss[0].item():.2f}, '
f'angle_prior: {angle_prior_loss[0].item():.2f}, '
f'shape_prior: {shape_prior_loss[0].item():.2f}')
if output == 'sum':
return total_loss.sum()
elif output == 'reprojection':
return reprojection_loss
def camera_fitting_loss(model_joints, camera_t, camera_t_est, camera_center, joints_2d, joints_conf,
focal_length=5000, depth_loss_weight=100):
"""
Loss function for camera optimization.
"""
# Project model joints
batch_size = model_joints.shape[0]
rotation = torch.eye(3, device=model_joints.device).unsqueeze(0).expand(batch_size, -1, -1)
projected_joints = perspective_projection(model_joints, rotation, camera_t,
focal_length, camera_center)
op_joints = ['OP RHip', 'OP LHip', 'OP RShoulder', 'OP LShoulder']
op_joints_ind = [JOINT_IDS[joint] for joint in op_joints]
gt_joints = ['Right Hip', 'Left Hip', 'Right Shoulder', 'Left Shoulder']
gt_joints_ind = [JOINT_IDS[joint] for joint in gt_joints]
reprojection_error_op = (joints_2d[:, op_joints_ind] -
projected_joints[:, op_joints_ind]) ** 2
reprojection_error_gt = (joints_2d[:, gt_joints_ind] -
projected_joints[:, gt_joints_ind]) ** 2
# Check if for each example in the batch all 4 OpenPose detections are valid, otherwise use the GT detections
# OpenPose joints are more reliable for this task, so we prefer to use them if possible
is_valid = (joints_conf[:, op_joints_ind].min(dim=-1)[0][:, None, None] > 0).float()
reprojection_loss = (is_valid * reprojection_error_op + (1 - is_valid) * reprojection_error_gt).sum(dim=(1, 2))
# Loss that penalizes deviation from depth estimate
depth_loss = (depth_loss_weight ** 2) * (camera_t[:, 2] - camera_t_est[:, 2]) ** 2
total_loss = reprojection_loss + depth_loss
return total_loss.sum()
def temporal_body_fitting_loss(body_pose, betas, model_joints, camera_t, camera_center,
joints_2d, joints_conf, pose_prior,
focal_length=5000, sigma=100, pose_prior_weight=4.78,
shape_prior_weight=5, angle_prior_weight=15.2,
smooth_2d_weight=0.01, smooth_3d_weight=1.0,
output='sum'):
"""
Loss function for body fitting
"""
# pose_prior_weight = 1.
# shape_prior_weight = 1.
# angle_prior_weight = 1.
# sigma = 10.
batch_size = body_pose.shape[0]
rotation = torch.eye(3, device=body_pose.device).unsqueeze(0).expand(batch_size, -1, -1)
projected_joints = perspective_projection(model_joints, rotation, camera_t,
focal_length, camera_center)
# Weighted robust reprojection error
reprojection_error = gmof(projected_joints - joints_2d, sigma)
reprojection_loss = (joints_conf ** 2) * reprojection_error.sum(dim=-1)
# Pose prior loss
pose_prior_loss = (pose_prior_weight ** 2) * pose_prior(body_pose, betas)
# Angle prior for knees and elbows
angle_prior_loss = (angle_prior_weight ** 2) * angle_prior(body_pose).sum(dim=-1)
# Regularizer to prevent betas from taking large values
shape_prior_loss = (shape_prior_weight ** 2) * (betas ** 2).sum(dim=-1)
total_loss = reprojection_loss.sum(dim=-1) + pose_prior_loss + angle_prior_loss + shape_prior_loss
# Smooth 2d joint loss
joint_conf_diff = joints_conf[1:]
joints_2d_diff = projected_joints[1:] - projected_joints[:-1]
smooth_j2d_loss = (joint_conf_diff ** 2) * joints_2d_diff.abs().sum(dim=-1)
smooth_j2d_loss = torch.cat(
[torch.zeros(1, smooth_j2d_loss.shape[1], device=body_pose.device), smooth_j2d_loss]
).sum(dim=-1)
smooth_j2d_loss = (smooth_2d_weight ** 2) * smooth_j2d_loss
# Smooth 3d joint loss
joints_3d_diff = model_joints[1:] - model_joints[:-1]
# joints_3d_diff = joints_3d_diff * 100.
smooth_j3d_loss = (joint_conf_diff ** 2) * joints_3d_diff.abs().sum(dim=-1)
smooth_j3d_loss = torch.cat(
[torch.zeros(1, smooth_j3d_loss.shape[1], device=body_pose.device), smooth_j3d_loss]
).sum(dim=-1)
smooth_j3d_loss = (smooth_3d_weight ** 2) * smooth_j3d_loss
total_loss += smooth_j2d_loss + smooth_j3d_loss
# print(f'joints: {reprojection_loss[0].sum().item():.2f}, '
# f'pose_prior: {pose_prior_loss[0].item():.2f}, '
# f'angle_prior: {angle_prior_loss[0].item():.2f}, '
# f'shape_prior: {shape_prior_loss[0].item():.2f}, '
# f'smooth_j2d: {smooth_j2d_loss.sum().item()}, '
# f'smooth_j3d: {smooth_j3d_loss.sum().item()}')
if output == 'sum':
return total_loss.sum()
elif output == 'reprojection':
return reprojection_loss
def temporal_camera_fitting_loss(model_joints, camera_t, camera_t_est, camera_center, joints_2d, joints_conf,
focal_length=5000, depth_loss_weight=100):
"""
Loss function for camera optimization.
"""
# Project model joints
batch_size = model_joints.shape[0]
rotation = torch.eye(3, device=model_joints.device).unsqueeze(0).expand(batch_size, -1, -1)
projected_joints = perspective_projection(model_joints, rotation, camera_t,
focal_length, camera_center)
op_joints = ['OP RHip', 'OP LHip', 'OP RShoulder', 'OP LShoulder']
op_joints_ind = [JOINT_IDS[joint] for joint in op_joints]
# gt_joints = ['Right Hip', 'Left Hip', 'Right Shoulder', 'Left Shoulder']
# gt_joints_ind = [constants.JOINT_IDS[joint] for joint in gt_joints]
reprojection_error_op = (joints_2d[:, op_joints_ind] -
projected_joints[:, op_joints_ind]) ** 2
# reprojection_error_gt = (joints_2d[:, gt_joints_ind] -
# projected_joints[:, gt_joints_ind]) ** 2
# Check if for each example in the batch all 4 OpenPose detections are valid, otherwise use the GT detections
# OpenPose joints are more reliable for this task, so we prefer to use them if possible
is_valid = (joints_conf[:, op_joints_ind].min(dim=-1)[0][:, None, None] > 0).float()
reprojection_loss = (is_valid * reprojection_error_op).sum(dim=(1, 2))
# Loss that penalizes deviation from depth estimate
depth_loss = (depth_loss_weight ** 2) * (camera_t[:, 2] - camera_t_est[:, 2]) ** 2
total_loss = reprojection_loss + depth_loss
return total_loss.sum()
| 44.233831
| 115
| 0.652907
| 1,216
| 8,891
| 4.476151
| 0.136513
| 0.036744
| 0.018005
| 0.015433
| 0.827301
| 0.825831
| 0.801029
| 0.790373
| 0.777145
| 0.777145
| 0
| 0.031662
| 0.232707
| 8,891
| 200
| 116
| 44.455
| 0.766198
| 0.235744
| 0
| 0.633663
| 0
| 0
| 0.051313
| 0.020555
| 0
| 0
| 0
| 0
| 0
| 1
| 0.059406
| false
| 0
| 0.029703
| 0
| 0.168317
| 0.009901
| 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
|
fbf6213f6f9ccba3cbb14f7864c86bda22d15f56
| 102
|
py
|
Python
|
homography/__init__.py
|
exhaustin/pytorch-homography
|
8e4243069d3974115181e9df8301a412a8f07e93
|
[
"MIT"
] | null | null | null |
homography/__init__.py
|
exhaustin/pytorch-homography
|
8e4243069d3974115181e9df8301a412a8f07e93
|
[
"MIT"
] | null | null | null |
homography/__init__.py
|
exhaustin/pytorch-homography
|
8e4243069d3974115181e9df8301a412a8f07e93
|
[
"MIT"
] | null | null | null |
from .planar import PlanarHomographyTransformer
from .pointwise import PointwiseHomographyTransformer
| 34
| 53
| 0.901961
| 8
| 102
| 11.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078431
| 102
| 2
| 54
| 51
| 0.978723
| 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
|
97ec048e7c9c60856041820e8ff4c7c2f6209f3f
| 82
|
py
|
Python
|
app/client/src/couchers/__init__.py
|
lpmi-13/couchers
|
4b69ed3192daede93d645b6c26f9acb3db03a2ea
|
[
"MIT"
] | null | null | null |
app/client/src/couchers/__init__.py
|
lpmi-13/couchers
|
4b69ed3192daede93d645b6c26f9acb3db03a2ea
|
[
"MIT"
] | 38
|
2022-02-10T16:32:53.000Z
|
2022-03-28T13:43:24.000Z
|
app/client/src/couchers/__init__.py
|
lpmi-13/couchers
|
4b69ed3192daede93d645b6c26f9acb3db03a2ea
|
[
"MIT"
] | null | null | null |
from .client import get_client
from .client import version as __version__ # noqa
| 27.333333
| 50
| 0.804878
| 12
| 82
| 5.083333
| 0.583333
| 0.327869
| 0.52459
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.158537
| 82
| 2
| 51
| 41
| 0.884058
| 0.04878
| 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
|
97f05f781c648e21d4650b42e20c0de60a7a6409
| 347
|
py
|
Python
|
CalibMuon/Configuration/python/CSC_FakeDBConditions_cff.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 852
|
2015-01-11T21:03:51.000Z
|
2022-03-25T21:14:00.000Z
|
CalibMuon/Configuration/python/CSC_FakeDBConditions_cff.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 30,371
|
2015-01-02T00:14:40.000Z
|
2022-03-31T23:26:05.000Z
|
CalibMuon/Configuration/python/CSC_FakeDBConditions_cff.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 3,240
|
2015-01-02T05:53:18.000Z
|
2022-03-31T17:24:21.000Z
|
import FWCore.ParameterSet.Config as cms
from CalibMuon.CSCCalibration.CSCFakeDBGains_cfi import *
from CalibMuon.CSCCalibration.CSCFakeDBPedestals_cfi import *
from CalibMuon.CSCCalibration.CSCFakeDBNoiseMatrix_cfi import *
from CalibMuon.CSCCalibration.CSCFakeDBCrosstalk_cfi import *
from CalibMuon.CSCCalibration.CSC_BadChambers_cfi import *
| 43.375
| 63
| 0.878963
| 37
| 347
| 8.081081
| 0.432432
| 0.217391
| 0.451505
| 0.294314
| 0.481605
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072046
| 347
| 7
| 64
| 49.571429
| 0.928571
| 0
| 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
|
3f4cb876c705e90596571df6e7977c0b433ddfed
| 45
|
py
|
Python
|
clipboard_memo/__init__.py
|
arafsheikh/clipboard-memo
|
7e851b2e70063af878f0b8cef075f6923b2809cb
|
[
"MIT"
] | null | null | null |
clipboard_memo/__init__.py
|
arafsheikh/clipboard-memo
|
7e851b2e70063af878f0b8cef075f6923b2809cb
|
[
"MIT"
] | null | null | null |
clipboard_memo/__init__.py
|
arafsheikh/clipboard-memo
|
7e851b2e70063af878f0b8cef075f6923b2809cb
|
[
"MIT"
] | null | null | null |
from clipboard_memo.main import ClipboardMemo
| 45
| 45
| 0.911111
| 6
| 45
| 6.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066667
| 45
| 1
| 45
| 45
| 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
|
3f674ca3350ccfe310656c1e6d6a9bcb77337076
| 49
|
py
|
Python
|
HW7/SoKKoS/CW_7_2.py
|
kolyasalubov/Lv-677.PythonCore
|
c9f9107c734a61e398154a90b8a3e249276c2704
|
[
"MIT"
] | null | null | null |
HW7/SoKKoS/CW_7_2.py
|
kolyasalubov/Lv-677.PythonCore
|
c9f9107c734a61e398154a90b8a3e249276c2704
|
[
"MIT"
] | null | null | null |
HW7/SoKKoS/CW_7_2.py
|
kolyasalubov/Lv-677.PythonCore
|
c9f9107c734a61e398154a90b8a3e249276c2704
|
[
"MIT"
] | 6
|
2022-02-22T22:30:49.000Z
|
2022-03-28T12:51:19.000Z
|
def reverse_list(l):
return list(reversed(l))
| 24.5
| 28
| 0.714286
| 8
| 49
| 4.25
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 49
| 2
| 28
| 24.5
| 0.809524
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 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
|
58eb3d9e61030cb1089b83494783ae938e45f697
| 155
|
py
|
Python
|
scripts/test_script.py
|
quantfiction/Modern-Renaissance
|
2b21003fc3bdb304a740687933f28923930cfb86
|
[
"BSD-3-Clause"
] | null | null | null |
scripts/test_script.py
|
quantfiction/Modern-Renaissance
|
2b21003fc3bdb304a740687933f28923930cfb86
|
[
"BSD-3-Clause"
] | null | null | null |
scripts/test_script.py
|
quantfiction/Modern-Renaissance
|
2b21003fc3bdb304a740687933f28923930cfb86
|
[
"BSD-3-Clause"
] | 1
|
2021-09-27T11:04:11.000Z
|
2021-09-27T11:04:11.000Z
|
from modern_renaissance.log import logger_init
from modern_renaissance.modern_renaissance import test_logger
if __name__ == "__main__":
test_logger()
| 25.833333
| 61
| 0.825806
| 20
| 155
| 5.7
| 0.55
| 0.447368
| 0.368421
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116129
| 155
| 5
| 62
| 31
| 0.832117
| 0
| 0
| 0
| 0
| 0
| 0.051613
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 6
|
58f249e806d94f7d42e59d60057a5c92146a1a34
| 128
|
py
|
Python
|
scripts/configure-file.py
|
kasymovga/taisei
|
8aad971114186b0679ac5447381c427d7319fe21
|
[
"CC-BY-4.0"
] | 573
|
2017-10-12T17:48:57.000Z
|
2022-03-28T05:44:43.000Z
|
scripts/configure-file.py
|
kasymovga/taisei
|
8aad971114186b0679ac5447381c427d7319fe21
|
[
"CC-BY-4.0"
] | 153
|
2017-10-18T19:51:33.000Z
|
2022-03-31T11:06:40.000Z
|
scripts/configure-file.py
|
kasymovga/taisei
|
8aad971114186b0679ac5447381c427d7319fe21
|
[
"CC-BY-4.0"
] | 72
|
2017-11-17T17:32:46.000Z
|
2022-03-23T11:36:33.000Z
|
#!/usr/bin/env python3
import taiseilib.common
import taiseilib.configure
taiseilib.common.run_main(taiseilib.configure.main)
| 18.285714
| 51
| 0.828125
| 17
| 128
| 6.176471
| 0.588235
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008403
| 0.070313
| 128
| 6
| 52
| 21.333333
| 0.87395
| 0.164063
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 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
|
58fb6f114e8da8b41d2ccb3b3a6bb523ef277da5
| 28
|
py
|
Python
|
transforms/noop.py
|
wikipathways/pathway-figure-ocr
|
970573463ca275de3aaf60df859b96868944dec1
|
[
"Apache-2.0"
] | 8
|
2018-05-16T10:05:11.000Z
|
2020-11-12T23:37:03.000Z
|
transforms/noop.py
|
hiplot/pathway-figure-ocr
|
ca6c9cc526bcd90084e739cbae0885aa6a948af8
|
[
"Apache-2.0"
] | 35
|
2018-03-24T02:21:22.000Z
|
2022-03-31T19:53:32.000Z
|
transforms/noop.py
|
hiplot/pathway-figure-ocr
|
ca6c9cc526bcd90084e739cbae0885aa6a948af8
|
[
"Apache-2.0"
] | 4
|
2018-01-17T21:09:44.000Z
|
2020-11-09T15:02:46.000Z
|
def noop(x):
return [x]
| 9.333333
| 14
| 0.535714
| 5
| 28
| 3
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.285714
| 28
| 2
| 15
| 14
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 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
|
45197c45488794f56f119dd4473868ef14149e4e
| 140
|
py
|
Python
|
src/UcsSdk/utils/__init__.py
|
noironetworks/UcsPythonSDK
|
bf6b07d6abeacb922c92b198352eda4eb9e4629b
|
[
"Apache-2.0"
] | 13
|
2015-01-16T15:36:56.000Z
|
2019-04-12T02:48:53.000Z
|
src/UcsSdk/utils/__init__.py
|
noironetworks/UcsPythonSDK
|
bf6b07d6abeacb922c92b198352eda4eb9e4629b
|
[
"Apache-2.0"
] | 4
|
2015-06-12T03:36:11.000Z
|
2015-07-29T18:39:42.000Z
|
src/UcsSdk/utils/__init__.py
|
noironetworks/UcsPythonSDK
|
bf6b07d6abeacb922c92b198352eda4eb9e4629b
|
[
"Apache-2.0"
] | 13
|
2015-07-01T09:17:37.000Z
|
2020-03-10T03:26:25.000Z
|
from exception import *
from generic import *
from helper import *
from management import *
from power import *
from spmanager import *
| 23.333333
| 25
| 0.757143
| 18
| 140
| 5.888889
| 0.444444
| 0.471698
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 140
| 6
| 26
| 23.333333
| 0.946429
| 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
|
18a7f74015524b8b6ecafec0616dbcb91ba54778
| 741
|
py
|
Python
|
dragoneye/__init__.py
|
tolidano/dragoneye
|
1340e2b1fdc1c80c7dbce5e8a6c7f4e28b16808d
|
[
"MIT"
] | 23
|
2021-04-08T16:00:27.000Z
|
2022-03-03T22:01:42.000Z
|
dragoneye/__init__.py
|
mirzajb/dragoneye
|
c7593640093a9178a55dd32c738bbf0b1cf49d5e
|
[
"MIT"
] | 70
|
2021-04-12T16:37:43.000Z
|
2022-01-17T11:33:58.000Z
|
dragoneye/__init__.py
|
mirzajb/dragoneye
|
c7593640093a9178a55dd32c738bbf0b1cf49d5e
|
[
"MIT"
] | 7
|
2021-04-29T08:28:43.000Z
|
2022-03-03T22:01:45.000Z
|
from dragoneye.cloud_scanner.aws.aws_scan_settings import AwsCloudScanSettings
from dragoneye.cloud_scanner.azure.azure_scan_settings import AzureCloudScanSettings
from dragoneye.cloud_scanner.gcp.gcp_scan_settings import GcpCloudScanSettings
from dragoneye.cloud_scanner.aws.aws_scanner import AwsScanner
from dragoneye.cloud_scanner.azure.azure_scanner import AzureScanner
from dragoneye.cloud_scanner.gcp.gcp_scanner import GcpScanner
from dragoneye.cloud_scanner.aws.aws_session_factory import AwsSessionFactory
from dragoneye.cloud_scanner.azure.azure_authorizer import AzureAuthorizer
from dragoneye.cloud_scanner.gcp.gcp_credentials_factory import GcpCredentialsFactory
from dragoneye.utils.app_logger import logger, add_file_handler
| 67.363636
| 85
| 0.904184
| 96
| 741
| 6.708333
| 0.302083
| 0.201863
| 0.251553
| 0.349379
| 0.451863
| 0.451863
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055331
| 741
| 10
| 86
| 74.1
| 0.92
| 0
| 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
|
18dc33768dfef10c4021570f9167ffb401c0f9c5
| 5,876
|
py
|
Python
|
tests/tests_test_workflow/test_dependency_installer.py
|
owaiskazi19/opensearch-build
|
e162aec9bd59b795d8f35ae8202b24b75afe9376
|
[
"Apache-2.0"
] | null | null | null |
tests/tests_test_workflow/test_dependency_installer.py
|
owaiskazi19/opensearch-build
|
e162aec9bd59b795d8f35ae8202b24b75afe9376
|
[
"Apache-2.0"
] | null | null | null |
tests/tests_test_workflow/test_dependency_installer.py
|
owaiskazi19/opensearch-build
|
e162aec9bd59b795d8f35ae8202b24b75afe9376
|
[
"Apache-2.0"
] | null | null | null |
import os
import unittest
from unittest.mock import MagicMock, patch
from manifests.build_manifest import BuildManifest
from manifests.bundle_manifest import BundleManifest
from test_workflow.dependency_installer import DependencyInstaller
class DependencyInstallerTests(unittest.TestCase):
DATA = os.path.join(os.path.dirname(__file__), "data")
BUILD_MANIFEST = os.path.join(DATA, "local", "builds", "manifest.yml")
DIST_MANIFEST_LOCAL = os.path.join(DATA, "local", "dist", "manifest.yml")
DIST_MANIFEST_REMOTE = os.path.join(DATA, "remote", "dist", "manifest.yml")
@patch("concurrent.futures.ThreadPoolExecutor", return_value=MagicMock())
@patch("os.makedirs")
@patch("shutil.copyfile")
@patch("urllib.request.urlretrieve")
def test_install_maven_dependencies_local(self, mock_request, mock_copyfile, mock_makedirs, mock_threadpool):
def submit_and_run(callable, source, dest):
# Filter down the actual calls to make analyzing failures easier
if 'alerting-notification-1.2.0.0.jar' in source:
return callable(source, dest)
return None
mock_threadpool.return_value.__enter__().submit.side_effect = submit_and_run
dependency_installer = DependencyInstaller(
self.DATA,
BuildManifest.from_path(self.BUILD_MANIFEST),
BundleManifest.from_path(self.DIST_MANIFEST_LOCAL)
)
dependency_installer.install_maven_dependencies()
self.assertEqual(mock_threadpool.call_count, 4)
self.assertEqual(mock_threadpool().__enter__().submit.call_count, 2375)
mock_makedirs.assert_called_with(
os.path.realpath(
os.path.join(
dependency_installer.maven_local_path, "org", "opensearch", "notification"
)
),
exist_ok=True
)
mock_request.assert_not_called()
mock_copyfile.assert_called_with(
os.path.join(self.DATA, "builds", "maven", "org", "opensearch", "notification", "alerting-notification-1.2.0.0.jar"),
os.path.realpath(os.path.join(dependency_installer.maven_local_path, "org", "opensearch", "notification", "alerting-notification-1.2.0.0.jar"))
)
@patch("concurrent.futures.ThreadPoolExecutor", return_value=MagicMock())
@patch("os.makedirs")
@patch("shutil.copyfile")
@patch("urllib.request.urlretrieve")
def test_install_maven_dependencies_remote(self, mock_request, mock_copyfile, mock_makedirs, mock_threadpool):
def submit_and_run(callable, source, dest):
# Filter down the actual calls to make analyzing failures easier
if 'alerting-notification-1.2.0.0.jar' in source:
return callable(source, dest)
return None
mock_threadpool.return_value.__enter__().submit.side_effect = submit_and_run
dependency_installer = DependencyInstaller(
"https://ci.opensearch.org/x/y",
BuildManifest.from_path(self.BUILD_MANIFEST),
BundleManifest.from_path(self.DIST_MANIFEST_REMOTE)
)
dependency_installer.install_maven_dependencies()
self.assertEqual(mock_threadpool.call_count, 4)
self.assertEqual(mock_threadpool().__enter__().submit.call_count, 2375)
mock_makedirs.assert_called_with(
os.path.realpath(
os.path.join(
dependency_installer.maven_local_path, "org", "opensearch", "notification"
)
),
exist_ok=True
)
mock_copyfile.assert_not_called()
mock_request.assert_called_with(
"https://ci.opensearch.org/x/y/builds/maven/org/opensearch/notification/alerting-notification-1.2.0.0.jar",
os.path.realpath(os.path.join(dependency_installer.maven_local_path, "org", "opensearch", "notification", "alerting-notification-1.2.0.0.jar"))
)
@patch("os.makedirs")
@patch("shutil.copyfile")
@patch("urllib.request.urlretrieve")
def test_install_build_dependencies_local(self, mock_request, mock_copyfile, mock_makedirs):
dependency_installer = DependencyInstaller(
self.DATA,
BuildManifest.from_path(self.BUILD_MANIFEST),
BundleManifest.from_path(self.DIST_MANIFEST_LOCAL)
)
dependencies = dict({"opensearch-job-scheduler": "1.1.0.0"})
dependency_installer.install_build_dependencies(dependencies, os.path.dirname(__file__))
mock_makedirs.assert_called_with(os.path.dirname(__file__), exist_ok=True)
mock_request.assert_not_called()
mock_copyfile.assert_called_once_with(
os.path.join(self.DATA, "builds", "plugins", "opensearch-job-scheduler-1.1.0.0.zip"),
os.path.realpath(os.path.join(os.path.dirname(__file__), "opensearch-job-scheduler-1.1.0.0.zip")),
)
@patch("os.makedirs")
@patch("shutil.copyfile")
@patch("urllib.request.urlretrieve")
def test_install_build_dependencies_remote(self, mock_request, mock_copyfile, mock_makedirs):
dependency_installer = DependencyInstaller(
"https://ci.opensearch.org/x/y", BuildManifest.from_path(self.BUILD_MANIFEST), BundleManifest.from_path(self.DIST_MANIFEST_REMOTE)
)
dependencies = dict({"opensearch-job-scheduler": "1.1.0.0"})
dependency_installer.install_build_dependencies(dependencies, os.path.dirname(__file__))
mock_makedirs.assert_called_with(os.path.dirname(__file__), exist_ok=True)
mock_copyfile.assert_not_called()
mock_request.assert_called_once_with(
"https://ci.opensearch.org/x/y/builds/plugins/opensearch-job-scheduler-1.1.0.0.zip",
os.path.realpath(os.path.join(os.path.dirname(__file__), "opensearch-job-scheduler-1.1.0.0.zip")),
)
| 50.655172
| 155
| 0.686521
| 686
| 5,876
| 5.593294
| 0.14723
| 0.039093
| 0.031274
| 0.031014
| 0.899401
| 0.889497
| 0.889497
| 0.870993
| 0.857441
| 0.851707
| 0
| 0.012309
| 0.198094
| 5,876
| 115
| 156
| 51.095652
| 0.801995
| 0.021273
| 0
| 0.638095
| 0
| 0.019048
| 0.187717
| 0.086813
| 0
| 0
| 0
| 0
| 0.152381
| 1
| 0.057143
| false
| 0
| 0.057143
| 0
| 0.2
| 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
|
7a1a209eceeaddf6d57e6a293b2bf91189d2c971
| 154
|
py
|
Python
|
Apps/Users/admin.py
|
ResidenciApp/ResidenciAppServidor
|
7cc8c66bc07d198be37232fdc74d64227d14ce3d
|
[
"MIT"
] | 2
|
2019-10-31T03:21:07.000Z
|
2019-12-11T16:25:33.000Z
|
Apps/Users/admin.py
|
ResidenciApp/ResidenciAppServidor
|
7cc8c66bc07d198be37232fdc74d64227d14ce3d
|
[
"MIT"
] | 6
|
2021-03-19T02:43:26.000Z
|
2022-02-10T10:42:00.000Z
|
Apps/Users/admin.py
|
lmbaeza/ResidenciAppServidor
|
7cc8c66bc07d198be37232fdc74d64227d14ce3d
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import People, Role, Owner
admin.site.register(People)
admin.site.register(Role)
admin.site.register(Owner)
| 25.666667
| 39
| 0.811688
| 23
| 154
| 5.434783
| 0.478261
| 0.216
| 0.408
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.084416
| 154
| 6
| 40
| 25.666667
| 0.886525
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 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
|
e16840bab4279636cd14663ac9df886384580195
| 159
|
py
|
Python
|
wot/__init__.py
|
gamazeps/wot
|
623bcdc78ad1fab43b3e05b467f961648741a7a0
|
[
"BSD-3-Clause"
] | null | null | null |
wot/__init__.py
|
gamazeps/wot
|
623bcdc78ad1fab43b3e05b467f961648741a7a0
|
[
"BSD-3-Clause"
] | null | null | null |
wot/__init__.py
|
gamazeps/wot
|
623bcdc78ad1fab43b3e05b467f961648741a7a0
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
import wot.io
import wot.simulate
import wot.tmap
from .dataset_util import *
from .gene_set_scores import *
from .population import *
| 19.875
| 30
| 0.742138
| 24
| 159
| 4.791667
| 0.625
| 0.234783
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007353
| 0.144654
| 159
| 7
| 31
| 22.714286
| 0.838235
| 0.132075
| 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
|
e16fe4bca4c3599f69b345146ecc0af6fdda7ab9
| 539
|
py
|
Python
|
cplxmodule/cplxmodule/nn/relevance/extensions/__init__.py
|
veya2ztn/mltool
|
4ed151152845ebe3de128e1f53c478581c1492e4
|
[
"IJG"
] | 86
|
2019-04-25T06:23:40.000Z
|
2022-03-31T07:33:03.000Z
|
cplxmodule/cplxmodule/nn/relevance/extensions/__init__.py
|
veya2ztn/mltool
|
4ed151152845ebe3de128e1f53c478581c1492e4
|
[
"IJG"
] | 20
|
2020-04-14T12:51:21.000Z
|
2022-01-08T11:33:03.000Z
|
cplxmodule/cplxmodule/nn/relevance/extensions/__init__.py
|
veya2ztn/mltool
|
4ed151152845ebe3de128e1f53c478581c1492e4
|
[
"IJG"
] | 27
|
2019-04-26T13:48:01.000Z
|
2022-03-07T07:33:02.000Z
|
from .complex import CplxLinearVDScaleFree, CplxBilinearVDScaleFree
from .complex import CplxConv1dVDScaleFree, CplxConv2dVDScaleFree
from .complex import CplxConv3dVDScaleFree
from .complex import CplxLinearVDApprox, CplxBilinearVDApprox
from .complex import CplxConv1dVDApprox, CplxConv2dVDApprox
from .complex import CplxConv3dVDApprox
from .complex import CplxLinearVDBogus, CplxBilinearVDBogus
from .complex import CplxConv1dVDBogus, CplxConv2dVDBogus
from .complex import CplxConv3dVDBogus
from .real import LinearL0, LinearLASSO
| 38.5
| 67
| 0.875696
| 47
| 539
| 10.042553
| 0.446809
| 0.209746
| 0.324153
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02045
| 0.092764
| 539
| 13
| 68
| 41.461538
| 0.944785
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| null | 1
| 1
| 0
| 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
|
e1b4678f08e02196877bfa09b181385c4a70511f
| 251
|
py
|
Python
|
psych_metric/distrib/bnn/__init__.py
|
prijatelj/bayesian_eval_ground_truth-free
|
c0e569c78d63beb79f5e1e727c322293c3584323
|
[
"MIT"
] | 1
|
2021-12-26T05:55:46.000Z
|
2021-12-26T05:55:46.000Z
|
psych_metric/distrib/bnn/__init__.py
|
prijatelj/bayesian_eval_ground_truth-free
|
c0e569c78d63beb79f5e1e727c322293c3584323
|
[
"MIT"
] | null | null | null |
psych_metric/distrib/bnn/__init__.py
|
prijatelj/bayesian_eval_ground_truth-free
|
c0e569c78d63beb79f5e1e727c322293c3584323
|
[
"MIT"
] | null | null | null |
from psych_metric.distrib.bnn import bnn_mcmc
from psych_metric.distrib.bnn import mcmc
# TODO need to fix the namespace such that only what I want from each file is
# pulled into the package, not tensorflow as tf being accessible from these
# files.
| 41.833333
| 77
| 0.804781
| 44
| 251
| 4.522727
| 0.75
| 0.090452
| 0.150754
| 0.221106
| 0.311558
| 0.311558
| 0
| 0
| 0
| 0
| 0
| 0
| 0.159363
| 251
| 5
| 78
| 50.2
| 0.943128
| 0.621514
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
bede8a6d53f679171f5478a92fdb01557999677e
| 3,596
|
py
|
Python
|
hoomd/hpmc/test-py/get_type_shapes.py
|
PetersResearchGroup/PCND
|
584768cc683a6df0152ead69b567d05b781aab2b
|
[
"BSD-3-Clause"
] | 1
|
2019-05-21T00:48:37.000Z
|
2019-05-21T00:48:37.000Z
|
hoomd/hpmc/test-py/get_type_shapes.py
|
PetersResearchGroup/PCND
|
584768cc683a6df0152ead69b567d05b781aab2b
|
[
"BSD-3-Clause"
] | null | null | null |
hoomd/hpmc/test-py/get_type_shapes.py
|
PetersResearchGroup/PCND
|
584768cc683a6df0152ead69b567d05b781aab2b
|
[
"BSD-3-Clause"
] | null | null | null |
import hoomd
from hoomd import hpmc
import unittest
hoomd.context.initialize()
print(hoomd.__file__)
class test_type_shapes(unittest.TestCase):
def setUp(self):
hoomd.context.initialize()
def test_type_shapes_convex_polygon(self):
box = hoomd.data.boxdim(10, dimensions=2)
snap = hoomd.data.make_snapshot(N=2, box=box)
snap.particles.types = ['A']
self.system = hoomd.init.read_snapshot(snap)
self.mc = hpmc.integrate.convex_polygon(seed=10);
test_verts = [(1, 0), (0, 1), (-1, -1)]
self.mc.shape_param.set('A', vertices=test_verts)
shape_types = self.mc.get_type_shapes()
self.assertEqual(shape_types[0]['type'], 'Polygon')
self.assertEqual(len(shape_types[0]['vertices']), 3)
self.assertTrue(all([shape_types[0]['vertices'][i] == list(test_verts[i]) for i in range(len(test_verts))]))
def test_type_shapes_simple_polygon(self):
box = hoomd.data.boxdim(10, dimensions=2)
snap = hoomd.data.make_snapshot(N=2, box=box)
snap.particles.types = ['A']
self.system = hoomd.init.read_snapshot(snap)
self.mc = hpmc.integrate.simple_polygon(seed=10);
test_verts = [(1, 0), (0, 1), (-1, -1)]
self.mc.shape_param.set('A', vertices=test_verts)
shape_types = self.mc.get_type_shapes()
self.assertEqual(shape_types[0]['type'], 'Polygon')
self.assertEqual(len(shape_types[0]['vertices']), 3)
self.assertTrue(all([shape_types[0]['vertices'][i] == list(test_verts[i]) for i in range(len(test_verts))]))
def test_type_shapes_disks(self):
box = hoomd.data.boxdim(10, dimensions=2)
snap = hoomd.data.make_snapshot(N=2, box=box)
snap.particles.types = ['A']
self.system = hoomd.init.read_snapshot(snap)
self.mc = hpmc.integrate.sphere(seed=10);
test_diam = 1
self.mc.shape_param.set('A', diameter = test_diam)
shape_types = self.mc.get_type_shapes()
self.assertEqual(shape_types[0]['type'], 'Disk')
self.assertEqual(shape_types[0]['diameter'], test_diam)
self.assertNotIn('vertices', shape_types[0])
def test_type_shapes_spheres(self):
box = hoomd.data.boxdim(10, dimensions=3)
snap = hoomd.data.make_snapshot(N=2, box=box)
snap.particles.types = ['A']
self.system = hoomd.init.read_snapshot(snap)
self.mc = hpmc.integrate.sphere(seed=10);
test_diam = 1
self.mc.shape_param.set('A', diameter = test_diam)
shape_types = self.mc.get_type_shapes()
self.assertEqual(shape_types[0]['type'], 'Sphere')
self.assertEqual(shape_types[0]['diameter'], test_diam)
self.assertNotIn('vertices', shape_types[0])
def test_type_shapes_convex_polyhedron(self):
box = hoomd.data.boxdim(10, dimensions=2)
snap = hoomd.data.make_snapshot(N=2, box=box)
snap.particles.types = ['A']
self.system = hoomd.init.read_snapshot(snap)
self.mc = hpmc.integrate.convex_polyhedron(seed=10);
test_verts = [(1, 0, 0), (0, 1, 0), (-1, -1, 0)]
self.mc.shape_param.set('A', vertices=test_verts)
shape_types = self.mc.get_type_shapes()
self.assertEqual(shape_types[0]['type'], 'ConvexPolyhedron')
self.assertEqual(len(shape_types[0]['vertices']), 3)
self.assertTrue(all([shape_types[0]['vertices'][i] == list(test_verts[i]) for i in range(len(test_verts))]))
def tearDown(self):
del self.mc
del self.system
hoomd.context.initialize()
| 37.852632
| 116
| 0.639043
| 501
| 3,596
| 4.407186
| 0.135729
| 0.09058
| 0.074728
| 0.079257
| 0.872283
| 0.859149
| 0.859149
| 0.835598
| 0.835598
| 0.835598
| 0
| 0.024912
| 0.207453
| 3,596
| 94
| 117
| 38.255319
| 0.749825
| 0
| 0
| 0.694444
| 0
| 0
| 0.041713
| 0
| 0
| 0
| 0
| 0
| 0.208333
| 1
| 0.097222
| false
| 0
| 0.041667
| 0
| 0.152778
| 0.013889
| 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
|
8326ddf510cb2ac4bfebb8e8eb201634be85a4a4
| 3,844
|
py
|
Python
|
tests/api/test_unit_api.py
|
parkanaur/flask-dynrbac
|
8f2d3448b60a44f440813288979da008ee857bc2
|
[
"MIT"
] | null | null | null |
tests/api/test_unit_api.py
|
parkanaur/flask-dynrbac
|
8f2d3448b60a44f440813288979da008ee857bc2
|
[
"MIT"
] | null | null | null |
tests/api/test_unit_api.py
|
parkanaur/flask-dynrbac
|
8f2d3448b60a44f440813288979da008ee857bc2
|
[
"MIT"
] | null | null | null |
from helpers import send_and_assert, send_request
def test_get_list(sample_filled_app, api_url):
app, db, rbac, dmg = sample_filled_app
units = send_request(app, api_url + '/units').get_json()
assert len(units) == 5
for unit in units:
assert 'name' in unit
assert 'id' in unit
assert 'permissions' in unit
assert len(unit['permissions']) >= 1
def test_get_unit(sample_filled_app, api_url):
app, db, rbac, dmg = sample_filled_app
r = send_request(app, api_url + '/units/1')
assert r.status_code == 200, 'GOT ' + str(r.status_code)
unit = r.get_json()
assert 'name' in unit
assert 'id' in unit
assert unit['id'] == 1
assert 'permissions' in unit
assert len(unit['permissions']) >= 1
def test_put_unit(sample_filled_app, api_url):
app, db, rbac, dmg = sample_filled_app
r = send_request(app, api_url + '/units/1', method='put', json={
'name': 'unit_new_1',
'update_permissions': True,
'permission_ids': [1, 2, 3, 4],
'perms_all_required': True
})
assert r.status_code == 204, 'GOT ' + str(r.status_code) + ' ' + r.data
r = send_request(app, api_url + '/units/1')
assert r.status_code == 200, 'GOT ' + str(r.status_code)
unit = r.get_json()
assert unit['name'] == 'unit_new_1'
assert unit['perms_all_required'] == True
for perm in unit['permissions']:
assert perm['id'] in [1, 2, 3, 4]
r = send_request(app, api_url + '/units/1', method='put', json={
'permission_ids': [1]
})
r = send_request(app, api_url + '/units/1')
unit = r.get_json()
assert unit['name'] == 'unit_new_1'
assert unit['perms_all_required'] == True
assert len(unit['permissions']) == 4
for perm in unit['permissions']:
assert perm['id'] in [1, 2, 3, 4]
r = send_request(app, api_url + '/units/1', method='put', json={
'update_permissions': True,
'permission_ids': [1, 4],
'perms_all_required': False
})
r = send_request(app, api_url + '/units/1')
unit = r.get_json()
assert len(unit['permissions']) == 2
assert unit['perms_all_required'] == False
for perm in unit['permissions']:
assert perm['id'] in [1, 4]
def test_delete_unit(sample_filled_app, api_url):
app, db, rbac, dmg = sample_filled_app
r = send_request(app, api_url + '/units/1', method='delete')
assert r.status_code == 204, 'GOT ' + str(r.status_code) + ' ' + r.data
r = send_request(app, api_url + '/units/1')
assert r.status_code == 404, 'GOT ' + str(r.status_code) + ' ' + r.data
def test_create_unit(sample_filled_app, api_url):
app, db, rbac, dmg = sample_filled_app
r = send_request(app, api_url + '/units', method='post', json={
'name': 'new_unit_create',
'permission_ids': [1, 2, 3]
})
assert r.status_code == 200, 'GOT ' + str(r.status_code) + ' ' + r.data
uid = r.get_json()['id']
r = send_request(app, api_url + '/units/' + str(uid))
assert r.status_code == 200, 'GOT ' + str(r.status_code) + ' ' + r.data
unit = r.get_json()
assert unit['name'] == 'new_unit_create'
assert unit['id'] == uid
assert len(unit['permissions']) == 3
def test_create_empty_unit(sample_filled_app, api_url):
app, db, rbac, dmg = sample_filled_app
r = send_request(app, api_url + '/units', method='post', json={
'name': 'new_unit_create_empty'
})
assert r.status_code == 200, 'GOT ' + str(r.status_code) + ' ' + r.data
uid = r.get_json()['id']
r = send_request(app, api_url + '/units/' + str(uid))
assert r.status_code == 200, 'GOT ' + str(r.status_code) + ' ' + r.data
unit = r.get_json()
assert unit['name'] == 'new_unit_create_empty'
assert unit['id'] == uid
assert len(unit['permissions']) == 0
| 32.854701
| 75
| 0.609521
| 572
| 3,844
| 3.863636
| 0.104895
| 0.054299
| 0.081448
| 0.107692
| 0.88371
| 0.852036
| 0.804525
| 0.79457
| 0.759276
| 0.732127
| 0
| 0.022597
| 0.228668
| 3,844
| 116
| 76
| 33.137931
| 0.722766
| 0
| 0
| 0.666667
| 0
| 0
| 0.164152
| 0.010926
| 0
| 0
| 0
| 0
| 0.4
| 1
| 0.066667
| false
| 0
| 0.011111
| 0
| 0.077778
| 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
|
83388f36270ccc688c2a84f76c09beb4006e37c4
| 961
|
py
|
Python
|
test/dataTables.py
|
Tythos/pyroclast
|
b4c65db644573e3d7f568e498d37e10d363b13a3
|
[
"MIT"
] | 2
|
2017-04-09T05:22:38.000Z
|
2017-10-12T04:28:10.000Z
|
test/dataTables.py
|
Tythos/pyroclast
|
b4c65db644573e3d7f568e498d37e10d363b13a3
|
[
"MIT"
] | null | null | null |
test/dataTables.py
|
Tythos/pyroclast
|
b4c65db644573e3d7f568e498d37e10d363b13a3
|
[
"MIT"
] | null | null | null |
"""Unit tests for flat data table parsing
"""
import unittest
from pyroclast import data, dataTables
class CsvTests(unittest.TestCase):
def test_get(self):
file = data.get_path('test.csv')
content = dataTables.getCsv(file)
def test_filter(self):
file = data.get_path('test.csv')
content = dataTables.getCsv(file, {'isPrime': True})
class ExcelTests(unittest.TestCase):
def test_get(self):
file = data.get_path('test.xlsx')
content = dataTables.getExcel(file)
def test_filter(self):
file = data.get_path('test.xlsx')
content = dataTables.getExcel(file, {'_sheet': 'Sheet1', 'isPrime': True})
class SqliteTests(unittest.TestCase):
def test_get(self):
file = data.get_path('test.sql')
content = dataTables.getSqlite(file, {'_table': 'Sheet1'})
def test_filter(self):
file = data.get_path('test.sql')
content = dataTables.getSqlite(file, {'_table': 'Sheet1', 'isPrime': True})
if __name__ == "__main__":
unittest.main()
| 26.694444
| 77
| 0.708637
| 127
| 961
| 5.181102
| 0.299213
| 0.06383
| 0.109422
| 0.136778
| 0.712766
| 0.712766
| 0.712766
| 0.712766
| 0.712766
| 0.693009
| 0
| 0.003614
| 0.136316
| 961
| 35
| 78
| 27.457143
| 0.789157
| 0.039542
| 0
| 0.48
| 0
| 0
| 0.125546
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.24
| false
| 0
| 0.08
| 0
| 0.44
| 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
|
833e9c500a3af362722ced99e9c1041986e57180
| 242
|
py
|
Python
|
backend/users/fixtures.py
|
hnthh/foodgram-project-react
|
3383c6a116fded11b4a764b95e6ca4ead03444f3
|
[
"MIT"
] | 1
|
2022-02-09T10:42:45.000Z
|
2022-02-09T10:42:45.000Z
|
backend/users/fixtures.py
|
hnthh/foodgram
|
3383c6a116fded11b4a764b95e6ca4ead03444f3
|
[
"MIT"
] | null | null | null |
backend/users/fixtures.py
|
hnthh/foodgram
|
3383c6a116fded11b4a764b95e6ca4ead03444f3
|
[
"MIT"
] | null | null | null |
import pytest
@pytest.fixture()
def anon(factory):
return factory.anon()
@pytest.fixture()
def user(factory):
return factory.user()
@pytest.fixture()
def admin(factory):
return factory.user(is_staff=True, is_superuser=True)
| 14.235294
| 57
| 0.714876
| 32
| 242
| 5.34375
| 0.40625
| 0.22807
| 0.280702
| 0.280702
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14876
| 242
| 16
| 58
| 15.125
| 0.830097
| 0
| 0
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.3
| false
| 0
| 0.1
| 0.3
| 0.7
| 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.