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
b9898f50f0778509377bedca834b741159dd1fa9
45,872
py
Python
openprocurement/audit/monitoring/tests/test_document.py
ProzorroUKR/openprocurement.audit.api
a17836e29bca28d9151c091e1d2e42de9f70b949
[ "Apache-2.0" ]
1
2018-05-21T08:14:55.000Z
2018-05-21T08:14:55.000Z
openprocurement/audit/monitoring/tests/test_document.py
ProzorroUKR/openprocurement.audit.api
a17836e29bca28d9151c091e1d2e42de9f70b949
[ "Apache-2.0" ]
59
2018-05-18T02:09:47.000Z
2019-05-29T12:10:06.000Z
openprocurement/audit/monitoring/tests/test_document.py
ProzorroUKR/openprocurement.audit.api
a17836e29bca28d9151c091e1d2e42de9f70b949
[ "Apache-2.0" ]
1
2020-06-15T11:04:25.000Z
2020-06-15T11:04:25.000Z
# -*- coding: utf-8 -*- import unittest from hashlib import sha512 from unittest import mock from openprocurement.audit.monitoring.tests.base import BaseWebTest, DSWebTestMixin from openprocurement.audit.monitoring.tests.test_elimination import MonitoringEliminationBaseTest from openprocurement.audit.monitoring.tests.utils import get_errors_field_names class MonitoringDecisionDocumentResourceTest(BaseWebTest, DSWebTestMixin): def setUp(self): super(MonitoringDecisionDocumentResourceTest, self).setUp() self.app.app.registry.docservice_url = 'http://localhost' self.create_monitoring() self.test_docservice_document_data = { 'title': 'lorem.doc', 'url': self.generate_docservice_url(), 'hash': 'md5:' + '0' * 32, 'format': 'application/msword', 'documentType': 'notice', 'id': '0' * 32 } self.test_monitoring_activation_data = { "status": "active", "decision": { "date": "2015-05-10T23:11:39.720908+03:00", "description": "text", "documents": [self.test_docservice_document_data] } } def test_document_get_single(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_activation_data}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_id = response.json['data']['decision']['documents'][-1]['id'] response = self.app.get('/monitorings/{}/decision/documents/{}'.format(self.monitoring_id, document_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_data = response.json['data'] self.assertEqual(document_data['title'], 'lorem.doc') self.assertIn('Signature=', document_data["url"]) self.assertIn('KeyID=', document_data["url"]) self.assertNotIn('Expires=', document_data["url"]) self.assertEqual(document_data["documentType"], "notice") def test_document_get_list(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_activation_data}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') response = self.app.get('/monitorings/{}/decision/documents'.format(self.monitoring_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') self.assertEqual(len(response.json['data']), 1) document_data = response.json['data'][-1] self.assertEqual(document_data['title'], 'lorem.doc') def test_document_download(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_activation_data}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_data = response.json['data']['decision']['documents'][-1] key = document_data["url"].split('/')[-1].split('?')[0] document_id = document_data['id'] response = self.app.get('/monitorings/{}/decision/documents/{}?download=some_id'.format( self.monitoring_id, document_id), status=404) self.assertEqual(response.status_code, 404) self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {'description': 'Not Found', 'location': 'url', 'name': 'download'} ]) response = self.app.get('/monitorings/{}/decision/documents/{}?download={}'.format( self.monitoring_id, document_id, key)) self.assertEqual(response.status_code, 302) self.assertIn('http://localhost/get/', response.location) self.assertIn('Signature=', response.location) self.assertIn('KeyID=', response.location) self.assertNotIn('Expires=', response.location) def test_document_upload(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': {'decision': self.test_monitoring_activation_data['decision']}}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') response = self.app.post_json('/monitorings/{}/decision/documents'.format( self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') def test_document_upload_forbidden(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_activation_data}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') response = self.app.post_json('/monitorings/{}/decision/documents'.format( self.monitoring_id), {'data': self.test_docservice_document_data}, status=403) self.assertEqual(response.status_code, 403) self.assertEqual(response.content_type, 'application/json') self.assertEqual( ('body', 'data'), next(get_errors_field_names(response, 'Can\'t add document in current active monitoring status.'))) class MonitoringPostActiveDocumentResourceTest(BaseWebTest, DSWebTestMixin): def setUp(self): super(MonitoringPostActiveDocumentResourceTest, self).setUp() self.app.app.registry.docservice_url = 'http://localhost' self.create_monitoring() self.test_docservice_document_data = { 'title': 'lorem.doc', 'url': self.generate_docservice_url(), 'hash': 'md5:' + '0' * 32, 'format': 'application/msword', } self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': { "status": "active", "decision": { "date": "2015-05-10T23:11:39.720908+03:00", "description": "text", "documents": [self.test_docservice_document_data] } }} ) self.post_data = { 'title': 'Lorem ipsum', 'description': 'Lorem ipsum dolor sit amet', 'documents': [self.test_docservice_document_data] } def test_document_get_single(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.post_json( '/monitorings/{}/posts'.format(self.monitoring_id), {'data': self.post_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') post_id = response.json['data']['id'] document_id = response.json['data']['documents'][-1]['id'] response = self.app.get('/monitorings/{}/posts/{}/documents/{}'.format(self.monitoring_id, post_id, document_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_data = response.json['data'] self.assertEqual(document_data['title'], 'lorem.doc') self.assertIn('Signature=', document_data["url"]) self.assertIn('KeyID=', document_data["url"]) self.assertNotIn('Expires=', document_data["url"]) def test_document_get_list(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.post_json( '/monitorings/{}/posts'.format(self.monitoring_id), {'data': self.post_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') post_id = response.json['data']['id'] response = self.app.get('/monitorings/{}/posts/{}/documents'.format(self.monitoring_id, post_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') self.assertEqual(len(response.json['data']), 1) document_data = response.json['data'][-1] self.assertEqual(document_data['title'], 'lorem.doc') def test_document_download(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.post_json( '/monitorings/{}/posts'.format(self.monitoring_id), {'data': self.post_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') post_id = response.json['data']['id'] document_data = response.json['data']['documents'][-1] key = document_data["url"].split('/')[-1].split('?')[0] document_id = document_data['id'] response = self.app.get('/monitorings/{}/posts/{}/documents/{}?download=some_id'.format( self.monitoring_id, post_id, document_id), status=404) self.assertEqual(response.status_code, 404) self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {'description': 'Not Found', 'location': 'url', 'name': 'download'} ]) response = self.app.get('/monitorings/{}/posts/{}/documents/{}?download={}'.format( self.monitoring_id, post_id, document_id, key)) self.assertEqual(response.status_code, 302) self.assertIn('http://localhost/get/', response.location) self.assertIn('Signature=', response.location) self.assertIn('KeyID=', response.location) self.assertNotIn('Expires=', response.location) def test_document_upload(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.post_json( '/monitorings/{}/posts'.format(self.monitoring_id), {'data': self.post_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') post_id = response.json['data']['id'] response = self.app.post_json('/monitorings/{}/posts/{}/documents'.format( self.monitoring_id, post_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') def test_document_upload_forbidden(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.post_json( '/monitorings/{}/posts'.format(self.monitoring_id), {'data': self.post_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') post_id = response.json['data']['id'] self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': { "status": "addressed", "conclusion": { "violationOccurred": True, "violationType": ["corruptionProcurementMethodType"], } }} ) self.app.authorization = ('Basic', (self.broker_name, self.broker_pass)) response = self.app.post_json('/monitorings/{}/posts/{}/documents'.format( self.monitoring_id, post_id), {'data': self.test_docservice_document_data}, status=403) self.assertEqual(response.status_code, 403) self.assertEqual(response.content_type, 'application/json') class MonitoringPostAddressedDocumentResourceTest(BaseWebTest, DSWebTestMixin): def setUp(self): super(MonitoringPostAddressedDocumentResourceTest, self).setUp() self.app.app.registry.docservice_url = 'http://localhost' self.create_monitoring() self.test_docservice_document_data = { 'title': 'lorem.doc', 'url': self.generate_docservice_url(), 'hash': 'md5:' + '0' * 32, 'format': 'application/msword', } self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': { "status": "active", "decision": { "date": "2015-05-10T23:11:39.720908+03:00", "description": "text", "documents": [self.test_docservice_document_data] } }} ) self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': { "conclusion": { "description": "Some text", "violationOccurred": True, "violationType": ["corruptionProcurementMethodType", "corruptionAwarded"], "documents": [self.test_docservice_document_data] }, "status": "addressed", }} ) self.post_data = { 'title': 'Lorem ipsum', 'description': 'Lorem ipsum dolor sit amet', 'documents': [self.test_docservice_document_data] } @mock.patch('openprocurement.audit.monitoring.validation.TendersClient') def test_document_get_single(self, mock_api_client): mock_api_client.return_value.extract_credentials.return_value = { 'data': {'tender_token': sha512(b'tender_token').hexdigest()} } self.app.authorization = ('Basic', (self.broker_name, self.broker_pass)) response = self.app.patch_json( '/monitorings/{}/credentials?acc_token={}'.format(self.monitoring_id, 'tender_token') ) tender_owner_token = response.json['access']['token'] response = self.app.post_json( '/monitorings/{}/posts?acc_token={}'.format(self.monitoring_id, tender_owner_token), {'data': self.post_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') post_id = response.json['data']['id'] document_id = response.json['data']['documents'][-1]['id'] response = self.app.get('/monitorings/{}/posts/{}/documents/{}'.format(self.monitoring_id, post_id, document_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_data = response.json['data'] self.assertEqual(document_data['title'], 'lorem.doc') self.assertIn('Signature=', document_data["url"]) self.assertIn('KeyID=', document_data["url"]) self.assertNotIn('Expires=', document_data["url"]) @mock.patch('openprocurement.audit.monitoring.validation.TendersClient') def test_document_get_list(self, mock_api_client): mock_api_client.return_value.extract_credentials.return_value = { 'data': {'tender_token': sha512(b'tender_token').hexdigest()} } self.app.authorization = ('Basic', (self.broker_name, self.broker_pass)) response = self.app.patch_json( '/monitorings/{}/credentials?acc_token={}'.format(self.monitoring_id, 'tender_token') ) tender_owner_token = response.json['access']['token'] response = self.app.post_json( '/monitorings/{}/posts?acc_token={}'.format(self.monitoring_id, tender_owner_token), {'data': self.post_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') post_id = response.json['data']['id'] response = self.app.get('/monitorings/{}/posts/{}/documents'.format(self.monitoring_id, post_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') self.assertEqual(len(response.json['data']), 1) document_data = response.json['data'][-1] self.assertEqual(document_data['title'], 'lorem.doc') @mock.patch('openprocurement.audit.monitoring.validation.TendersClient') def test_document_download(self, mock_api_client): mock_api_client.return_value.extract_credentials.return_value = { 'data': {'tender_token': sha512(b'tender_token').hexdigest()} } self.app.authorization = ('Basic', (self.broker_name, self.broker_pass)) response = self.app.patch_json( '/monitorings/{}/credentials?acc_token={}'.format(self.monitoring_id, 'tender_token') ) tender_owner_token = response.json['access']['token'] response = self.app.post_json( '/monitorings/{}/posts?acc_token={}'.format(self.monitoring_id, tender_owner_token), {'data': self.post_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') post_id = response.json['data']['id'] document_data = response.json['data']['documents'][-1] key = document_data["url"].split('/')[-1].split('?')[0] document_id = document_data['id'] response = self.app.get('/monitorings/{}/posts/{}/documents/{}?download=some_id'.format( self.monitoring_id, post_id, document_id), status=404) self.assertEqual(response.status_code, 404) self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {'description': 'Not Found', 'location': 'url', 'name': 'download'} ]) response = self.app.get('/monitorings/{}/posts/{}/documents/{}?download={}'.format( self.monitoring_id, post_id, document_id, key)) self.assertEqual(response.status_code, 302) self.assertIn('http://localhost/get/', response.location) self.assertIn('Signature=', response.location) self.assertIn('KeyID=', response.location) self.assertNotIn('Expires=', response.location) @mock.patch('openprocurement.audit.monitoring.validation.TendersClient') def test_document_upload_no_token(self, mock_api_client): mock_api_client.return_value.extract_credentials.return_value = { 'data': {'tender_token': sha512(b'tender_token').hexdigest()} } self.app.authorization = ('Basic', (self.broker_name, self.broker_pass)) response = self.app.patch_json( '/monitorings/{}/credentials?acc_token={}'.format(self.monitoring_id, 'tender_token') ) tender_owner_token = response.json['access']['token'] response = self.app.post_json( '/monitorings/{}/posts?acc_token={}'.format(self.monitoring_id, tender_owner_token), {'data': self.post_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') post_id = response.json['data']['id'] response = self.app.post_json('/monitorings/{}/posts/{}/documents'.format( self.monitoring_id, post_id), {'data': self.test_docservice_document_data}, status=403) self.assertEqual(response.status_code, 403) self.assertEqual(response.content_type, 'application/json') @mock.patch('openprocurement.audit.monitoring.validation.TendersClient') def test_document_upload(self, mock_api_client): mock_api_client.return_value.extract_credentials.return_value = { 'data': {'tender_token': sha512(b'tender_token').hexdigest()} } self.app.authorization = ('Basic', (self.broker_name, self.broker_pass)) response = self.app.patch_json( '/monitorings/{}/credentials?acc_token={}'.format(self.monitoring_id, 'tender_token') ) tender_owner_token = response.json['access']['token'] response = self.app.post_json( '/monitorings/{}/posts?acc_token={}'.format(self.monitoring_id, tender_owner_token), {'data': self.post_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') post_id = response.json['data']['id'] response = self.app.post_json('/monitorings/{}/posts/{}/documents?acc_token={}'.format( self.monitoring_id, post_id, tender_owner_token), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') @mock.patch('openprocurement.audit.monitoring.validation.TendersClient') def test_document_upload_author_forbidden(self, mock_api_client): mock_api_client.return_value.extract_credentials.return_value = { 'data': {'tender_token': sha512(b'tender_token').hexdigest()} } self.app.authorization = ('Basic', (self.broker_name, self.broker_pass)) response = self.app.patch_json( '/monitorings/{}/credentials?acc_token={}'.format(self.monitoring_id, 'tender_token') ) tender_owner_token = response.json['access']['token'] response = self.app.post_json( '/monitorings/{}/posts?acc_token={}'.format(self.monitoring_id, tender_owner_token), {'data': self.post_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') post_id = response.json['data']['id'] self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) self.app.post_json('/monitorings/{}/posts/{}/documents'.format( self.monitoring_id, post_id), {'data': self.test_docservice_document_data}, status=403) class MonitoringDocumentResourceTest(BaseWebTest, DSWebTestMixin): def setUp(self): super(MonitoringDocumentResourceTest, self).setUp() self.app.app.registry.docservice_url = 'http://localhost' self.create_monitoring() self.test_docservice_document_data = { 'title': 'lorem.doc', 'url': self.generate_docservice_url(), 'hash': 'md5:' + '0' * 32, 'format': 'application/msword', } self.test_monitoring_activation_data = { "documents": [self.test_docservice_document_data], } self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': { 'status': "cancelled", 'cancellation': { "description": "text" } }}) def test_document_get_single(self): response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_activation_data}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_id = response.json['data']['documents'][-1]['id'] response = self.app.get('/monitorings/{}/documents/{}'.format(self.monitoring_id, document_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_data = response.json['data'] self.assertEqual(document_data['title'], 'lorem.doc') self.assertIn('Signature=', document_data["url"]) self.assertIn('KeyID=', document_data["url"]) self.assertNotIn('Expires=', document_data["url"]) def test_document_get_list(self): response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_activation_data}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') response = self.app.get('/monitorings/{}/documents'.format(self.monitoring_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') self.assertEqual(len(response.json['data']), 1) document_data = response.json['data'][-1] self.assertEqual(document_data['title'], 'lorem.doc') def test_document_download(self): response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_activation_data}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_data = response.json['data']['documents'][-1] key = document_data["url"].split('/')[-1].split('?')[0] document_id = document_data['id'] response = self.app.get('/monitorings/{}/documents/{}?download=some_id'.format( self.monitoring_id, document_id), status=404) self.assertEqual(response.status_code, 404) self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {'description': 'Not Found', 'location': 'url', 'name': 'download'} ]) response = self.app.get('/monitorings/{}/documents/{}?download={}'.format( self.monitoring_id, document_id, key)) self.assertEqual(response.status_code, 302) self.assertIn('http://localhost/get/', response.location) self.assertIn('Signature=', response.location) self.assertIn('KeyID=', response.location) self.assertNotIn('Expires=', response.location) def test_document_upload(self): response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_activation_data}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') response = self.app.post_json('/monitorings/{}/documents'.format( self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') class MonitoringCancellationDocumentResourceTest(BaseWebTest, DSWebTestMixin): def setUp(self): super(MonitoringCancellationDocumentResourceTest, self).setUp() self.app.app.registry.docservice_url = 'http://localhost' self.create_monitoring() self.test_docservice_document_data = { 'title': 'lorem.doc', 'url': self.generate_docservice_url(), 'hash': 'md5:' + '0' * 32, 'format': 'application/msword', } self.test_monitoring_activation_data = { 'status': "cancelled", 'cancellation': { "description": "text", "documents": [] } } self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_activation_data}) self.end_point = '/monitorings/%s/cancellation/documents' % self.monitoring_id def test_get_single(self): response = self.app.post_json( '/monitorings/{}/cancellation/documents'.format(self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') document_id = response.json['data']['id'] response = self.app.get('/monitorings/{}/cancellation/documents/{}'.format(self.monitoring_id, document_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_data = response.json['data'] self.assertEqual(document_data['title'], 'lorem.doc') self.assertIn('Signature=', document_data["url"]) self.assertIn('KeyID=', document_data["url"]) self.assertNotIn('Expires=', document_data["url"]) def test_document_get_list(self): response = self.app.post_json( '/monitorings/{}/cancellation/documents'.format(self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') response = self.app.get('/monitorings/{}/cancellation/documents'.format(self.monitoring_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') self.assertEqual(len(response.json['data']), 1) document_data = response.json['data'][-1] self.assertEqual(document_data['title'], 'lorem.doc') def test_document_download(self): response = self.app.post_json( '/monitorings/{}/cancellation/documents'.format(self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') document_data = response.json['data'] key = document_data["url"].split('/')[-1].split('?')[0] document_id = document_data['id'] response = self.app.get('/monitorings/{}/cancellation/documents/{}?download=some_id'.format( self.monitoring_id, document_id), status=404) self.assertEqual(response.status_code, 404) self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {'description': 'Not Found', 'location': 'url', 'name': 'download'} ]) response = self.app.get('/monitorings/{}/cancellation/documents/{}?download={}'.format( self.monitoring_id, document_id, key)) self.assertEqual(response.status_code, 302) self.assertIn('http://localhost/get/', response.location) self.assertIn('Signature=', response.location) self.assertIn('KeyID=', response.location) self.assertNotIn('Expires=', response.location) def test_document_upload(self): response = self.app.post_json('/monitorings/{}/cancellation/documents'.format( self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') class MonitoringEliminationResolutionDocumentResourceTest(MonitoringEliminationBaseTest): def setUp(self): super(MonitoringEliminationResolutionDocumentResourceTest, self).setUp() self.app.app.registry.docservice_url = 'http://localhost' self.create_monitoring() self.test_docservice_document_data = { 'title': 'lorem.doc', 'url': self.generate_docservice_url(), 'hash': 'md5:' + '0' * 32, 'format': 'application/msword', } self.create_monitoring_with_resolution() def test_document_get_single(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.post_json( '/monitorings/{}/eliminationResolution/documents'.format(self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') document_id = response.json['data']['id'] response = self.app.get( '/monitorings/{}/eliminationResolution/documents/{}'.format(self.monitoring_id, document_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_data = response.json['data'] self.assertEqual(document_data['title'], 'lorem.doc') self.assertIn('Signature=', document_data["url"]) self.assertIn('KeyID=', document_data["url"]) self.assertNotIn('Expires=', document_data["url"]) def test_document_get_list(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.post_json( '/monitorings/{}/eliminationResolution/documents'.format(self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') response = self.app.get('/monitorings/{}/eliminationResolution/documents'.format(self.monitoring_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') self.assertEqual(2, len(response.json['data'])) self.assertIn('lorem.doc', [doc['title'] for doc in response.json['data']]) def test_document_download(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.post_json( '/monitorings/{}/eliminationResolution/documents'.format(self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') document_data = response.json['data'] key = document_data["url"].split('/')[-1].split('?')[0] document_id = document_data['id'] response = self.app.get('/monitorings/{}/eliminationResolution/documents/{}?download=some_id'.format( self.monitoring_id, document_id), status=404) self.assertEqual(response.status_code, 404) self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {'description': 'Not Found', 'location': 'url', 'name': 'download'} ]) response = self.app.get('/monitorings/{}/eliminationResolution/documents/{}?download={}'.format( self.monitoring_id, document_id, key)) self.assertEqual(response.status_code, 302) self.assertIn('http://localhost/get/', response.location) self.assertIn('Signature=', response.location) self.assertIn('KeyID=', response.location) self.assertNotIn('Expires=', response.location) def test_document_upload(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.post_json('/monitorings/{}/eliminationResolution/documents'.format( self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') def test_patch_document(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) request_data = { 'title': 'another.txt', 'url': self.generate_docservice_url(), 'hash': 'md5:' + '1' * 32, 'format': 'application/msword', } response = self.app.get('/monitorings/{}/eliminationResolution/documents'.format(self.monitoring_id)) doc_to_update = response.json['data'][0] response = self.app.patch_json( '/monitorings/{}/eliminationResolution/documents/{}'.format( self.monitoring_id, doc_to_update["id"] ), {"data": request_data} ) self.assertEqual(response.json["data"]["title"], request_data["title"]) self.assertEqual(response.json["data"]["format"], request_data["format"]) self.assertNotEqual( response.json["data"]["url"].split("Signature")[0], request_data["url"].split("Signature")[0], ) self.assertNotEqual(response.json["data"]["hash"], request_data["hash"]) def test_patch_document_forbidden(self): self.app.authorization = ('Basic', (self.broker_name, self.broker_pass)) document = { 'title': 'another.txt', 'url': self.generate_docservice_url(), 'hash': 'md5:' + '1' * 32, 'format': 'application/msword', } response = self.app.get('/monitorings/{}/eliminationResolution/documents'.format(self.monitoring_id)) doc_to_update = response.json['data'][0] self.app.patch_json( '/monitorings/{}/eliminationResolution/documents/{}?acc_token={}'.format( self.monitoring_id, doc_to_update["id"], self.tender_owner_token ), {"data": document}, status=403 ) def test_put_document(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) request_data = { 'title': 'my_new_file.txt', 'url': self.generate_docservice_url(), 'hash': 'md5:' + '0' * 32, 'format': 'text/css', } response = self.app.get('/monitorings/{}/eliminationResolution/documents'.format(self.monitoring_id)) doc_to_update = response.json['data'][0] response = self.app.put_json( '/monitorings/{}/eliminationResolution/documents/{}'.format( self.monitoring_id, doc_to_update["id"] ), {"data": request_data} ) self.assertEqual(response.json["data"]["title"], request_data["title"]) self.assertEqual( response.json["data"]["url"].split("Signature")[0], request_data["url"].split("Signature")[0], ) self.assertEqual(response.json["data"]["format"], request_data["format"]) self.assertEqual(response.json["data"]["hash"], request_data["hash"]) def test_put_document_forbidden(self): self.app.authorization = ('Basic', (self.broker_name, self.broker_pass)) document = { 'title': 'my_new_file.txt', 'url': self.generate_docservice_url(), 'hash': 'md5:' + '0' * 32, 'format': 'text/css', } response = self.app.get('/monitorings/{}/eliminationResolution/documents'.format(self.monitoring_id)) doc_to_update = response.json['data'][0] self.app.put_json( '/monitorings/{}/eliminationResolution/documents/{}?acc_token={}'.format( self.monitoring_id, doc_to_update["id"], self.tender_owner_token ), {"data": document}, status=403 ) class MonitoringConclusionDocumentResourceTest(BaseWebTest, DSWebTestMixin): def setUp(self): super(MonitoringConclusionDocumentResourceTest, self).setUp() self.app.app.registry.docservice_url = 'http://localhost' self.create_monitoring() self.test_docservice_document_data = { 'title': 'lorem.doc', 'url': self.generate_docservice_url(), 'hash': 'md5:' + '0' * 32, 'format': 'application/msword', } self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': { "status": "active", "decision": { "date": "2015-05-10T23:11:39.720908+03:00", "description": "text", "documents": [self.test_docservice_document_data] } }} ) self.test_monitoring_addressed_data = { "conclusion": { "description": "Some text", "violationOccurred": True, "violationType": ["corruptionProcurementMethodType", "corruptionAwarded"], "documents": [self.test_docservice_document_data] }, "status": "addressed", } def test_document_get_single(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_addressed_data}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_id = response.json['data']['conclusion']['documents'][-1]['id'] response = self.app.get('/monitorings/{}/conclusion/documents/{}'.format(self.monitoring_id, document_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') document_data = response.json['data'] self.assertEqual(document_data['title'], 'lorem.doc') self.assertIn('Signature=', document_data["url"]) self.assertIn('KeyID=', document_data["url"]) self.assertNotIn('Expires=', document_data["url"]) def test_document_get_list(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_addressed_data}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') response = self.app.get('/monitorings/{}/conclusion/documents'.format(self.monitoring_id)) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') self.assertEqual(len(response.json['data']), 1) document_data = response.json['data'][-1] self.assertEqual(document_data['title'], 'lorem.doc') def test_document_upload(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': {'conclusion': self.test_monitoring_addressed_data['conclusion']}}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') response = self.app.post_json('/monitorings/{}/conclusion/documents'.format( self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') def test_document_patch(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': {'conclusion': self.test_monitoring_addressed_data['conclusion']}}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') response = self.app.post_json('/monitorings/{}/conclusion/documents'.format( self.monitoring_id), {'data': self.test_docservice_document_data}) self.assertEqual(response.status_code, 201) self.assertEqual(response.content_type, 'application/json') doc_id = response.json["data"]["id"] old_dateModified = response.json["data"]["dateModified"] response = self.app.patch_json('/monitorings/{}/conclusion/documents/{}'.format( self.monitoring_id, doc_id), {'data': {'title': self.test_docservice_document_data["title"]}} ) self.assertEqual(response.status_code, 200) self.assertEqual(response.json, None) response = self.app.patch_json('/monitorings/{}/conclusion/documents/{}'.format( self.monitoring_id, doc_id), {'data': {'title': 'lorem1.doc'}} ) self.assertEqual(response.status_code, 200) self.assertNotEqual(response.json["data"]["dateModified"], old_dateModified) def test_document_upload_forbidden(self): self.app.authorization = ('Basic', (self.sas_name, self.sas_pass)) response = self.app.patch_json( '/monitorings/{}'.format(self.monitoring_id), {'data': self.test_monitoring_addressed_data}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content_type, 'application/json') response = self.app.post_json('/monitorings/{}/conclusion/documents'.format( self.monitoring_id), {'data': self.test_docservice_document_data}, status=403) self.assertEqual(response.status_code, 403) self.assertEqual(response.content_type, 'application/json') self.assertEqual( ('body', 'data'), next(get_errors_field_names(response, 'Can\'t add document in current addressed monitoring status.')))
44.88454
121
0.635159
4,779
45,872
5.896003
0.036619
0.093693
0.124889
0.072612
0.951805
0.943074
0.925436
0.922384
0.918231
0.911985
0
0.01283
0.21839
45,872
1,021
122
44.928501
0.773052
0.000458
0
0.838253
0
0
0.188881
0.076708
0
0
0
0
0.265643
1
0.051948
false
0.043684
0.007084
0
0.067296
0
0
0
0
null
0
0
0
1
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
7
b9e1a8631ef45df8756a5f1a9021db9b96d6145f
20,203
py
Python
src/adaptivehmc.py
modichirag/hmc
e7c7931e999d0ffdee506662d0f095efdc7dc152
[ "MIT" ]
null
null
null
src/adaptivehmc.py
modichirag/hmc
e7c7931e999d0ffdee506662d0f095efdc7dc152
[ "MIT" ]
null
null
null
src/adaptivehmc.py
modichirag/hmc
e7c7931e999d0ffdee506662d0f095efdc7dc152
[ "MIT" ]
null
null
null
import numpy as np class HMC(): def __init__(self, log_prob, grad_log_prob, invmetric_diag=None): self.log_prob, self.grad_log_prob = log_prob, grad_log_prob self.V = lambda x : self.log_prob(x)*-1. #self.V_g = lambda x : self.grad_log_prob(x)*-1. self.leapcount, self.Vgcount, self.Hcount = 0, 0, 0 if invmetric_diag is None: self.invmetric_diag = 1. else: self.invmetric_diag = invmetric_diag self.metricstd = self.invmetric_diag**-0.5 self.KE = lambda p: 0.5*(p**2 * self.invmetric_diag).sum() self.KE_g = lambda p: p * self.invmetric_diag def V_g(self, x): self.Vgcount += 1 return self.grad_log_prob(x)*-1. def unit_norm_KE(self, p): return 0.5 * (p**2).sum() def unit_norm_KE_g(self, p): return p def H(self, q,p): self.Hcount += 1 return self.V(q) + self.KE(p) def leapfrog(self, q, p, N, step_size): self.leapcount += 1 q0, p0 = q, p try: p = p - 0.5*step_size * self.V_g(q) for i in range(N-1): q = q + step_size * self.KE_g(p) p = p - step_size * self.V_g(q) q = q + step_size * self.KE_g(p) p = p - 0.5*step_size * self.V_g(q) return q, p except Exception as e: print(e) return q0, p0 def leapfrog1(self, q, p, step_size, Vgq=None): #This needs to be optimized to not estimate V_g again and again self.leapcount += 1 q0, p0 = q, p try: if Vgq is None: Vgq = self.V_g(q) p = p - 0.5*step_size * Vgq q = q + step_size * self.KE_g(p) p = p - 0.5*step_size * self.V_g(q) return q, p, Vgq except Exception as e: print(e) return q0, p0, Vgq def metropolis(self, qp0, qp1): q0, p0 = qp0 q1, p1 = qp1 H0 = self.H(q0, p0) H1 = self.H(q1, p1) prob = np.exp(H0 - H1) #prob = min(1., np.exp(H0 - H1)) if np.isnan(prob) or np.isinf(prob) or (q0-q1).sum()==0: return q0, p0, 2., [H0, H1] elif np.random.uniform(0., 1., size=1) > min(1., prob): return q0, p0, 0., [H0, H1] else: return q1, p1, 1., [H0, H1] def hmc_step(self, q, N, step_size): '''Single hmc iteration Parameters: ---------- q: initial position N: number of leapfrog steps step_size: step size for leapfrog iteration Returns: -------- A tuple of- q p accepted (0/1/2) acceptance probability list of [Hcounts, Vcounts, nleapfrogs] ''' self.leapcount, self.Vgcount, self.Hcount = 0, 0, 0 p = np.random.normal(size=q.size).reshape(q.shape) * self.metricstd q1, p1 = self.leapfrog(q, p, N, step_size) q, p, accepted, prob = self.metropolis([q, p], [q1, p1]) return q, p, accepted, prob, [self.Hcount, self.Vgcount, self.leapcount] ###################### class AdHMC_eps0(HMC): def __init__(self, log_prob, grad_log_prob, invmetric_diag=None): super().__init__(log_prob, grad_log_prob, invmetric_diag) def get_stepsize(self, q0, p0, smin=0.01, smax=1.0, ntry=20, logspace=True, nsteps=1, eps=None): H0 = self.H(q0, p0) Hs = np.zeros(ntry) if logspace: steps = np.logspace(np.log10(smin), np.log10(smax), ntry) else: steps = np.linspace(smin, smax, ntry) pwts = steps.copy()**0.5 #np.linspace(0.9, 1.1, steps.size) for iss, ss in enumerate(steps): #nsteps = int(steps.max()/ss)+1 q1, p1 = self.leapfrog(q0, p0, nsteps, ss) Hs[iss] = self.H(q1, p1) pp = np.exp(H0 - Hs) * pwts pp[np.isnan(pp)] = 0 pp[np.isinf(pp)] = 0 pp /= pp.sum() cdf = np.cumsum(pp) if eps is None: sx = np.random.uniform(low=cdf.min()) isx = np.where(sx > cdf)[0][-1] sx2 = np.random.uniform(steps[isx], steps[isx+1]) prob = pp[isx+1] # * 1/(steps[isx+1]-steps[isx+1]) return sx2, pp[isx+1] else: prob = pp[np.where(steps > eps)[0][0]] return prob def hmc_step(self, q0, Nleap, smin=0.01, smax=1.0, Tint=0, ntry=10, nsteps=1): '''Single hmc iteration Parameters: ---------- q: initial position N: number of leapfrog steps step_size: step size for leapfrog iteration smin: Minimum allowed step size smin: Maximum allowed step size Tint: Time of integration ntry: Number of points to try for estimating first step size nsteps: Number of steps per try for estimating first step size Returns: -------- A tuple of- q p accepted (0/1/2) acceptance probability array of [pfactor denominator, pfactor numberator, stepsize] list of [Hcounts, Vcounts, nleapfrogs] ''' self.leapcount, self.Vgcount, self.Hcount = 0, 0, 0 p0 = np.random.normal(size=q0.size).reshape(q0.shape) * self.metricstd H0 = self.H(q0, p0) if (Tint == 0) and (Nleap == 0): print("Tint and Nleap cannot be both zeros") import sys sys.exit() elif (Tint != 0) and (Nleap != 0): print("Tint and Nleap both given and are inconsistent") import sys sys.exit() #First step is drawn from a distribution ss, pf_den = self.get_stepsize(q0, p0, smin, smax, ntry=ntry, nsteps=nsteps) eps = ss if Tint == 0: N = Nleap else: N = int(Tint/eps) + 1 #print("Steps size is %0.2f, and number of steps is %d"%(eps, N)) q1, p1 = self.leapfrog(q0, p0, N, ss) H1 = self.H(q1, p1) pb_num = self.get_stepsize(q1, -p1, smin=smin, smax=smax, eps=ss, ntry=ntry, nsteps=nsteps) hastings_factor = pb_num/pf_den prob = np.exp(H0 - H1) * hastings_factor #print("prb, fac, metrop : ", prob, adfac, prob/adfac, pb_num, pf_den) toret = [[prob, prob/hastings_factor, hastings_factor], np.stack([pf_den, pb_num, eps]), [self.Hcount, self.Vgcount, self.leapcount]] if np.isnan(prob) or np.isinf(prob) or (q0-q1).sum()==0: return q0, p0, 2., *toret elif np.random.uniform(0., 1., size=1) > min(1., prob): return q0, p0, 0., *toret else: return q1, p1, 1., *toret ## ###################### class AdHMC(HMC): def __init__(self, log_prob, grad_log_prob, invmetric_diag=None): super().__init__(log_prob, grad_log_prob, invmetric_diag) def get_stepsize(self, q0, p0, smin=0.01, smax=1.0, ntry=10, logspace=True, nsteps=1, eps=None): H0 = self.H(q0, p0) Hs = np.zeros(ntry) if logspace: steps = np.logspace(np.log10(smin), np.log10(smax), ntry) else: steps = np.linspace(smin, smax, ntry) pwts = steps.copy()**0.5 #np.linspace(0.9, 1.1, steps.size) for iss, ss in enumerate(steps): #nsteps = int(steps.max()/ss)+1 q1, p1 = self.leapfrog(q0, p0, nsteps, ss) Hs[iss] = self.H(q1, p1) pp = np.exp(H0 - Hs) * pwts pp[np.isnan(pp)] = 0 pp[np.isinf(pp)] = 0 pp /= pp.sum() cdf = np.cumsum(pp) if eps is None: sx = np.random.uniform(low=cdf.min()) isx = np.where(sx > cdf)[0][-1] sx2 = np.random.uniform(steps[isx], steps[isx+1]) prob = pp[isx+1] # * 1/(steps[isx+1]-steps[isx+1]) return sx2, pp[isx+1] else: prob = pp[np.where(steps > eps)[0][0]] return prob def hmc_step(self, q0, Nleap=100, nleap=10, ratios= [1/np.sqrt(2), np.sqrt(2)], pwts0 = [1., 1.], smin=0.01, smax=1.0, ntry_eps0=10, nsteps_eps0=1, logeps=True, verbose=False): ''' Parameters: ---------- q: initial position Nleap: number of leapfrog steps nleap: number of leapfrog steps to adapt step size smin: Minimum allowed step size smin: Maximum allowed step size ratios: ratio to change step size with after nleap steps- expected in INCREASING order ntry_eps0: Number of points to try for estimating first step size nsteps_eps0: Number of steps per try for estimating first step size Returns: -------- A tuple of- q p accepted (0/1/2) list of probabiliies [acc_prob, acc_prob/hastings_factor, hastings_factor] array of checks [pfactor denominator, pfactor numberator, stepsize] list of counts [Hcounts, Vcounts, nleapfrogs] ''' #normprob is not implemented self.leapcount, self.Vgcount, self.Hcount = 0, 0, 0 p0 = np.random.normal(size=q0.size).reshape(q0.shape) * self.metricstd N = int(Nleap//nleap) #First step is drawn from a distribution eps, pf_den, pb_num = np.zeros(N), np.zeros(N), np.zeros(N) #pwts0 = 1. #np.array([0.9, 1.0, 1.1]) nr = len(ratios) H0 = self.H(q0, p0) #First step is drawn from a distribution ss, pf_den[0] = self.get_stepsize(q0, p0, smin, smax, ntry=ntry_eps0, nsteps=nsteps_eps0, logspace=logeps) eps[0] = ss q1, p1 = self.leapfrog(q0, p0, nleap, ss) H1 = self.H(q1, p1) Hprev = H0 sigma = np.log(0.5)/2. for i in range(N - 1): #q1, p1, H1 is the current position. #ss is the current step size i.e. the last taken ##Forward pf, pb = np.zeros(nr), np.zeros(nr) qs, ps, Hs = [], [], [] for j in range(nr): ss2 = ss*ratios[j] q, p= self.leapfrog(q1, p1, nleap, ss2) qs.append(q) ps.append(p) Hs.append(self.H(q, p)) pH = np.exp(H1 - Hs[-1]) if np.isnan(pH) or np.isinf(pH): pH = 0 pf[j] = pH pwts = np.ones(nr) * pwts0 if smin > ss*ratios[0]: pwts[0] = 0 if smax < ss*ratios[-1]: pwts[-1] = 0 pf *= pwts pfraw = pf.copy() pf /= pf.sum() if np.isnan(pf.sum()) or np.isinf(pf.sum()): if verbose: print("Something blew up so returning initial position") print(pfraw, pwts, pf, Hs, ss) return q0, p0, 100+i, [np.NaN, np.NaN, np.NaN], np.stack([pf_den, pb_num, eps]), [self.Hcount, self.Vgcount, self.leapcount] #Select a step size to carry forth pind = np.random.choice(nr, p=pf) ssnew = ss*ratios[pind] q2, p2, H2 = qs[pind], ps[pind], Hs[pind] pf_den[i+1] = pf[pind] ##Reverse #step from q1, p1 if we arrive here with ssnew step size in reverse direction Hsb = [] for j in range(nr): if np.allclose(ssnew*ratios[j] , ss): Hsb.append(Hprev) pbind = j else: ss2 = ssnew*ratios[j] q, p = self.leapfrog(q1, -p1, nleap, ss2) Hsb.append(self.H(q, p)) pH = np.exp(H1 - Hsb[-1]) if np.isnan(pH) or np.isinf(pH): pH = 0 pb[j] = pH pwts = np.ones(nr) *pwts0 if smin > ssnew*ratios[0]: pwts[0] = 0 if smax < ssnew*ratios[-1]: pwts[-1] = 0 pb *= pwts pb /= pb.sum() pb_num[i] = pb[pbind] #setup for next step eps[i+1] = ssnew ss = ssnew Hprev = H1 q1, p1, H1 = q2, p2, H2 #print(pf, pb, pf[pind], pb[pbind]) #print(ss) #print('started and ended with step sizes ', eps[0], eps[i+1]) #print('Number of steps taken is %d out of %d'%(i, N)) if (ssnew > smin) and (ssnew < smax): #pb_num[-1] = self.get_stepsize(q2, -p2, smin=smin, smax=smax, eps=ssnew, ntry=ntry, nsteps=nsteps) pb_num[i+1] = self.get_stepsize(q2, -p2, smin=smin, smax=smax, eps=ssnew, ntry=ntry_eps0, nsteps=nsteps_eps0, logspace=logeps) hastings_factor = np.prod(pb_num[:i+2])/np.prod(pf_den[:i+2]) prob = np.exp(H0 - H2) * hastings_factor if verbose: print("prb, fac, metrop : ", prob, hastings_factor, prob/hastings_factor, pb_num[-1], pf_den[0]) #Return toret = [[prob, prob/hastings_factor, hastings_factor], np.stack([pf_den, pb_num, eps]), [self.Hcount, self.Vgcount, self.leapcount]] if np.isnan(prob) or np.isinf(prob) or (q0-q1).sum()==0: return q0, p0, 2., *toret elif np.random.uniform(0., 1., size=1) > min(1., prob): return q0, p0, 0., *toret else: return q2, p2, 1., *toret ## ###################### ###################### class AdHMC_May(HMC): ##DO NOT DELETE. HAS normprob and other methods implemented that need to be moved above def __init__(self, log_prob, grad_log_prob, invmetric_diag=None): super.__init__(log_prob, grad_log_prob, invmetric_diag) def get_stepsize(self, q0, p0, smin=0.01, smax=1.0, ntry=20, logspace=True, nsteps=1, eps=None): H0 = self.H(q0, p0) Hs = np.zeros(ntry) if logspace: steps = np.logspace(np.log10(smin), np.log10(smax), ntry) else: steps = np.linspace(smin, smax, ntry) pwts = steps.copy()**0.5 #np.linspace(0.9, 1.1, steps.size) for iss, ss in enumerate(steps): #nsteps = int(steps.max()/ss)+1 q1, p1 = self.leapfrog(q0, p0, nsteps, ss) Hs[iss] = self.H(q1, p1) pp = np.exp(H0 - Hs) * pwts pp[np.isnan(pp)] = 0 pp[np.isinf(pp)] = 0 pp /= pp.sum() cdf = np.cumsum(pp) if eps is None: sx = np.random.uniform(low=cdf.min()) isx = np.where(sx > cdf)[0][-1] sx2 = np.random.uniform(steps[isx], steps[isx+1]) prob = pp[isx+1] # * 1/(steps[isx+1]-steps[isx+1]) return sx2, pp[isx+1] else: prob = pp[np.where(steps > eps)[0][0]] return prob def hmc_step(self, q0, Nleap, smin=0.01, smax=1.0, ratios= [0.75, 1.0, 1/0.75], Tint=0, ntry=20, nsteps=1, normprob=True): self.leapcount, self.Vgcount, self.Hcount = 0, 0, 0 p0 = np.random.normal(size=q0.size).reshape(q0.shape) * self.metricstd if (Tint == 0) and (Nleap == 0): print("Tint and Nleap cannot be both zeros") import sys sys.exit() elif (Tint != 0) and (Nleap != 0): print("Tint and Nleap both given and are inconsistent") import sys sys.exit() if Tint == 0: N = Nleap else: N = int(Tint/smin) #First step is drawn from a distribution eps, pf_den, pb_num = np.zeros(N), np.zeros(N), np.zeros(N) pwts0 = 1. #np.array([0.9, 1.0, 1.1]) nr = len(ratios) H0 = self.H(q0, p0) def halfleap(q, p, step_size, Vgq=None): #This needs to be optimized to not estimate V_g again and again self.leapcount += 1 q0, p0 = q, p if Vgq is None: Vgq = self.V_g(q) p = p - 0.5*step_size * Vgq q = q + step_size * self.KE_g(p) return q, p, Vgq #First step is drawn from a distribution ss, pf_den[0] = self.get_stepsize(q0, p0, smin, smax, ntry=ntry, nsteps=nsteps) eps[0] = ss q1, p1, _ = self.leapfrog1(q0, p0, ss) H1 = self.H(q1, p1) Hprev = H0 sigma = np.log(0.5)/2. #print('Doing half step to estimate goodness') for i in range(N-1): #q1, p1, H1 is the current position. #ss is the current step size i.e. the last taken #Forward pf, pb = np.zeros(nr), np.zeros(nr) qs, ps, Hs = [], [], [] Vgq = None for j in range(nr): ss2 = ss*ratios[j] q, p, Vgq = self.leapfrog1(q1, p1, ss2, Vgq) #q, p, Vgq = halfleap(q1, p1, ss2, Vgq) qs.append(q) ps.append(p) Hs.append(self.H(q, p)) #if normprob: pH = np.exp(-0.5 * (Hs[-1] - Hprev)**2 / sigma**2) #if normprob: pH = np.exp(- abs(Hs[-1] - Hprev)) if normprob: pH = np.exp(- abs(Hs[-1] - H1)) else: pH = np.exp(H1 - Hs[-1]) if np.isnan(pH) or np.isinf(pH): pH = 0 pf[j] = pH pwts = np.ones(nr) * pwts0 if smin > ss*ratios[0]: pwts[0] = 0 if smax < ss*ratios[-1]: pwts[-1] = 0 pf *= pwts pf /= pf.sum() if np.isnan(pf.sum()) or np.isinf(pf.sum()): return q0, p0, 100+i, 0, np.stack([pf_den, pb_num, eps]), [self.Hcount, self.Vgcount, self.leapcount] pind = np.random.choice(nr, p=pf) ssnew = ss*ratios[pind] q2, p2, _ = self.leapfrog1(q1, p1, ssnew, Vgq) H2 = self.H(q2, p2) #q2, p2, H2 = qs[pind], ps[pind], Hs[pind] pf_den[i+1] = pf[pind] #step from q1, p1 if we arrive here with ssnew step size in reverse direction Hsb = [] for j in range(nr): if np.allclose(ssnew*ratios[j] , ss): Hsb.append(Hprev) pbind = j else: ss2 = ssnew*ratios[j] q, p, Vgq = self.leapfrog1(q1, -p1, ss2, Vgq) Hsb.append(self.H(q, p)) #if normprob: pH = np.exp(-0.5 * (Hsb[-1] - H2)**2 / sigma**2) #if normprob: pH = np.exp(- abs(Hsb[-1] - H2)) if normprob: pH = np.exp(- abs(Hsb[-1] - H1)) else: pH = np.exp(H1 - Hsb[-1]) if np.isnan(pH) or np.isinf(pH): pH = 0 pb[j] = pH pwts = np.ones(nr) *pwts0 if smin > ssnew*ratios[0]: pwts[0] = 0 if smax < ssnew*ratios[-1]: pwts[-1] = 0 pb *= pwts pb /= pb.sum() pb_num[i] = pb[pbind] #setup for next step eps[i+1] =ssnew # ratios[pind] ss = ssnew Hprev = H1 q1, p1, H1 = q2, p2, H2 #print(pf, pb, pf[pind], pb[pbind]) #print(ss) ##THIS VIOLATES DB BUT LETS SEE HOW BAD THIS IS ##THIS MIGHT BE RELATED TO NUTS GOING IN BOTH DIRECTIONS ##CONSIDER SEQ OF STEPSIZES 0.5,1,2,3,6 with TINT=10, AND CASE WHEN WE START FROM 1 OR 3 #if Tint > 0 : # if eps[:i+1].sum() > Tint : break #print('started and ended with step sizes ', eps[0], eps[i+1]) #print('Number of steps taken is %d out of %d'%(i, N)) if (ssnew > smin) and (ssnew < smax): #pb_num[-1] = self.get_stepsize(q2, -p2, smin=smin, smax=smax, eps=ssnew, ntry=ntry, nsteps=nsteps) pb_num[i+1] = self.get_stepsize(q2, -p2, smin=smin, smax=smax, eps=ssnew, ntry=ntry, nsteps=nsteps) adfac = np.prod(pb_num[:i+2])/np.prod(pf_den[:i+2]) prob = np.exp(H0 - H2) * adfac #print("prb, fac, metrop : ", prob, adfac, prob/adfac, pb_num[-1], pf_den[0]) if np.isnan(prob) or np.isinf(prob) or (q0-q1).sum()==0: return q0, p0, 2., prob, np.stack([pf_den, pb_num, eps]), [self.Hcount, self.Vgcount, self.leapcount] elif np.random.uniform(0., 1., size=1) > min(1., prob): return q0, p0, 0., prob, np.stack([pf_den, pb_num, eps]), [self.Hcount, self.Vgcount, self.leapcount] else: return q2, p2, 1., prob, np.stack([pf_den, pb_num, eps]), [self.Hcount, self.Vgcount, self.leapcount] ##
38.703065
180
0.513835
2,991
20,203
3.405884
0.09328
0.013743
0.019142
0.008835
0.822912
0.788456
0.769706
0.757829
0.7433
0.721508
0
0.046162
0.341632
20,203
521
181
38.777351
0.71972
0.198782
0
0.722054
0
0
0.01466
0
0
0
0
0
0
1
0.057402
false
0
0.015106
0.006042
0.166163
0.02719
0
0
0
null
0
0
0
1
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
7
b9f17cb5e7899351122967abf90e9105830e5b0f
312,471
py
Python
Tools/mavlink_px4.py
wms124/PX4_1.4.1_Back-up
9d6d903a8f46346281ae11104c47f1904da05e37
[ "BSD-3-Clause" ]
4,224
2015-01-02T11:51:02.000Z
2020-10-27T23:42:28.000Z
Tools/mavlink_px4.py
wms124/PX4_1.4.1_Back-up
9d6d903a8f46346281ae11104c47f1904da05e37
[ "BSD-3-Clause" ]
11,736
2015-01-01T11:59:16.000Z
2020-10-28T17:13:38.000Z
Tools/mavlink_px4.py
wms124/PX4_1.4.1_Back-up
9d6d903a8f46346281ae11104c47f1904da05e37
[ "BSD-3-Clause" ]
11,850
2015-01-02T14:54:47.000Z
2020-10-28T16:42:47.000Z
''' MAVLink protocol implementation (auto-generated by mavgen.py) Generated from: common.xml Note: this file has been auto-generated. DO NOT EDIT ''' import struct, array, mavutil, time, json WIRE_PROTOCOL_VERSION = "1.0" # some base types from mavlink_types.h MAVLINK_TYPE_CHAR = 0 MAVLINK_TYPE_UINT8_T = 1 MAVLINK_TYPE_INT8_T = 2 MAVLINK_TYPE_UINT16_T = 3 MAVLINK_TYPE_INT16_T = 4 MAVLINK_TYPE_UINT32_T = 5 MAVLINK_TYPE_INT32_T = 6 MAVLINK_TYPE_UINT64_T = 7 MAVLINK_TYPE_INT64_T = 8 MAVLINK_TYPE_FLOAT = 9 MAVLINK_TYPE_DOUBLE = 10 class MAVLink_header(object): '''MAVLink message header''' def __init__(self, msgId, mlen=0, seq=0, srcSystem=0, srcComponent=0): self.mlen = mlen self.seq = seq self.srcSystem = srcSystem self.srcComponent = srcComponent self.msgId = msgId def pack(self): return struct.pack('BBBBBB', 254, self.mlen, self.seq, self.srcSystem, self.srcComponent, self.msgId) class MAVLink_message(object): '''base MAVLink message class''' def __init__(self, msgId, name): self._header = MAVLink_header(msgId) self._payload = None self._msgbuf = None self._crc = None self._fieldnames = [] self._type = name def get_msgbuf(self): if isinstance(self._msgbuf, str): return self._msgbuf return self._msgbuf.tostring() def get_header(self): return self._header def get_payload(self): return self._payload def get_crc(self): return self._crc def get_fieldnames(self): return self._fieldnames def get_type(self): return self._type def get_msgId(self): return self._header.msgId def get_srcSystem(self): return self._header.srcSystem def get_srcComponent(self): return self._header.srcComponent def get_seq(self): return self._header.seq def __str__(self): ret = '%s {' % self._type for a in self._fieldnames: v = getattr(self, a) ret += '%s : %s, ' % (a, v) ret = ret[0:-2] + '}' return ret def to_dict(self): d = dict({}) d['mavpackettype'] = self._type for a in self._fieldnames: d[a] = getattr(self, a) return d def to_json(self): return json.dumps(self.to_dict) def pack(self, mav, crc_extra, payload): self._payload = payload self._header = MAVLink_header(self._header.msgId, len(payload), mav.seq, mav.srcSystem, mav.srcComponent) self._msgbuf = self._header.pack() + payload crc = mavutil.x25crc(self._msgbuf[1:]) if True: # using CRC extra crc.accumulate(chr(crc_extra)) self._crc = crc.crc self._msgbuf += struct.pack('<H', self._crc) return self._msgbuf # enums # MAV_AUTOPILOT MAV_AUTOPILOT_GENERIC = 0 # Generic autopilot, full support for everything MAV_AUTOPILOT_PIXHAWK = 1 # PIXHAWK autopilot, http://pixhawk.ethz.ch MAV_AUTOPILOT_SLUGS = 2 # SLUGS autopilot, http://slugsuav.soe.ucsc.edu MAV_AUTOPILOT_ARDUPILOTMEGA = 3 # ArduPilotMega / ArduCopter, http://diydrones.com MAV_AUTOPILOT_OPENPILOT = 4 # OpenPilot, http://openpilot.org MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5 # Generic autopilot only supporting simple waypoints MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6 # Generic autopilot supporting waypoints and other simple navigation # commands MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7 # Generic autopilot supporting the full mission command set MAV_AUTOPILOT_INVALID = 8 # No valid autopilot, e.g. a GCS or other MAVLink component MAV_AUTOPILOT_PPZ = 9 # PPZ UAV - http://nongnu.org/paparazzi MAV_AUTOPILOT_UDB = 10 # UAV Dev Board MAV_AUTOPILOT_FP = 11 # FlexiPilot MAV_AUTOPILOT_PX4 = 12 # PX4 Autopilot - http://pixhawk.ethz.ch/px4/ MAV_AUTOPILOT_ENUM_END = 13 # # MAV_TYPE MAV_TYPE_GENERIC = 0 # Generic micro air vehicle. MAV_TYPE_FIXED_WING = 1 # Fixed wing aircraft. MAV_TYPE_QUADROTOR = 2 # Quadrotor MAV_TYPE_COAXIAL = 3 # Coaxial helicopter MAV_TYPE_HELICOPTER = 4 # Normal helicopter with tail rotor. MAV_TYPE_ANTENNA_TRACKER = 5 # Ground installation MAV_TYPE_GCS = 6 # Operator control unit / ground control station MAV_TYPE_AIRSHIP = 7 # Airship, controlled MAV_TYPE_FREE_BALLOON = 8 # Free balloon, uncontrolled MAV_TYPE_ROCKET = 9 # Rocket MAV_TYPE_GROUND_ROVER = 10 # Ground rover MAV_TYPE_SURFACE_BOAT = 11 # Surface vessel, boat, ship MAV_TYPE_SUBMARINE = 12 # Submarine MAV_TYPE_HEXAROTOR = 13 # Hexarotor MAV_TYPE_OCTOROTOR = 14 # Octorotor MAV_TYPE_TRICOPTER = 15 # Octorotor MAV_TYPE_FLAPPING_WING = 16 # Flapping wing MAV_TYPE_KITE = 17 # Flapping wing MAV_TYPE_ENUM_END = 18 # # MAV_MODE_FLAG MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 # 0b00000001 Reserved for future use. MAV_MODE_FLAG_TEST_ENABLED = 2 # 0b00000010 system has a test mode enabled. This flag is intended for # temporary system tests and should not be # used for stable implementations. MAV_MODE_FLAG_AUTO_ENABLED = 4 # 0b00000100 autonomous mode enabled, system finds its own goal # positions. Guided flag can be set or not, # depends on the actual implementation. MAV_MODE_FLAG_GUIDED_ENABLED = 8 # 0b00001000 guided mode enabled, system flies MISSIONs / mission items. MAV_MODE_FLAG_STABILIZE_ENABLED = 16 # 0b00010000 system stabilizes electronically its attitude (and # optionally position). It needs however # further control inputs to move around. MAV_MODE_FLAG_HIL_ENABLED = 32 # 0b00100000 hardware in the loop simulation. All motors / actuators are # blocked, but internal software is full # operational. MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 # 0b01000000 remote control input is enabled. MAV_MODE_FLAG_SAFETY_ARMED = 128 # 0b10000000 MAV safety set to armed. Motors are enabled / running / can # start. Ready to fly. MAV_MODE_FLAG_ENUM_END = 129 # # MAV_MODE_FLAG_DECODE_POSITION MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1 # Eighth bit: 00000001 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2 # Seventh bit: 00000010 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4 # Sixt bit: 00000100 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8 # Fifth bit: 00001000 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16 # Fourth bit: 00010000 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32 # Third bit: 00100000 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64 # Second bit: 01000000 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128 # First bit: 10000000 MAV_MODE_FLAG_DECODE_POSITION_ENUM_END = 129 # # MAV_GOTO MAV_GOTO_DO_HOLD = 0 # Hold at the current position. MAV_GOTO_DO_CONTINUE = 1 # Continue with the next item in mission execution. MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2 # Hold at the current position of the system MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3 # Hold at the position specified in the parameters of the DO_HOLD action MAV_GOTO_ENUM_END = 4 # # MAV_MODE MAV_MODE_PREFLIGHT = 0 # System is not ready to fly, booting, calibrating, etc. No flag is set. MAV_MODE_MANUAL_DISARMED = 64 # System is allowed to be active, under manual (RC) control, no # stabilization MAV_MODE_TEST_DISARMED = 66 # UNDEFINED mode. This solely depends on the autopilot - use with # caution, intended for developers only. MAV_MODE_STABILIZE_DISARMED = 80 # System is allowed to be active, under assisted RC control. MAV_MODE_GUIDED_DISARMED = 88 # System is allowed to be active, under autonomous control, manual # setpoint MAV_MODE_AUTO_DISARMED = 92 # System is allowed to be active, under autonomous control and # navigation (the trajectory is decided # onboard and not pre-programmed by MISSIONs) MAV_MODE_MANUAL_ARMED = 192 # System is allowed to be active, under manual (RC) control, no # stabilization MAV_MODE_TEST_ARMED = 194 # UNDEFINED mode. This solely depends on the autopilot - use with # caution, intended for developers only. MAV_MODE_STABILIZE_ARMED = 208 # System is allowed to be active, under assisted RC control. MAV_MODE_GUIDED_ARMED = 216 # System is allowed to be active, under autonomous control, manual # setpoint MAV_MODE_AUTO_ARMED = 220 # System is allowed to be active, under autonomous control and # navigation (the trajectory is decided # onboard and not pre-programmed by MISSIONs) MAV_MODE_ENUM_END = 221 # # MAV_STATE MAV_STATE_UNINIT = 0 # Uninitialized system, state is unknown. MAV_STATE_BOOT = 1 # System is booting up. MAV_STATE_CALIBRATING = 2 # System is calibrating and not flight-ready. MAV_STATE_STANDBY = 3 # System is grounded and on standby. It can be launched any time. MAV_STATE_ACTIVE = 4 # System is active and might be already airborne. Motors are engaged. MAV_STATE_CRITICAL = 5 # System is in a non-normal flight mode. It can however still navigate. MAV_STATE_EMERGENCY = 6 # System is in a non-normal flight mode. It lost control over parts or # over the whole airframe. It is in mayday and # going down. MAV_STATE_POWEROFF = 7 # System just initialized its power-down sequence, will shut down now. MAV_STATE_ENUM_END = 8 # # MAV_COMPONENT MAV_COMP_ID_ALL = 0 # MAV_COMP_ID_CAMERA = 100 # MAV_COMP_ID_SERVO1 = 140 # MAV_COMP_ID_SERVO2 = 141 # MAV_COMP_ID_SERVO3 = 142 # MAV_COMP_ID_SERVO4 = 143 # MAV_COMP_ID_SERVO5 = 144 # MAV_COMP_ID_SERVO6 = 145 # MAV_COMP_ID_SERVO7 = 146 # MAV_COMP_ID_SERVO8 = 147 # MAV_COMP_ID_SERVO9 = 148 # MAV_COMP_ID_SERVO10 = 149 # MAV_COMP_ID_SERVO11 = 150 # MAV_COMP_ID_SERVO12 = 151 # MAV_COMP_ID_SERVO13 = 152 # MAV_COMP_ID_SERVO14 = 153 # MAV_COMP_ID_MAPPER = 180 # MAV_COMP_ID_MISSIONPLANNER = 190 # MAV_COMP_ID_PATHPLANNER = 195 # MAV_COMP_ID_IMU = 200 # MAV_COMP_ID_IMU_2 = 201 # MAV_COMP_ID_IMU_3 = 202 # MAV_COMP_ID_GPS = 220 # MAV_COMP_ID_UDP_BRIDGE = 240 # MAV_COMP_ID_UART_BRIDGE = 241 # MAV_COMP_ID_SYSTEM_CONTROL = 250 # MAV_COMPONENT_ENUM_END = 251 # # MAV_FRAME MAV_FRAME_GLOBAL = 0 # Global coordinate frame, WGS84 coordinate system. First value / x: # latitude, second value / y: longitude, third # value / z: positive altitude over mean sea # level (MSL) MAV_FRAME_LOCAL_NED = 1 # Local coordinate frame, Z-up (x: north, y: east, z: down). MAV_FRAME_MISSION = 2 # NOT a coordinate frame, indicates a mission command. MAV_FRAME_GLOBAL_RELATIVE_ALT = 3 # Global coordinate frame, WGS84 coordinate system, relative altitude # over ground with respect to the home # position. First value / x: latitude, second # value / y: longitude, third value / z: # positive altitude with 0 being at the # altitude of the home location. MAV_FRAME_LOCAL_ENU = 4 # Local coordinate frame, Z-down (x: east, y: north, z: up) MAV_FRAME_ENUM_END = 5 # # MAVLINK_DATA_STREAM_TYPE MAVLINK_DATA_STREAM_IMG_JPEG = 1 # MAVLINK_DATA_STREAM_IMG_BMP = 2 # MAVLINK_DATA_STREAM_IMG_RAW8U = 3 # MAVLINK_DATA_STREAM_IMG_RAW32U = 4 # MAVLINK_DATA_STREAM_IMG_PGM = 5 # MAVLINK_DATA_STREAM_IMG_PNG = 6 # MAVLINK_DATA_STREAM_TYPE_ENUM_END = 7 # # MAV_CMD MAV_CMD_NAV_WAYPOINT = 16 # Navigate to MISSION. MAV_CMD_NAV_LOITER_UNLIM = 17 # Loiter around this MISSION an unlimited amount of time MAV_CMD_NAV_LOITER_TURNS = 18 # Loiter around this MISSION for X turns MAV_CMD_NAV_LOITER_TIME = 19 # Loiter around this MISSION for X seconds MAV_CMD_NAV_RETURN_TO_LAUNCH = 20 # Return to launch location MAV_CMD_NAV_LAND = 21 # Land at location MAV_CMD_NAV_TAKEOFF = 22 # Takeoff from ground / hand MAV_CMD_NAV_ROI = 80 # Sets the region of interest (ROI) for a sensor set or the vehicle # itself. This can then be used by the # vehicles control system to control the # vehicle attitude and the attitude of various # sensors such as cameras. MAV_CMD_NAV_PATHPLANNING = 81 # Control autonomous path planning on the MAV. MAV_CMD_NAV_LAST = 95 # NOP - This command is only used to mark the upper limit of the # NAV/ACTION commands in the enumeration MAV_CMD_CONDITION_DELAY = 112 # Delay mission state machine. MAV_CMD_CONDITION_CHANGE_ALT = 113 # Ascend/descend at rate. Delay mission state machine until desired # altitude reached. MAV_CMD_CONDITION_DISTANCE = 114 # Delay mission state machine until within desired distance of next NAV # point. MAV_CMD_CONDITION_YAW = 115 # Reach a certain target angle. MAV_CMD_CONDITION_LAST = 159 # NOP - This command is only used to mark the upper limit of the # CONDITION commands in the enumeration MAV_CMD_DO_SET_MODE = 176 # Set system mode. MAV_CMD_DO_JUMP = 177 # Jump to the desired command in the mission list. Repeat this action # only the specified number of times MAV_CMD_DO_CHANGE_SPEED = 178 # Change speed and/or throttle set points. MAV_CMD_DO_SET_HOME = 179 # Changes the home location either to the current location or a # specified location. MAV_CMD_DO_SET_PARAMETER = 180 # Set a system parameter. Caution! Use of this command requires # knowledge of the numeric enumeration value # of the parameter. MAV_CMD_DO_SET_RELAY = 181 # Set a relay to a condition. MAV_CMD_DO_REPEAT_RELAY = 182 # Cycle a relay on and off for a desired number of cyles with a desired # period. MAV_CMD_DO_SET_SERVO = 183 # Set a servo to a desired PWM value. MAV_CMD_DO_REPEAT_SERVO = 184 # Cycle a between its nominal setting and a desired PWM for a desired # number of cycles with a desired period. MAV_CMD_DO_CONTROL_VIDEO = 200 # Control onboard camera system. MAV_CMD_DO_LAST = 240 # NOP - This command is only used to mark the upper limit of the DO # commands in the enumeration MAV_CMD_PREFLIGHT_CALIBRATION = 241 # Trigger calibration. This command will be only accepted if in pre- # flight mode. MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242 # Set sensor offsets. This command will be only accepted if in pre- # flight mode. MAV_CMD_PREFLIGHT_STORAGE = 245 # Request storage of different parameter values and logs. This command # will be only accepted if in pre-flight mode. MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246 # Request the reboot or shutdown of system components. MAV_CMD_OVERRIDE_GOTO = 252 # Hold / continue the current action MAV_CMD_MISSION_START = 300 # start running a mission MAV_CMD_COMPONENT_ARM_DISARM = 400 # Arms / Disarms a component MAV_CMD_ENUM_END = 401 # # MAV_DATA_STREAM MAV_DATA_STREAM_ALL = 0 # Enable all data streams MAV_DATA_STREAM_RAW_SENSORS = 1 # Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. MAV_DATA_STREAM_EXTENDED_STATUS = 2 # Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS MAV_DATA_STREAM_RC_CHANNELS = 3 # Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW MAV_DATA_STREAM_RAW_CONTROLLER = 4 # Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, # NAV_CONTROLLER_OUTPUT. MAV_DATA_STREAM_POSITION = 6 # Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. MAV_DATA_STREAM_EXTRA1 = 10 # Dependent on the autopilot MAV_DATA_STREAM_EXTRA2 = 11 # Dependent on the autopilot MAV_DATA_STREAM_EXTRA3 = 12 # Dependent on the autopilot MAV_DATA_STREAM_ENUM_END = 13 # # MAV_ROI MAV_ROI_NONE = 0 # No region of interest. MAV_ROI_WPNEXT = 1 # Point toward next MISSION. MAV_ROI_WPINDEX = 2 # Point toward given MISSION. MAV_ROI_LOCATION = 3 # Point toward fixed location. MAV_ROI_TARGET = 4 # Point toward of given id. MAV_ROI_ENUM_END = 5 # # MAV_CMD_ACK MAV_CMD_ACK_OK = 1 # Command / mission item is ok. MAV_CMD_ACK_ERR_FAIL = 2 # Generic error message if none of the other reasons fails or if no # detailed error reporting is implemented. MAV_CMD_ACK_ERR_ACCESS_DENIED = 3 # The system is refusing to accept this command from this source / # communication partner. MAV_CMD_ACK_ERR_NOT_SUPPORTED = 4 # Command or mission item is not supported, other commands would be # accepted. MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 5 # The coordinate frame of this command / mission item is not supported. MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE = 6 # The coordinate frame of this command is ok, but he coordinate values # exceed the safety limits of this system. # This is a generic error, please use the more # specific error messages below if possible. MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE = 7 # The X or latitude value is out of range. MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE = 8 # The Y or longitude value is out of range. MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE = 9 # The Z or altitude value is out of range. MAV_CMD_ACK_ENUM_END = 10 # # MAV_PARAM_TYPE MAV_PARAM_TYPE_UINT8 = 1 # 8-bit unsigned integer MAV_PARAM_TYPE_INT8 = 2 # 8-bit signed integer MAV_PARAM_TYPE_UINT16 = 3 # 16-bit unsigned integer MAV_PARAM_TYPE_INT16 = 4 # 16-bit signed integer MAV_PARAM_TYPE_UINT32 = 5 # 32-bit unsigned integer MAV_PARAM_TYPE_INT32 = 6 # 32-bit signed integer MAV_PARAM_TYPE_UINT64 = 7 # 64-bit unsigned integer MAV_PARAM_TYPE_INT64 = 8 # 64-bit signed integer MAV_PARAM_TYPE_REAL32 = 9 # 32-bit floating-point MAV_PARAM_TYPE_REAL64 = 10 # 64-bit floating-point MAV_PARAM_TYPE_ENUM_END = 11 # # MAV_RESULT MAV_RESULT_ACCEPTED = 0 # Command ACCEPTED and EXECUTED MAV_RESULT_TEMPORARILY_REJECTED = 1 # Command TEMPORARY REJECTED/DENIED MAV_RESULT_DENIED = 2 # Command PERMANENTLY DENIED MAV_RESULT_UNSUPPORTED = 3 # Command UNKNOWN/UNSUPPORTED MAV_RESULT_FAILED = 4 # Command executed, but failed MAV_RESULT_ENUM_END = 5 # # MAV_MISSION_RESULT MAV_MISSION_ACCEPTED = 0 # mission accepted OK MAV_MISSION_ERROR = 1 # generic error / not accepting mission commands at all right now MAV_MISSION_UNSUPPORTED_FRAME = 2 # coordinate frame is not supported MAV_MISSION_UNSUPPORTED = 3 # command is not supported MAV_MISSION_NO_SPACE = 4 # mission item exceeds storage space MAV_MISSION_INVALID = 5 # one of the parameters has an invalid value MAV_MISSION_INVALID_PARAM1 = 6 # param1 has an invalid value MAV_MISSION_INVALID_PARAM2 = 7 # param2 has an invalid value MAV_MISSION_INVALID_PARAM3 = 8 # param3 has an invalid value MAV_MISSION_INVALID_PARAM4 = 9 # param4 has an invalid value MAV_MISSION_INVALID_PARAM5_X = 10 # x/param5 has an invalid value MAV_MISSION_INVALID_PARAM6_Y = 11 # y/param6 has an invalid value MAV_MISSION_INVALID_PARAM7 = 12 # param7 has an invalid value MAV_MISSION_INVALID_SEQUENCE = 13 # received waypoint out of sequence MAV_MISSION_DENIED = 14 # not accepting any mission commands from this communication partner MAV_MISSION_RESULT_ENUM_END = 15 # # MAV_SEVERITY MAV_SEVERITY_EMERGENCY = 0 # System is unusable. This is a "panic" condition. MAV_SEVERITY_ALERT = 1 # Action should be taken immediately. Indicates error in non-critical # systems. MAV_SEVERITY_CRITICAL = 2 # Action must be taken immediately. Indicates failure in a primary # system. MAV_SEVERITY_ERROR = 3 # Indicates an error in secondary/redundant systems. MAV_SEVERITY_WARNING = 4 # Indicates about a possible future error if this is not resolved within # a given timeframe. Example would be a low # battery warning. MAV_SEVERITY_NOTICE = 5 # An unusual event has occured, though not an error condition. This # should be investigated for the root cause. MAV_SEVERITY_INFO = 6 # Normal operational messages. Useful for logging. No action is required # for these messages. MAV_SEVERITY_DEBUG = 7 # Useful non-operational messages that can assist in debugging. These # should not occur during normal operation. MAV_SEVERITY_ENUM_END = 8 # # message IDs MAVLINK_MSG_ID_BAD_DATA = -1 MAVLINK_MSG_ID_HEARTBEAT = 0 MAVLINK_MSG_ID_SYS_STATUS = 1 MAVLINK_MSG_ID_SYSTEM_TIME = 2 MAVLINK_MSG_ID_PING = 4 MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL = 5 MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK = 6 MAVLINK_MSG_ID_AUTH_KEY = 7 MAVLINK_MSG_ID_SET_MODE = 11 MAVLINK_MSG_ID_PARAM_REQUEST_READ = 20 MAVLINK_MSG_ID_PARAM_REQUEST_LIST = 21 MAVLINK_MSG_ID_PARAM_VALUE = 22 MAVLINK_MSG_ID_PARAM_SET = 23 MAVLINK_MSG_ID_GPS_RAW_INT = 24 MAVLINK_MSG_ID_GPS_STATUS = 25 MAVLINK_MSG_ID_SCALED_IMU = 26 MAVLINK_MSG_ID_RAW_IMU = 27 MAVLINK_MSG_ID_RAW_PRESSURE = 28 MAVLINK_MSG_ID_SCALED_PRESSURE = 29 MAVLINK_MSG_ID_ATTITUDE = 30 MAVLINK_MSG_ID_ATTITUDE_QUATERNION = 31 MAVLINK_MSG_ID_LOCAL_POSITION_NED = 32 MAVLINK_MSG_ID_GLOBAL_POSITION_INT = 33 MAVLINK_MSG_ID_RC_CHANNELS_SCALED = 34 MAVLINK_MSG_ID_RC_CHANNELS_RAW = 35 MAVLINK_MSG_ID_SERVO_OUTPUT_RAW = 36 MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST = 37 MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST = 38 MAVLINK_MSG_ID_MISSION_ITEM = 39 MAVLINK_MSG_ID_MISSION_REQUEST = 40 MAVLINK_MSG_ID_MISSION_SET_CURRENT = 41 MAVLINK_MSG_ID_MISSION_CURRENT = 42 MAVLINK_MSG_ID_MISSION_REQUEST_LIST = 43 MAVLINK_MSG_ID_MISSION_COUNT = 44 MAVLINK_MSG_ID_MISSION_CLEAR_ALL = 45 MAVLINK_MSG_ID_MISSION_ITEM_REACHED = 46 MAVLINK_MSG_ID_MISSION_ACK = 47 MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN = 48 MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN = 49 MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT = 50 MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT = 51 MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT = 52 MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT = 53 MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA = 54 MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA = 55 MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST = 56 MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST = 57 MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT = 58 MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT = 59 MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT = 60 MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST = 61 MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT = 62 MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST = 63 MAVLINK_MSG_ID_STATE_CORRECTION = 64 MAVLINK_MSG_ID_REQUEST_DATA_STREAM = 66 MAVLINK_MSG_ID_DATA_STREAM = 67 MAVLINK_MSG_ID_MANUAL_CONTROL = 69 MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE = 70 MAVLINK_MSG_ID_VFR_HUD = 74 MAVLINK_MSG_ID_COMMAND_LONG = 76 MAVLINK_MSG_ID_COMMAND_ACK = 77 MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT = 80 MAVLINK_MSG_ID_MANUAL_SETPOINT = 81 MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET = 89 MAVLINK_MSG_ID_HIL_STATE = 90 MAVLINK_MSG_ID_HIL_CONTROLS = 91 MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW = 92 MAVLINK_MSG_ID_OPTICAL_FLOW = 100 MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE = 101 MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE = 102 MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE = 103 MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE = 104 MAVLINK_MSG_ID_HIGHRES_IMU = 105 MAVLINK_MSG_ID_FILE_TRANSFER_START = 110 MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST = 111 MAVLINK_MSG_ID_FILE_TRANSFER_RES = 112 MAVLINK_MSG_ID_BATTERY_STATUS = 147 MAVLINK_MSG_ID_SETPOINT_8DOF = 148 MAVLINK_MSG_ID_SETPOINT_6DOF = 149 MAVLINK_MSG_ID_MEMORY_VECT = 249 MAVLINK_MSG_ID_DEBUG_VECT = 250 MAVLINK_MSG_ID_NAMED_VALUE_FLOAT = 251 MAVLINK_MSG_ID_NAMED_VALUE_INT = 252 MAVLINK_MSG_ID_STATUSTEXT = 253 MAVLINK_MSG_ID_DEBUG = 254 class MAVLink_heartbeat_message(MAVLink_message): ''' The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). ''' def __init__(self, type, autopilot, base_mode, custom_mode, system_status, mavlink_version): MAVLink_message.__init__(self, MAVLINK_MSG_ID_HEARTBEAT, 'HEARTBEAT') self._fieldnames = ['type', 'autopilot', 'base_mode', 'custom_mode', 'system_status', 'mavlink_version'] self.type = type self.autopilot = autopilot self.base_mode = base_mode self.custom_mode = custom_mode self.system_status = system_status self.mavlink_version = mavlink_version def pack(self, mav): return MAVLink_message.pack(self, mav, 50, struct.pack('<IBBBBB', self.custom_mode, self.type, self.autopilot, self.base_mode, self.system_status, self.mavlink_version)) class MAVLink_sys_status_message(MAVLink_message): ''' The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows wether the system is currently active or not and if an emergency occured. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occured it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout. ''' def __init__(self, onboard_control_sensors_present, onboard_control_sensors_enabled, onboard_control_sensors_health, load, voltage_battery, current_battery, battery_remaining, drop_rate_comm, errors_comm, errors_count1, errors_count2, errors_count3, errors_count4): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SYS_STATUS, 'SYS_STATUS') self._fieldnames = ['onboard_control_sensors_present', 'onboard_control_sensors_enabled', 'onboard_control_sensors_health', 'load', 'voltage_battery', 'current_battery', 'battery_remaining', 'drop_rate_comm', 'errors_comm', 'errors_count1', 'errors_count2', 'errors_count3', 'errors_count4'] self.onboard_control_sensors_present = onboard_control_sensors_present self.onboard_control_sensors_enabled = onboard_control_sensors_enabled self.onboard_control_sensors_health = onboard_control_sensors_health self.load = load self.voltage_battery = voltage_battery self.current_battery = current_battery self.battery_remaining = battery_remaining self.drop_rate_comm = drop_rate_comm self.errors_comm = errors_comm self.errors_count1 = errors_count1 self.errors_count2 = errors_count2 self.errors_count3 = errors_count3 self.errors_count4 = errors_count4 def pack(self, mav): return MAVLink_message.pack(self, mav, 124, struct.pack('<IIIHHhHHHHHHb', self.onboard_control_sensors_present, self.onboard_control_sensors_enabled, self.onboard_control_sensors_health, self.load, self.voltage_battery, self.current_battery, self.drop_rate_comm, self.errors_comm, self.errors_count1, self.errors_count2, self.errors_count3, self.errors_count4, self.battery_remaining)) class MAVLink_system_time_message(MAVLink_message): ''' The system time is the time of the master clock, typically the computer clock of the main onboard computer. ''' def __init__(self, time_unix_usec, time_boot_ms): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SYSTEM_TIME, 'SYSTEM_TIME') self._fieldnames = ['time_unix_usec', 'time_boot_ms'] self.time_unix_usec = time_unix_usec self.time_boot_ms = time_boot_ms def pack(self, mav): return MAVLink_message.pack(self, mav, 137, struct.pack('<QI', self.time_unix_usec, self.time_boot_ms)) class MAVLink_ping_message(MAVLink_message): ''' A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. ''' def __init__(self, time_usec, seq, target_system, target_component): MAVLink_message.__init__(self, MAVLINK_MSG_ID_PING, 'PING') self._fieldnames = ['time_usec', 'seq', 'target_system', 'target_component'] self.time_usec = time_usec self.seq = seq self.target_system = target_system self.target_component = target_component def pack(self, mav): return MAVLink_message.pack(self, mav, 237, struct.pack('<QIBB', self.time_usec, self.seq, self.target_system, self.target_component)) class MAVLink_change_operator_control_message(MAVLink_message): ''' Request to control this MAV ''' def __init__(self, target_system, control_request, version, passkey): MAVLink_message.__init__(self, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, 'CHANGE_OPERATOR_CONTROL') self._fieldnames = ['target_system', 'control_request', 'version', 'passkey'] self.target_system = target_system self.control_request = control_request self.version = version self.passkey = passkey def pack(self, mav): return MAVLink_message.pack(self, mav, 217, struct.pack('<BBB25s', self.target_system, self.control_request, self.version, self.passkey)) class MAVLink_change_operator_control_ack_message(MAVLink_message): ''' Accept / deny control of this MAV ''' def __init__(self, gcs_system_id, control_request, ack): MAVLink_message.__init__(self, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, 'CHANGE_OPERATOR_CONTROL_ACK') self._fieldnames = ['gcs_system_id', 'control_request', 'ack'] self.gcs_system_id = gcs_system_id self.control_request = control_request self.ack = ack def pack(self, mav): return MAVLink_message.pack(self, mav, 104, struct.pack('<BBB', self.gcs_system_id, self.control_request, self.ack)) class MAVLink_auth_key_message(MAVLink_message): ''' Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. ''' def __init__(self, key): MAVLink_message.__init__(self, MAVLINK_MSG_ID_AUTH_KEY, 'AUTH_KEY') self._fieldnames = ['key'] self.key = key def pack(self, mav): return MAVLink_message.pack(self, mav, 119, struct.pack('<32s', self.key)) class MAVLink_set_mode_message(MAVLink_message): ''' Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. ''' def __init__(self, target_system, base_mode, custom_mode): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_MODE, 'SET_MODE') self._fieldnames = ['target_system', 'base_mode', 'custom_mode'] self.target_system = target_system self.base_mode = base_mode self.custom_mode = custom_mode def pack(self, mav): return MAVLink_message.pack(self, mav, 89, struct.pack('<IBB', self.custom_mode, self.target_system, self.base_mode)) class MAVLink_param_request_read_message(MAVLink_message): ''' Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -> value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. ''' def __init__(self, target_system, target_component, param_id, param_index): MAVLink_message.__init__(self, MAVLINK_MSG_ID_PARAM_REQUEST_READ, 'PARAM_REQUEST_READ') self._fieldnames = ['target_system', 'target_component', 'param_id', 'param_index'] self.target_system = target_system self.target_component = target_component self.param_id = param_id self.param_index = param_index def pack(self, mav): return MAVLink_message.pack(self, mav, 214, struct.pack('<hBB16s', self.param_index, self.target_system, self.target_component, self.param_id)) class MAVLink_param_request_list_message(MAVLink_message): ''' Request all parameters of this component. After his request, all parameters are emitted. ''' def __init__(self, target_system, target_component): MAVLink_message.__init__(self, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, 'PARAM_REQUEST_LIST') self._fieldnames = ['target_system', 'target_component'] self.target_system = target_system self.target_component = target_component def pack(self, mav): return MAVLink_message.pack(self, mav, 159, struct.pack('<BB', self.target_system, self.target_component)) class MAVLink_param_value_message(MAVLink_message): ''' Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. ''' def __init__(self, param_id, param_value, param_type, param_count, param_index): MAVLink_message.__init__(self, MAVLINK_MSG_ID_PARAM_VALUE, 'PARAM_VALUE') self._fieldnames = ['param_id', 'param_value', 'param_type', 'param_count', 'param_index'] self.param_id = param_id self.param_value = param_value self.param_type = param_type self.param_count = param_count self.param_index = param_index def pack(self, mav): return MAVLink_message.pack(self, mav, 220, struct.pack('<fHH16sB', self.param_value, self.param_count, self.param_index, self.param_id, self.param_type)) class MAVLink_param_set_message(MAVLink_message): ''' Set a parameter value TEMPORARILY to RAM. It will be reset to default on system reboot. Send the ACTION MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM contents to EEPROM. IMPORTANT: The receiving component should acknowledge the new parameter value by sending a param_value message to all communication partners. This will also ensure that multiple GCS all have an up-to-date list of all parameters. If the sending GCS did not receive a PARAM_VALUE message within its timeout time, it should re-send the PARAM_SET message. ''' def __init__(self, target_system, target_component, param_id, param_value, param_type): MAVLink_message.__init__(self, MAVLINK_MSG_ID_PARAM_SET, 'PARAM_SET') self._fieldnames = ['target_system', 'target_component', 'param_id', 'param_value', 'param_type'] self.target_system = target_system self.target_component = target_component self.param_id = param_id self.param_value = param_value self.param_type = param_type def pack(self, mav): return MAVLink_message.pack(self, mav, 168, struct.pack('<fBB16sB', self.param_value, self.target_system, self.target_component, self.param_id, self.param_type)) class MAVLink_gps_raw_int_message(MAVLink_message): ''' The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame). ''' def __init__(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible): MAVLink_message.__init__(self, MAVLINK_MSG_ID_GPS_RAW_INT, 'GPS_RAW_INT') self._fieldnames = ['time_usec', 'fix_type', 'lat', 'lon', 'alt', 'eph', 'epv', 'vel', 'cog', 'satellites_visible'] self.time_usec = time_usec self.fix_type = fix_type self.lat = lat self.lon = lon self.alt = alt self.eph = eph self.epv = epv self.vel = vel self.cog = cog self.satellites_visible = satellites_visible def pack(self, mav): return MAVLink_message.pack(self, mav, 24, struct.pack('<QiiiHHHHBB', self.time_usec, self.lat, self.lon, self.alt, self.eph, self.epv, self.vel, self.cog, self.fix_type, self.satellites_visible)) class MAVLink_gps_status_message(MAVLink_message): ''' The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION for the global position estimate. This message can contain information for up to 20 satellites. ''' def __init__(self, satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr): MAVLink_message.__init__(self, MAVLINK_MSG_ID_GPS_STATUS, 'GPS_STATUS') self._fieldnames = ['satellites_visible', 'satellite_prn', 'satellite_used', 'satellite_elevation', 'satellite_azimuth', 'satellite_snr'] self.satellites_visible = satellites_visible self.satellite_prn = satellite_prn self.satellite_used = satellite_used self.satellite_elevation = satellite_elevation self.satellite_azimuth = satellite_azimuth self.satellite_snr = satellite_snr def pack(self, mav): return MAVLink_message.pack(self, mav, 23, struct.pack('<B20s20s20s20s20s', self.satellites_visible, self.satellite_prn, self.satellite_used, self.satellite_elevation, self.satellite_azimuth, self.satellite_snr)) class MAVLink_scaled_imu_message(MAVLink_message): ''' The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units ''' def __init__(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SCALED_IMU, 'SCALED_IMU') self._fieldnames = ['time_boot_ms', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag'] self.time_boot_ms = time_boot_ms self.xacc = xacc self.yacc = yacc self.zacc = zacc self.xgyro = xgyro self.ygyro = ygyro self.zgyro = zgyro self.xmag = xmag self.ymag = ymag self.zmag = zmag def pack(self, mav): return MAVLink_message.pack(self, mav, 170, struct.pack('<Ihhhhhhhhh', self.time_boot_ms, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag)) class MAVLink_raw_imu_message(MAVLink_message): ''' The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. ''' def __init__(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag): MAVLink_message.__init__(self, MAVLINK_MSG_ID_RAW_IMU, 'RAW_IMU') self._fieldnames = ['time_usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag'] self.time_usec = time_usec self.xacc = xacc self.yacc = yacc self.zacc = zacc self.xgyro = xgyro self.ygyro = ygyro self.zgyro = zgyro self.xmag = xmag self.ymag = ymag self.zmag = zmag def pack(self, mav): return MAVLink_message.pack(self, mav, 144, struct.pack('<Qhhhhhhhhh', self.time_usec, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag)) class MAVLink_raw_pressure_message(MAVLink_message): ''' The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values. ''' def __init__(self, time_usec, press_abs, press_diff1, press_diff2, temperature): MAVLink_message.__init__(self, MAVLINK_MSG_ID_RAW_PRESSURE, 'RAW_PRESSURE') self._fieldnames = ['time_usec', 'press_abs', 'press_diff1', 'press_diff2', 'temperature'] self.time_usec = time_usec self.press_abs = press_abs self.press_diff1 = press_diff1 self.press_diff2 = press_diff2 self.temperature = temperature def pack(self, mav): return MAVLink_message.pack(self, mav, 67, struct.pack('<Qhhhh', self.time_usec, self.press_abs, self.press_diff1, self.press_diff2, self.temperature)) class MAVLink_scaled_pressure_message(MAVLink_message): ''' The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field. ''' def __init__(self, time_boot_ms, press_abs, press_diff, temperature): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SCALED_PRESSURE, 'SCALED_PRESSURE') self._fieldnames = ['time_boot_ms', 'press_abs', 'press_diff', 'temperature'] self.time_boot_ms = time_boot_ms self.press_abs = press_abs self.press_diff = press_diff self.temperature = temperature def pack(self, mav): return MAVLink_message.pack(self, mav, 115, struct.pack('<Iffh', self.time_boot_ms, self.press_abs, self.press_diff, self.temperature)) class MAVLink_attitude_message(MAVLink_message): ''' The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). ''' def __init__(self, time_boot_ms, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed): MAVLink_message.__init__(self, MAVLINK_MSG_ID_ATTITUDE, 'ATTITUDE') self._fieldnames = ['time_boot_ms', 'roll', 'pitch', 'yaw', 'rollspeed', 'pitchspeed', 'yawspeed'] self.time_boot_ms = time_boot_ms self.roll = roll self.pitch = pitch self.yaw = yaw self.rollspeed = rollspeed self.pitchspeed = pitchspeed self.yawspeed = yawspeed def pack(self, mav): return MAVLink_message.pack(self, mav, 39, struct.pack('<Iffffff', self.time_boot_ms, self.roll, self.pitch, self.yaw, self.rollspeed, self.pitchspeed, self.yawspeed)) class MAVLink_attitude_quaternion_message(MAVLink_message): ''' The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. ''' def __init__(self, time_boot_ms, q1, q2, q3, q4, rollspeed, pitchspeed, yawspeed): MAVLink_message.__init__(self, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, 'ATTITUDE_QUATERNION') self._fieldnames = ['time_boot_ms', 'q1', 'q2', 'q3', 'q4', 'rollspeed', 'pitchspeed', 'yawspeed'] self.time_boot_ms = time_boot_ms self.q1 = q1 self.q2 = q2 self.q3 = q3 self.q4 = q4 self.rollspeed = rollspeed self.pitchspeed = pitchspeed self.yawspeed = yawspeed def pack(self, mav): return MAVLink_message.pack(self, mav, 246, struct.pack('<Ifffffff', self.time_boot_ms, self.q1, self.q2, self.q3, self.q4, self.rollspeed, self.pitchspeed, self.yawspeed)) class MAVLink_local_position_ned_message(MAVLink_message): ''' The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) ''' def __init__(self, time_boot_ms, x, y, z, vx, vy, vz): MAVLink_message.__init__(self, MAVLINK_MSG_ID_LOCAL_POSITION_NED, 'LOCAL_POSITION_NED') self._fieldnames = ['time_boot_ms', 'x', 'y', 'z', 'vx', 'vy', 'vz'] self.time_boot_ms = time_boot_ms self.x = x self.y = y self.z = z self.vx = vx self.vy = vy self.vz = vz def pack(self, mav): return MAVLink_message.pack(self, mav, 185, struct.pack('<Iffffff', self.time_boot_ms, self.x, self.y, self.z, self.vx, self.vy, self.vz)) class MAVLink_global_position_int_message(MAVLink_message): ''' The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. ''' def __init__(self, time_boot_ms, lat, lon, alt, relative_alt, vx, vy, vz, hdg): MAVLink_message.__init__(self, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, 'GLOBAL_POSITION_INT') self._fieldnames = ['time_boot_ms', 'lat', 'lon', 'alt', 'relative_alt', 'vx', 'vy', 'vz', 'hdg'] self.time_boot_ms = time_boot_ms self.lat = lat self.lon = lon self.alt = alt self.relative_alt = relative_alt self.vx = vx self.vy = vy self.vz = vz self.hdg = hdg def pack(self, mav): return MAVLink_message.pack(self, mav, 104, struct.pack('<IiiiihhhH', self.time_boot_ms, self.lat, self.lon, self.alt, self.relative_alt, self.vx, self.vy, self.vz, self.hdg)) class MAVLink_rc_channels_scaled_message(MAVLink_message): ''' The scaled values of the RC channels received. (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to 65535. ''' def __init__(self, time_boot_ms, port, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi): MAVLink_message.__init__(self, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, 'RC_CHANNELS_SCALED') self._fieldnames = ['time_boot_ms', 'port', 'chan1_scaled', 'chan2_scaled', 'chan3_scaled', 'chan4_scaled', 'chan5_scaled', 'chan6_scaled', 'chan7_scaled', 'chan8_scaled', 'rssi'] self.time_boot_ms = time_boot_ms self.port = port self.chan1_scaled = chan1_scaled self.chan2_scaled = chan2_scaled self.chan3_scaled = chan3_scaled self.chan4_scaled = chan4_scaled self.chan5_scaled = chan5_scaled self.chan6_scaled = chan6_scaled self.chan7_scaled = chan7_scaled self.chan8_scaled = chan8_scaled self.rssi = rssi def pack(self, mav): return MAVLink_message.pack(self, mav, 237, struct.pack('<IhhhhhhhhBB', self.time_boot_ms, self.chan1_scaled, self.chan2_scaled, self.chan3_scaled, self.chan4_scaled, self.chan5_scaled, self.chan6_scaled, self.chan7_scaled, self.chan8_scaled, self.port, self.rssi)) class MAVLink_rc_channels_raw_message(MAVLink_message): ''' The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. ''' def __init__(self, time_boot_ms, port, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi): MAVLink_message.__init__(self, MAVLINK_MSG_ID_RC_CHANNELS_RAW, 'RC_CHANNELS_RAW') self._fieldnames = ['time_boot_ms', 'port', 'chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw', 'rssi'] self.time_boot_ms = time_boot_ms self.port = port self.chan1_raw = chan1_raw self.chan2_raw = chan2_raw self.chan3_raw = chan3_raw self.chan4_raw = chan4_raw self.chan5_raw = chan5_raw self.chan6_raw = chan6_raw self.chan7_raw = chan7_raw self.chan8_raw = chan8_raw self.rssi = rssi def pack(self, mav): return MAVLink_message.pack(self, mav, 244, struct.pack('<IHHHHHHHHBB', self.time_boot_ms, self.chan1_raw, self.chan2_raw, self.chan3_raw, self.chan4_raw, self.chan5_raw, self.chan6_raw, self.chan7_raw, self.chan8_raw, self.port, self.rssi)) class MAVLink_servo_output_raw_message(MAVLink_message): ''' The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. ''' def __init__(self, time_boot_ms, port, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 'SERVO_OUTPUT_RAW') self._fieldnames = ['time_boot_ms', 'port', 'servo1_raw', 'servo2_raw', 'servo3_raw', 'servo4_raw', 'servo5_raw', 'servo6_raw', 'servo7_raw', 'servo8_raw'] self.time_boot_ms = time_boot_ms self.port = port self.servo1_raw = servo1_raw self.servo2_raw = servo2_raw self.servo3_raw = servo3_raw self.servo4_raw = servo4_raw self.servo5_raw = servo5_raw self.servo6_raw = servo6_raw self.servo7_raw = servo7_raw self.servo8_raw = servo8_raw def pack(self, mav): return MAVLink_message.pack(self, mav, 242, struct.pack('<IHHHHHHHHB', self.time_boot_ms, self.servo1_raw, self.servo2_raw, self.servo3_raw, self.servo4_raw, self.servo5_raw, self.servo6_raw, self.servo7_raw, self.servo8_raw, self.port)) class MAVLink_mission_request_partial_list_message(MAVLink_message): ''' Request a partial list of mission items from the system/component. http://qgroundcontrol.org/mavlink/waypoint_protocol. If start and end index are the same, just send one waypoint. ''' def __init__(self, target_system, target_component, start_index, end_index): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, 'MISSION_REQUEST_PARTIAL_LIST') self._fieldnames = ['target_system', 'target_component', 'start_index', 'end_index'] self.target_system = target_system self.target_component = target_component self.start_index = start_index self.end_index = end_index def pack(self, mav): return MAVLink_message.pack(self, mav, 212, struct.pack('<hhBB', self.start_index, self.end_index, self.target_system, self.target_component)) class MAVLink_mission_write_partial_list_message(MAVLink_message): ''' This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED! ''' def __init__(self, target_system, target_component, start_index, end_index): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, 'MISSION_WRITE_PARTIAL_LIST') self._fieldnames = ['target_system', 'target_component', 'start_index', 'end_index'] self.target_system = target_system self.target_component = target_component self.start_index = start_index self.end_index = end_index def pack(self, mav): return MAVLink_message.pack(self, mav, 9, struct.pack('<hhBB', self.start_index, self.end_index, self.target_system, self.target_component)) class MAVLink_mission_item_message(MAVLink_message): ''' Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See also http://qgroundcontrol.org/mavlink/waypoint_protocol. ''' def __init__(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MISSION_ITEM, 'MISSION_ITEM') self._fieldnames = ['target_system', 'target_component', 'seq', 'frame', 'command', 'current', 'autocontinue', 'param1', 'param2', 'param3', 'param4', 'x', 'y', 'z'] self.target_system = target_system self.target_component = target_component self.seq = seq self.frame = frame self.command = command self.current = current self.autocontinue = autocontinue self.param1 = param1 self.param2 = param2 self.param3 = param3 self.param4 = param4 self.x = x self.y = y self.z = z def pack(self, mav): return MAVLink_message.pack(self, mav, 254, struct.pack('<fffffffHHBBBBB', self.param1, self.param2, self.param3, self.param4, self.x, self.y, self.z, self.seq, self.command, self.target_system, self.target_component, self.frame, self.current, self.autocontinue)) class MAVLink_mission_request_message(MAVLink_message): ''' Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. http://qgroundcontrol.org/mavlink/waypoint_protocol ''' def __init__(self, target_system, target_component, seq): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MISSION_REQUEST, 'MISSION_REQUEST') self._fieldnames = ['target_system', 'target_component', 'seq'] self.target_system = target_system self.target_component = target_component self.seq = seq def pack(self, mav): return MAVLink_message.pack(self, mav, 230, struct.pack('<HBB', self.seq, self.target_system, self.target_component)) class MAVLink_mission_set_current_message(MAVLink_message): ''' Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in- between). ''' def __init__(self, target_system, target_component, seq): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MISSION_SET_CURRENT, 'MISSION_SET_CURRENT') self._fieldnames = ['target_system', 'target_component', 'seq'] self.target_system = target_system self.target_component = target_component self.seq = seq def pack(self, mav): return MAVLink_message.pack(self, mav, 28, struct.pack('<HBB', self.seq, self.target_system, self.target_component)) class MAVLink_mission_current_message(MAVLink_message): ''' Message that announces the sequence number of the current active mission item. The MAV will fly towards this mission item. ''' def __init__(self, seq): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MISSION_CURRENT, 'MISSION_CURRENT') self._fieldnames = ['seq'] self.seq = seq def pack(self, mav): return MAVLink_message.pack(self, mav, 28, struct.pack('<H', self.seq)) class MAVLink_mission_request_list_message(MAVLink_message): ''' Request the overall list of mission items from the system/component. ''' def __init__(self, target_system, target_component): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, 'MISSION_REQUEST_LIST') self._fieldnames = ['target_system', 'target_component'] self.target_system = target_system self.target_component = target_component def pack(self, mav): return MAVLink_message.pack(self, mav, 132, struct.pack('<BB', self.target_system, self.target_component)) class MAVLink_mission_count_message(MAVLink_message): ''' This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of MISSIONs. ''' def __init__(self, target_system, target_component, count): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MISSION_COUNT, 'MISSION_COUNT') self._fieldnames = ['target_system', 'target_component', 'count'] self.target_system = target_system self.target_component = target_component self.count = count def pack(self, mav): return MAVLink_message.pack(self, mav, 221, struct.pack('<HBB', self.count, self.target_system, self.target_component)) class MAVLink_mission_clear_all_message(MAVLink_message): ''' Delete all mission items at once. ''' def __init__(self, target_system, target_component): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, 'MISSION_CLEAR_ALL') self._fieldnames = ['target_system', 'target_component'] self.target_system = target_system self.target_component = target_component def pack(self, mav): return MAVLink_message.pack(self, mav, 232, struct.pack('<BB', self.target_system, self.target_component)) class MAVLink_mission_item_reached_message(MAVLink_message): ''' A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next MISSION. ''' def __init__(self, seq): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, 'MISSION_ITEM_REACHED') self._fieldnames = ['seq'] self.seq = seq def pack(self, mav): return MAVLink_message.pack(self, mav, 11, struct.pack('<H', self.seq)) class MAVLink_mission_ack_message(MAVLink_message): ''' Ack message during MISSION handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). ''' def __init__(self, target_system, target_component, type): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MISSION_ACK, 'MISSION_ACK') self._fieldnames = ['target_system', 'target_component', 'type'] self.target_system = target_system self.target_component = target_component self.type = type def pack(self, mav): return MAVLink_message.pack(self, mav, 153, struct.pack('<BBB', self.target_system, self.target_component, self.type)) class MAVLink_set_gps_global_origin_message(MAVLink_message): ''' As local waypoints exist, the global MISSION reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. ''' def __init__(self, target_system, latitude, longitude, altitude): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, 'SET_GPS_GLOBAL_ORIGIN') self._fieldnames = ['target_system', 'latitude', 'longitude', 'altitude'] self.target_system = target_system self.latitude = latitude self.longitude = longitude self.altitude = altitude def pack(self, mav): return MAVLink_message.pack(self, mav, 41, struct.pack('<iiiB', self.latitude, self.longitude, self.altitude, self.target_system)) class MAVLink_gps_global_origin_message(MAVLink_message): ''' Once the MAV sets a new GPS-Local correspondence, this message announces the origin (0,0,0) position ''' def __init__(self, latitude, longitude, altitude): MAVLink_message.__init__(self, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, 'GPS_GLOBAL_ORIGIN') self._fieldnames = ['latitude', 'longitude', 'altitude'] self.latitude = latitude self.longitude = longitude self.altitude = altitude def pack(self, mav): return MAVLink_message.pack(self, mav, 39, struct.pack('<iii', self.latitude, self.longitude, self.altitude)) class MAVLink_set_local_position_setpoint_message(MAVLink_message): ''' Set the setpoint for a local position controller. This is the position in local coordinates the MAV should fly to. This message is sent by the path/MISSION planner to the onboard position controller. As some MAVs have a degree of freedom in yaw (e.g. all helicopters/quadrotors), the desired yaw angle is part of the message. ''' def __init__(self, target_system, target_component, coordinate_frame, x, y, z, yaw): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT, 'SET_LOCAL_POSITION_SETPOINT') self._fieldnames = ['target_system', 'target_component', 'coordinate_frame', 'x', 'y', 'z', 'yaw'] self.target_system = target_system self.target_component = target_component self.coordinate_frame = coordinate_frame self.x = x self.y = y self.z = z self.yaw = yaw def pack(self, mav): return MAVLink_message.pack(self, mav, 214, struct.pack('<ffffBBB', self.x, self.y, self.z, self.yaw, self.target_system, self.target_component, self.coordinate_frame)) class MAVLink_local_position_setpoint_message(MAVLink_message): ''' Transmit the current local setpoint of the controller to other MAVs (collision avoidance) and to the GCS. ''' def __init__(self, coordinate_frame, x, y, z, yaw): MAVLink_message.__init__(self, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT, 'LOCAL_POSITION_SETPOINT') self._fieldnames = ['coordinate_frame', 'x', 'y', 'z', 'yaw'] self.coordinate_frame = coordinate_frame self.x = x self.y = y self.z = z self.yaw = yaw def pack(self, mav): return MAVLink_message.pack(self, mav, 223, struct.pack('<ffffB', self.x, self.y, self.z, self.yaw, self.coordinate_frame)) class MAVLink_global_position_setpoint_int_message(MAVLink_message): ''' Transmit the current local setpoint of the controller to other MAVs (collision avoidance) and to the GCS. ''' def __init__(self, coordinate_frame, latitude, longitude, altitude, yaw): MAVLink_message.__init__(self, MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT, 'GLOBAL_POSITION_SETPOINT_INT') self._fieldnames = ['coordinate_frame', 'latitude', 'longitude', 'altitude', 'yaw'] self.coordinate_frame = coordinate_frame self.latitude = latitude self.longitude = longitude self.altitude = altitude self.yaw = yaw def pack(self, mav): return MAVLink_message.pack(self, mav, 141, struct.pack('<iiihB', self.latitude, self.longitude, self.altitude, self.yaw, self.coordinate_frame)) class MAVLink_set_global_position_setpoint_int_message(MAVLink_message): ''' Set the current global position setpoint. ''' def __init__(self, coordinate_frame, latitude, longitude, altitude, yaw): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT, 'SET_GLOBAL_POSITION_SETPOINT_INT') self._fieldnames = ['coordinate_frame', 'latitude', 'longitude', 'altitude', 'yaw'] self.coordinate_frame = coordinate_frame self.latitude = latitude self.longitude = longitude self.altitude = altitude self.yaw = yaw def pack(self, mav): return MAVLink_message.pack(self, mav, 33, struct.pack('<iiihB', self.latitude, self.longitude, self.altitude, self.yaw, self.coordinate_frame)) class MAVLink_safety_set_allowed_area_message(MAVLink_message): ''' Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/MISSIONs to accept and which to reject. Safety areas are often enforced by national or competition regulations. ''' def __init__(self, target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, 'SAFETY_SET_ALLOWED_AREA') self._fieldnames = ['target_system', 'target_component', 'frame', 'p1x', 'p1y', 'p1z', 'p2x', 'p2y', 'p2z'] self.target_system = target_system self.target_component = target_component self.frame = frame self.p1x = p1x self.p1y = p1y self.p1z = p1z self.p2x = p2x self.p2y = p2y self.p2z = p2z def pack(self, mav): return MAVLink_message.pack(self, mav, 15, struct.pack('<ffffffBBB', self.p1x, self.p1y, self.p1z, self.p2x, self.p2y, self.p2z, self.target_system, self.target_component, self.frame)) class MAVLink_safety_allowed_area_message(MAVLink_message): ''' Read out the safety zone the MAV currently assumes. ''' def __init__(self, frame, p1x, p1y, p1z, p2x, p2y, p2z): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, 'SAFETY_ALLOWED_AREA') self._fieldnames = ['frame', 'p1x', 'p1y', 'p1z', 'p2x', 'p2y', 'p2z'] self.frame = frame self.p1x = p1x self.p1y = p1y self.p1z = p1z self.p2x = p2x self.p2y = p2y self.p2z = p2z def pack(self, mav): return MAVLink_message.pack(self, mav, 3, struct.pack('<ffffffB', self.p1x, self.p1y, self.p1z, self.p2x, self.p2y, self.p2z, self.frame)) class MAVLink_set_roll_pitch_yaw_thrust_message(MAVLink_message): ''' Set roll, pitch and yaw. ''' def __init__(self, target_system, target_component, roll, pitch, yaw, thrust): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST, 'SET_ROLL_PITCH_YAW_THRUST') self._fieldnames = ['target_system', 'target_component', 'roll', 'pitch', 'yaw', 'thrust'] self.target_system = target_system self.target_component = target_component self.roll = roll self.pitch = pitch self.yaw = yaw self.thrust = thrust def pack(self, mav): return MAVLink_message.pack(self, mav, 100, struct.pack('<ffffBB', self.roll, self.pitch, self.yaw, self.thrust, self.target_system, self.target_component)) class MAVLink_set_roll_pitch_yaw_speed_thrust_message(MAVLink_message): ''' Set roll, pitch and yaw. ''' def __init__(self, target_system, target_component, roll_speed, pitch_speed, yaw_speed, thrust): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST, 'SET_ROLL_PITCH_YAW_SPEED_THRUST') self._fieldnames = ['target_system', 'target_component', 'roll_speed', 'pitch_speed', 'yaw_speed', 'thrust'] self.target_system = target_system self.target_component = target_component self.roll_speed = roll_speed self.pitch_speed = pitch_speed self.yaw_speed = yaw_speed self.thrust = thrust def pack(self, mav): return MAVLink_message.pack(self, mav, 24, struct.pack('<ffffBB', self.roll_speed, self.pitch_speed, self.yaw_speed, self.thrust, self.target_system, self.target_component)) class MAVLink_roll_pitch_yaw_thrust_setpoint_message(MAVLink_message): ''' Setpoint in roll, pitch, yaw currently active on the system. ''' def __init__(self, time_boot_ms, roll, pitch, yaw, thrust): MAVLink_message.__init__(self, MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT, 'ROLL_PITCH_YAW_THRUST_SETPOINT') self._fieldnames = ['time_boot_ms', 'roll', 'pitch', 'yaw', 'thrust'] self.time_boot_ms = time_boot_ms self.roll = roll self.pitch = pitch self.yaw = yaw self.thrust = thrust def pack(self, mav): return MAVLink_message.pack(self, mav, 239, struct.pack('<Iffff', self.time_boot_ms, self.roll, self.pitch, self.yaw, self.thrust)) class MAVLink_roll_pitch_yaw_speed_thrust_setpoint_message(MAVLink_message): ''' Setpoint in rollspeed, pitchspeed, yawspeed currently active on the system. ''' def __init__(self, time_boot_ms, roll_speed, pitch_speed, yaw_speed, thrust): MAVLink_message.__init__(self, MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, 'ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT') self._fieldnames = ['time_boot_ms', 'roll_speed', 'pitch_speed', 'yaw_speed', 'thrust'] self.time_boot_ms = time_boot_ms self.roll_speed = roll_speed self.pitch_speed = pitch_speed self.yaw_speed = yaw_speed self.thrust = thrust def pack(self, mav): return MAVLink_message.pack(self, mav, 238, struct.pack('<Iffff', self.time_boot_ms, self.roll_speed, self.pitch_speed, self.yaw_speed, self.thrust)) class MAVLink_set_quad_motors_setpoint_message(MAVLink_message): ''' Setpoint in the four motor speeds ''' def __init__(self, target_system, motor_front_nw, motor_right_ne, motor_back_se, motor_left_sw): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT, 'SET_QUAD_MOTORS_SETPOINT') self._fieldnames = ['target_system', 'motor_front_nw', 'motor_right_ne', 'motor_back_se', 'motor_left_sw'] self.target_system = target_system self.motor_front_nw = motor_front_nw self.motor_right_ne = motor_right_ne self.motor_back_se = motor_back_se self.motor_left_sw = motor_left_sw def pack(self, mav): return MAVLink_message.pack(self, mav, 30, struct.pack('<HHHHB', self.motor_front_nw, self.motor_right_ne, self.motor_back_se, self.motor_left_sw, self.target_system)) class MAVLink_set_quad_swarm_roll_pitch_yaw_thrust_message(MAVLink_message): ''' Setpoint for up to four quadrotors in a group / wing ''' def __init__(self, group, mode, roll, pitch, yaw, thrust): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, 'SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST') self._fieldnames = ['group', 'mode', 'roll', 'pitch', 'yaw', 'thrust'] self.group = group self.mode = mode self.roll = roll self.pitch = pitch self.yaw = yaw self.thrust = thrust def pack(self, mav): return MAVLink_message.pack(self, mav, 240, struct.pack('<4h4h4h4HBB', self.roll, self.pitch, self.yaw, self.thrust, self.group, self.mode)) class MAVLink_nav_controller_output_message(MAVLink_message): ''' Outputs of the APM navigation controller. The primary use of this message is to check the response and signs of the controller before actual flight and to assist with tuning controller parameters. ''' def __init__(self, nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error): MAVLink_message.__init__(self, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, 'NAV_CONTROLLER_OUTPUT') self._fieldnames = ['nav_roll', 'nav_pitch', 'nav_bearing', 'target_bearing', 'wp_dist', 'alt_error', 'aspd_error', 'xtrack_error'] self.nav_roll = nav_roll self.nav_pitch = nav_pitch self.nav_bearing = nav_bearing self.target_bearing = target_bearing self.wp_dist = wp_dist self.alt_error = alt_error self.aspd_error = aspd_error self.xtrack_error = xtrack_error def pack(self, mav): return MAVLink_message.pack(self, mav, 183, struct.pack('<fffffhhH', self.nav_roll, self.nav_pitch, self.alt_error, self.aspd_error, self.xtrack_error, self.nav_bearing, self.target_bearing, self.wp_dist)) class MAVLink_set_quad_swarm_led_roll_pitch_yaw_thrust_message(MAVLink_message): ''' Setpoint for up to four quadrotors in a group / wing ''' def __init__(self, group, mode, led_red, led_blue, led_green, roll, pitch, yaw, thrust): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST, 'SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST') self._fieldnames = ['group', 'mode', 'led_red', 'led_blue', 'led_green', 'roll', 'pitch', 'yaw', 'thrust'] self.group = group self.mode = mode self.led_red = led_red self.led_blue = led_blue self.led_green = led_green self.roll = roll self.pitch = pitch self.yaw = yaw self.thrust = thrust def pack(self, mav): return MAVLink_message.pack(self, mav, 130, struct.pack('<4h4h4h4HBB4s4s4s', self.roll, self.pitch, self.yaw, self.thrust, self.group, self.mode, self.led_red, self.led_blue, self.led_green)) class MAVLink_state_correction_message(MAVLink_message): ''' Corrects the systems state by adding an error correction term to the position and velocity, and by rotating the attitude by a correction angle. ''' def __init__(self, xErr, yErr, zErr, rollErr, pitchErr, yawErr, vxErr, vyErr, vzErr): MAVLink_message.__init__(self, MAVLINK_MSG_ID_STATE_CORRECTION, 'STATE_CORRECTION') self._fieldnames = ['xErr', 'yErr', 'zErr', 'rollErr', 'pitchErr', 'yawErr', 'vxErr', 'vyErr', 'vzErr'] self.xErr = xErr self.yErr = yErr self.zErr = zErr self.rollErr = rollErr self.pitchErr = pitchErr self.yawErr = yawErr self.vxErr = vxErr self.vyErr = vyErr self.vzErr = vzErr def pack(self, mav): return MAVLink_message.pack(self, mav, 130, struct.pack('<fffffffff', self.xErr, self.yErr, self.zErr, self.rollErr, self.pitchErr, self.yawErr, self.vxErr, self.vyErr, self.vzErr)) class MAVLink_request_data_stream_message(MAVLink_message): ''' ''' def __init__(self, target_system, target_component, req_stream_id, req_message_rate, start_stop): MAVLink_message.__init__(self, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, 'REQUEST_DATA_STREAM') self._fieldnames = ['target_system', 'target_component', 'req_stream_id', 'req_message_rate', 'start_stop'] self.target_system = target_system self.target_component = target_component self.req_stream_id = req_stream_id self.req_message_rate = req_message_rate self.start_stop = start_stop def pack(self, mav): return MAVLink_message.pack(self, mav, 148, struct.pack('<HBBBB', self.req_message_rate, self.target_system, self.target_component, self.req_stream_id, self.start_stop)) class MAVLink_data_stream_message(MAVLink_message): ''' ''' def __init__(self, stream_id, message_rate, on_off): MAVLink_message.__init__(self, MAVLINK_MSG_ID_DATA_STREAM, 'DATA_STREAM') self._fieldnames = ['stream_id', 'message_rate', 'on_off'] self.stream_id = stream_id self.message_rate = message_rate self.on_off = on_off def pack(self, mav): return MAVLink_message.pack(self, mav, 21, struct.pack('<HBB', self.message_rate, self.stream_id, self.on_off)) class MAVLink_manual_control_message(MAVLink_message): ''' This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled an buttons are also transmit as boolean values of their ''' def __init__(self, target, x, y, z, r, buttons): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MANUAL_CONTROL, 'MANUAL_CONTROL') self._fieldnames = ['target', 'x', 'y', 'z', 'r', 'buttons'] self.target = target self.x = x self.y = y self.z = z self.r = r self.buttons = buttons def pack(self, mav): return MAVLink_message.pack(self, mav, 243, struct.pack('<hhhhHB', self.x, self.y, self.z, self.r, self.buttons, self.target)) class MAVLink_rc_channels_override_message(MAVLink_message): ''' The RAW values of the RC channels sent to the MAV to override info received from the RC radio. A value of -1 means no change to that channel. A value of 0 means control of that channel should be released back to the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. ''' def __init__(self, target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw): MAVLink_message.__init__(self, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, 'RC_CHANNELS_OVERRIDE') self._fieldnames = ['target_system', 'target_component', 'chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw'] self.target_system = target_system self.target_component = target_component self.chan1_raw = chan1_raw self.chan2_raw = chan2_raw self.chan3_raw = chan3_raw self.chan4_raw = chan4_raw self.chan5_raw = chan5_raw self.chan6_raw = chan6_raw self.chan7_raw = chan7_raw self.chan8_raw = chan8_raw def pack(self, mav): return MAVLink_message.pack(self, mav, 124, struct.pack('<HHHHHHHHBB', self.chan1_raw, self.chan2_raw, self.chan3_raw, self.chan4_raw, self.chan5_raw, self.chan6_raw, self.chan7_raw, self.chan8_raw, self.target_system, self.target_component)) class MAVLink_vfr_hud_message(MAVLink_message): ''' Metrics typically displayed on a HUD for fixed wing aircraft ''' def __init__(self, airspeed, groundspeed, heading, throttle, alt, climb): MAVLink_message.__init__(self, MAVLINK_MSG_ID_VFR_HUD, 'VFR_HUD') self._fieldnames = ['airspeed', 'groundspeed', 'heading', 'throttle', 'alt', 'climb'] self.airspeed = airspeed self.groundspeed = groundspeed self.heading = heading self.throttle = throttle self.alt = alt self.climb = climb def pack(self, mav): return MAVLink_message.pack(self, mav, 20, struct.pack('<ffffhH', self.airspeed, self.groundspeed, self.alt, self.climb, self.heading, self.throttle)) class MAVLink_command_long_message(MAVLink_message): ''' Send a command with up to four parameters to the MAV ''' def __init__(self, target_system, target_component, command, confirmation, param1, param2, param3, param4, param5, param6, param7): MAVLink_message.__init__(self, MAVLINK_MSG_ID_COMMAND_LONG, 'COMMAND_LONG') self._fieldnames = ['target_system', 'target_component', 'command', 'confirmation', 'param1', 'param2', 'param3', 'param4', 'param5', 'param6', 'param7'] self.target_system = target_system self.target_component = target_component self.command = command self.confirmation = confirmation self.param1 = param1 self.param2 = param2 self.param3 = param3 self.param4 = param4 self.param5 = param5 self.param6 = param6 self.param7 = param7 def pack(self, mav): return MAVLink_message.pack(self, mav, 152, struct.pack('<fffffffHBBB', self.param1, self.param2, self.param3, self.param4, self.param5, self.param6, self.param7, self.command, self.target_system, self.target_component, self.confirmation)) class MAVLink_command_ack_message(MAVLink_message): ''' Report status of a command. Includes feedback wether the command was executed. ''' def __init__(self, command, result): MAVLink_message.__init__(self, MAVLINK_MSG_ID_COMMAND_ACK, 'COMMAND_ACK') self._fieldnames = ['command', 'result'] self.command = command self.result = result def pack(self, mav): return MAVLink_message.pack(self, mav, 143, struct.pack('<HB', self.command, self.result)) class MAVLink_roll_pitch_yaw_rates_thrust_setpoint_message(MAVLink_message): ''' Setpoint in roll, pitch, yaw rates and thrust currently active on the system. ''' def __init__(self, time_boot_ms, roll_rate, pitch_rate, yaw_rate, thrust): MAVLink_message.__init__(self, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, 'ROLL_PITCH_YAW_RATES_THRUST_SETPOINT') self._fieldnames = ['time_boot_ms', 'roll_rate', 'pitch_rate', 'yaw_rate', 'thrust'] self.time_boot_ms = time_boot_ms self.roll_rate = roll_rate self.pitch_rate = pitch_rate self.yaw_rate = yaw_rate self.thrust = thrust def pack(self, mav): return MAVLink_message.pack(self, mav, 127, struct.pack('<Iffff', self.time_boot_ms, self.roll_rate, self.pitch_rate, self.yaw_rate, self.thrust)) class MAVLink_manual_setpoint_message(MAVLink_message): ''' Setpoint in roll, pitch, yaw and thrust from the operator ''' def __init__(self, time_boot_ms, roll, pitch, yaw, thrust, mode_switch, manual_override_switch): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MANUAL_SETPOINT, 'MANUAL_SETPOINT') self._fieldnames = ['time_boot_ms', 'roll', 'pitch', 'yaw', 'thrust', 'mode_switch', 'manual_override_switch'] self.time_boot_ms = time_boot_ms self.roll = roll self.pitch = pitch self.yaw = yaw self.thrust = thrust self.mode_switch = mode_switch self.manual_override_switch = manual_override_switch def pack(self, mav): return MAVLink_message.pack(self, mav, 106, struct.pack('<IffffBB', self.time_boot_ms, self.roll, self.pitch, self.yaw, self.thrust, self.mode_switch, self.manual_override_switch)) class MAVLink_local_position_ned_system_global_offset_message(MAVLink_message): ''' The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) ''' def __init__(self, time_boot_ms, x, y, z, roll, pitch, yaw): MAVLink_message.__init__(self, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, 'LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET') self._fieldnames = ['time_boot_ms', 'x', 'y', 'z', 'roll', 'pitch', 'yaw'] self.time_boot_ms = time_boot_ms self.x = x self.y = y self.z = z self.roll = roll self.pitch = pitch self.yaw = yaw def pack(self, mav): return MAVLink_message.pack(self, mav, 231, struct.pack('<Iffffff', self.time_boot_ms, self.x, self.y, self.z, self.roll, self.pitch, self.yaw)) class MAVLink_hil_state_message(MAVLink_message): ''' Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations. ''' def __init__(self, time_usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc): MAVLink_message.__init__(self, MAVLINK_MSG_ID_HIL_STATE, 'HIL_STATE') self._fieldnames = ['time_usec', 'roll', 'pitch', 'yaw', 'rollspeed', 'pitchspeed', 'yawspeed', 'lat', 'lon', 'alt', 'vx', 'vy', 'vz', 'xacc', 'yacc', 'zacc'] self.time_usec = time_usec self.roll = roll self.pitch = pitch self.yaw = yaw self.rollspeed = rollspeed self.pitchspeed = pitchspeed self.yawspeed = yawspeed self.lat = lat self.lon = lon self.alt = alt self.vx = vx self.vy = vy self.vz = vz self.xacc = xacc self.yacc = yacc self.zacc = zacc def pack(self, mav): return MAVLink_message.pack(self, mav, 183, struct.pack('<Qffffffiiihhhhhh', self.time_usec, self.roll, self.pitch, self.yaw, self.rollspeed, self.pitchspeed, self.yawspeed, self.lat, self.lon, self.alt, self.vx, self.vy, self.vz, self.xacc, self.yacc, self.zacc)) class MAVLink_hil_controls_message(MAVLink_message): ''' Sent from autopilot to simulation. Hardware in the loop control outputs ''' def __init__(self, time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode): MAVLink_message.__init__(self, MAVLINK_MSG_ID_HIL_CONTROLS, 'HIL_CONTROLS') self._fieldnames = ['time_usec', 'roll_ailerons', 'pitch_elevator', 'yaw_rudder', 'throttle', 'aux1', 'aux2', 'aux3', 'aux4', 'mode', 'nav_mode'] self.time_usec = time_usec self.roll_ailerons = roll_ailerons self.pitch_elevator = pitch_elevator self.yaw_rudder = yaw_rudder self.throttle = throttle self.aux1 = aux1 self.aux2 = aux2 self.aux3 = aux3 self.aux4 = aux4 self.mode = mode self.nav_mode = nav_mode def pack(self, mav): return MAVLink_message.pack(self, mav, 63, struct.pack('<QffffffffBB', self.time_usec, self.roll_ailerons, self.pitch_elevator, self.yaw_rudder, self.throttle, self.aux1, self.aux2, self.aux3, self.aux4, self.mode, self.nav_mode)) class MAVLink_hil_rc_inputs_raw_message(MAVLink_message): ''' Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. ''' def __init__(self, time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi): MAVLink_message.__init__(self, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, 'HIL_RC_INPUTS_RAW') self._fieldnames = ['time_usec', 'chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw', 'chan9_raw', 'chan10_raw', 'chan11_raw', 'chan12_raw', 'rssi'] self.time_usec = time_usec self.chan1_raw = chan1_raw self.chan2_raw = chan2_raw self.chan3_raw = chan3_raw self.chan4_raw = chan4_raw self.chan5_raw = chan5_raw self.chan6_raw = chan6_raw self.chan7_raw = chan7_raw self.chan8_raw = chan8_raw self.chan9_raw = chan9_raw self.chan10_raw = chan10_raw self.chan11_raw = chan11_raw self.chan12_raw = chan12_raw self.rssi = rssi def pack(self, mav): return MAVLink_message.pack(self, mav, 54, struct.pack('<QHHHHHHHHHHHHB', self.time_usec, self.chan1_raw, self.chan2_raw, self.chan3_raw, self.chan4_raw, self.chan5_raw, self.chan6_raw, self.chan7_raw, self.chan8_raw, self.chan9_raw, self.chan10_raw, self.chan11_raw, self.chan12_raw, self.rssi)) class MAVLink_optical_flow_message(MAVLink_message): ''' Optical flow from a flow sensor (e.g. optical mouse sensor) ''' def __init__(self, time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance): MAVLink_message.__init__(self, MAVLINK_MSG_ID_OPTICAL_FLOW, 'OPTICAL_FLOW') self._fieldnames = ['time_usec', 'sensor_id', 'flow_x', 'flow_y', 'flow_comp_m_x', 'flow_comp_m_y', 'quality', 'ground_distance'] self.time_usec = time_usec self.sensor_id = sensor_id self.flow_x = flow_x self.flow_y = flow_y self.flow_comp_m_x = flow_comp_m_x self.flow_comp_m_y = flow_comp_m_y self.quality = quality self.ground_distance = ground_distance def pack(self, mav): return MAVLink_message.pack(self, mav, 175, struct.pack('<QfffhhBB', self.time_usec, self.flow_comp_m_x, self.flow_comp_m_y, self.ground_distance, self.flow_x, self.flow_y, self.sensor_id, self.quality)) class MAVLink_global_vision_position_estimate_message(MAVLink_message): ''' ''' def __init__(self, usec, x, y, z, roll, pitch, yaw): MAVLink_message.__init__(self, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, 'GLOBAL_VISION_POSITION_ESTIMATE') self._fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw'] self.usec = usec self.x = x self.y = y self.z = z self.roll = roll self.pitch = pitch self.yaw = yaw def pack(self, mav): return MAVLink_message.pack(self, mav, 102, struct.pack('<Qffffff', self.usec, self.x, self.y, self.z, self.roll, self.pitch, self.yaw)) class MAVLink_vision_position_estimate_message(MAVLink_message): ''' ''' def __init__(self, usec, x, y, z, roll, pitch, yaw): MAVLink_message.__init__(self, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, 'VISION_POSITION_ESTIMATE') self._fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw'] self.usec = usec self.x = x self.y = y self.z = z self.roll = roll self.pitch = pitch self.yaw = yaw def pack(self, mav): return MAVLink_message.pack(self, mav, 158, struct.pack('<Qffffff', self.usec, self.x, self.y, self.z, self.roll, self.pitch, self.yaw)) class MAVLink_vision_speed_estimate_message(MAVLink_message): ''' ''' def __init__(self, usec, x, y, z): MAVLink_message.__init__(self, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, 'VISION_SPEED_ESTIMATE') self._fieldnames = ['usec', 'x', 'y', 'z'] self.usec = usec self.x = x self.y = y self.z = z def pack(self, mav): return MAVLink_message.pack(self, mav, 208, struct.pack('<Qfff', self.usec, self.x, self.y, self.z)) class MAVLink_vicon_position_estimate_message(MAVLink_message): ''' ''' def __init__(self, usec, x, y, z, roll, pitch, yaw): MAVLink_message.__init__(self, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, 'VICON_POSITION_ESTIMATE') self._fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw'] self.usec = usec self.x = x self.y = y self.z = z self.roll = roll self.pitch = pitch self.yaw = yaw def pack(self, mav): return MAVLink_message.pack(self, mav, 56, struct.pack('<Qffffff', self.usec, self.x, self.y, self.z, self.roll, self.pitch, self.yaw)) class MAVLink_highres_imu_message(MAVLink_message): ''' The IMU readings in SI units in NED body frame ''' def __init__(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated): MAVLink_message.__init__(self, MAVLINK_MSG_ID_HIGHRES_IMU, 'HIGHRES_IMU') self._fieldnames = ['time_usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag', 'abs_pressure', 'diff_pressure', 'pressure_alt', 'temperature', 'fields_updated'] self.time_usec = time_usec self.xacc = xacc self.yacc = yacc self.zacc = zacc self.xgyro = xgyro self.ygyro = ygyro self.zgyro = zgyro self.xmag = xmag self.ymag = ymag self.zmag = zmag self.abs_pressure = abs_pressure self.diff_pressure = diff_pressure self.pressure_alt = pressure_alt self.temperature = temperature self.fields_updated = fields_updated def pack(self, mav): return MAVLink_message.pack(self, mav, 93, struct.pack('<QfffffffffffffH', self.time_usec, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag, self.abs_pressure, self.diff_pressure, self.pressure_alt, self.temperature, self.fields_updated)) class MAVLink_file_transfer_start_message(MAVLink_message): ''' Begin file transfer ''' def __init__(self, transfer_uid, dest_path, direction, file_size, flags): MAVLink_message.__init__(self, MAVLINK_MSG_ID_FILE_TRANSFER_START, 'FILE_TRANSFER_START') self._fieldnames = ['transfer_uid', 'dest_path', 'direction', 'file_size', 'flags'] self.transfer_uid = transfer_uid self.dest_path = dest_path self.direction = direction self.file_size = file_size self.flags = flags def pack(self, mav): return MAVLink_message.pack(self, mav, 235, struct.pack('<QI240sBB', self.transfer_uid, self.file_size, self.dest_path, self.direction, self.flags)) class MAVLink_file_transfer_dir_list_message(MAVLink_message): ''' Get directory listing ''' def __init__(self, transfer_uid, dir_path, flags): MAVLink_message.__init__(self, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST, 'FILE_TRANSFER_DIR_LIST') self._fieldnames = ['transfer_uid', 'dir_path', 'flags'] self.transfer_uid = transfer_uid self.dir_path = dir_path self.flags = flags def pack(self, mav): return MAVLink_message.pack(self, mav, 93, struct.pack('<Q240sB', self.transfer_uid, self.dir_path, self.flags)) class MAVLink_file_transfer_res_message(MAVLink_message): ''' File transfer result ''' def __init__(self, transfer_uid, result): MAVLink_message.__init__(self, MAVLINK_MSG_ID_FILE_TRANSFER_RES, 'FILE_TRANSFER_RES') self._fieldnames = ['transfer_uid', 'result'] self.transfer_uid = transfer_uid self.result = result def pack(self, mav): return MAVLink_message.pack(self, mav, 124, struct.pack('<QB', self.transfer_uid, self.result)) class MAVLink_battery_status_message(MAVLink_message): ''' Transmitte battery informations for a accu pack. ''' def __init__(self, accu_id, voltage_cell_1, voltage_cell_2, voltage_cell_3, voltage_cell_4, voltage_cell_5, voltage_cell_6, current_battery, battery_remaining): MAVLink_message.__init__(self, MAVLINK_MSG_ID_BATTERY_STATUS, 'BATTERY_STATUS') self._fieldnames = ['accu_id', 'voltage_cell_1', 'voltage_cell_2', 'voltage_cell_3', 'voltage_cell_4', 'voltage_cell_5', 'voltage_cell_6', 'current_battery', 'battery_remaining'] self.accu_id = accu_id self.voltage_cell_1 = voltage_cell_1 self.voltage_cell_2 = voltage_cell_2 self.voltage_cell_3 = voltage_cell_3 self.voltage_cell_4 = voltage_cell_4 self.voltage_cell_5 = voltage_cell_5 self.voltage_cell_6 = voltage_cell_6 self.current_battery = current_battery self.battery_remaining = battery_remaining def pack(self, mav): return MAVLink_message.pack(self, mav, 42, struct.pack('<HHHHHHhBb', self.voltage_cell_1, self.voltage_cell_2, self.voltage_cell_3, self.voltage_cell_4, self.voltage_cell_5, self.voltage_cell_6, self.current_battery, self.accu_id, self.battery_remaining)) class MAVLink_setpoint_8dof_message(MAVLink_message): ''' Set the 8 DOF setpoint for a controller. ''' def __init__(self, target_system, val1, val2, val3, val4, val5, val6, val7, val8): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SETPOINT_8DOF, 'SETPOINT_8DOF') self._fieldnames = ['target_system', 'val1', 'val2', 'val3', 'val4', 'val5', 'val6', 'val7', 'val8'] self.target_system = target_system self.val1 = val1 self.val2 = val2 self.val3 = val3 self.val4 = val4 self.val5 = val5 self.val6 = val6 self.val7 = val7 self.val8 = val8 def pack(self, mav): return MAVLink_message.pack(self, mav, 241, struct.pack('<ffffffffB', self.val1, self.val2, self.val3, self.val4, self.val5, self.val6, self.val7, self.val8, self.target_system)) class MAVLink_setpoint_6dof_message(MAVLink_message): ''' Set the 6 DOF setpoint for a attitude and position controller. ''' def __init__(self, target_system, trans_x, trans_y, trans_z, rot_x, rot_y, rot_z): MAVLink_message.__init__(self, MAVLINK_MSG_ID_SETPOINT_6DOF, 'SETPOINT_6DOF') self._fieldnames = ['target_system', 'trans_x', 'trans_y', 'trans_z', 'rot_x', 'rot_y', 'rot_z'] self.target_system = target_system self.trans_x = trans_x self.trans_y = trans_y self.trans_z = trans_z self.rot_x = rot_x self.rot_y = rot_y self.rot_z = rot_z def pack(self, mav): return MAVLink_message.pack(self, mav, 15, struct.pack('<ffffffB', self.trans_x, self.trans_y, self.trans_z, self.rot_x, self.rot_y, self.rot_z, self.target_system)) class MAVLink_memory_vect_message(MAVLink_message): ''' Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. ''' def __init__(self, address, ver, type, value): MAVLink_message.__init__(self, MAVLINK_MSG_ID_MEMORY_VECT, 'MEMORY_VECT') self._fieldnames = ['address', 'ver', 'type', 'value'] self.address = address self.ver = ver self.type = type self.value = value def pack(self, mav): return MAVLink_message.pack(self, mav, 204, struct.pack('<HBB32s', self.address, self.ver, self.type, self.value)) class MAVLink_debug_vect_message(MAVLink_message): ''' ''' def __init__(self, name, time_usec, x, y, z): MAVLink_message.__init__(self, MAVLINK_MSG_ID_DEBUG_VECT, 'DEBUG_VECT') self._fieldnames = ['name', 'time_usec', 'x', 'y', 'z'] self.name = name self.time_usec = time_usec self.x = x self.y = y self.z = z def pack(self, mav): return MAVLink_message.pack(self, mav, 49, struct.pack('<Qfff10s', self.time_usec, self.x, self.y, self.z, self.name)) class MAVLink_named_value_float_message(MAVLink_message): ''' Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. ''' def __init__(self, time_boot_ms, name, value): MAVLink_message.__init__(self, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, 'NAMED_VALUE_FLOAT') self._fieldnames = ['time_boot_ms', 'name', 'value'] self.time_boot_ms = time_boot_ms self.name = name self.value = value def pack(self, mav): return MAVLink_message.pack(self, mav, 170, struct.pack('<If10s', self.time_boot_ms, self.value, self.name)) class MAVLink_named_value_int_message(MAVLink_message): ''' Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. ''' def __init__(self, time_boot_ms, name, value): MAVLink_message.__init__(self, MAVLINK_MSG_ID_NAMED_VALUE_INT, 'NAMED_VALUE_INT') self._fieldnames = ['time_boot_ms', 'name', 'value'] self.time_boot_ms = time_boot_ms self.name = name self.value = value def pack(self, mav): return MAVLink_message.pack(self, mav, 44, struct.pack('<Ii10s', self.time_boot_ms, self.value, self.name)) class MAVLink_statustext_message(MAVLink_message): ''' Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). ''' def __init__(self, severity, text): MAVLink_message.__init__(self, MAVLINK_MSG_ID_STATUSTEXT, 'STATUSTEXT') self._fieldnames = ['severity', 'text'] self.severity = severity self.text = text def pack(self, mav): return MAVLink_message.pack(self, mav, 83, struct.pack('<B50s', self.severity, self.text)) class MAVLink_debug_message(MAVLink_message): ''' Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. ''' def __init__(self, time_boot_ms, ind, value): MAVLink_message.__init__(self, MAVLINK_MSG_ID_DEBUG, 'DEBUG') self._fieldnames = ['time_boot_ms', 'ind', 'value'] self.time_boot_ms = time_boot_ms self.ind = ind self.value = value def pack(self, mav): return MAVLink_message.pack(self, mav, 46, struct.pack('<IfB', self.time_boot_ms, self.value, self.ind)) mavlink_map = { MAVLINK_MSG_ID_HEARTBEAT : ( '<IBBBBB', MAVLink_heartbeat_message, [1, 2, 3, 0, 4, 5], 50 ), MAVLINK_MSG_ID_SYS_STATUS : ( '<IIIHHhHHHHHHb', MAVLink_sys_status_message, [0, 1, 2, 3, 4, 5, 12, 6, 7, 8, 9, 10, 11], 124 ), MAVLINK_MSG_ID_SYSTEM_TIME : ( '<QI', MAVLink_system_time_message, [0, 1], 137 ), MAVLINK_MSG_ID_PING : ( '<QIBB', MAVLink_ping_message, [0, 1, 2, 3], 237 ), MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL : ( '<BBB25s', MAVLink_change_operator_control_message, [0, 1, 2, 3], 217 ), MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK : ( '<BBB', MAVLink_change_operator_control_ack_message, [0, 1, 2], 104 ), MAVLINK_MSG_ID_AUTH_KEY : ( '<32s', MAVLink_auth_key_message, [0], 119 ), MAVLINK_MSG_ID_SET_MODE : ( '<IBB', MAVLink_set_mode_message, [1, 2, 0], 89 ), MAVLINK_MSG_ID_PARAM_REQUEST_READ : ( '<hBB16s', MAVLink_param_request_read_message, [1, 2, 3, 0], 214 ), MAVLINK_MSG_ID_PARAM_REQUEST_LIST : ( '<BB', MAVLink_param_request_list_message, [0, 1], 159 ), MAVLINK_MSG_ID_PARAM_VALUE : ( '<fHH16sB', MAVLink_param_value_message, [3, 0, 4, 1, 2], 220 ), MAVLINK_MSG_ID_PARAM_SET : ( '<fBB16sB', MAVLink_param_set_message, [1, 2, 3, 0, 4], 168 ), MAVLINK_MSG_ID_GPS_RAW_INT : ( '<QiiiHHHHBB', MAVLink_gps_raw_int_message, [0, 8, 1, 2, 3, 4, 5, 6, 7, 9], 24 ), MAVLINK_MSG_ID_GPS_STATUS : ( '<B20s20s20s20s20s', MAVLink_gps_status_message, [0, 1, 2, 3, 4, 5], 23 ), MAVLINK_MSG_ID_SCALED_IMU : ( '<Ihhhhhhhhh', MAVLink_scaled_imu_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 170 ), MAVLINK_MSG_ID_RAW_IMU : ( '<Qhhhhhhhhh', MAVLink_raw_imu_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 144 ), MAVLINK_MSG_ID_RAW_PRESSURE : ( '<Qhhhh', MAVLink_raw_pressure_message, [0, 1, 2, 3, 4], 67 ), MAVLINK_MSG_ID_SCALED_PRESSURE : ( '<Iffh', MAVLink_scaled_pressure_message, [0, 1, 2, 3], 115 ), MAVLINK_MSG_ID_ATTITUDE : ( '<Iffffff', MAVLink_attitude_message, [0, 1, 2, 3, 4, 5, 6], 39 ), MAVLINK_MSG_ID_ATTITUDE_QUATERNION : ( '<Ifffffff', MAVLink_attitude_quaternion_message, [0, 1, 2, 3, 4, 5, 6, 7], 246 ), MAVLINK_MSG_ID_LOCAL_POSITION_NED : ( '<Iffffff', MAVLink_local_position_ned_message, [0, 1, 2, 3, 4, 5, 6], 185 ), MAVLINK_MSG_ID_GLOBAL_POSITION_INT : ( '<IiiiihhhH', MAVLink_global_position_int_message, [0, 1, 2, 3, 4, 5, 6, 7, 8], 104 ), MAVLINK_MSG_ID_RC_CHANNELS_SCALED : ( '<IhhhhhhhhBB', MAVLink_rc_channels_scaled_message, [0, 9, 1, 2, 3, 4, 5, 6, 7, 8, 10], 237 ), MAVLINK_MSG_ID_RC_CHANNELS_RAW : ( '<IHHHHHHHHBB', MAVLink_rc_channels_raw_message, [0, 9, 1, 2, 3, 4, 5, 6, 7, 8, 10], 244 ), MAVLINK_MSG_ID_SERVO_OUTPUT_RAW : ( '<IHHHHHHHHB', MAVLink_servo_output_raw_message, [0, 9, 1, 2, 3, 4, 5, 6, 7, 8], 242 ), MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST : ( '<hhBB', MAVLink_mission_request_partial_list_message, [2, 3, 0, 1], 212 ), MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST : ( '<hhBB', MAVLink_mission_write_partial_list_message, [2, 3, 0, 1], 9 ), MAVLINK_MSG_ID_MISSION_ITEM : ( '<fffffffHHBBBBB', MAVLink_mission_item_message, [9, 10, 7, 11, 8, 12, 13, 0, 1, 2, 3, 4, 5, 6], 254 ), MAVLINK_MSG_ID_MISSION_REQUEST : ( '<HBB', MAVLink_mission_request_message, [1, 2, 0], 230 ), MAVLINK_MSG_ID_MISSION_SET_CURRENT : ( '<HBB', MAVLink_mission_set_current_message, [1, 2, 0], 28 ), MAVLINK_MSG_ID_MISSION_CURRENT : ( '<H', MAVLink_mission_current_message, [0], 28 ), MAVLINK_MSG_ID_MISSION_REQUEST_LIST : ( '<BB', MAVLink_mission_request_list_message, [0, 1], 132 ), MAVLINK_MSG_ID_MISSION_COUNT : ( '<HBB', MAVLink_mission_count_message, [1, 2, 0], 221 ), MAVLINK_MSG_ID_MISSION_CLEAR_ALL : ( '<BB', MAVLink_mission_clear_all_message, [0, 1], 232 ), MAVLINK_MSG_ID_MISSION_ITEM_REACHED : ( '<H', MAVLink_mission_item_reached_message, [0], 11 ), MAVLINK_MSG_ID_MISSION_ACK : ( '<BBB', MAVLink_mission_ack_message, [0, 1, 2], 153 ), MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN : ( '<iiiB', MAVLink_set_gps_global_origin_message, [3, 0, 1, 2], 41 ), MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN : ( '<iii', MAVLink_gps_global_origin_message, [0, 1, 2], 39 ), MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT : ( '<ffffBBB', MAVLink_set_local_position_setpoint_message, [4, 5, 6, 0, 1, 2, 3], 214 ), MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT : ( '<ffffB', MAVLink_local_position_setpoint_message, [4, 0, 1, 2, 3], 223 ), MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT : ( '<iiihB', MAVLink_global_position_setpoint_int_message, [4, 0, 1, 2, 3], 141 ), MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT : ( '<iiihB', MAVLink_set_global_position_setpoint_int_message, [4, 0, 1, 2, 3], 33 ), MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA : ( '<ffffffBBB', MAVLink_safety_set_allowed_area_message, [6, 7, 8, 0, 1, 2, 3, 4, 5], 15 ), MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA : ( '<ffffffB', MAVLink_safety_allowed_area_message, [6, 0, 1, 2, 3, 4, 5], 3 ), MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST : ( '<ffffBB', MAVLink_set_roll_pitch_yaw_thrust_message, [4, 5, 0, 1, 2, 3], 100 ), MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST : ( '<ffffBB', MAVLink_set_roll_pitch_yaw_speed_thrust_message, [4, 5, 0, 1, 2, 3], 24 ), MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT : ( '<Iffff', MAVLink_roll_pitch_yaw_thrust_setpoint_message, [0, 1, 2, 3, 4], 239 ), MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT : ( '<Iffff', MAVLink_roll_pitch_yaw_speed_thrust_setpoint_message, [0, 1, 2, 3, 4], 238 ), MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT : ( '<HHHHB', MAVLink_set_quad_motors_setpoint_message, [4, 0, 1, 2, 3], 30 ), MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST : ( '<4h4h4h4HBB', MAVLink_set_quad_swarm_roll_pitch_yaw_thrust_message, [4, 5, 0, 1, 2, 3], 240 ), MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT : ( '<fffffhhH', MAVLink_nav_controller_output_message, [0, 1, 5, 6, 7, 2, 3, 4], 183 ), MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST : ( '<4h4h4h4HBB4s4s4s', MAVLink_set_quad_swarm_led_roll_pitch_yaw_thrust_message, [4, 5, 6, 7, 8, 0, 1, 2, 3], 130 ), MAVLINK_MSG_ID_STATE_CORRECTION : ( '<fffffffff', MAVLink_state_correction_message, [0, 1, 2, 3, 4, 5, 6, 7, 8], 130 ), MAVLINK_MSG_ID_REQUEST_DATA_STREAM : ( '<HBBBB', MAVLink_request_data_stream_message, [1, 2, 3, 0, 4], 148 ), MAVLINK_MSG_ID_DATA_STREAM : ( '<HBB', MAVLink_data_stream_message, [1, 0, 2], 21 ), MAVLINK_MSG_ID_MANUAL_CONTROL : ( '<hhhhHB', MAVLink_manual_control_message, [5, 0, 1, 2, 3, 4], 243 ), MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE : ( '<HHHHHHHHBB', MAVLink_rc_channels_override_message, [8, 9, 0, 1, 2, 3, 4, 5, 6, 7], 124 ), MAVLINK_MSG_ID_VFR_HUD : ( '<ffffhH', MAVLink_vfr_hud_message, [0, 1, 4, 5, 2, 3], 20 ), MAVLINK_MSG_ID_COMMAND_LONG : ( '<fffffffHBBB', MAVLink_command_long_message, [8, 9, 7, 10, 0, 1, 2, 3, 4, 5, 6], 152 ), MAVLINK_MSG_ID_COMMAND_ACK : ( '<HB', MAVLink_command_ack_message, [0, 1], 143 ), MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT : ( '<Iffff', MAVLink_roll_pitch_yaw_rates_thrust_setpoint_message, [0, 1, 2, 3, 4], 127 ), MAVLINK_MSG_ID_MANUAL_SETPOINT : ( '<IffffBB', MAVLink_manual_setpoint_message, [0, 1, 2, 3, 4, 5, 6], 106 ), MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET : ( '<Iffffff', MAVLink_local_position_ned_system_global_offset_message, [0, 1, 2, 3, 4, 5, 6], 231 ), MAVLINK_MSG_ID_HIL_STATE : ( '<Qffffffiiihhhhhh', MAVLink_hil_state_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], 183 ), MAVLINK_MSG_ID_HIL_CONTROLS : ( '<QffffffffBB', MAVLink_hil_controls_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 63 ), MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW : ( '<QHHHHHHHHHHHHB', MAVLink_hil_rc_inputs_raw_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], 54 ), MAVLINK_MSG_ID_OPTICAL_FLOW : ( '<QfffhhBB', MAVLink_optical_flow_message, [0, 6, 4, 5, 1, 2, 7, 3], 175 ), MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE : ( '<Qffffff', MAVLink_global_vision_position_estimate_message, [0, 1, 2, 3, 4, 5, 6], 102 ), MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE : ( '<Qffffff', MAVLink_vision_position_estimate_message, [0, 1, 2, 3, 4, 5, 6], 158 ), MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE : ( '<Qfff', MAVLink_vision_speed_estimate_message, [0, 1, 2, 3], 208 ), MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE : ( '<Qffffff', MAVLink_vicon_position_estimate_message, [0, 1, 2, 3, 4, 5, 6], 56 ), MAVLINK_MSG_ID_HIGHRES_IMU : ( '<QfffffffffffffH', MAVLink_highres_imu_message, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], 93 ), MAVLINK_MSG_ID_FILE_TRANSFER_START : ( '<QI240sBB', MAVLink_file_transfer_start_message, [0, 2, 3, 1, 4], 235 ), MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST : ( '<Q240sB', MAVLink_file_transfer_dir_list_message, [0, 1, 2], 93 ), MAVLINK_MSG_ID_FILE_TRANSFER_RES : ( '<QB', MAVLink_file_transfer_res_message, [0, 1], 124 ), MAVLINK_MSG_ID_BATTERY_STATUS : ( '<HHHHHHhBb', MAVLink_battery_status_message, [7, 0, 1, 2, 3, 4, 5, 6, 8], 42 ), MAVLINK_MSG_ID_SETPOINT_8DOF : ( '<ffffffffB', MAVLink_setpoint_8dof_message, [8, 0, 1, 2, 3, 4, 5, 6, 7], 241 ), MAVLINK_MSG_ID_SETPOINT_6DOF : ( '<ffffffB', MAVLink_setpoint_6dof_message, [6, 0, 1, 2, 3, 4, 5], 15 ), MAVLINK_MSG_ID_MEMORY_VECT : ( '<HBB32s', MAVLink_memory_vect_message, [0, 1, 2, 3], 204 ), MAVLINK_MSG_ID_DEBUG_VECT : ( '<Qfff10s', MAVLink_debug_vect_message, [4, 0, 1, 2, 3], 49 ), MAVLINK_MSG_ID_NAMED_VALUE_FLOAT : ( '<If10s', MAVLink_named_value_float_message, [0, 2, 1], 170 ), MAVLINK_MSG_ID_NAMED_VALUE_INT : ( '<Ii10s', MAVLink_named_value_int_message, [0, 2, 1], 44 ), MAVLINK_MSG_ID_STATUSTEXT : ( '<B50s', MAVLink_statustext_message, [0, 1], 83 ), MAVLINK_MSG_ID_DEBUG : ( '<IfB', MAVLink_debug_message, [0, 2, 1], 46 ), } class MAVError(Exception): '''MAVLink error class''' def __init__(self, msg): Exception.__init__(self, msg) self.message = msg class MAVString(str): '''NUL terminated string''' def __init__(self, s): str.__init__(self) def __str__(self): i = self.find(chr(0)) if i == -1: return self[:] return self[0:i] class MAVLink_bad_data(MAVLink_message): ''' a piece of bad data in a mavlink stream ''' def __init__(self, data, reason): MAVLink_message.__init__(self, MAVLINK_MSG_ID_BAD_DATA, 'BAD_DATA') self._fieldnames = ['data', 'reason'] self.data = data self.reason = reason self._msgbuf = data class MAVLink(object): '''MAVLink protocol handling class''' def __init__(self, file, srcSystem=0, srcComponent=0): self.seq = 0 self.file = file self.srcSystem = srcSystem self.srcComponent = srcComponent self.callback = None self.callback_args = None self.callback_kwargs = None self.buf = array.array('B') self.expected_length = 6 self.have_prefix_error = False self.robust_parsing = False self.protocol_marker = 254 self.little_endian = True self.crc_extra = True self.sort_fields = True self.total_packets_sent = 0 self.total_bytes_sent = 0 self.total_packets_received = 0 self.total_bytes_received = 0 self.total_receive_errors = 0 self.startup_time = time.time() def set_callback(self, callback, *args, **kwargs): self.callback = callback self.callback_args = args self.callback_kwargs = kwargs def send(self, mavmsg): '''send a MAVLink message''' buf = mavmsg.pack(self) self.file.write(buf) self.seq = (self.seq + 1) % 255 self.total_packets_sent += 1 self.total_bytes_sent += len(buf) def bytes_needed(self): '''return number of bytes needed for next parsing stage''' ret = self.expected_length - len(self.buf) if ret <= 0: return 1 return ret def parse_char(self, c): '''input some data bytes, possibly returning a new message''' if isinstance(c, str): self.buf.fromstring(c) else: self.buf.extend(c) self.total_bytes_received += len(c) if len(self.buf) >= 1 and self.buf[0] != 254: magic = self.buf[0] self.buf = self.buf[1:] if self.robust_parsing: m = MAVLink_bad_data(chr(magic), "Bad prefix") if self.callback: self.callback(m, *self.callback_args, **self.callback_kwargs) self.expected_length = 6 self.total_receive_errors += 1 return m if self.have_prefix_error: return None self.have_prefix_error = True self.total_receive_errors += 1 raise MAVError("invalid MAVLink prefix '%s'" % magic) self.have_prefix_error = False if len(self.buf) >= 2: (magic, self.expected_length) = struct.unpack('BB', self.buf[0:2]) self.expected_length += 8 if self.expected_length >= 8 and len(self.buf) >= self.expected_length: mbuf = self.buf[0:self.expected_length] self.buf = self.buf[self.expected_length:] self.expected_length = 6 if self.robust_parsing: try: m = self.decode(mbuf) self.total_packets_received += 1 except MAVError as reason: m = MAVLink_bad_data(mbuf, reason.message) self.total_receive_errors += 1 else: m = self.decode(mbuf) self.total_packets_received += 1 if self.callback: self.callback(m, *self.callback_args, **self.callback_kwargs) return m return None def parse_buffer(self, s): '''input some data bytes, possibly returning a list of new messages''' m = self.parse_char(s) if m is None: return None ret = [m] while True: m = self.parse_char("") if m is None: return ret ret.append(m) return ret def decode(self, msgbuf): '''decode a buffer as a MAVLink message''' # decode the header try: magic, mlen, seq, srcSystem, srcComponent, msgId = struct.unpack('cBBBBB', msgbuf[:6]) except struct.error as emsg: raise MAVError('Unable to unpack MAVLink header: %s' % emsg) if ord(magic) != 254: raise MAVError("invalid MAVLink prefix '%s'" % magic) if mlen != len(msgbuf)-8: raise MAVError('invalid MAVLink message length. Got %u expected %u, msgId=%u' % (len(msgbuf)-8, mlen, msgId)) if not msgId in mavlink_map: raise MAVError('unknown MAVLink message ID %u' % msgId) # decode the payload (fmt, type, order_map, crc_extra) = mavlink_map[msgId] # decode the checksum try: crc, = struct.unpack('<H', msgbuf[-2:]) except struct.error as emsg: raise MAVError('Unable to unpack MAVLink CRC: %s' % emsg) crc2 = mavutil.x25crc(msgbuf[1:-2]) if True: # using CRC extra crc2.accumulate(chr(crc_extra)) if crc != crc2.crc: raise MAVError('invalid MAVLink CRC in msgID %u 0x%04x should be 0x%04x' % (msgId, crc, crc2.crc)) try: t = struct.unpack(fmt, msgbuf[6:-2]) except struct.error as emsg: raise MAVError('Unable to unpack MAVLink payload type=%s fmt=%s payloadLength=%u: %s' % ( type, fmt, len(msgbuf[6:-2]), emsg)) tlist = list(t) # handle sorted fields if True: t = tlist[:] for i in range(0, len(tlist)): tlist[i] = t[order_map[i]] # terminate any strings for i in range(0, len(tlist)): if isinstance(tlist[i], str): tlist[i] = MAVString(tlist[i]) t = tuple(tlist) # construct the message object try: m = type(*t) except Exception as emsg: raise MAVError('Unable to instantiate MAVLink message of type %s : %s' % (type, emsg)) m._msgbuf = msgbuf m._payload = msgbuf[6:-2] m._crc = crc m._header = MAVLink_header(msgId, mlen, seq, srcSystem, srcComponent) return m def heartbeat_encode(self, type, autopilot, base_mode, custom_mode, system_status, mavlink_version=3): ''' The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). type : Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) (uint8_t) autopilot : Autopilot type / class. defined in MAV_AUTOPILOT ENUM (uint8_t) base_mode : System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h (uint8_t) custom_mode : A bitfield for use for autopilot-specific flags. (uint32_t) system_status : System status flag, see MAV_STATE ENUM (uint8_t) mavlink_version : MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version (uint8_t) ''' msg = MAVLink_heartbeat_message(type, autopilot, base_mode, custom_mode, system_status, mavlink_version) msg.pack(self) return msg def heartbeat_send(self, type, autopilot, base_mode, custom_mode, system_status, mavlink_version=3): ''' The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). type : Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) (uint8_t) autopilot : Autopilot type / class. defined in MAV_AUTOPILOT ENUM (uint8_t) base_mode : System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h (uint8_t) custom_mode : A bitfield for use for autopilot-specific flags. (uint32_t) system_status : System status flag, see MAV_STATE ENUM (uint8_t) mavlink_version : MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version (uint8_t) ''' return self.send(self.heartbeat_encode(type, autopilot, base_mode, custom_mode, system_status, mavlink_version)) def sys_status_encode(self, onboard_control_sensors_present, onboard_control_sensors_enabled, onboard_control_sensors_health, load, voltage_battery, current_battery, battery_remaining, drop_rate_comm, errors_comm, errors_count1, errors_count2, errors_count3, errors_count4): ''' The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows wether the system is currently active or not and if an emergency occured. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occured it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout. onboard_control_sensors_present : Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control (uint32_t) onboard_control_sensors_enabled : Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control (uint32_t) onboard_control_sensors_health : Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control (uint32_t) load : Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 (uint16_t) voltage_battery : Battery voltage, in millivolts (1 = 1 millivolt) (uint16_t) current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t) battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery (int8_t) drop_rate_comm : Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t) errors_comm : Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t) errors_count1 : Autopilot-specific errors (uint16_t) errors_count2 : Autopilot-specific errors (uint16_t) errors_count3 : Autopilot-specific errors (uint16_t) errors_count4 : Autopilot-specific errors (uint16_t) ''' msg = MAVLink_sys_status_message(onboard_control_sensors_present, onboard_control_sensors_enabled, onboard_control_sensors_health, load, voltage_battery, current_battery, battery_remaining, drop_rate_comm, errors_comm, errors_count1, errors_count2, errors_count3, errors_count4) msg.pack(self) return msg def sys_status_send(self, onboard_control_sensors_present, onboard_control_sensors_enabled, onboard_control_sensors_health, load, voltage_battery, current_battery, battery_remaining, drop_rate_comm, errors_comm, errors_count1, errors_count2, errors_count3, errors_count4): ''' The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows wether the system is currently active or not and if an emergency occured. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occured it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout. onboard_control_sensors_present : Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control (uint32_t) onboard_control_sensors_enabled : Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control (uint32_t) onboard_control_sensors_health : Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control (uint32_t) load : Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 (uint16_t) voltage_battery : Battery voltage, in millivolts (1 = 1 millivolt) (uint16_t) current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t) battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery (int8_t) drop_rate_comm : Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t) errors_comm : Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t) errors_count1 : Autopilot-specific errors (uint16_t) errors_count2 : Autopilot-specific errors (uint16_t) errors_count3 : Autopilot-specific errors (uint16_t) errors_count4 : Autopilot-specific errors (uint16_t) ''' return self.send(self.sys_status_encode(onboard_control_sensors_present, onboard_control_sensors_enabled, onboard_control_sensors_health, load, voltage_battery, current_battery, battery_remaining, drop_rate_comm, errors_comm, errors_count1, errors_count2, errors_count3, errors_count4)) def system_time_encode(self, time_unix_usec, time_boot_ms): ''' The system time is the time of the master clock, typically the computer clock of the main onboard computer. time_unix_usec : Timestamp of the master clock in microseconds since UNIX epoch. (uint64_t) time_boot_ms : Timestamp of the component clock since boot time in milliseconds. (uint32_t) ''' msg = MAVLink_system_time_message(time_unix_usec, time_boot_ms) msg.pack(self) return msg def system_time_send(self, time_unix_usec, time_boot_ms): ''' The system time is the time of the master clock, typically the computer clock of the main onboard computer. time_unix_usec : Timestamp of the master clock in microseconds since UNIX epoch. (uint64_t) time_boot_ms : Timestamp of the component clock since boot time in milliseconds. (uint32_t) ''' return self.send(self.system_time_encode(time_unix_usec, time_boot_ms)) def ping_encode(self, time_usec, seq, target_system, target_component): ''' A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. time_usec : Unix timestamp in microseconds (uint64_t) seq : PING sequence (uint32_t) target_system : 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system (uint8_t) target_component : 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system (uint8_t) ''' msg = MAVLink_ping_message(time_usec, seq, target_system, target_component) msg.pack(self) return msg def ping_send(self, time_usec, seq, target_system, target_component): ''' A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. time_usec : Unix timestamp in microseconds (uint64_t) seq : PING sequence (uint32_t) target_system : 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system (uint8_t) target_component : 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system (uint8_t) ''' return self.send(self.ping_encode(time_usec, seq, target_system, target_component)) def change_operator_control_encode(self, target_system, control_request, version, passkey): ''' Request to control this MAV target_system : System the GCS requests control for (uint8_t) control_request : 0: request control of this MAV, 1: Release control of this MAV (uint8_t) version : 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. (uint8_t) passkey : Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" (char) ''' msg = MAVLink_change_operator_control_message(target_system, control_request, version, passkey) msg.pack(self) return msg def change_operator_control_send(self, target_system, control_request, version, passkey): ''' Request to control this MAV target_system : System the GCS requests control for (uint8_t) control_request : 0: request control of this MAV, 1: Release control of this MAV (uint8_t) version : 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. (uint8_t) passkey : Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" (char) ''' return self.send(self.change_operator_control_encode(target_system, control_request, version, passkey)) def change_operator_control_ack_encode(self, gcs_system_id, control_request, ack): ''' Accept / deny control of this MAV gcs_system_id : ID of the GCS this message (uint8_t) control_request : 0: request control of this MAV, 1: Release control of this MAV (uint8_t) ack : 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control (uint8_t) ''' msg = MAVLink_change_operator_control_ack_message(gcs_system_id, control_request, ack) msg.pack(self) return msg def change_operator_control_ack_send(self, gcs_system_id, control_request, ack): ''' Accept / deny control of this MAV gcs_system_id : ID of the GCS this message (uint8_t) control_request : 0: request control of this MAV, 1: Release control of this MAV (uint8_t) ack : 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control (uint8_t) ''' return self.send(self.change_operator_control_ack_encode(gcs_system_id, control_request, ack)) def auth_key_encode(self, key): ''' Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. key : key (char) ''' msg = MAVLink_auth_key_message(key) msg.pack(self) return msg def auth_key_send(self, key): ''' Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. key : key (char) ''' return self.send(self.auth_key_encode(key)) def set_mode_encode(self, target_system, base_mode, custom_mode): ''' Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. target_system : The system setting the mode (uint8_t) base_mode : The new base mode (uint8_t) custom_mode : The new autopilot-specific mode. This field can be ignored by an autopilot. (uint32_t) ''' msg = MAVLink_set_mode_message(target_system, base_mode, custom_mode) msg.pack(self) return msg def set_mode_send(self, target_system, base_mode, custom_mode): ''' Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. target_system : The system setting the mode (uint8_t) base_mode : The new base mode (uint8_t) custom_mode : The new autopilot-specific mode. This field can be ignored by an autopilot. (uint32_t) ''' return self.send(self.set_mode_encode(target_system, base_mode, custom_mode)) def param_request_read_encode(self, target_system, target_component, param_id, param_index): ''' Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -> value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (char) param_index : Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) (int16_t) ''' msg = MAVLink_param_request_read_message(target_system, target_component, param_id, param_index) msg.pack(self) return msg def param_request_read_send(self, target_system, target_component, param_id, param_index): ''' Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -> value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (char) param_index : Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) (int16_t) ''' return self.send(self.param_request_read_encode(target_system, target_component, param_id, param_index)) def param_request_list_encode(self, target_system, target_component): ''' Request all parameters of this component. After his request, all parameters are emitted. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) ''' msg = MAVLink_param_request_list_message(target_system, target_component) msg.pack(self) return msg def param_request_list_send(self, target_system, target_component): ''' Request all parameters of this component. After his request, all parameters are emitted. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) ''' return self.send(self.param_request_list_encode(target_system, target_component)) def param_value_encode(self, param_id, param_value, param_type, param_count, param_index): ''' Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (char) param_value : Onboard parameter value (float) param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t) param_count : Total number of onboard parameters (uint16_t) param_index : Index of this onboard parameter (uint16_t) ''' msg = MAVLink_param_value_message(param_id, param_value, param_type, param_count, param_index) msg.pack(self) return msg def param_value_send(self, param_id, param_value, param_type, param_count, param_index): ''' Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (char) param_value : Onboard parameter value (float) param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t) param_count : Total number of onboard parameters (uint16_t) param_index : Index of this onboard parameter (uint16_t) ''' return self.send(self.param_value_encode(param_id, param_value, param_type, param_count, param_index)) def param_set_encode(self, target_system, target_component, param_id, param_value, param_type): ''' Set a parameter value TEMPORARILY to RAM. It will be reset to default on system reboot. Send the ACTION MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM contents to EEPROM. IMPORTANT: The receiving component should acknowledge the new parameter value by sending a param_value message to all communication partners. This will also ensure that multiple GCS all have an up-to-date list of all parameters. If the sending GCS did not receive a PARAM_VALUE message within its timeout time, it should re-send the PARAM_SET message. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (char) param_value : Onboard parameter value (float) param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t) ''' msg = MAVLink_param_set_message(target_system, target_component, param_id, param_value, param_type) msg.pack(self) return msg def param_set_send(self, target_system, target_component, param_id, param_value, param_type): ''' Set a parameter value TEMPORARILY to RAM. It will be reset to default on system reboot. Send the ACTION MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM contents to EEPROM. IMPORTANT: The receiving component should acknowledge the new parameter value by sending a param_value message to all communication partners. This will also ensure that multiple GCS all have an up-to-date list of all parameters. If the sending GCS did not receive a PARAM_VALUE message within its timeout time, it should re-send the PARAM_SET message. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (char) param_value : Onboard parameter value (float) param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t) ''' return self.send(self.param_set_encode(target_system, target_component, param_id, param_value, param_type)) def gps_raw_int_encode(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible): ''' The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame). time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) fix_type : 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. (uint8_t) lat : Latitude in 1E7 degrees (int32_t) lon : Longitude in 1E7 degrees (int32_t) alt : Altitude in 1E3 meters (millimeters) above MSL (int32_t) eph : GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 (uint16_t) epv : GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 (uint16_t) vel : GPS ground speed (m/s * 100). If unknown, set to: 65535 (uint16_t) cog : Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 (uint16_t) satellites_visible : Number of satellites visible. If unknown, set to 255 (uint8_t) ''' msg = MAVLink_gps_raw_int_message(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible) msg.pack(self) return msg def gps_raw_int_send(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible): ''' The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame). time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) fix_type : 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. (uint8_t) lat : Latitude in 1E7 degrees (int32_t) lon : Longitude in 1E7 degrees (int32_t) alt : Altitude in 1E3 meters (millimeters) above MSL (int32_t) eph : GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 (uint16_t) epv : GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 (uint16_t) vel : GPS ground speed (m/s * 100). If unknown, set to: 65535 (uint16_t) cog : Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 (uint16_t) satellites_visible : Number of satellites visible. If unknown, set to 255 (uint8_t) ''' return self.send(self.gps_raw_int_encode(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible)) def gps_status_encode(self, satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr): ''' The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION for the global position estimate. This message can contain information for up to 20 satellites. satellites_visible : Number of satellites visible (uint8_t) satellite_prn : Global satellite ID (uint8_t) satellite_used : 0: Satellite not used, 1: used for localization (uint8_t) satellite_elevation : Elevation (0: right on top of receiver, 90: on the horizon) of satellite (uint8_t) satellite_azimuth : Direction of satellite, 0: 0 deg, 255: 360 deg. (uint8_t) satellite_snr : Signal to noise ratio of satellite (uint8_t) ''' msg = MAVLink_gps_status_message(satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr) msg.pack(self) return msg def gps_status_send(self, satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr): ''' The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION for the global position estimate. This message can contain information for up to 20 satellites. satellites_visible : Number of satellites visible (uint8_t) satellite_prn : Global satellite ID (uint8_t) satellite_used : 0: Satellite not used, 1: used for localization (uint8_t) satellite_elevation : Elevation (0: right on top of receiver, 90: on the horizon) of satellite (uint8_t) satellite_azimuth : Direction of satellite, 0: 0 deg, 255: 360 deg. (uint8_t) satellite_snr : Signal to noise ratio of satellite (uint8_t) ''' return self.send(self.gps_status_encode(satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr)) def scaled_imu_encode(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag): ''' The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) xacc : X acceleration (mg) (int16_t) yacc : Y acceleration (mg) (int16_t) zacc : Z acceleration (mg) (int16_t) xgyro : Angular speed around X axis (millirad /sec) (int16_t) ygyro : Angular speed around Y axis (millirad /sec) (int16_t) zgyro : Angular speed around Z axis (millirad /sec) (int16_t) xmag : X Magnetic field (milli tesla) (int16_t) ymag : Y Magnetic field (milli tesla) (int16_t) zmag : Z Magnetic field (milli tesla) (int16_t) ''' msg = MAVLink_scaled_imu_message(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag) msg.pack(self) return msg def scaled_imu_send(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag): ''' The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) xacc : X acceleration (mg) (int16_t) yacc : Y acceleration (mg) (int16_t) zacc : Z acceleration (mg) (int16_t) xgyro : Angular speed around X axis (millirad /sec) (int16_t) ygyro : Angular speed around Y axis (millirad /sec) (int16_t) zgyro : Angular speed around Z axis (millirad /sec) (int16_t) xmag : X Magnetic field (milli tesla) (int16_t) ymag : Y Magnetic field (milli tesla) (int16_t) zmag : Z Magnetic field (milli tesla) (int16_t) ''' return self.send(self.scaled_imu_encode(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag)) def raw_imu_encode(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag): ''' The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) xacc : X acceleration (raw) (int16_t) yacc : Y acceleration (raw) (int16_t) zacc : Z acceleration (raw) (int16_t) xgyro : Angular speed around X axis (raw) (int16_t) ygyro : Angular speed around Y axis (raw) (int16_t) zgyro : Angular speed around Z axis (raw) (int16_t) xmag : X Magnetic field (raw) (int16_t) ymag : Y Magnetic field (raw) (int16_t) zmag : Z Magnetic field (raw) (int16_t) ''' msg = MAVLink_raw_imu_message(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag) msg.pack(self) return msg def raw_imu_send(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag): ''' The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) xacc : X acceleration (raw) (int16_t) yacc : Y acceleration (raw) (int16_t) zacc : Z acceleration (raw) (int16_t) xgyro : Angular speed around X axis (raw) (int16_t) ygyro : Angular speed around Y axis (raw) (int16_t) zgyro : Angular speed around Z axis (raw) (int16_t) xmag : X Magnetic field (raw) (int16_t) ymag : Y Magnetic field (raw) (int16_t) zmag : Z Magnetic field (raw) (int16_t) ''' return self.send(self.raw_imu_encode(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag)) def raw_pressure_encode(self, time_usec, press_abs, press_diff1, press_diff2, temperature): ''' The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values. time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) press_abs : Absolute pressure (raw) (int16_t) press_diff1 : Differential pressure 1 (raw) (int16_t) press_diff2 : Differential pressure 2 (raw) (int16_t) temperature : Raw Temperature measurement (raw) (int16_t) ''' msg = MAVLink_raw_pressure_message(time_usec, press_abs, press_diff1, press_diff2, temperature) msg.pack(self) return msg def raw_pressure_send(self, time_usec, press_abs, press_diff1, press_diff2, temperature): ''' The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values. time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) press_abs : Absolute pressure (raw) (int16_t) press_diff1 : Differential pressure 1 (raw) (int16_t) press_diff2 : Differential pressure 2 (raw) (int16_t) temperature : Raw Temperature measurement (raw) (int16_t) ''' return self.send(self.raw_pressure_encode(time_usec, press_abs, press_diff1, press_diff2, temperature)) def scaled_pressure_encode(self, time_boot_ms, press_abs, press_diff, temperature): ''' The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) press_abs : Absolute pressure (hectopascal) (float) press_diff : Differential pressure 1 (hectopascal) (float) temperature : Temperature measurement (0.01 degrees celsius) (int16_t) ''' msg = MAVLink_scaled_pressure_message(time_boot_ms, press_abs, press_diff, temperature) msg.pack(self) return msg def scaled_pressure_send(self, time_boot_ms, press_abs, press_diff, temperature): ''' The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) press_abs : Absolute pressure (hectopascal) (float) press_diff : Differential pressure 1 (hectopascal) (float) temperature : Temperature measurement (0.01 degrees celsius) (int16_t) ''' return self.send(self.scaled_pressure_encode(time_boot_ms, press_abs, press_diff, temperature)) def attitude_encode(self, time_boot_ms, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed): ''' The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) roll : Roll angle (rad, -pi..+pi) (float) pitch : Pitch angle (rad, -pi..+pi) (float) yaw : Yaw angle (rad, -pi..+pi) (float) rollspeed : Roll angular speed (rad/s) (float) pitchspeed : Pitch angular speed (rad/s) (float) yawspeed : Yaw angular speed (rad/s) (float) ''' msg = MAVLink_attitude_message(time_boot_ms, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed) msg.pack(self) return msg def attitude_send(self, time_boot_ms, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed): ''' The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) roll : Roll angle (rad, -pi..+pi) (float) pitch : Pitch angle (rad, -pi..+pi) (float) yaw : Yaw angle (rad, -pi..+pi) (float) rollspeed : Roll angular speed (rad/s) (float) pitchspeed : Pitch angular speed (rad/s) (float) yawspeed : Yaw angular speed (rad/s) (float) ''' return self.send(self.attitude_encode(time_boot_ms, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed)) def attitude_quaternion_encode(self, time_boot_ms, q1, q2, q3, q4, rollspeed, pitchspeed, yawspeed): ''' The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) q1 : Quaternion component 1 (float) q2 : Quaternion component 2 (float) q3 : Quaternion component 3 (float) q4 : Quaternion component 4 (float) rollspeed : Roll angular speed (rad/s) (float) pitchspeed : Pitch angular speed (rad/s) (float) yawspeed : Yaw angular speed (rad/s) (float) ''' msg = MAVLink_attitude_quaternion_message(time_boot_ms, q1, q2, q3, q4, rollspeed, pitchspeed, yawspeed) msg.pack(self) return msg def attitude_quaternion_send(self, time_boot_ms, q1, q2, q3, q4, rollspeed, pitchspeed, yawspeed): ''' The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) q1 : Quaternion component 1 (float) q2 : Quaternion component 2 (float) q3 : Quaternion component 3 (float) q4 : Quaternion component 4 (float) rollspeed : Roll angular speed (rad/s) (float) pitchspeed : Pitch angular speed (rad/s) (float) yawspeed : Yaw angular speed (rad/s) (float) ''' return self.send(self.attitude_quaternion_encode(time_boot_ms, q1, q2, q3, q4, rollspeed, pitchspeed, yawspeed)) def local_position_ned_encode(self, time_boot_ms, x, y, z, vx, vy, vz): ''' The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) x : X Position (float) y : Y Position (float) z : Z Position (float) vx : X Speed (float) vy : Y Speed (float) vz : Z Speed (float) ''' msg = MAVLink_local_position_ned_message(time_boot_ms, x, y, z, vx, vy, vz) msg.pack(self) return msg def local_position_ned_send(self, time_boot_ms, x, y, z, vx, vy, vz): ''' The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) x : X Position (float) y : Y Position (float) z : Z Position (float) vx : X Speed (float) vy : Y Speed (float) vz : Z Speed (float) ''' return self.send(self.local_position_ned_encode(time_boot_ms, x, y, z, vx, vy, vz)) def global_position_int_encode(self, time_boot_ms, lat, lon, alt, relative_alt, vx, vy, vz, hdg): ''' The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) lat : Latitude, expressed as * 1E7 (int32_t) lon : Longitude, expressed as * 1E7 (int32_t) alt : Altitude in meters, expressed as * 1000 (millimeters), above MSL (int32_t) relative_alt : Altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t) vx : Ground X Speed (Latitude), expressed as m/s * 100 (int16_t) vy : Ground Y Speed (Longitude), expressed as m/s * 100 (int16_t) vz : Ground Z Speed (Altitude), expressed as m/s * 100 (int16_t) hdg : Compass heading in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 (uint16_t) ''' msg = MAVLink_global_position_int_message(time_boot_ms, lat, lon, alt, relative_alt, vx, vy, vz, hdg) msg.pack(self) return msg def global_position_int_send(self, time_boot_ms, lat, lon, alt, relative_alt, vx, vy, vz, hdg): ''' The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) lat : Latitude, expressed as * 1E7 (int32_t) lon : Longitude, expressed as * 1E7 (int32_t) alt : Altitude in meters, expressed as * 1000 (millimeters), above MSL (int32_t) relative_alt : Altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t) vx : Ground X Speed (Latitude), expressed as m/s * 100 (int16_t) vy : Ground Y Speed (Longitude), expressed as m/s * 100 (int16_t) vz : Ground Z Speed (Altitude), expressed as m/s * 100 (int16_t) hdg : Compass heading in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 (uint16_t) ''' return self.send(self.global_position_int_encode(time_boot_ms, lat, lon, alt, relative_alt, vx, vy, vz, hdg)) def rc_channels_scaled_encode(self, time_boot_ms, port, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi): ''' The scaled values of the RC channels received. (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to 65535. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) port : Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. (uint8_t) chan1_scaled : RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan2_scaled : RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan3_scaled : RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan4_scaled : RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan5_scaled : RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan6_scaled : RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan7_scaled : RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan8_scaled : RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) rssi : Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. (uint8_t) ''' msg = MAVLink_rc_channels_scaled_message(time_boot_ms, port, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi) msg.pack(self) return msg def rc_channels_scaled_send(self, time_boot_ms, port, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi): ''' The scaled values of the RC channels received. (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to 65535. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) port : Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. (uint8_t) chan1_scaled : RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan2_scaled : RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan3_scaled : RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan4_scaled : RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan5_scaled : RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan6_scaled : RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan7_scaled : RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) chan8_scaled : RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767. (int16_t) rssi : Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. (uint8_t) ''' return self.send(self.rc_channels_scaled_encode(time_boot_ms, port, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi)) def rc_channels_raw_encode(self, time_boot_ms, port, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi): ''' The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) port : Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. (uint8_t) chan1_raw : RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan2_raw : RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan3_raw : RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan4_raw : RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan5_raw : RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan6_raw : RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan7_raw : RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan8_raw : RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) rssi : Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. (uint8_t) ''' msg = MAVLink_rc_channels_raw_message(time_boot_ms, port, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi) msg.pack(self) return msg def rc_channels_raw_send(self, time_boot_ms, port, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi): ''' The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) port : Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. (uint8_t) chan1_raw : RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan2_raw : RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan3_raw : RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan4_raw : RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan5_raw : RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan6_raw : RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan7_raw : RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) chan8_raw : RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused. (uint16_t) rssi : Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. (uint8_t) ''' return self.send(self.rc_channels_raw_encode(time_boot_ms, port, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi)) def servo_output_raw_encode(self, time_boot_ms, port, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw): ''' The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. time_boot_ms : Timestamp (microseconds since system boot) (uint32_t) port : Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. (uint8_t) servo1_raw : Servo output 1 value, in microseconds (uint16_t) servo2_raw : Servo output 2 value, in microseconds (uint16_t) servo3_raw : Servo output 3 value, in microseconds (uint16_t) servo4_raw : Servo output 4 value, in microseconds (uint16_t) servo5_raw : Servo output 5 value, in microseconds (uint16_t) servo6_raw : Servo output 6 value, in microseconds (uint16_t) servo7_raw : Servo output 7 value, in microseconds (uint16_t) servo8_raw : Servo output 8 value, in microseconds (uint16_t) ''' msg = MAVLink_servo_output_raw_message(time_boot_ms, port, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw) msg.pack(self) return msg def servo_output_raw_send(self, time_boot_ms, port, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw): ''' The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. time_boot_ms : Timestamp (microseconds since system boot) (uint32_t) port : Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. (uint8_t) servo1_raw : Servo output 1 value, in microseconds (uint16_t) servo2_raw : Servo output 2 value, in microseconds (uint16_t) servo3_raw : Servo output 3 value, in microseconds (uint16_t) servo4_raw : Servo output 4 value, in microseconds (uint16_t) servo5_raw : Servo output 5 value, in microseconds (uint16_t) servo6_raw : Servo output 6 value, in microseconds (uint16_t) servo7_raw : Servo output 7 value, in microseconds (uint16_t) servo8_raw : Servo output 8 value, in microseconds (uint16_t) ''' return self.send(self.servo_output_raw_encode(time_boot_ms, port, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw)) def mission_request_partial_list_encode(self, target_system, target_component, start_index, end_index): ''' Request a partial list of mission items from the system/component. http://qgroundcontrol.org/mavlink/waypoint_protocol. If start and end index are the same, just send one waypoint. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) start_index : Start index, 0 by default (int16_t) end_index : End index, -1 by default (-1: send list to end). Else a valid index of the list (int16_t) ''' msg = MAVLink_mission_request_partial_list_message(target_system, target_component, start_index, end_index) msg.pack(self) return msg def mission_request_partial_list_send(self, target_system, target_component, start_index, end_index): ''' Request a partial list of mission items from the system/component. http://qgroundcontrol.org/mavlink/waypoint_protocol. If start and end index are the same, just send one waypoint. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) start_index : Start index, 0 by default (int16_t) end_index : End index, -1 by default (-1: send list to end). Else a valid index of the list (int16_t) ''' return self.send(self.mission_request_partial_list_encode(target_system, target_component, start_index, end_index)) def mission_write_partial_list_encode(self, target_system, target_component, start_index, end_index): ''' This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED! target_system : System ID (uint8_t) target_component : Component ID (uint8_t) start_index : Start index, 0 by default and smaller / equal to the largest index of the current onboard list. (int16_t) end_index : End index, equal or greater than start index. (int16_t) ''' msg = MAVLink_mission_write_partial_list_message(target_system, target_component, start_index, end_index) msg.pack(self) return msg def mission_write_partial_list_send(self, target_system, target_component, start_index, end_index): ''' This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED! target_system : System ID (uint8_t) target_component : Component ID (uint8_t) start_index : Start index, 0 by default and smaller / equal to the largest index of the current onboard list. (int16_t) end_index : End index, equal or greater than start index. (int16_t) ''' return self.send(self.mission_write_partial_list_encode(target_system, target_component, start_index, end_index)) def mission_item_encode(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z): ''' Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See also http://qgroundcontrol.org/mavlink/waypoint_protocol. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) seq : Sequence (uint16_t) frame : The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h (uint8_t) command : The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs (uint16_t) current : false:0, true:1 (uint8_t) autocontinue : autocontinue to next wp (uint8_t) param1 : PARAM1 / For NAV command MISSIONs: Radius in which the MISSION is accepted as reached, in meters (float) param2 : PARAM2 / For NAV command MISSIONs: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds (float) param3 : PARAM3 / For LOITER command MISSIONs: Orbit to circle around the MISSION, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. (float) param4 : PARAM4 / For NAV and LOITER command MISSIONs: Yaw orientation in degrees, [0..360] 0 = NORTH (float) x : PARAM5 / local: x position, global: latitude (float) y : PARAM6 / y position: global: longitude (float) z : PARAM7 / z position: global: altitude (float) ''' msg = MAVLink_mission_item_message(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z) msg.pack(self) return msg def mission_item_send(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z): ''' Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See also http://qgroundcontrol.org/mavlink/waypoint_protocol. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) seq : Sequence (uint16_t) frame : The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h (uint8_t) command : The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs (uint16_t) current : false:0, true:1 (uint8_t) autocontinue : autocontinue to next wp (uint8_t) param1 : PARAM1 / For NAV command MISSIONs: Radius in which the MISSION is accepted as reached, in meters (float) param2 : PARAM2 / For NAV command MISSIONs: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds (float) param3 : PARAM3 / For LOITER command MISSIONs: Orbit to circle around the MISSION, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. (float) param4 : PARAM4 / For NAV and LOITER command MISSIONs: Yaw orientation in degrees, [0..360] 0 = NORTH (float) x : PARAM5 / local: x position, global: latitude (float) y : PARAM6 / y position: global: longitude (float) z : PARAM7 / z position: global: altitude (float) ''' return self.send(self.mission_item_encode(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z)) def mission_request_encode(self, target_system, target_component, seq): ''' Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. http://qgroundcontrol.org/mavlink/waypoint_protocol target_system : System ID (uint8_t) target_component : Component ID (uint8_t) seq : Sequence (uint16_t) ''' msg = MAVLink_mission_request_message(target_system, target_component, seq) msg.pack(self) return msg def mission_request_send(self, target_system, target_component, seq): ''' Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. http://qgroundcontrol.org/mavlink/waypoint_protocol target_system : System ID (uint8_t) target_component : Component ID (uint8_t) seq : Sequence (uint16_t) ''' return self.send(self.mission_request_encode(target_system, target_component, seq)) def mission_set_current_encode(self, target_system, target_component, seq): ''' Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in-between). target_system : System ID (uint8_t) target_component : Component ID (uint8_t) seq : Sequence (uint16_t) ''' msg = MAVLink_mission_set_current_message(target_system, target_component, seq) msg.pack(self) return msg def mission_set_current_send(self, target_system, target_component, seq): ''' Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in-between). target_system : System ID (uint8_t) target_component : Component ID (uint8_t) seq : Sequence (uint16_t) ''' return self.send(self.mission_set_current_encode(target_system, target_component, seq)) def mission_current_encode(self, seq): ''' Message that announces the sequence number of the current active mission item. The MAV will fly towards this mission item. seq : Sequence (uint16_t) ''' msg = MAVLink_mission_current_message(seq) msg.pack(self) return msg def mission_current_send(self, seq): ''' Message that announces the sequence number of the current active mission item. The MAV will fly towards this mission item. seq : Sequence (uint16_t) ''' return self.send(self.mission_current_encode(seq)) def mission_request_list_encode(self, target_system, target_component): ''' Request the overall list of mission items from the system/component. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) ''' msg = MAVLink_mission_request_list_message(target_system, target_component) msg.pack(self) return msg def mission_request_list_send(self, target_system, target_component): ''' Request the overall list of mission items from the system/component. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) ''' return self.send(self.mission_request_list_encode(target_system, target_component)) def mission_count_encode(self, target_system, target_component, count): ''' This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of MISSIONs. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) count : Number of mission items in the sequence (uint16_t) ''' msg = MAVLink_mission_count_message(target_system, target_component, count) msg.pack(self) return msg def mission_count_send(self, target_system, target_component, count): ''' This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of MISSIONs. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) count : Number of mission items in the sequence (uint16_t) ''' return self.send(self.mission_count_encode(target_system, target_component, count)) def mission_clear_all_encode(self, target_system, target_component): ''' Delete all mission items at once. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) ''' msg = MAVLink_mission_clear_all_message(target_system, target_component) msg.pack(self) return msg def mission_clear_all_send(self, target_system, target_component): ''' Delete all mission items at once. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) ''' return self.send(self.mission_clear_all_encode(target_system, target_component)) def mission_item_reached_encode(self, seq): ''' A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next MISSION. seq : Sequence (uint16_t) ''' msg = MAVLink_mission_item_reached_message(seq) msg.pack(self) return msg def mission_item_reached_send(self, seq): ''' A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next MISSION. seq : Sequence (uint16_t) ''' return self.send(self.mission_item_reached_encode(seq)) def mission_ack_encode(self, target_system, target_component, type): ''' Ack message during MISSION handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). target_system : System ID (uint8_t) target_component : Component ID (uint8_t) type : See MAV_MISSION_RESULT enum (uint8_t) ''' msg = MAVLink_mission_ack_message(target_system, target_component, type) msg.pack(self) return msg def mission_ack_send(self, target_system, target_component, type): ''' Ack message during MISSION handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). target_system : System ID (uint8_t) target_component : Component ID (uint8_t) type : See MAV_MISSION_RESULT enum (uint8_t) ''' return self.send(self.mission_ack_encode(target_system, target_component, type)) def set_gps_global_origin_encode(self, target_system, latitude, longitude, altitude): ''' As local waypoints exist, the global MISSION reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. target_system : System ID (uint8_t) latitude : global position * 1E7 (int32_t) longitude : global position * 1E7 (int32_t) altitude : global position * 1000 (int32_t) ''' msg = MAVLink_set_gps_global_origin_message(target_system, latitude, longitude, altitude) msg.pack(self) return msg def set_gps_global_origin_send(self, target_system, latitude, longitude, altitude): ''' As local waypoints exist, the global MISSION reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. target_system : System ID (uint8_t) latitude : global position * 1E7 (int32_t) longitude : global position * 1E7 (int32_t) altitude : global position * 1000 (int32_t) ''' return self.send(self.set_gps_global_origin_encode(target_system, latitude, longitude, altitude)) def gps_global_origin_encode(self, latitude, longitude, altitude): ''' Once the MAV sets a new GPS-Local correspondence, this message announces the origin (0,0,0) position latitude : Latitude (WGS84), expressed as * 1E7 (int32_t) longitude : Longitude (WGS84), expressed as * 1E7 (int32_t) altitude : Altitude(WGS84), expressed as * 1000 (int32_t) ''' msg = MAVLink_gps_global_origin_message(latitude, longitude, altitude) msg.pack(self) return msg def gps_global_origin_send(self, latitude, longitude, altitude): ''' Once the MAV sets a new GPS-Local correspondence, this message announces the origin (0,0,0) position latitude : Latitude (WGS84), expressed as * 1E7 (int32_t) longitude : Longitude (WGS84), expressed as * 1E7 (int32_t) altitude : Altitude(WGS84), expressed as * 1000 (int32_t) ''' return self.send(self.gps_global_origin_encode(latitude, longitude, altitude)) def set_local_position_setpoint_encode(self, target_system, target_component, coordinate_frame, x, y, z, yaw): ''' Set the setpoint for a local position controller. This is the position in local coordinates the MAV should fly to. This message is sent by the path/MISSION planner to the onboard position controller. As some MAVs have a degree of freedom in yaw (e.g. all helicopters/quadrotors), the desired yaw angle is part of the message. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) coordinate_frame : Coordinate frame - valid values are only MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_ENU (uint8_t) x : x position (float) y : y position (float) z : z position (float) yaw : Desired yaw angle (float) ''' msg = MAVLink_set_local_position_setpoint_message(target_system, target_component, coordinate_frame, x, y, z, yaw) msg.pack(self) return msg def set_local_position_setpoint_send(self, target_system, target_component, coordinate_frame, x, y, z, yaw): ''' Set the setpoint for a local position controller. This is the position in local coordinates the MAV should fly to. This message is sent by the path/MISSION planner to the onboard position controller. As some MAVs have a degree of freedom in yaw (e.g. all helicopters/quadrotors), the desired yaw angle is part of the message. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) coordinate_frame : Coordinate frame - valid values are only MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_ENU (uint8_t) x : x position (float) y : y position (float) z : z position (float) yaw : Desired yaw angle (float) ''' return self.send(self.set_local_position_setpoint_encode(target_system, target_component, coordinate_frame, x, y, z, yaw)) def local_position_setpoint_encode(self, coordinate_frame, x, y, z, yaw): ''' Transmit the current local setpoint of the controller to other MAVs (collision avoidance) and to the GCS. coordinate_frame : Coordinate frame - valid values are only MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_ENU (uint8_t) x : x position (float) y : y position (float) z : z position (float) yaw : Desired yaw angle (float) ''' msg = MAVLink_local_position_setpoint_message(coordinate_frame, x, y, z, yaw) msg.pack(self) return msg def local_position_setpoint_send(self, coordinate_frame, x, y, z, yaw): ''' Transmit the current local setpoint of the controller to other MAVs (collision avoidance) and to the GCS. coordinate_frame : Coordinate frame - valid values are only MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_ENU (uint8_t) x : x position (float) y : y position (float) z : z position (float) yaw : Desired yaw angle (float) ''' return self.send(self.local_position_setpoint_encode(coordinate_frame, x, y, z, yaw)) def global_position_setpoint_int_encode(self, coordinate_frame, latitude, longitude, altitude, yaw): ''' Transmit the current local setpoint of the controller to other MAVs (collision avoidance) and to the GCS. coordinate_frame : Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT (uint8_t) latitude : WGS84 Latitude position in degrees * 1E7 (int32_t) longitude : WGS84 Longitude position in degrees * 1E7 (int32_t) altitude : WGS84 Altitude in meters * 1000 (positive for up) (int32_t) yaw : Desired yaw angle in degrees * 100 (int16_t) ''' msg = MAVLink_global_position_setpoint_int_message(coordinate_frame, latitude, longitude, altitude, yaw) msg.pack(self) return msg def global_position_setpoint_int_send(self, coordinate_frame, latitude, longitude, altitude, yaw): ''' Transmit the current local setpoint of the controller to other MAVs (collision avoidance) and to the GCS. coordinate_frame : Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT (uint8_t) latitude : WGS84 Latitude position in degrees * 1E7 (int32_t) longitude : WGS84 Longitude position in degrees * 1E7 (int32_t) altitude : WGS84 Altitude in meters * 1000 (positive for up) (int32_t) yaw : Desired yaw angle in degrees * 100 (int16_t) ''' return self.send(self.global_position_setpoint_int_encode(coordinate_frame, latitude, longitude, altitude, yaw)) def set_global_position_setpoint_int_encode(self, coordinate_frame, latitude, longitude, altitude, yaw): ''' Set the current global position setpoint. coordinate_frame : Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT (uint8_t) latitude : WGS84 Latitude position in degrees * 1E7 (int32_t) longitude : WGS84 Longitude position in degrees * 1E7 (int32_t) altitude : WGS84 Altitude in meters * 1000 (positive for up) (int32_t) yaw : Desired yaw angle in degrees * 100 (int16_t) ''' msg = MAVLink_set_global_position_setpoint_int_message(coordinate_frame, latitude, longitude, altitude, yaw) msg.pack(self) return msg def set_global_position_setpoint_int_send(self, coordinate_frame, latitude, longitude, altitude, yaw): ''' Set the current global position setpoint. coordinate_frame : Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT (uint8_t) latitude : WGS84 Latitude position in degrees * 1E7 (int32_t) longitude : WGS84 Longitude position in degrees * 1E7 (int32_t) altitude : WGS84 Altitude in meters * 1000 (positive for up) (int32_t) yaw : Desired yaw angle in degrees * 100 (int16_t) ''' return self.send(self.set_global_position_setpoint_int_encode(coordinate_frame, latitude, longitude, altitude, yaw)) def safety_set_allowed_area_encode(self, target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z): ''' Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/MISSIONs to accept and which to reject. Safety areas are often enforced by national or competition regulations. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) frame : Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (uint8_t) p1x : x position 1 / Latitude 1 (float) p1y : y position 1 / Longitude 1 (float) p1z : z position 1 / Altitude 1 (float) p2x : x position 2 / Latitude 2 (float) p2y : y position 2 / Longitude 2 (float) p2z : z position 2 / Altitude 2 (float) ''' msg = MAVLink_safety_set_allowed_area_message(target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z) msg.pack(self) return msg def safety_set_allowed_area_send(self, target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z): ''' Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/MISSIONs to accept and which to reject. Safety areas are often enforced by national or competition regulations. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) frame : Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (uint8_t) p1x : x position 1 / Latitude 1 (float) p1y : y position 1 / Longitude 1 (float) p1z : z position 1 / Altitude 1 (float) p2x : x position 2 / Latitude 2 (float) p2y : y position 2 / Longitude 2 (float) p2z : z position 2 / Altitude 2 (float) ''' return self.send(self.safety_set_allowed_area_encode(target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z)) def safety_allowed_area_encode(self, frame, p1x, p1y, p1z, p2x, p2y, p2z): ''' Read out the safety zone the MAV currently assumes. frame : Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (uint8_t) p1x : x position 1 / Latitude 1 (float) p1y : y position 1 / Longitude 1 (float) p1z : z position 1 / Altitude 1 (float) p2x : x position 2 / Latitude 2 (float) p2y : y position 2 / Longitude 2 (float) p2z : z position 2 / Altitude 2 (float) ''' msg = MAVLink_safety_allowed_area_message(frame, p1x, p1y, p1z, p2x, p2y, p2z) msg.pack(self) return msg def safety_allowed_area_send(self, frame, p1x, p1y, p1z, p2x, p2y, p2z): ''' Read out the safety zone the MAV currently assumes. frame : Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (uint8_t) p1x : x position 1 / Latitude 1 (float) p1y : y position 1 / Longitude 1 (float) p1z : z position 1 / Altitude 1 (float) p2x : x position 2 / Latitude 2 (float) p2y : y position 2 / Longitude 2 (float) p2z : z position 2 / Altitude 2 (float) ''' return self.send(self.safety_allowed_area_encode(frame, p1x, p1y, p1z, p2x, p2y, p2z)) def set_roll_pitch_yaw_thrust_encode(self, target_system, target_component, roll, pitch, yaw, thrust): ''' Set roll, pitch and yaw. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) roll : Desired roll angle in radians (float) pitch : Desired pitch angle in radians (float) yaw : Desired yaw angle in radians (float) thrust : Collective thrust, normalized to 0 .. 1 (float) ''' msg = MAVLink_set_roll_pitch_yaw_thrust_message(target_system, target_component, roll, pitch, yaw, thrust) msg.pack(self) return msg def set_roll_pitch_yaw_thrust_send(self, target_system, target_component, roll, pitch, yaw, thrust): ''' Set roll, pitch and yaw. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) roll : Desired roll angle in radians (float) pitch : Desired pitch angle in radians (float) yaw : Desired yaw angle in radians (float) thrust : Collective thrust, normalized to 0 .. 1 (float) ''' return self.send(self.set_roll_pitch_yaw_thrust_encode(target_system, target_component, roll, pitch, yaw, thrust)) def set_roll_pitch_yaw_speed_thrust_encode(self, target_system, target_component, roll_speed, pitch_speed, yaw_speed, thrust): ''' Set roll, pitch and yaw. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) roll_speed : Desired roll angular speed in rad/s (float) pitch_speed : Desired pitch angular speed in rad/s (float) yaw_speed : Desired yaw angular speed in rad/s (float) thrust : Collective thrust, normalized to 0 .. 1 (float) ''' msg = MAVLink_set_roll_pitch_yaw_speed_thrust_message(target_system, target_component, roll_speed, pitch_speed, yaw_speed, thrust) msg.pack(self) return msg def set_roll_pitch_yaw_speed_thrust_send(self, target_system, target_component, roll_speed, pitch_speed, yaw_speed, thrust): ''' Set roll, pitch and yaw. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) roll_speed : Desired roll angular speed in rad/s (float) pitch_speed : Desired pitch angular speed in rad/s (float) yaw_speed : Desired yaw angular speed in rad/s (float) thrust : Collective thrust, normalized to 0 .. 1 (float) ''' return self.send(self.set_roll_pitch_yaw_speed_thrust_encode(target_system, target_component, roll_speed, pitch_speed, yaw_speed, thrust)) def roll_pitch_yaw_thrust_setpoint_encode(self, time_boot_ms, roll, pitch, yaw, thrust): ''' Setpoint in roll, pitch, yaw currently active on the system. time_boot_ms : Timestamp in milliseconds since system boot (uint32_t) roll : Desired roll angle in radians (float) pitch : Desired pitch angle in radians (float) yaw : Desired yaw angle in radians (float) thrust : Collective thrust, normalized to 0 .. 1 (float) ''' msg = MAVLink_roll_pitch_yaw_thrust_setpoint_message(time_boot_ms, roll, pitch, yaw, thrust) msg.pack(self) return msg def roll_pitch_yaw_thrust_setpoint_send(self, time_boot_ms, roll, pitch, yaw, thrust): ''' Setpoint in roll, pitch, yaw currently active on the system. time_boot_ms : Timestamp in milliseconds since system boot (uint32_t) roll : Desired roll angle in radians (float) pitch : Desired pitch angle in radians (float) yaw : Desired yaw angle in radians (float) thrust : Collective thrust, normalized to 0 .. 1 (float) ''' return self.send(self.roll_pitch_yaw_thrust_setpoint_encode(time_boot_ms, roll, pitch, yaw, thrust)) def roll_pitch_yaw_speed_thrust_setpoint_encode(self, time_boot_ms, roll_speed, pitch_speed, yaw_speed, thrust): ''' Setpoint in rollspeed, pitchspeed, yawspeed currently active on the system. time_boot_ms : Timestamp in milliseconds since system boot (uint32_t) roll_speed : Desired roll angular speed in rad/s (float) pitch_speed : Desired pitch angular speed in rad/s (float) yaw_speed : Desired yaw angular speed in rad/s (float) thrust : Collective thrust, normalized to 0 .. 1 (float) ''' msg = MAVLink_roll_pitch_yaw_speed_thrust_setpoint_message(time_boot_ms, roll_speed, pitch_speed, yaw_speed, thrust) msg.pack(self) return msg def roll_pitch_yaw_speed_thrust_setpoint_send(self, time_boot_ms, roll_speed, pitch_speed, yaw_speed, thrust): ''' Setpoint in rollspeed, pitchspeed, yawspeed currently active on the system. time_boot_ms : Timestamp in milliseconds since system boot (uint32_t) roll_speed : Desired roll angular speed in rad/s (float) pitch_speed : Desired pitch angular speed in rad/s (float) yaw_speed : Desired yaw angular speed in rad/s (float) thrust : Collective thrust, normalized to 0 .. 1 (float) ''' return self.send(self.roll_pitch_yaw_speed_thrust_setpoint_encode(time_boot_ms, roll_speed, pitch_speed, yaw_speed, thrust)) def set_quad_motors_setpoint_encode(self, target_system, motor_front_nw, motor_right_ne, motor_back_se, motor_left_sw): ''' Setpoint in the four motor speeds target_system : System ID of the system that should set these motor commands (uint8_t) motor_front_nw : Front motor in + configuration, front left motor in x configuration (uint16_t) motor_right_ne : Right motor in + configuration, front right motor in x configuration (uint16_t) motor_back_se : Back motor in + configuration, back right motor in x configuration (uint16_t) motor_left_sw : Left motor in + configuration, back left motor in x configuration (uint16_t) ''' msg = MAVLink_set_quad_motors_setpoint_message(target_system, motor_front_nw, motor_right_ne, motor_back_se, motor_left_sw) msg.pack(self) return msg def set_quad_motors_setpoint_send(self, target_system, motor_front_nw, motor_right_ne, motor_back_se, motor_left_sw): ''' Setpoint in the four motor speeds target_system : System ID of the system that should set these motor commands (uint8_t) motor_front_nw : Front motor in + configuration, front left motor in x configuration (uint16_t) motor_right_ne : Right motor in + configuration, front right motor in x configuration (uint16_t) motor_back_se : Back motor in + configuration, back right motor in x configuration (uint16_t) motor_left_sw : Left motor in + configuration, back left motor in x configuration (uint16_t) ''' return self.send(self.set_quad_motors_setpoint_encode(target_system, motor_front_nw, motor_right_ne, motor_back_se, motor_left_sw)) def set_quad_swarm_roll_pitch_yaw_thrust_encode(self, group, mode, roll, pitch, yaw, thrust): ''' Setpoint for up to four quadrotors in a group / wing group : ID of the quadrotor group (0 - 255, up to 256 groups supported) (uint8_t) mode : ID of the flight mode (0 - 255, up to 256 modes supported) (uint8_t) roll : Desired roll angle in radians +-PI (+-32767) (int16_t) pitch : Desired pitch angle in radians +-PI (+-32767) (int16_t) yaw : Desired yaw angle in radians, scaled to int16 +-PI (+-32767) (int16_t) thrust : Collective thrust, scaled to uint16 (0..65535) (uint16_t) ''' msg = MAVLink_set_quad_swarm_roll_pitch_yaw_thrust_message(group, mode, roll, pitch, yaw, thrust) msg.pack(self) return msg def set_quad_swarm_roll_pitch_yaw_thrust_send(self, group, mode, roll, pitch, yaw, thrust): ''' Setpoint for up to four quadrotors in a group / wing group : ID of the quadrotor group (0 - 255, up to 256 groups supported) (uint8_t) mode : ID of the flight mode (0 - 255, up to 256 modes supported) (uint8_t) roll : Desired roll angle in radians +-PI (+-32767) (int16_t) pitch : Desired pitch angle in radians +-PI (+-32767) (int16_t) yaw : Desired yaw angle in radians, scaled to int16 +-PI (+-32767) (int16_t) thrust : Collective thrust, scaled to uint16 (0..65535) (uint16_t) ''' return self.send(self.set_quad_swarm_roll_pitch_yaw_thrust_encode(group, mode, roll, pitch, yaw, thrust)) def nav_controller_output_encode(self, nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error): ''' Outputs of the APM navigation controller. The primary use of this message is to check the response and signs of the controller before actual flight and to assist with tuning controller parameters. nav_roll : Current desired roll in degrees (float) nav_pitch : Current desired pitch in degrees (float) nav_bearing : Current desired heading in degrees (int16_t) target_bearing : Bearing to current MISSION/target in degrees (int16_t) wp_dist : Distance to active MISSION in meters (uint16_t) alt_error : Current altitude error in meters (float) aspd_error : Current airspeed error in meters/second (float) xtrack_error : Current crosstrack error on x-y plane in meters (float) ''' msg = MAVLink_nav_controller_output_message(nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error) msg.pack(self) return msg def nav_controller_output_send(self, nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error): ''' Outputs of the APM navigation controller. The primary use of this message is to check the response and signs of the controller before actual flight and to assist with tuning controller parameters. nav_roll : Current desired roll in degrees (float) nav_pitch : Current desired pitch in degrees (float) nav_bearing : Current desired heading in degrees (int16_t) target_bearing : Bearing to current MISSION/target in degrees (int16_t) wp_dist : Distance to active MISSION in meters (uint16_t) alt_error : Current altitude error in meters (float) aspd_error : Current airspeed error in meters/second (float) xtrack_error : Current crosstrack error on x-y plane in meters (float) ''' return self.send(self.nav_controller_output_encode(nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error)) def set_quad_swarm_led_roll_pitch_yaw_thrust_encode(self, group, mode, led_red, led_blue, led_green, roll, pitch, yaw, thrust): ''' Setpoint for up to four quadrotors in a group / wing group : ID of the quadrotor group (0 - 255, up to 256 groups supported) (uint8_t) mode : ID of the flight mode (0 - 255, up to 256 modes supported) (uint8_t) led_red : RGB red channel (0-255) (uint8_t) led_blue : RGB green channel (0-255) (uint8_t) led_green : RGB blue channel (0-255) (uint8_t) roll : Desired roll angle in radians +-PI (+-32767) (int16_t) pitch : Desired pitch angle in radians +-PI (+-32767) (int16_t) yaw : Desired yaw angle in radians, scaled to int16 +-PI (+-32767) (int16_t) thrust : Collective thrust, scaled to uint16 (0..65535) (uint16_t) ''' msg = MAVLink_set_quad_swarm_led_roll_pitch_yaw_thrust_message(group, mode, led_red, led_blue, led_green, roll, pitch, yaw, thrust) msg.pack(self) return msg def set_quad_swarm_led_roll_pitch_yaw_thrust_send(self, group, mode, led_red, led_blue, led_green, roll, pitch, yaw, thrust): ''' Setpoint for up to four quadrotors in a group / wing group : ID of the quadrotor group (0 - 255, up to 256 groups supported) (uint8_t) mode : ID of the flight mode (0 - 255, up to 256 modes supported) (uint8_t) led_red : RGB red channel (0-255) (uint8_t) led_blue : RGB green channel (0-255) (uint8_t) led_green : RGB blue channel (0-255) (uint8_t) roll : Desired roll angle in radians +-PI (+-32767) (int16_t) pitch : Desired pitch angle in radians +-PI (+-32767) (int16_t) yaw : Desired yaw angle in radians, scaled to int16 +-PI (+-32767) (int16_t) thrust : Collective thrust, scaled to uint16 (0..65535) (uint16_t) ''' return self.send(self.set_quad_swarm_led_roll_pitch_yaw_thrust_encode(group, mode, led_red, led_blue, led_green, roll, pitch, yaw, thrust)) def state_correction_encode(self, xErr, yErr, zErr, rollErr, pitchErr, yawErr, vxErr, vyErr, vzErr): ''' Corrects the systems state by adding an error correction term to the position and velocity, and by rotating the attitude by a correction angle. xErr : x position error (float) yErr : y position error (float) zErr : z position error (float) rollErr : roll error (radians) (float) pitchErr : pitch error (radians) (float) yawErr : yaw error (radians) (float) vxErr : x velocity (float) vyErr : y velocity (float) vzErr : z velocity (float) ''' msg = MAVLink_state_correction_message(xErr, yErr, zErr, rollErr, pitchErr, yawErr, vxErr, vyErr, vzErr) msg.pack(self) return msg def state_correction_send(self, xErr, yErr, zErr, rollErr, pitchErr, yawErr, vxErr, vyErr, vzErr): ''' Corrects the systems state by adding an error correction term to the position and velocity, and by rotating the attitude by a correction angle. xErr : x position error (float) yErr : y position error (float) zErr : z position error (float) rollErr : roll error (radians) (float) pitchErr : pitch error (radians) (float) yawErr : yaw error (radians) (float) vxErr : x velocity (float) vyErr : y velocity (float) vzErr : z velocity (float) ''' return self.send(self.state_correction_encode(xErr, yErr, zErr, rollErr, pitchErr, yawErr, vxErr, vyErr, vzErr)) def request_data_stream_encode(self, target_system, target_component, req_stream_id, req_message_rate, start_stop): ''' target_system : The target requested to send the message stream. (uint8_t) target_component : The target requested to send the message stream. (uint8_t) req_stream_id : The ID of the requested data stream (uint8_t) req_message_rate : The requested interval between two messages of this type (uint16_t) start_stop : 1 to start sending, 0 to stop sending. (uint8_t) ''' msg = MAVLink_request_data_stream_message(target_system, target_component, req_stream_id, req_message_rate, start_stop) msg.pack(self) return msg def request_data_stream_send(self, target_system, target_component, req_stream_id, req_message_rate, start_stop): ''' target_system : The target requested to send the message stream. (uint8_t) target_component : The target requested to send the message stream. (uint8_t) req_stream_id : The ID of the requested data stream (uint8_t) req_message_rate : The requested interval between two messages of this type (uint16_t) start_stop : 1 to start sending, 0 to stop sending. (uint8_t) ''' return self.send(self.request_data_stream_encode(target_system, target_component, req_stream_id, req_message_rate, start_stop)) def data_stream_encode(self, stream_id, message_rate, on_off): ''' stream_id : The ID of the requested data stream (uint8_t) message_rate : The requested interval between two messages of this type (uint16_t) on_off : 1 stream is enabled, 0 stream is stopped. (uint8_t) ''' msg = MAVLink_data_stream_message(stream_id, message_rate, on_off) msg.pack(self) return msg def data_stream_send(self, stream_id, message_rate, on_off): ''' stream_id : The ID of the requested data stream (uint8_t) message_rate : The requested interval between two messages of this type (uint16_t) on_off : 1 stream is enabled, 0 stream is stopped. (uint8_t) ''' return self.send(self.data_stream_encode(stream_id, message_rate, on_off)) def manual_control_encode(self, target, x, y, z, r, buttons): ''' This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled an buttons are also transmit as boolean values of their target : The system to be controlled. (uint8_t) x : X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. (int16_t) y : Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. (int16_t) z : Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. (int16_t) r : R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. (int16_t) buttons : A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. (uint16_t) ''' msg = MAVLink_manual_control_message(target, x, y, z, r, buttons) msg.pack(self) return msg def manual_control_send(self, target, x, y, z, r, buttons): ''' This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled an buttons are also transmit as boolean values of their target : The system to be controlled. (uint8_t) x : X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. (int16_t) y : Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. (int16_t) z : Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. (int16_t) r : R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. (int16_t) buttons : A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. (uint16_t) ''' return self.send(self.manual_control_encode(target, x, y, z, r, buttons)) def rc_channels_override_encode(self, target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw): ''' The RAW values of the RC channels sent to the MAV to override info received from the RC radio. A value of -1 means no change to that channel. A value of 0 means control of that channel should be released back to the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) chan1_raw : RC channel 1 value, in microseconds (uint16_t) chan2_raw : RC channel 2 value, in microseconds (uint16_t) chan3_raw : RC channel 3 value, in microseconds (uint16_t) chan4_raw : RC channel 4 value, in microseconds (uint16_t) chan5_raw : RC channel 5 value, in microseconds (uint16_t) chan6_raw : RC channel 6 value, in microseconds (uint16_t) chan7_raw : RC channel 7 value, in microseconds (uint16_t) chan8_raw : RC channel 8 value, in microseconds (uint16_t) ''' msg = MAVLink_rc_channels_override_message(target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw) msg.pack(self) return msg def rc_channels_override_send(self, target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw): ''' The RAW values of the RC channels sent to the MAV to override info received from the RC radio. A value of -1 means no change to that channel. A value of 0 means control of that channel should be released back to the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. target_system : System ID (uint8_t) target_component : Component ID (uint8_t) chan1_raw : RC channel 1 value, in microseconds (uint16_t) chan2_raw : RC channel 2 value, in microseconds (uint16_t) chan3_raw : RC channel 3 value, in microseconds (uint16_t) chan4_raw : RC channel 4 value, in microseconds (uint16_t) chan5_raw : RC channel 5 value, in microseconds (uint16_t) chan6_raw : RC channel 6 value, in microseconds (uint16_t) chan7_raw : RC channel 7 value, in microseconds (uint16_t) chan8_raw : RC channel 8 value, in microseconds (uint16_t) ''' return self.send(self.rc_channels_override_encode(target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw)) def vfr_hud_encode(self, airspeed, groundspeed, heading, throttle, alt, climb): ''' Metrics typically displayed on a HUD for fixed wing aircraft airspeed : Current airspeed in m/s (float) groundspeed : Current ground speed in m/s (float) heading : Current heading in degrees, in compass units (0..360, 0=north) (int16_t) throttle : Current throttle setting in integer percent, 0 to 100 (uint16_t) alt : Current altitude (MSL), in meters (float) climb : Current climb rate in meters/second (float) ''' msg = MAVLink_vfr_hud_message(airspeed, groundspeed, heading, throttle, alt, climb) msg.pack(self) return msg def vfr_hud_send(self, airspeed, groundspeed, heading, throttle, alt, climb): ''' Metrics typically displayed on a HUD for fixed wing aircraft airspeed : Current airspeed in m/s (float) groundspeed : Current ground speed in m/s (float) heading : Current heading in degrees, in compass units (0..360, 0=north) (int16_t) throttle : Current throttle setting in integer percent, 0 to 100 (uint16_t) alt : Current altitude (MSL), in meters (float) climb : Current climb rate in meters/second (float) ''' return self.send(self.vfr_hud_encode(airspeed, groundspeed, heading, throttle, alt, climb)) def command_long_encode(self, target_system, target_component, command, confirmation, param1, param2, param3, param4, param5, param6, param7): ''' Send a command with up to four parameters to the MAV target_system : System which should execute the command (uint8_t) target_component : Component which should execute the command, 0 for all components (uint8_t) command : Command ID, as defined by MAV_CMD enum. (uint16_t) confirmation : 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) (uint8_t) param1 : Parameter 1, as defined by MAV_CMD enum. (float) param2 : Parameter 2, as defined by MAV_CMD enum. (float) param3 : Parameter 3, as defined by MAV_CMD enum. (float) param4 : Parameter 4, as defined by MAV_CMD enum. (float) param5 : Parameter 5, as defined by MAV_CMD enum. (float) param6 : Parameter 6, as defined by MAV_CMD enum. (float) param7 : Parameter 7, as defined by MAV_CMD enum. (float) ''' msg = MAVLink_command_long_message(target_system, target_component, command, confirmation, param1, param2, param3, param4, param5, param6, param7) msg.pack(self) return msg def command_long_send(self, target_system, target_component, command, confirmation, param1, param2, param3, param4, param5, param6, param7): ''' Send a command with up to four parameters to the MAV target_system : System which should execute the command (uint8_t) target_component : Component which should execute the command, 0 for all components (uint8_t) command : Command ID, as defined by MAV_CMD enum. (uint16_t) confirmation : 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) (uint8_t) param1 : Parameter 1, as defined by MAV_CMD enum. (float) param2 : Parameter 2, as defined by MAV_CMD enum. (float) param3 : Parameter 3, as defined by MAV_CMD enum. (float) param4 : Parameter 4, as defined by MAV_CMD enum. (float) param5 : Parameter 5, as defined by MAV_CMD enum. (float) param6 : Parameter 6, as defined by MAV_CMD enum. (float) param7 : Parameter 7, as defined by MAV_CMD enum. (float) ''' return self.send(self.command_long_encode(target_system, target_component, command, confirmation, param1, param2, param3, param4, param5, param6, param7)) def command_ack_encode(self, command, result): ''' Report status of a command. Includes feedback wether the command was executed. command : Command ID, as defined by MAV_CMD enum. (uint16_t) result : See MAV_RESULT enum (uint8_t) ''' msg = MAVLink_command_ack_message(command, result) msg.pack(self) return msg def command_ack_send(self, command, result): ''' Report status of a command. Includes feedback wether the command was executed. command : Command ID, as defined by MAV_CMD enum. (uint16_t) result : See MAV_RESULT enum (uint8_t) ''' return self.send(self.command_ack_encode(command, result)) def roll_pitch_yaw_rates_thrust_setpoint_encode(self, time_boot_ms, roll_rate, pitch_rate, yaw_rate, thrust): ''' Setpoint in roll, pitch, yaw rates and thrust currently active on the system. time_boot_ms : Timestamp in milliseconds since system boot (uint32_t) roll_rate : Desired roll rate in radians per second (float) pitch_rate : Desired pitch rate in radians per second (float) yaw_rate : Desired yaw rate in radians per second (float) thrust : Collective thrust, normalized to 0 .. 1 (float) ''' msg = MAVLink_roll_pitch_yaw_rates_thrust_setpoint_message(time_boot_ms, roll_rate, pitch_rate, yaw_rate, thrust) msg.pack(self) return msg def roll_pitch_yaw_rates_thrust_setpoint_send(self, time_boot_ms, roll_rate, pitch_rate, yaw_rate, thrust): ''' Setpoint in roll, pitch, yaw rates and thrust currently active on the system. time_boot_ms : Timestamp in milliseconds since system boot (uint32_t) roll_rate : Desired roll rate in radians per second (float) pitch_rate : Desired pitch rate in radians per second (float) yaw_rate : Desired yaw rate in radians per second (float) thrust : Collective thrust, normalized to 0 .. 1 (float) ''' return self.send(self.roll_pitch_yaw_rates_thrust_setpoint_encode(time_boot_ms, roll_rate, pitch_rate, yaw_rate, thrust)) def manual_setpoint_encode(self, time_boot_ms, roll, pitch, yaw, thrust, mode_switch, manual_override_switch): ''' Setpoint in roll, pitch, yaw and thrust from the operator time_boot_ms : Timestamp in milliseconds since system boot (uint32_t) roll : Desired roll rate in radians per second (float) pitch : Desired pitch rate in radians per second (float) yaw : Desired yaw rate in radians per second (float) thrust : Collective thrust, normalized to 0 .. 1 (float) mode_switch : Flight mode switch position, 0.. 255 (uint8_t) manual_override_switch : Override mode switch position, 0.. 255 (uint8_t) ''' msg = MAVLink_manual_setpoint_message(time_boot_ms, roll, pitch, yaw, thrust, mode_switch, manual_override_switch) msg.pack(self) return msg def manual_setpoint_send(self, time_boot_ms, roll, pitch, yaw, thrust, mode_switch, manual_override_switch): ''' Setpoint in roll, pitch, yaw and thrust from the operator time_boot_ms : Timestamp in milliseconds since system boot (uint32_t) roll : Desired roll rate in radians per second (float) pitch : Desired pitch rate in radians per second (float) yaw : Desired yaw rate in radians per second (float) thrust : Collective thrust, normalized to 0 .. 1 (float) mode_switch : Flight mode switch position, 0.. 255 (uint8_t) manual_override_switch : Override mode switch position, 0.. 255 (uint8_t) ''' return self.send(self.manual_setpoint_encode(time_boot_ms, roll, pitch, yaw, thrust, mode_switch, manual_override_switch)) def local_position_ned_system_global_offset_encode(self, time_boot_ms, x, y, z, roll, pitch, yaw): ''' The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) x : X Position (float) y : Y Position (float) z : Z Position (float) roll : Roll (float) pitch : Pitch (float) yaw : Yaw (float) ''' msg = MAVLink_local_position_ned_system_global_offset_message(time_boot_ms, x, y, z, roll, pitch, yaw) msg.pack(self) return msg def local_position_ned_system_global_offset_send(self, time_boot_ms, x, y, z, roll, pitch, yaw): ''' The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) x : X Position (float) y : Y Position (float) z : Z Position (float) roll : Roll (float) pitch : Pitch (float) yaw : Yaw (float) ''' return self.send(self.local_position_ned_system_global_offset_encode(time_boot_ms, x, y, z, roll, pitch, yaw)) def hil_state_encode(self, time_usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc): ''' Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations. time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) roll : Roll angle (rad) (float) pitch : Pitch angle (rad) (float) yaw : Yaw angle (rad) (float) rollspeed : Roll angular speed (rad/s) (float) pitchspeed : Pitch angular speed (rad/s) (float) yawspeed : Yaw angular speed (rad/s) (float) lat : Latitude, expressed as * 1E7 (int32_t) lon : Longitude, expressed as * 1E7 (int32_t) alt : Altitude in meters, expressed as * 1000 (millimeters) (int32_t) vx : Ground X Speed (Latitude), expressed as m/s * 100 (int16_t) vy : Ground Y Speed (Longitude), expressed as m/s * 100 (int16_t) vz : Ground Z Speed (Altitude), expressed as m/s * 100 (int16_t) xacc : X acceleration (mg) (int16_t) yacc : Y acceleration (mg) (int16_t) zacc : Z acceleration (mg) (int16_t) ''' msg = MAVLink_hil_state_message(time_usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc) msg.pack(self) return msg def hil_state_send(self, time_usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc): ''' Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations. time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) roll : Roll angle (rad) (float) pitch : Pitch angle (rad) (float) yaw : Yaw angle (rad) (float) rollspeed : Roll angular speed (rad/s) (float) pitchspeed : Pitch angular speed (rad/s) (float) yawspeed : Yaw angular speed (rad/s) (float) lat : Latitude, expressed as * 1E7 (int32_t) lon : Longitude, expressed as * 1E7 (int32_t) alt : Altitude in meters, expressed as * 1000 (millimeters) (int32_t) vx : Ground X Speed (Latitude), expressed as m/s * 100 (int16_t) vy : Ground Y Speed (Longitude), expressed as m/s * 100 (int16_t) vz : Ground Z Speed (Altitude), expressed as m/s * 100 (int16_t) xacc : X acceleration (mg) (int16_t) yacc : Y acceleration (mg) (int16_t) zacc : Z acceleration (mg) (int16_t) ''' return self.send(self.hil_state_encode(time_usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc)) def hil_controls_encode(self, time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode): ''' Sent from autopilot to simulation. Hardware in the loop control outputs time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) roll_ailerons : Control output -1 .. 1 (float) pitch_elevator : Control output -1 .. 1 (float) yaw_rudder : Control output -1 .. 1 (float) throttle : Throttle 0 .. 1 (float) aux1 : Aux 1, -1 .. 1 (float) aux2 : Aux 2, -1 .. 1 (float) aux3 : Aux 3, -1 .. 1 (float) aux4 : Aux 4, -1 .. 1 (float) mode : System mode (MAV_MODE) (uint8_t) nav_mode : Navigation mode (MAV_NAV_MODE) (uint8_t) ''' msg = MAVLink_hil_controls_message(time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode) msg.pack(self) return msg def hil_controls_send(self, time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode): ''' Sent from autopilot to simulation. Hardware in the loop control outputs time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) roll_ailerons : Control output -1 .. 1 (float) pitch_elevator : Control output -1 .. 1 (float) yaw_rudder : Control output -1 .. 1 (float) throttle : Throttle 0 .. 1 (float) aux1 : Aux 1, -1 .. 1 (float) aux2 : Aux 2, -1 .. 1 (float) aux3 : Aux 3, -1 .. 1 (float) aux4 : Aux 4, -1 .. 1 (float) mode : System mode (MAV_MODE) (uint8_t) nav_mode : Navigation mode (MAV_NAV_MODE) (uint8_t) ''' return self.send(self.hil_controls_encode(time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode)) def hil_rc_inputs_raw_encode(self, time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi): ''' Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) chan1_raw : RC channel 1 value, in microseconds (uint16_t) chan2_raw : RC channel 2 value, in microseconds (uint16_t) chan3_raw : RC channel 3 value, in microseconds (uint16_t) chan4_raw : RC channel 4 value, in microseconds (uint16_t) chan5_raw : RC channel 5 value, in microseconds (uint16_t) chan6_raw : RC channel 6 value, in microseconds (uint16_t) chan7_raw : RC channel 7 value, in microseconds (uint16_t) chan8_raw : RC channel 8 value, in microseconds (uint16_t) chan9_raw : RC channel 9 value, in microseconds (uint16_t) chan10_raw : RC channel 10 value, in microseconds (uint16_t) chan11_raw : RC channel 11 value, in microseconds (uint16_t) chan12_raw : RC channel 12 value, in microseconds (uint16_t) rssi : Receive signal strength indicator, 0: 0%, 255: 100% (uint8_t) ''' msg = MAVLink_hil_rc_inputs_raw_message(time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi) msg.pack(self) return msg def hil_rc_inputs_raw_send(self, time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi): ''' Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t) chan1_raw : RC channel 1 value, in microseconds (uint16_t) chan2_raw : RC channel 2 value, in microseconds (uint16_t) chan3_raw : RC channel 3 value, in microseconds (uint16_t) chan4_raw : RC channel 4 value, in microseconds (uint16_t) chan5_raw : RC channel 5 value, in microseconds (uint16_t) chan6_raw : RC channel 6 value, in microseconds (uint16_t) chan7_raw : RC channel 7 value, in microseconds (uint16_t) chan8_raw : RC channel 8 value, in microseconds (uint16_t) chan9_raw : RC channel 9 value, in microseconds (uint16_t) chan10_raw : RC channel 10 value, in microseconds (uint16_t) chan11_raw : RC channel 11 value, in microseconds (uint16_t) chan12_raw : RC channel 12 value, in microseconds (uint16_t) rssi : Receive signal strength indicator, 0: 0%, 255: 100% (uint8_t) ''' return self.send(self.hil_rc_inputs_raw_encode(time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi)) def optical_flow_encode(self, time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance): ''' Optical flow from a flow sensor (e.g. optical mouse sensor) time_usec : Timestamp (UNIX) (uint64_t) sensor_id : Sensor ID (uint8_t) flow_x : Flow in pixels in x-sensor direction (int16_t) flow_y : Flow in pixels in y-sensor direction (int16_t) flow_comp_m_x : Flow in meters in x-sensor direction, angular-speed compensated (float) flow_comp_m_y : Flow in meters in y-sensor direction, angular-speed compensated (float) quality : Optical flow quality / confidence. 0: bad, 255: maximum quality (uint8_t) ground_distance : Ground distance in meters. Positive value: distance known. Negative value: Unknown distance (float) ''' msg = MAVLink_optical_flow_message(time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance) msg.pack(self) return msg def optical_flow_send(self, time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance): ''' Optical flow from a flow sensor (e.g. optical mouse sensor) time_usec : Timestamp (UNIX) (uint64_t) sensor_id : Sensor ID (uint8_t) flow_x : Flow in pixels in x-sensor direction (int16_t) flow_y : Flow in pixels in y-sensor direction (int16_t) flow_comp_m_x : Flow in meters in x-sensor direction, angular-speed compensated (float) flow_comp_m_y : Flow in meters in y-sensor direction, angular-speed compensated (float) quality : Optical flow quality / confidence. 0: bad, 255: maximum quality (uint8_t) ground_distance : Ground distance in meters. Positive value: distance known. Negative value: Unknown distance (float) ''' return self.send(self.optical_flow_encode(time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance)) def global_vision_position_estimate_encode(self, usec, x, y, z, roll, pitch, yaw): ''' usec : Timestamp (microseconds, synced to UNIX time or since system boot) (uint64_t) x : Global X position (float) y : Global Y position (float) z : Global Z position (float) roll : Roll angle in rad (float) pitch : Pitch angle in rad (float) yaw : Yaw angle in rad (float) ''' msg = MAVLink_global_vision_position_estimate_message(usec, x, y, z, roll, pitch, yaw) msg.pack(self) return msg def global_vision_position_estimate_send(self, usec, x, y, z, roll, pitch, yaw): ''' usec : Timestamp (microseconds, synced to UNIX time or since system boot) (uint64_t) x : Global X position (float) y : Global Y position (float) z : Global Z position (float) roll : Roll angle in rad (float) pitch : Pitch angle in rad (float) yaw : Yaw angle in rad (float) ''' return self.send(self.global_vision_position_estimate_encode(usec, x, y, z, roll, pitch, yaw)) def vision_position_estimate_encode(self, usec, x, y, z, roll, pitch, yaw): ''' usec : Timestamp (microseconds, synced to UNIX time or since system boot) (uint64_t) x : Global X position (float) y : Global Y position (float) z : Global Z position (float) roll : Roll angle in rad (float) pitch : Pitch angle in rad (float) yaw : Yaw angle in rad (float) ''' msg = MAVLink_vision_position_estimate_message(usec, x, y, z, roll, pitch, yaw) msg.pack(self) return msg def vision_position_estimate_send(self, usec, x, y, z, roll, pitch, yaw): ''' usec : Timestamp (microseconds, synced to UNIX time or since system boot) (uint64_t) x : Global X position (float) y : Global Y position (float) z : Global Z position (float) roll : Roll angle in rad (float) pitch : Pitch angle in rad (float) yaw : Yaw angle in rad (float) ''' return self.send(self.vision_position_estimate_encode(usec, x, y, z, roll, pitch, yaw)) def vision_speed_estimate_encode(self, usec, x, y, z): ''' usec : Timestamp (microseconds, synced to UNIX time or since system boot) (uint64_t) x : Global X speed (float) y : Global Y speed (float) z : Global Z speed (float) ''' msg = MAVLink_vision_speed_estimate_message(usec, x, y, z) msg.pack(self) return msg def vision_speed_estimate_send(self, usec, x, y, z): ''' usec : Timestamp (microseconds, synced to UNIX time or since system boot) (uint64_t) x : Global X speed (float) y : Global Y speed (float) z : Global Z speed (float) ''' return self.send(self.vision_speed_estimate_encode(usec, x, y, z)) def vicon_position_estimate_encode(self, usec, x, y, z, roll, pitch, yaw): ''' usec : Timestamp (microseconds, synced to UNIX time or since system boot) (uint64_t) x : Global X position (float) y : Global Y position (float) z : Global Z position (float) roll : Roll angle in rad (float) pitch : Pitch angle in rad (float) yaw : Yaw angle in rad (float) ''' msg = MAVLink_vicon_position_estimate_message(usec, x, y, z, roll, pitch, yaw) msg.pack(self) return msg def vicon_position_estimate_send(self, usec, x, y, z, roll, pitch, yaw): ''' usec : Timestamp (microseconds, synced to UNIX time or since system boot) (uint64_t) x : Global X position (float) y : Global Y position (float) z : Global Z position (float) roll : Roll angle in rad (float) pitch : Pitch angle in rad (float) yaw : Yaw angle in rad (float) ''' return self.send(self.vicon_position_estimate_encode(usec, x, y, z, roll, pitch, yaw)) def highres_imu_encode(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated): ''' The IMU readings in SI units in NED body frame time_usec : Timestamp (microseconds, synced to UNIX time or since system boot) (uint64_t) xacc : X acceleration (m/s^2) (float) yacc : Y acceleration (m/s^2) (float) zacc : Z acceleration (m/s^2) (float) xgyro : Angular speed around X axis (rad / sec) (float) ygyro : Angular speed around Y axis (rad / sec) (float) zgyro : Angular speed around Z axis (rad / sec) (float) xmag : X Magnetic field (Gauss) (float) ymag : Y Magnetic field (Gauss) (float) zmag : Z Magnetic field (Gauss) (float) abs_pressure : Absolute pressure in millibar (float) diff_pressure : Differential pressure in millibar (float) pressure_alt : Altitude calculated from pressure (float) temperature : Temperature in degrees celsius (float) fields_updated : Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature (uint16_t) ''' msg = MAVLink_highres_imu_message(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated) msg.pack(self) return msg def highres_imu_send(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated): ''' The IMU readings in SI units in NED body frame time_usec : Timestamp (microseconds, synced to UNIX time or since system boot) (uint64_t) xacc : X acceleration (m/s^2) (float) yacc : Y acceleration (m/s^2) (float) zacc : Z acceleration (m/s^2) (float) xgyro : Angular speed around X axis (rad / sec) (float) ygyro : Angular speed around Y axis (rad / sec) (float) zgyro : Angular speed around Z axis (rad / sec) (float) xmag : X Magnetic field (Gauss) (float) ymag : Y Magnetic field (Gauss) (float) zmag : Z Magnetic field (Gauss) (float) abs_pressure : Absolute pressure in millibar (float) diff_pressure : Differential pressure in millibar (float) pressure_alt : Altitude calculated from pressure (float) temperature : Temperature in degrees celsius (float) fields_updated : Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature (uint16_t) ''' return self.send(self.highres_imu_encode(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated)) def file_transfer_start_encode(self, transfer_uid, dest_path, direction, file_size, flags): ''' Begin file transfer transfer_uid : Unique transfer ID (uint64_t) dest_path : Destination path (char) direction : Transfer direction: 0: from requester, 1: to requester (uint8_t) file_size : File size in bytes (uint32_t) flags : RESERVED (uint8_t) ''' msg = MAVLink_file_transfer_start_message(transfer_uid, dest_path, direction, file_size, flags) msg.pack(self) return msg def file_transfer_start_send(self, transfer_uid, dest_path, direction, file_size, flags): ''' Begin file transfer transfer_uid : Unique transfer ID (uint64_t) dest_path : Destination path (char) direction : Transfer direction: 0: from requester, 1: to requester (uint8_t) file_size : File size in bytes (uint32_t) flags : RESERVED (uint8_t) ''' return self.send(self.file_transfer_start_encode(transfer_uid, dest_path, direction, file_size, flags)) def file_transfer_dir_list_encode(self, transfer_uid, dir_path, flags): ''' Get directory listing transfer_uid : Unique transfer ID (uint64_t) dir_path : Directory path to list (char) flags : RESERVED (uint8_t) ''' msg = MAVLink_file_transfer_dir_list_message(transfer_uid, dir_path, flags) msg.pack(self) return msg def file_transfer_dir_list_send(self, transfer_uid, dir_path, flags): ''' Get directory listing transfer_uid : Unique transfer ID (uint64_t) dir_path : Directory path to list (char) flags : RESERVED (uint8_t) ''' return self.send(self.file_transfer_dir_list_encode(transfer_uid, dir_path, flags)) def file_transfer_res_encode(self, transfer_uid, result): ''' File transfer result transfer_uid : Unique transfer ID (uint64_t) result : 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device (uint8_t) ''' msg = MAVLink_file_transfer_res_message(transfer_uid, result) msg.pack(self) return msg def file_transfer_res_send(self, transfer_uid, result): ''' File transfer result transfer_uid : Unique transfer ID (uint64_t) result : 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device (uint8_t) ''' return self.send(self.file_transfer_res_encode(transfer_uid, result)) def battery_status_encode(self, accu_id, voltage_cell_1, voltage_cell_2, voltage_cell_3, voltage_cell_4, voltage_cell_5, voltage_cell_6, current_battery, battery_remaining): ''' Transmitte battery informations for a accu pack. accu_id : Accupack ID (uint8_t) voltage_cell_1 : Battery voltage of cell 1, in millivolts (1 = 1 millivolt) (uint16_t) voltage_cell_2 : Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell (uint16_t) voltage_cell_3 : Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell (uint16_t) voltage_cell_4 : Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell (uint16_t) voltage_cell_5 : Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell (uint16_t) voltage_cell_6 : Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell (uint16_t) current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t) battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery (int8_t) ''' msg = MAVLink_battery_status_message(accu_id, voltage_cell_1, voltage_cell_2, voltage_cell_3, voltage_cell_4, voltage_cell_5, voltage_cell_6, current_battery, battery_remaining) msg.pack(self) return msg def battery_status_send(self, accu_id, voltage_cell_1, voltage_cell_2, voltage_cell_3, voltage_cell_4, voltage_cell_5, voltage_cell_6, current_battery, battery_remaining): ''' Transmitte battery informations for a accu pack. accu_id : Accupack ID (uint8_t) voltage_cell_1 : Battery voltage of cell 1, in millivolts (1 = 1 millivolt) (uint16_t) voltage_cell_2 : Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell (uint16_t) voltage_cell_3 : Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell (uint16_t) voltage_cell_4 : Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell (uint16_t) voltage_cell_5 : Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell (uint16_t) voltage_cell_6 : Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell (uint16_t) current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t) battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery (int8_t) ''' return self.send(self.battery_status_encode(accu_id, voltage_cell_1, voltage_cell_2, voltage_cell_3, voltage_cell_4, voltage_cell_5, voltage_cell_6, current_battery, battery_remaining)) def setpoint_8dof_encode(self, target_system, val1, val2, val3, val4, val5, val6, val7, val8): ''' Set the 8 DOF setpoint for a controller. target_system : System ID (uint8_t) val1 : Value 1 (float) val2 : Value 2 (float) val3 : Value 3 (float) val4 : Value 4 (float) val5 : Value 5 (float) val6 : Value 6 (float) val7 : Value 7 (float) val8 : Value 8 (float) ''' msg = MAVLink_setpoint_8dof_message(target_system, val1, val2, val3, val4, val5, val6, val7, val8) msg.pack(self) return msg def setpoint_8dof_send(self, target_system, val1, val2, val3, val4, val5, val6, val7, val8): ''' Set the 8 DOF setpoint for a controller. target_system : System ID (uint8_t) val1 : Value 1 (float) val2 : Value 2 (float) val3 : Value 3 (float) val4 : Value 4 (float) val5 : Value 5 (float) val6 : Value 6 (float) val7 : Value 7 (float) val8 : Value 8 (float) ''' return self.send(self.setpoint_8dof_encode(target_system, val1, val2, val3, val4, val5, val6, val7, val8)) def setpoint_6dof_encode(self, target_system, trans_x, trans_y, trans_z, rot_x, rot_y, rot_z): ''' Set the 6 DOF setpoint for a attitude and position controller. target_system : System ID (uint8_t) trans_x : Translational Component in x (float) trans_y : Translational Component in y (float) trans_z : Translational Component in z (float) rot_x : Rotational Component in x (float) rot_y : Rotational Component in y (float) rot_z : Rotational Component in z (float) ''' msg = MAVLink_setpoint_6dof_message(target_system, trans_x, trans_y, trans_z, rot_x, rot_y, rot_z) msg.pack(self) return msg def setpoint_6dof_send(self, target_system, trans_x, trans_y, trans_z, rot_x, rot_y, rot_z): ''' Set the 6 DOF setpoint for a attitude and position controller. target_system : System ID (uint8_t) trans_x : Translational Component in x (float) trans_y : Translational Component in y (float) trans_z : Translational Component in z (float) rot_x : Rotational Component in x (float) rot_y : Rotational Component in y (float) rot_z : Rotational Component in z (float) ''' return self.send(self.setpoint_6dof_encode(target_system, trans_x, trans_y, trans_z, rot_x, rot_y, rot_z)) def memory_vect_encode(self, address, ver, type, value): ''' Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. address : Starting address of the debug variables (uint16_t) ver : Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below (uint8_t) type : Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 (uint8_t) value : Memory contents at specified address (int8_t) ''' msg = MAVLink_memory_vect_message(address, ver, type, value) msg.pack(self) return msg def memory_vect_send(self, address, ver, type, value): ''' Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. address : Starting address of the debug variables (uint16_t) ver : Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below (uint8_t) type : Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 (uint8_t) value : Memory contents at specified address (int8_t) ''' return self.send(self.memory_vect_encode(address, ver, type, value)) def debug_vect_encode(self, name, time_usec, x, y, z): ''' name : Name (char) time_usec : Timestamp (uint64_t) x : x (float) y : y (float) z : z (float) ''' msg = MAVLink_debug_vect_message(name, time_usec, x, y, z) msg.pack(self) return msg def debug_vect_send(self, name, time_usec, x, y, z): ''' name : Name (char) time_usec : Timestamp (uint64_t) x : x (float) y : y (float) z : z (float) ''' return self.send(self.debug_vect_encode(name, time_usec, x, y, z)) def named_value_float_encode(self, time_boot_ms, name, value): ''' Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) name : Name of the debug variable (char) value : Floating point value (float) ''' msg = MAVLink_named_value_float_message(time_boot_ms, name, value) msg.pack(self) return msg def named_value_float_send(self, time_boot_ms, name, value): ''' Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) name : Name of the debug variable (char) value : Floating point value (float) ''' return self.send(self.named_value_float_encode(time_boot_ms, name, value)) def named_value_int_encode(self, time_boot_ms, name, value): ''' Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) name : Name of the debug variable (char) value : Signed integer value (int32_t) ''' msg = MAVLink_named_value_int_message(time_boot_ms, name, value) msg.pack(self) return msg def named_value_int_send(self, time_boot_ms, name, value): ''' Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) name : Name of the debug variable (char) value : Signed integer value (int32_t) ''' return self.send(self.named_value_int_encode(time_boot_ms, name, value)) def statustext_encode(self, severity, text): ''' Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). severity : Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. (uint8_t) text : Status text message, without null termination character (char) ''' msg = MAVLink_statustext_message(severity, text) msg.pack(self) return msg def statustext_send(self, severity, text): ''' Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). severity : Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. (uint8_t) text : Status text message, without null termination character (char) ''' return self.send(self.statustext_encode(severity, text)) def debug_encode(self, time_boot_ms, ind, value): ''' Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) ind : index of debug variable (uint8_t) value : DEBUG value (float) ''' msg = MAVLink_debug_message(time_boot_ms, ind, value) msg.pack(self) return msg def debug_send(self, time_boot_ms, ind, value): ''' Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t) ind : index of debug variable (uint8_t) value : DEBUG value (float) ''' return self.send(self.debug_encode(time_boot_ms, ind, value))
59.303663
579
0.58319
37,274
312,471
4.644685
0.042496
0.019824
0.017606
0.018715
0.859622
0.808134
0.769289
0.736625
0.713319
0.692721
0
0.031636
0.346509
312,471
5,268
580
59.31492
0.816202
0.423617
0
0.323996
1
0
0.049116
0.005481
0
0
0
0
0
1
0.169935
false
0.003735
0.000467
0.044351
0.343137
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
6a07cfcee599ccf0eab0d4eca12139c8a2272c22
70,751
py
Python
legacy/functional_code/backprojection/backprojection.py
jjimmykang/bwsi-backprojection
440e21f90e2a1d0d1c28bfd9a0faaf97129378a5
[ "MIT" ]
1
2020-02-09T19:09:27.000Z
2020-02-09T19:09:27.000Z
legacy/functional_code/backprojection/backprojection.py
jjimmykang/bwsi-backprojection
440e21f90e2a1d0d1c28bfd9a0faaf97129378a5
[ "MIT" ]
null
null
null
legacy/functional_code/backprojection/backprojection.py
jjimmykang/bwsi-backprojection
440e21f90e2a1d0d1c28bfd9a0faaf97129378a5
[ "MIT" ]
null
null
null
#!/usr/bin/env python from pytransform import pyarmor_runtime pyarmor_runtime() __pyarmor__(__name__, __file__, b'\xe4\x50\x8c\x64\x26\x42\xd6\x01\x92\x66\xef\x19\xf6\xf6\xdc\x27\x16\xfe\x75\x04\x29\xbd\xcc\xc6\x42\x82\x80\x80\x4c\x5b\xbe\xad\x13\xdf\xc8\x81\x97\xb7\xe7\x2d\xfd\xc3\xe1\x8e\x68\xc9\xc6\xdd\x07\x90\x63\x18\xd1\xf6\xbd\x67\xda\x06\x1b\x54\x37\x13\x59\x38\x23\xb4\x50\xb9\x81\x87\x31\x71\xdd\x58\x83\xde\x7e\x46\x5e\x39\x81\xbb\x91\x21\x59\x54\x95\xa0\x43\x89\xc0\x8a\x28\x90\x8f\x5c\x1b\xfe\x5b\xe0\x39\xb0\x50\x16\x65\x32\xa2\xeb\xf8\x44\xfc\x4e\x2e\x2c\xdf\x49\xf4\x29\xee\x3b\x81\x95\x37\x91\x56\x6d\xec\x5f\x03\x7d\xf6\x03\xc3\xc2\x9b\x30\x4d\x72\xb9\xde\x80\x29\x74\xe6\x2a\x64\x10\x03\x3a\x93\x99\x2c\x7c\xa2\xb1\x5e\xed\xca\x6d\xd7\x2e\xa8\x1d\x2f\x8a\xfc\x1f\x87\x8a\x5e\x1d\xdd\xc2\x32\x34\x49\xba\xa2\xb2\xe2\xdb\x55\x8e\xbe\x53\xf7\x1c\x08\x95\x43\x0d\x83\x4e\x85\x6c\x63\x38\x70\x17\xda\x3a\xa9\xaa\x2d\x75\xab\xda\xa6\xc5\xdf\x62\x09\xdf\x4e\x4c\x87\xb5\x11\xdb\x65\xb7\xb6\x63\x18\x38\x65\xc8\x3b\xc3\x99\xd4\x30\x4b\x10\x45\x49\xdd\x81\x06\xfb\xd9\xb2\x87\x38\x09\xce\x56\x97\x7a\xec\x5b\x46\x01\x8f\x2d\xcd\x93\xcc\x23\x46\x1f\x88\xb2\x15\x54\x19\x0f\x09\x3f\x8c\x69\x96\xab\x69\xf0\x10\x97\x05\xaa\x95\xe0\xe9\x06\x68\x0f\x73\x4e\x78\xa0\xcd\xe2\x72\x64\x19\x0c\xc0\xf9\x63\xf0\x32\xa9\x16\x7d\x33\x52\x4a\x84\xc3\x32\xb3\x41\x32\x08\xc2\xbf\xb4\xc5\xe2\xe2\x00\x8f\xc4\x96\x78\x44\x35\x35\x3a\xf1\x94\x2e\x9c\x78\x0f\x18\xdc\xa9\x43\x31\x73\x13\xa9\x90\xdd\x6e\x3e\x8c\xd8\x24\xe6\xd3\x67\x40\x3e\x17\xbc\x63\xd8\x7c\x81\xf9\xad\x5f\xe6\xac\xd3\x13\x34\xab\x3f\x31\xac\x63\x08\x69\xd2\x87\x17\x3f\xf4\xde\x5d\xff\xac\x73\x37\xb6\x6d\xb2\x65\xd8\x07\xda\x35\x13\xb3\xe4\x22\x1e\x3e\x5d\xc9\xe2\xb9\x40\x19\xca\x53\x38\xc9\x19\xd5\x0a\xff\x14\x0d\x70\x7e\x4e\xe4\x84\xab\x39\x30\x6c\x9d\x88\xb0\x45\x80\xee\x61\x42\x8c\xb0\xf0\x63\x98\x46\x3c\x9d\xc4\x98\xef\x89\x63\x56\x4f\x27\x9c\x86\x8a\x8a\xdf\x7b\x19\xd0\x03\x42\x21\x4c\x30\x76\x79\xcf\xb2\xb3\x93\x7e\xa6\x06\x48\xb0\xac\x7a\x61\x8b\x10\x4f\x2a\xd3\xdd\x3f\x4f\xa7\xc6\x91\xc9\x42\xe5\x23\x3e\x91\x94\x01\x39\x2a\x97\x79\x28\x73\xcb\x9f\x90\x7f\x5b\x11\xe8\x4d\x8b\x76\x61\xc1\xa9\xd0\x76\x65\xa5\xcf\xb5\xe1\x4d\xdb\xcc\x96\x5f\x28\x2c\x81\xfb\x03\x9e\x1a\xa2\xc3\xc3\xea\xb2\xbf\x67\xbf\x56\x52\xc1\x94\x67\x12\xde\xe0\xd4\x53\x55\x14\xc3\xf4\xee\xa3\x94\x5d\x0a\x54\xf8\xe2\x86\x9a\x42\xb8\xc7\x91\x94\x09\x2c\x48\x00\x2c\x3d\xfb\xb1\x85\xb8\x00\xc1\xf4\x43\xb4\xa1\x01\xfa\x7f\xed\x0d\x86\xd8\x15\x1f\x2d\x40\x8a\xd2\xeb\xe6\x21\x55\x62\x62\x66\x0f\xdc\xcf\xea\xb4\x9b\xb4\x51\x5e\x80\x39\xb4\x5b\x0e\xad\xfb\x05\xf3\x3b\x42\x91\xda\xa4\x62\x1e\x73\x0f\xba\xfe\x16\x03\x7b\x69\xe3\xef\xc6\x69\x03\xa4\xd9\x68\xbf\xf4\x62\x36\x8d\xe6\x88\x5f\xea\x48\xe0\xb5\x23\x3f\xe6\x4e\x5e\xf6\x22\x20\xb3\x49\x46\x60\x85\x63\x12\xfe\xdc\xab\x04\x51\xa1\xb4\xf2\x54\x05\x0c\xac\x88\x36\x6f\x93\xaa\x34\x6f\x81\xf5\x47\x63\x63\x51\x85\x43\x38\xb2\x7d\xe7\x55\xd7\xb5\xa3\xd4\xbd\x4f\x31\xb1\x9f\x99\x8e\xe7\x87\xfb\xab\xde\xfe\xa2\x26\x5f\xa3\x28\xc9\xf3\x63\x79\x25\xc9\xe9\x0e\xd4\xb7\xea\x32\x1f\x85\xdf\xed\x9d\xfc\x90\x81\x2a\x40\x83\x96\x2b\x99\xf0\xf9\xa6\xe5\x70\xdc\x5d\x7a\x80\x93\xb0\x03\xa1\x2b\xb6\xa8\xb1\xb1\xda\xd5\x16\xd6\xa2\x6d\xdb\xb7\x3c\x9c\x50\x3b\xc4\xae\x8d\xe1\xfb\x32\xc0\x06\x50\x9b\x22\x27\x8c\x6b\xb1\x03\x91\xe1\x2c\x99\xf7\xe7\x50\x3e\x1c\x14\x27\x59\xc7\x8d\xc1\xe2\xaf\xd4\xa3\xee\xff\xbb\x25\xcf\xd8\xa1\x10\x77\xf9\xaa\x78\x85\x2b\x15\x63\x00\xf8\x97\x06\x42\x9b\x43\x9f\x9b\x53\x60\x26\xb3\x08\x52\x81\xf7\x7e\x33\xfa\x44\x30\x60\xb0\xdb\x99\xf0\x9d\x52\x75\xc0\xa6\x1e\xdb\x70\x2b\x2b\x82\xe8\x71\x39\xe0\x75\x60\xaf\xe8\xb4\xfe\x55\x00\x75\xe2\xbf\x9d\x2b\x7d\x8d\x0d\x84\x37\xcd\xd2\x38\xe9\xeb\x34\x7a\x88\x3b\x2b\xe9\x46\x89\xeb\x72\xd4\x23\x52\xfe\xce\x1e\xd3\xfe\xab\x2f\x9f\xf8\xcf\x0a\xa5\x02\x04\x1b\x51\xac\xbe\x00\xd9\xee\x23\x4b\x4d\xf3\x84\x9c\x0c\x05\xe3\x18\x87\x6a\xb3\xa1\x22\xac\xe6\x79\x61\xc7\x91\xfa\x28\x71\x5b\x66\xf7\xf1\xf3\x25\x5a\xa7\x82\x82\x80\x05\xf9\xf6\x25\x2b\xa2\x40\x5d\x94\x28\x73\xae\xc6\x92\x9e\x06\xc4\x4e\x45\x15\xa7\x1b\xee\x2e\x71\x71\xde\xa0\x97\x0d\x28\x22\xb8\x06\x47\xa6\x7d\x3d\x7c\x08\x83\x47\xe9\x5d\x73\x2b\xaa\x09\xaa\xef\x21\xea\x1b\xa2\xde\x9a\x6b\x28\xcf\x33\x35\x99\x23\x5a\xce\x6b\x8d\xd9\x21\xd1\x0d\x40\xc8\x24\x67\xb0\xe4\x1e\x31\x63\x55\xb0\xa9\x20\x7a\x9d\xf6\xc9\x5b\x8f\x89\x48\x9c\x89\x25\x33\x30\x26\x3f\x7f\x23\x27\x94\x49\x4c\x75\x1c\x66\x5f\x6c\xa3\x94\xa1\x5f\xbd\x48\x52\xd5\x78\x93\xe4\xe1\xba\x11\x8a\xd3\xa0\x0c\x8a\x2a\x1e\xf5\xa5\xdb\x11\xde\x2a\xc8\xfd\x59\x2e\x25\x2e\x9c\x9e\x2a\xa4\x27\x79\x66\x7f\xdc\x22\x9d\x08\x5f\xaa\xe7\x69\x08\xa3\x6c\xa3\xd3\x96\x35\xbb\x20\x44\x6a\x50\xfc\x71\x6a\x4a\x86\x33\x60\x83\xfc\x96\x21\x42\x97\x14\xe6\x3e\xf1\x9e\xa1\x25\x67\x35\x67\xa3\x3b\xfe\x0c\x57\x14\x05\xab\x00\xcd\xe3\xd2\xfd\xc6\xd8\xd7\x8e\x1a\x98\x0d\x34\x71\x92\x15\x33\xa5\xa2\xf1\x73\x57\x58\xe4\x2a\x47\x81\x91\x59\xa4\x4c\xa6\x5f\xc0\x7e\x2b\x43\x6e\x06\xdd\x88\x9a\x09\xe9\xb6\xcf\x32\xe1\x53\x30\xc1\x94\x85\x3c\xca\x58\x6d\x87\x33\x58\x2d\xc5\xed\xca\x30\x94\xbd\xba\x85\x5e\xb7\xac\xca\x52\x11\x87\xe8\x70\x8b\xb1\x3f\x92\x2b\xec\xc0\x2c\xb9\xea\x3d\x37\xb4\x51\x07\x39\x68\x84\x51\x72\x42\x9c\x8b\x83\x24\x1c\xdb\x0b\x1f\x7e\x6e\x71\x1e\xe6\xb8\x07\x89\x31\x1c\x7f\x79\xd8\xc6\x2c\xfb\x62\x87\x14\xd1\x78\xdf\xeb\xe1\xaa\x0e\x02\xfb\x06\x82\x24\xe8\x80\x79\x6d\x25\x93\x57\x1c\xc5\x5d\x9b\x27\x9d\xe8\x50\xaf\x3c\x57\xa9\xcd\xf2\x3f\x69\x09\xf6\xe7\xff\x8b\x52\xc6\xaa\x42\xd8\x33\xa6\x3a\x3d\x9b\xd6\xda\xe2\x22\x20\x5e\xab\x42\x68\xf3\xbd\xe8\xec\x76\x83\xfb\xcc\x3e\x12\x9c\x50\x3b\x6d\xf5\x18\xc8\xe9\x41\xd8\x16\xfb\x24\x57\xc4\x6a\xae\x40\x0f\x4f\x98\x5b\x5d\x83\x96\xdf\xba\x9b\x1e\x3e\xc8\xa5\xa9\xc4\xf4\xa4\xef\xcb\x05\x7d\x27\xc8\xc7\x59\x69\x80\xb5\x93\xa7\xab\xc0\xa1\x8f\x93\xdb\x27\x40\xfd\xcf\x30\xd1\x78\x5d\x90\x26\xd4\x71\x32\x7a\x8d\x97\x17\x9e\xa2\x35\x2d\x5d\xf0\x86\xbc\x0d\x8a\x3f\x15\xaa\x40\x7f\xa9\xcb\x5d\x45\x1d\x4f\xd2\x13\x80\x57\xf4\x5d\x78\xbf\x76\x23\x7d\x8d\x4b\x9e\x32\x52\x9f\xdb\x9a\xff\xda\x55\xfe\x99\x1e\xc2\xc5\x73\xe5\x9d\x7d\x77\xe3\x68\x12\xb4\xce\x11\xde\x73\x76\x1c\x17\xea\x99\x9d\x4f\x0c\x81\xfc\xcc\x33\x69\x8d\xd4\x9f\x89\x2f\xa1\x30\xf4\xe3\x54\x47\xae\x82\x56\x66\xef\xd5\x8d\x35\xde\x7b\x7e\xe4\x70\x16\xea\x70\xf7\xbd\x44\x34\xb7\x67\x06\xe2\x80\x2d\x25\x6a\x98\x40\x8b\xf4\x18\x6f\xf7\xa5\xd8\x31\xd1\x44\xa2\x87\xcd\x97\xd0\x37\xc3\xcf\xd7\xba\xe2\x80\x4d\x10\x88\x86\xf4\xcf\x39\xf8\x30\xde\x37\xfd\x0c\xcf\x45\xc0\xee\x62\xa2\x97\xb9\xfa\x3b\xbf\xdf\xf7\xd6\xc6\xea\xfe\x97\x2a\x3c\xd2\x9b\x77\x7c\xb3\x09\x5e\x88\x3a\x25\x71\x0e\x38\xe4\x29\xb0\xbe\xdc\x2d\x48\xc5\xf5\x41\x1a\x09\x34\xb4\xc3\x5d\x80\x83\x7b\xe5\x03\xa5\x33\x12\xe9\xe0\x1f\xd9\x5c\x38\xcb\x0a\x18\xd9\x37\xe6\x77\xf3\xa6\xc3\x6c\xa7\xfb\x0f\x14\x67\xfb\xbe\xca\x96\xdd\xf8\x15\x63\x84\x8d\xc9\x91\x4a\x28\xdb\xb0\x11\x43\x40\x55\x9e\xcf\x4a\x57\x6b\xb0\xc6\x79\xb3\x0c\xf7\xf7\x6f\xca\xf7\xa0\x7a\xbb\xc4\x3a\x7a\x71\x3c\x7d\x66\x76\x3f\x6d\x1e\x82\x5d\xa2\x4b\xe0\x1f\xb9\x67\x88\xbb\x28\xc8\x34\xae\x17\x7e\x0e\x84\x2f\xd2\xd7\x72\x55\xe4\x62\x30\x04\xee\x6e\xa8\xac\xcd\x33\x91\x02\x9d\x47\x90\x6d\x37\xaf\x57\xdc\x35\x7d\x7a\x97\xfd\x99\x51\x84\x29\x50\xb0\x2e\x0f\x16\xfa\x8c\x13\xe7\x7d\xa5\x75\xb5\x28\x84\x42\x72\x33\x5a\x9a\xae\x65\xc1\x81\xfd\xef\x74\x79\xfe\x03\xa6\xf6\x8f\x2a\x8e\xa6\x28\xee\xbd\x6b\x64\x26\x8d\x1e\x1f\xca\x07\xea\x9a\x2d\x69\x84\x3b\x4f\xa7\xe8\x75\x2b\xc8\xa7\xeb\x42\x86\x36\x82\xc8\xb9\x4e\x82\x5e\x26\x7f\x7d\xc4\x83\x10\x42\xe1\xd1\x52\x4c\x6b\x33\x3d\xe9\x71\x9c\xdc\x32\xa7\xeb\xbd\x43\x2a\x3f\xa4\xef\x0f\x85\xd2\xfd\xcd\xbc\x7c\x6c\x99\x2b\x0e\xb1\x02\x9d\x94\x2e\x46\x01\x70\x49\xd1\xb3\xc7\xea\xd6\xad\xde\xf9\x20\xbd\xeb\x4a\x63\x86\xb9\xcb\xdc\x28\x30\xd4\x94\xde\x44\xae\xec\x90\x1f\x04\x8c\x9e\x6d\xed\x3e\x5d\x0d\xfd\xec\x63\x64\x1b\xd5\x4f\x9f\x5a\x05\xf2\x01\x25\xf6\x99\x8b\x0e\x43\x2c\xf7\xfe\x63\xf9\xde\x7a\x24\x48\x95\xc2\xc7\xb1\x53\x49\x08\x27\x9e\xdd\xbd\x93\xc6\x9f\x46\x2b\x1a\x90\x10\x71\x9e\xe2\x74\x07\xdc\x15\xf0\xfc\x1b\xac\x0f\x0e\xa7\xb9\x08\x14\x6b\x5a\x0e\xa5\x0f\xce\xc3\xd4\x5c\xd2\x1b\x75\x54\x6a\x91\xa9\xd6\x11\x86\xca\x4b\xd5\xa6\x9a\xcf\xbe\x93\xaa\x19\xc3\x10\xd8\xde\x77\x85\x3d\x46\xdd\xbd\x7e\x48\x5e\xa0\x54\x07\x76\x56\x0e\x0c\xc5\x0c\x9f\xe5\x89\x53\x2e\x00\xac\x6e\xed\x35\x75\x7f\xfe\xc8\xd1\x95\x0e\x7f\xf9\x61\x2c\xd9\xdc\x8f\x9e\x7a\x4f\x53\x0d\xd7\x93\x2d\x0c\xcd\x1d\xa2\x82\x92\x73\xa4\xea\x85\xf0\xdf\x40\xa9\x3b\xfa\x6d\xe6\x6d\x88\x79\x23\x15\xdb\x5e\xb9\xa7\xa0\x27\x21\x79\xa4\x27\x3a\x76\x6a\xc8\x47\xb1\x9f\x03\x0c\x20\x3c\xad\x7c\x9c\x11\xa2\xba\x63\x49\x4d\x8e\xf7\x7a\xa2\xe1\x3d\x6c\xff\xcf\xc3\x8b\x75\x5e\x63\xb0\x66\x8c\x23\x1a\x22\xdb\xfd\x07\x0a\xdb\x53\x29\xe7\xde\x3a\xd6\x4e\x77\x40\x40\x98\x70\x5c\x0f\x12\x57\x4f\x03\x9b\x1f\x56\x0b\x18\x81\xf6\x4d\xd5\x8f\x67\xce\xa1\xaf\x93\x6d\x88\x8e\xbe\xa0\x60\x7c\x67\x0b\xe7\x26\x8d\x52\x02\x72\x9b\x20\xb9\x60\xfb\x7c\x8d\x0b\x53\x82\x06\x36\x8a\xf2\x9a\x1b\x56\xa9\x97\x6b\xf5\xb8\xfd\xcd\x9f\xec\xa3\xf1\xb5\xd4\x62\x28\x80\x18\x26\x61\x29\xa6\x21\xa4\x29\x67\x89\x14\x1d\x84\x74\x40\x46\x63\x64\xfc\xfd\x1c\xbf\x49\x78\x6d\x1b\xd3\x29\xd2\x1a\x5f\x7d\x6e\x92\xa9\xf9\xdd\xb8\xf0\x71\x21\x91\xa0\xb1\x66\xe5\xfa\x37\x67\x8d\x21\xf3\x2e\x3a\xef\xa2\x2d\xff\x91\xca\x1a\x5c\x33\xbd\xec\x2a\x68\xa7\x9f\xf1\x6f\x0a\x4e\x62\x57\xdb\xe7\xb3\xa5\xcf\x50\x7a\x9c\x13\xeb\xc6\x1d\x29\xde\x13\xd6\xb6\x05\x1a\x71\xad\xfe\x73\x92\x4b\xbd\x0a\x89\xa1\x11\xdd\x3b\x69\x22\x3f\x11\xbf\x37\x2c\x5e\x55\xdf\x5b\x07\xb1\xfc\xdb\x68\x9b\x0d\xed\xdd\xa5\xe7\x5d\x5e\xa4\x1a\xb7\x1c\xca\x5b\x17\xd6\xfc\x91\xe2\x4e\x3e\x0d\xec\xce\x6d\x66\x37\x4d\xc7\x7e\x22\x26\xec\xae\xc8\x29\xf1\xd6\xf9\x06\x07\xaf\x79\xf8\x06\xe2\xdd\x7b\xfa\x13\xa0\xee\xdb\x8a\x5f\x58\x04\xc9\x6f\xda\x5b\x61\x84\xd7\x4b\x80\xdb\xe2\x20\xa8\x41\xac\xe2\xa5\x8c\x1f\xff\x88\x6a\x8c\xd5\xa7\xf3\x7a\xa9\x0f\x32\x18\x12\xd1\x8f\xd4\x60\xc7\x1d\x3d\xc7\xe1\x01\xba\x17\x8f\x33\x87\xe5\x88\x4b\x34\xa6\x23\x18\x7b\x21\x53\x26\x6c\xfe\x99\x14\x65\xdd\xcc\x24\x18\x0e\xfa\x0b\xc8\xf5\xd3\x82\xde\xee\xad\x82\xcf\x93\xec\x26\x10\x12\x68\xec\x5c\x89\x61\xd1\x3d\xac\x1d\xc7\xf6\x34\x21\x02\x5a\x87\x10\xb9\x8d\x5c\x19\x31\xcb\x3a\xac\xaa\xc5\xbb\x73\xe6\x17\x6a\x9f\x36\x2d\x7d\x23\x01\x19\x80\x5f\xc1\x8a\x8b\xdd\xc9\xba\x7e\x30\x9d\x2e\x9e\x00\x9f\xeb\xfc\xf2\xd8\x24\x44\xca\xe6\x8c\xc1\x3f\xc3\x53\xb3\x62\x49\xe5\x8f\x20\xfb\xb5\x85\x3a\x81\xb2\xe5\xd7\xe7\x0a\x7a\xd1\xc3\x7d\x41\x8f\x7c\x97\x1c\x44\xdf\x32\x55\xe4\x3c\x64\x07\xc5\xc4\xd1\xfd\x2d\x69\xc3\x18\xb5\x0d\x50\x51\x38\xc6\xe8\xe7\xe1\x16\xde\x75\x32\xff\x5f\xc9\xe7\x93\x8d\xd4\x7b\xad\x2f\x2a\x0d\x1d\xfe\x45\xa2\x8f\x9e\xe3\x4e\x53\xf6\x89\x7e\xa4\x46\x4c\xff\x36\xf1\xe7\x9b\x05\xf9\x6d\x6d\x60\xd2\x1b\x68\x7c\x51\x0a\xf4\x97\x00\x1c\x4c\xe8\x4e\xda\x15\x1a\xb6\xfd\x58\x7d\x75\xa9\x19\x16\xf6\x6c\xa8\xf8\x64\x00\x41\x98\x56\x8f\xfe\x0e\x19\xd8\xd2\x3e\x8e\x41\x65\xc4\x94\xf2\xf3\x74\xf2\x1f\xd4\x32\x4a\x8d\xeb\x5e\x25\xb9\xac\xf5\xf2\x0f\xdd\x61\x31\x0b\x56\xa7\x0c\x58\xad\xe2\x32\xa2\x70\x47\x65\x71\x3a\xd0\xaa\x11\xa7\x8e\xb8\x3f\x69\x8e\xe2\x8a\x92\x35\x5d\xef\xaf\x76\xaf\x1c\xae\xb4\x46\x22\xdc\x10\xe7\xcb\x00\x46\x78\xd2\x83\x1d\xfa\x1b\xee\xcd\xab\x13\x2c\x90\x52\x44\x85\xf0\xda\xdc\x68\x51\x73\x47\x30\xfe\x01\x75\xfd\x86\x34\xe3\x61\x99\xac\x67\x5c\xb6\x8f\xb4\x94\x56\xbb\x74\x05\x3d\x04\x66\xc8\x2c\x5b\xda\x0d\xcd\x1a\xbb\xb0\xf3\xfd\x37\x12\x86\xbf\xfe\x5e\x9f\x96\xb5\xf7\x06\xbe\x98\xee\x7c\xec\x79\x6d\xc6\xa4\xa7\x2a\x6d\x78\x26\x10\x86\x48\xec\x2b\x75\x48\x69\x8f\x32\xc6\xaf\xd4\xf5\x5a\xca\x1d\x66\xb7\xe8\x06\x1b\x59\x72\x3e\xec\xf5\x58\xf7\xdf\x0a\x99\x28\xa4\x9e\xd3\xf9\x17\x6a\xaa\x19\x73\xd2\xb9\xcb\xc7\x25\xe1\xa8\xf0\x0f\xa9\xcb\xc2\xf2\x98\x75\x86\x0b\x04\xa5\x8d\xd1\x0c\x24\x3c\x59\xb4\xb1\xe0\xd9\xdb\xcd\x0b\x45\x4d\xe0\xf3\xf6\x68\xbd\xd1\x1f\xef\x94\x2b\x71\xe3\x0e\x11\xb5\x84\x25\xda\x02\x3b\x28\x03\x61\x7d\xcc\xd2\x14\x5c\x50\x8e\x2e\x82\x2a\x4c\x19\x8a\x78\xcf\x65\x35\x5e\x65\x05\x5f\xcc\x68\xa4\x8a\x41\x63\xdb\xdc\x89\x4a\xe3\x35\x1f\xf1\x3d\xff\x4b\xf5\x63\x9c\x32\xc2\x51\xf0\x53\xb9\xe0\xaf\x0b\xc2\x99\x8e\x2a\x11\x9b\xb1\xd0\x62\x2b\x30\xc9\x6b\x94\x46\x61\x90\xba\x14\x69\xca\x86\xbe\x86\x19\x66\x73\x49\xc1\xa4\x7a\x0f\x15\xd8\x13\xb2\xb4\x12\x17\x84\x82\x05\xca\x16\xf2\xfe\xa2\x8a\xc1\xea\xa9\x5a\x48\x4d\xbb\xe8\xd8\x49\x75\x46\x28\x0a\x2c\xd4\xfd\xbd\x0d\x09\x5b\x1d\x86\x33\x75\x94\xfb\x12\x69\xd4\x3e\xaf\x4d\x2d\xec\x3a\xf5\xea\xec\x3c\x37\x38\x8d\xa0\x51\xfa\x54\x50\x04\x0d\x8d\xc4\x11\x99\x50\x3e\x55\x44\x06\xac\x8d\xc3\xfc\xae\x7b\x2d\x87\x73\x60\x1f\x9e\x45\x45\xf2\x64\xcb\x3f\x62\x8c\x26\x78\x86\x7f\xc1\x3f\x14\x55\x35\xbb\x26\xe8\x2d\x60\x48\xb4\x7a\x85\xa9\xa9\xa3\xfb\x44\x65\x3d\x1a\x32\x5a\xe2\x39\xba\x7b\xbd\x92\x3d\xc0\xef\x9c\xce\xf7\x43\x76\x79\xa3\xd8\x35\xe1\x2a\xdb\x78\xf6\x6b\xce\x75\x4d\x51\xc9\xfd\x53\x1d\x4d\xda\x27\x21\xf0\xf7\xe4\x10\xe6\x4b\xda\xa3\x29\x4f\x85\x6d\x04\x03\x68\xad\x02\x42\x54\x3d\xf7\x9d\x1a\x6d\x43\x38\x97\xa2\xd8\xe0\xe9\x02\x55\x0f\x7b\xa1\x10\xb5\x26\x67\x0f\xc2\x71\xd0\x4f\xe6\xdb\xb4\x8a\xf6\xc9\x1d\x31\x88\xb5\x82\x1b\x50\xf3\xf1\xe8\x7e\x7a\xe4\xcb\x60\xc8\x86\xd2\x8f\xcf\x5b\xe0\xf7\x54\x4b\xd6\xf2\xbc\x69\xe4\x56\xd7\x65\xfa\xa4\xa7\x2d\x30\x43\x33\x71\x3b\x0f\x80\x41\x64\xbf\xe6\xc2\x94\x3e\x6c\xe4\xcc\x43\x1c\x8e\x41\xbe\x0d\xae\xad\xc6\xd7\xfc\x9e\x55\xfa\x5a\x65\x41\x16\xc1\x15\x98\x6d\x0a\x61\x79\xfb\xaf\x44\x1c\x14\xb0\x08\x82\x9e\x03\x15\xd5\xe1\x51\x24\xd1\x0e\xdd\x7f\x92\x10\xf5\xf9\x91\x28\x6a\x28\xb5\xd6\x00\xac\x97\x23\x5d\x91\x78\x89\x53\x72\x21\xc1\xb4\xe5\xaf\x76\x16\xef\x76\x3b\x5b\xc1\x18\x70\x47\x76\x31\x5b\x21\xe4\x2b\x67\xfa\xc5\x86\xaf\x03\xf3\x65\xc1\x33\xc1\xe9\x61\xb1\xc3\xee\x07\x24\xf3\x01\x3e\x14\x91\xf8\x18\x1b\x17\x1f\xc8\x8f\x85\x31\xad\x5f\xc8\xd6\x83\xd2\x20\x30\xb9\x9c\xb7\x24\xea\xcf\xad\xed\x2d\x5c\xae\x45\x95\x27\xfe\xc6\xb7\xef\xa4\x4a\x74\x7c\xce\xe4\x6a\x69\x34\x8e\xeb\x5c\x26\x60\x14\x0d\xb0\xbf\x8f\xff\xd0\xa2\x18\xb1\x7a\x74\x0e\xec\x4d\x70\x36\xc4\x06\x11\x28\x96\xba\x87\x71\x2e\x84\xbc\x00\x0d\x26\x09\xd1\x2c\x7b\xc9\x9c\x9f\x17\x07\x63\x26\x04\xa6\xc4\x58\x0f\x2a\xb1\x03\x19\xea\x1f\xd7\x06\x33\x58\x78\xc3\x76\xb5\xee\x2a\x7f\x9b\xe4\xba\x2b\x7c\xb3\xaf\x94\x5b\x0d\x97\xae\x7c\x03\xc1\xf4\xd3\x54\x78\x17\x48\x16\x13\x8f\x51\x25\x6d\xc6\x62\x8d\xd2\x24\x5c\x38\x00\x43\x19\xf9\x3c\xe9\x07\xbb\xd2\x90\x99\xd5\xc6\x36\xb2\x39\x79\x05\xe0\x34\xae\xfe\xa4\xd8\xad\xad\xb6\xa3\x71\x92\x0c\x9e\xb0\xd8\xc5\xa0\x25\x99\x6f\x20\x1f\xe4\x32\xcd\x03\x5d\x73\xdf\x72\xf0\xf4\x6b\x95\x56\xd6\xf6\xe8\x26\x0e\xe0\x26\x95\x98\xf0\x48\x21\xc4\xee\x74\x66\xc3\x4d\x0b\x45\x52\x50\x10\x3c\xd4\x57\x74\xb2\x4f\x53\xed\x7a\x7c\xe2\x80\x34\x1f\x1f\xb1\x73\x0f\x56\x36\x6e\x90\x37\x2b\x90\x3a\x33\xda\x77\xa3\x56\xf9\x9a\x0c\x7f\xca\x55\x86\xc6\x5b\x03\xd9\x53\xfd\xf7\x8d\xe3\x1f\x4c\x51\x9b\x8d\x6a\x43\xfe\xe2\xbe\xa0\x44\xa2\x34\xda\xb6\xd3\xd5\xeb\x58\x99\x92\x27\x51\x17\xcb\x63\x56\x2c\x77\xd5\x7a\xec\xec\xf4\xb1\x17\x77\xa2\x36\xad\x1b\xb4\x3d\x59\x5d\x22\x7a\x41\x9e\xd5\xa1\x04\xee\x29\x5f\x8e\x88\xb0\xdf\xd7\xd4\xa5\x38\xa1\x68\xd6\xa3\x86\x6a\xec\x15\x8a\x02\xa0\xae\xec\x1f\xd5\x7e\xd0\xd9\x50\xfa\x6a\x85\x98\xbb\x83\x6c\x9a\x27\x30\xc3\x03\x2d\x6e\xcc\x17\x11\x90\xae\xb9\xf7\x09\x11\x69\xca\x3a\x68\x5d\x57\x48\x34\xb7\xef\x52\x59\x55\x43\x25\xad\xe2\xd4\xa0\x7b\xaf\x58\x46\x6a\x7d\xc4\xe9\xa3\xa6\x45\x6d\x70\x79\x24\xd1\x87\xeb\x91\x03\x5f\xcf\x8e\xb6\x01\xfc\x00\x10\xfa\xa5\x20\x3d\x3d\xa0\xab\x10\xa6\xec\xf1\x69\x2d\x8b\x29\x9e\xde\x6c\x3f\x14\xae\x5d\x3c\x8d\xcb\xf7\xf1\x82\xfb\x18\x5a\xa5\x64\xad\xb5\xb3\x81\x04\x2a\xd2\x96\xf5\xe0\x87\xdd\x83\x8d\xdc\x7b\xfd\x1b\xb0\xa5\x1b\xb4\x84\x57\xc3\x2d\x2c\x47\xa2\x27\x92\x4d\x25\x5f\xf2\x52\x41\x80\x29\x36\xb6\xbf\x81\xea\x2a\xae\x59\x55\xe9\x88\xfa\x58\x6c\x86\x7b\xb4\xa4\x02\x93\xb1\x06\x32\x11\xf7\x85\x8b\x60\x10\xc1\x49\xc0\x23\x94\xf8\x66\x93\xec\xd2\x03\x2d\x20\xf8\x10\x7d\xce\x61\xe5\xd3\x18\x62\xde\xcc\x61\x7a\x3a\xf5\xbe\xbb\xb2\x6e\x35\xf8\x5a\xf1\x5b\xe1\x6a\x5e\x9d\x38\x15\x23\x5f\x4a\xc5\xf3\x0f\xb1\x28\x75\x36\x5c\x45\x6c\x83\xe7\x84\xb5\xc8\x6b\x02\x03\x8c\xdc\xb2\x3a\x29\xef\x53\x47\x71\x1d\x4b\x76\xa8\xdf\x8b\x90\x98\x74\x8a\xdb\xdf\x71\xcf\x68\xf7\x8d\x91\x6c\x08\xbd\x32\x1f\x47\xec\x18\x71\x18\x4c\xba\x90\x3e\xba\xfb\x96\xff\x11\xa7\xea\x6c\xfd\x76\x19\x03\x87\x6b\x83\xa6\xa3\xdb\x3b\x32\xfa\x2f\xfd\x4d\xa9\xf0\x7c\x61\x66\x2c\xcf\x0f\xf7\xc4\x53\xb5\x51\x96\x44\x9c\x80\x96\xbb\x33\xe6\x2f\xe1\x5e\xa7\x7c\xf5\x71\x8d\x25\x2e\xad\x98\x89\xda\x29\xc4\xd9\xa2\xb4\xf9\xd8\x65\x27\x7a\x7d\x12\x17\x42\x3f\x0b\xc7\xef\x1a\xd4\x89\xfb\xa6\xea\xac\x8a\xee\x66\xaf\x7a\x04\x79\x92\x2d\x14\x82\x02\x3f\x29\x97\x82\x7a\x5a\xfd\xae\xcb\x8d\xd5\xab\x3c\x52\x9f\xa9\xaa\x2f\x48\x0b\xb3\xf3\xe6\x58\x20\xac\x00\xd2\x26\xa6\x3b\x21\x57\x55\xda\x9d\x63\x2c\x35\x98\xe9\xc3\xc8\x55\xa2\xf0\x02\x21\xe0\x47\x7c\x35\xca\x8e\x29\x91\xbe\xeb\x02\xf3\x5a\x69\x2d\x4c\xef\x6b\x9b\x7b\xd0\x4e\x00\xe9\x75\xca\x79\x60\x53\xcb\x72\xec\xb0\x04\xbb\x4b\x58\xd9\x35\x10\x71\xd1\x45\xeb\x69\x8e\x97\xd6\x9d\x52\x5d\xac\x65\x2b\xf8\x60\xfa\x36\x43\x9f\x38\x85\xfc\xc9\x02\xa6\x5a\x40\x26\xd8\x8b\xd4\xe9\x83\xbd\xfe\x63\xbe\xac\x21\x1a\x80\x90\xeb\xce\x56\x55\xbf\x7f\x9e\x81\xa1\xd7\x8d\x03\xef\x0e\xa1\x9d\xe3\xf9\x9e\xac\x8b\x50\xfd\xab\xe3\xf9\x1b\xe3\x01\x77\xa4\xbb\x32\xcd\x48\x14\x95\x18\x53\x4b\x98\xa9\xaf\x30\x78\x8f\x85\xc3\xd3\x6c\x10\xe0\xc7\xe4\xc5\x11\xed\x43\x27\xab\xd1\xba\xa8\x49\xb0\xe6\x22\x8a\x04\xc1\xa3\x9f\xba\x3d\xeb\x99\x99\xf9\x23\x69\xea\x07\x23\x0d\x45\x74\x9a\x4c\x89\xcf\xed\xcd\xaf\xd3\x08\x83\xa2\x22\xc7\xa9\xc0\xac\x9e\x29\x69\xe3\xda\xad\xdc\x0f\xe0\xff\x84\xd1\x35\x07\xee\x31\x7c\xff\x69\x81\x07\x7f\x64\xf0\xfc\x70\x04\x6a\x83\x1c\x90\x52\x59\x23\x43\x58\x1a\x38\x38\x4e\xa7\xf5\x21\x9b\xba\x01\xda\x07\xb7\x16\x05\x94\xa9\x04\xba\xf9\xdd\xaa\x6a\x75\x2a\x93\x72\xef\x8e\x22\x5a\xae\x90\x69\x64\x6a\x8b\xb5\x5b\x22\xf7\x15\xb9\x52\x14\x3d\xc7\x38\x2f\x21\x52\xd4\x18\x32\x23\x5e\xf4\xd5\xc0\xe6\x1e\xcf\xa5\xc9\x3f\x32\xe2\x6f\x28\xe1\xc4\xfd\x1a\xe2\x17\xd5\xf1\x64\x6f\x78\xbf\xc7\x4e\x33\x21\x60\xf7\x71\x1f\x43\x11\x65\x96\xf3\x52\x5e\x9d\xd4\xd2\x58\x2f\x7f\xd3\x68\x42\xda\x9a\x36\x67\x67\xaa\xdb\x04\x8a\xbe\x33\x4f\x5a\x01\x31\x22\xe8\xc5\xe1\x0e\x34\x1e\x6a\xc4\x28\x31\x63\x25\x14\xcd\x22\xe7\xa9\x4f\x30\x5e\xf8\xf4\x79\x4d\xc4\xa4\xbc\x47\x8a\x17\x25\x57\xd1\xde\xb0\x45\x42\x8d\x2a\xec\xa1\x0b\xd1\xd1\xfb\x0e\x72\x4d\x44\xdf\x3d\x8a\x8f\x87\xbf\xe6\xe6\x7a\x85\xac\x3c\xdc\xb5\x50\x0f\x8d\x30\x8c\xf1\x01\xcb\x45\xe7\x11\xdd\x3a\x34\x2d\xac\x28\xc6\xcb\xfb\x4e\xf0\xc9\xe6\x63\x48\xa7\x98\xe1\xa1\xb5\xba\xb1\x1e\x4b\xee\x3e\x3a\x8c\x51\x6c\xed\x4d\xdc\x4d\x63\xe8\x27\xec\x13\x6e\x27\x62\x48\x8a\xf5\x2c\x59\x33\xb6\xe6\x24\x49\x8b\xb8\x04\x8d\x31\x1e\xb6\xe2\x12\x6d\xda\xbc\x46\x1d\xfb\xf5\xee\x4b\xe7\xf1\xd3\x04\xd7\x70\xbf\x6e\x9f\xa3\xb5\xe0\x34\x51\x4c\xaa\xd8\x20\xeb\xc5\xb1\x4a\xb4\xf3\xd7\x91\x22\x1e\x1f\x8c\xd3\x56\x94\xf6\xca\x61\xd6\xfc\x1a\x5c\x97\x54\xd5\x1b\x0a\x6d\xc9\x80\xc0\x74\xab\xe7\xf0\xa8\x9e\xb2\xa0\xb2\xfd\x78\x86\xd2\xb8\x61\xcc\xac\xd4\xed\xd4\x6e\x89\x43\xe2\xcb\xe4\xf4\x75\x89\xcb\x1f\x78\x30\x06\xc6\x7f\xb5\x29\x70\xeb\x29\x86\xbc\xf7\xad\x4b\xe7\x4d\x7c\xb4\xf3\x14\x02\x62\x7a\x51\x5e\xc9\x1a\xd9\xe4\xbc\xfb\x73\x11\x68\xfd\x1a\x1e\x63\xc9\xff\x7b\x09\x87\x9e\xd3\xa6\xe6\x91\xc7\x54\x5f\x2b\xe1\x32\xf9\xa5\xc8\xb0\xcb\x4d\xb2\x20\xc6\xe1\xd0\xd4\x93\xca\xed\x4f\x30\x17\x9a\x14\x40\xa8\x5a\xb5\x2f\xad\x8f\xf1\xf0\xd5\xb8\x74\x60\xa3\x5b\x40\xf0\xe2\xb6\xc6\x5c\xe7\x96\x0c\x15\x3a\xd5\x70\xcc\x19\x11\x0a\x05\xf5\x87\xf8\xbf\x18\x7b\xfa\xaa\x6c\xb6\x31\x4a\x3b\x08\x43\x79\x34\xf7\x8f\x24\x9d\x01\x0a\xeb\xfa\x34\x27\xea\xd9\x99\xb7\xf3\xb9\x76\x13\x78\x85\x9e\x87\xcc\xba\x41\x4e\x30\x91\xa6\xf5\x8d\x75\x4d\xb0\x82\x0e\x91\x12\x0d\x46\x62\xee\xa1\x22\x04\x64\xe1\x0f\x12\x1a\x42\x12\x9d\xa1\xa8\xf1\x43\x2c\x82\xf8\x60\x63\x40\x78\xfb\x70\x84\x54\x6d\x4a\x51\xe5\x04\x0d\xc2\xbe\x8f\xbf\xd1\xae\xc9\x7b\x3c\xf4\x57\x34\x8f\xb9\x02\xfa\x94\xc6\x81\xf4\x64\x44\x1c\x94\xde\x8f\xb8\xa5\xfa\x42\x3c\x0d\xdd\xae\x8f\x52\x70\x37\x82\x9a\x45\x83\x59\xd8\x00\xf2\xee\x2e\xd7\xe9\x95\x97\x37\x38\x1b\x47\x30\x2a\x70\x75\xaf\x6e\x66\x67\xc1\x8a\xb0\xc0\xe3\xb6\x9b\x29\x85\x71\x19\xf3\xf6\x78\xad\x27\x9a\xf1\x28\xb9\x7e\xc5\x87\x85\x25\xb5\x3b\xff\xf6\xd7\x17\x87\xd7\xb9\xae\xd5\x84\xac\xf4\x9d\x57\x86\xda\xbc\x6d\x20\x96\x1e\x0f\xce\x03\x38\xcf\xdf\xda\x2c\x63\x94\x0d\x7c\x4a\x0b\x60\x09\xbd\x8d\x8b\xa5\x88\xd1\xef\xb0\x8e\xe9\x7b\x51\xee\x37\xab\xad\x1d\xb8\x4e\x95\x4c\xb7\xf8\x69\x13\xf3\x45\xf5\x04\xbf\x19\x7d\x94\xac\x97\x27\x8d\xd8\xaa\xba\x20\x51\xc1\xcd\xfb\xba\xb0\x1c\x95\x8f\xa5\xd3\xb0\x89\x01\xd7\xe0\x09\x9e\x2a\x7b\xdf\x0f\xa0\x03\xdf\x98\xea\x7e\xfe\x28\x38\x9d\xe7\x2a\x4a\x52\xa0\x1a\xff\x6d\x64\xb0\xec\x04\x28\x28\xa6\x04\xb8\xbf\xff\x56\x1a\xea\xaf\x69\x5d\xba\xa7\xf9\x81\x62\x2d\x5c\x97\x6e\x00\x51\xf8\xb1\x16\xc1\xe6\xf3\xb1\x3f\x1f\x4b\x7b\x2b\x39\x61\xc0\x39\x70\x60\xc4\x1b\xc3\xf7\xf5\xdf\xf4\x47\x56\xf4\x28\xa8\x75\x37\x74\xa7\xd2\x12\xbd\xc7\x4b\x8c\xd0\x55\x5e\xf7\x8e\xaa\x8b\xd7\x40\x25\xf2\x5c\x35\xe7\xd5\x7f\x81\x05\x73\x37\xdc\x49\x98\x53\x2b\x3b\xf7\x20\x95\xab\xda\x09\xac\xbb\x5a\x00\x61\xdf\x06\xc3\xf5\x8f\x50\x0d\xcf\x20\x52\xff\xdd\x08\x6b\xf7\x3a\xcc\xbe\x10\xa5\xfb\x56\x96\x6b\x4c\x5c\x00\x61\xf0\x85\xb7\x31\x12\x30\x73\xa2\xed\xf1\x1b\xb9\xa4\x24\x3d\x7c\xa8\x8c\x80\xda\xb5\x62\xe3\x61\x76\xe8\xe9\x10\x38\x6a\x8b\x6e\xac\x58\x2b\x1b\xa8\x9e\x62\xc3\xd4\x29\x3c\xa2\x3b\x8d\x78\x2a\x30\xe3\xec\xc4\xce\x75\x52\xed\x1a\x7c\xaa\x0c\x2a\xa1\x0c\x77\xeb\xa7\xf2\xe7\x39\x2e\x00\x3c\xde\xa8\x32\x72\x36\x5f\x68\xd5\xe2\x04\xd2\x2e\xdf\x75\x1c\x65\x42\x03\xca\x70\xfb\xcc\x93\x11\x1f\xb0\xe9\x40\xf4\x82\xb6\xe6\x6a\x1e\x1f\xb4\xf2\x41\x36\x03\x28\xb6\x73\x8a\xa1\x1f\x94\xf2\xc5\x69\x4f\xdc\x00\xd7\xaa\x8e\x24\xf0\xc0\x9e\xb5\x3f\xb6\x6e\x44\xc0\xd5\xfa\x3d\xce\x49\xd9\x0d\x6a\xc0\x0c\x6b\x73\x1e\xd0\x3c\x90\x80\x00\xb6\x89\xfe\x91\x20\x12\x0a\x42\x23\x78\x07\x1f\x68\xb1\x67\x35\x62\x61\x4a\xd8\x7e\x39\x84\x74\x2b\x33\x19\xd0\xc1\x91\x46\x40\xe6\x57\x25\x4b\xf3\x6e\x25\x2d\x1e\xac\x44\xd0\x84\x2d\x15\x34\x95\xb3\x2b\x2d\x24\xec\xdc\x6a\xbb\x8a\x3f\xaf\x3d\x3f\x45\x70\xc0\x0e\x0c\x7d\xc9\xef\x1d\xb4\xb4\x92\x09\xce\xa4\x3c\x4e\xe1\x09\xad\x26\x7b\x00\x2f\x6e\x48\x93\xbe\xba\x19\xf0\x0e\x45\x9b\x5f\x9d\x37\xec\xbb\xc4\x24\xb7\x77\xdc\x60\x3e\x05\x92\xb5\xea\xc0\x33\xba\xe6\xde\xda\x22\xb7\x18\x31\xd7\xd5\x42\x7a\x22\x26\x66\x40\x9e\x28\x97\x70\x79\x82\x6b\x88\x5f\x4e\x38\xf8\x7b\x99\xa4\x74\x8b\xe1\xf1\xeb\xd4\xd6\xbd\x29\xcc\x19\xc9\x1a\x38\xcc\x93\x3a\x4d\xd3\x75\x34\x4a\x89\x7a\xeb\xd4\xe9\x41\xf9\x16\xe6\xa4\xab\xe9\xf5\xb9\xd7\xfa\x87\x80\x20\x54\x88\x31\x5f\x22\x07\xe7\xed\xf8\x7b\x73\x30\x8d\xc5\x3a\x63\x01\xfe\xe2\x89\x0b\xa2\x83\xdf\xb7\xf4\x16\xfa\x5e\x4e\xb4\xdb\x13\xc0\x9d\x31\xd6\xff\x02\x12\x10\x86\xca\xf8\x96\x37\x3d\x70\x97\x78\x3c\xc8\x3d\xf8\xdf\x89\x28\x4a\x7e\xb9\x61\x51\xba\xdf\x59\x5f\xd3\xee\xce\xd8\x8c\x8a\x87\x8a\x33\x09\x75\x24\xba\x77\x47\xe1\x2c\x54\xca\x69\xc9\xc8\x8c\xd5\xe8\x8f\x2f\x6d\xf3\x88\x7e\x79\xa3\x67\x70\x73\x18\x57\x45\xa0\x77\x64\xa5\xd5\x4a\xcb\xfb\xd4\x25\xeb\xc6\x1f\x4c\x94\x99\xfb\x09\x8d\x7f\x95\x30\xdc\xf7\xf6\xfc\x94\xc7\x3a\x6c\x91\x4b\x06\x4f\x94\x6f\x3a\x17\x4a\x47\xac\x71\x65\xa7\x66\x10\x55\xf6\xce\xad\x9b\x10\xd9\xfb\x6a\x9b\xcf\x68\xb7\x25\x47\x60\x1a\x15\x5e\x33\x9e\xfc\xea\x7e\xb7\x46\xf1\x0b\x78\x06\xea\xc7\xae\x37\x00\xc2\x82\xaf\xa1\xc2\x70\xad\xbd\xac\x16\x86\x13\x5f\x52\xd6\xf3\xd7\xc6\x0b\xb8\x90\x3d\x91\x74\x40\xf7\x52\xea\x27\x3e\x2f\x40\x34\xf9\xfc\x6f\xfb\x4d\x4f\x55\x85\xa4\x99\xe4\x6c\x4d\x7c\x00\xc4\xfd\xe8\xff\xe8\x6c\x54\xe1\xd4\x93\x48\x7e\x2b\xa1\x7b\xd1\x52\x28\x90\xc0\x35\xee\x47\xfc\xb6\xd5\xb2\xfe\x73\x9c\xc0\xde\xe3\xc7\x66\x43\xf0\x1d\x6c\x3d\xd3\xfe\x85\x1e\x10\x0d\xfb\xc7\x6c\xd4\x80\xe1\x2a\x60\x05\x65\x11\x14\x02\xa5\xa2\xb4\x81\x13\xf4\xd7\x45\xf5\xec\xc6\xda\x81\xd1\x51\xbf\xb4\xfc\x27\x3f\x24\xea\x9e\x7a\x5e\xb0\xbd\xf6\x57\x7d\x77\xfb\x1a\xf9\x53\xc1\xb4\x24\x41\x3a\x57\x44\xa2\x01\xcf\xd1\x55\x6c\x5f\x2c\x6c\xd5\xaf\xfa\x56\xb2\xde\xb7\x28\x71\x2b\x87\x71\xd9\x74\x23\xa3\xab\x41\xef\x29\xb4\x74\xe4\xc5\xa8\x70\xa6\xeb\xc3\x83\xbd\x8a\xc5\x92\x04\x05\xd7\xcc\x68\x95\xb0\x28\xd5\xfc\x0c\xaf\xe2\x43\x5e\x89\x8d\x70\x17\xbc\x59\x46\x37\x3f\x68\x38\x07\xb7\x71\xb0\x52\x55\x06\x95\x57\x70\x2b\xd4\xb9\x62\xc3\x6a\x5f\x69\x26\xb4\x36\x92\x2a\xc5\xf3\x37\xe8\x29\xa5\x64\x49\x4c\x45\x51\x41\xe7\x7f\x3c\xed\xda\xc4\xa8\x5b\x1d\x77\x52\x56\x4d\xb2\x67\xff\x53\xa5\xc7\xf8\x0f\xb7\x17\xa9\x1a\x53\x63\xa2\x49\xd3\xc8\x56\x77\x7b\x81\x63\xc8\xfe\xb9\xb7\xa9\x58\x95\x2a\xa0\xee\x43\x7c\xe9\x78\x2a\x0a\x6f\x7c\xda\x9a\x88\x90\xf9\x1e\x46\x5d\xcb\x3e\x1a\xae\x1b\xfd\xb7\x19\x94\xce\x6f\x01\x14\xb2\x46\x80\x87\x0d\x82\xd9\x70\x38\x64\x5f\x47\xdc\x0a\x97\xf0\x8f\xb2\x5e\xc5\xe1\xc8\x41\x6f\x48\xdc\xc3\xbd\xfc\xa9\xb7\xec\xb3\xd3\x6d\x2b\x4e\xd2\x71\xb2\x8c\x09\xca\xb6\x24\x96\x41\xe8\xeb\x3e\xb5\x8f\x37\x55\xa0\x80\xdb\xb4\x9c\x48\xc5\x88\x1c\x02\x81\xd9\xbb\x02\x21\xe9\x73\xd3\xbe\x6d\xa7\x9c\x25\x3b\x10\x8e\x25\x17\xf7\x89\x59\xe3\xce\x1f\xd6\x1f\xc7\xa7\xb6\xe5\x18\xd5\x66\x6f\x37\x0d\x61\xaf\x9b\xc5\xfd\xed\x26\xfa\x02\xeb\x6c\x18\x73\x81\x5c\x12\x0e\x2b\x3b\x9c\xf9\xb5\xb5\x27\x32\x8d\xb5\x2a\x82\x54\x65\x7b\x2a\x57\x76\xf8\xde\x67\x8e\x27\x16\x00\x2e\x97\x10\x4d\xf2\x97\x71\x29\x06\x67\x99\xc4\x7a\x62\x7f\xed\x7c\x5a\x73\xb9\x1a\x6c\x90\xe5\x6a\x58\x8d\xb8\x95\x42\xc3\xff\xe0\x85\xe5\x3c\x26\xdc\x57\x35\xec\x5f\x54\x04\xe2\x0b\x67\x1d\x54\x9d\x3b\x86\x72\xc8\xc2\x73\x06\x88\xbe\xae\xdc\x85\x38\xad\xe6\x46\xbd\x13\x0e\xb3\xbd\x2c\x5f\x6d\x8f\x19\x4a\xf7\xf8\x03\xda\xe1\x34\x51\xac\xb0\x9c\x53\x27\xf1\x91\x4e\x0d\xa1\xbb\x65\xb7\x75\x2d\x13\xe6\xa8\x03\xcd\x63\xda\x4e\xf2\xac\x1a\xc4\x7b\x1c\x35\x26\x2d\x5c\x70\x27\xcd\x06\x06\xfa\x86\x0a\x1e\x86\xe8\xee\x6e\x41\x46\x26\xba\x9f\x2f\x29\xff\xa3\x45\x60\xa3\xf5\xfa\xa2\x0a\xe9\x5e\x97\x8a\x56\xf1\x8f\x57\x17\x72\x32\xa2\x63\x3b\x47\x84\x95\x06\xb3\x0c\x66\x0a\x9f\x1a\x1a\x0d\xba\x10\x86\x7a\x30\x1f\xa3\x86\x42\x26\x7b\x6f\x66\xd2\xa9\xde\x51\x2c\x08\xdb\x04\x63\xfd\x2b\x56\x2f\xc1\xc2\xd2\x16\xcb\xb4\x9d\xa8\xa7\xf0\xe5\xfc\x63\x6e\xa1\x3a\x94\x7c\xe9\x89\x40\x81\xb6\x51\xaf\xae\x21\xb6\x23\xa6\x6a\x51\x2d\x58\x73\x22\x79\x88\x26\x6d\x3f\x17\x5d\xfa\xe6\x55\x37\x29\xc7\x13\x0e\xde\x01\x26\x21\xfe\x27\xc3\x48\xe7\xb4\xbd\x04\xd7\x73\xdb\xed\x21\xf0\xf8\xf5\xc2\xe2\xb3\x80\x39\x40\xe8\x54\x18\xaf\x34\x58\x37\x87\xf2\x96\xb9\xa5\xbc\x59\xf8\xfc\x81\xc8\x32\xa7\x12\xb0\x16\x7c\x97\x9c\xa0\xdc\x4d\x3e\x0a\xed\x13\x13\xa2\x94\xc2\xf0\x02\x60\x9c\xb4\xb9\xf1\xc4\x3f\x0b\x02\xb5\x0d\xf4\x61\x8a\x05\x71\xbf\x50\xc9\xcc\x78\xa6\xfb\x27\xe8\xab\xcf\x6b\x5f\x0d\x2a\x59\x02\xa9\x77\x7d\x00\x61\xb1\x24\xfe\x6b\x82\x5c\x94\xc0\x6d\x00\x8f\x51\xf9\x26\x18\x26\x1b\xe2\xc3\x54\xe2\x2d\xe3\xfb\x35\x05\xfc\x16\x5c\x9a\xaf\x7f\x10\xd3\x1b\x30\x57\xf2\x2b\x7b\x55\x30\x41\xad\x08\x43\xec\xc3\xd8\x64\xfb\x90\xc9\x46\x4c\x1a\xdd\x4c\x7c\x61\xcf\x54\xcf\x86\x6b\x5c\x95\x2e\x0e\x87\x31\x9e\x05\x51\xab\xcf\xe4\xda\x2f\x1e\x37\xbd\x75\xb3\x91\x23\x49\x47\xc9\x58\xe1\x14\x7d\xc6\x24\xf5\x7e\x48\x03\xf9\x98\xe4\x94\x7b\xc9\x86\xd3\x4b\xb2\x91\x48\xaf\x19\xa5\x9d\x98\xad\xce\xb0\x64\x6d\xa7\x68\x2b\xdd\xe3\x37\x40\x4c\xaa\xda\x35\x8f\x9e\x6a\xd3\x92\x79\x3d\xe7\x32\x4a\x9a\xb9\x6c\xec\xbf\x44\x1a\x2f\xdd\xa4\xb1\xca\xf3\xe1\x0e\x4a\xe9\x9a\x40\x3d\x8c\x97\xc6\x93\x23\xee\xd0\xae\x34\x9a\x45\xab\xc3\xa3\x55\x7d\x49\x97\x83\x82\x92\x4d\x84\x81\x85\x2f\xe6\xd2\xeb\x78\x71\xfc\x5c\xed\xaa\x8a\x81\xe2\x9d\xf9\xd0\xc9\xb9\x6f\xff\x38\x87\x65\x9b\x7b\x02\xca\xe2\x4f\x6b\xf8\x65\xb4\xb5\xdd\xf5\xc2\x57\x79\xbc\x7a\xfb\x24\x64\x7f\x61\xb5\x40\xbd\xda\xb5\xc1\xa2\xa6\xdf\x5d\x83\x6f\x48\x58\x38\xd2\x25\x04\x1b\x0b\x43\xda\xe7\x3c\x0d\x55\xa3\xf7\xa6\x40\x4f\x74\x50\x45\xe2\x28\xa5\x54\x8c\x10\x27\xa3\x82\x7f\xc8\xf6\x50\x3a\x94\xe9\xc2\x80\xe8\x64\x96\x65\x9d\xdd\x35\x00\x18\xe4\xad\x13\x38\x67\x7e\x52\x98\xb6\xc1\x30\x48\x5b\xf7\xd8\x8f\x67\xea\x5c\xa4\x81\xb3\xd7\x51\xbe\x7f\xe2\x09\xef\xf3\x11\xb0\xd4\x4b\xff\xfa\x23\x70\xcc\xf8\xdb\x77\x27\x30\x7d\x93\x01\x7c\xca\x34\x53\x25\x5f\xdb\x0b\xd8\xc8\x73\x86\xea\x69\xc0\x03\x8d\x03\x3e\x13\x23\x86\x19\xbd\xe7\xb8\x80\x31\x78\x10\x17\x60\x3a\x6c\x2a\x07\x38\x17\x3a\x88\xa9\x77\x76\x69\x10\x31\x9b\xfa\x1c\x75\xf3\x24\x0f\x19\xbb\x35\xd7\x32\xc7\x82\x76\x33\x84\x1a\x93\xae\x4a\xf1\x08\x90\xfa\x8b\xb8\xca\x68\x86\xc1\x36\xa3\xa3\x3b\xe0\xf6\x19\x74\x1b\xb9\x67\x12\xc1\xf0\x68\x7e\x32\x8f\x64\x53\x3b\xfc\x17\x9d\x89\x53\xa1\x29\xe4\x8d\xb3\x42\x40\xb2\x55\x77\x12\x16\x78\xd6\x65\xfc\xfb\x0d\x09\x91\xf6\x82\xf3\xcd\x49\x99\xba\xc7\xa6\xd1\xab\x52\xf2\x38\xf9\xfe\x6d\xfe\x8f\xc1\x01\xe7\x17\xaa\x36\x16\xd2\x8e\xa9\x83\x8f\xcf\x4f\x4a\xcf\x64\x9f\xe5\xe8\x39\xa9\x70\x14\x09\x63\x31\x2b\x67\xe4\xd1\xe5\x6c\x0c\x06\xe3\xc0\x11\x43\x6d\xd9\x1f\xdc\x6b\xdf\x08\xcf\x59\xfe\xc3\xbe\xf0\xbe\xd3\x36\x3d\x2a\x2d\xd2\x3d\xc5\xe8\x32\xd4\xa5\x0e\x11\x47\x4a\xfb\x72\x35\x88\x17\x81\xdc\x74\x3c\xf5\x73\x52\xc5\x32\xc3\xf9\x05\x71\x6c\x67\x58\xc5\x8b\x2c\xff\xe4\x42\x06\xb2\x68\x79\x4b\x12\x91\x7a\xec\xab\x35\x09\x8a\xa9\x21\x78\xaf\x0f\xd9\x79\x47\x7b\xab\xf3\x43\x4f\x43\x30\x33\x3d\xa0\xfc\x0a\xcc\x1b\x70\xeb\x0f\xc3\xc8\xbe\x12\xe3\x36\x5d\x49\xc6\x46\xb1\x83\x48\x00\x0f\x0d\xaa\x74\xd4\xed\x65\x18\x51\xfb\xe5\xb7\x62\x10\xe1\x84\xdb\x87\xc4\x8a\xab\xe6\x80\x29\xe8\x4e\x6e\xf7\x5c\x58\xf9\xe2\x9f\x3b\x35\x4e\x46\x57\x3d\x87\x0a\x59\xac\x6c\x72\x22\xae\xbd\xf4\x63\xef\x95\x0d\x95\xea\xef\x8f\x2b\xfe\x18\x44\x48\xe8\x1c\x9a\x18\xf0\x29\xf8\xef\x4f\x3c\xab\xbb\x50\xf0\x24\xda\x67\xc4\xfb\x69\x04\x1d\xf7\x3e\xb6\x43\x97\x55\x93\xef\x6e\x2a\x65\x37\x7c\x5c\x4c\x87\xd9\x01\xc2\x8e\xda\xd4\x2e\x3b\x1f\x61\xa0\xc9\xf4\x96\x46\xeb\xee\x64\x7a\xc1\xd5\x7e\x40\x17\x3c\x02\x76\x2a\x79\xb0\xf0\x2e\x5f\xa4\xea\xa4\x68\x34\x10\x93\x3d\x30\x11\x7d\xe2\x35\x5b\xcb\xe7\xd5\x23\xf6\x96\xa0\xad\xd5\xc6\x4d\x03\xd4\x3d\xd6\xfc\xe9\x1c\x39\x3e\xd7\x6a\x98\x94\x09\xa9\x39\x3f\x78\x71\x03\x4a\x46\x1a\xb3\x8d\xe9\x74\xec\x4b\xc7\x18\x6f\xad\xf3\x12\xc0\xe8\x59\xe3\x54\x16\x77\x89\x03\xe2\x08\x7d\xa7\x31\xa3\xef\x37\x3b\x99\xbd\xbb\x46\x77\xff\xfb\x4f\x1d\x04\xf2\x32\x84\x31\xdf\xb5\x64\xac\x74\x81\xf0\x0c\xde\xec\x2a\x0e\x26\x08\x8e\xf9\x5f\x65\x5d\xd6\xf1\xae\x10\xa8\xa0\x9b\xe1\x68\xbe\x71\xa9\x3b\x20\x7c\x0e\x91\x46\x82\x59\x0a\x19\x40\xaa\x43\x20\x96\x29\x6b\x30\x0f\xaf\xfb\x62\x2a\x8e\xf0\x76\xd4\xa0\x15\x45\x08\xe2\x89\x59\xf5\x9e\x3b\x9a\xb4\x77\xd2\xb1\x00\x20\x68\xa4\xce\x7c\x06\xd6\x2e\xef\x7f\x75\x24\x54\x29\xa0\xb7\x31\xbc\xc7\x4b\x0d\x56\xa9\x9c\xfe\xdf\x51\x1f\x62\xcc\x5a\xb4\xa1\xa5\xfc\xa1\x1c\x6e\xd5\x63\x59\x96\xdc\xb4\x9d\x7b\x06\x41\xd7\xf2\x9a\xa4\x5e\xb3\x6e\x41\x2a\x2a\xd3\x9e\x17\xa3\x86\x1b\xcf\xee\x15\x63\x40\xfd\x51\x8b\xa3\xa6\x16\x35\x31\x16\x8a\x0e\x4d\x2d\x46\x15\x77\x2a\x60\xae\x43\x46\xac\x77\x70\xbe\x99\xda\xff\x4e\x1d\x2e\xae\x87\x92\x94\x17\x21\xfa\x1b\xe3\x2c\x5f\xe4\x0a\xa4\x9b\x79\x1b\x3a\x9c\x9d\x29\x12\x99\xc1\x0c\xd1\x6a\x21\xef\x1d\xf9\x7b\x89\xca\x4b\x00\x00\xd2\xd2\xb9\xdb\xab\x1c\xaa\xb9\xb9\xe5\x84\x68\x7c\x70\xd7\x19\x60\x02\x13\x62\x00\x37\x87\x07\x39\x34\x78\x4f\xc3\x65\x04\x89\xa5\xc3\x67\xef\xb8\x36\xda\x68\x39\xa8\x0f\x73\x41\xbf\xbf\x79\x2a\x01\x50\x9e\x67\xd0\xca\x85\x93\x8c\xac\x05\x51\x65\xac\x50\x97\xe5\x55\x7a\xf0\xa9\x7d\xf3\x1d\x48\x29\xd6\x7d\x66\x1a\x5d\x79\x18\x1d\xa3\x80\xb2\x26\x19\x84\xb2\xe4\xbd\xf0\x68\x18\x97\x9f\xf1\xe2\xc0\x63\x20\x56\xc9\x0f\x69\x5c\x35\x4a\xa1\x9d\xc0\xa7\xa7\x07\xd8\x23\xd9\xec\xbc\x77\x4d\x65\x3a\xc3\x9f\xa5\xad\x05\xc5\x4e\x82\xa6\x0b\x83\x92\x86\xc7\xa1\xbf\x11\xe9\xf9\x0f\xc9\xab\x6b\xf6\x2b\x29\x0c\xe4\xba\x4a\xc9\xb8\xe7\x2a\xa5\x1a\x9f\xe0\x54\x65\x8c\x73\x7c\x1f\x0a\x7a\xb1\x80\x13\xf2\x03\x51\x8a\x8f\xac\xd5\x45\x09\x97\xb5\x71\xce\x78\x53\x26\x7d\x0a\xcc\xd7\xb8\x51\xd8\xc5\x01\x53\xad\xed\x11\x4d\x19\x9e\xfa\xc6\xe6\x40\x86\x1f\xb6\xb9\x1d\x04\x97\x21\x37\x0c\x17\xa8\xb5\x6d\x87\x6d\x6a\xbd\xd3\x17\x1b\x0d\x3a\x6b\x08\x71\x6a\xab\xd2\xa3\x39\xd3\xa2\x97\x71\x6c\x8d\xf7\x0a\x2d\x5b\xec\xb2\xd6\xe2\x1f\x23\xb3\xe1\x6b\x1c\xd2\xcc\x06\xa9\x13\x6a\x68\x48\xaa\xcb\x0c\xb5\x92\x65\x71\x95\x08\x9f\xa8\xd0\x25\xbd\x3d\x1f\x6e\x56\x13\xea\x9f\x99\xf9\x3b\xfb\x0c\xb5\x0e\xa7\xd6\x23\xe9\x5c\xc4\xaa\x9d\x5d\xd3\x58\x8f\x04\xd7\xa6\xc8\x72\x6c\x3f\x2e\xf2\x7e\x41\x9e\xef\x4e\x20\x68\x34\x28\x88\x8d\xb6\xf1\xf9\x88\x03\x59\x2e\x56\x39\xbb\x67\x1a\x36\x1b\xc2\x48\x10\xcf\x6e\x71\xfb\xb0\xec\x44\x94\x69\x05\xb5\x15\xb5\xfc\x98\x1f\x4a\xc2\xa8\xed\x49\x1c\x95\x1b\x8d\x20\x5b\x0f\xff\xf2\xba\xb6\x7c\x01\xfa\x54\x8a\x8d\x18\x30\x9f\xc0\x88\x8a\x42\x6d\x5d\x46\xfe\x4f\xfd\x91\xc8\x1a\x5d\x10\xa5\xc9\xf2\x87\x6e\x52\x65\xa0\x90\x61\x8f\xc0\x8d\xd2\x62\x08\xb8\x43\x17\x42\x48\x93\x15\x21\x20\xbb\x87\x97\x7e\xa4\x53\x38\x90\xb8\xb8\x14\x2b\x2d\x98\xd2\x21\xd5\x71\x0d\x82\xc3\x03\xf6\x32\xe0\x13\xa0\x1d\xd6\xd4\x11\x1f\xb1\x8f\x70\xa1\x7e\x8c\x5a\x04\xfd\xbb\x48\x6a\x35\x26\x73\xd1\xc2\x22\xbc\xca\x10\x99\xf3\x45\x0d\x82\x2b\x4f\xfc\x15\xea\xc3\x42\xe2\x18\x82\xe9\x31\x11\xaa\xce\x77\xfd\xfc\xc4\x74\x54\x42\xf3\x5c\xfe\x72\x39\x59\x2d\xb0\x58\x21\x83\xf4\x5e\xd1\x2c\x3c\x0a\x1c\x41\x9c\x36\x31\x8f\xcb\xa9\xdd\x64\x5b\x61\x5d\x65\x22\x7d\x24\x34\x2b\xe8\xff\x39\x79\xc6\x43\x94\xf0\xcc\xf0\xf1\xfb\xbf\x5a\xb3\xe4\xb8\x9c\xb2\xe9\x52\xc1\x96\xab\xf5\x10\x71\x9a\x67\x00\xa5\x6a\x9b\x01\x00\x84\x49\xf2\x43\x0b\x03\x62\xcb\xb4\x6e\x37\x7f\x72\x21\xdf\xde\xa9\x4b\xda\x09\xf6\x6c\x30\xba\x56\x49\x90\xac\xf0\x28\x6c\x51\xaf\x6d\x40\xd5\x8a\x41\xb2\x57\x3d\x7b\xf4\xf3\x07\x0e\x35\x96\x79\x68\x5e\x41\x37\x72\xcc\x9b\xd9\xa2\x18\x65\xa5\x92\x8b\x07\x3b\x8a\x53\x37\x1f\xfa\x80\x8c\x2c\xa3\x2d\xa7\xb5\x21\x4a\xef\xc0\x48\x92\xc9\x5f\x32\xf7\xa0\x45\x7c\x42\x12\x22\x2a\xa6\x49\x8c\x71\x3b\xae\xac\x8c\x36\x58\x66\x10\x73\x1b\x0b\x34\x8d\xc9\x81\x6e\x6f\x4d\x3e\x01\x20\x26\x17\x1f\x1f\xf2\xb9\x95\x3b\x4e\x96\x14\x3c\xab\xcb\x71\xa5\x6b\x2b\x79\xf1\x3f\xb4\x6d\x65\x3a\x19\x36\xe1\x15\x17\x0d\x39\x86\x16\xcd\x17\x59\xe7\xf5\x9d\x18\x2b\xdc\xd8\x6d\x04\x35\x59\x01\x3a\xad\xe0\xaf\xac\x11\x3b\x4d\x9d\xbe\xe9\x09\x28\xb9\xcb\x1b\x6a\xd4\xa3\x40\xbe\xc0\xef\x7f\xc4\x27\x98\x27\xd1\x55\x83\xec\x2a\xab\x28\x1e\x39\xb8\x9e\xb7\x7a\xe3\x3a\x0c\x80\x0e\xb1\xb1\x2f\xa9\xe4\x81\x97\xf0\xea\x0b\x2c\x58\x08\x91\xe6\xdf\x4d\xe2\x2d\x28\xcc\x07\x35\x2e\xe0\x77\x21\xe4\x73\xc6\x66\xee\x48\xe8\x96\x75\xb4\x1a\x38\x07\x16\xcd\x85\xb4\x52\x09\xa4\xc8\xc6\xa0\xfc\x13\x51\x81\x85\x60\xe1\x2b\x46\xd7\xee\x26\x33\xbf\x3f\xcb\xb5\x55\x22\xd4\x5a\x33\x7d\xbf\x29\x9e\x2a\x4b\xb4\x6c\x33\x62\xf1\xef\x87\xc5\x2b\xb6\x3b\x62\xa9\xa1\x7b\x68\xa9\x78\x24\x0c\x2d\x64\xf4\x54\x86\x3c\xb2\xe2\x42\x62\xe0\xbe\x22\x77\xf9\x7d\x3b\x20\xcb\x07\xe3\x09\x63\x14\xf3\xf9\x4a\x2d\xc1\xdb\x65\xc2\x83\xa8\x0b\x7c\x09\xee\x74\x82\x49\x1e\x76\xf8\xbc\x7f\xb1\x11\x17\xa0\xb2\xb8\x47\xc2\x0f\xfe\x3a\x90\xd4\x82\x83\xd8\xab\x76\x0a\x33\x4b\xb2\xbd\x19\x33\x4f\x5e\xea\x4c\xb2\x4c\x90\x3d\x41\x44\xe1\x46\xf5\xdb\xc1\x5c\x87\x44\xed\x13\x6e\x84\x62\x06\xe4\xda\xe2\xb3\x91\xe1\x0c\x43\xaf\x94\x53\x8a\x5c\x2d\x8b\xb2\xf3\x38\xce\xaf\x79\x29\x1b\xa5\x81\x8c\xce\xf0\x25\x2c\xe1\x28\xcc\x49\x9f\x7d\x5a\x8f\xb7\xe3\x49\x5f\x96\x55\xc8\x72\x5d\xb3\xa2\xbb\x8a\x8a\xe4\xd7\x33\x24\xa7\x49\x45\x05\x8d\x30\x23\x5d\xae\x8a\xd0\xce\x66\xd7\x40\x7d\x12\x90\x79\x02\x80\xee\xc0\x16\xee\x3f\xe9\xef\x86\x05\xbe\x43\x1f\x68\x88\x53\x66\xb8\x2e\xa7\xc5\x42\x7f\xbf\x28\x4b\xa7\x27\xdd\x73\x54\xe9\xd7\xef\x7e\x56\xb3\xce\x10\xc6\xff\x49\x8a\x89\xa0\x54\x37\x25\x0e\x8d\x26\x87\xd8\x00\x14\x14\x77\x7e\x45\x44\x73\x8a\x0c\x0e\x4c\x5f\x59\x10\x0b\x3f\x37\x1f\x05\x2e\x84\xa8\xca\xeb\x34\x58\xb6\x4e\x19\x9e\x8e\x51\x3f\x25\x9e\x14\xbf\x39\xbb\x01\x93\xdf\x2d\x1c\x05\x54\x65\x05\xd0\xb8\x6e\x89\x05\xd9\x01\x39\xf7\xba\x5a\x73\x4b\x2d\x47\xa1\xf7\x0f\x0e\x6c\xb3\x88\x7d\x86\x63\xe5\x20\x77\xff\x02\x2c\xa0\x3c\xc4\xb1\xc4\xe4\xc3\xf2\xa3\x53\x16\x52\xb5\x13\x3b\x43\xf7\x66\x0e\x1c\xe4\xc3\x38\xd3\x4e\x86\xc7\xc5\xb8\x9c\xaf\x80\x8d\x88\xfa\x12\x9b\x6c\xfd\x0b\x5f\xf2\x16\x23\x36\x9b\x51\x13\x25\x38\xfb\x3c\x7c\x84\xc9\xe3\xca\x76\xc5\x9b\xf8\x28\x31\x41\x7e\x80\xe5\x17\xe4\xa6\xfe\x24\x27\x62\xdd\xc3\x70\x8e\x40\xad\x51\x5c\xf2\x73\x35\x98\xee\x2b\x8c\xe0\xf4\x64\x90\x77\x93\xc0\xf1\x38\xff\xab\x24\x25\xa1\x01\xe3\x61\xc2\xda\x5d\xe6\xd9\xd9\x53\x1a\x54\x3d\xa9\xcf\xe8\x80\x1d\x84\x1b\xf1\x5b\xc9\xfe\x10\xc1\x57\xa1\x98\x17\x4a\x6b\xe5\x92\x90\x9c\x9c\xf6\x5e\x03\x27\xb4\x20\x54\x7c\xdc\x0d\xa0\x17\x36\x0e\xfd\xbd\x32\xef\xb9\x2b\x53\x88\x0d\xb1\x33\x88\x69\x34\xed\xee\xbf\xfc\x42\x7e\x51\x62\x2e\xd3\x24\x2a\x0d\x8e\xbe\x51\xb2\xe2\xe2\xeb\x8f\x2d\x25\xe9\xb3\x04\xab\x47\xfb\xd9\x5f\x00\xd3\xfb\xd0\x5d\x28\x55\xfa\xf2\x02\x4a\x83\x60\x04\xf7\xd4\x18\xf3\x4d\xfa\x64\x38\x90\x1a\x1c\x3e\x0e\x8e\xd5\x72\x73\xf0\xfd\x6e\x51\xc2\xa0\x3d\x87\x61\xd3\x2f\x16\xcd\xb9\xd0\x1d\x93\xbc\x29\x62\xc8\x44\x3c\x9d\x5a\x59\x88\x13\xb7\xdb\x5d\x6b\x68\xf1\x97\xff\x68\x7e\x59\x5f\x1c\xd9\xa8\x87\xf5\xe5\xe5\x04\x8b\xa8\x9d\x3b\x4c\xe7\x62\x40\xa8\xc5\x0f\x88\x90\xc7\x5c\x4f\x61\x58\x99\x07\x97\xa9\x11\xf5\x8e\x4c\x15\x91\x00\x43\xd5\x90\xcb\x61\xd2\xd1\x85\xe3\x3f\xfd\xc7\x4f\xa0\xe6\xe4\xa1\x61\xc7\xad\x35\xb2\xdd\x80\x9d\x6b\xc6\xcc\x86\x46\xd4\xe1\xbb\x0a\x84\xb8\x8d\xa9\x76\x4c\x70\xd2\xbf\xbe\xcb\x47\xfd\xe0\x04\xb1\x9e\xd1\xf3\x90\x87\x3c\x2c\xb4\x2c\x11\x7c\xc4\x4a\x91\x85\xec\x3e\x52\xac\xb5\xb4\xcb\x61\xda\x55\x8d\xbe\x40\xa7\x21\xd7\xc0\x2b\x88\xb6\x69\x8f\xbd\x17\xd1\x6d\x95\xb7\x47\x85\x3b\xed\x9e\x62\xc5\xaa\x4d\x2d\x34\xea\xef\x13\x4a\x48\x00\xc7\xf9\x51\x14\xb0\xdc\xcf\x03\x77\x94\x83\x16\xa3\xa2\x6b\x6e\x21\xa8\x98\x0f\x51\x4d\xb7\x36\x98\x6f\x0e\xd3\x42\x65\xb6\xb9\x7c\x3b\x84\xbf\x70\x66\x71\xf4\x68\x35\x5a\xd6\x16\x73\xdb\x92\xb0\xfe\x1d\x3c\x45\xa7\x9a\xa3\xaa\x15\x3f\xdf\x06\xe4\xdf\x5c\xfb\x6f\xf1\x70\x30\x2c\xf7\x53\xc6\x9a\x22\xc4\xf1\x67\x40\xce\x52\x73\x63\xd4\xdc\xa4\x50\x5c\xf1\x57\x92\xfb\x27\x61\xdc\x14\xdb\xe5\xbd\x7c\x79\xcb\xd8\xe2\x3e\xc5\x8f\x90\xe5\x2e\x58\xf9\xe8\xd8\x0c\x1a\xfd\x99\x08\xb5\xe3\xce\xac\x62\xef\xeb\x43\xe2\x83\xd3\xda\x68\x78\x9a\x33\xe3\xcc\xf9\x7e\xe9\x08\x27\x09\x13\x58\xfc\x78\xf0\xda\xb3\x09\x2b\xd8\x1d\xb2\x23\x6d\x59\x5d\xba\x55\xc2\x7b\x2d\xfc\xac\x8e\x0e\xaa\xf6\x6f\x10\xe0\x46\xe6\x2e\xb2\x8e\x87\xea\x36\x3c\x43\x63\x1a\x10\xd1\xe0\xaa\x82\x05\xfa\xfe\x54\x86\xc5\x26\x7f\xc5\xc4\xfc\xf2\x53\x96\x3e\x1c\x41\x43\x9a\x51\x0b\x87\x3e\x41\x23\x02\x78\x91\xfb\x6c\x93\xa1\x4f\x8b\xac\xe3\xfa\x63\x31\x8e\x3a\xd1\xa5\x32\x57\xbb\xb4\xbd\xf9\x5e\x70\xda\x02\x3d\x64\x7d\x73\x29\x89\x28\x04\x86\x16\x2a\xbd\xc8\xfe\xe1\x02\x8b\xfa\xbe\x16\xd6\x34\x6a\x86\x9f\x10\x4f\x76\x1a\x27\xc5\x01\xf5\xca\x0e\x42\x3d\x35\xbb\x1a\x02\x9d\x56\xf8\x18\x8f\x62\x0d\xc8\xe0\xe5\xf7\x5e\xa2\x70\x2d\x29\xd2\xa8\x6d\xed\xd5\xec\x11\x06\x75\x19\x2f\xd9\x28\x4b\x7a\x08\x4e\xce\x5b\xcb\x0b\xcf\xd0\x67\x24\x8c\x7a\x68\xc7\xc1\xd3\xf7\x2d\x77\x51\x4d\xfe\x4c\x89\x39\xcc\xf3\xfd\x10\xa2\x58\xa9\xae\x67\x82\x25\x57\x95\x53\xc8\xf5\xfc\x08\xf5\x27\x0f\xb9\x04\x1f\x6b\x06\xce\x93\xa2\xc0\x82\x9d\xd0\xf5\x19\x32\xa9\xcb\x45\xf5\x0a\x5c\xa6\xa3\xe8\xbe\x02\xc9\x09\xd2\x09\xb9\xce\x13\xdb\xc6\xdb\x9b\x4a\xa2\x34\x62\x7e\xb5\x08\xb3\x8b\x20\xc6\x09\x5a\xbb\xda\xdf\x6b\xf5\x0c\x35\x38\xa2\x72\xd4\xd8\x7f\xb0\xc8\x0c\x27\x77\xad\x41\xdf\x1f\xe8\xb3\x2e\x28\x8a\x81\xdf\xb2\xfc\x18\xe6\x2c\x83\x7c\x6b\xa2\x5e\x71\xec\xdd\xd3\x4f\x90\xc7\xf0\xc9\x16\x78\xe8\x7b\x13\xaa\xac\x26\x92\xe5\xbf\x67\x8f\xd6\x70\xd1\x4d\xa4\x33\x15\xfa\x98\x55\xe8\x07\x02\xd4\xbd\x15\x4d\xff\x15\xc1\x00\x5d\x0e\x14\xcf\xcf\x6d\x7f\x43\xa3\x9d\xc3\x2a\x2f\x4b\x98\x0e\x1b\x5d\xa4\x68\x2a\x9d\xc7\x9a\xac\xb5\xc5\x33\xc4\xc9\xeb\x43\x38\x71\x94\xcc\x48\xe2\x1f\x09\xf2\x9c\x50\xd7\xc5\x09\xdd\xef\xc8\x00\x07\x29\x06\xac\xfd\x80\x5b\x64\x00\x65\x35\xfc\xf3\xa7\x71\x8e\x58\x49\x3a\xe5\x14\xe0\x46\xeb\xdb\x7b\x75\x0a\xa7\xd9\x2e\xca\x9c\xfd\x54\xfb\x29\xaa\x90\xab\x41\xb6\xed\x59\xee\x69\xcd\x33\x46\x5b\x7f\xf3\xe4\x41\x77\xbd\xaa\x14\x0b\x54\x6a\xbd\xe2\x03\xb3\xd6\x0f\x6d\x6b\xeb\xb8\x92\x4c\x15\x5c\xe9\x46\xc3\x35\x4e\x18\x8b\xd2\x48\x52\x80\x97\xb3\xb2\x01\x11\x45\x54\xd5\x5d\xc1\x71\x4a\xe7\x0b\x31\x9d\x0e\xc1\xbc\x11\xd4\x02\x7b\xf2\xb6\xec\x4f\x6e\xbe\xef\x84\xb7\xdd\xa3\xcd\x89\x1e\x6d\x97\x28\x99\x2d\xe9\x63\x47\xbf\xe3\xde\x40\xdd\x58\x2e\x88\x1b\x52\xb5\xc8\x83\x1c\x23\xe3\x34\xd4\x8e\x50\xf0\xc6\xf1\xb5\x43\xf6\x3f\x45\x12\x1e\xf2\x72\xf4\x37\xd1\x05\xc7\x8b\x8e\x47\xdc\x62\x74\x6e\x3a\xe3\x76\x34\x26\x0f\xa7\x7b\xd9\xe1\xf4\x89\x56\x65\x82\x64\x2e\xaf\x0c\xbf\xe0\xd3\xb2\x10\xd0\xa6\xfa\x5a\x78\xba\xe7\x25\xa2\xb3\x89\xdf\xa2\xd1\x40\xca\x7d\xc4\x68\x89\x90\x08\xbf\x2e\x23\xd1\x11\xa0\x1e\x96\xcd\xbf\x1d\x84\x59\xee\x8d\xe0\xfd\x3c\x47\xfc\x98\x88\x41\xf4\x70\x4f\xe5\x5a\x32\x5f\xe7\xa0\x78\x65\x9a\x4a\xe6\xfb\x80\xb3\x3e\xb8\x10\x65\x93\xa6\xb1\x6d\xfc\x10\x41\x6f\x12\xa0\xf6\x89\x76\x9c\x79\xda\x87\x72\x5e\x1c\x5c\xa0\x2f\x73\x36\x0b\x7b\xbc\x17\x86\xc4\x91\xb8\x3b\x28\xee\x34\x0d\x92\xf8\xe8\xd0\xeb\x3e\x00\xf2\x8c\x7c\x09\xb3\x20\x29\x5a\x2c\xf8\xb4\x81\x57\xa9\xbb\x9a\x49\x0f\x91\x05\xd8\x3e\xd3\x20\xae\x70\x38\xf8\xe9\x62\x66\x79\x64\x3a\x66\x79\x96\xad\xce\x24\x9a\x3e\x5b\x65\xef\x4c\x1a\x92\xd3\x15\x4e\x77\xfb\x79\xe0\xe0\x2c\xb1\xff\x8a\x27\x07\x04\x0e\x88\x02\xaa\xf7\xf5\xa6\x97\x97\xfd\x2f\x66\xc2\xb8\x17\x0b\xe9\x0f\xa6\xee\xba\xb6\x54\x83\xb3\x91\xcb\x46\x7c\xd4\x88\x9d\xf1\xcc\xb9\x3c\x52\xf5\xbe\x0e\x0d\x93\x7d\xfb\x08\x7f\xd2\xe3\x66\x6b\xb8\x1e\x50\x82\x45\x3c\xe8\xe7\xc6\x72\xb1\xc6\x8b\x05\xe2\x72\xa7\xd9\x95\x76\xb3\xac\x3d\xdd\x07\x6b\x83\xa8\x87\x52\x37\x92\x36\xd2\x72\xe2\x7f\x87\x9a\xc8\xaa\xfb\x66\x22\x8b\x65\x9d\x6a\xfa\x89\x6f\x9b\x79\xc3\xce\xcf\x15\x1b\x76\xff\xee\x54\xc6\x93\xb7\xdd\xfe\xb3\x71\x8b\x6d\x3f\x67\x85\x1e\xda\x44\x2e\xd8\x6d\xdb\xc6\x16\x5a\x2d\x2e\xcd\xdd\xf7\xfa\x8e\x56\xab\xf1\x6a\xb9\x2b\x5b\xbf\x3e\x32\x72\xf4\xf1\x69\xe6\xe5\x27\xb0\x15\xf6\x06\x5e\x25\x12\x8e\x24\x5c\x36\x93\xbe\x40\xd7\xfd\x5d\x4b\xa7\x1a\x4b\xde\x6b\x84\x75\x3b\xa9\xe8\x81\x3e\xe9\xf3\x15\x7b\x90\x74\xe5\x9e\xbc\xd5\xbe\x76\xbd\xfa\x8d\x71\x39\x48\x4c\xad\x01\x89\xa4\x21\xfa\x13\xa8\x0e\xe7\xbc\xa5\xcd\x7d\x8b\x95\xc1\xa9\x3e\xb2\xba\x9e\xcc\xfa\x21\xa5\xd0\x25\xd4\x47\x49\x6e\xad\x65\x09\x26\x25\x5c\x6b\x1b\xef\x62\x1a\x56\x43\x4e\x80\xde\xa5\xc4\x64\x70\x45\x36\xe2\x52\xe0\x38\x9a\x7c\xb5\xb7\xe7\xe1\xbf\xa7\x63\xf4\x16\x31\xde\xfd\x9a\x96\x8a\x6c\x7a\x18\x86\x5d\xda\x15\x35\xd5\x18\xa6\x83\x49\x42\x8f\x5c\xc5\x9a\xe3\x7e\x36\xa8\x78\x8a\x24\x44\x29\xea\x14\x08\x34\xc1\xe1\x62\xa8\x7e\x44\xdd\x52\x71\x56\xa5\x65\x43\xb6\x9c\x22\xe0\x96\x80\xa9\xdd\x90\x97\xb3\xc8\x79\xad\x12\xa0\xe4\x10\xdc\xa6\x37\xd6\x15\xbc\x1e\xcc\x39\x94\xe8\xd3\xb2\xb4\xb6\x39\x0f\x0b\x8b\x84\x59\x00\x83\xe4\xc1\x1a\x02\x1f\xb8\xcd\xfe\x4e\x83\xdd\x9b\x39\xe6\x8a\xcb\x92\x27\x5b\xbc\x5e\x69\xe4\xe5\x35\x2a\xf7\xee\x88\xf6\xc4\xaf\xc8\x30\x21\x29\xca\x4d\xc5\x12\xcb\x65\xbb\x90\x5b\xb0\x4f\x66\x9a\x32\xf7\xf7\x39\xcf\x3e\x5d\x12\x4b\xa3\xe7\x8b\xce\x8b\x4d\x1b\x52\xe4\x59\x5f\x39\x95\xd3\x5c\x4f\xba\x86\x00\x20\x08\x96\xc8\xe9\xdf\xcf\x5d\xcc\x02\x29\x91\x01\xf4\xd8\x94\x1a\xb2\xc6\x84\x97\x92\xdd\x45\x37\x8e\xd2\x10\x59\x35\x06\xe0\x0f\x60\x7f\xcf\xf0\x47\x91\x8f\x0c\x96\x61\x4e\xee\x1f\x6a\x05\xea\xee\x26\x53\x16\x67\x9c\xda\x08\xdf\xa7\x68\xd9\x53\xea\xc3\x52\xd9\x4e\x18\xc6\x60\xa8\x19\x38\x21\x8b\x14\xfc\x9a\x0a\x8f\x21\x3c\x96\xa3\xe1\x42\x3f\x83\xfd\x88\xf2\x92\x1a\x5f\xb6\x6f\xb4\x36\xa1\x2f\xa6\x67\x7b\x21\xf8\xab\x98\x90\xe6\x25\x26\x7c\xef\xaa\x30\xff\xe0\x41\xfc\xc5\x8a\xbb\xad\xd7\xbe\x90\xb6\x9c\x61\x2e\x09\x78\xe7\xa1\xdd\x85\xa2\xde\xae\x68\x11\x90\x08\x4c\x37\x54\xcb\xdd\x4e\x69\x3b\x41\x52\xa2\xe9\xed\x7b\x68\x63\x8a\x34\xc5\x44\xf9\xc9\x48\x6a\xad\x0f\x90\x63\xaa\xa4\xf4\xa6\x59\xba\x79\xab\x94\x14\xbb\xbf\x55\xae\x77\x45\x03\x7f\xb2\x8f\xc5\x98\xeb\xd1\xd7\x83\xbd\x5a\x0e\x15\x55\x19\xa6\x9f\x0f\x96\x2f\xb2\x6f\xf3\x53\xfd\x93\x79\x8d\x3d\x4a\xe0\x99\x2f\xe0\xb6\xe3\x92\x7f\x17\x04\x09\xde\x92\x8c\xfe\x4d\xa4\x55\xde\x2d\x5d\xb4\xea\xad\x59\x4d\x2d\x4a\x29\x5a\x74\xb5\x3b\x6b\xd3\x08\xfa\xdb\xe5\x78\xc2\xa1\x69\x59\x90\xd0\x32\x9a\xc3\x5c\x84\xf0\xcd\x39\xf1\x97\x8c\xda\xca\xf1\xea\x18\x8c\xdb\xcc\x02\xa9\x63\xfa\xb1\xaf\x66\xfa\x9f\x3b\x73\x44\x47\xc2\x68\x79\xf4\x4d\x2b\xac\x38\x12\x3d\xbb\x44\x10\x0b\x40\xc7\x8a\x16\x5d\x7b\x16\x28\x99\x9c\xd2\x86\xb2\x0d\x96\x88\xad\x65\xce\x97\x97\x53\x6a\x98\xef\x90\xf1\x2c\x52\x3b\x8f\xbb\xa0\x93\xaa\xe3\x9b\x3f\x0c\x35\x21\x73\x03\x42\xb2\x93\x0d\xf8\xa8\x41\x67\xd7\x46\x03\x4f\x97\xf3\x7b\xc2\xf8\x64\xe8\x08\x00\x5c\x88\x53\xe0\x97\xf2\xe3\xef\xe9\xa5\x5c\x0f\x5b\xa8\xe7\x59\xc6\x16\x43\xc9\x42\xb6\x7f\x64\xc8\xeb\x14\x9d\x8c\x50\xc2\xf4\x2d\x58\x23\xe1\xad\xbb\x47\x64\xda\xd9\xdd\x04\xfc\xc3\xa9\xb7\xd8\x1b\x22\xf5\x1f\xfc\x5b\x18\xca\x44\xe5\x80\xf6\x4a\x89\x5d\xf7\x62\xba\xbd\x77\xe5\x7d\x40\xb2\x16\xb0\x03\x8f\x39\x5f\x46\x42\x31\xc9\x1c\x5e\x1a\x1c\x3a\x6e\xdd\xa1\x11\x5d\x25\xed\x2f\x98\x13\x6c\xb7\x62\x30\x51\xa1\xb6\x32\xad\x17\x39\x27\x0b\x74\x42\xb7\xfa\xa4\x85\x67\xbb\x66\xd4\xcf\x97\x59\x41\x9f\xea\xf1\xe5\x75\x7e\x53\x18\x08\x18\x4e\x12\x96\x72\xb9\x5c\x0a\x23\x9b\x2c\x02\x00\x89\xa7\x15\x8f\x73\x95\x13\x5e\xcd\x88\xfb\xec\xe1\xb1\x74\x24\xa6\xa8\xc2\x4a\x3f\x73\xaa\x49\x8e\x1b\xe2\x63\x84\x40\x2d\x5a\x7c\x8a\x6c\xfd\x2f\x4a\x9b\x32\x12\xb1\xdf\x68\xad\x62\x24\x25\xe0\x22\x04\x8a\x38\x45\x9b\x0e\x14\xae\x2a\xac\x70\xa4\x5f\x7b\x59\x23\xba\xc6\x01\xd3\xdd\x06\x4c\xf1\xdd\xd9\x82\xab\x3f\xa8\x0d\x5b\x0e\x66\x40\xc7\xb6\xe1\x0a\x55\x8c\x8a\xe7\x4c\x5c\x4d\x38\xa6\x64\x69\x9e\xfa\x0e\x80\xbf\xcd\x80\x16\x22\xca\xcd\xc7\xd5\xa9\x7d\xcf\xfb\x26\xc9\x43\x79\x89\x3f\x6f\x4f\x2c\xfc\xe0\x11\x36\x00\x4c\x10\xa8\x4e\x14\x1e\x3b\x11\x10\x28\x95\xc4\x05\x4f\x79\xff\xf9\x30\xe2\x82\x0b\xf5\x42\x72\xa8\xc7\x92\xd1\x5b\x74\xe0\x3c\xfd\x69\x22\xe0\xc0\x5e\xf2\xed\xec\x4a\x14\x07\x7f\xe0\xe8\x99\x49\x16\x92\x20\xc8\x5c\x49\xe3\x8d\x9a\xc4\xb0\x19\xc9\xa6\xbd\xc5\x59\xb5\xfe\x89\xb6\x61\x77\xd8\x8c\xe3\xb7\xab\x89\x53\xc1\x5f\xc6\x73\x56\xaa\x78\x77\xc6\x37\xcb\x7f\x07\xb5\xa6\xd6\xcf\x4c\x55\x97\xaa\x65\xa3\xda\x55\x75\x89\x23\x48\x07\xc4\x7a\xca\xa4\x89\x24\xb4\xfa\xfa\x0b\x5f\xa2\xd5\x48\x72\xeb\xa9\x00\x2e\x42\x6b\x66\x31\x49\x24\x62\xa6\xa1\x62\x77\xc1\x43\x07\xe7\xa4\xa4\xa0\x48\xcf\x00\xc4\x3d\xfd\xb6\x0c\xea\xeb\xdf\xfe\x31\xb7\xcd\x31\x0a\xfd\xde\xba\x46\xc2\x3d\x7a\x36\x90\x8e\x6f\xbd\xd1\xc4\x0a\x40\x43\x59\x24\x0d\x39\x79\xde\x55\xe1\x1d\xde\xd1\x5b\x56\xae\x5f\x75\x6e\x94\x75\xfc\xef\x85\x45\xb3\xc5\x40\x81\xb6\xb9\x56\x59\x50\xa6\x37\xf3\x02\xdf\xb6\x29\x8a\x01\xad\x48\xad\x47\xd4\x60\x03\xe2\x97\x85\x9b\xf8\x05\x8a\x4e\x3c\x3a\xeb\xa7\x29\x13\xc9\x16\x16\x9d\x7c\xd2\x40\x65\x12\xe4\x32\x5e\xac\xeb\x03\xcd\xa3\x54\x82\xfd\x6d\x37\x1b\xa6\x98\x6e\x8c\xf9\xd6\x58\x15\xca\x74\x26\x0f\xb0\x8a\x90\x26\xe4\x09\xa3\x26\xa3\x20\x21\x30\x8b\xfe\xb5\x4b\x88\x62\xab\xd4\xe5\xef\x6a\x6f\x5c\xf4\x92\x87\xb2\x3d\xd6\xbb\x9b\xc6\x64\x56\x51\x2b\x32\xef\x20\x57\xa5\x8c\xd3\x30\xd0\x9f\xe2\x32\x48\xcc\xfc\x12\x07\xb4\x6e\xb9\x6a\x2f\xdd\xcc\x36\x3a\xa5\xb5\x26\xc4\xcb\xcb\x3c\x96\x44\xe4\xa7\x2c\xcd\xb6\x51\x43\x0f\xe4\xd1\xf9\x90\x47\xc7\x03\x98\xd0\x35\x0e\x3c\x17\x75\xd5\xae\x73\x37\xc0\x5e\x82\x55\x51\x60\x54\xda\xe5\x06\x15\xfe\x00\xb2\xab\x45\x1c\xf1\xfc\x46\x07\x27\x56\xcb\x25\x44\xa7\xeb\xe5\x31\x68\xc9\x7a\x8c\xf6\xff\x0c\x36\x51\x6d\x78\x5b\xcf\x6d\x1f\xab\x77\x80\x49\x3c\x49\x9c\x09\x89\xb5\x24\x5c\xcd\x0f\x01\x42\xf2\x1b\xaa\xad\xc1\x26\x5e\x0b\x02\xb2\x68\x0f\xce\x84\x38\x73\x6d\xae\xc6\x20\xe3\xd1\x70\x5f\x88\x7d\x7e\x64\x0a\xa4\x57\xa6\xa6\x28\x71\x54\x6d\x0e\xe2\x74\x8f\xbb\xfe\xe4\x68\xac\xf6\xd2\xc6\x88\x7c\x0a\xa1\x00\x40\x83\xbe\xfe\xe8\xe2\xd1\x68\xc9\xb5\xae\x30\x91\x8a\xdf\x59\x36\xdd\xa6\xc4\x4d\xb3\x25\xf2\x9f\xec\xa0\xd4\xe9\x9b\xb3\x25\xb9\xb2\x22\xef\xff\xd8\x4e\x0f\x2c\x5e\xb9\x6d\x1e\xfa\xe4\xda\x19\x2b\xd8\x2a\xf9\x77\x82\xf5\x05\xca\xf9\x4e\xa9\x0c\xbf\x75\xe5\xc6\xbc\xeb\x90\x8e\x01\x18\xca\xc1\xab\x2b\xb5\x66\xe0\xd6\xfd\x74\x87\x89\x82\x7d\x70\x9c\x73\x15\x52\x32\xd4\x98\x66\x06\x07\xe2\x4c\xff\x81\x3d\x55\x79\xe7\x32\xf8\xe5\x84\x3d\x5e\x76\x41\xa7\x2e\x15\x60\x30\xd8\x17\xa2\x7b\x47\xfa\x80\x66\x62\x6c\xaa\x98\xb2\xdb\x39\x39\x0c\x8a\xc6\x31\x66\xa3\x9b\x88\x09\x54\x33\x40\x0a\x0f\x93\xc1\xc1\xc3\xb3\x15\x3f\xaf\xa5\x65\xdc\x99\x1e\x73\xe6\x3a\x8c\x5d\x4d\xe7\xba\x65\x74\x2c\x97\x96\x02\x2a\x96\x41\x17\x9f\x97\x99\xc2\xfc\xe8\xfc\x02\x63\xd2\xa8\xf7\x00\x1c\x75\xb1\x3e\x4f\x27\xa3\x2a\xa9\x38\xbb\xb3\x9e\x41\x22\xaf\xb8\x8b\x5b\x3d\xed\xcc\x4a\x88\xf5\x8d\x43\x2a\xd5\x56\x33\xec\xbe\x90\x4a\x24\xae\x03\x6b\xc2\x87\x4c\x13\x82\x97\xb6\x3a\xaa\x25\xee\xe3\x73\xa0\xc5\x0b\x1a\x41\x9f\xef\x9d\xa1\x81\xb9\x65\x4c\x29\x8b\xe3\xcb\x22\x7f\xee\xfc\x22\x9f\x25\x50\x7b\x8c\x51\x87\x8d\x5e\x42\xa0\x57\x0b\xdd\xe5\x9a\x86\x0d\xd7\x18\x4c\x90\x67\x14\xaf\x7f\x5b\xe0\x5a\x80\x35\x80\x3f\xf3\xd0\x5c\xe1\xeb\x0a\xd6\x10\x46\x75\x99\xef\x3e\x23\x24\xca\x76\x08\xd0\x26\x30\xaf\x91\x25\x97\x19\x19\x50\xbc\xd2\x6a\x3d\x26\x6c\x87\xdb\x33\x72\x0b\xa0\xe3\x5a\x85\x22\xef\x92\xcf\xad\x26\x39\xef\x23\x78\x17\xe4\x2e\xc5\xc0\x67\x8f\x9e\x38\x38\x01\xd3\xd3\xbe\xa2\x6a\x96\x10\xe9\x31\xeb\x82\x90\x21\xbc\xa3\x7c\xee\x5e\xfb\x4b\x02\x82\xc2\xdc\xcb\x88\xe0\xe2\x4f\xb5\xf3\x49\xbe\xd9\xfc\x5a\x95\xc9\xc9\x3b\x09\xb3\xc0\xbd\xad\xb3\x89\xc7\x30\x6e\x64\xfc\x58\x8f\xc4\x5b\x36\x07\x52\x74\x48\x02\x83\xee\x12\xdf\x71\xd3\x58\xc2\xdb\x6f\x45\xe8\x1d\x76\xeb\x53\xb0\xbe\xdd\xae\x3c\x98\x4f\x08\x5a\xf6\xb1\xc0\x3a\xf4\x2d\x34\x8f\x4e\x9b\xd9\xcb\x83\x09\xd2\x33\x9b\x28\xed\x11\x72\x86\xca\xaa\x2f\x42\xa6\xa1\xfa\x83\x9c\xe9\xfe\x21\x1f\x5d\x21\x00\x01\x14\xc4\xe8\x16\xf8\x31\x00\x25\x00\x05\xa5\x9f\x57\x60\xa8\x42\xf5\xc9\xba\x71\x42\x7a\x3b\xaa\x9b\x5c\x5d\x27\xc3\x53\x7f\x7f\xbf\x98\xd9\xcd\xf5\xe8\x2d\x7f\xd0\x41\xb5\xd7\xcc\x9f\xcb\x69\xd7\xf0\x4b\x44\xb1\xfb\x95\x5b\x73\x46\x79\x14\x8c\xf2\x4f\xf5\xf4\x34\x03\x47\x82\x60\xb7\x5c\xc8\x14\x47\x8d\xc5\xb5\x33\x9a\xba\x7b\x23\xe8\x96\x05\x1e\x6b\xa6\xef\x53\x9f\x31\xd4\x3c\x79\x88\x24\x12\xb8\xc4\x29\x4f\x3d\x66\xe9\x87\x31\x86\x3a\x4f\xf2\xf7\xa1\x35\xe1\x81\x5e\x53\x6c\x2c\x41\x49\xf9\x32\x71\xf8\xb2\xe2\xa6\x8b\x59\x7a\x14\x56\xb7\x83\x32\x74\x31\xb7\xca\x96\xc6\xea\xee\x58\x37\xe3\x2d\x26\xcb\xd2\xcb\x4b\x40\x38\x7d\x99\x24\xf7\x31\x6d\x4c\x0e\xa5\x01\xec\x69\xfb\xf7\x8c\xd6\x2e\x76\x23\x6e\x29\xd6\x82\xc2\x36\xc1\x4b\x8e\x3a\xce\x26\x09\x41\x4d\x26\x4e\xd8\x8f\x20\x0d\xcd\x3f\xb2\x1f\xa3\x42\x5a\xcb\x0b\x4f\xcb\x06\xa1\xcc\x09\xc8\xd1\x4d\x90\x73\x16\x9c\x06\xd9\x39\xd5\xd8\x2b\xe9\x72\xb1\x18\xe3\x8f\xf0\xcb\xa6\xf2\x48\x91\xa4\xe4\x4c\xaa\xec\x30\x52\x22\xdd\x30\x9c\x8b\x4e\x0d\x1d\xd6\xb1\x00\xfe\xc7\xec\xf5\x01\x36\x1b\xe2\xbc\xe4\x6c\x13\x32\xf5\x57\xbc\x84\x87\x0a\x3d\xc4\x5e\xb1\xc1\x85\x56\x9d\x82\x8c\x27\x54\xce\xf6\x2f\xc5\x9a\xd6\x49\x8f\x17\x81\x22\x5c\x0d\x07\xac\x23\xb4\x30\x6e\x64\x19\x51\xf4\xdb\x08\xd6\x05\x2d\x72\x5e\x1d\x66\xdc\x44\x40\xb4\x20\x53\x6e\x65\xd8\x7c\x97\x3f\x49\x16\x11\xb4\x5e\x4d\x75\xb4\x1e\xc9\xe1\x25\x0b\x98\xf2\x6b\xb7\x2a\xaf\x96\x38\x43\x61\x4f\x48\x53\x2e\x29\x52\x71\x34\xba\x6f\xf6\xc4\x0d\x07\x26\xd2\xbb\xcf\xb7\x84\x27\x6e\xd5\xbb\x88\x69\x88\xae\xd3\x4f\x6b\x44\x1b\x54\x76\x1a\xd7\x1f\xcf\x55\xd1\x61\x24\xe2\xab\x58\xcd\x12\x79\xf0\x8e\xd8\xc7\x8f\xe4\xb8\xc7\xd1\x58\xe0\x1a\x35\x98\x98\xce\x03\x0e\x38\xdf\xdd\x1d\x85\xb4\xbf\xd8\x91\x5f\x6f\x1d\xb5\x34\xac\x9e\x3f\x33\x09\xd6\xe1\xfc\x73\xa0\xd4\xd2\xb6\x15\x21\x44\xed\x09\x71\xb2\x1c\x1d\xe6\xaa\x55\xed\xd9\x44\xff\x24\xc3\x6c\x57\x20\xeb\x30\x80\xe1\x31\xb5\x5a\xab\x3d\xef\xa3\x2e\xe1\x88\xde\x7d\x59\xe0\xee\xca\xda\x9b\x7d\xe3\xb2\xde\x6d\x84\x93\xd6\x69\xe4\x7e\x61\x5e\xdc\x3f\xaa\x3b\x59\x1c\xc6\x56\xf0\x65\x31\xc9\xfd\x8e\x9f\xe6\xfc\xe4\xe0\x3b\x50\xba\xbc\x9d\x03\x6c\x39\x35\x4b\x11\xd6\xb1\xcd\xac\x8f\x2c\xd0\x1e\x04\x30\xbe\x00\xfd\xc6\xa2\x7d\x98\x4c\xe6\xa3\xdb\x83\xf0\x5c\x9e\x58\x90\xe3\x2c\xc4\x53\x6f\xad\xeb\xdf\xdd\x1b\x49\x39\x22\x4b\x81\xf7\xb3\x53\xcd\x2c\xab\x2e\x04\x3e\xc0\x32\x14\x2f\x01\x56\x91\xc2\x2e\x54\x3e\xf3\xda\x84\xfa\x07\x61\x41\xba\x12\x2e\x1c\xba\x2b\x06\xa2\x96\x12\x34\x48\xc3\x23\xc1\x74\x41\x08\x04\x36\x6e\xc4\x71\x88\x2b\x84\x90\x28\x51\xc1\x17\xf6\x51\xed\x0e\x38\xb4\x0d\x86\xb1\xb3\x79\xfc\x35\x4d\x16\x55\x59\xdc\x43\xed\xa0\xe4\xe4\x37\x24\x8a\x4e\x7b\x9c\xd6\x5a\x4c\x1b\xd4\xb1\x49\x5a\x3b\x24\xf3\x16\x16\x54\x5a\xe7\x21\xbb\xa1\x21\x47\x2b\x46\x78\x02\x38\xde\x7c\x78\xd7\x7b\xf4\x9b\xa6\x0a\x53\x08\xb6\xaf\xf0\x50\x5a\x1c\xab\xfd\xf9\xec\x5e\x0c\xbe\xac\xad\xb8\x52\xb0\x2b\x13\x75\xd5\x32\xb3\xf7\x2b\xa8\x56\x43\x58\x99\xe0\xaa\x5f\x81\xec\xe7\x63\xb7\x1a\xe7\x79\x75\xc0\xbb\xef\xed\xa2\x91\x17\x01\x1e\xb2\x7f\xa1\xa2\x18\xfb\x35\x31\x4c\xa6\xaa\x91\xdd\x21\x08\xe6\x31\x8b\x7f\x9d\x37\xd3\x0d\xf6\xdb\x39\x38\xed\x4d\x3d\x0f\xe4\xe0\xa9\x74\xa0\x99\x14\xe0\xc6\x74\x2e\x77\x66\x0f\x1e\x62\x21\xd4\x6a\xe9\x24\xb1\xef\x31\xe0\x00\xf0\xa0\x12\x97\x2d\xe9\x6e\x9c\x49\xce\x49\x6b\xa7\x7d\x4b\x1e\xd1\xbb\x70\x4f\x48\xc3\xdd\x4c\x93\x45\x90\xf6\x06\x1b\xb5\x1c\x9f\x46\x79\xd8\xf9\xc8\x5a\x78\x67\xfa\x12\xf8\xbb\x36\xc5\x47\x63\xe8\x70\xff\x50\x86\x5a\xe5\xef\xf6\xf3\x22\x88\xfe\xa3\x9d\x93\x82\xbb\xdf\xda\x62\xde\x6b\xb3\x31\x7b\xc3\xea\x93\x9c\x33\x16\x0c\xa7\xfb\x55\x8e\x5a\x9d\x90\x7a\x9f\x49\xe2\x07\x5b\x3e\x57\x91\xfe\x6c\x52\x8e\x76\x68\x72\xf1\xb5\x98\xc7\x8e\xea\x0c\x2e\x98\xbf\x8e\x74\x68\x0a\x6d\x61\xe1\x89\x46\xb6\x58\xa4\xbe\x25\xe0\xcd\xcc\x60\xb7\x59\x37\x95\xec\x9a\xe0\x97\xed\xd3\x83\xbd\x70\x7b\x2a\x2a\x4d\xcd\x3a\xf2\x24\xd6\x1c\x3a\xc7\xfa\xe5\xd0\x62\x42\x10\x01\x47\x8b\xb6\x77\xc5\x0e\xaa\xcd\x1a\x8f\x6b\xfd\x6a\xad\xdc\x63\x2e\x5e\x95\x4d\xbe\x06\xc3\xa0\x36\x8d\xda\x60\x0c\xbf\xc1\x24\x5d\x9e\x64\x0c\xa5\x3b\x0a\x02\x7a\xee\x23\x2a\x12\xb8\x29\xe4\xbf\xa9\xd2\x38\xbf\x11\xc8\x33\xcb\x55\xb0\x9a\xe5\x25\xe7\x87\xf6\xa0\x33\x60\x44\x5c\xf0\xb0\x38\x8b\x54\xd1\x1c\xd8\x0b\x04\x97\x23\x3c\xb3\x39\xb3\x6c\xa8\x31\x0d\x16\x24\xf8\x97\x5d\x4c\x3e\x96\x70\x36\x5a\x9e\x75\xe4\x5f\xcb\xaa\x12\x36\x4a\x04\x4f\x66\x52\x40\xf3\xaf\xa3\x74\x8d\x20\x94\xba\x93\xd1\x33\x13\xfe\x24\x3f\xa4\x53\x24\xfb\x1d\x0b\x53\xa3\x4e\x90\x52\x59\x05\x43\xce\x15\xf3\x6e\x6e\x1e\x67\x37\xc4\xb9\xae\xfc\x1b\x10\x97\x31\x04\x03\xf4\x30\x5f\x7b\x62\x17\x79\x6b\x99\xf0\xbf\xbb\xde\xee\xa2\xc4\xa1\x33\xe1\x58\x85\x38\x34\xb9\x17\x7c\xbc\x50\xfb\xf4\x46\x24\xf4\xd3\x9b\xb0\x21\x63\x3a\x0e\x61\xa1\x74\x0b\xaf\x09\x47\x59\xdb\xad\x1e\xeb\xb2\x9d\x79\x88\x05\x52\x2e\x91\xd4\x5d\x9b\x0b\x48\x33\x87\x2b\xa1\x74\x79\xf8\xc2\xf2\x8e\x32\x87\x06\xe5\x19\xe5\x12\x40\x1f\xd9\x79\x09\xc6\x11\x08\xc7\xf8\x08\xd1\xcf\xf0\x54\xb0\x9d\x5f\xee\x10\xbb\x84\xb1\x91\x84\xb0\x21\xbd\x9d\xb9\x9f\x85\xc0\x27\x38\x8b\x5e\xbb\x42\x96\xd7\xa9\xed\x4d\x63\x9c\x31\x3c\xad\x46\xf4\xa9\x92\x51\x79\x18\xcb\x8d\x03\x59\xb8\x4f\x0d\x0d\x02\xa4\xe0\x6f\x14\x7b\xd9\xb6\x2d\x88\xd0\x3a\x1d\xf9\x96\x47\xff\x73\x75\x78\x31\x98\x9d\x9b\x33\xab\x1e\xb6\xbe\x63\x63\xe2\x68\x66\xd8\x1c\x97\x52\x46\xdc\xa4\x46\xd3\xe0\x29\x7b\x10\xeb\xd9\x87\x86\xc8\x03\x44\x28\x1f\x41\x95\x9e\x3f\x20\xd2\x63\xc6\x23\xba\x40\x6c\xb5\x1d\xa7\xc0\x61\x11\x71\xb2\xba\x1e\xf8\x68\x6d\x92\xae\xa9\xfa\x4e\x7e\xfe\x68\xd7\xff\xf3\x5d\x88\x64\xa8\x96\xbe\xa0\x12\x4c\xab\xd1\x06\x35\x96\x77\x9a\x9d\xc1\x95\xc8\x2a\xad\x25\x88\x83\x41\x8c\x54\x65\x8a\xe2\x55\x17\xae\xcc\x0a\xb7\x88\x2e\x4c\x2b\x53\x37\xad\x76\x14\x41\x84\x30\x99\xad\x28\xeb\xc2\x91\xf2\x2b\xb9\xa8\x90\xd3\xc5\x4b\x84\xff\xa4\xb1\xad\x42\x44\xc5\xf2\xe4\x69\x1c\xc9\x13\x80\x68\x87\x63\xdc\x0e\xa9\x27\xed\xb0\x38\x3f\xa3\x84\x13\x4e\x13\x93\x20\x96\x05\x6e\xf7\xe5\x16\xae\xf3\x85\x5c\x79\xb8\xec\x7a\xd9\xa9\xa7\x35\x7c\x33\xe8\xb7\x28\x00\x6d\xe8\x0d\xad\x55\x42\x0e\x78\x88\x35\x88\x19\x46\x19\x4f\x75\xb8\xb4\x84\x20\xc0\xf0\xf8\x62\xb1\x18\x46\xc2\xbf\xd9\xb0\x29\xb2\xbf\x9b\x6b\xe0\x6c\x0c\xce\x3b\x68\x7e\xd6\x43\xb4\x1a\x21\x9f\xe6\xae\xdd\x61\x6f\xba\xb9\x4a\x52\x2f\xab\xbd\x79\x54\xcd\x1a\x77\xbc\x74\xfc\x0c\x37\x1a\x9a\x52\x26\x28\xab\xec\xec\x93\xeb\xad\xd4\xc3\x48\xb5\xa2\xaf\x1b\xda\x77\xa3\xcb\xc2\x26\x45\xce\xb6\x72\x4a\x29\xc6\xef\xb1\xc4\x93\xe8\x1d\x1d\x38\xb6\x92\x1b\x33\x2b\xdc\x70\xfe\x8d\x71\x50\x9c\x51\xd4\x8a\x6d\x53\x93\x7c\xf6\x24\x28\xb4\xcf\xf2\xdf\xfa\x60\x51\xcf\x6b\xe8\x65\x6f\xac\xe6\x03\x54\x46\xf1\xdf\xae\xf5\x25\xed\x08\x42\xad\xac\xc2\x3e\x39\x13\x90\x40\x8e\x88\xc4\xe8\x3f\xdc\xb2\x93\xa1\x72\xea\x3a\x19\x0d\xdf\x76\xa4\x94\xe5\x2e\x2a\x8c\xd9\x35\x8a\x46\x70\x62\xc5\x01\x85\xca\x66\x11\xa7\x05\x26\x5e\xd9\xc9\x44\xd1\xe8\x8d\x33\x92\x06\x5c\x34\x68\x97\x6e\x14\xe0\x1d\x22\xe8\x8c\xfa\x39\x13\x81\x7e\xa5\xac\xfc\xf6\x0d\x7b\x17\xc7\xcb\xac\x51\xb2\xac\x8d\x90\xbc\xfe\xcc\x39\xed\x04\x8e\xe9\xb7\xaa\x95\xee\xc0\xfd\xfc\x00\xda\xc5\x0d\x03\x00\x71\x67\x42\xf2\xc3\x57\x16\xc4\xbc\xf5\x30\xe5\x0e\xb7\xde\x9e\x39\xc9\xde\x13\x4d\x33\xd7\xe4\xa8\xc0\x0a\xff\x6d\xf4\x54\xee\x96\x44\xf2\xd9\xf4\x86\x8d\x41\x91\xfd\xec\x59\xb6\xc5\x3f\x50\xaa\xf0\x14\x40\x6c\xe0\x88\x34\x82\x1c\x82\x56\x9a\x93\x0b\x93\xda\x1a\x97\x08\xf9\x89\xec\xff\xe9\x20\xe4\x82\x59\x79\x7e\x44\xe1\x87\xf9\x55\x55\x77\x1b\x6e\x9d\xd7\xee\x66\x9e\xae\xfb\xa1\xaf\x86\x1f\x74\xe6\xa9\xe5\x42\xf4\xf3\x9e\x24\x83\xa6\xe0\x5a\x26\xfe\x64\xd7\xa4\x19\x3f\xd7\x31\x61\x0c\x30\x02\xa5\xf5\x86\x2f\xf6\xee\xed\x7a\x8f\xd4\xba\x6c\x3c\x6f\x61\xb0\x47\xc8\x7b\xc9\x9e\xf7\xa2\xd0\xaa\x2f\xd1\x04\xf6\xc5\x2c\x55\xa0\xaf\x9d\x4d\xd0\x23\xa3\xc2\xdb\x75\x73\x54\xb4\x66\x20\xa0\xea\xa9\xdd\xf9\x30\xd8\x92\xb1\x4a\x83\x6b\xec\x48\xf0\x59\x43\xd2\x6a\x73\xce\xa9\x93\x0b\xa3\x21\x00\x6a\x0d\x9a\x10\x3a\x19\xf1\xc6\xac\x17\x91\xba\x04\xc9\xbe\xa3\xa5\xc8\x8d\x6f\x13\xac\x63\xad\x48\xe9\xb2\x8d\x1b\xff\xc2\xdf\x8a\x84\x9c\xe6\x09\xf2\x25\x0e\x14\xff\xec\x93\xc2\xad\x3e\x65\xe2\x37\x05\x50\x98\xbe\x88\x60\x10\x92\xe5\x6d\x57\x3a\x41\x84\xe6\xa4\x9c\xe2\x2b\x2e\x37\x52\xf0\xb0\x6b\x28\x30\xad\x26\x14\xa0\x19\x60\x1f\x5e\xb6\x29\x36\xce\xd2\xd9\x9f\xd3\x05\xd2\xf6\xec\x76\xa7\x05\x8d\x77\x85\x95\xdb\x16\x82\x2a\xe6\xe1\xcc\x48\x94\x57\x82\x21\x59\x2c\xc2\xb0\x75\xe4\x6c\x84\x78\x19\x1d\xb0\x0d\xc3\x6a\x3c\x25\xf4\xcc\x0d\x9d\x49\x12\x43\x2f\x28\x41\x1d\x67\x6f\xe0\xe1\x56\x52\x17\x35\x91\x0b\x23\xdf\x65\xc9\xeb\x8e\xd6\x98\x53\xc7\x85\x23\x11\x8b\xda\x09\xd5\x6a\xe7\x35\xf3\xcd\xd4\x3b\xd3\x6d\x34\xe3\x26\x2b\xcb\xe4\x2a\xcf\x2f\x71\x9d\xba\x36\xc4\xfb\x46\x88\x97\x3a\x71\xa2\xd6\x88\xe0\x0f\x85\x8b\x29\xbc\x09\xd4\xa5\x88\x17\x39\x75\xa5\x7b\x76\xd6\xdf\x8d\x7e\x10\xe1\xde\x78\x26\xc4\x15\x30\x09\xe4\xcb\x27\x1f\x53\x85\x1c\x1a\xdf\xa1\x68\x66\x7d\x46\x75\x77\xf4\xc8\x86\x8d\xef\x1a\xbe\xa4\xa5\xd7\x86\x89\x6d\x69\xc1\xed\x1d\x3c\xa5\x4c\xd0\x34\x84\x07\xa6\x5c\x07\xdc\x6b\xd9\x90\x89\x56\xab\x0f\xfd\x5a\xd3\x60\x62\x7a\x8d\x78\xeb\xa0\x16\x91\xbd\xe4\x2e\xac\x46\x7b\xdb\x10\x51\x6b\x61\x70\xbc\x19\x91\xc0\x25\x55\xd2\xed\x06\xa3\x76\x18\x1f\xe4\x6b\x03\xcc\x62\xb9\x30\x80\x0f\xf1\xc2\x3b\xf2\x53\x4e\x0d\xfc\xe6\xe1\x39\x00\x3d\xbd\x4e\x6b\xc6\x70\xee\x39\x0c\x5f\xab\xb5\x0d\xbb\x2f\xd7\x34\x29\x1d\xd0\x66\xa7\x40\x61\x97\xd0\xbb\x5a\xc0\x4d\x57\xb5\x6e\xc3\xa0\x05\xc2\x7d\x50\x1d\x46\xec\x72\xc4\x5d\x2a\x7f\xc3\x58\x2c\xdf\x56\xe2\xc4\xad\x7d\x6f\xa5\x58\x35\xf1\x8f\x93\x1d\x6b\x03\xe4\xd2\xbf\xb2\xd8\xce\xbf\x68\xb0\x21\xe8\xf7\xf0\x4f\xf9\x83\x4a\xa6\xad\x90\x53\x32\x9f\x19\xfb\x74\xa2\xf3\x25\x19\xb6\x26\xd6\x99\x63\x84\x43\xe7\x57\x54\xbf\x28\x25\x7c\x4a\x27\x15\xf7\xc1\x28\x86\x36\x9e\x8c\x3c\x9f\x22\xff\x5d\x84\xfc\x74\xd2\xf6\xa9\xb4\xe9\x2b\x78\xf8\x7f\x77\xd6\x4e\x5e\xbf\xcd\xd4\x9e\xf7\x5d\x91\x06\x96\x68\x30\xf7\x9f\x74\xf1\x5e\x6b\x4a\x26\x8f\x35\x6d\xc5\x1b\x3c\x14\xfe\xbb\x27\xff\x8d\x5e\x74\x8e\xad\xb1\x2c\x21\xa4\xa2\xb0\x17\x8e\x9e\x97\x2c\x36\xeb\xcb\x81\x7e\x19\x8d\x81\x18\x3c\xa5\x6f\x41\x45\x9e\xd1\x92\xb7\x65\xdd\xb2\x4a\x07\x9e\x68\xee\x1d\xda\x8f\xd8\x2a\xbd\xa3\xda\x2e\x88\x9b\x87\xa8\xd0\x67\x24\xbf\x3e\x66\xd8\x74\xac\x44\x47\x3f\xdb\xd1\xeb\x6d\xbf\x9d\x4c\x07\x4e\x7e\x08\x3f\xac\xbc\xea\x0d\x87\x22\x83\xa0\x51\x80\x3f\xd7\x4c\x7a\x7a\x59\xd4\x5d\x2f\x76\xa6\xb7\x22\xa3\xe1\x29\xa0\xe9\x93\x2d\x1c\x85\x0e\x67\x7e\x5b\x02\x26\xa8\x5c\x6d\x3f\x75\xae\x4c\xf5\xac\x31\x2c\xc9\x02\x49\x01\xf3\x1d\xa3\xb6\xfd\xfa\xac\xa1\x0a\x6f\xc6\x82\x48\x20\xf3\xba\xf1\x49\x84\xe5\x25\x62\x9d\xb6\xec\x5d\x30\xc8\x81\xe5\xf0\x19\xbc\x18\xfa\xd7\xd5\x10\x78\x34\x6a\x3d\x56\x5c\xfe\x17\xa6\xbf\xc8\x78\x84\x8a\xb3\x97\x46\xbe\xd0\x29\xb6\x43\x9c\x31\xc9\x42\xf2\x26\x03\x43\xa0\x84\x78\x87\x6d\x56\xfc\xeb\x57\x56\xf2\x8b\x51\x28\x92\x06\x78\xbd\xd3\xcb\x78\x22\x01\x1b\xf5\xc3\x50\x78\x80\x04\x2a\x91\x9e\x96\xe7\x18\x96\x6b\x22\x50\x10\xc3\x01\x43\x08\x7e\xf0\x27\xc5\x98\x94\x9c\x1e\xc9\x5e\x90\x10\xaf\xc1\x86\xcc\x1e\x26\x89\x46\xf2\x67\x7b\xee\x87\xa3\x21\xa4\x55\x00\x08\xf7\xc1\x7f\x77\x46\x72\xfc\x0e\x7e\x0c\x4e\x70\x47\x98\x26\x69\x18\xbd\x31\x47\xe4\x86\x3d\xb3\x10\xe6\x46\x7b\x94\x29\x4f\x8b\xa8\xf3\x35\x65\xfb\x60\xfe\xb6\x5d\xb8\xca\x0b\x56\xee\xa4\x42\x80\xb9\xb0\x74\x69\xe0\x16\xaa\x0f\xd3\x01\xeb\x23\x7e\xe8\xe9\x15\xed\xc4\xbc\xe1\x82\xfd\x21\xaf\x12\x6f\x0f\xbc\xef\x6e\xb6\x79\xca\xdb\x69\x3c\x87\x97\x33\xf7\x2d\x85\x8e\xb9\x24\x10\xca\xf6\x4f\xac\xbd\xf3\x92\x35\x64\x23\x92\x2c\x2b\xfd\xa2\xa4\x31\x01\x6c\x87\xb5\x82\x65\xd2\x8a\x4e\x30\x02\xeb\x99\x89\x2c\x23\xcf\xf3\xc9\x13\x25\x11\xe1\x4a\x27\x50\x19\xfa\xbc\x6f\x6f\xce\x08\x28\x07\x08\xbd\xe3\x53\xb2\x6c\xe0\x0b\x70\x46\x49\x3e\x0b\x1e\xe8\x78\x25\x88\x54\x75\x24\x84\x44\x69\xb5\xa6\x54\xd4\x15\x54\xbe\x90\xbd\x4d\x1f\xc4\xec\x25\x49\x4f\x38\xe3\x48\xf6\xc4\xc1\x70\x02\xcd\xfc\x4c\x9f\x1b\x8c\xe5\x4b\xf3\x91\xdb\xbf\x0f\x36\x88\x1b\x94\xa2\x6d\xc9\x52\xd1\x4b\x94\x51\xc7\xcb\x67\x64\x95\xe6\x12\x19\xd3\x3b\xd0\x7d\x8f\xcb\x4f\xb1\x1f\x74\xa5\x21\x58\xe1\xb7\xb7\xa2\xc5\x20\x4a\x75\x65\x34\xd1\xd5\x3d\x0b\xd8\x2f\xa3\x2e\xb0\xa8\xe7\x75\x22\x7f\x3a\x26\xe5\x13\x99\xb7\x22\xc6\x70\x0b\x69\xba\x42\x88\xea\x60\x8b\x31\x3d\x7b\x43\x99\xc1\xf0\x0f\xe3\x5e\x96\xbf\x33\x45\x9d\xed\xf8\xc4\x09\x8d\x77\x76\x15\xd3\x09\xd2\xaa\x15\x68\x36\xa2\xf4\xf6\xf6\xae\x78\x19\xf3\x25\xdc\x99\xe7\x46\xfe\xed\x9e\xe6\x8a\x4b\x9c\xeb\xc1\xa7\xde\x71\x70\xa7\x47\x84\xce\x30\xa9\x54\x23\x43\x5e\xf5\x1a\x16\xc4\xec\x15\x98\xe9\xcd\xf5\x7f\x58\x3c\xd0\xee\x6c\x80\x68\x52\xfa\x8f\x17\xe1\x23\x77\x56\x83\xc7\xc4\xa8\x55\x22\xb2\x39\x51\x51\x9a\x82\x70\x05\x61\x1b\xe6\xf6\xe6\xfb\xec\x24\xf1\xee\x52\xc8\xa3\x59\xdc\xc1\xc1\x88\xe9\xe2\x80\xd0\x3a\xab\x9e\x28\x5e\x0f\x3f\x5c\xd3\xb0\xe9\x2e\x86\x1c\x0c\x82\x8e\xf1\x43\x59\x6c\xe2\xae\x5a\x72\x6b\xf0\xf5\x88\x03\x16\xaa\xbc\xcf\x34\xe3\x64\x96\xa5\x40\x3e\xc3\xca\xf3\x01\xfa\xee\x3d\x50\x63\x5d\xcd\xa2\x86\x17\xbb\xa4\xbb\x6f\x8b\x0e\xa4\xfb\x11\x4c\xd6\xab\x9b\xe2\xfd\xee\x76\xa6\x5c\xdb\x40\xe6\x89\x9b\xfd\x7f\x3b\xd9\xc1\xcb\x23\x17\x86\xdc\xb6\xd1\x4c\x34\x52\x2a\xe8\x77\x8c\xff\xbb\x99\xcc\x59\xdb\xe0\xf2\x51\x84\x20\x72\xd9\x40\x01\xbe\xf4\x6c\x77\x99\x82\x22\x5f\x50\x4b\x55\xfe\x2f\x5c\xcb\x73\xe5\x12\x3f\xbd\x7d\x76\x8f\xe5\x23\x99\x54\xf2\x81\xab\xb4\xd6\x68\x2c\x7c\xbb\x18\x1f\xf9\xfe\x5d\x92\xa0\x44\x5a\xbe\xa5\xbc\xd1\xa5\xea\xbf\xf9\x18\x7d\x2a\x0f\xc2\x94\x13\xd3\x94\x60\x4d\x92\x1f\xb3\x9e\x96\x19\x68\xf6\xc7\x99\x02\xb3\xe2\xb2\xde\x49\x48\x0a\xa2\x01\x96\x11\x28\x5e\x09\xce\xc7\xb1\xec\x90\x89\x95\x6e\x65\x1d\xee\xb1\xe9\x44\x3d\x85\xbb\x0c\xfd\x7b\xb6\x82\x0b\x9e\xe9\x7a\xfe\xd7\x69\x8f\x54\xf9\x38\x3d\x0c\xf0\x39\x95\x51\xc1\xa6\x8c\xd5\x96\x9b\x4c\x62\x50\xa1\xd7\x99\x8b\x14\x44\x8a\x45\x7e\xdf\x0c\x70\x2f\x03\xb8\xc0\x93\xe1\x8f\x9b\x82\x13\xc7\xa3\xe3\x29\x0d\x92\x65\x86\xef\x9e\xd8\x41\x79\xdc\xcf\x96\x3b\x1b\x1d\x58\x04\x79\xc3\xc5\x4d\xbc\xb2\xa7\x1e\xf2\xa7\x02\x39\x03\x72\x96\x39\xc0\x65\x3d\x25\xac\x3f\x6c\x3b\xa3\xfe\xa2\x88\x6a\x72\xa5\x1a\xd9\xe6\x67\x86\xba\x51\xf4\x71\x4f\x4a\x1c\xae\x5e\x33\x1d\xb7\xec\x76\x23\x8d\x0a\x5f\xda\xfe\x39\x35\x23\xba\xd1\x1f\x34\x83\x39\x61\xa9\x30\xee\x4e\x22\xec\x96\x45\x4b\x2f\xcd\xdc\x09\x25\xe5\x71\x19\x82\x75\x1b\x2b\x93\x6e\xad\x04\x37\xe8\x64\x43\x69\x66\x81\x52\x36\x0b\x16\x95\x71\xea\xff\xda\x6a\x98\x21\xcc\xf9\x52\x9a\x66\xa8\x22\xbc\x0f\x99\x63\xab\xbb\x7a\x26\x84\x6d\xe0\xe7\x33\xf1\xb8\xca\xb4\xc5\xf6\x23\xf6\xdf\x50\xf3\x72\x8c\x3b\xba\x6e\x9e\xf8\x7a\x22\x36\xb8\x93\x27\x24\x85\xc5\x56\x60\x41\x6a\x09\x87\xb5\x27\x5a\xb4\xee\xc1\xcb\x65\x28\x54\x93\xda\xce\xf5\x61\xbd\x31\x30\x3a\x54\x97\x97\x00\x18\xa7\xc3\x40\x2a\x21\x10\x5b\x1b\xc7\x45\x94\x1e\x41\xbe\x64\xfc\x37\x67\x73\x8e\x79\x02\x83\x81\x17\xa7\xbd\x24\x94\x7a\x1d\xdd\xe8\x91\xc2\x59\xb8\x79\xef\x02\x40\xd7\x76\xce\xd0\xf5\x57\xbf\x28\xab\x86\x71\x2b\x60\xdb\x58\x93\xae\x61\x80\x75\x04\xaa\x8c\xd1\xe7\xc5\xb8\xc4\xee\xc3\xe0\xd6\x36\xc2\x8b\x47\xda\x83\x42\x9d\xb8\x6e\xc8\x2b\x1f\xa1\x0a\x33\x67\x84\x1f\xdc\x66\xa4\xf9\xa4\xf2\x1c\x83\x37\x76\x2f\x84\xfc\x01\xc6\xe9\xe0\x00\xdd\x3a\xdb\xe9\x9e\x7d\x60\xcc\x74\x29\x91\x98\xbc\x9f\xf8\xf8\xdd\x22\x98\x38\x60\xe7\x6b\xbe\x91\xc4\x9a\x9a\x67\x76\x72\xac\x27\xbc\xe5\x8d\x0e\x11\xc4\x0d\xf5\x32\x1f\xd6\x12\x35\xa2\x93\x70\x61\x52\x1d\x40\x59\xaf\x1d\x0a\x0a\xf5\x57\xbc\x45\x75\x56\x1a\x8c\x26\x1a\x39\xdb\xa7\x62\xc5\x6a\x02\xde\x6c\x76\x10\x2e\x9a\x44\x17\xf9\x8e\x18\x18\x11\xcc\xf9\xb2\xed\xd2\x58\xa2\x82\xa2\xce\x5b\x20\x0a\x77\xee\xd0\xab\x20\xfb\xca\x11\x40\x63\x0b\x6b\x72\xc3\xad\x6c\x74\xb6\x25\x0a\xaa\xda\x4f\x4f\x09\x2d\xe8\x55\x0b\xb9\x1a\x24\x0e\x8c\x94\xee\x3a\xe8\x20\xd8\x83\xa8\x3b\x94\xed\xce\x08\xe3\xfe\x73\xd2\xeb\x5f\x1a\x1c\xdf\x0c\x0b\x9a\xbe\x0c\xc3\xeb\xc8\xac\xe1\xe3\x95\x17\x25\xf5\x38\x1b\x77\xf3\xb3\xd1\xde\x3a\xf4\xfa\x6a\x59\xa2\xf0\x96\x8e\x21\x1c\x21\x72\xd3\x04\x0e\xfd\xd9\xd2\x94\xe7\xb2\xb7\x1f\x57\xa1\xe6\xef\x7d\x99\x16\xc9\x87\x19\x2e\x53\xa2\xa4\x50\x5a\xea\x98\xea\x3a\x86\xb0\x21\x72\x42\x37\x9b\x43\x47\x4c\x3e\x9e\x9d\xb3\x9e\x1b\x64\xa6\x30\x83\x20\x2e\xa9\x67\x71\xad\x33\x98\xea\xf3\xf3\xcf\x5b\xe4\xf2\xc0\x49\x83\xc3\x2c\xc4\x2b\x32\x5b\x6b\xb3\x44\xa1\x77\x9b\x3e\x0c\xa4\x3b\x9a\xe0\x13\xcc\x38\xa3\xdf\x72\x4b\x51\xc6\x4d\xb1\x9d\x17\x57\x7a\x85\xc2\x18\xf5\x11\x9e\x5e\x81\xc8\x5f\x25\x04\xa9\xfa\x97\x14\x98\x6d\x42\x98\x29\xaf\xfd\xf9\xa8\x80\x89\x3b\x36\xb8\x38\xee\xb7\x8a\xfa\x0b\x7e\x9a\x9a\x61\x30\xfa\x4a\x05\x01\x4d\xf5\x38\xc8\xb5\xa0\xd8\xc3\xa2\x91\x87\x7d\xcf\x02\x40\x1f\x14\x02\x11\x20\x05\x08\x5b\xdc\xf8\x13\xc0\x2d\x4c\x5f\x48\x32\x36\x80\x0f\x22\xce\x6a\x1d\xff\x4a\x97\x71\xe0\xe4\xe0\xcd\x67\xd1\xb3\xf7\x75\x3a\x58\x85\x47\x30\x77\x42\xf9\x43\x45\x68\x14\x1c\x56\x05\xb4\x89\x0a\xe4\xc6\x52\x05\x55\xfa\x29\x49\x2b\x09\x5c\x50\xd7\x06\xce\x36\x69\xde\x03\xb2\xdc\xe8\x19\x82\x0b\x71\x57\x9d\x1b\xc7\x53\x41\x8e\xae\x63\xc3\xa0\xff\xbe\x81\x6b\x51\x5e\xf3\x39\xdc\x31\x2a\xd7\x7e\xe8\x12\x89\x9c\x82\xe4\x6c\x77\x00\x0e\x27\x6f\xce\x99\x05\xdf\x79\x4b\xab\xfd\x0d\x41\x8b\x1e\xb7\xad\xbb\xa0\xdc\xd9\xc4\xac\xe3\x03\x45\x88\x90\xb7\x11\xbb\x39\x77\xef\xd1\x95\xa2\x9a\xb0\x19\xc9\xaf\x0c\xb6\x8f\x09\xca\xc4\xa2\xf1\x1f\x99\x60\xcf\x73\x5d\xf7\x5b\xe1\x3d\x9c\xd3\xd9\x4d\x9c\xf0\x36\xdf\x08\xee\x1f\xf0\xa6\xc3\x29\x35\xf4\x37\x0e\x38\x64\x79\xa7\x2e\x77\x56\xa1\xfb\xa3\xff\xf9\x59\x9b\xaa\x51\xfc\x8c\xe0\x6e\xf8\x1b\xc1\x5d\xe2\x54\x58\x2d\x6c\x27\x41\x36\x75\x1c\x0f\x88\xaa\xfe\x85\x1d\x17\x32\xc7\xb0\xa8\xc4\x65\xb5\xde\x31\x9e\x74\x5f\x1c\xdb\x9c\xc4\x3f\x78\x39\x21\x1c\x03\x68\x0f\xab\xb9\x91\x59\xae\x60\x67\xa1\x3b\x6c\x1a\xb3\x4c\xc9\x91\x38\x8a\x0b\x04\x56\xdd\x58\x7a\xa2\x0d\xd2\x4f\xcd\x80\x64\xa8\x6c\x6f\xc5\xe1\x20\x36\x09\x99\x44\xf1\xfa\x97\xb5\x21\xe9\x21\xdf\x87\xb7\x2a\x58\x1f\x2d\x41\xde\x0f\x6a\x94\x09\x7e\x60\x9a\x2f\xd6\xc8\x0e\xf9\xf4\xbf\x99\x51\xe1\x26\x72\x0c\x9a\x61\x90\xe0\x3c\x6f\xe0\xc3\xbd\x85\x26\x31\x34\xe3\x0c\x83\x7c\x91\x8d\x5c\x14\x56\xd4\xb7\x29\x92\x6c\x4d\xb2\xbe\xec\x35\x58\xb6\x0b\x9c\x2e\x99\x4f\x56\xcc\xb0\x05\xb9\xf3\xf4\x1a\xb7\x01\x33\xdd\xa8\x0c\xdc\x73\x59\x3b\xf7\x99\xe9\xb2\x72\x7d\xf0\x1e\x53\x62\x79\x02\x6e\x2a\x03\x88\x02\x06\x4a\x52\x1b\x40\xf4\x98\x25\x85\x63\xbc\xd9\xc8\x81\xf3\xeb\x34\x67\xd2\x92\xed\x21\x6b\xe0\xfb\xe1\x0c\x6d\x1f\x3c\xe9\x69\x6c\x01\xcf\x80\x30\xf8\x96\x75\xe6\x6b\x52\xcd\x80\x63\xd4\x8f\x8a\xd9\xac\x2f\xaf\xa0\xea\x31\xc9\xeb\xab\xef\x78\xe7\xfb\x6a\x74\xbf\xf7\x77\x9a\xf8\x9c\xf9\x83\x87\x53\x46\x24\x66\x87\x02\xa6\x75\xd7\x2e\xd5\x69\x45\x8d\xaa\x07\x36\x92\x78\x7f\x02\x73\x5c\x13\xcf\x13\x48\xc5\x93\xca\xd9\x20\x82\x96\x6d\xbb\x3a\x86\x42\xb5\xbd\x42\x21\xa5\xfd\xf9\xc0\xf9\x02\xa9\x87\xe2\xeb\x8e\x13\xe3\x19\x8a\xb0\xf2\x7c\x3d\x8c\xcb\x48\x7f\x44\xc6\x6c\x68\xf1\xe6\xa4\xcf\xe6\xa2\xdb\xac\xba\xdc\x8b\xf7\x66\x01\x7d\xf3\xc7\xaf\x16\x6f\x3a\xbd\x1d\xf5\x82\x46\xd7\x2a\x2f\xc7\xc5\x26\xee\xfc\xc1\x23\x09\x30\x83\xf1\x4e\x92\x65\x61\x22\x70\xae\x84\xbe\x91\x1b\x8a\xdb\x3a\x30\x29\x6a\x11\x30\xa9\xa1\x2f\x2d\x07\xe8\x98\x37\x32\x8e\xea\xaa\xe7\x3d\x44\xda\x13\x1d\x10\xfe\x63\xfd\x05\xb2\x42\xaf\x9e\xeb\xac\x61\xdd\x74\x06\x16\x54\x14\x20\x9f\xf9\x77\x23\xa1\xa6\xa9\x70\x24\xd7\x1d\x32\x3e\x79\x46\xfb\x92\x29\x40\x2e\x29\x2b\x9a\x25\xbc\xdb\xe1\x38\x75\x2c\x43\x0e\x65\x16\x5b\xc5\x27\x69\xfb\x7d\xe1\x3c\xbd\x71\xa4\x0b\x54\x2d\xfa\xf0\x53\xb7\x50\x15\x37\x83\x92\x10\x0f\x64\x32\x9a\xce\xea\xe5\x3c\xad\x5c\x05\x42\x87\x8e\xc0\xaf\xb7\xe0\xfe\xbb\xf3\xef\x59\xa2\xb5\xa5\xea\x1a\x4a\x48\x75\xd5\x9e\x4a\x48\xa8\x97\xc6\x21\x91\xca\x21\xee\x26\x7f\xa9\x0c\x46\x7d\xbf\xbf\x70\x2d\x2a\xa0\xcb\x11\xf8\x34\xb1\x65\xb5\x84\xf2\x2f\xf7\xcf\x4d\xb4\x83\x0c\xe6\x9f\x18\xec\xd6\x54\x47\xb0\x4e\x1d\xf6\x25\x9f\xbb\x7c\x36\x45\x3e\xb7\xf0\x6d\x7a\xa8\x32\xe4\xd5\x3a\xee\xf1\x56\xbc\xf9\xa5\x74\xa8\x6a\xaa\x3f\x35\x70\xb7\x58\x75\x79\xa7\x95\x26\x4d\x22\x8d\x46\x3d\x8a\x43\xcb\x54\x1d\x61\x55\x04\x2e\x8a\xfa\xb6\x99\xc0\xc8\xb1\x7e\xd4\x17\x6b\x19\xfa\xa6\xf7\xda\xbd\x9a\xa1\x33\xa4\x64\x74\xc6\x59\xbc\x5a\xd8\xed\x5e\xdf\x9b\xc9\x47\x29\x2a\x70\xca\xa3\xcc\x8a\x63\xc6\x82\xe7\x8b\x48\xc5\x69\x91\x27\xcd\x1b\x85\x69\xb6\x22\x9c\xce\xa3\xd4\x12\x99\x88\xeb\x25\xa0\x20\xa5\xcf\xe5\x8c\x43\x60\x0c\xde\x30\xc0\x63\x2f\x84\xdb\x95\xeb\x70\xc0\x43\x2a\xd6\x46\x06\xb6\x4f\xa9\x71\x47\x8b\x0c\xba\x74\x92\x38\x48\xc9\x8b\xb0\xfa\xd1\xc6\xa5\x31\x84\xbd\x63\x04\x9e\xe5\xb6\x17\x39\xa2\x5c\x31\xf2\xbe\xfa\x9b\x53\xf1\x42\xcf\x57\x2b\xdc\x6d\x51\x5e\x9a\x9d\x83\x96\x11\xef\xc3\x32\xc3\x61\xc5\xe9\x41\xd4\xe0\xaf\xb0\xec\xe9\x59\x61\x54\xcf\x13\x87\x95\xcc\xbc\x1f\xfe\x5f\x7e\xfb\x40\x92\x46\x55\x97\x51\x81\xa6\xdb\xbc\x03\x6f\xf3\x70\x54\x53\x8a\xaa\x5d\xd3\x73\x6a\x28\x2c\x5b\x50\x50\x88\x7f\xd4\x11\xaf\x56\x2a\x9b\xb5\xb6\xcc\x3b\x9a\xb0\x54\xce\x5f\x5e\x86\x46\x1d\xdd\x7b\xa9\x31\x62\x76\xba\x7a\x3c\x43\x6f\x67\xec\xd8\xd8\x59\xb0\x62\xd3\x10\x89\xcd\x52\xcb\x0c\x06\x4d\xc6\x1e\x5a\x84\x6b\xfa\xa4\x49\x49\x0d\x38\x25\xaa\x5d\x6a\x24\x72\xfd\x58\x18\x79\x6a\x9f\x02\x0e\xb9\x75\x77\x10\x03\x7c\xb3\xfa\xc6\x63\xfa\x18\x1b\x63\x00\xe1\x6a\xe6\x29\x88\x7e\x1f\xdc\xdd\xae\xcc\xe4\x7b\x90\xe1\x6d\x1b\x7c\xb8\x13\x1b\xf5\xc9\x56\xcb\x8b\xaf\xab\x4e\xf2\x90\xda\xfd\x50\xb1\xab\xbe\xf4\xf1\xc7\x86\x69\x8f\x6e\xa1\x61\xb7\x64\x17\xb2\x43\x82\x14\xe1\x70\xbf\x66\x4f\x7e\xf6\xa1\x85\xc5\xe8\x1b\x23\x66\x2e\xc1\xab\xf2\x27\xc2\x90\x0c\x18\x67\x16\xe0\xcf\x11\x6c\xa1\x4d\x5b\x8f\x22\x35\x38\xfa\xeb\x20\x75\x44\xf9\x00\xbf\xe8\xa9\x1f\x70\xc5\xba\xd4\xb7\x72\x40\x94\x73\xb6\x6e\x32\xc3\xef\xc4\x6c\x08\x93\x33\xc9\x53\xc8\xf1\x54\x17\xe6\xb5\xe9\x0b\x54\x9b\xf6\x64\xc0\xf1\xe8\x01\x2d\x18\x02\x9c\xe9\xf2\x37\xca\x2c\xee', 1)
17,687.75
70,671
0.750081
17,674
70,751
3.001867
0.01522
0.000452
0.000792
0
0
0
0
0
0
0
0
0.311658
0.000141
70,751
4
70,671
17,687.75
0.438331
0.000283
0
0
0
0.333333
0.9986
0.9986
0
1
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
1
0
0
0
0
1
1
1
null
1
0
0
0
0
0
1
0
1
0
0
0
0
11
6a33a2009362d494b419ac787df1773780479897
106
py
Python
expdj/apps/main/context_processors.py
vsoch/expfactory-docker-dev
a2d9097db3d57a5c5303c2bc281cb4361af25ec4
[ "MIT" ]
null
null
null
expdj/apps/main/context_processors.py
vsoch/expfactory-docker-dev
a2d9097db3d57a5c5303c2bc281cb4361af25ec4
[ "MIT" ]
null
null
null
expdj/apps/main/context_processors.py
vsoch/expfactory-docker-dev
a2d9097db3d57a5c5303c2bc281cb4361af25ec4
[ "MIT" ]
1
2021-04-22T03:43:46.000Z
2021-04-22T03:43:46.000Z
from expdj.settings import DOMAIN_NAME def domain_processor(request): return {'domain': DOMAIN_NAME}
21.2
38
0.783019
14
106
5.714286
0.714286
0.25
0
0
0
0
0
0
0
0
0
0
0.132075
106
4
39
26.5
0.869565
0
0
0
0
0
0.056604
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
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
1
0
0
1
1
1
0
0
7
e015e5ff95b53ce5e6febf3c0642346436cc1b16
71,871
py
Python
qmeq/tests/test_leadstun.py
gedaskir/test-deploy-qmeq
47f1176df5341a0f251657c299a4a98aaac40833
[ "BSD-2-Clause" ]
16
2016-12-14T09:21:16.000Z
2022-02-23T08:01:45.000Z
qmeq/tests/test_leadstun.py
gedaskir/test-deploy-qmeq
47f1176df5341a0f251657c299a4a98aaac40833
[ "BSD-2-Clause" ]
3
2018-02-03T19:13:01.000Z
2021-06-09T14:10:28.000Z
qmeq/tests/test_leadstun.py
gedaskir/test-deploy-qmeq
47f1176df5341a0f251657c299a4a98aaac40833
[ "BSD-2-Clause" ]
7
2017-07-09T04:46:42.000Z
2021-04-26T16:27:55.000Z
from numpy.linalg import norm from qmeq.indexing import StateIndexing from qmeq.leadstun import * EPS = 1e-14 class ParametersDoubleDotSpinful(object): def __init__(self): tL, tR = 2.0, 1.0 self.tleads = {(0,0): tL, (2,2): tL, (1,1): tR, (3,3): tR, (0,1): 0.3*tL, (2,3): 0.3*tL, (1,0): 0.1*tR, (3,2): 0.1*tR} e1, e2, omega = 0.0, 0.0, 20.0 self.hsingle = {(0,0):e1, (2,2):e1, (1,1):e2, (3,3):e2, (0,1):omega, (2,3):omega} uintra, uinter = 80.0, 40.0 self.coulomb = {(0,2,2,0):uintra, (1,3,3,1):uintra, (0,1,1,0):uinter, (0,3,3,0):uinter, (1,2,2,1):uinter, (2,3,3,2):uinter} self.vecs = {'Lin': [np.array([[1.0]]), np.array([[-0.7071067811865475, 0.0, 0.0, 0.7071067811865475], [0.7071067811865475, 0.0, 0.0, 0.7071067811865475], [0.0, -0.7071067811865475, 0.7071067811865475, 0.0], [0.0, 0.7071067811865475, 0.7071067811865475, 0.0]]), np.array([[0.0, 1.0, 0.0, 0.0, 0.0, 0.0], [0.37174803446018445, 0.0, 0.0, 0.0, -0.7071067811865476, -0.6015009550075454], [-0.6015009550075456, 0.0, 0.0, -0.7071067811865475, 0.0, -0.37174803446018434], [-0.6015009550075456, 0.0, 0.0, 0.7071067811865476, 0.0, -0.37174803446018423], [0.37174803446018445, 0.0, 0.0, 0.0, 0.7071067811865476, -0.6015009550075455], [0.0, 0.0, 1.0, 0.0, 0.0, 0.0]]), np.array([[-0.7071067811865475, 0.0, 0.0, 0.7071067811865475], [0.7071067811865475, 0.0, 0.0, 0.7071067811865475], [0.0, -0.7071067811865475, 0.7071067811865475, 0.0], [0.0, 0.7071067811865475, 0.7071067811865475, 0.0]]), np.array([[1.0]])], 'charge': [np.array([[1.0]]), np.array([[-0.7071067811865475, 0.0, 0.0, 0.7071067811865475], [0.7071067811865475, 0.0, 0.0, 0.7071067811865475], [0.0, -0.7071067811865475, 0.7071067811865475, 0.0], [0.0, 0.7071067811865475, 0.7071067811865475, 0.0]]), np.array([[0.0, 1.0, 0.0, 0.0, 0.0, 0.0], [0.37174803446018445, 0.0, 0.0, 0.0, -0.7071067811865476, -0.6015009550075454], [-0.6015009550075456, 0.0, 0.0, -0.7071067811865475, 0.0, -0.37174803446018434], [-0.6015009550075456, 0.0, 0.0, 0.7071067811865476, 0.0, -0.37174803446018423], [0.37174803446018445, 0.0, 0.0, 0.0, 0.7071067811865476, -0.6015009550075455], [0.0, 0.0, 1.0, 0.0, 0.0, 0.0]]), np.array([[-0.7071067811865475, 0.0, 0.0, 0.7071067811865475], [0.7071067811865475, 0.0, 0.0, 0.7071067811865475], [0.0, -0.7071067811865475, 0.7071067811865475, 0.0], [0.0, 0.7071067811865475, 0.7071067811865475, 0.0]]), np.array([[1.0]])], 'sz': [[np.array([[1.0]])], [np.array([[-0.7071067811865475, 0.7071067811865475], [0.7071067811865475, 0.7071067811865475]]), np.array([[-0.7071067811865475, 0.7071067811865475], [0.7071067811865475, 0.7071067811865475]])], [np.array([[1.0]]), np.array([[0.37174803446018445, 0.0, -0.7071067811865476, -0.6015009550075454], [-0.6015009550075456, -0.7071067811865475, 0.0, -0.37174803446018434], [-0.6015009550075456, 0.7071067811865476, 0.0, -0.37174803446018423], [0.37174803446018445, 0.0, 0.7071067811865476, -0.6015009550075455]]), np.array([[1.0]])], [np.array([[-0.7071067811865475, 0.7071067811865475], [0.7071067811865475, 0.7071067811865475]]), np.array([[-0.7071067811865475, 0.7071067811865475], [0.7071067811865475, 0.7071067811865475]])], [np.array([[1.0]])]], 'ssq': [[[np.array([[1.0]])]], [[np.array([[-0.7071067811865475, 0.7071067811865475], [0.7071067811865475, 0.7071067811865475]])], [np.array([[-0.7071067811865475, 0.7071067811865475], [0.7071067811865475, 0.7071067811865475]])]], [[np.array([[1.0]])], [np.array([[0.37174803446018434, -0.7071067811865475, -0.6015009550075459], [-0.6015009550075456, 0.0, -0.3717480344601844], [-0.6015009550075456, 0.0, -0.3717480344601844], [0.3717480344601844, 0.707106781186548, -0.6015009550075456]]), np.array([[0.0], [-0.7071067811865475], [0.7071067811865475], [0.0]])], [np.array([[1.0]])]], [[np.array([[-0.7071067811865475, 0.7071067811865475], [0.7071067811865475, 0.7071067811865475]])], [np.array([[0.7071067811865475, -0.7071067811865475], [-0.7071067811865475, -0.7071067811865475]])]], [[np.array([[1.0]])]]]} def test_construct_Tba(): data = {'Lin': [[[0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0], [0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0], [0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0], [0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0], [0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0], [2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0], [0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0], [0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0], [0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6], [0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0], [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1], [0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0], [0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0], [0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0], [0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0], [0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0]], [[0.0, 0.6, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.6, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [2.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 2.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.6, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 2.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 2.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, -0.6], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, -0.6, 0.0]], [[0.0, 1.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.1, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.1, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -1.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.1, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.1], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, -1.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, -1.0, 0.0]]], 'charge': [[[0.0, 0.0, 0.0, 0.6, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0], [2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 2.0, 0.0, 0.0, 0.0], [0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0], [0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0], [0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0], [0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0], [0.0, 0.0, 0.0, 2.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0], [0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, -0.6, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 1.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0], [0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.1, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0], [0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0], [0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0], [0.0, 0.0, 0.0, 0.1, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1], [0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, -1.0, 0.0, 0.0, 0.0]], [[0.0, 0.6, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.6, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [2.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 2.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 2.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 2.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, -0.6], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, -0.6, 0.0]], [[0.0, 1.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.1, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.1, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.1, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.1], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, -1.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, -1.0, 0.0]]], 'sz': [[[0.0, 0.0, 0.0, 0.6, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0], [2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 2.0, 0.0, 0.0, 0.0], [0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0], [0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0], [0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0], [0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0], [0.0, 0.0, 0.0, 2.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0], [0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, -0.6, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 1.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0], [0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.1, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0], [0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0], [0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0], [0.0, 0.0, 0.0, 0.1, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1], [0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, -1.0, 0.0, 0.0, 0.0]], [[0.0, 0.6, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.6, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [2.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 2.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 2.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 2.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, -0.6], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, -0.6, 0.0]], [[0.0, 1.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.1, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.1, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.1, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.1], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, -1.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, -1.0, 0.0]]], 'ssq': [[[0.0, 0.0, 0.0, 0.6, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0], [2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 2.0, 0.0, 0.0, 0.0], [0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0], [0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0], [0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0], [0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0], [0.0, 0.0, 0.0, 2.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0], [0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, -0.6, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 1.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0], [0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.1, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0], [0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0], [0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0], [0.0, 0.0, 0.0, 0.1, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1], [0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, -1.0, 0.0, 0.0, 0.0]], [[0.0, 0.6, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.6, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [2.0, 0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 2.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 2.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.0, 2.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, -0.6], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, -0.6, 0.0]], [[0.0, 1.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.1, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.1, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.1, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.1], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, -1.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, -1.0, 0.0]]]} p = ParametersDoubleDotSpinful() for indexing in ['Lin', 'charge', 'sz', 'ssq']: si = StateIndexing(4, indexing=indexing) leads = LeadsTunneling(4, {}, si, {}, {}, {}) Tba = construct_Tba(leads, p.tleads) assert Tba.tolist() == data[indexing] def test_construct_full_pmtr(): data = {'Lin': np.array([[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, -0.7071067811865475, 0.0, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.37174803446018445, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7071067811865476, 0.0, -0.6015009550075454, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.6015009550075456, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7071067811865475, 0.0, 0.0, -0.37174803446018434, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, 0.0], [0.0, 0.0, 0.7071067811865475, 0.0, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.6015009550075456, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865476, 0.0, 0.0, -0.37174803446018423, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.37174803446018445, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865476, 0.0, -0.6015009550075455, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7071067811865475, 0.0, 0.7071067811865475, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, 0.0, 0.7071067811865475, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0]]), 'charge': np.array([[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -0.7071067811865475, 0.0, 0.0, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.7071067811865475, 0.0, 0.0, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, -0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.37174803446018445, 0.0, 0.0, 0.0, -0.7071067811865476, -0.6015009550075454, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.6015009550075456, 0.0, 0.0, -0.7071067811865475, 0.0, -0.37174803446018434, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.6015009550075456, 0.0, 0.0, 0.7071067811865476, 0.0, -0.37174803446018423, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.37174803446018445, 0.0, 0.0, 0.0, 0.7071067811865476, -0.6015009550075455, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7071067811865475, 0.0, 0.0, 0.7071067811865475, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, 0.0, 0.0, 0.7071067811865475, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7071067811865475, 0.7071067811865475, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, 0.7071067811865475, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0]]), 'sz': np.array([[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.37174803446018445, 0.0, -0.7071067811865476, -0.6015009550075454, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6015009550075456, -0.7071067811865475, 0.0, -0.37174803446018434, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6015009550075456, 0.7071067811865476, 0.0, -0.37174803446018423, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.37174803446018445, 0.0, 0.7071067811865476, -0.6015009550075455, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7071067811865475, 0.7071067811865475, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, 0.7071067811865475, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0]]), 'ssq': np.array([[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.37174803446018434, -0.7071067811865475, -0.6015009550075459, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6015009550075456, 0.0, -0.3717480344601844, -0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6015009550075456, 0.0, -0.3717480344601844, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3717480344601844, 0.707106781186548, -0.6015009550075456, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, 0.7071067811865475, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7071067811865475, -0.7071067811865475, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7071067811865475, -0.7071067811865475, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0]])} p = ParametersDoubleDotSpinful() for indexing in ['Lin', 'charge', 'sz', 'ssq']: si = StateIndexing(4, indexing=indexing) Pmtr = construct_full_pmtr(p.vecs[indexing], si) assert norm(Pmtr - data[indexing]) < EPS def test_rotate_Tba(): data = {'Lin': [[[0.0, 0.0, 0.9899494936611665, 0.0, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.9634673443298214, 0.0, 0.0, 0.0, 0.0, 0.0, -1.3, 1.3, 0.0, -0.2274437873630345, 0.0, 0.0, 0.0], [0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.9634673443298213, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.4223956051027782, 0.0, 0.0, -1.7892964966125253, 0.0, -0.2274437873630344, 0.0, 0.0], [1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.8384776310850235, 0.0], [0.0, 0.0, -1.8384776310850235, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235], [0.0, 0.0, 0.0, -0.42239560510277824, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7, 0.7, 0.0, -1.7892964966125247, 0.0, 0.0, 0.0], [0.0, -1.3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7, 0.0, 0.0, -0.7, 0.0, -1.3, 0.0, 0.0], [0.0, 1.3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7, 0.0, 0.0, 0.7, 0.0, -1.3, 0.0, 0.0], [0.0, 0.0, 0.0, -1.7892964966125255, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7, 0.7, 0.0, 0.4223956051027781, 0.0, 0.0, 0.0], [0.0, -0.22744378736303472, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.7892964966125247, 0.0, 0.0, 0.42239560510277796, 0.0, -0.9634673443298212, 0.0, 0.0], [0.0, 0.0, 0.0, -0.2274437873630345, 0.0, 0.0, 0.0, 0.0, 0.0, -1.3, -1.3, 0.0, -0.963467344329821, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0]], [[0.0, 0.0, -0.6363961030678927, 0.0, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.619371864212028, 0.0, 0.0, 0.0, 0.0, 0.0, -0.55, 0.55, 0.0, 0.14621386330480773, 0.0, 0.0, 0.0], [-0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -0.619371864212028, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.17870583292809844, 0.0, 0.0, -0.7570100562591453, 0.0, 0.14621386330480785, 0.0, 0.0], [0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7778174593052022, 0.0], [0.0, 0.0, -0.7778174593052022, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022], [0.0, 0.0, 0.0, -0.17870583292809847, 0.0, 0.0, 0.0, 0.0, 0.0, -0.45, -0.45, 0.0, -0.7570100562591451, 0.0, 0.0, 0.0], [0.0, -0.55, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.45, 0.0, 0.0, 0.45, 0.0, -0.55, 0.0, 0.0], [0.0, 0.55, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.45, 0.0, 0.0, -0.45, 0.0, -0.55, 0.0, 0.0], [0.0, 0.0, 0.0, -0.7570100562591453, 0.0, 0.0, 0.0, 0.0, 0.0, 0.45, -0.45, 0.0, 0.17870583292809855, 0.0, 0.0, 0.0], [0.0, 0.1462138633048077, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7570100562591451, 0.0, 0.0, 0.17870583292809855, 0.0, 0.6193718642120277, 0.0, 0.0], [0.0, 0.0, 0.0, 0.1462138633048078, 0.0, 0.0, 0.0, 0.0, 0.0, -0.55, -0.55, 0.0, 0.6193718642120278, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0]], [[0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.9899494936611665, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.9634673443298214, 0.0, 0.0, 0.0, 0.0, 0.0, -1.3, -1.3, 0.0, 0.2274437873630344, 0.0, 0.0, 0.0], [0.0, 0.0, -0.9634673443298214, 0.0, 0.4223956051027782, 0.0, 0.0, 1.789296496612525, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.22744378736303444, 0.0], [0.0, 0.0, 0.0, 0.42239560510277824, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7, -0.7, 0.0, 1.7892964966125247, 0.0, 0.0, 0.0], [0.0, -1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 1.8384776310850235, 0.0, 0.0], [0.0, 0.0, 0.0, 1.7892964966125255, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7, -0.7, 0.0, -0.4223956051027783, 0.0, 0.0, 0.0], [1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, -1.3, 0.0, 0.7, 0.0, 0.0, -0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.3, 0.0], [0.0, 0.0, -1.3, 0.0, -0.7, 0.0, 0.0, -0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.3, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235], [0.0, 0.0, 0.2274437873630345, 0.0, 1.7892964966125247, 0.0, 0.0, -0.4223956051027782, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9634673443298207, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665], [0.0, 0.0, 0.0, 0.2274437873630345, 0.0, 0.0, 0.0, 0.0, 0.0, -1.3, 1.3, 0.0, 0.9634673443298208, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.9899494936611665, 0.0, 0.0]], [[0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [-0.6363961030678927, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.619371864212028, 0.0, 0.0, 0.0, 0.0, 0.0, -0.55, -0.55, 0.0, -0.1462138633048078, 0.0, 0.0, 0.0], [0.0, 0.0, 0.619371864212028, 0.0, 0.17870583292809844, 0.0, 0.0, 0.7570100562591453, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1462138633048078, 0.0], [0.0, 0.0, 0.0, 0.17870583292809847, 0.0, 0.0, 0.0, 0.0, 0.0, -0.45, 0.45, 0.0, 0.757010056259145, 0.0, 0.0, 0.0], [0.0, -0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.7778174593052022, 0.0, 0.0], [0.0, 0.0, 0.0, 0.7570100562591453, 0.0, 0.0, 0.0, 0.0, 0.0, 0.45, 0.45, 0.0, -0.17870583292809847, 0.0, 0.0, 0.0], [0.7778174593052022, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, -0.55, 0.0, -0.45, 0.0, 0.0, 0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.55, 0.0], [0.0, 0.0, -0.55, 0.0, 0.45, 0.0, 0.0, 0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.55, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022], [0.0, 0.0, -0.14621386330480782, 0.0, 0.757010056259145, 0.0, 0.0, -0.17870583292809844, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6193718642120278, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927], [0.0, 0.0, 0.0, -0.1462138633048078, 0.0, 0.0, 0.0, 0.0, 0.0, -0.55, 0.55, 0.0, -0.6193718642120278, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, -0.6363961030678927, 0.0, 0.0]]], 'charge': [[[0.0, 0.0, 0.9899494936611665, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.9634673443298214, 0.0, 0.0, -1.3, 1.3, -0.2274437873630345, 0.0, 0.0, 0.0, 0.0, 0.0], [0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.42239560510277824, 0.0, 0.0, 0.7, 0.7, -1.7892964966125247, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.9634673443298214, 0.0, 0.0, -0.42239560510277824, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.7892964966125253, -0.2274437873630344, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 1.8384776310850235, 0.0], [0.0, 0.0, -1.8384776310850235, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -1.3, 0.0, 0.0, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7, -1.3, 0.0, 0.0], [0.0, 1.3, 0.0, 0.0, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7, -1.3, 0.0, 0.0], [0.0, -0.2274437873630345, 0.0, 0.0, -1.7892964966125247, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.42239560510277796, -0.9634673443298212, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235], [0.0, 0.0, 0.0, 0.0, 0.0, -1.7892964966125253, 0.0, 0.0, -0.7, 0.7, 0.42239560510277796, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.2274437873630344, 0.0, 0.0, -1.3, -1.3, -0.9634673443298212, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.0, 0.9899494936611665, 0.0]], [[0.0, 0.0, -0.6363961030678927, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.619371864212028, 0.0, 0.0, -0.55, 0.55, 0.14621386330480773, 0.0, 0.0, 0.0, 0.0, 0.0], [-0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.17870583292809847, 0.0, 0.0, -0.45, -0.45, -0.7570100562591451, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -0.619371864212028, 0.0, 0.0, -0.17870583292809847, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7570100562591453, 0.14621386330480785, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.7778174593052022, 0.0], [0.0, 0.0, -0.7778174593052022, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -0.55, 0.0, 0.0, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.45, -0.55, 0.0, 0.0], [0.0, 0.55, 0.0, 0.0, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.45, -0.55, 0.0, 0.0], [0.0, 0.14621386330480773, 0.0, 0.0, -0.7570100562591451, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.17870583292809855, 0.6193718642120277, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022], [0.0, 0.0, 0.0, 0.0, 0.0, -0.7570100562591453, 0.0, 0.0, 0.45, -0.45, 0.17870583292809855, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.14621386330480785, 0.0, 0.0, -0.55, -0.55, 0.6193718642120277, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, 0.0, -0.6363961030678927, 0.0]], [[0.0, 0.9899494936611665, 0.0, 0.0, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.9634673443298214, 0.0, 0.0, -1.3, -1.3, 0.2274437873630344, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.42239560510277824, 0.0, 0.0, 0.7, -0.7, 1.7892964966125247, 0.0, 0.0, 0.0, 0.0, 0.0], [1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, -0.9634673443298214, 0.42239560510277824, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.789296496612525, 0.0, 0.0, 0.22744378736303444, 0.0], [0.0, -1.8384776310850235, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 1.8384776310850235, 0.0, 0.0], [0.0, 0.0, -1.3, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7, 0.0, 0.0, -1.3, 0.0], [0.0, 0.0, -1.3, -0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7, 0.0, 0.0, 1.3, 0.0], [0.0, 0.0, 0.2274437873630344, 1.7892964966125247, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.4223956051027782, 0.0, 0.0, 0.9634673443298207, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 1.789296496612525, 0.0, 0.0, -0.7, -0.7, -0.4223956051027782, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665], [0.0, 0.0, 0.0, 0.0, 0.0, 0.22744378736303444, 0.0, 0.0, -1.3, 1.3, 0.9634673443298207, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.9899494936611665, 0.0, 0.0]], [[0.0, -0.6363961030678927, 0.0, 0.0, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [-0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.619371864212028, 0.0, 0.0, -0.55, -0.55, -0.1462138633048078, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.17870583292809847, 0.0, 0.0, -0.45, 0.45, 0.757010056259145, 0.0, 0.0, 0.0, 0.0, 0.0], [0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.619371864212028, 0.17870583292809847, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7570100562591453, 0.0, 0.0, -0.1462138633048078, 0.0], [0.0, -0.7778174593052022, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.7778174593052022, 0.0, 0.0], [0.0, 0.0, -0.55, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.45, 0.0, 0.0, -0.55, 0.0], [0.0, 0.0, -0.55, 0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.45, 0.0, 0.0, 0.55, 0.0], [0.0, 0.0, -0.1462138633048078, 0.757010056259145, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.17870583292809844, 0.0, 0.0, -0.6193718642120278, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.7570100562591453, 0.0, 0.0, 0.45, 0.45, -0.17870583292809844, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927], [0.0, 0.0, 0.0, 0.0, 0.0, -0.1462138633048078, 0.0, 0.0, -0.55, 0.55, -0.6193718642120278, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, -0.6363961030678927, 0.0, 0.0]]], 'sz': [[[0.0, 0.0, 0.0, 0.9899494936611665, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9634673443298214, -1.3, 1.3, -0.2274437873630345, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.42239560510277824, 0.7, 0.7, -1.7892964966125247, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0], [1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 1.8384776310850235, 0.0, 0.0, 0.0], [0.0, 0.9634673443298214, -0.42239560510277824, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.7892964966125253, -0.2274437873630344, 0.0], [0.0, -1.3, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7, -1.3, 0.0], [0.0, 1.3, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7, -1.3, 0.0], [0.0, -0.2274437873630345, -1.7892964966125247, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.42239560510277796, -0.9634673443298212, 0.0], [0.0, 0.0, 0.0, -1.8384776310850235, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235], [0.0, 0.0, 0.0, 0.0, 0.0, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.7892964966125253, -0.7, 0.7, 0.42239560510277796, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.2274437873630344, -1.3, -1.3, -0.9634673443298212, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.9899494936611665, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, -0.6363961030678927, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.619371864212028, -0.55, 0.55, 0.14621386330480773, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.17870583292809847, -0.45, -0.45, -0.7570100562591451, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [-0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0], [0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.7778174593052022, 0.0, 0.0, 0.0], [0.0, -0.619371864212028, -0.17870583292809847, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7570100562591453, 0.14621386330480785, 0.0], [0.0, -0.55, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.45, -0.55, 0.0], [0.0, 0.55, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.45, -0.55, 0.0], [0.0, 0.14621386330480773, -0.7570100562591451, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.17870583292809855, 0.6193718642120277, 0.0], [0.0, 0.0, 0.0, -0.7778174593052022, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022], [0.0, 0.0, 0.0, 0.0, 0.0, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7570100562591453, 0.45, -0.45, 0.17870583292809855, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.14621386330480785, -0.55, -0.55, 0.6193718642120277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, -0.6363961030678927, 0.0, 0.0, 0.0]], [[0.0, 0.9899494936611665, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.9899494936611665, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.9634673443298214, -1.3, -1.3, 0.2274437873630344, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.42239560510277824, 0.7, -0.7, 1.7892964966125247, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -1.8384776310850235, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.9634673443298214, 0.42239560510277824, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.789296496612525, 0.22744378736303444, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -1.3, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7, -1.3, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -1.3, -0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7, 1.3, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.2274437873630344, 1.7892964966125247, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.4223956051027782, 0.9634673443298207, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 1.8384776310850235, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.789296496612525, -0.7, -0.7, -0.4223956051027782, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.22744378736303444, -1.3, 1.3, 0.9634673443298207, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.9899494936611665, 0.0]], [[0.0, -0.6363961030678927, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [-0.6363961030678927, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.7778174593052022, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.619371864212028, -0.55, -0.55, -0.1462138633048078, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.17870583292809847, -0.45, 0.45, 0.757010056259145, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -0.7778174593052022, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.619371864212028, 0.17870583292809847, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7570100562591453, -0.1462138633048078, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.55, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.45, -0.55, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.55, 0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.45, 0.55, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.1462138633048078, 0.757010056259145, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.17870583292809844, -0.6193718642120278, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.7778174593052022, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7570100562591453, 0.45, 0.45, -0.17870583292809844, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1462138633048078, -0.55, 0.55, -0.6193718642120278, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, -0.6363961030678927, 0.0]]], 'ssq': [[[0.0, 0.0, 0.0, 0.9899494936611665, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9634673443298214, 1.3, -0.22744378736303428, -1.3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.4223956051027784, 0.7, -1.789296496612525, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0], [1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 1.8384776310850235, 0.0, 0.0, 0.0], [0.0, 0.9634673443298214, -0.4223956051027784, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.789296496612525, 0.2274437873630345, 0.0], [0.0, 1.3, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7, 1.3, 0.0], [0.0, -0.22744378736303428, -1.789296496612525, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.4223956051027786, 0.9634673443298214, 0.0], [0.0, -1.3, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7, 1.3, 0.0], [0.0, 0.0, 0.0, -1.8384776310850235, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235], [0.0, 0.0, 0.0, 0.0, 0.0, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.789296496612525, -0.7, -0.4223956051027786, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2274437873630345, 1.3, 0.9634673443298214, 1.3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.9899494936611665, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, -0.6363961030678927, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.619371864212028, 0.55, 0.146213863304808, -0.55, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.17870583292809852, -0.45, -0.7570100562591454, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [-0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0], [0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.7778174593052022, 0.0, 0.0, 0.0], [0.0, -0.619371864212028, -0.17870583292809852, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7570100562591453, -0.14621386330480785, 0.0], [0.0, 0.55, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.45, 0.55, 0.0], [0.0, 0.146213863304808, -0.7570100562591454, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.17870583292809852, -0.6193718642120278, 0.0], [0.0, -0.55, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.45, 0.55, 0.0], [0.0, 0.0, 0.0, -0.7778174593052022, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022], [0.0, 0.0, 0.0, 0.0, 0.0, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7570100562591453, 0.45, -0.17870583292809852, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.14621386330480785, 0.55, -0.6193718642120278, 0.55, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, -0.6363961030678927, 0.0, 0.0, 0.0]], [[0.0, 0.9899494936611665, 1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.9899494936611665, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [1.8384776310850235, 0.0, 0.0, 0.0, 0.0, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.9634673443298214, -1.3, 0.22744378736303428, -1.3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4223956051027784, -0.7, 1.789296496612525, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -1.8384776310850235, 0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.9634673443298214, 0.4223956051027784, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.789296496612525, 0.22744378736303444, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -1.3, -0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7, 1.3, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.22744378736303428, 1.789296496612525, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.42239560510277857, 0.9634673443298214, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -1.3, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7, -1.3, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.9899494936611665, -1.8384776310850235, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.789296496612525, -0.7, -0.42239560510277857, -0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.22744378736303444, 1.3, 0.9634673443298214, -1.3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.9899494936611665, 0.0, 0.0, 0.0, 0.0, 1.8384776310850235], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.8384776310850235, 0.0, 0.0, 0.0, 0.0, -0.9899494936611665], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.8384776310850235, -0.9899494936611665, 0.0]], [[0.0, -0.6363961030678927, 0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [-0.6363961030678927, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.7778174593052022, 0.0, 0.0, 0.0, 0.0, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.619371864212028, -0.55, -0.146213863304808, -0.55, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.17870583292809852, 0.45, 0.7570100562591454, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, -0.7778174593052022, -0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.619371864212028, 0.17870583292809852, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7570100562591453, -0.14621386330480785, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.55, 0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.45, 0.55, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.146213863304808, 0.7570100562591454, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.17870583292809855, -0.6193718642120278, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, -0.55, -0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.45, -0.55, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6363961030678927, -0.7778174593052022, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7570100562591453, 0.45, -0.17870583292809855, 0.45, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.14621386330480785, 0.55, -0.6193718642120278, -0.55, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6363961030678927, 0.0, 0.0, 0.0, 0.0, 0.7778174593052022], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.7778174593052022, 0.0, 0.0, 0.0, 0.0, 0.6363961030678927], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7778174593052022, 0.6363961030678927, 0.0]]]} p = ParametersDoubleDotSpinful() for indexing in ['Lin', 'charge', 'sz', 'ssq']: # 'Lin', 'charge', 'sz', 'ssq' si = StateIndexing(4, indexing=indexing) leads = LeadsTunneling(4, {}, si, {}, {}, {}) Tba0 = construct_Tba(leads, p.tleads) Tba = rotate_Tba(Tba0, p.vecs[indexing], si) assert norm(Tba - data[indexing]) < EPS def test_make_tleads_mtr_and_dict(): nsingle = 4 nleads = 4 si = StateIndexing(nsingle) si.nleads = nleads # tL, tR = 2.0, 1.0 tleads_dict = {(0,0): tL, (2,2): tL, (1,1): tR, (3,3): tR, (0,1): 0.3*tL, (2,3): 0.3*tL, (1,0): 0.1*tR, (3,2): 0.1*tR} tleads_list = [[0,0,tL], [2,2,tL], [1,1,tR], [3,3,tR], [0,1,0.3*tL], [2,3,0.3*tL], [1,0,0.1*tR], [3,2,0.1*tR]] tleads_mtr = [[tL, 0.3*tL, 0.0, 0.0], [0.1*tR, tR, 0.0, 0.0], [0.0, 0.0, tL, 0.3*tL], [0.0, 0.0, 0.1*tR, tR]] assert make_tleads_mtr(tleads_dict, nleads, nsingle, mtype=float).tolist() == tleads_mtr assert make_tleads_mtr(tleads_list, nleads, nsingle, mtype=float).tolist() == tleads_mtr assert make_tleads_dict(tleads_list, si) == tleads_dict assert make_tleads_dict(np.array(tleads_mtr), si) == tleads_dict assert make_tleads_dict(tleads_dict, si) == tleads_dict def test_make_array(): si = StateIndexing(0) si.nleads = 7 si.nleads_sym = 7 assert make_array(None, {0:0.3, 1:0.2, 2:0.1, 3:0.01, 6:1.0}, si).tolist() == [0.3, 0.2, 0.1, 0.01, 0., 0., 1.] assert make_array(None, 2, si).tolist() == [2, 2, 2, 2, 2, 2, 2] assert make_array_dlst(None, {0:0.3, 1:0.2, 2:0.1, 3:0.01, 6:1.0}, si).tolist() == [[-0.3,0.3], [-0.2,0.2], [-0.1,0.1], [-0.01,0.01], [0.,0.], [0.,0.], [-1.,1.]] def test_LeadsTunneling(): nsingle = 2 nleads = 4 t0, vbias, temp, dband = 0.1, 0.5, 1.0, 60.0 mulst = {0: vbias/2, 1: -vbias/2, 2: vbias/2, 3: -vbias/2} tlst = {0: temp, 1: temp, 2: temp, 3: temp} dlst = {0: dband, 1: dband, 2: dband, 3: dband} tleads = np.array([[t0,0], [t0,0], [0,t0], [0,t0]]) si = StateIndexing(nsingle) leads = LeadsTunneling(nleads, tleads, si, mulst, tlst, dlst) # assert leads.tleads == {(0,0):t0, (1,0):t0, (2,1):t0, (3,1):t0} assert leads.si.nleads == 4 assert leads.mulst.tolist() == [vbias/2, -vbias/2, vbias/2, -vbias/2] assert leads.tlst.tolist() == [temp, temp, temp, temp] assert leads.dlst.tolist() == [[-dband,dband], [-dband,dband], [-dband,dband], [-dband,dband]] # leads.add(tleads={(0,0):1.0, (1,0):2.0, (2,1):3.0, (3,1):4.0}, mulst={0:0.1, 1:0.2, 2:0.3, 3:0.4}, tlst={0:1.0, 1:2.0, 2:3.0, 3:4.0}, dlst={0:10.0, 1:20.0, 2:30.0, 3:40.0}) assert leads.tleads == {(0,0):t0+1.0, (1,0):t0+2.0, (2,1):t0+3.0, (3,1):t0+4.0} assert leads.mulst.tolist() == [vbias/2+0.1, -vbias/2+0.2, vbias/2+0.3, -vbias/2+0.4] assert leads.tlst.tolist() == [temp+1.0, temp+2.0, temp+3.0, temp+4.0] assert leads.dlst.tolist() == [[-dband-10.0,dband+10.0], [-dband-20.0,dband+20.0], [-dband-30.0,dband+30.0], [-dband-40.0,dband+40.0]] # leads.change(tleads={(0,0):t0, (1,0):t0, (2,1):t0, (3,1):t0}, mulst=[vbias/2, -vbias/2, vbias/2, -vbias/2], tlst=[temp, temp, temp, temp], dlst=[dband, dband, dband, dband]) # The change function introduces numerical errors to tleads assert norm( make_tleads_mtr(leads.tleads, 4, 2) - make_tleads_mtr({(0,0):t0, (1,0):t0, (2,1):t0, (3,1):t0}, 4, 2) ) < EPS assert leads.mulst.tolist() == [vbias/2, -vbias/2, vbias/2, -vbias/2] assert leads.tlst.tolist() == [temp, temp, temp, temp] assert leads.dlst.tolist() == [[-dband,dband], [-dband,dband], [-dband,dband], [-dband,dband]] # leads.change(mulst={0: 1.23}, tlst={1: 2.13}, dlst={2: 3.21}) assert leads.mulst.tolist() == [1.23, -vbias/2, vbias/2, -vbias/2] assert leads.tlst.tolist() == [temp, 2.13, temp, temp] assert leads.dlst.tolist() == [[-dband,dband], [-dband,dband], [-3.21,3.21], [-dband,dband]] leads.add(mulst={0: 1.23}, tlst={1: 2.13}, dlst={2: 3.21}) assert leads.mulst.tolist() == [2*1.23, -vbias/2, vbias/2, -vbias/2] assert leads.tlst.tolist() == [temp, 2*2.13, temp, temp] assert leads.dlst.tolist() == [[-dband,dband], [-dband,dband], [-2*3.21,2*3.21], [-dband,dband]] # leads.change(mulst=1, tlst=2, dlst=3) assert leads.mulst.tolist() == [1, 1, 1, 1] assert leads.tlst.tolist() == [2, 2, 2, 2] assert leads.dlst.tolist() == [[-3,3], [-3,3], [-3,3], [-3,3]] leads.change(mulst=[vbias/2, -vbias/2, vbias/2, -vbias/2], tlst=[temp, temp, temp, temp], dlst=[dband, dband, dband, dband]) leads.add(mulst=1, tlst=2, dlst=3) assert leads.mulst.tolist() == [vbias/2+1, -vbias/2+1, vbias/2+1, -vbias/2+1] assert leads.tlst.tolist() == [temp+2, temp+2, temp+2, temp+2] assert leads.dlst.tolist() == [[-dband-3,dband+3], [-dband-3,dband+3], [-dband-3,dband+3], [-dband-3,dband+3]] # leads.change(dlst=dband-10.0) leads.add(dlst=10.0) assert leads.dlst.tolist() == [[-dband,dband], [-dband,dband], [-dband,dband], [-dband,dband]] leads.change(dlst={0:(1,1), 3:(2,2)}) assert leads.dlst.tolist() == [[1,1], [-dband,dband], [-dband,dband], [2,2]] leads.add(dlst={0:(1,1), 3:(2,2)}) assert leads.dlst.tolist() == [[2,2], [-dband,dband], [-dband,dband], [4,4]] # Tba_tmp = np.array(leads.Tba) leads.Tba.fill(0.0) leads.use_Tba0() assert norm(leads.Tba - Tba_tmp) < EPS def test_LeadsTunneling_spin(): nsingle = 2 nleads = 4 t0, vbias, temp, dband = 0.1, 0.5, 1.0, 60.0 mulst = {0: vbias/2, 1: -vbias/2} tlst = {0: temp, 1: temp} dlst = {0: dband, 1: dband} tleads = np.array([[t0,0], [t0,0]]) si = StateIndexing(nsingle, symmetry='spin') leads = LeadsTunneling(nleads, tleads, si, mulst, tlst, dlst) # assert leads.tleads == {(0,0):t0, (1,0):t0, (2,1):t0, (3,1):t0} assert leads.si.nleads == 4 assert leads.mulst.tolist() == [vbias/2, -vbias/2, vbias/2, -vbias/2] assert leads.tlst.tolist() == [temp, temp, temp, temp] assert leads.dlst.tolist() == [[-dband,dband], [-dband,dband], [-dband,dband], [-dband,dband]] # leads.add(tleads={(0,0):1.0, (1,0):2.0}, mulst={0:0.1, 1:0.2}, tlst={0:1.0, 1:2.0}, dlst={0:10.0, 1:20.0}) assert leads.tleads == {(0,0):t0+1.0, (1,0):t0+2.0, (2,1):t0+1.0, (3,1):t0+2.0} assert leads.mulst.tolist() == [vbias/2+0.1, -vbias/2+0.2, vbias/2+0.1, -vbias/2+0.2] assert leads.tlst.tolist() == [temp+1.0, temp+2.0, temp+1.0, temp+2.0] assert leads.dlst.tolist() == [[-dband-10.0,dband+10.0], [-dband-20.0,dband+20.0], [-dband-10.0,dband+10.0], [-dband-20.0,dband+20.0]] # leads.change(tleads={(0,0):t0, (1,0):t0}, mulst=[vbias/2, -vbias/2], tlst=[temp, temp], dlst=[dband, dband]) # The change function introduces numerical errors to tleads assert norm( make_tleads_mtr(leads.tleads, 4, 2) - make_tleads_mtr({(0,0):t0, (1,0):t0, (2,1):t0, (3,1):t0}, 4, 2) ) < EPS assert leads.mulst.tolist() == [vbias/2, -vbias/2, vbias/2, -vbias/2] assert leads.tlst.tolist() == [temp, temp, temp, temp] assert leads.dlst.tolist() == [[-dband,dband], [-dband,dband], [-dband,dband], [-dband,dband]] # leads.change(mulst={0: 1.23}, tlst={1: 2.13}, dlst={1: 3.21}) assert leads.mulst.tolist() == [1.23, -vbias/2, 1.23, -vbias/2] assert leads.tlst.tolist() == [temp, 2.13, temp, 2.13] assert leads.dlst.tolist() == [[-dband,dband], [-3.21,3.21], [-dband,dband], [-3.21,3.21]] leads.add(mulst={0: 1.23}, tlst={1: 2.13}, dlst={1: 3.21}) assert leads.mulst.tolist() == [2*1.23, -vbias/2, 2*1.23, -vbias/2] assert leads.tlst.tolist() == [temp, 2*2.13, temp, 2*2.13] assert leads.dlst.tolist() == [[-dband,dband], [-2*3.21,2*3.21], [-dband,dband], [-2*3.21,2*3.21]] # leads.change(mulst=1, tlst=2, dlst=3) assert leads.mulst.tolist() == [1, 1, 1, 1] assert leads.tlst.tolist() == [2, 2, 2, 2] assert leads.dlst.tolist() == [[-3,3], [-3,3], [-3,3], [-3,3]] leads.change(mulst=[vbias/2, -vbias/2], tlst=[temp, temp], dlst=[dband, dband]) leads.add(mulst=1, tlst=2, dlst=3) assert leads.mulst.tolist() == [vbias/2+1, -vbias/2+1, vbias/2+1, -vbias/2+1] assert leads.tlst.tolist() == [temp+2, temp+2, temp+2, temp+2] assert leads.dlst.tolist() == [[-dband-3,dband+3], [-dband-3,dband+3], [-dband-3,dband+3], [-dband-3,dband+3]] # leads.change(dlst=dband-10.0) leads.add(dlst=10.0) assert leads.dlst.tolist() == [[-dband,dband], [-dband,dband], [-dband,dband], [-dband,dband]] leads.change(dlst={0:(1,1), 1:(2,2)}) assert leads.dlst.tolist() == [[1,1], [2,2], [1,1], [2,2]] leads.add(dlst={0:(1,1), 1:(2,2)}) assert leads.dlst.tolist() == [[2,2], [4,4], [2,2], [4,4]] # Tba_tmp = np.array(leads.Tba) leads.Tba.fill(0.0) leads.use_Tba0() assert norm(leads.Tba - Tba_tmp) < EPS
303.253165
7,347
0.503708
20,758
71,871
1.740726
0.007563
0.871977
1.212653
1.500526
0.969807
0.962805
0.957159
0.945647
0.936652
0.928488
0
0.517364
0.166242
71,871
236
7,348
304.538136
0.085643
0.002004
0
0.40796
0
0
0.001422
0
0
0
0
0
0.343284
1
0.039801
false
0
0.014925
0
0.059701
0
0
0
1
null
1
1
1
1
1
1
1
1
1
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
14
e017feebffe8196d8c226e1dcb046468918a3fc6
29,671
py
Python
test/test_dhcp6.py
pogobanane/vpp-fork
fccc95ae06e98a1605c4600b1e441811b67abfa8
[ "Apache-2.0" ]
2
2019-04-03T10:09:09.000Z
2020-09-23T08:56:24.000Z
test/test_dhcp6.py
pogobanane/vpp-fork
fccc95ae06e98a1605c4600b1e441811b67abfa8
[ "Apache-2.0" ]
2
2021-03-20T05:38:00.000Z
2021-06-02T03:49:49.000Z
test/test_dhcp6.py
AbduSami-bK/vpp
ad3f68b9d8c27206ab5dfbf129352a1c844a7004
[ "Apache-2.0" ]
1
2019-03-12T18:19:23.000Z
2019-03-12T18:19:23.000Z
from socket import AF_INET6 from scapy.layers.dhcp6 import DHCP6_Advertise, DHCP6OptClientId, \ DHCP6OptStatusCode, DHCP6OptPref, DHCP6OptIA_PD, DHCP6OptIAPrefix, \ DHCP6OptServerId, DHCP6_Solicit, DHCP6_Reply, DHCP6_Request, DHCP6_Renew, \ DHCP6_Rebind, DUID_LL, DHCP6_Release, DHCP6OptElapsedTime, DHCP6OptIA_NA, \ DHCP6OptIAAddress from scapy.layers.inet6 import IPv6, Ether, UDP from scapy.utils6 import in6_mactoifaceid from scapy.utils import inet_ntop, inet_pton from framework import VppTestCase import util def ip6_normalize(ip6): return inet_ntop(AF_INET6, inet_pton(AF_INET6, ip6)) class TestDHCPv6DataPlane(VppTestCase): """ DHCPv6 Data Plane Test Case """ @classmethod def setUpClass(cls): super(TestDHCPv6DataPlane, cls).setUpClass() @classmethod def tearDownClass(cls): super(TestDHCPv6DataPlane, cls).tearDownClass() def setUp(self): super(TestDHCPv6DataPlane, self).setUp() self.create_pg_interfaces(range(1)) self.interfaces = list(self.pg_interfaces) for i in self.interfaces: i.admin_up() i.config_ip6() self.server_duid = DUID_LL(lladdr=self.pg0.remote_mac) def tearDown(self): for i in self.interfaces: i.unconfig_ip6() i.admin_down() super(TestDHCPv6DataPlane, self).tearDown() def test_dhcp_ia_na_send_solicit_receive_advertise(self): """ Verify DHCPv6 IA NA Solicit packet and Advertise event """ self.vapi.dhcp6_clients_enable_disable() self.pg_enable_capture(self.pg_interfaces) self.pg_start() address_bin = '\00\01\00\02\00\03' + '\00' * 8 + '\00\05' address = {'address': address_bin, 'preferred_time': 60, 'valid_time': 120} self.vapi.dhcp6_send_client_message(msg_type=1, sw_if_index=self.pg0.sw_if_index, T1=20, T2=40, addresses=[address], n_addresses=len([address])) rx_list = self.pg0.get_capture(1) self.assertEqual(len(rx_list), 1) packet = rx_list[0] self.assertEqual(packet.haslayer(IPv6), 1) self.assertEqual(packet[IPv6].haslayer(DHCP6_Solicit), 1) client_duid = packet[DHCP6OptClientId].duid trid = packet[DHCP6_Solicit].trid dst = ip6_normalize(packet[IPv6].dst) dst2 = ip6_normalize("ff02::1:2") self.assert_equal(dst, dst2) src = ip6_normalize(packet[IPv6].src) src2 = ip6_normalize(self.pg0.local_ip6_ll) self.assert_equal(src, src2) ia_na = packet[DHCP6OptIA_NA] self.assert_equal(ia_na.T1, 20) self.assert_equal(ia_na.T2, 40) self.assert_equal(len(ia_na.ianaopts), 1) address = ia_na.ianaopts[0] self.assert_equal(address.addr, '1:2:3::5') self.assert_equal(address.preflft, 60) self.assert_equal(address.validlft, 120) self.vapi.want_dhcp6_reply_events() try: ia_na_opts = DHCP6OptIAAddress(addr='7:8::2', preflft=60, validlft=120) p = (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) / IPv6(src=util.mk_ll_addr(self.pg0.remote_mac), dst=self.pg0.local_ip6_ll) / UDP(sport=547, dport=546) / DHCP6_Advertise(trid=trid) / DHCP6OptServerId(duid=self.server_duid) / DHCP6OptClientId(duid=client_duid) / DHCP6OptPref(prefval=7) / DHCP6OptStatusCode(statuscode=1) / DHCP6OptIA_NA(iaid=1, T1=20, T2=40, ianaopts=ia_na_opts) ) self.pg0.add_stream([p]) self.pg_start() ev = self.vapi.wait_for_event(1, "dhcp6_reply_event") self.assert_equal(ev.preference, 7) self.assert_equal(ev.status_code, 1) self.assert_equal(ev.T1, 20) self.assert_equal(ev.T2, 40) reported_address = ev.addresses[0] address = inet_pton(AF_INET6, ia_na_opts.getfieldval("addr")) self.assert_equal(reported_address.address, address) self.assert_equal(reported_address.preferred_time, ia_na_opts.getfieldval("preflft")) self.assert_equal(reported_address.valid_time, ia_na_opts.getfieldval("validlft")) finally: self.vapi.want_dhcp6_reply_events(enable_disable=0) def test_dhcp_pd_send_solicit_receive_advertise(self): """ Verify DHCPv6 PD Solicit packet and Advertise event """ self.vapi.dhcp6_clients_enable_disable() self.pg_enable_capture(self.pg_interfaces) self.pg_start() prefix_bin = '\00\01\00\02\00\03' + '\00' * 10 prefix = {'prefix': prefix_bin, 'prefix_length': 50, 'preferred_time': 60, 'valid_time': 120} self.vapi.dhcp6_pd_send_client_message(1, self.pg0.sw_if_index, T1=20, T2=40, prefixes=[prefix]) rx_list = self.pg0.get_capture(1) self.assertEqual(len(rx_list), 1) packet = rx_list[0] self.assertEqual(packet.haslayer(IPv6), 1) self.assertEqual(packet[IPv6].haslayer(DHCP6_Solicit), 1) client_duid = packet[DHCP6OptClientId].duid trid = packet[DHCP6_Solicit].trid dst = ip6_normalize(packet[IPv6].dst) dst2 = ip6_normalize("ff02::1:2") self.assert_equal(dst, dst2) src = ip6_normalize(packet[IPv6].src) src2 = ip6_normalize(self.pg0.local_ip6_ll) self.assert_equal(src, src2) ia_pd = packet[DHCP6OptIA_PD] self.assert_equal(ia_pd.T1, 20) self.assert_equal(ia_pd.T2, 40) self.assert_equal(len(ia_pd.iapdopt), 1) prefix = ia_pd.iapdopt[0] self.assert_equal(prefix.prefix, '1:2:3::') self.assert_equal(prefix.plen, 50) self.assert_equal(prefix.preflft, 60) self.assert_equal(prefix.validlft, 120) self.vapi.want_dhcp6_pd_reply_events() try: ia_pd_opts = DHCP6OptIAPrefix(prefix='7:8::', plen=56, preflft=60, validlft=120) p = (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) / IPv6(src=util.mk_ll_addr(self.pg0.remote_mac), dst=self.pg0.local_ip6_ll) / UDP(sport=547, dport=546) / DHCP6_Advertise(trid=trid) / DHCP6OptServerId(duid=self.server_duid) / DHCP6OptClientId(duid=client_duid) / DHCP6OptPref(prefval=7) / DHCP6OptStatusCode(statuscode=1) / DHCP6OptIA_PD(iaid=1, T1=20, T2=40, iapdopt=ia_pd_opts) ) self.pg0.add_stream([p]) self.pg_start() ev = self.vapi.wait_for_event(1, "dhcp6_pd_reply_event") self.assert_equal(ev.preference, 7) self.assert_equal(ev.status_code, 1) self.assert_equal(ev.T1, 20) self.assert_equal(ev.T2, 40) reported_prefix = ev.prefixes[0] prefix = inet_pton(AF_INET6, ia_pd_opts.getfieldval("prefix")) self.assert_equal(reported_prefix.prefix, prefix) self.assert_equal(reported_prefix.prefix_length, ia_pd_opts.getfieldval("plen")) self.assert_equal(reported_prefix.preferred_time, ia_pd_opts.getfieldval("preflft")) self.assert_equal(reported_prefix.valid_time, ia_pd_opts.getfieldval("validlft")) finally: self.vapi.want_dhcp6_pd_reply_events(enable_disable=0) class TestDHCPv6IANAControlPlane(VppTestCase): """ DHCPv6 IA NA Control Plane Test Case """ @classmethod def setUpClass(cls): super(TestDHCPv6IANAControlPlane, cls).setUpClass() @classmethod def tearDownClass(cls): super(TestDHCPv6IANAControlPlane, cls).tearDownClass() def setUp(self): super(TestDHCPv6IANAControlPlane, self).setUp() self.create_pg_interfaces(range(1)) self.interfaces = list(self.pg_interfaces) for i in self.interfaces: i.admin_up() self.server_duid = DUID_LL(lladdr=self.pg0.remote_mac) self.client_duid = None self.T1 = 1 self.T2 = 2 fib = self.vapi.ip6_fib_dump() self.initial_addresses = set(self.get_interface_addresses(fib, self.pg0)) self.pg_enable_capture(self.pg_interfaces) self.pg_start() self.vapi.dhcp6_client_enable_disable(self.pg0.sw_if_index) def tearDown(self): self.vapi.dhcp6_client_enable_disable(self.pg0.sw_if_index, enable=0) for i in self.interfaces: i.admin_down() super(TestDHCPv6IANAControlPlane, self).tearDown() @staticmethod def get_interface_addresses(fib, pg): lst = [] for entry in fib: if entry.address_length == 128: path = entry.path[0] if path.sw_if_index == pg.sw_if_index: lst.append(entry.address) return lst def get_addresses(self): fib = self.vapi.ip6_fib_dump() addresses = set(self.get_interface_addresses(fib, self.pg0)) return addresses.difference(self.initial_addresses) def validate_duid_ll(self, duid): DUID_LL(duid) def validate_packet(self, packet, msg_type, is_resend=False): try: self.assertEqual(packet.haslayer(msg_type), 1) client_duid = packet[DHCP6OptClientId].duid if self.client_duid is None: self.client_duid = client_duid self.validate_duid_ll(client_duid) else: self.assertEqual(self.client_duid, client_duid) if msg_type != DHCP6_Solicit and msg_type != DHCP6_Rebind: server_duid = packet[DHCP6OptServerId].duid self.assertEqual(server_duid, self.server_duid) if is_resend: self.assertEqual(self.trid, packet[msg_type].trid) else: self.trid = packet[msg_type].trid ip = packet[IPv6] udp = packet[UDP] self.assertEqual(ip.dst, 'ff02::1:2') self.assertEqual(udp.sport, 546) self.assertEqual(udp.dport, 547) dhcpv6 = packet[msg_type] elapsed_time = dhcpv6[DHCP6OptElapsedTime] if (is_resend): self.assertNotEqual(elapsed_time.elapsedtime, 0) else: self.assertEqual(elapsed_time.elapsedtime, 0) except: packet.show() raise def wait_for_packet(self, msg_type, timeout=None, is_resend=False): if timeout is None: timeout = 3 rx_list = self.pg0.get_capture(1, timeout=timeout) packet = rx_list[0] self.validate_packet(packet, msg_type, is_resend=is_resend) def wait_for_solicit(self, timeout=None, is_resend=False): self.wait_for_packet(DHCP6_Solicit, timeout, is_resend=is_resend) def wait_for_request(self, timeout=None, is_resend=False): self.wait_for_packet(DHCP6_Request, timeout, is_resend=is_resend) def wait_for_renew(self, timeout=None, is_resend=False): self.wait_for_packet(DHCP6_Renew, timeout, is_resend=is_resend) def wait_for_rebind(self, timeout=None, is_resend=False): self.wait_for_packet(DHCP6_Rebind, timeout, is_resend=is_resend) def wait_for_release(self, timeout=None, is_resend=False): self.wait_for_packet(DHCP6_Release, timeout, is_resend=is_resend) def send_packet(self, msg_type, t1=None, t2=None, ianaopts=None): if t1 is None: t1 = self.T1 if t2 is None: t2 = self.T2 if ianaopts is None: opt_ia_na = DHCP6OptIA_NA(iaid=1, T1=t1, T2=t2) else: opt_ia_na = DHCP6OptIA_NA(iaid=1, T1=t1, T2=t2, ianaopts=ianaopts) p = (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) / IPv6(src=util.mk_ll_addr(self.pg0.remote_mac), dst=self.pg0.local_ip6_ll) / UDP(sport=547, dport=546) / msg_type(trid=self.trid) / DHCP6OptServerId(duid=self.server_duid) / DHCP6OptClientId(duid=self.client_duid) / opt_ia_na ) self.pg0.add_stream([p]) self.pg_enable_capture(self.pg_interfaces) self.pg_start() def send_advertise(self, t1=None, t2=None, ianaopts=None): self.send_packet(DHCP6_Advertise, t1, t2, ianaopts) def send_reply(self, t1=None, t2=None, ianaopts=None): self.send_packet(DHCP6_Reply, t1, t2, ianaopts) def test_T1_and_T2_timeouts(self): """ Test T1 and T2 timeouts """ self.wait_for_solicit() self.send_advertise() self.wait_for_request() self.send_reply() self.sleep(1) self.wait_for_renew() self.pg_enable_capture(self.pg_interfaces) self.sleep(1) self.wait_for_rebind() def test_addresses(self): """ Test handling of addresses """ ia_na_opts = DHCP6OptIAAddress(addr='7:8::2', preflft=1, validlft=2) self.wait_for_solicit() self.send_advertise(t1=20, t2=40, ianaopts=ia_na_opts) self.wait_for_request() self.send_reply(t1=20, t2=40, ianaopts=ia_na_opts) self.sleep(0.1) # check FIB for new address new_addresses = self.get_addresses() self.assertEqual(len(new_addresses), 1) addr = list(new_addresses)[0] self.assertEqual(inet_ntop(AF_INET6, addr), '7:8::2') self.sleep(2) # check that the address is deleted fib = self.vapi.ip6_fib_dump() addresses = set(self.get_interface_addresses(fib, self.pg0)) new_addresses = addresses.difference(self.initial_addresses) self.assertEqual(len(new_addresses), 0) def test_sending_client_messages_solicit(self): """ VPP receives messages from DHCPv6 client """ self.wait_for_solicit() self.send_packet(DHCP6_Solicit) self.send_packet(DHCP6_Request) self.send_packet(DHCP6_Renew) self.send_packet(DHCP6_Rebind) self.sleep(1) self.wait_for_solicit(is_resend=True) def test_sending_inappropriate_packets(self): """ Server sends messages with inappropriate message types """ self.wait_for_solicit() self.send_reply() self.wait_for_solicit(is_resend=True) self.send_advertise() self.wait_for_request() self.send_advertise() self.wait_for_request(is_resend=True) self.send_reply() self.wait_for_renew() def test_no_address_available_in_advertise(self): """ Advertise message contains NoAddrsAvail status code """ self.wait_for_solicit() noavail = DHCP6OptStatusCode(statuscode=2) # NoAddrsAvail self.send_advertise(ianaopts=noavail) self.wait_for_solicit(is_resend=True) def test_preferred_greater_than_valid_lifetime(self): """ Preferred lifetime is greater than valid lifetime """ self.wait_for_solicit() self.send_advertise() self.wait_for_request() ia_na_opts = DHCP6OptIAAddress(addr='7:8::2', preflft=4, validlft=3) self.send_reply(ianaopts=ia_na_opts) self.sleep(0.5) # check FIB contains no addresses fib = self.vapi.ip6_fib_dump() addresses = set(self.get_interface_addresses(fib, self.pg0)) new_addresses = addresses.difference(self.initial_addresses) self.assertEqual(len(new_addresses), 0) def test_T1_greater_than_T2(self): """ T1 is greater than T2 """ self.wait_for_solicit() self.send_advertise() self.wait_for_request() ia_na_opts = DHCP6OptIAAddress(addr='7:8::2', preflft=4, validlft=8) self.send_reply(t1=80, t2=40, ianaopts=ia_na_opts) self.sleep(0.5) # check FIB contains no addresses fib = self.vapi.ip6_fib_dump() addresses = set(self.get_interface_addresses(fib, self.pg0)) new_addresses = addresses.difference(self.initial_addresses) self.assertEqual(len(new_addresses), 0) class TestDHCPv6PDControlPlane(VppTestCase): """ DHCPv6 PD Control Plane Test Case """ @classmethod def setUpClass(cls): super(TestDHCPv6PDControlPlane, cls).setUpClass() @classmethod def tearDownClass(cls): super(TestDHCPv6PDControlPlane, cls).tearDownClass() def setUp(self): super(TestDHCPv6PDControlPlane, self).setUp() self.create_pg_interfaces(range(2)) self.interfaces = list(self.pg_interfaces) for i in self.interfaces: i.admin_up() self.server_duid = DUID_LL(lladdr=self.pg0.remote_mac) self.client_duid = None self.T1 = 1 self.T2 = 2 fib = self.vapi.ip6_fib_dump() self.initial_addresses = set(self.get_interface_addresses(fib, self.pg1)) self.pg_enable_capture(self.pg_interfaces) self.pg_start() self.prefix_group = 'my-pd-prefix-group' self.vapi.dhcp6_pd_client_enable_disable( self.pg0.sw_if_index, prefix_group=self.prefix_group) def tearDown(self): self.vapi.dhcp6_pd_client_enable_disable(self.pg0.sw_if_index, enable=0) for i in self.interfaces: i.admin_down() super(TestDHCPv6PDControlPlane, self).tearDown() @staticmethod def get_interface_addresses(fib, pg): lst = [] for entry in fib: if entry.address_length == 128: path = entry.path[0] if path.sw_if_index == pg.sw_if_index: lst.append(entry.address) return lst def get_addresses(self): fib = self.vapi.ip6_fib_dump() addresses = set(self.get_interface_addresses(fib, self.pg1)) return addresses.difference(self.initial_addresses) def validate_duid_ll(self, duid): DUID_LL(duid) def validate_packet(self, packet, msg_type, is_resend=False): try: self.assertEqual(packet.haslayer(msg_type), 1) client_duid = packet[DHCP6OptClientId].duid if self.client_duid is None: self.client_duid = client_duid self.validate_duid_ll(client_duid) else: self.assertEqual(self.client_duid, client_duid) if msg_type != DHCP6_Solicit and msg_type != DHCP6_Rebind: server_duid = packet[DHCP6OptServerId].duid self.assertEqual(server_duid, self.server_duid) if is_resend: self.assertEqual(self.trid, packet[msg_type].trid) else: self.trid = packet[msg_type].trid ip = packet[IPv6] udp = packet[UDP] self.assertEqual(ip.dst, 'ff02::1:2') self.assertEqual(udp.sport, 546) self.assertEqual(udp.dport, 547) dhcpv6 = packet[msg_type] elapsed_time = dhcpv6[DHCP6OptElapsedTime] if (is_resend): self.assertNotEqual(elapsed_time.elapsedtime, 0) else: self.assertEqual(elapsed_time.elapsedtime, 0) except: packet.show() raise def wait_for_packet(self, msg_type, timeout=None, is_resend=False): if timeout is None: timeout = 3 rx_list = self.pg0.get_capture(1, timeout=timeout) packet = rx_list[0] self.validate_packet(packet, msg_type, is_resend=is_resend) def wait_for_solicit(self, timeout=None, is_resend=False): self.wait_for_packet(DHCP6_Solicit, timeout, is_resend=is_resend) def wait_for_request(self, timeout=None, is_resend=False): self.wait_for_packet(DHCP6_Request, timeout, is_resend=is_resend) def wait_for_renew(self, timeout=None, is_resend=False): self.wait_for_packet(DHCP6_Renew, timeout, is_resend=is_resend) def wait_for_rebind(self, timeout=None, is_resend=False): self.wait_for_packet(DHCP6_Rebind, timeout, is_resend=is_resend) def wait_for_release(self, timeout=None, is_resend=False): self.wait_for_packet(DHCP6_Release, timeout, is_resend=is_resend) def send_packet(self, msg_type, t1=None, t2=None, iapdopt=None): if t1 is None: t1 = self.T1 if t2 is None: t2 = self.T2 if iapdopt is None: opt_ia_pd = DHCP6OptIA_PD(iaid=1, T1=t1, T2=t2) else: opt_ia_pd = DHCP6OptIA_PD(iaid=1, T1=t1, T2=t2, iapdopt=iapdopt) p = (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) / IPv6(src=util.mk_ll_addr(self.pg0.remote_mac), dst=self.pg0.local_ip6_ll) / UDP(sport=547, dport=546) / msg_type(trid=self.trid) / DHCP6OptServerId(duid=self.server_duid) / DHCP6OptClientId(duid=self.client_duid) / opt_ia_pd ) self.pg0.add_stream([p]) self.pg_enable_capture(self.pg_interfaces) self.pg_start() def send_advertise(self, t1=None, t2=None, iapdopt=None): self.send_packet(DHCP6_Advertise, t1, t2, iapdopt) def send_reply(self, t1=None, t2=None, iapdopt=None): self.send_packet(DHCP6_Reply, t1, t2, iapdopt) def test_T1_and_T2_timeouts(self): """ Test T1 and T2 timeouts """ self.wait_for_solicit() self.send_advertise() self.wait_for_request() self.send_reply() self.sleep(1) self.wait_for_renew() self.pg_enable_capture(self.pg_interfaces) self.sleep(1) self.wait_for_rebind() def test_prefixes(self): """ Test handling of prefixes """ address_bin_1 = None address_bin_2 = None try: address_bin_1 = '\x00' * 6 + '\x00\x02' + '\x00' * 6 + '\x04\x05' address_prefix_length_1 = 60 self.vapi.ip6_add_del_address_using_prefix(self.pg1.sw_if_index, address_bin_1, address_prefix_length_1, self.prefix_group) ia_pd_opts = DHCP6OptIAPrefix(prefix='7:8::', plen=56, preflft=2, validlft=3) self.wait_for_solicit() self.send_advertise(t1=20, t2=40, iapdopt=ia_pd_opts) self.wait_for_request() self.send_reply(t1=20, t2=40, iapdopt=ia_pd_opts) self.sleep(0.1) # check FIB for new address new_addresses = self.get_addresses() self.assertEqual(len(new_addresses), 1) addr = list(new_addresses)[0] self.assertEqual(inet_ntop(AF_INET6, addr), '7:8:0:2::405') self.sleep(1) address_bin_2 = '\x00' * 6 + '\x00\x76' + '\x00' * 6 + '\x04\x06' address_prefix_length_2 = 62 self.vapi.ip6_add_del_address_using_prefix(self.pg1.sw_if_index, address_bin_2, address_prefix_length_2, self.prefix_group) self.sleep(1) # check FIB contains 2 addresses fib = self.vapi.ip6_fib_dump() addresses = set(self.get_interface_addresses(fib, self.pg1)) new_addresses = addresses.difference(self.initial_addresses) self.assertEqual(len(new_addresses), 2) addr1 = list(new_addresses)[0] addr2 = list(new_addresses)[1] if inet_ntop(AF_INET6, addr1) == '7:8:0:76::406': addr1, addr2 = addr2, addr1 self.assertEqual(inet_ntop(AF_INET6, addr1), '7:8:0:2::405') self.assertEqual(inet_ntop(AF_INET6, addr2), '7:8:0:76::406') self.sleep(1) # check that the addresses are deleted fib = self.vapi.ip6_fib_dump() addresses = set(self.get_interface_addresses(fib, self.pg1)) new_addresses = addresses.difference(self.initial_addresses) self.assertEqual(len(new_addresses), 0) finally: if address_bin_1 is not None: self.vapi.ip6_add_del_address_using_prefix( self.pg1.sw_if_index, address_bin_1, address_prefix_length_1, self.prefix_group, is_add=0) if address_bin_2 is not None: self.vapi.ip6_add_del_address_using_prefix( self.pg1.sw_if_index, address_bin_2, address_prefix_length_2, self.prefix_group, is_add=0) def test_sending_client_messages_solicit(self): """ VPP receives messages from DHCPv6 client """ self.wait_for_solicit() self.send_packet(DHCP6_Solicit) self.send_packet(DHCP6_Request) self.send_packet(DHCP6_Renew) self.send_packet(DHCP6_Rebind) self.sleep(1) self.wait_for_solicit(is_resend=True) def test_sending_inappropriate_packets(self): """ Server sends messages with inappropriate message types """ self.wait_for_solicit() self.send_reply() self.wait_for_solicit(is_resend=True) self.send_advertise() self.wait_for_request() self.send_advertise() self.wait_for_request(is_resend=True) self.send_reply() self.wait_for_renew() def test_no_prefix_available_in_advertise(self): """ Advertise message contains NoPrefixAvail status code """ self.wait_for_solicit() noavail = DHCP6OptStatusCode(statuscode=6) # NoPrefixAvail self.send_advertise(iapdopt=noavail) self.wait_for_solicit(is_resend=True) def test_preferred_greater_than_valid_lifetime(self): """ Preferred lifetime is greater than valid lifetime """ try: address_bin = '\x00' * 6 + '\x00\x02' + '\x00' * 6 + '\x04\x05' address_prefix_length = 60 self.vapi.ip6_add_del_address_using_prefix(self.pg1.sw_if_index, address_bin, address_prefix_length, self.prefix_group) self.wait_for_solicit() self.send_advertise() self.wait_for_request() ia_pd_opts = DHCP6OptIAPrefix(prefix='7:8::', plen=56, preflft=4, validlft=3) self.send_reply(iapdopt=ia_pd_opts) self.sleep(0.5) # check FIB contains no addresses fib = self.vapi.ip6_fib_dump() addresses = set(self.get_interface_addresses(fib, self.pg1)) new_addresses = addresses.difference(self.initial_addresses) self.assertEqual(len(new_addresses), 0) finally: self.vapi.ip6_add_del_address_using_prefix(self.pg1.sw_if_index, address_bin, address_prefix_length, self.prefix_group, is_add=0) def test_T1_greater_than_T2(self): """ T1 is greater than T2 """ try: address_bin = '\x00' * 6 + '\x00\x02' + '\x00' * 6 + '\x04\x05' address_prefix_length = 60 self.vapi.ip6_add_del_address_using_prefix(self.pg1.sw_if_index, address_bin, address_prefix_length, self.prefix_group) self.wait_for_solicit() self.send_advertise() self.wait_for_request() ia_pd_opts = DHCP6OptIAPrefix(prefix='7:8::', plen=56, preflft=4, validlft=8) self.send_reply(t1=80, t2=40, iapdopt=ia_pd_opts) self.sleep(0.5) # check FIB contains no addresses fib = self.vapi.ip6_fib_dump() addresses = set(self.get_interface_addresses(fib, self.pg1)) new_addresses = addresses.difference(self.initial_addresses) self.assertEqual(len(new_addresses), 0) finally: self.vapi.ip6_add_del_address_using_prefix(self.pg1.sw_if_index, address_bin, address_prefix_length, self.prefix_group, is_add=0)
37.797452
79
0.5927
3,583
29,671
4.639967
0.070332
0.026105
0.031759
0.021654
0.865684
0.847459
0.826887
0.787609
0.770045
0.738286
0
0.03936
0.31155
29,671
784
80
37.845663
0.774514
0.036264
0
0.723051
0
0
0.016438
0
0.00995
0
0
0
0.114428
1
0.091211
false
0
0.011609
0.001658
0.116086
0
0
0
0
null
0
0
0
1
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
7
e02aa8e977f63bd646308a30ce83ae2d817d6628
18,921
py
Python
alastria_identity/services/contracts.py
alejandroalffer/alastria-identity-lib-py
4db82fc905fcfa48749cf6908a8dcfb462a5ff81
[ "MIT" ]
1
2021-04-22T21:22:15.000Z
2021-04-22T21:22:15.000Z
alastria_identity/services/contracts.py
alejandroalffer/alastria-identity-lib-py
4db82fc905fcfa48749cf6908a8dcfb462a5ff81
[ "MIT" ]
null
null
null
alastria_identity/services/contracts.py
alejandroalffer/alastria-identity-lib-py
4db82fc905fcfa48749cf6908a8dcfb462a5ff81
[ "MIT" ]
null
null
null
from web3 import Web3 from web3.contract import Contract IDENTITY_MANAGER_ADDRESS = '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9' PUBLIC_KEY_REGISTRY_ADDRESS = '0x4958091227bbfbe1fdfc0fd79fc44844dc014ca0' PRESENTATION_REGISTRY_ADDRESS = '0x54d1dbfacada17ff39f2bac08e05fbdb4659f671' CREDENTIAL_REGISTRY_ADDRESS = '0x7bbca11cbd86b562136d5708eba40f4bc0aa1ddc' class ContractsService: @staticmethod def AlastriaIdentityEntity(endpoint: Web3) -> Contract: # TODO get the ABI from autogenerated config return endpoint.eth.contract( abi=[{"inputs":[],"payable":False,"stateMutability":"nonpayable","type":"constructor"},{"constant":False,"inputs":[{"internalType":"address","name":"_addressEntity","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_cif","type":"string"},{"internalType":"string","name":"_url_logo","type":"string"},{"internalType":"string","name":"_url_createAID","type":"string"},{"internalType":"string","name":"_url_AOA","type":"string"},{"internalType":"bool","name":"_active","type":"bool"}],"name":"addEntity","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"internalType":"address","name":"_addressEntity","type":"address"},{"internalType":"string","name":"_name","type":"string"}],"name":"setNameEntity","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"internalType":"address","name":"_addressEntity","type":"address"},{"internalType":"string","name":"_cif","type":"string"}],"name":"setCifEntity","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"internalType":"address","name":"_addressEntity","type":"address"},{"internalType":"string","name":"_url_logo","type":"string"}],"name":"setUrlLogo","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"internalType":"address","name":"_addressEntity","type":"address"},{"internalType":"string","name":"_url_createAID","type":"string"}],"name":"setUrlCreateAID","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"internalType":"address","name":"_addressEntity","type":"address"},{"internalType":"string","name":"_url_AOA","type":"string"}],"name":"setUrlAOA","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[{"internalType":"address","name":"_addressEntity","type":"address"}],"name":"getEntity","outputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_cif","type":"string"},{"internalType":"string","name":"_url_logo","type":"string"},{"internalType":"string","name":"_url_createAID","type":"string"},{"internalType":"string","name":"_url_AOA","type":"string"},{"internalType":"bool","name":"_active","type":"bool"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[],"name":"entitiesList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"payable":False,"stateMutability":"view","type":"function"}] ) @staticmethod def AlastriaIdentityManager(endpoint: Web3) -> Contract: # TODO get the ABI from autogenerated config return endpoint.eth.contract( abi=[{"constant":True,"inputs":[{"name":"","type":"address"}],"name":"identityKeys","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"_identityIssuer","type":"address"}],"name":"getEidasLevel","outputs":[{"name":"","type":"uint8"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"_identityServiceProvider","type":"address"}],"name":"addIdentityServiceProvider","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"_addressEntity","type":"address"},{"name":"_url_logo","type":"string"}],"name":"setUrlLogo","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"newOwner","type":"address"}],"name":"transfer","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"_addressEntity","type":"address"},{"name":"_cif","type":"string"}],"name":"setCifEntity","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[{"name":"","type":"address"}],"name":"pendingIDs","outputs":[{"name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"addr","type":"address"}],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"_identityServiceProvider","type":"address"}],"name":"deleteIdentityServiceProvider","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"alastriaPresentationRegistry","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"_identityIssuer","type":"address"},{"name":"_level","type":"uint8"}],"name":"updateIdentityIssuerEidasLevel","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"_signAddress","type":"address"}],"name":"prepareAlastriaID","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"_addressEntity","type":"address"},{"name":"_url_createAID","type":"string"}],"name":"setUrlCreateAID","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"version","outputs":[{"name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"_destination","type":"address"},{"name":"_value","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"delegateCall","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[{"name":"_identityIssuer","type":"address"}],"name":"isIdentityIssuer","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"addPublicKeyCallData","type":"bytes"}],"name":"createAlastriaIdentity","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"entitiesList","outputs":[{"name":"","type":"address[]"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"_addressEntity","type":"address"}],"name":"getEntity","outputs":[{"name":"_name","type":"string"},{"name":"_cif","type":"string"},{"name":"_url_logo","type":"string"},{"name":"_url_createAID","type":"string"},{"name":"_url_AOA","type":"string"},{"name":"_active","type":"bool"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"_identityIssuer","type":"address"},{"name":"_level","type":"uint8"}],"name":"addIdentityIssuer","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"_addressEntity","type":"address"},{"name":"_url_AOA","type":"string"}],"name":"setUrlAOA","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"_addressEntity","type":"address"},{"name":"_name","type":"string"},{"name":"_cif","type":"string"},{"name":"_url_logo","type":"string"},{"name":"_url_createAID","type":"string"},{"name":"_url_AOA","type":"string"},{"name":"_active","type":"bool"}],"name":"addEntity","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"accountLost","type":"address"},{"name":"newAccount","type":"address"}],"name":"recoverAccount","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"_identityIssuer","type":"address"}],"name":"deleteIdentityIssuer","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[{"name":"_identityServiceProvider","type":"address"}],"name":"isIdentityServiceProvider","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[],"name":"alastriaCredentialRegistry","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"_addressEntity","type":"address"},{"name":"_name","type":"string"}],"name":"setNameEntity","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"alastriaPublicKeyRegistry","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_version","type":"uint256"}],"payable":False,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":False,"inputs":[{"indexed":True,"name":"signAddress","type":"address"}],"name":"PreparedAlastriaID","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"name":"method","type":"string"}],"name":"OperationWasNotSupported","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"name":"identity","type":"address"},{"indexed":True,"name":"creator","type":"address"},{"indexed":False,"name":"owner","type":"address"}],"name":"IdentityCreated","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"name":"oldAccount","type":"address"},{"indexed":False,"name":"newAccount","type":"address"},{"indexed":True,"name":"serviceProvider","type":"address"}],"name":"IdentityRecovered","type":"event"}] ) @staticmethod def AlastriaPublicKeyRegistry(endpoint: Web3) -> Contract: # TODO get the ABI from autogenerated config return endpoint.eth.contract( abi=[{"constant":True,"inputs":[{"name":"subject","type":"address"},{"name":"publicKey","type":"bytes32"}],"name":"getPublicKeyStatus","outputs":[{"name":"exists","type":"bool"},{"name":"status","type":"uint8"},{"name":"startDate","type":"uint256"},{"name":"endDate","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"subject","type":"address"}],"name":"getCurrentPublicKey","outputs":[{"name":"","type":"string"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"publicKey","type":"string"}],"name":"deletePublicKey","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"publicKey","type":"string"}],"name":"addKey","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"version","outputs":[{"name":"","type":"int256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[],"name":"previousPublishedVersion","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"publicKeyList","outputs":[{"name":"","type":"string"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"publicKey","type":"string"}],"name":"revokePublicKey","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_previousPublishedVersion","type":"address"}],"payable":False,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":False,"inputs":[{"indexed":False,"name":"publicKey","type":"string"}],"name":"PublicKeyDeleted","type":"event"},{"anonymous":False,"inputs":[{"indexed":False,"name":"publicKey","type":"string"}],"name":"PublicKeyRevoked","type":"event"}] ) @staticmethod def AlastriaCredentialRegistry(endpoint: Web3) -> Contract: # TODO get the ABI from autogenerated config return endpoint.eth.contract( abi=[{"constant":True,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"issuerCredentialList","outputs":[{"name":"","type":"bytes32"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"subject","type":"address"}],"name":"getSubjectCredentialList","outputs":[{"name":"","type":"uint256"},{"name":"","type":"bytes32[]"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[],"name":"version","outputs":[{"name":"","type":"int256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"subject","type":"address"},{"name":"subjectCredentialHash","type":"bytes32"}],"name":"getSubjectCredentialStatus","outputs":[{"name":"exists","type":"bool"},{"name":"status","type":"uint8"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"subjectStatus","type":"uint8"},{"name":"issuerStatus","type":"uint8"}],"name":"getCredentialStatus","outputs":[{"name":"","type":"uint8"}],"payable":False,"stateMutability":"pure","type":"function"},{"constant":True,"inputs":[],"name":"previousPublishedVersion","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"","type":"address"},{"name":"","type":"bytes32"}],"name":"subjectCredentialRegistry","outputs":[{"name":"exists","type":"bool"},{"name":"status","type":"uint8"},{"name":"URI","type":"string"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"issuer","type":"address"},{"name":"issuerCredentialHash","type":"bytes32"}],"name":"getIssuerCredentialStatus","outputs":[{"name":"exists","type":"bool"},{"name":"status","type":"uint8"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"subjectCredentialList","outputs":[{"name":"","type":"bytes32"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"issuerCredentialHash","type":"bytes32"}],"name":"addIssuerCredential","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"issuerCredentialHash","type":"bytes32"},{"name":"status","type":"uint8"}],"name":"updateCredentialStatus","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"subjectCredentialHash","type":"bytes32"}],"name":"deleteSubjectCredential","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"subjectCredentialHash","type":"bytes32"},{"name":"URI","type":"string"}],"name":"addSubjectCredential","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_previousPublishedVersion","type":"address"}],"payable":False,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":False,"inputs":[{"indexed":False,"name":"subjectCredentialHash","type":"bytes32"}],"name":"SubjectCredentialDeleted","type":"event"},{"anonymous":False,"inputs":[{"indexed":False,"name":"issuerCredentialHash","type":"bytes32"},{"indexed":False,"name":"status","type":"uint8"}],"name":"IssuerCredentialRevoked","type":"event"}] ) @staticmethod def AlastriaPresentationRegistry(endpoint: Web3) -> Contract: # TODO get the ABI from autogenerated config return endpoint.eth.contract( abi=[{"constant":True,"inputs":[{"name":"subjectStatus","type":"uint8"},{"name":"receiverStatus","type":"uint8"}],"name":"getPresentationStatus","outputs":[{"name":"","type":"uint8"}],"payable":False,"stateMutability":"pure","type":"function"},{"constant":True,"inputs":[{"name":"","type":"address"},{"name":"","type":"bytes32"}],"name":"subjectPresentationRegistry","outputs":[{"name":"exists","type":"bool"},{"name":"status","type":"uint8"},{"name":"URI","type":"string"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"receiverPresentationHash","type":"bytes32"},{"name":"status","type":"uint8"}],"name":"updateReceiverPresentation","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"subjectPresentationHash","type":"bytes32"},{"name":"URI","type":"string"}],"name":"addSubjectPresentation","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[{"name":"subject","type":"address"},{"name":"subjectPresentationHash","type":"bytes32"}],"name":"getSubjectPresentationStatus","outputs":[{"name":"exists","type":"bool"},{"name":"status","type":"uint8"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[],"name":"version","outputs":[{"name":"","type":"int256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[],"name":"previousPublishedVersion","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"receiver","type":"address"},{"name":"receiverPresentationHash","type":"bytes32"}],"name":"getReceiverPresentationStatus","outputs":[{"name":"exists","type":"bool"},{"name":"status","type":"uint8"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"subject","type":"address"}],"name":"getSubjectPresentationList","outputs":[{"name":"","type":"uint256"},{"name":"","type":"bytes32[]"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"subjectPresentationListRegistry","outputs":[{"name":"","type":"bytes32"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"subjectPresentationHash","type":"bytes32"},{"name":"status","type":"uint8"}],"name":"updateSubjectPresentation","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_previousPublishedVersion","type":"address"}],"payable":False,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":False,"inputs":[{"indexed":False,"name":"hash","type":"bytes32"},{"indexed":False,"name":"status","type":"uint8"}],"name":"PresentationUpdated","type":"event"}] )
430.022727
6,734
0.674859
1,818
18,921
6.972497
0.088559
0.070054
0.157621
0.107999
0.828653
0.79828
0.790549
0.772562
0.749606
0.735879
0
0.010978
0.017864
18,921
43
6,735
440.023256
0.671151
0.01131
0
0.3125
0
0
0.598471
0.067964
0
0
0.008983
0.023256
0
1
0.15625
false
0
0.0625
0.15625
0.40625
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
1
0
0
0
10
e02cc845d08bd7359c4969dc11c28e539667641a
25,613
py
Python
data_processing/AWG_and_Alazar/old/Quick3StateProcess.py
PITT-HATLAB/data_processing
ad49bb921e0fc90b90f0b696e2cbb662019f5f40
[ "MIT" ]
null
null
null
data_processing/AWG_and_Alazar/old/Quick3StateProcess.py
PITT-HATLAB/data_processing
ad49bb921e0fc90b90f0b696e2cbb662019f5f40
[ "MIT" ]
null
null
null
data_processing/AWG_and_Alazar/old/Quick3StateProcess.py
PITT-HATLAB/data_processing
ad49bb921e0fc90b90f0b696e2cbb662019f5f40
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Thu Apr 14 11:11:55 2022 @author: Hatlab-RRK Purpose: create a neat, almost-executable file that can quickly plot a 3-state pulse file, and have the option to do just histograms, or additionally try to fit using majority vote and give classification accuracy """ from data_processing.AWG_and_Alazar.Pulse_Processing_utils import extract_3pulse_histogram_from_filepath, extract_3pulse_noise_from_filepath, plot_stats_from_filepath, plot_custom_stats_from_filepath import os import matplotlib.pyplot as plt plt.style.use('hatlab') import numpy as np #histogram plotting # datapath = r'Z:\Data\N25_L3_SQ\BP1\loopback_after_rebuild_2\2022-05-05_0002_test1_Rep_0__.ddh5' # datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_tests_0.4mA\2022-05-05_0001_amp_onoff_-90_Amp_0__.ddh5' # datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_tests_0.4mA\2022-05-05_0002_amp_onoff_-90_Amp_1__.ddh5' # datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_tests_0.4mA\2022-05-05_0003_amp_onoff_-120_Amp_0__.ddh5' # datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_tests_0.4mA\2022-05-05_0004_amp_onoff_-120_Amp_1__.ddh5' # datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_tests_0.4mA\2022-05-05_0005_amp_onoff_-120_Amp_0__.ddh5' # datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_tests_0.4mA\2022-05-05_0006_amp_onoff_-120_Amp_1__.ddh5' # datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_saturation_0.4mA\2022-05-05_0006_amp_onoff_-100_higher_range_Amp_1__.ddh5' # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA/2022-05-05_0003_amp_onoff_-100_higher_range_Amp_0__.ddh5' #now trying to see saturation # datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_saturation_0.4mA\2022-05-05_0002_amp_onoff_-100_Amp_1__.ddh5' datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_saturation_0.4mA\2022-05-05_0009_amp_onoff_-80_high_pwr_var_Rep_0__.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep/2022-05-05_0008_pwr_sweep_30dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.35_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep/2022-05-05_0018_pwr_sweep_30dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.35_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep/2022-05-05_0050_pwr_sweep_30dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.35_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep/2022-05-05_0060_pwr_sweep_30dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.35_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0046_pwr_sweep_20dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.35_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0056_pwr_sweep_20dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.35_V_.ddh5' datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_saturation_0.4mA_sweep_even_higher_pwr\2022-05-05_0006_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.55_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0028_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.35_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0056_pwr_sweep_20dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.35_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0001_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.05_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0004_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.35_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0014_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.35_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0029_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.05_V_.ddh5' datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_saturation_0.4mA_sweep_0dB_att\2022-05-05_0002_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.15_V_.ddh5' datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_saturation_0.4mA_sweep_0dB_att\2022-05-05_0006_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.5_V_.ddh5' # datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_saturation_0.4mA_sweep_0dB_att\2022-05-05_0064_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.35_V_.ddh5' # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0039_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.05_V_.ddh5' # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0048_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.55_V_.ddh5' # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0052_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.95_V_.ddh5' # # datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_saturation_0.4mA_farther_detuned\2022-05-05_0001_amp_onoff_-110_Amp_0__.ddh5' # datapath = r'Z:\Data\N25_L3_SQ\BP1\amp_saturation_0.4mA_farther_detuned\2022-05-05_0002_amp_onoff_-110_Amp_1__.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0013_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.45_V_.ddh5' datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0005_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.45_V_.ddh5' #this one looks like a Poisson distribution datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep/2022-05-05_0010_pwr_sweep_30dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.55_V_.ddh5' #this is those SAME settings, but with the amplifier on datapath = r'' #10dB more power #amp_off datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0001_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.05_V_.ddh5' # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0006_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.55_V_.ddh5' #amp on # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0006_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.55_V_.ddh5' #higher power # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep/2022-05-05_0018_pwr_sweep_30dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.35_V_.ddh5' # datapath = r"Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0001_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.05_V_.ddh5" datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0001_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.05_V_.ddh5' # # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0002_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.15_V_.ddh5' #reduce detuning # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0016_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.15_V_.ddh5' # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0003_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.25_V_.ddh5' # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0006_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.55_V_.ddh5' # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0010_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.95_V_.ddh5' #amp off high power # datapath = r'Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_even_higher_pwr/2022-05-05_0010_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.95_V_.ddh5' # print(datapath) nr = 7686 # #%% # print(datapath) # fid = extract_3pulse_histogram_from_filepath(datapath, plot = True, hist_scale = 0.01, numRecords = nr, numRecordsUsed = 400, IQ_offset = (0,0), fit = False, lpf = True, lpf_wc = 50e6, boxcar = True, bc_window = [50, 150], record_track = False, tuneup_plots = False, debug = False, tstart_index = 0, tstop_index = -1) #%% # print(datapath) # fid = extract_3pulse_histogram_from_filepath(datapath, figscale = 1.2, plot = True, hist_scale = 0.0006, numRecords = nr, rec_start = 0, rec_stop = 2500, IQ_offset = (0,0), fit = False, lpf = False, lpf_wc = 50e6, boxcar = False, bc_window = [80, 100], record_track = False, tuneup_plots = False, debug = False, tstart_index = 60 , tstop_index = 120, phase_correction_rate = 0.0000, guess = 1) tstart = 50 tstop = 150 fid = extract_3pulse_histogram_from_filepath(datapath, figscale = 1.2, plot = True, hist_scale = 0.003, numRecords = nr, rec_start = 1, rec_stop = 7686, rec_skip = 1, IQ_offset = (0,0), fit = 0, lpf = 0, lpf_wc = 15e6, boxcar = False, bc_window = [tstart, tstop], record_track = False, tuneup_plots = False, debug = False, tstart_index = tstart , tstop_index = tstop, phase_correction_rate = 0.0000, guess = 1) print(fid) #%%custom stats for trace in [0,1,2]: Pvar, Pvar_fit, Pavg, Ivar, Qvar = plot_custom_stats_from_filepath(datapath, debug = True, trace = trace, fit = 0, timeslice = 58) print("Variance (numpy):", Pvar, "\nVariance (fit): ", Pvar_fit, "\nAverage: ", Pavg) #%%old stats plot_stats_from_filepath(datapath, plt_avg = 0, plt_var = 1, vscale = 100, plot = 1) #%% file_arr_amp_off = [ "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0014_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.35_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0001_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0002_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0003_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.25_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0004_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.35_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0005_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.45_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0006_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.55_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0007_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.65_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0008_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.75_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0009_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.85_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0010_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.95_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0011_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0012_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_higher_pwr/2022-05-05_0013_pwr_sweep_20dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.25_V_.ddh5" ] file_arr_amp_on = [ "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0014_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.35_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0001_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0002_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0003_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.25_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0004_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.35_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0005_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.45_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0006_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.55_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0007_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.65_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0008_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.75_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0009_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.85_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0010_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.95_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0011_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0012_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_20dB_att/2022-05-05_0013_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.25_V_.ddh5" ] Pvar_arr, Pvar_fit_arr, Pavg_arr, Ivar_arr, Qvar_arr = [],[],[],[],[] for fp in file_arr_amp_off: Pvar, Pvar_fit, Pavg, Ivar, Qvar = plot_custom_stats_from_filepath(fp, debug = True, trace = 0) # print("Variance (numpy):", Pvar, "\nVariance (fit): ", Pvar_fit, "\nAverage: ", Pavg) Pvar_arr.append(Pvar) Pvar_fit_arr.append(Pvar_fit) Pavg_arr.append(Pavg) Ivar_arr.append(Ivar) Qvar_arr.append(Qvar) #%% plt.plot(Pavg_arr, Ivar_arr, '.') plt.plot(Pavg_arr, Qvar_arr, '.') # plt.plot(Pavg_arr, Pvar_arr, '.', label = 'numpy variance') # plt.plot(Pavg_arr, Pvar_fit_arr, '.', label = 'fit_variance') # plt.xlim(0, 0.04) # plt.ylim(0, 0.0031) plt.legend() #%% pwr_file_arr = [ "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0022_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.35_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0009_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0010_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0011_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.25_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0012_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.35_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0013_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.45_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0014_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.55_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0015_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.65_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0016_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.75_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0017_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.85_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0018_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_0.95_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0019_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0020_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0021_pwr_sweep_0dB_att_pump_pwr_9.76_dBm_LO_freq_5914000000.0_Hz_Sig_Volt_1.25_V_.ddh5" ] pwr_file_arr = [ "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0051_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0052_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0053_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.25_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0054_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.35_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0055_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.45_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0056_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.55_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0057_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.65_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0058_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.75_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0059_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.85_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0060_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.95_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0061_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0062_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0063_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.25_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_saturation_0.4mA_sweep_0dB_att/2022-05-05_0064_pwr_sweep_0dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.35_V_.ddh5" ] pwr_file_arr = [ "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0028_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.35_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0015_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0016_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0017_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.25_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0018_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.35_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0019_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.45_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0020_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.55_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0021_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.65_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0022_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.75_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0023_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.85_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0024_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.95_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0025_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0026_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0027_pwr_sweep_10dB_att_pump_pwr_9.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.25_V_.ddh5" ] pwr_file_arr = [ "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0056_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.35_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0043_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0044_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0045_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.25_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0046_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.35_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0047_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.45_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0048_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.55_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0049_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.65_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0050_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.75_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0051_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.85_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0052_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_0.95_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0053_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.05_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0054_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.15_V_.ddh5", "Z:/Data/N25_L3_SQ/BP1/amp_was_actually_off/amp_saturation_0.4mA_sweep_even_higher_pwr/2022-05-05_0055_pwr_sweep_10dB_att_pump_pwr_10.76_dBm_LO_freq_5917000000.0_Hz_Sig_Volt_1.25_V_.ddh5" ] Gvar_arr, Evar_arr, Fvar_arr = [],[],[] Gavg_arr, Eavg_arr, Favg_arr = [],[],[] for i, fp in enumerate(pwr_file_arr): print(i, fp) [Gvar,Gavg], [Evar,Eavg], [Fvar,Favg] = plot_stats_from_filepath(fp, vscale = 1, plot = 0) Gvar_arr.append(Gvar) Evar_arr.append(Evar) Fvar_arr.append(Fvar) Gavg_arr.append(Gavg) Eavg_arr.append(Eavg) Favg_arr.append(Favg) #%% plt.plot(np.array(Gavg_arr),np.array(Gvar_arr), '.')
93.138182
410
0.860227
5,521
25,613
3.371128
0.051621
0.035192
0.056308
0.070385
0.905599
0.897647
0.883946
0.878466
0.872179
0.868365
0
0.201483
0.036349
25,613
275
411
93.138182
0.552589
0.20556
0
0.051613
0
0.677419
0.860185
0.857474
0
0
0
0
0
1
0
false
0
0.025806
0
0.025806
0.019355
0
0
0
null
0
0
0
1
1
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
e06be6bc35d880acc32e9542139aac8505ea92e4
51,466
py
Python
envcopy.py
chuiyangmeng96/GNN_DRL_Cache
5e34b2933c5fcc428f18d391fc555c38041a53a3
[ "MIT" ]
1
2022-03-21T14:25:15.000Z
2022-03-21T14:25:15.000Z
envcopy.py
chuiyangmeng96/GNN_DRL_Cache
5e34b2933c5fcc428f18d391fc555c38041a53a3
[ "MIT" ]
1
2021-08-11T10:07:12.000Z
2021-08-11T10:07:12.000Z
envcopy.py
chuiyangmeng96/GNN_DRL_Cache
5e34b2933c5fcc428f18d391fc555c38041a53a3
[ "MIT" ]
null
null
null
import numpy as np import math import time import random class Environ: def __init__(self): self.length = 500 self.vehicle_num = 500 self.RSU_num = 4 self.RSUposition = np.array([[250, 0], [-250, 0], [0, -250], [0, 250]]) self.MBSposition = np.array([0, 0]) self.delta_int = 0.002 self.T_wait = 2 self.P_wait = 0.8 self.dis_thresh = 100 # threshold of distance for different content request probability self.v = 60 / 3.6 # velocity m/s self.time_delta = 1.5 # time step self.gammaV = 100 # V2V threshold self.gammaR = 560 # V2R threshold self.z = None # popularity for each content self.z1 = 1.1 # popularity for inner circle vehicles self.z2 = 1.3 # popularity for outer circle vehicles self.z3 = 1.5 # popularity for all RSUs' self.content_num = 50 # content number self.max_cacheV = 600 # total 20 vehicles caching capability 12000MB = 12GB, each 600MB, max 3 contents self.max_cacheR = 2e3 # total 4 RSUs caching capability 8000MB = 8GB, each 2GB, max 10 contents self.content_size = 200 # each content size = 200MB self.request_arr_V = np.zeros((self.vehicle_num, self.content_num)) # request array for each vehicle and each file self.request_arr_R = np.zeros((self.RSU_num, self.content_num)) # request array for each RSU and each file self.content_label_V = np.zeros((self.vehicle_num, int(self.max_cacheV / self.content_size))) # vehicle caching content array self.content_label_R = np.zeros((self.vehicle_num, int(self.max_cacheR / self.content_size))) # RSU caching content array self.candidateV = np.zeros((self.vehicle_num, self.vehicle_num)) # matrix stores dis between vehicles self.candidateR = np.zeros((self.vehicle_num, self.RSU_num)) # matrix stores dis between vehicles and RSUs # self.loop = 0 # need modification self.band_V2V = 5e6 # bandwidth 5MHz self.p_k = pow(10, 24 / 10) # transmission power 24dBm to mW self.sigma_2 = pow(10, -11) # noise power mW self.alpha = 2 # path loss exponent self.h_ik = 0.16 # channel gain 都是0.16 self.band_V2R = 1e7 # bandwidth 10MHz self.bij = 1e7 # allocated bandwidth self.p_j = pow(10, 36 / 10) # transmission power 36dBm to mW self.h_ij = 0.16 # channel gain # self.h_ij_total = # total channel gain 不考虑干扰问题 self.band_V2I = 2e7 # V2I bandwidth 20MHz self.W = 10 # number of sub-carriers self.p_m = pow(10, 43 / 10) # transmission power 43dBM to mW self.h_i0 = 0.16 # channel gain self.position = np.zeros((self.vehicle_num, 4)) def add_vehicle_pos(self): position = np.zeros((self.vehicle_num, 4)) for i in range(self.vehicle_num): ind = np.random.rand(1) if ind < 1 / 12: position[i][0] = np.random.randint(-self.length + 1, 0) position[i][1] = self.length - 1 elif 1 / 12 < ind < 2 / 12: position[i][0] = np.random.randint(0, self.length) position[i][1] = self.length - 1 elif 2 / 12 < ind < 3 / 12: position[i][0] = -(self.length - 1) position[i][1] = np.random.randint(0, self.length) elif 3 / 12 < ind < 4 / 12: position[i][0] = 0 position[i][1] = np.random.randint(0, self.length) elif 4 / 12 < ind < 5 / 12: position[i][0] = self.length - 1 position[i][1] = np.random.randint(0, self.length) elif 5 / 12 < ind < 6 / 12: position[i][0] = np.random.randint(-self.length + 1, 0) position[i][1] = 0 elif 6 / 12 < ind < 7 / 12: position[i][0] = np.random.randint(0, self.length) position[i][1] = 0 elif 7 / 12 < ind < 8 / 12: position[i][0] = -(self.length - 1) position[i][1] = np.random.randint(-self.length + 1, 0) elif 8 / 12 < ind < 9 / 12: position[i][0] = 0 position[i][1] = np.random.randint(-self.length + 1, 0) elif 9 / 12 < ind < 10 / 12: position[i][0] = self.length - 1 position[i][1] = np.random.randint(-self.length + 1, 0) elif 10 / 12 < ind < 11 / 12: position[i][0] = np.random.randint(-self.length + 1, 0) position[i][1] = -(self.length - 1) else: position[i][0] = np.random.randint(0, self.length) position[i][1] = -(self.length - 1) self.position = position return self.position def update_position(self, obs_step): P_eta = 2 / (2 + self.T_wait * self.P_wait * self.delta_int * self.v) # moving probability for i in range(self.vehicle_num): if self.position[i][3] == obs_step: # initial EAST # head EAST with intersection at y=0 axis if self.position[i][2] == 0 and self.position[i][1] == 0 and self.position[i][0] * ( self.position[i][0] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 0.25: # proceed EAST self.position[i][2] = 0 self.position[i][0] = self.position[i][0] + self.time_delta * self.v elif 0.25 < direct_dice < 0.5: # change WEST self.position[i][2] = 1 self.position[i][0] = -(self.position[i][0] + self.time_delta * self.v) elif 0.5 < direct_dice < 0.75: # change SOUTH self.position[i][2] = 2 self.position[i][1] = -(self.position[i][0] + self.time_delta * self.v) self.position[i][0] = 0 else: # change NORTH self.position[i][2] = 3 self.position[i][1] = self.position[i][0] + self.time_delta * self.v self.position[i][0] = 0 else: # stop at intersection self.position[i][0] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head EAST no intersection at y=0 axis elif self.position[i][2] == 0 and self.position[i][1] == 0 and self.position[i][0] * ( self.position[i][0] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][0] = self.position[i][0] + self.time_delta * self.v if self.position[i][0] > self.length - 1: # out of bound ### NEED MODIFICATION stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # U turn WEST self.position[i][2] = 1 self.position[i][0] = 2 * (self.length - 1) - self.position[i][0] elif 1 / 3 < direct_dice < 2 / 3: # change NORTH self.position[i][2] = 3 self.position[i][1] = self.position[i][0] - (self.length - 1) self.position[i][0] = self.length - 1 else: # change SOUTH self.position[i][2] = 2 self.position[i][1] = (self.length - 1) - self.position[i][0] self.position[i][0] = self.length - 1 else: # stop at intersection self.position[i][0] = self.length - 1 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head EAST with intersection at y = self.length-1 axis elif self.position[i][2] == 0 and self.position[i][1] == (self.length - 1) and self.position[i][ 0] * ( self.position[i][0] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # proceed EAST self.position[i][2] = 0 self.position[i][0] = self.position[i][0] + self.time_delta * self.v elif 1 / 3 < direct_dice < 2 / 3: # change WEST self.position[i][2] = 1 self.position[i][0] = -(self.position[i][0] + self.time_delta * self.v) else: # change SOUTH self.position[i][2] = 2 self.position[i][1] = (self.length - 1) - ( self.position[i][0] + self.time_delta * self.v) self.position[i][0] = 0 else: # stop at intersection self.position[i][0] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head EAST no intersection at y = self.length - 1 axis elif self.position[i][2] == 0 and self.position[i][1] == (self.length - 1) and self.position[i][ 0] * ( self.position[i][0] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][0] = self.position[i][0] + self.time_delta * self.v if self.position[i][0] > self.length - 1: # out of bound stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at CORNER direct_dice = np.random.rand(1) if direct_dice < 1 / 2: # U turn WEST self.position[i][2] = 1 self.position[i][0] = 2 * (self.length - 1) - self.position[i][0] else: # change SOUTH self.position[i][2] = 2 self.position[i][1] = 2 * (self.length - 1) - self.position[i][0] self.position[i][0] = self.length - 1 else: # STOP at CORNER self.position[i][0] = self.length - 1 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head EAST with intersection at y = -(self.length-1) axis elif self.position[i][2] == 0 and self.position[i][1] == -(self.length - 1) and self.position[i][ 0] * ( self.position[i][0] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # proceed EAST self.position[i][2] = 0 self.position[i][0] = self.position[i][0] + self.time_delta * self.v elif 1 / 3 < direct_dice < 2 / 3: # change WEST self.position[i][2] = 1 self.position[i][0] = -(self.position[i][0] + self.time_delta * self.v) else: # change NORTH self.position[i][2] = 2 self.position[i][1] = -(self.length - 1) + ( self.position[i][0] + self.time_delta * self.v) self.position[i][0] = 0 else: # stop at intersection self.position[i][0] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head EAST no intersection at y = -(self.length-1) axis elif self.position[i][2] == 0 and self.position[i][1] == -(self.length - 1) and self.position[i][ 0] * ( self.position[i][0] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][0] = self.position[i][0] + self.time_delta * self.v if self.position[i][0] > self.length - 1: # out of bound stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at CORNER direct_dice = np.random.rand(1) if direct_dice < 1 / 2: # U turn WEST self.position[i][2] = 1 self.position[i][0] = 2 * (self.length - 1) - self.position[i][0] else: # change NORTH self.position[i][2] = 3 self.position[i][1] = -2 * (self.length - 1) + self.position[i][0] self.position[i][0] = self.length - 1 else: # STOP at CORNER self.position[i][0] = self.length - 1 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # intial WEST # head WEST with intersection at y = 0 axis if self.position[i][2] == 1 and self.position[i][1] == 0 and self.position[i][0] * ( self.position[i][0] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 0.25: # change EAST self.position[i][2] = 0 self.position[i][0] = -self.position[i][0] + self.time_delta * self.v elif 0.25 < direct_dice < 0.5: # proceed WEST self.position[i][2] = 1 self.position[i][0] = self.position[i][0] - self.time_delta * self.v elif 0.5 < direct_dice < 0.75: # change SOUTH self.position[i][2] = 2 self.position[i][1] = self.position[i][0] - self.time_delta * self.v self.position[i][0] = 0 else: # change NORTH self.position[i][2] = 3 self.position[i][1] = -self.position[i][0] + self.time_delta * self.v self.position[i][0] = 0 else: # stop at intersection self.position[i][0] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head WEST no intersection at y = 0 axis elif self.position[i][2] == 1 and self.position[i][1] == 0 and self.position[i][0] * ( self.position[i][0] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][0] = self.position[i][0] - self.time_delta * self.v if self.position[i][0] < -(self.length - 1): # out of bound stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # U turn EAST self.position[i][2] = 0 self.position[i][0] = 2 * (-self.length + 1) - self.position[i][0] elif 1 / 3 < direct_dice < 2 / 3: # change SOUTH self.position[i][2] = 2 self.position[i][1] = self.position[i][0] + (self.length - 1) self.position[i][0] = -(self.length - 1) else: # change NORTH self.position[i][2] = 3 self.position[i][1] = -self.position[i][0] - (self.length - 1) self.position[i][0] = -(self.length - 1) else: # STOP at intersection self.position[i][0] = -(self.length - 1) self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head WEST with intersection at y = self.length - 1 axis elif self.position[i][2] == 1 and self.position[i][1] == self.length - 1 and self.position[i][0] * ( self.position[i][0] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # change EAST self.position[i][2] = 0 self.position[i][0] = -self.position[i][0] + self.time_delta * self.v elif 0.25 < direct_dice < 0.5: # proceed WEST self.position[i][2] = 1 self.position[i][0] = self.position[i][0] - self.time_delta * self.v elif 0.5 < direct_dice < 0.75: # change SOUTH self.position[i][2] = 2 self.position[i][1] = (self.length - 1) + self.position[i][0] - self.time_delta * self.v self.position[i][0] = 0 else: # stop at intersection self.position[i][0] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head WEST no intersection at y = self.length - 1 axis elif self.position[i][2] == 1 and self.position[i][1] == self.length - 1 and self.position[i][0] * ( self.position[i][0] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][0] = self.position[i][0] - self.time_delta * self.v if self.position[i][0] < -(self.length - 1): # out of bound at CORNER stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection direct_dice = np.random.rand(1) if direct_dice < 1 / 2: # U turn EAST self.position[i][2] = 0 self.position[i][0] = 2 * (-self.length + 1) - self.position[i][0] else: # change SOUTH self.position[i][2] = 2 self.position[i][1] = self.position[i][0] + 2 * (self.length - 1) self.position[i][0] = -(self.length - 1) else: # STOP at CORNER self.position[i][0] = -(self.length - 1) self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head WEST with intersection at y = -(self.length - 1) axis elif self.position[i][2] == 1 and self.position[i][1] == -(self.length - 1) and self.position[i][ 0] * ( self.position[i][0] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # change EAST self.position[i][2] = 0 self.position[i][0] = -self.position[i][0] + self.time_delta * self.v elif 1 / 3 < direct_dice < 2 / 3: # proceed WEST self.position[i][2] = 1 self.position[i][0] = self.position[i][0] - self.time_delta * self.v else: # change NORTH self.position[i][2] = 3 self.position[i][1] = -(self.length - 1) + self.position[i][ 0] - self.time_delta * self.v self.position[i][0] = 0 else: # stop at intersection self.position[i][0] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head WEST no intersection at y = -(self.length - 1) axis elif self.position[i][2] == 1 and self.position[i][1] == -(self.length - 1) and self.position[i][ 0] * ( self.position[i][0] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][0] = self.position[i][0] - self.time_delta * self.v if self.position[i][0] < -(self.length - 1): # out of bound at CORNER stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection direct_dice = np.random.rand(1) if direct_dice < 1 / 2: # U turn EAST self.position[i][2] = 0 self.position[i][0] = 2 * (-self.length + 1) - self.position[i][0] else: # change NORTH self.position[i][2] = 3 self.position[i][1] = 2 * (-self.length + 1) + self.position[i][0] self.position[i][0] = -(self.length - 1) else: # STOP at CORNER self.position[i][0] = -(self.length - 1) self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # intial SOUTH # head SOUTH with intersection at x = 0 axis if self.position[i][2] == 2 and self.position[i][0] == 0 and self.position[i][1] * ( self.position[i][1] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 0.25: # change EAST self.position[i][2] = 0 self.position[i][0] = -self.position[i][1] + self.time_delta * self.v self.position[i][1] = 0 elif 0.25 < direct_dice < 0.5: # change WEST self.position[i][2] = 1 self.position[i][0] = self.position[i][0] - self.time_delta * self.v self.position[i][1] = 0 elif 0.5 < direct_dice < 0.75: # proceed SOUTH self.position[i][2] = 2 self.position[i][1] = self.position[i][1] - self.time_delta * self.v else: # change NORTH self.position[i][2] = 3 self.position[i][1] = -self.position[i][1] + self.time_delta * self.v else: # stop at intersection self.position[i][1] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head SOUTH no intersection at x = 0 axis elif self.position[i][2] == 2 and self.position[i][0] == 0 and self.position[i][1] * ( self.position[i][1] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][1] = self.position[i][1] - self.time_delta * self.v if self.position[i][1] < -self.length + 1: # out of bound stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # change EAST self.position[i][2] = 0 self.position[i][0] = -(self.length - 1) - self.position[i][1] self.position[i][1] = -(self.length - 1) elif 1 / 3 < direct_dice < 2 / 3: # change SOUTH self.position[i][2] = 2 self.position[i][0] = (self.length - 1) + self.position[i][1] self.position[i][1] = -(self.length - 1) else: # U turn to NORTH self.position[i][2] = 3 self.position[i][1] = 2 * (-self.length + 1) - self.position[i][1] else: # stop at intersection self.position[i][1] = -(self.length - 1) self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head SOUTH with intersection at x = self.length - 1 axis elif self.position[i][2] == 2 and self.position[i][0] == self.length - 1 and self.position[i][1] * ( self.position[i][1] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # change WEST self.position[i][2] = 1 self.position[i][0] = (self.length - 1) + self.position[i][0] - self.time_delta * self.v self.position[i][1] = 0 elif 1 / 3 < direct_dice < 2 / 3: # proceed SOUTH self.position[i][2] = 2 self.position[i][1] = self.position[i][1] - self.time_delta * self.v else: # change NORTH self.position[i][2] = 3 self.position[i][1] = -self.position[i][1] + self.time_delta * self.v else: # stop at intersection self.position[i][1] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head SOUTH no intersection at x = self.length - 1 axis elif self.position[i][2] == 2 and self.position[i][0] == self.length - 1 and self.position[i][1] * ( self.position[i][1] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][1] = self.position[i][1] - self.time_delta * self.v if self.position[i][1] < -self.length + 1: # out of bound at corner stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection direct_dice = np.random.rand(1) if direct_dice < 0.5: # change WEST self.position[i][2] = 1 self.position[i][0] = 2 * (self.length - 1) + self.position[i][1] self.position[i][1] = -(self.length - 1) else: # U turn to NORTH self.position[i][2] = 3 self.position[i][1] = 2 * (-self.length + 1) - self.position[i][1] # head SOUTH with intersection at x = -(self.length - 1) axis elif self.position[i][2] == 2 and self.position[i][0] == -(self.length - 1) and self.position[i][ 1] * ( self.position[i][1] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # change EAST self.position[i][2] = 0 self.position[i][0] = -(self.length - 1) - ( self.position[i][0] - self.time_delta * self.v) self.position[i][1] = 0 elif 1 / 3 < direct_dice < 2 / 3: # proceed SOUTH self.position[i][2] = 2 self.position[i][1] = self.position[i][1] - self.time_delta * self.v else: # change NORTH self.position[i][2] = 3 self.position[i][1] = -self.position[i][1] + self.time_delta * self.v else: # stop at intersection self.position[i][1] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head SOUTH no intersection at x = -(self.length - 1) axis elif self.position[i][2] == 2 and self.position[i][0] == -(self.length - 1) and self.position[i][ 1] * ( self.position[i][1] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][1] = self.position[i][1] - self.time_delta * self.v if self.position[i][1] < -self.length + 1: # out of bound at corner stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection direct_dice = np.random.rand(1) if direct_dice < 0.5: # change EAST self.position[i][2] = 0 self.position[i][0] = 2 * (-self.length + 1) - self.position[i][1] self.position[i][1] = -(self.length - 1) else: # U turn to NORTH self.position[i][2] = 3 self.position[i][1] = 2 * (-self.length + 1) - self.position[i][1] # intial NORTH # head NORTH with intersection at x = 0 axis if self.position[i][2] == 3 and self.position[i][0] == 0 and self.position[i][1] * ( self.position[i][1] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 0.25: # change EAST self.position[i][2] = 0 self.position[i][0] = self.position[i][1] + self.time_delta * self.v self.position[i][1] = 0 elif 0.25 < direct_dice < 0.5: # change WEST self.position[i][2] = 1 self.position[i][0] = -(self.position[i][0] + self.time_delta * self.v) self.position[i][1] = 0 elif 0.5 < direct_dice < 0.75: # change SOUTH self.position[i][2] = 2 self.position[i][1] = -(self.position[i][1] + self.time_delta * self.v) else: # proceed NORTH self.position[i][2] = 3 self.position[i][1] = self.position[i][1] + self.time_delta * self.v else: # stop at intersection self.position[i][1] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head NORTH no intersection at x = 0 axis elif self.position[i][2] == 3 and self.position[i][0] == 0 and self.position[i][1] * ( self.position[i][1] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][1] = self.position[i][1] + self.time_delta * self.v if self.position[i][1] > self.length - 1: # out of bound stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # change EAST self.position[i][2] = 0 self.position[i][0] = self.position[i][1] - (self.length - 1) self.position[i][1] = self.length - 1 elif 1 / 3 < direct_dice < 2 / 3: # change WEST self.position[i][2] = 1 self.position[i][0] = -self.position[i][1] + (self.length - 1) self.position[i][1] = self.length - 1 else: # U turn to SOUTH self.position[i][2] = 2 self.position[i][1] = 2 * (self.length - 1) - self.position[i][1] else: # stop at intersection self.position[i][1] = self.length - 1 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head NORTH with intersection at x = self.length - 1 axis elif self.position[i][2] == 3 and self.position[i][0] == self.length - 1 and self.position[i][1] * ( self.position[i][1] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # change WEST self.position[i][2] = 1 self.position[i][0] = (self.length - 1) - self.time_delta * self.v self.position[i][1] = 0 elif 1 / 3 < direct_dice < 2 / 3: # change SOUTH self.position[i][2] = 2 self.position[i][1] = -(self.position[i][1] + self.time_delta * self.v) else: # proceed NORTH self.position[i][2] = 3 self.position[i][1] = self.position[i][1] + self.time_delta * self.v else: self.position[i][1] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head NORTH no intersection at x = self.length - 1 axis elif self.position[i][2] == 3 and self.position[i][0] == self.length - 1 and self.position[i][1] * ( self.position[i][1] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][1] = self.position[i][1] + self.time_delta * self.v if self.position[i][1] > self.length - 1: # out of bound at CORNER stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection direct_dice = np.random.rand(1) if direct_dice < 1 / 2: # change WEST self.position[i][2] = 1 self.position[i][0] = 2 * (self.length - 1) - self.position[i][1] self.position[i][1] = self.length - 1 else: # U turn to SOUTH self.position[i][2] = 2 self.position[i][1] = 2 * (self.length - 1) - self.position[i][1] else: # stop at intersection self.position[i][1] = self.length - 1 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head NORTH with intersection at x = -(self.length - 1) axis elif self.position[i][2] == 3 and self.position[i][0] == -(self.length - 1) and self.position[i][ 1] * ( self.position[i][1] + self.time_delta * self.v) < 0: stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection self.position[i][3] = obs_step direct_dice = np.random.rand(1) if direct_dice < 1 / 3: # change EAST self.position[i][2] = 0 self.position[i][0] = -(self.length - 1) + self.time_delta * self.v self.position[i][1] = 0 elif 1 / 3 < direct_dice < 2 / 3: # change SOUTH self.position[i][2] = 2 self.position[i][1] = -(self.position[i][1] + self.time_delta * self.v) else: # proceed NORTH self.position[i][2] = 3 self.position[i][1] = self.position[i][1] + self.time_delta * self.v else: self.position[i][1] = 0 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head NORTH no intersection at x = self.length - 1 axis elif self.position[i][2] == 3 and self.position[i][0] == -(self.length - 1) and self.position[i][ 1] * ( self.position[i][1] + self.time_delta * self.v) > 0: self.position[i][3] = obs_step self.position[i][1] = self.position[i][1] + self.time_delta * self.v if self.position[i][1] > self.length - 1: # out of bound at CORNER stop_dice = np.random.rand(1) if stop_dice < P_eta: # move at intersection direct_dice = np.random.rand(1) if direct_dice < 1 / 2: # change EAST self.position[i][2] = 0 self.position[i][0] = -2 * (self.length - 1) + self.position[i][1] self.position[i][1] = self.length - 1 else: # U turn to SOUTH self.position[i][2] = 2 self.position[i][1] = 2 * (self.length - 1) - self.position[i][1] else: # stop at intersection self.position[i][1] = self.length - 1 self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval return self.position def cal_neighbor(self): # self,candidateV rewrite # V2V, V2R distance calculation for i in range(self.vehicle_num): for j in range(self.vehicle_num): temp_V = np.sqrt(np.sum(np.power((self.position[i, 0:2] - self.position[j, 0:2]), 2))) if i != j and temp_V < self.gammaV: self.candidateV[i][j] = temp_V for k in range(self.RSU_num): temp_R = np.sqrt(np.sum(np.power((self.position[i, 0:2] - self.RSUposition[k, 0:2]), 2))) if temp_R < self.gammaR: self.candidateR[i][k] = temp_R return self.candidateV, self.candidateR def content_request(self): # define different request probability in inner/outer circle for all Vehicles and RSUs for i in range(self.vehicle_num): # for Vehicles temp_request_arr = np.zeros((1, self.content_num)) if np.sqrt(np.sum(np.power(self.position[i, 0:2], 2))) < self.dis_thresh: # inner circle self.z = self.z1 temp_content_deno = np.zeros(self.content_num) for j in range(self.content_num): temp_content_deno[j] = 1 / pow(j + 1, self.z) # begin at 0 content_deno = np.sum(temp_content_deno) for j in range(self.content_num): temp_request_arr[0][j] = temp_content_deno[j] / content_deno # begin at 0 self.request_arr_V[i, :] = temp_request_arr else: # outer circle self.z = self.z2 temp_content_deno = np.zeros(self.content_num) for j in range(self.content_num): temp_content_deno[j] = 1 / pow(j + 1, self.z) # begin at 0 content_deno = np.sum(temp_content_deno) for j in range(self.content_num): temp_request_arr[0][j] = temp_content_deno[j] / content_deno # begin at 0 self.request_arr_V[i, :] = temp_request_arr for j in range(self.RSU_num): # for RSUs temp_request_arr = np.zeros((1, self.content_num)) self.z = self.z3 temp_content_deno = np.zeros(self.content_num) for i in range(self.content_num): temp_content_deno[j] = 1 / pow(j + 1, self.z) # begin at 0 content_deno = np.sum(temp_content_deno) for k in range(self.content_num): temp_request_arr[0][j] = (1 / pow(k + 1, self.z)) / content_deno # begin at 0 self.request_arr_R[j, :] = temp_request_arr return self.request_arr_V, self.request_arr_R def caching_strategy(self): # define basic caching strategy with LRU for i in range(self.vehicle_num): # Vehicle caching strategy dice = np.random.rand(1) if 0 < dice < self.request_arr_V[i][0]: # randomly request a content and its label content_label = 0 else: for j in range(1, self.content_num): if self.request_arr_V[i][j - 1] < dice < self.request_arr_V[i][j]: content_label = j if content_label in self.content_label_V[i, :]: # case 1 requested content already in vehicle cache content_label_index = list(self.content_label_V[i, :]).index(content_label) if content_label_index != 0: for j in range(content_label_index): self.content_label_V[i][j + 1] = self.content_label_V[i][j] self.content_label_V[i][0] = content_label else: # requested content not in vehicle, enough/not enough (same case) space for storing new content for j in range(self.max_cacheV / self.content_size): self.content_label_V[i][j + 1] = self.content_label_V[i][j] self.content_label_V[i][0] = content_label # self.content_label_V[i][1] = self.content_label_V[i][0] for i in range(self.RSU_num): dice = np.random.rand(1) if 0 < dice < self.request_arr_R[i][0]: # randomly request a content and its label content_label = 0 else: for j in range(1, self.content_num): if self.request_arr_R[i][j - 1] < dice < self.request_arr_R[i][j]: content_label = j if content_label in self.content_label_R[i, :]: # case 1 requested content already in RSU cache content_label_index = list(self.content_label_R[i, :]).index(content_label) if content_label_index != 0: for j in range(content_label_index): self.content_label_R[i][j + 1] = self.content_label_R[i][j] self.content_label_R[i][0] = content_label else: # requested content not in RSU # length = self.max_cacheR / self.content_size for j in range(self.max_cacheR / self.content_size): self.content_label_R[i][j + 1] = self.content_label_R[i][j] self.content_label_R[i][0] = content_label return self.content_label_V, self.content_label_R def input(self): # combine as a state matrix # section 1: neighboring vehicles #global self, i, pos_dis, index_R input_1 = np.zeros((self.vehicle_num, self.vehicle_num)) for i in range(self.vehicle_num): connect_index_V = np.argwhere(self.candidateV[i, :] != 0) for index in connect_index_V: input_1[i][index] = 1 # section 2: transmission rate / delay input_2 = np.zeros((self.vehicle_num, self.vehicle_num + self.RSU_num + 1)) for i in range(self.vehicle_num): connect_index_V = np.argwhere(self.candidateV[i, :] != 0) for index_V in connect_index_V: input_2[i][index_V] = self.band_V2V * np.log2(1 + self.p_k * self.h_ik * pow(self.candidateV[i][index_V], -self.alpha) / self.sigma_2) connect_index_R = np.argwhere(self.candidateR[i, :] != 0) for index_R in connect_index_R: input_2[i][self.vehicle_num + index_R] = self.bij * np.log2(1 + self.p_j * self.h_ij * pow(self.candidateR[i][index_R], -self.alpha) / self.sigma_2) pos_dis = np.sqrt(np.sum(pow(self.position[i, 0:2], 2))) input_2[i][self.vehicle_num + self.RSU_num] = self.band_V2I / self.W * np.log2(1 + self.p_m * self.h_i0 * pow(pos_dis, -self.alpha) / self.sigma_2) # section 3: Vehicle cached contents input_3 = np.array((self.vehicle_num, self.vehicle_num * self.content_num)) for i in range(self.vehicle_num): for j in self.content_label_V[i, :]: # store self cache information input_3[i][i * self.content_num + j] = 1 connect_index_V = np.argwhere(self.candidateV[i, :] != 0) for index in connect_index_V: # store other vehicle information #index = self.candidateV[index][1] for j in self.content_label_V[index, :]: input_3[i][index * self.content_num + j] = 1 # section 4: RSU cached contents input_4 = np.array((self.vehicle_num, self.RSU_num * self.content_num)) for i in range(self.vehicle_num): connect_index_R = np.argwhere(self.candidateR[:, 0] != 0) for index in connect_index_R: #index = self.candidateR[index][1] for j in self.content_label_R[index, :]: input_4[i][index * self.content_num + j] = 1 input_matrix = np.concatenate((input_1, input_2, input_3, input_4), axis=1) return input_matrix def V2V_rate(self, position_A, position_B): # achievable data rate d_ik = np.sqrt(np.sum(np.power(position_A - position_B, 2))) R_ki = self.band_V2V * np.log2(1 + self.p_k * self.h_ik * pow(d_ik, -self.alpha) / self.sigma_2) return R_ki def V2V_time(self, y_ikf, position_A, position_B): # delivery time R_ki = self.V2V_rate(position_A, position_B) return y_ikf * self.content_size / R_ki def V2R_rate(self, position_A, position_B): d_ij = np.sqrt(np.sum(np.power(position_A - position_B, 2))) # total = np.sum(self.p_j .* ) # need modification R_ji = self.bij * np.log2(1 + self.p_j * self.h_ij * pow(d_ij, -self.alpha) / self.sigma_2) return R_ji def V2R_time(self, y_ijf, position_A, position_B): # delivery time R_ji = self.V2R_rate(position_A, position_B) return y_ijf * self.content_size / R_ji def V2I_rate(self, position_A): d_i0 = np.sqrt(np.sum(np.power(position_A - self.MBSposition, 2))) R_0i = self.band_V2I / self.W * np.log2(1 + self.p_m * self.h_i0 * pow(d_i0, -self.alpha) / self.sigma_2) return R_0i def V2I_time(self, y_i0f, position_A): R_0i = self.V2I_rate(position_A) return y_i0f * self.content_size / R_0i def delay_func(self, y_ikf, y_ijf, y_i0f, x_if, x_jf): # x_if, x_jf need modification # y_ikf, y_ijf, y_i0f, x_if, x_jf are ACTION SET V2V_delay = np.zeros((self.vehicle_num, self.vehicle_num)) for num in range(self.vehicle_num): for i in range(self.vehicle_num): if self.candidateV[num][i] != 0: position_A = self.position[num, 0:2] position_B = self.position[i, 0:2] T_ki = x_if * self.V2V_time(y_ikf, position_A, position_B) V2V_delay[num][i] = T_ki V2R_delay = np.zeros((self.vehicle_num, self.RSU_num)) for num in range(self.vehicle_num): for j in range(self.RSU_num): if self.candidateR[num][j] != 0: #ind0 = self.candidateR[j][0] #ind1 = self.candidateR[j][1] position_A = self.position[num, 0:2] position_B = self.RSUposition[j, 0:2] T_ji = x_jf * self.V2R_time(y_ijf, position_A, position_B) V2R_delay[num][j] = T_ji V2I_delay = np.zeros((self.vehicle_num, 1)) for k in range(self.vehicle_num): position_A = self.position[k, 0:2] V2I_delay[k] = self.V2I_time(y_i0f, position_A) total_delay = np.sum(V2V_delay, axis=1) + np.sum(V2R_delay, axis=1) + V2I_delay return total_delay
61.709832
164
0.469766
6,574
51,466
3.574536
0.039702
0.186136
0.255585
0.094727
0.855483
0.844078
0.821439
0.796119
0.771565
0.75982
0
0.049678
0.411359
51,466
834
165
61.709832
0.725994
0.122702
0
0.729252
0
0
0
0
0
0
0
0
0
1
0.019048
false
0
0.005442
0
0.043537
0
0
0
0
null
0
1
0
1
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
8
0eeb3d35a3c203ebc4e3a9d780cc42de6abeb580
37
py
Python
Codeforces Problems/Add Odd or Subtract Even/Add Odd or Subtract Even2.py
Social-CodePlat/Comptt-Coding-Solutions
240732e6c1a69e1124064bff4a27a5785a14b021
[ "MIT" ]
null
null
null
Codeforces Problems/Add Odd or Subtract Even/Add Odd or Subtract Even2.py
Social-CodePlat/Comptt-Coding-Solutions
240732e6c1a69e1124064bff4a27a5785a14b021
[ "MIT" ]
1
2020-10-13T20:57:34.000Z
2020-10-13T20:57:34.000Z
Codeforces Problems/Add Odd or Subtract Even/Add Odd or Subtract Even2.py
Social-CodePlat/Comptt-Coding-Solutions
240732e6c1a69e1124064bff4a27a5785a14b021
[ "MIT" ]
null
null
null
b=13 print(b and((b<0)&b|(b>0)&~b)+1)
18.5
32
0.513514
12
37
1.583333
0.5
0.210526
0.315789
0
0
0
0
0
0
0
0
0.142857
0.054054
37
2
32
18.5
0.4
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
1
1
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
8
0eeed55faef0079dce70ac44f66df5f39a80bcdb
49,229
py
Python
test_autoarray/unit/structures/test_arrays.py
Sketos/PyAutoArray
72dc7e8d1c38786915f82a7e7284239e5ce87624
[ "MIT" ]
null
null
null
test_autoarray/unit/structures/test_arrays.py
Sketos/PyAutoArray
72dc7e8d1c38786915f82a7e7284239e5ce87624
[ "MIT" ]
null
null
null
test_autoarray/unit/structures/test_arrays.py
Sketos/PyAutoArray
72dc7e8d1c38786915f82a7e7284239e5ce87624
[ "MIT" ]
null
null
null
import os import numpy as np import pytest import shutil import autoarray as aa from autoarray.structures import arrays from autoarray import exc test_data_dir = "{}/../test_files/array/".format( os.path.dirname(os.path.realpath(__file__)) ) class TestArrayAPI: class TestManual: def test__array__makes_array_without_other_inputs(self): arr = aa.array.manual_2d(array=[[1.0, 2.0], [3.0, 4.0]]) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0])).all() arr = aa.array.manual_1d(array=[1.0, 2.0, 3.0, 4.0], shape_2d=(2, 2)) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0])).all() arr = aa.array.manual_1d( array=[1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape_2d=(2, 3), store_in_1d=True ) assert type(arr) == arrays.Array assert (arr == np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0])).all() assert (arr.in_2d == np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0])).all() arr = aa.array.manual_1d( array=[1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape_2d=(2, 3), store_in_1d=False ) assert type(arr) == arrays.Array assert (arr == np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])).all() assert (arr.in_2d == np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0])).all() def test__array__makes_array_with_pixel_scale(self): arr = aa.array.manual_2d(array=[[1.0, 2.0], [3.0, 4.0]], pixel_scales=1.0) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) arr = aa.array.manual_1d( array=[1.0, 2.0, 3.0, 4.0], shape_2d=(2, 2), pixel_scales=1.0, origin=(0.0, 1.0), ) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) arr = aa.array.manual_1d( array=[1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape_2d=(2, 3), pixel_scales=(2.0, 3.0), ) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0])).all() assert arr.pixel_scales == (2.0, 3.0) assert arr.geometry.origin == (0.0, 0.0) def test__array__makes_with_pixel_scale_and_sub_size(self): arr = aa.array.manual_2d( array=[[1.0, 2.0], [3.0, 4.0]], pixel_scales=1.0, sub_size=1 ) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 1 arr = aa.array.manual_1d( array=[1.0, 2.0, 3.0, 4.0], shape_2d=(1, 1), pixel_scales=1.0, sub_size=2, origin=(0.0, 1.0), ) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) assert arr.mask.sub_size == 2 arr = aa.array.manual_1d( array=[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0], shape_2d=(2, 1), pixel_scales=2.0, sub_size=2, ) assert type(arr) == arrays.Array assert ( arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]) ).all() assert ( arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]) ).all() assert (arr.in_2d_binned == np.array([[2.5], [6.5]])).all() assert (arr.in_1d_binned == np.array([2.5, 6.5])).all() assert arr.pixel_scales == (2.0, 2.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 2 class TestFull: def test__array__makes_array_without_other_inputs(self): arr = aa.array.full(fill_value=1.0, shape_2d=(2, 2)) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 1.0], [1.0, 1.0]])).all() assert (arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0])).all() arr = aa.array.full(fill_value=2.0, shape_2d=(2, 2), store_in_1d=True) assert type(arr) == arrays.Array assert (arr == np.array([2.0, 2.0, 2.0, 2.0])).all() assert (arr.in_2d == np.array([[2.0, 2.0], [2.0, 2.0]])).all() assert (arr.in_1d == np.array([2.0, 2.0, 2.0, 2.0])).all() arr = aa.array.full(fill_value=2.0, shape_2d=(2, 2), store_in_1d=False) assert type(arr) == arrays.Array assert (arr == np.array([[2.0, 2.0], [2.0, 2.0]])).all() assert (arr.in_2d == np.array([[2.0, 2.0], [2.0, 2.0]])).all() assert (arr.in_1d == np.array([2.0, 2.0, 2.0, 2.0])).all() def test__array__makes_scaled_array_with_pixel_scale(self): arr = aa.array.full(fill_value=1.0, shape_2d=(2, 2), pixel_scales=1.0) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 1.0], [1.0, 1.0]])).all() assert (arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) arr = aa.array.full( fill_value=2.0, shape_2d=(2, 2), pixel_scales=1.0, origin=(0.0, 1.0) ) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[2.0, 2.0], [2.0, 2.0]])).all() assert (arr.in_1d == np.array([2.0, 2.0, 2.0, 2.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) def test__array__makes_scaled_sub_array_with_pixel_scale_and_sub_size(self): arr = aa.array.full( fill_value=1.0, shape_2d=(1, 4), pixel_scales=1.0, sub_size=1 ) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 1.0, 1.0, 1.0]])).all() assert (arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 1 arr = aa.array.full( fill_value=2.0, shape_2d=(1, 1), pixel_scales=1.0, sub_size=2, origin=(0.0, 1.0), ) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[2.0, 2.0], [2.0, 2.0]])).all() assert (arr.in_1d == np.array([2.0, 2.0, 2.0, 2.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) assert arr.mask.sub_size == 2 class TestOnesZeros: def test__array__makes_array_without_other_inputs(self): arr = aa.array.ones(shape_2d=(2, 2)) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 1.0], [1.0, 1.0]])).all() assert (arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0])).all() arr = aa.array.zeros(shape_2d=(2, 2), store_in_1d=True) assert type(arr) == arrays.Array assert (arr == np.array([0.0, 0.0, 0.0, 0.0])).all() assert (arr.in_2d == np.array([[0.0, 0.0], [0.0, 0.0]])).all() assert (arr.in_1d == np.array([0.0, 0.0, 0.0, 0.0])).all() arr = aa.array.zeros(shape_2d=(2, 2), store_in_1d=False) assert type(arr) == arrays.Array assert (arr == np.array([[0.0, 0.0], [0.0, 0.0]])).all() assert (arr.in_2d == np.array([[0.0, 0.0], [0.0, 0.0]])).all() assert (arr.in_1d == np.array([0.0, 0.0, 0.0, 0.0])).all() def test__array__makes_scaled_array_with_pixel_scale(self): arr = aa.array.ones(shape_2d=(2, 2), pixel_scales=1.0) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 1.0], [1.0, 1.0]])).all() assert (arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) arr = aa.array.zeros(shape_2d=(2, 2), pixel_scales=1.0, origin=(0.0, 1.0)) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[0.0, 0.0], [0.0, 0.0]])).all() assert (arr.in_1d == np.array([0.0, 0.0, 0.0, 0.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) def test__array__makes_scaled_sub_array_with_pixel_scale_and_sub_size(self): arr = aa.array.ones(shape_2d=(1, 4), pixel_scales=1.0, sub_size=1) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 1.0, 1.0, 1.0]])).all() assert (arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 1 arr = aa.array.zeros( shape_2d=(1, 1), pixel_scales=1.0, sub_size=2, origin=(0.0, 1.0) ) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[0.0, 0.0], [0.0, 0.0]])).all() assert (arr.in_1d == np.array([0.0, 0.0, 0.0, 0.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) assert arr.mask.sub_size == 2 class TestFromFits: def test__array__makes_array_without_other_inputs(self): arr = aa.array.from_fits(file_path=test_data_dir + "3x3_ones.fits", hdu=0) assert type(arr) == arrays.Array assert (arr.in_2d == np.ones((3, 3))).all() assert (arr.in_1d == np.ones(9)).all() arr = aa.array.from_fits( file_path=test_data_dir + "4x3_ones.fits", hdu=0, store_in_1d=True ) assert type(arr) == arrays.Array assert (arr == np.ones((12,))).all() assert (arr.in_2d == np.ones((4, 3))).all() assert (arr.in_1d == np.ones((12,))).all() arr = aa.array.from_fits( file_path=test_data_dir + "4x3_ones.fits", hdu=0, store_in_1d=False ) assert type(arr) == arrays.Array assert (arr == np.ones((4, 3))).all() assert (arr.in_2d == np.ones((4, 3))).all() assert (arr.in_1d == np.ones((12,))).all() def test__array__makes_scaled_array_with_pixel_scale(self): arr = aa.array.from_fits( file_path=test_data_dir + "3x3_ones.fits", hdu=0, pixel_scales=1.0 ) assert type(arr) == arrays.Array assert (arr.in_2d == np.ones((3, 3))).all() assert (arr.in_1d == np.ones(9)).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) arr = aa.array.from_fits( file_path=test_data_dir + "4x3_ones.fits", hdu=0, pixel_scales=1.0, origin=(0.0, 1.0), ) assert type(arr) == arrays.Array assert (arr.in_2d == np.ones((4, 3))).all() assert (arr.in_1d == np.ones((12,))).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) def test__array__makes_scaled_sub_array_with_pixel_scale_and_sub_size(self): arr = aa.array.from_fits( file_path=test_data_dir + "3x3_ones.fits", hdu=0, pixel_scales=1.0, sub_size=1, ) assert type(arr) == arrays.Array assert (arr.in_2d == np.ones((3, 3))).all() assert (arr.in_1d == np.ones(9)).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 1 arr = aa.array.from_fits( file_path=test_data_dir + "4x3_ones.fits", hdu=0, pixel_scales=1.0, sub_size=1, origin=(0.0, 1.0), ) assert type(arr) == arrays.Array assert (arr.in_2d == np.ones((4, 3))).all() assert (arr.in_1d == np.ones(12)).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) assert arr.mask.sub_size == 1 class TestMaskedArrayAPI: class TestManual: def test__array__makes_array_with_pixel_scale(self): mask = aa.mask.unmasked(shape_2d=(2, 2), pixel_scales=1.0) arr = aa.masked.array.manual_2d(array=[[1.0, 2.0], [3.0, 4.0]], mask=mask) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) mask = aa.mask.manual( mask_2d=[[False, False], [True, False]], pixel_scales=1.0, origin=(0.0, 1.0), ) arr = aa.masked.array.manual_1d(array=[1.0, 2.0, 4.0], mask=mask) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 2.0], [0.0, 4.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 4.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) mask = aa.mask.manual( mask_2d=[[False, False], [True, False]], pixel_scales=1.0, origin=(0.0, 1.0), ) arr = aa.masked.array.manual_2d(array=[[1.0, 2.0], [3.0, 4.0]], mask=mask) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 2.0], [0.0, 4.0]])).all() assert (arr.in_1d == np.array([1.0, 2.0, 4.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) mask = aa.mask.manual( mask_2d=[[False], [True]], pixel_scales=2.0, sub_size=2 ) arr = aa.masked.array.manual_1d( array=[1.0, 2.0, 3.0, 4.0], mask=mask, store_in_1d=True ) assert type(arr) == arrays.Array assert (arr == np.array([1.0, 2.0, 3.0, 4.0])).all() assert ( arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0], [0.0, 0.0], [0.0, 0.0]]) ).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0])).all() assert (arr.in_2d_binned == np.array([[2.5], [0.0]])).all() assert (arr.in_1d_binned == np.array([2.5])).all() assert arr.pixel_scales == (2.0, 2.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 2 arr = aa.masked.array.manual_1d( array=[1.0, 2.0, 3.0, 4.0], mask=mask, store_in_1d=False ) assert type(arr) == arrays.Array assert ( arr == np.array([[1.0, 2.0], [3.0, 4.0], [0.0, 0.0], [0.0, 0.0]]) ).all() assert ( arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0], [0.0, 0.0], [0.0, 0.0]]) ).all() assert (arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0])).all() assert (arr.in_2d_binned == np.array([[2.5], [0.0]])).all() assert (arr.in_1d_binned == np.array([2.5])).all() assert arr.pixel_scales == (2.0, 2.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 2 def test__manual_2d__exception_raised_if_input_array_is_2d_and_not_sub_shape_of_mask( self ): with pytest.raises(exc.ArrayException): mask = aa.mask.unmasked(shape_2d=(2, 2), pixel_scales=1.0, sub_size=1) aa.masked.array.manual_2d(array=[[1.0], [3.0]], mask=mask) with pytest.raises(exc.ArrayException): mask = aa.mask.unmasked(shape_2d=(2, 2), pixel_scales=1.0, sub_size=2) aa.masked.array.manual_2d(array=[[1.0, 2.0], [3.0, 4.0]], mask=mask) with pytest.raises(exc.ArrayException): mask = aa.mask.unmasked(shape_2d=(2, 2), pixel_scales=1.0, sub_size=2) aa.masked.array.manual_2d( array=[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], mask=mask ) def test__exception_raised_if_input_array_is_1d_and_not_number_of_masked_sub_pixels( self ): with pytest.raises(exc.ArrayException): mask = aa.mask.manual( mask_2d=[[False, False], [True, False]], sub_size=1 ) aa.masked.array.manual_1d(array=[1.0, 2.0, 3.0, 4.0], mask=mask) with pytest.raises(exc.ArrayException): mask = aa.mask.manual( mask_2d=[[False, False], [True, False]], sub_size=1 ) aa.masked.array.manual_1d(array=[1.0, 2.0], mask=mask) with pytest.raises(exc.ArrayException): mask = aa.mask.manual(mask_2d=[[False, True], [True, True]], sub_size=2) aa.masked.array.manual_1d(array=[1.0, 2.0, 4.0], mask=mask) with pytest.raises(exc.ArrayException): mask = aa.mask.manual(mask_2d=[[False, True], [True, True]], sub_size=2) aa.masked.array.manual_1d(array=[1.0, 2.0, 3.0, 4.0, 5.0], mask=mask) class TestFull: def test__makes_array_using_mask(self): mask = aa.mask.unmasked(shape_2d=(2, 2), pixel_scales=1.0) arr = aa.masked.array.full(fill_value=1.0, mask=mask) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 1.0], [1.0, 1.0]])).all() assert (arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) mask = aa.mask.manual( mask_2d=[[False, False], [True, False]], pixel_scales=1.0, origin=(0.0, 1.0), ) arr = aa.masked.array.full(fill_value=2.0, mask=mask) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[2.0, 2.0], [0.0, 2.0]])).all() assert (arr.in_1d == np.array([2.0, 2.0, 2.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) mask = aa.mask.manual( mask_2d=[[False], [True]], pixel_scales=2.0, sub_size=2 ) arr = aa.masked.array.full(fill_value=3.0, mask=mask, store_in_1d=True) assert type(arr) == arrays.Array assert (arr == np.array([3.0, 3.0, 3.0, 3.0])).all() assert ( arr.in_2d == np.array([[3.0, 3.0], [3.0, 3.0], [0.0, 0.0], [0.0, 0.0]]) ).all() assert (arr.in_1d == np.array([3.0, 3.0, 3.0, 3.0])).all() assert (arr.in_2d_binned == np.array([[3.0], [0.0]])).all() assert (arr.in_1d_binned == np.array([3.0])).all() assert arr.pixel_scales == (2.0, 2.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 2 arr = aa.masked.array.full(fill_value=3.0, mask=mask, store_in_1d=False) assert type(arr) == arrays.Array assert ( arr == np.array([[3.0, 3.0], [3.0, 3.0], [0.0, 0.0], [0.0, 0.0]]) ).all() assert ( arr.in_2d == np.array([[3.0, 3.0], [3.0, 3.0], [0.0, 0.0], [0.0, 0.0]]) ).all() assert (arr.in_1d == np.array([3.0, 3.0, 3.0, 3.0])).all() assert (arr.in_2d_binned == np.array([[3.0], [0.0]])).all() assert (arr.in_1d_binned == np.array([3.0])).all() assert arr.pixel_scales == (2.0, 2.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 2 class TestOnesZeros: def test__makes_array_using_mask(self): mask = aa.mask.unmasked(shape_2d=(2, 2), pixel_scales=1.0) arr = aa.masked.array.ones(mask=mask) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[1.0, 1.0], [1.0, 1.0]])).all() assert (arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) mask = aa.mask.manual( mask_2d=[[False, False], [True, False]], pixel_scales=1.0, origin=(0.0, 1.0), ) arr = aa.masked.array.zeros(mask=mask) assert type(arr) == arrays.Array assert (arr.in_2d == np.array([[0.0, 0.0], [0.0, 0.0]])).all() assert (arr.in_1d == np.array([0.0, 0.0, 0.0])).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) mask = aa.mask.manual( mask_2d=[[False], [True]], pixel_scales=2.0, sub_size=2 ) arr = aa.masked.array.ones(mask=mask, store_in_1d=True) assert type(arr) == arrays.Array assert (arr == np.array([1.0, 1.0, 1.0, 1.0])).all() assert ( arr.in_2d == np.array([[1.0, 1.0], [1.0, 1.0], [0.0, 0.0], [0.0, 0.0]]) ).all() assert (arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0])).all() assert (arr.in_2d_binned == np.array([[1.0], [0.0]])).all() assert (arr.in_1d_binned == np.array([1.0])).all() assert arr.pixel_scales == (2.0, 2.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 2 arr = aa.masked.array.ones(mask=mask, store_in_1d=False) assert type(arr) == arrays.Array assert ( arr == np.array([[1.0, 1.0], [1.0, 1.0], [0.0, 0.0], [0.0, 0.0]]) ).all() assert ( arr.in_2d == np.array([[1.0, 1.0], [1.0, 1.0], [0.0, 0.0], [0.0, 0.0]]) ).all() assert (arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0])).all() assert (arr.in_2d_binned == np.array([[1.0], [0.0]])).all() assert (arr.in_1d_binned == np.array([1.0])).all() assert arr.pixel_scales == (2.0, 2.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 2 class TestFromFits: def test__array_from_fits_uses_mask(self): mask = aa.mask.unmasked(shape_2d=(3, 3), pixel_scales=1.0) arr = aa.masked.array.from_fits( file_path=test_data_dir + "3x3_ones.fits", hdu=0, mask=mask ) assert type(arr) == arrays.Array assert (arr.in_2d == np.ones((3, 3))).all() assert (arr.in_1d == np.ones(9)).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 0.0) assert arr.mask.sub_size == 1 mask = aa.mask.manual( [ [False, False, False], [False, False, False], [True, False, True], [False, False, False], ], pixel_scales=1.0, origin=(0.0, 1.0), ) arr = aa.masked.array.from_fits( file_path=test_data_dir + "4x3_ones.fits", hdu=0, mask=mask, store_in_1d=True, ) assert type(arr) == arrays.Array assert ( arr == np.array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]) ).all() assert ( arr.in_2d == np.array( [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [0.0, 1.0, 0.0], [1.0, 1.0, 1.0]] ) ).all() assert ( arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]) ).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) assert arr.mask.sub_size == 1 arr = aa.masked.array.from_fits( file_path=test_data_dir + "4x3_ones.fits", hdu=0, mask=mask, store_in_1d=False, ) assert type(arr) == arrays.Array assert ( arr == np.array( [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [0.0, 1.0, 0.0], [1.0, 1.0, 1.0]] ) ).all() assert ( arr.in_2d == np.array( [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [0.0, 1.0, 0.0], [1.0, 1.0, 1.0]] ) ).all() assert ( arr.in_1d == np.array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]) ).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.origin == (0.0, 1.0) assert arr.mask.sub_size == 1 class TestArray: class TestConstructorMethods: def test__constructor_class_method_in_2d__store_in_1d(self): arr = arrays.Array.manual_2d( array=np.ones((3, 3)), sub_size=1, pixel_scales=(1.0, 1.0), store_in_1d=True, ) assert (arr == np.ones((9,))).all() assert (arr.in_1d == np.ones((9,))).all() assert (arr.in_2d == np.ones((3, 3))).all() assert (arr.in_1d_binned == np.ones((9,))).all() assert (arr.in_2d_binned == np.ones((3, 3))).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.central_pixel_coordinates == (1.0, 1.0) assert arr.geometry.shape_2d_scaled == pytest.approx((3.0, 3.0)) assert arr.geometry.scaled_maxima == (1.5, 1.5) assert arr.geometry.scaled_minima == (-1.5, -1.5) arr = arrays.Array.manual_2d( array=np.ones((4, 4)), sub_size=2, pixel_scales=(0.1, 0.1), store_in_1d=True, ) assert (arr == np.ones((16,))).all() assert (arr.in_1d == np.ones((16,))).all() assert (arr.in_2d == np.ones((4, 4))).all() assert (arr.in_1d_binned == np.ones((4,))).all() assert (arr.in_2d_binned == np.ones((2, 2))).all() assert arr.pixel_scales == (0.1, 0.1) assert arr.geometry.central_pixel_coordinates == (0.5, 0.5) assert arr.geometry.shape_2d_scaled == pytest.approx((0.2, 0.2)) assert arr.geometry.scaled_maxima == pytest.approx((0.1, 0.1), 1e-4) assert arr.geometry.scaled_minima == pytest.approx((-0.1, -0.1), 1e-4) arr = arrays.Array.manual_2d( array=np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]), pixel_scales=(0.1, 0.1), sub_size=2, origin=(1.0, 1.0), store_in_1d=True, ) assert (arr == np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0])).all() assert arr.shape_2d == (2, 1) assert arr.sub_shape_2d == (4, 2) assert ( arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]) ).all() assert ( arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]) ).all() assert arr.in_2d_binned.shape == (2, 1) assert (arr.in_1d_binned == np.array([2.5, 6.5])).all() assert (arr.in_2d_binned == np.array([[2.5], [6.5]])).all() assert arr.pixel_scales == (0.1, 0.1) assert arr.geometry.central_pixel_coordinates == (0.5, 0.0) assert arr.geometry.shape_2d_scaled == pytest.approx((0.2, 0.1)) assert arr.geometry.scaled_maxima == pytest.approx((1.1, 1.05), 1e-4) assert arr.geometry.scaled_minima == pytest.approx((0.9, 0.95), 1e-4) arr = arrays.Array.manual_2d( array=np.ones((3, 3)), pixel_scales=(2.0, 1.0), sub_size=1, origin=(-1.0, -2.0), store_in_1d=True, ) assert arr == pytest.approx(np.ones((9,)), 1e-4) assert arr.in_1d == pytest.approx(np.ones((9,)), 1e-4) assert arr.in_2d == pytest.approx(np.ones((3, 3)), 1e-4) assert arr.pixel_scales == (2.0, 1.0) assert arr.geometry.central_pixel_coordinates == (1.0, 1.0) assert arr.geometry.shape_2d_scaled == pytest.approx((6.0, 3.0)) assert arr.geometry.origin == (-1.0, -2.0) assert arr.geometry.scaled_maxima == pytest.approx((2.0, -0.5), 1e-4) assert arr.geometry.scaled_minima == pytest.approx((-4.0, -3.5), 1e-4) def test__constructor_class_method_in_1d__store_in_1d(self): arr = arrays.Array.manual_1d( array=np.ones((9,)), shape_2d=(3, 3), pixel_scales=(2.0, 1.0), sub_size=1, origin=(-1.0, -2.0), store_in_1d=True, ) assert arr == pytest.approx(np.ones((9,)), 1e-4) assert arr.in_1d == pytest.approx(np.ones((9,)), 1e-4) assert arr.in_2d == pytest.approx(np.ones((3, 3)), 1e-4) assert arr.pixel_scales == (2.0, 1.0) assert arr.geometry.central_pixel_coordinates == (1.0, 1.0) assert arr.geometry.shape_2d_scaled == pytest.approx((6.0, 3.0)) assert arr.geometry.origin == (-1.0, -2.0) assert arr.geometry.scaled_maxima == pytest.approx((2.0, -0.5), 1e-4) assert arr.geometry.scaled_minima == pytest.approx((-4.0, -3.5), 1e-4) def test__constructor_class_method_in_2d__store_in_2d(self): arr = arrays.Array.manual_2d( array=np.ones((3, 3)), sub_size=1, pixel_scales=(1.0, 1.0), store_in_1d=False, ) assert (arr == np.ones((3, 3))).all() assert (arr.in_1d == np.ones((9,))).all() assert (arr.in_2d == np.ones((3, 3))).all() assert (arr.in_1d_binned == np.ones((9,))).all() assert (arr.in_2d_binned == np.ones((3, 3))).all() assert arr.pixel_scales == (1.0, 1.0) assert arr.geometry.central_pixel_coordinates == (1.0, 1.0) assert arr.geometry.shape_2d_scaled == pytest.approx((3.0, 3.0)) assert arr.geometry.scaled_maxima == (1.5, 1.5) assert arr.geometry.scaled_minima == (-1.5, -1.5) arr = arrays.Array.manual_2d( array=np.ones((4, 4)), sub_size=2, pixel_scales=(0.1, 0.1), store_in_1d=False, ) assert (arr == np.ones((4, 4))).all() assert (arr.in_1d == np.ones((16,))).all() assert (arr.in_2d == np.ones((4, 4))).all() assert (arr.in_1d_binned == np.ones((4,))).all() assert (arr.in_2d_binned == np.ones((2, 2))).all() assert arr.pixel_scales == (0.1, 0.1) assert arr.geometry.central_pixel_coordinates == (0.5, 0.5) assert arr.geometry.shape_2d_scaled == pytest.approx((0.2, 0.2)) assert arr.geometry.scaled_maxima == pytest.approx((0.1, 0.1), 1e-4) assert arr.geometry.scaled_minima == pytest.approx((-0.1, -0.1), 1e-4) arr = arrays.Array.manual_2d( array=np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]), pixel_scales=(0.1, 0.1), sub_size=2, origin=(1.0, 1.0), store_in_1d=False, ) assert ( arr == np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]) ).all() assert arr.shape_2d == (2, 1) assert arr.sub_shape_2d == (4, 2) assert ( arr.in_1d == np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]) ).all() assert ( arr.in_2d == np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]) ).all() assert arr.in_2d_binned.shape == (2, 1) assert (arr.in_1d_binned == np.array([2.5, 6.5])).all() assert (arr.in_2d_binned == np.array([[2.5], [6.5]])).all() assert arr.pixel_scales == (0.1, 0.1) assert arr.geometry.central_pixel_coordinates == (0.5, 0.0) assert arr.geometry.shape_2d_scaled == pytest.approx((0.2, 0.1)) assert arr.geometry.scaled_maxima == pytest.approx((1.1, 1.05), 1e-4) assert arr.geometry.scaled_minima == pytest.approx((0.9, 0.95), 1e-4) arr = arrays.Array.manual_2d( array=np.ones((3, 3)), pixel_scales=(2.0, 1.0), sub_size=1, origin=(-1.0, -2.0), store_in_1d=False, ) assert arr == pytest.approx(np.ones((3, 3)), 1e-4) assert arr.in_1d == pytest.approx(np.ones((9,)), 1e-4) assert arr.in_2d == pytest.approx(np.ones((3, 3)), 1e-4) assert arr.pixel_scales == (2.0, 1.0) assert arr.geometry.central_pixel_coordinates == (1.0, 1.0) assert arr.geometry.shape_2d_scaled == pytest.approx((6.0, 3.0)) assert arr.geometry.origin == (-1.0, -2.0) assert arr.geometry.scaled_maxima == pytest.approx((2.0, -0.5), 1e-4) assert arr.geometry.scaled_minima == pytest.approx((-4.0, -3.5), 1e-4) def test__constructor_class_method_in_1d__store_in_2d(self): arr = arrays.Array.manual_1d( array=np.ones((9,)), shape_2d=(3, 3), pixel_scales=(2.0, 1.0), sub_size=1, origin=(-1.0, -2.0), store_in_1d=False, ) assert arr == pytest.approx(np.ones((3, 3)), 1e-4) assert arr.in_1d == pytest.approx(np.ones((9,)), 1e-4) assert arr.in_2d == pytest.approx(np.ones((3, 3)), 1e-4) assert arr.pixel_scales == (2.0, 1.0) assert arr.geometry.central_pixel_coordinates == (1.0, 1.0) assert arr.geometry.shape_2d_scaled == pytest.approx((6.0, 3.0)) assert arr.geometry.origin == (-1.0, -2.0) assert arr.geometry.scaled_maxima == pytest.approx((2.0, -0.5), 1e-4) assert arr.geometry.scaled_minima == pytest.approx((-4.0, -3.5), 1e-4) class TestNewArrays: def test__pad__compare_to_array_util(self): array_2d = np.ones((5, 5)) array_2d[2, 2] = 2.0 arr = arrays.Array.manual_2d( array=array_2d, sub_size=1, pixel_scales=(1.0, 1.0) ) arr = arr.resized_from_new_shape(new_shape=(7, 7)) arr_resized_manual = np.array( [ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 2.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ] ) assert type(arr) == arrays.Array assert (arr.in_2d == arr_resized_manual).all() assert arr.mask.pixel_scales == (1.0, 1.0) def test__trim__compare_to_array_util(self): array_2d = np.ones((5, 5)) array_2d[2, 2] = 2.0 arr = arrays.Array.manual_2d( array=array_2d, sub_size=1, pixel_scales=(1.0, 1.0) ) arr = arr.resized_from_new_shape(new_shape=(3, 3)) arr_resized_manual = np.array( [[1.0, 1.0, 1.0], [1.0, 2.0, 1.0], [1.0, 1.0, 1.0]] ) assert type(arr) == arrays.Array assert (arr.in_2d == arr_resized_manual).all() assert arr.mask.pixel_scales == (1.0, 1.0) def test__kernel_trim__trim_edges_where_extra_psf_blurring_is_performed(self): array_2d = np.ones((5, 5)) array_2d[2, 2] = 2.0 arr = arrays.Array.manual_2d( array=array_2d, sub_size=1, pixel_scales=(1.0, 1.0) ) new_arr = arr.trimmed_from_kernel_shape(kernel_shape_2d=(3, 3)) assert type(new_arr) == arrays.Array assert ( new_arr.in_2d == np.array([[1.0, 1.0, 1.0], [1.0, 2.0, 1.0], [1.0, 1.0, 1.0]]) ).all() assert new_arr.mask.pixel_scales == (1.0, 1.0) new_arr = arr.trimmed_from_kernel_shape(kernel_shape_2d=(5, 5)) assert type(new_arr) == arrays.Array assert (new_arr.in_2d == np.array([[2.0]])).all() assert new_arr.mask.pixel_scales == (1.0, 1.0) array_2d = np.ones((9, 9)) array_2d[4, 4] = 2.0 arr = arrays.Array.manual_2d( array=array_2d, sub_size=1, pixel_scales=(1.0, 1.0) ) new_arr = arr.trimmed_from_kernel_shape(kernel_shape_2d=(7, 7)) assert type(new_arr) == arrays.Array assert ( new_arr.in_2d == np.array([[1.0, 1.0, 1.0], [1.0, 2.0, 1.0], [1.0, 1.0, 1.0]]) ).all() assert new_arr.mask.pixel_scales == (1.0, 1.0) def test__zoomed__2d_array_zoomed__uses_the_limits_of_the_mask(self): array_2d = np.array( [ [1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0], [9.0, 10.0, 11.0, 12.0], [13.0, 14.0, 15.0, 16.0], ] ) mask = aa.mask.manual( mask_2d=np.array( [ [True, True, True, True], [True, False, False, True], [True, False, False, True], [True, True, True, True], ] ), pixel_scales=(1.0, 1.0), sub_size=1, ) arr_masked = aa.masked.array.manual_2d(array=array_2d, mask=mask) arr_zoomed = arr_masked.zoomed_around_mask(buffer=0) assert (arr_zoomed.in_2d == np.array([[6.0, 7.0], [10.0, 11.0]])).all() mask = aa.mask.manual( mask_2d=np.array( [ [True, True, True, True], [True, False, False, False], [True, False, False, False], [True, True, True, True], ] ), pixel_scales=(1.0, 1.0), sub_size=1, ) arr_masked = aa.masked.array.manual_2d(array=array_2d, mask=mask) arr_zoomed = arr_masked.zoomed_around_mask(buffer=0) assert ( arr_zoomed.in_2d == np.array([[6.0, 7.0, 8.0], [10.0, 11.0, 12.0]]) ).all() mask = aa.mask.manual( mask_2d=np.array( [ [True, True, True, True], [True, False, False, True], [True, False, False, True], [True, False, False, True], ] ), pixel_scales=(1.0, 1.0), sub_size=1, ) arr_masked = aa.masked.array.manual_2d(array=array_2d, mask=mask) arr_zoomed = arr_masked.zoomed_around_mask(buffer=0) assert ( arr_zoomed.in_2d == np.array([[6.0, 7.0], [10.0, 11.0], [14.0, 15.0]]) ).all() mask = aa.mask.manual( mask_2d=np.array( [ [True, True, True, True], [True, False, False, True], [False, False, False, True], [True, True, True, True], ] ), pixel_scales=(1.0, 1.0), sub_size=1, ) arr_masked = aa.masked.array.manual_2d(array=array_2d, mask=mask) arr_zoomed = arr_masked.zoomed_around_mask(buffer=0) assert ( arr_zoomed.in_2d == np.array([[0.0, 6.0, 7.0], [9.0, 10.0, 11.0]]) ).all() mask = aa.mask.manual( mask_2d=np.array( [ [True, False, True, True], [True, False, False, True], [True, False, False, True], [True, True, True, True], ] ), pixel_scales=(1.0, 1.0), sub_size=1, ) arr_masked = aa.masked.array.manual_2d(array=array_2d, mask=mask) arr_zoomed = arr_masked.zoomed_around_mask(buffer=0) assert ( arr_zoomed.in_2d == np.array([[2.0, 0.0], [6.0, 7.0], [10.0, 11.0]]) ).all() mask = aa.mask.manual( mask_2d=np.array( [ [True, True, True, True], [True, False, False, True], [True, False, False, True], [True, True, True, True], ] ), pixel_scales=(1.0, 1.0), sub_size=1, ) arr_masked = aa.masked.array.manual_2d(array=array_2d, mask=mask) arr_zoomed = arr_masked.zoomed_around_mask(buffer=1) assert ( arr_zoomed.in_2d == np.array( [ [0.0, 0.0, 0.0, 0.0], [0.0, 6.0, 7.0, 0.0], [0.0, 10.0, 11.0, 0.0], [0.0, 0.0, 0.0, 0.0], ] ) ).all() def test__zoomed__array_extent__uses_the_limits_of_the_unzoomed_mask(self): array_2d = np.array( [ [1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0], [9.0, 10.0, 11.0, 12.0], [13.0, 14.0, 15.0, 16.0], ] ) mask = aa.mask.manual( mask_2d=np.array( [ [True, True, True, False], [True, False, False, True], [True, False, False, True], [True, True, True, True], ] ), pixel_scales=(1.0, 2.0), sub_size=1, ) arr_masked = aa.masked.array.manual_2d(array=array_2d, mask=mask) extent = arr_masked.extent_of_zoomed_array(buffer=1) assert extent == pytest.approx(np.array([-4.0, 6.0, -2.0, 3.0]), 1.0e-4) def test__binned_up__compare_all_extract_methods_to_array_util(self): array_2d = np.array( [ [1.0, 6.0, 3.0, 7.0, 3.0, 2.0], [2.0, 5.0, 3.0, 7.0, 7.0, 7.0], [1.0, 2.0, 3.0, 4.0, 5.0, 6.0], ] ) arr = arrays.Array.manual_2d( array=array_2d, sub_size=1, pixel_scales=(0.1, 0.1) ) arr_binned_util = aa.util.binning.bin_array_2d_via_mean( array_2d=array_2d, bin_up_factor=4 ) arr_binned = arr.binned_from_bin_up_factor(bin_up_factor=4, method="mean") assert (arr_binned.in_2d == arr_binned_util).all() assert arr_binned.pixel_scales == (0.4, 0.4) arr_binned_util = aa.util.binning.bin_array_2d_via_quadrature( array_2d=array_2d, bin_up_factor=4 ) arr_binned = arr.binned_from_bin_up_factor( bin_up_factor=4, method="quadrature" ) assert (arr_binned.in_2d == arr_binned_util).all() assert arr_binned.pixel_scales == (0.4, 0.4) arr_binned_util = aa.util.binning.bin_array_2d_via_sum( array_2d=array_2d, bin_up_factor=4 ) arr_binned = arr.binned_from_bin_up_factor(bin_up_factor=4, method="sum") assert (arr_binned.in_2d == arr_binned_util).all() assert arr_binned.pixel_scales == (0.4, 0.4) def test__binned_up__invalid_method__raises_exception(self): array_2d = np.array( [ [1.0, 6.0, 3.0, 7.0, 3.0, 2.0], [2.0, 5.0, 3.0, 7.0, 7.0, 7.0], [1.0, 2.0, 3.0, 4.0, 5.0, 6.0], ] ) array_2d = arrays.Array.manual_2d( array=array_2d, sub_size=1, pixel_scales=(0.1, 0.1) ) with pytest.raises(exc.ArrayException): array_2d.binned_from_bin_up_factor(bin_up_factor=4, method="wrong") class TestOutputToFits: def test__output_to_fits(self): arr = aa.array.from_fits(file_path=test_data_dir + "3x3_ones.fits", hdu=0) output_data_dir = "{}/../test_files/array/output_test/".format( os.path.dirname(os.path.realpath(__file__)) ) if os.path.exists(output_data_dir): shutil.rmtree(output_data_dir) os.makedirs(output_data_dir) arr.output_to_fits(file_path=output_data_dir + "array.fits") array_from_out = aa.array.from_fits( file_path=output_data_dir + "array.fits", hdu=0 ) assert (array_from_out.in_2d == np.ones((3, 3))).all() def test__output_to_fits__shapes_of_arrays_are_2d(self): arr = aa.array.from_fits(file_path=test_data_dir + "3x3_ones.fits", hdu=0) output_data_dir = "{}/../test_files/array/output_test/".format( os.path.dirname(os.path.realpath(__file__)) ) if os.path.exists(output_data_dir): shutil.rmtree(output_data_dir) os.makedirs(output_data_dir) arr.output_to_fits(file_path=output_data_dir + "array.fits") array_from_out = aa.util.array.numpy_array_2d_from_fits( file_path=output_data_dir + "array.fits", hdu=0 ) assert (array_from_out == np.ones((3, 3))).all() mask = aa.mask.unmasked(shape_2d=(3, 3), pixel_scales=0.1) masked_array = aa.masked.array(array=arr, mask=mask) masked_array.output_to_fits(file_path=output_data_dir + "masked_array.fits") masked_array_from_out = aa.util.array.numpy_array_2d_from_fits( file_path=output_data_dir + "masked_array.fits", hdu=0 ) assert (masked_array_from_out == np.ones((3, 3))).all()
40.219771
93
0.475939
7,392
49,229
3.00717
0.021239
0.041927
0.036304
0.036529
0.963606
0.95029
0.946826
0.941338
0.93324
0.920239
0
0.101585
0.352719
49,229
1,223
94
40.252657
0.596014
0
0
0.739563
0
0
0.007008
0.001889
0
0
0
0
0.387674
1
0.030815
false
0
0.006958
0
0.05169
0
0
0
0
null
0
0
0
1
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
7
1601a24de6348ad66a9381c0effa40ae2e60256b
24,190
py
Python
mpf/tests/test_BallHold.py
Scottacus64/mpf
fcfb6c5698b9c7d8bf0eb64b021aaa389ea6478a
[ "MIT" ]
163
2015-01-25T02:19:50.000Z
2022-03-26T12:00:28.000Z
mpf/tests/test_BallHold.py
Scottacus64/mpf
fcfb6c5698b9c7d8bf0eb64b021aaa389ea6478a
[ "MIT" ]
1,086
2015-03-23T19:53:17.000Z
2022-03-24T20:46:11.000Z
mpf/tests/test_BallHold.py
Scottacus64/mpf
fcfb6c5698b9c7d8bf0eb64b021aaa389ea6478a
[ "MIT" ]
148
2015-01-28T02:31:39.000Z
2022-03-22T13:54:01.000Z
from mpf.tests.MpfTestCase import MpfTestCase from unittest.mock import MagicMock class TestBallHold(MpfTestCase): def get_config_file(self): return 'test_ball_holds.yaml' def get_machine_path(self): return 'tests/machine_files/ball_holds/' def _missing_ball(self, **kwargs): del kwargs self._missing += 1 def _ball_enter(self, new_balls, unclaimed_balls, **kwargs): del unclaimed_balls del kwargs self._enter += new_balls def _captured_from_pf(self, balls, **kwargs): del kwargs self._captured += balls def _collecting_balls_complete_handler(self, **kwargs): del kwargs self._collecting_balls_complete = 1 def test_ball_hold_in_mode(self): # start mode self.post_event("start_mode1") # mode loaded. ball_hold2 should be enabled self.assertTrue(self.machine.ball_holds["hold_test2"].enabled) # stop mode self.post_event("stop_mode1") # mode stopped. should ball_hold be disabled self.assertFalse(self.machine.ball_holds["hold_test2"].enabled) # start mode (again) self.post_event("start_mode1") # mode loaded. ball_hold2 should be enabled self.assertTrue(self.machine.ball_holds["hold_test2"].enabled) # stop mode self.post_event("stop_mode1") # mode stopped. should ball_hold be disabled self.assertFalse(self.machine.ball_holds["hold_test2"].enabled) def test_hold_and_release_at_game_end(self): coil1 = self.machine.coils['eject_coil1'] coil2 = self.machine.coils['eject_coil2'] coil3 = self.machine.coils['eject_coil3'] trough = self.machine.ball_devices['test_trough'] launcher = self.machine.ball_devices['test_launcher'] hold = self.machine.ball_devices['test_hold'] hold_logic = self.machine.ball_holds['hold_test'] playfield = self.machine.ball_devices['playfield'] self.machine.events.add_handler('balldevice_captured_from_playfield', self._captured_from_pf) self.machine.events.add_handler('balldevice_ball_missing', self._missing_ball) self._enter = 0 self._captured = 0 self._missing = 0 # add an initial ball to trough self.machine.switch_controller.process_switch("s_ball_switch1", 1) self.machine.switch_controller.process_switch("s_ball_switch2", 1) self.advance_time_and_run(1) self.assertEqual(2, self._captured) self._captured = 0 self.assertEqual(0, playfield.balls) self.assertEqual(2, self.machine.ball_controller.num_balls_known) # it should keep the ball coil1.pulse = MagicMock() coil2.pulse = MagicMock() coil3.pulse = MagicMock() self.assertEqual(2, trough.balls) assert not coil1.pulse.called assert not coil2.pulse.called assert not coil3.pulse.called # start a game self.machine.switch_controller.process_switch("s_start", 1) self.advance_time_and_run(0.1) self.machine.switch_controller.process_switch("s_start", 0) self.advance_time_and_run(1) # trough ejects self.assertTrue(coil1.pulse.called) assert not coil2.pulse.called assert not coil3.pulse.called self.machine.switch_controller.process_switch("s_ball_switch1", 0) self.advance_time_and_run(1) self.assertEqual(1, trough.balls) # launcher receives and ejects self.machine.switch_controller.process_switch("s_ball_switch_launcher", 1) self.advance_time_and_run(1) self.assertEqual(1, launcher.balls) self.assertTrue(coil1.pulse.called) self.assertTrue(coil2.pulse.called) assert not coil3.pulse.called # launcher shoots the ball self.machine.switch_controller.process_switch("s_ball_switch_launcher", 0) self.advance_time_and_run(1) self.assertEqual(0, launcher.balls) self.machine.switch_controller.process_switch("s_playfield_active", 1) self.advance_time_and_run(0.1) self.machine.switch_controller.process_switch("s_playfield_active", 0) self.advance_time_and_run(1) self.assertEqual(1, playfield.balls) self.assertEqual(0, self._captured) self.assertEqual(0, self._missing) self.mock_event("yes") self.mock_event("no") self.post_event("test_conditional_event") self.assertEventCalled("no") self.assertEventNotCalled("yes") coil1.pulse = MagicMock() coil2.pulse = MagicMock() coil3.pulse = MagicMock() # ball enters hold self.machine.switch_controller.process_switch("s_ball_switch_hold1", 1) self.advance_time_and_run(1) self.assertEqual(1, hold.balls) self.mock_event("yes") self.mock_event("no") self.post_event("test_conditional_event") self.assertEventNotCalled("no") self.assertEventCalled("yes") # request another ball self.machine.playfield.add_ball(1) self.advance_time_and_run() self.assertTrue(coil1.pulse.called) assert not coil2.pulse.called assert not coil3.pulse.called self.assertEqual(0, playfield.balls) self.assertEqual(1, self._captured) self.assertEqual(0, self._missing) self.assertEqual(1, hold_logic.balls_held) self._captured = 0 self.machine.switch_controller.process_switch("s_ball_switch2", 0) self.advance_time_and_run(1) self.assertEqual(0, trough.balls) # launcher receives and ejects self.machine.switch_controller.process_switch("s_ball_switch_launcher", 1) self.advance_time_and_run(1) self.assertEqual(1, launcher.balls) self.assertTrue(coil1.pulse.called) self.assertTrue(coil2.pulse.called) assert not coil3.pulse.called # launcher shoots the ball self.machine.switch_controller.process_switch("s_ball_switch_launcher", 0) self.advance_time_and_run(1) self.assertEqual(0, launcher.balls) self.machine.switch_controller.process_switch("s_playfield_active", 1) self.advance_time_and_run(0.1) self.machine.switch_controller.process_switch("s_playfield_active", 0) self.advance_time_and_run(1) self.assertEqual(1, playfield.balls) self.assertEqual(0, self._captured) self.assertEqual(0, self._missing) # ball drains self.machine.switch_controller.process_switch("s_ball_switch1", 1) self.advance_time_and_run(1) self.assertEqual(0, playfield.balls) self.assertEqual(1, self._captured) self.assertEqual(0, self._missing) self._captured = 0 self.assertEqual(2, self.machine.ball_controller.num_balls_known) # hold should eject all balls self.assertTrue(coil1.pulse.called) self.assertTrue(coil2.pulse.called) self.assertTrue(coil3.pulse.called) self.machine.switch_controller.process_switch("s_ball_switch_hold1", 0) self.advance_time_and_run(1) self.assertEqual(0, hold.balls) self.assertEqual(0, hold_logic.balls_held) self.assertEqual(0, self._captured) self.assertEqual(0, self._missing) # game did not end because ball has not drained self.assertIsNotNone(self.machine.game) # ball also drains self.machine.switch_controller.process_switch("s_ball_switch2", 1) self.advance_time_and_run(1) # game ends self.assertIsNone(self.machine.game) self.assertEqual(0, playfield.balls) self.assertEqual(1, self._captured) self.assertEqual(0, self._missing) self.assertEqual(2, self.machine.ball_controller.num_balls_known) self.advance_time_and_run(100) self.assertEqual(0, playfield.balls) self.assertEqual(1, self._captured) self.assertEqual(0, self._missing) self.assertEqual(2, self.machine.ball_controller.num_balls_known) def test_hold_full_and_release(self): coil1 = self.machine.coils['eject_coil1'] coil2 = self.machine.coils['eject_coil2'] coil3 = self.machine.coils['eject_coil3'] trough = self.machine.ball_devices['test_trough'] hold = self.machine.ball_devices['test_hold'] hold_logic = self.machine.ball_holds['hold_test'] playfield = self.machine.ball_devices['playfield'] self.machine.events.add_handler('balldevice_captured_from_playfield', self._captured_from_pf) self.machine.events.add_handler('balldevice_ball_missing', self._missing_ball) self.machine.events.add_handler('collecting_balls_complete', self._collecting_balls_complete_handler) hold_logic.enable() self._enter = 0 self._captured = 0 self._missing = 0 self._collecting_balls_complete = 0 # add an initial ball to trough self.machine.switch_controller.process_switch("s_ball_switch1", 1) self.machine.switch_controller.process_switch("s_ball_switch2", 1) self.advance_time_and_run(1) self.assertEqual(2, self._captured) self._captured = 0 self.assertEqual(0, playfield.balls) self.assertEqual(2, self.machine.ball_controller.num_balls_known) # it should keep the ball coil1.pulse = MagicMock() coil2.pulse = MagicMock() coil3.pulse = MagicMock() self.assertEqual(2, trough.balls) assert not coil1.pulse.called assert not coil2.pulse.called assert not coil3.pulse.called self.assertFalse(hold_logic.is_full()) self.assertEqual(2, trough.available_balls) # hold captures a first random ball self.machine.switch_controller.process_switch("s_ball_switch_hold1", 1) self.advance_time_and_run(1) assert not coil3.pulse.called self.assertFalse(hold_logic.is_full()) # self.assertEqual(1, trough.available_balls) self.assertEqual(1, hold.available_balls) # hold captures a second random ball self.machine.switch_controller.process_switch("s_ball_switch_hold2", 1) self.advance_time_and_run(1) assert not coil3.pulse.called self.assertTrue(hold_logic.is_full()) # self.assertEqual(0, trough.available_balls) self.assertEqual(2, hold.available_balls) # hold captures a third random ball self.machine.switch_controller.process_switch("s_ball_switch_hold3", 1) self.advance_time_and_run(1) # it should eject it right away self.assertTrue(coil3.pulse.called) coil3.pulse = MagicMock() self.assertTrue(hold_logic.is_full()) self.advance_time_and_run(1) self.machine.switch_controller.process_switch("s_ball_switch_hold3", 0) self.advance_time_and_run(11) self.assertTrue(hold_logic.is_full()) self.assertEqual(2, hold.available_balls) hold_logic.release_all() self.advance_time_and_run(1) self.assertEqual(0, hold.available_balls) self.assertTrue(coil3.pulse.called) coil3.pulse = MagicMock() self.advance_time_and_run(1) self.machine.switch_controller.process_switch("s_ball_switch_hold2", 0) self.advance_time_and_run(1) self.assertFalse(hold_logic.is_full()) self.advance_time_and_run(11) self.assertTrue(coil3.pulse.called) coil3.pulse = MagicMock() self.advance_time_and_run(1) self.machine.switch_controller.process_switch("s_ball_switch_hold1", 0) self.advance_time_and_run(11) assert not coil3.pulse.called def test_eject_to_hold(self): coil1 = self.machine.coils['eject_coil1'] coil2 = self.machine.coils['eject_coil2'] coil3 = self.machine.coils['eject_coil3'] trough = self.machine.ball_devices['test_trough'] launcher = self.machine.ball_devices['test_launcher'] hold = self.machine.ball_devices['test_hold'] hold_logic = self.machine.ball_holds['hold_test'] playfield = self.machine.ball_devices['playfield'] self.machine.events.add_handler('balldevice_captured_from_playfield', self._captured_from_pf) self.machine.events.add_handler('balldevice_ball_missing', self._missing_ball) self.machine.events.add_handler('collecting_balls_complete', self._collecting_balls_complete_handler) self._enter = 0 self._captured = 0 self._missing = 0 self._collecting_balls_complete = 0 # add an initial ball to trough self.machine.switch_controller.process_switch("s_ball_switch1", 1) self.machine.switch_controller.process_switch("s_ball_switch2", 1) self.advance_time_and_run(1) self.assertEqual(2, self._captured) self._captured = 0 self.assertEqual(0, playfield.balls) self.assertEqual(2, self.machine.ball_controller.num_balls_known) # it should keep the ball coil1.pulse = MagicMock() coil2.pulse = MagicMock() coil3.pulse = MagicMock() self.assertEqual(2, trough.balls) assert not coil1.pulse.called assert not coil2.pulse.called assert not coil3.pulse.called # start a game self.machine.switch_controller.process_switch("s_start", 1) self.advance_time_and_run(0.1) self.machine.switch_controller.process_switch("s_start", 0) self.advance_time_and_run(1) # trough ejects self.assertTrue(coil1.pulse.called) assert not coil2.pulse.called assert not coil3.pulse.called self.machine.switch_controller.process_switch("s_ball_switch1", 0) self.advance_time_and_run(1) self.assertEqual(1, trough.balls) # launcher receives and ejects self.machine.switch_controller.process_switch("s_ball_switch_launcher", 1) self.advance_time_and_run(1) self.assertEqual(1, launcher.balls) self.assertTrue(coil1.pulse.called) self.assertTrue(coil2.pulse.called) assert not coil3.pulse.called # launcher shoots the ball self.machine.switch_controller.process_switch("s_ball_switch_launcher", 0) self.advance_time_and_run(1) self.assertEqual(0, launcher.balls) coil1.pulse = MagicMock() coil2.pulse = MagicMock() coil3.pulse = MagicMock() # ball directly enters the hold self.machine.switch_controller.process_switch("s_ball_switch_hold1", 1) self.advance_time_and_run(1) self.assertEqual(1, hold.balls) # request another ball self.machine.playfield.add_ball(1) self.advance_time_and_run() self.assertTrue(coil1.pulse.called) assert not coil2.pulse.called assert not coil3.pulse.called self.assertEqual(0, playfield.balls) self.assertEqual(1, self._captured) self.assertEqual(0, self._missing) self.assertEqual(1, hold_logic.balls_held) self._captured = 0 self.machine.switch_controller.process_switch("s_ball_switch2", 0) self.advance_time_and_run(1) self.assertEqual(0, trough.balls) # launcher receives and ejects self.machine.switch_controller.process_switch("s_ball_switch_launcher", 1) self.advance_time_and_run(1) self.assertEqual(1, launcher.balls) self.assertTrue(coil1.pulse.called) self.assertTrue(coil2.pulse.called) assert not coil3.pulse.called # launcher shoots the ball self.machine.switch_controller.process_switch("s_ball_switch_launcher", 0) self.advance_time_and_run(1) self.assertEqual(0, launcher.balls) self.machine.switch_controller.process_switch("s_playfield_active", 1) self.advance_time_and_run(0.1) self.machine.switch_controller.process_switch("s_playfield_active", 0) self.advance_time_and_run(1) self.assertEqual(1, playfield.balls) self.assertEqual(0, self._captured) self.assertEqual(0, self._missing) self.assertEqual(1, hold.available_balls) # request a release of one ball from hold via event self.machine.events.post("release_test") # since we are not using a multi ball increase the balls_in_play manually self.assertEqual(1, self.machine.game.balls_in_play) self.machine.game.balls_in_play += 1 self.advance_time_and_run(1) # hold should eject a ball self.assertTrue(coil1.pulse.called) self.assertTrue(coil2.pulse.called) self.assertTrue(coil3.pulse.called) self.machine.switch_controller.process_switch("s_ball_switch_hold1", 0) self.advance_time_and_run(1) self.assertEqual(0, hold.balls) self.assertEqual(0, hold_logic.balls_held) self.assertEqual(0, self._captured) self.assertEqual(0, self._missing) # ball drains instantly. one left on pf self.machine.switch_controller.process_switch("s_ball_switch1", 1) self.advance_time_and_run(1) self.assertEqual(1, self.machine.game.balls_in_play) # other ball hits some pf switches self.machine.switch_controller.process_switch("s_playfield_active", 1) self.advance_time_and_run(0.1) self.machine.switch_controller.process_switch("s_playfield_active", 0) self.advance_time_and_run(1) self.assertEqual(1, playfield.balls) self.assertEqual(1, self._captured) self.assertEqual(0, self._missing) self._captured = 0 self.assertEqual(2, self.machine.ball_controller.num_balls_known) self.assertEqual(0, self._collecting_balls_complete) self.assertEqual(1, self.machine.game.balls_in_play) coil1.pulse = MagicMock() coil2.pulse = MagicMock() coil3.pulse = MagicMock() # we add another ball self.machine.game.balls_in_play += 1 playfield.add_ball() self.advance_time_and_run(1) self.assertEqual(2, self.machine.game.balls_in_play) self.machine.switch_controller.process_switch("s_ball_switch1", 0) self.advance_time_and_run(1) self.assertEqual(0, trough.balls) # launcher receives and ejects self.machine.switch_controller.process_switch("s_ball_switch_launcher", 1) self.advance_time_and_run(1) self.assertEqual(1, launcher.balls) self.assertTrue(coil1.pulse.called) self.assertTrue(coil2.pulse.called) assert not coil3.pulse.called # launcher shoots the ball self.machine.switch_controller.process_switch("s_ball_switch_launcher", 0) self.advance_time_and_run(1) self.assertEqual(0, launcher.balls) coil1.pulse = MagicMock() coil2.pulse = MagicMock() coil3.pulse = MagicMock() # ball directly enters the hold (again) self.machine.switch_controller.process_switch("s_ball_switch_hold1", 1) self.advance_time_and_run(1) self.assertEqual(1, hold.balls) # playfield count goes to 0 self.assertEqual(0, playfield.balls) self.assertEqual(1, self._captured) self.assertEqual(0, self._missing) self._captured = 0 # wait for eject confirm for hold self.advance_time_and_run(10) self.assertEqual(2, self.machine.ball_controller.num_balls_known) self.advance_time_and_run(100) self.assertEqual(1, playfield.balls) self.assertEqual(0, self._captured) self.assertEqual(0, self._missing) self.assertEqual(2, self.machine.ball_controller.num_balls_known) def test_auto_capacity(self): self.assertEqual(self.machine.ball_holds["hold_test3"].config['balls_to_hold'], 2) def test_enabled_state_in_placeholder(self): placeholder = self.machine.placeholder_manager.build_bool_template("device.ball_holds.hold_test.enabled") value, subscription = placeholder.evaluate_and_subscribe([]) self.assertFalse(value) self.assertFalse(subscription.done()) self.mock_event("should_post_when_enabled") self.mock_event("should_post_when_disabled") self.mock_event("should_not_post_when_enabled") self.mock_event("should_not_post_when_disabled") hold = self.machine.ball_holds['hold_test'] hold.enable() self.assertTrue(hold.enabled) self.post_event("test_event_when_enabled") self.assertEventCalled("should_post_when_enabled") self.assertEventNotCalled("should_not_post_when_enabled") self.assertTrue(subscription.done()) value, subscription = placeholder.evaluate_and_subscribe([]) self.assertTrue(value) hold.disable() self.assertFalse(hold.enabled) self.post_event("test_event_when_disabled") self.assertEventCalled("should_post_when_disabled") self.assertEventNotCalled("should_not_post_when_disabled") self.assertTrue(subscription.done()) value, subscription = placeholder.evaluate_and_subscribe([]) self.assertFalse(value) # we need to chancel the subscription or it will crash later subscription.cancel() class TestBallHoldSmart(MpfTestCase): def get_config_file(self): return 'test_ball_holds.yaml' def get_machine_path(self): return 'tests/machine_files/ball_holds/' def get_platform(self): return 'smart_virtual' def test_ball_end(self): self.machine.config['game']['balls_per_game'] = self.machine.placeholder_manager.build_int_template(3) # add an initial ball to trough self.hit_switch_and_run("s_ball_switch1", 1) self.hit_switch_and_run("s_ball_switch2", 1) self.advance_time_and_run(1) self.assertEqual(0, self.machine.playfield.balls) self.assertEqual(2, self.machine.ball_controller.num_balls_known) # press start self.hit_and_release_switch("s_start") # wait until ball is on pf self.advance_time_and_run(10) self.assertEqual(1, self.machine.game.player.ball) self.assertEqual(1, self.machine.playfield.balls) # hold one ball self.machine.ball_holds["hold_test"].enable() self.hit_switch_and_run("s_ball_switch_hold1", 1) # still held self.advance_time_and_run(10) self.assertEqual(1, self.machine.ball_holds["hold_test"].balls_held) self.assertEqual(0, self.machine.playfield.balls) # request another ball self.machine.playfield.add_ball(1) self.advance_time_and_run() self.hit_and_release_switch('s_playfield_active') self.advance_time_and_run() self.assertEqual(1, self.machine.playfield.balls) # drain ball on pf self.machine.default_platform.add_ball_to_device(self.machine.ball_devices["test_trough"]) self.advance_time_and_run(1) # machine waits for the hold self.advance_time_and_run(10) self.assertEqual(1, self.machine.game.player.ball) # release the hold self.post_event('release_test') self.assertEqual(0, self.machine.ball_holds["hold_test"].balls_held) self.assertEqual(1, self.machine.playfield.balls) # once the ball drains move on to the ball 2 self.machine.default_platform.add_ball_to_device(self.machine.ball_devices["test_trough"]) self.advance_time_and_run(1) self.assertEqual(2, self.machine.game.player.ball) # next ball self.advance_time_and_run(10) self.assertBallsOnPlayfield(1) # drain again self.machine.default_platform.add_ball_to_device(self.machine.ball_devices["test_trough"]) self.advance_time_and_run(1) # there should be no hold this time self.assertEqual(3, self.machine.game.player.ball)
37.73791
113
0.683423
3,082
24,190
5.093446
0.06684
0.088992
0.063065
0.075678
0.891642
0.86183
0.841763
0.80781
0.792967
0.766085
0
0.020912
0.221124
24,190
640
114
37.796875
0.812271
0.074163
0
0.835955
0
0
0.090376
0.037664
0
0
0
0
0.404494
1
0.035955
false
0
0.004494
0.011236
0.05618
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
8
16145998ba43092217546fe268221a2b4d946bcd
68,579
py
Python
lib/mirror/cnn_wrapper/resnet.py
Yzhbuaa/DAGSfM
321f9bf24456f2e68aa4ea3d7a59c39040fe1f1f
[ "BSD-3-Clause" ]
255
2018-12-14T05:59:29.000Z
2020-11-04T12:15:32.000Z
lib/mirror/cnn_wrapper/resnet.py
Yzhbuaa/DAGSfM
321f9bf24456f2e68aa4ea3d7a59c39040fe1f1f
[ "BSD-3-Clause" ]
35
2018-12-25T03:02:48.000Z
2020-11-19T03:33:25.000Z
lib/mirror/cnn_wrapper/resnet.py
Yzhbuaa/DAGSfM
321f9bf24456f2e68aa4ea3d7a59c39040fe1f1f
[ "BSD-3-Clause" ]
54
2018-12-14T06:09:21.000Z
2020-11-21T08:29:31.000Z
from cnn_wrapper.network import Network class ResNet50(Network): def setup(self): (self.feed('data') .conv(7, 64, 2, padding=3, relu=False, name='conv1') .batch_normalization(relu=True, scale=True, center=True, name='bn_conv1') .max_pool(3, 2, name='pool1') .conv(1, 256, 1, biased=False, relu=False, name='res2a_branch1') .batch_normalization(scale=True, center=True, name='bn2a_branch1')) (self.feed('pool1') .conv(1, 64, 1, biased=False, relu=False, name='res2a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn2a_branch2a') .conv(3, 64, 1, biased=False, relu=False, name='res2a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn2a_branch2b') .conv(1, 256, 1, biased=False, relu=False, name='res2a_branch2c') .batch_normalization(scale=True, center=True, name='bn2a_branch2c')) (self.feed('bn2a_branch1', 'bn2a_branch2c') .add(name='res2a') .relu(name='res2a_relu') .conv(1, 64, 1, biased=False, relu=False, name='res2b_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn2b_branch2a') .conv(3, 64, 1, biased=False, relu=False, name='res2b_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn2b_branch2b') .conv(1, 256, 1, biased=False, relu=False, name='res2b_branch2c') .batch_normalization(scale=True, center=True, name='bn2b_branch2c')) (self.feed('res2a_relu', 'bn2b_branch2c') .add(name='res2b') .relu(name='res2b_relu') .conv(1, 64, 1, biased=False, relu=False, name='res2c_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn2c_branch2a') .conv(3, 64, 1, biased=False, relu=False, name='res2c_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn2c_branch2b') .conv(1, 256, 1, biased=False, relu=False, name='res2c_branch2c') .batch_normalization(scale=True, center=True, name='bn2c_branch2c')) (self.feed('res2b_relu', 'bn2c_branch2c') .add(name='res2c') .relu(name='res2c_relu') .conv(1, 512, 2, biased=False, relu=False, name='res3a_branch1') .batch_normalization(scale=True, center=True, name='bn3a_branch1')) (self.feed('res2c_relu') .conv(1, 128, 2, biased=False, relu=False, name='res3a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3a_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3a_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3a_branch2c') .batch_normalization(scale=True, center=True, name='bn3a_branch2c')) (self.feed('bn3a_branch1', 'bn3a_branch2c') .add(name='res3a') .relu(name='res3a_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3b_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3b_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3b_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3b_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3b_branch2c') .batch_normalization(scale=True, center=True, name='bn3b_branch2c')) (self.feed('res3a_relu', 'bn3b_branch2c') .add(name='res3b') .relu(name='res3b_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3c_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3c_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3c_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3c_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3c_branch2c') .batch_normalization(scale=True, center=True, name='bn3c_branch2c')) (self.feed('res3b_relu', 'bn3c_branch2c') .add(name='res3c') .relu(name='res3c_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3d_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3d_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3d_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3d_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3d_branch2c') .batch_normalization(scale=True, center=True, name='bn3d_branch2c')) (self.feed('res3c_relu', 'bn3d_branch2c') .add(name='res3d') .relu(name='res3d_relu') .conv(1, 1024, 2, biased=False, relu=False, name='res4a_branch1') .batch_normalization(scale=True, center=True, name='bn4a_branch1')) (self.feed('res3d_relu') .conv(1, 256, 2, biased=False, relu=False, name='res4a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4a_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4a_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4a_branch2c') .batch_normalization(scale=True, center=True, name='bn4a_branch2c')) (self.feed('bn4a_branch1', 'bn4a_branch2c') .add(name='res4a') .relu(name='res4a_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b_branch2c') .batch_normalization(scale=True, center=True, name='bn4b_branch2c')) (self.feed('res4a_relu', 'bn4b_branch2c') .add(name='res4b') .relu(name='res4b_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4c_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4c_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4c_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4c_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4c_branch2c') .batch_normalization(scale=True, center=True, name='bn4c_branch2c')) (self.feed('res4b_relu', 'bn4c_branch2c') .add(name='res4c') .relu(name='res4c_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4d_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4d_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4d_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4d_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4d_branch2c') .batch_normalization(scale=True, center=True, name='bn4d_branch2c')) (self.feed('res4c_relu', 'bn4d_branch2c') .add(name='res4d') .relu(name='res4d_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4e_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4e_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4e_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4e_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4e_branch2c') .batch_normalization(scale=True, center=True, name='bn4e_branch2c')) (self.feed('res4d_relu', 'bn4e_branch2c') .add(name='res4e') .relu(name='res4e_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4f_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4f_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4f_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4f_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4f_branch2c') .batch_normalization(scale=True, center=True, name='bn4f_branch2c')) (self.feed('res4e_relu', 'bn4f_branch2c') .add(name='res4f') .relu(name='res4f_relu') .conv(1, 2048, 2, biased=False, relu=False, name='res5a_branch1') .batch_normalization(scale=True, center=True, name='bn5a_branch1')) (self.feed('res4f_relu') .conv(1, 512, 2, biased=False, relu=False, name='res5a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn5a_branch2a') .conv(3, 512, 1, biased=False, relu=False, name='res5a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn5a_branch2b') .conv(1, 2048, 1, biased=False, relu=False, name='res5a_branch2c') .batch_normalization(scale=True, center=True, name='bn5a_branch2c')) (self.feed('bn5a_branch1', 'bn5a_branch2c') .add(name='res5a') .relu(name='res5a_relu') .conv(1, 512, 1, biased=False, relu=False, name='res5b_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn5b_branch2a') .conv(3, 512, 1, biased=False, relu=False, name='res5b_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn5b_branch2b') .conv(1, 2048, 1, biased=False, relu=False, name='res5b_branch2c') .batch_normalization(scale=True, center=True, name='bn5b_branch2c')) (self.feed('res5a_relu', 'bn5b_branch2c') .add(name='res5b') .relu(name='res5b_relu') .conv(1, 512, 1, biased=False, relu=False, name='res5c_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn5c_branch2a') .conv(3, 512, 1, biased=False, relu=False, name='res5c_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn5c_branch2b') .conv(1, 2048, 1, biased=False, relu=False, name='res5c_branch2c') .batch_normalization(scale=True, center=True, name='bn5c_branch2c')) (self.feed('res5b_relu', 'bn5c_branch2c') .add(name='res5c') .relu(name='res5c_relu') .avg_pool(7, 1, padding='VALID', name='pool5')) if not self.fcn: (self.feed('pool5') .fc(1000, relu=False, name='fc1000') .softmax(name='prob')) class ResNet101(Network): def setup(self): (self.feed('data') .conv(7, 64, 2, biased=False, relu=False, name='conv1') .batch_normalization(scale=True, center=True, relu=True, name='bn_conv1') .max_pool(3, 2, name='pool1') .conv(1, 256, 1, biased=False, relu=False, name='res2a_branch1') .batch_normalization(scale=True, center=True, name='bn2a_branch1')) (self.feed('pool1') .conv(1, 64, 1, biased=False, relu=False, name='res2a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn2a_branch2a') .conv(3, 64, 1, biased=False, relu=False, name='res2a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn2a_branch2b') .conv(1, 256, 1, biased=False, relu=False, name='res2a_branch2c') .batch_normalization(scale=True, center=True, name='bn2a_branch2c')) (self.feed('bn2a_branch1', 'bn2a_branch2c') .add(name='res2a') .relu(name='res2a_relu') .conv(1, 64, 1, biased=False, relu=False, name='res2b_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn2b_branch2a') .conv(3, 64, 1, biased=False, relu=False, name='res2b_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn2b_branch2b') .conv(1, 256, 1, biased=False, relu=False, name='res2b_branch2c') .batch_normalization(scale=True, center=True, name='bn2b_branch2c')) (self.feed('res2a_relu', 'bn2b_branch2c') .add(name='res2b') .relu(name='res2b_relu') .conv(1, 64, 1, biased=False, relu=False, name='res2c_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn2c_branch2a') .conv(3, 64, 1, biased=False, relu=False, name='res2c_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn2c_branch2b') .conv(1, 256, 1, biased=False, relu=False, name='res2c_branch2c') .batch_normalization(scale=True, center=True, name='bn2c_branch2c')) (self.feed('res2b_relu', 'bn2c_branch2c') .add(name='res2c') .relu(name='res2c_relu') .conv(1, 512, 2, biased=False, relu=False, name='res3a_branch1') .batch_normalization(scale=True, center=True, name='bn3a_branch1')) (self.feed('res2c_relu') .conv(1, 128, 2, biased=False, relu=False, name='res3a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3a_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3a_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3a_branch2c') .batch_normalization(scale=True, center=True, name='bn3a_branch2c')) (self.feed('bn3a_branch1', 'bn3a_branch2c') .add(name='res3a') .relu(name='res3a_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3b1_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3b1_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3b1_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3b1_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3b1_branch2c') .batch_normalization(scale=True, center=True, name='bn3b1_branch2c')) (self.feed('res3a_relu', 'bn3b1_branch2c') .add(name='res3b1') .relu(name='res3b1_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3b2_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3b2_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3b2_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3b2_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3b2_branch2c') .batch_normalization(scale=True, center=True, name='bn3b2_branch2c')) (self.feed('res3b1_relu', 'bn3b2_branch2c') .add(name='res3b2') .relu(name='res3b2_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3b3_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3b3_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3b3_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3b3_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3b3_branch2c') .batch_normalization(scale=True, center=True, name='bn3b3_branch2c')) (self.feed('res3b2_relu', 'bn3b3_branch2c') .add(name='res3b3') .relu(name='res3b3_relu') .conv(1, 1024, 2, biased=False, relu=False, name='res4a_branch1') .batch_normalization(scale=True, center=True, name='bn4a_branch1')) (self.feed('res3b3_relu') .conv(1, 256, 2, biased=False, relu=False, name='res4a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4a_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4a_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4a_branch2c') .batch_normalization(scale=True, center=True, name='bn4a_branch2c')) (self.feed('bn4a_branch1', 'bn4a_branch2c') .add(name='res4a') .relu(name='res4a_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b1_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b1_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b1_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b1_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b1_branch2c') .batch_normalization(scale=True, center=True, name='bn4b1_branch2c')) (self.feed('res4a_relu', 'bn4b1_branch2c') .add(name='res4b1') .relu(name='res4b1_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b2_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b2_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b2_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b2_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b2_branch2c') .batch_normalization(scale=True, center=True, name='bn4b2_branch2c')) (self.feed('res4b1_relu', 'bn4b2_branch2c') .add(name='res4b2') .relu(name='res4b2_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b3_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b3_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b3_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b3_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b3_branch2c') .batch_normalization(scale=True, center=True, name='bn4b3_branch2c')) (self.feed('res4b2_relu', 'bn4b3_branch2c') .add(name='res4b3') .relu(name='res4b3_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b4_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b4_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b4_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b4_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b4_branch2c') .batch_normalization(scale=True, center=True, name='bn4b4_branch2c')) (self.feed('res4b3_relu', 'bn4b4_branch2c') .add(name='res4b4') .relu(name='res4b4_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b5_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b5_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b5_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b5_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b5_branch2c') .batch_normalization(scale=True, center=True, name='bn4b5_branch2c')) (self.feed('res4b4_relu', 'bn4b5_branch2c') .add(name='res4b5') .relu(name='res4b5_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b6_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b6_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b6_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b6_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b6_branch2c') .batch_normalization(scale=True, center=True, name='bn4b6_branch2c')) (self.feed('res4b5_relu', 'bn4b6_branch2c') .add(name='res4b6') .relu(name='res4b6_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b7_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b7_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b7_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b7_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b7_branch2c') .batch_normalization(scale=True, center=True, name='bn4b7_branch2c')) (self.feed('res4b6_relu', 'bn4b7_branch2c') .add(name='res4b7') .relu(name='res4b7_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b8_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b8_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b8_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b8_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b8_branch2c') .batch_normalization(scale=True, center=True, name='bn4b8_branch2c')) (self.feed('res4b7_relu', 'bn4b8_branch2c') .add(name='res4b8') .relu(name='res4b8_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b9_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b9_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b9_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b9_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b9_branch2c') .batch_normalization(scale=True, center=True, name='bn4b9_branch2c')) (self.feed('res4b8_relu', 'bn4b9_branch2c') .add(name='res4b9') .relu(name='res4b9_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b10_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b10_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b10_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b10_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b10_branch2c') .batch_normalization(scale=True, center=True, name='bn4b10_branch2c')) (self.feed('res4b9_relu', 'bn4b10_branch2c') .add(name='res4b10') .relu(name='res4b10_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b11_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b11_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b11_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b11_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b11_branch2c') .batch_normalization(scale=True, center=True, name='bn4b11_branch2c')) (self.feed('res4b10_relu', 'bn4b11_branch2c') .add(name='res4b11') .relu(name='res4b11_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b12_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b12_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b12_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b12_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b12_branch2c') .batch_normalization(scale=True, center=True, name='bn4b12_branch2c')) (self.feed('res4b11_relu', 'bn4b12_branch2c') .add(name='res4b12') .relu(name='res4b12_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b13_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b13_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b13_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b13_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b13_branch2c') .batch_normalization(scale=True, center=True, name='bn4b13_branch2c')) (self.feed('res4b12_relu', 'bn4b13_branch2c') .add(name='res4b13') .relu(name='res4b13_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b14_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b14_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b14_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b14_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b14_branch2c') .batch_normalization(scale=True, center=True, name='bn4b14_branch2c')) (self.feed('res4b13_relu', 'bn4b14_branch2c') .add(name='res4b14') .relu(name='res4b14_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b15_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b15_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b15_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b15_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b15_branch2c') .batch_normalization(scale=True, center=True, name='bn4b15_branch2c')) (self.feed('res4b14_relu', 'bn4b15_branch2c') .add(name='res4b15') .relu(name='res4b15_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b16_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b16_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b16_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b16_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b16_branch2c') .batch_normalization(scale=True, center=True, name='bn4b16_branch2c')) (self.feed('res4b15_relu', 'bn4b16_branch2c') .add(name='res4b16') .relu(name='res4b16_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b17_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b17_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b17_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b17_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b17_branch2c') .batch_normalization(scale=True, center=True, name='bn4b17_branch2c')) (self.feed('res4b16_relu', 'bn4b17_branch2c') .add(name='res4b17') .relu(name='res4b17_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b18_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b18_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b18_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b18_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b18_branch2c') .batch_normalization(scale=True, center=True, name='bn4b18_branch2c')) (self.feed('res4b17_relu', 'bn4b18_branch2c') .add(name='res4b18') .relu(name='res4b18_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b19_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b19_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b19_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b19_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b19_branch2c') .batch_normalization(scale=True, center=True, name='bn4b19_branch2c')) (self.feed('res4b18_relu', 'bn4b19_branch2c') .add(name='res4b19') .relu(name='res4b19_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b20_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b20_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b20_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b20_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b20_branch2c') .batch_normalization(scale=True, center=True, name='bn4b20_branch2c')) (self.feed('res4b19_relu', 'bn4b20_branch2c') .add(name='res4b20') .relu(name='res4b20_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b21_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b21_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b21_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b21_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b21_branch2c') .batch_normalization(scale=True, center=True, name='bn4b21_branch2c')) (self.feed('res4b20_relu', 'bn4b21_branch2c') .add(name='res4b21') .relu(name='res4b21_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b22_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b22_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b22_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b22_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b22_branch2c') .batch_normalization(scale=True, center=True, name='bn4b22_branch2c')) (self.feed('res4b21_relu', 'bn4b22_branch2c') .add(name='res4b22') .relu(name='res4b22_relu') .conv(1, 2048, 2, biased=False, relu=False, name='res5a_branch1') .batch_normalization(scale=True, center=True, name='bn5a_branch1')) (self.feed('res4b22_relu') .conv(1, 512, 2, biased=False, relu=False, name='res5a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn5a_branch2a') .conv(3, 512, 1, biased=False, relu=False, name='res5a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn5a_branch2b') .conv(1, 2048, 1, biased=False, relu=False, name='res5a_branch2c') .batch_normalization(scale=True, center=True, name='bn5a_branch2c')) (self.feed('bn5a_branch1', 'bn5a_branch2c') .add(name='res5a') .relu(name='res5a_relu') .conv(1, 512, 1, biased=False, relu=False, name='res5b_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn5b_branch2a') .conv(3, 512, 1, biased=False, relu=False, name='res5b_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn5b_branch2b') .conv(1, 2048, 1, biased=False, relu=False, name='res5b_branch2c') .batch_normalization(scale=True, center=True, name='bn5b_branch2c')) (self.feed('res5a_relu', 'bn5b_branch2c') .add(name='res5b') .relu(name='res5b_relu') .conv(1, 512, 1, biased=False, relu=False, name='res5c_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn5c_branch2a') .conv(3, 512, 1, biased=False, relu=False, name='res5c_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn5c_branch2b') .conv(1, 2048, 1, biased=False, relu=False, name='res5c_branch2c') .batch_normalization(scale=True, center=True, name='bn5c_branch2c')) (self.feed('res5b_relu', 'bn5c_branch2c') .add(name='res5c') .relu(name='res5c_relu') .avg_pool(7, 1, padding='VALID', name='pool5')) if not self.fcn: (self.feed('pool5') .fc(1000, relu=False, name='fc1000') .softmax(name='prob')) class ResNet152(Network): def setup(self): (self.feed('data') .conv(7, 64, 2, biased=False, relu=False, name='conv1') .batch_normalization(scale=True, center=True, relu=True, name='bn_conv1') .max_pool(3, 2, name='pool1') .conv(1, 256, 1, biased=False, relu=False, name='res2a_branch1') .batch_normalization(scale=True, center=True, name='bn2a_branch1')) (self.feed('pool1') .conv(1, 64, 1, biased=False, relu=False, name='res2a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn2a_branch2a') .conv(3, 64, 1, biased=False, relu=False, name='res2a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn2a_branch2b') .conv(1, 256, 1, biased=False, relu=False, name='res2a_branch2c') .batch_normalization(scale=True, center=True, name='bn2a_branch2c')) (self.feed('bn2a_branch1', 'bn2a_branch2c') .add(name='res2a') .relu(name='res2a_relu') .conv(1, 64, 1, biased=False, relu=False, name='res2b_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn2b_branch2a') .conv(3, 64, 1, biased=False, relu=False, name='res2b_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn2b_branch2b') .conv(1, 256, 1, biased=False, relu=False, name='res2b_branch2c') .batch_normalization(scale=True, center=True, name='bn2b_branch2c')) (self.feed('res2a_relu', 'bn2b_branch2c') .add(name='res2b') .relu(name='res2b_relu') .conv(1, 64, 1, biased=False, relu=False, name='res2c_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn2c_branch2a') .conv(3, 64, 1, biased=False, relu=False, name='res2c_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn2c_branch2b') .conv(1, 256, 1, biased=False, relu=False, name='res2c_branch2c') .batch_normalization(scale=True, center=True, name='bn2c_branch2c')) (self.feed('res2b_relu', 'bn2c_branch2c') .add(name='res2c') .relu(name='res2c_relu') .conv(1, 512, 2, biased=False, relu=False, name='res3a_branch1') .batch_normalization(scale=True, center=True, name='bn3a_branch1')) (self.feed('res2c_relu') .conv(1, 128, 2, biased=False, relu=False, name='res3a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3a_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3a_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3a_branch2c') .batch_normalization(scale=True, center=True, name='bn3a_branch2c')) (self.feed('bn3a_branch1', 'bn3a_branch2c') .add(name='res3a') .relu(name='res3a_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3b1_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3b1_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3b1_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3b1_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3b1_branch2c') .batch_normalization(scale=True, center=True, name='bn3b1_branch2c')) (self.feed('res3a_relu', 'bn3b1_branch2c') .add(name='res3b1') .relu(name='res3b1_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3b2_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3b2_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3b2_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3b2_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3b2_branch2c') .batch_normalization(scale=True, center=True, name='bn3b2_branch2c')) (self.feed('res3b1_relu', 'bn3b2_branch2c') .add(name='res3b2') .relu(name='res3b2_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3b3_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3b3_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3b3_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3b3_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3b3_branch2c') .batch_normalization(scale=True, center=True, name='bn3b3_branch2c')) (self.feed('res3b2_relu', 'bn3b3_branch2c') .add(name='res3b3') .relu(name='res3b3_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3b4_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3b4_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3b4_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3b4_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3b4_branch2c') .batch_normalization(scale=True, center=True, name='bn3b4_branch2c')) (self.feed('res3b3_relu', 'bn3b4_branch2c') .add(name='res3b4') .relu(name='res3b4_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3b5_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3b5_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3b5_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3b5_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3b5_branch2c') .batch_normalization(scale=True, center=True, name='bn3b5_branch2c')) (self.feed('res3b4_relu', 'bn3b5_branch2c') .add(name='res3b5') .relu(name='res3b5_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3b6_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3b6_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3b6_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3b6_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3b6_branch2c') .batch_normalization(scale=True, center=True, name='bn3b6_branch2c')) (self.feed('res3b5_relu', 'bn3b6_branch2c') .add(name='res3b6') .relu(name='res3b6_relu') .conv(1, 128, 1, biased=False, relu=False, name='res3b7_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn3b7_branch2a') .conv(3, 128, 1, biased=False, relu=False, name='res3b7_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn3b7_branch2b') .conv(1, 512, 1, biased=False, relu=False, name='res3b7_branch2c') .batch_normalization(scale=True, center=True, name='bn3b7_branch2c')) (self.feed('res3b6_relu', 'bn3b7_branch2c') .add(name='res3b7') .relu(name='res3b7_relu') .conv(1, 1024, 2, biased=False, relu=False, name='res4a_branch1') .batch_normalization(scale=True, center=True, name='bn4a_branch1')) (self.feed('res3b7_relu') .conv(1, 256, 2, biased=False, relu=False, name='res4a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4a_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4a_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4a_branch2c') .batch_normalization(scale=True, center=True, name='bn4a_branch2c')) (self.feed('bn4a_branch1', 'bn4a_branch2c') .add(name='res4a') .relu(name='res4a_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b1_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b1_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b1_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b1_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b1_branch2c') .batch_normalization(scale=True, center=True, name='bn4b1_branch2c')) (self.feed('res4a_relu', 'bn4b1_branch2c') .add(name='res4b1') .relu(name='res4b1_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b2_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b2_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b2_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b2_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b2_branch2c') .batch_normalization(scale=True, center=True, name='bn4b2_branch2c')) (self.feed('res4b1_relu', 'bn4b2_branch2c') .add(name='res4b2') .relu(name='res4b2_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b3_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b3_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b3_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b3_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b3_branch2c') .batch_normalization(scale=True, center=True, name='bn4b3_branch2c')) (self.feed('res4b2_relu', 'bn4b3_branch2c') .add(name='res4b3') .relu(name='res4b3_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b4_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b4_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b4_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b4_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b4_branch2c') .batch_normalization(scale=True, center=True, name='bn4b4_branch2c')) (self.feed('res4b3_relu', 'bn4b4_branch2c') .add(name='res4b4') .relu(name='res4b4_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b5_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b5_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b5_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b5_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b5_branch2c') .batch_normalization(scale=True, center=True, name='bn4b5_branch2c')) (self.feed('res4b4_relu', 'bn4b5_branch2c') .add(name='res4b5') .relu(name='res4b5_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b6_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b6_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b6_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b6_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b6_branch2c') .batch_normalization(scale=True, center=True, name='bn4b6_branch2c')) (self.feed('res4b5_relu', 'bn4b6_branch2c') .add(name='res4b6') .relu(name='res4b6_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b7_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b7_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b7_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b7_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b7_branch2c') .batch_normalization(scale=True, center=True, name='bn4b7_branch2c')) (self.feed('res4b6_relu', 'bn4b7_branch2c') .add(name='res4b7') .relu(name='res4b7_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b8_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b8_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b8_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b8_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b8_branch2c') .batch_normalization(scale=True, center=True, name='bn4b8_branch2c')) (self.feed('res4b7_relu', 'bn4b8_branch2c') .add(name='res4b8') .relu(name='res4b8_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b9_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b9_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b9_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b9_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b9_branch2c') .batch_normalization(scale=True, center=True, name='bn4b9_branch2c')) (self.feed('res4b8_relu', 'bn4b9_branch2c') .add(name='res4b9') .relu(name='res4b9_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b10_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b10_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b10_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b10_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b10_branch2c') .batch_normalization(scale=True, center=True, name='bn4b10_branch2c')) (self.feed('res4b9_relu', 'bn4b10_branch2c') .add(name='res4b10') .relu(name='res4b10_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b11_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b11_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b11_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b11_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b11_branch2c') .batch_normalization(scale=True, center=True, name='bn4b11_branch2c')) (self.feed('res4b10_relu', 'bn4b11_branch2c') .add(name='res4b11') .relu(name='res4b11_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b12_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b12_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b12_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b12_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b12_branch2c') .batch_normalization(scale=True, center=True, name='bn4b12_branch2c')) (self.feed('res4b11_relu', 'bn4b12_branch2c') .add(name='res4b12') .relu(name='res4b12_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b13_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b13_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b13_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b13_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b13_branch2c') .batch_normalization(scale=True, center=True, name='bn4b13_branch2c')) (self.feed('res4b12_relu', 'bn4b13_branch2c') .add(name='res4b13') .relu(name='res4b13_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b14_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b14_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b14_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b14_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b14_branch2c') .batch_normalization(scale=True, center=True, name='bn4b14_branch2c')) (self.feed('res4b13_relu', 'bn4b14_branch2c') .add(name='res4b14') .relu(name='res4b14_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b15_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b15_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b15_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b15_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b15_branch2c') .batch_normalization(scale=True, center=True, name='bn4b15_branch2c')) (self.feed('res4b14_relu', 'bn4b15_branch2c') .add(name='res4b15') .relu(name='res4b15_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b16_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b16_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b16_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b16_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b16_branch2c') .batch_normalization(scale=True, center=True, name='bn4b16_branch2c')) (self.feed('res4b15_relu', 'bn4b16_branch2c') .add(name='res4b16') .relu(name='res4b16_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b17_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b17_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b17_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b17_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b17_branch2c') .batch_normalization(scale=True, center=True, name='bn4b17_branch2c')) (self.feed('res4b16_relu', 'bn4b17_branch2c') .add(name='res4b17') .relu(name='res4b17_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b18_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b18_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b18_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b18_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b18_branch2c') .batch_normalization(scale=True, center=True, name='bn4b18_branch2c')) (self.feed('res4b17_relu', 'bn4b18_branch2c') .add(name='res4b18') .relu(name='res4b18_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b19_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b19_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b19_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b19_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b19_branch2c') .batch_normalization(scale=True, center=True, name='bn4b19_branch2c')) (self.feed('res4b18_relu', 'bn4b19_branch2c') .add(name='res4b19') .relu(name='res4b19_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b20_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b20_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b20_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b20_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b20_branch2c') .batch_normalization(scale=True, center=True, name='bn4b20_branch2c')) (self.feed('res4b19_relu', 'bn4b20_branch2c') .add(name='res4b20') .relu(name='res4b20_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b21_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b21_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b21_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b21_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b21_branch2c') .batch_normalization(scale=True, center=True, name='bn4b21_branch2c')) (self.feed('res4b20_relu', 'bn4b21_branch2c') .add(name='res4b21') .relu(name='res4b21_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b22_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b22_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b22_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b22_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b22_branch2c') .batch_normalization(scale=True, center=True, name='bn4b22_branch2c')) (self.feed('res4b21_relu', 'bn4b22_branch2c') .add(name='res4b22') .relu(name='res4b22_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b23_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b23_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b23_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b23_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b23_branch2c') .batch_normalization(scale=True, center=True, name='bn4b23_branch2c')) (self.feed('res4b22_relu', 'bn4b23_branch2c') .add(name='res4b23') .relu(name='res4b23_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b24_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b24_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b24_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b24_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b24_branch2c') .batch_normalization(scale=True, center=True, name='bn4b24_branch2c')) (self.feed('res4b23_relu', 'bn4b24_branch2c') .add(name='res4b24') .relu(name='res4b24_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b25_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b25_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b25_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b25_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b25_branch2c') .batch_normalization(scale=True, center=True, name='bn4b25_branch2c')) (self.feed('res4b24_relu', 'bn4b25_branch2c') .add(name='res4b25') .relu(name='res4b25_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b26_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b26_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b26_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b26_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b26_branch2c') .batch_normalization(scale=True, center=True, name='bn4b26_branch2c')) (self.feed('res4b25_relu', 'bn4b26_branch2c') .add(name='res4b26') .relu(name='res4b26_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b27_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b27_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b27_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b27_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b27_branch2c') .batch_normalization(scale=True, center=True, name='bn4b27_branch2c')) (self.feed('res4b26_relu', 'bn4b27_branch2c') .add(name='res4b27') .relu(name='res4b27_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b28_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b28_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b28_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b28_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b28_branch2c') .batch_normalization(scale=True, center=True, name='bn4b28_branch2c')) (self.feed('res4b27_relu', 'bn4b28_branch2c') .add(name='res4b28') .relu(name='res4b28_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b29_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b29_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b29_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b29_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b29_branch2c') .batch_normalization(scale=True, center=True, name='bn4b29_branch2c')) (self.feed('res4b28_relu', 'bn4b29_branch2c') .add(name='res4b29') .relu(name='res4b29_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b30_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b30_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b30_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b30_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b30_branch2c') .batch_normalization(scale=True, center=True, name='bn4b30_branch2c')) (self.feed('res4b29_relu', 'bn4b30_branch2c') .add(name='res4b30') .relu(name='res4b30_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b31_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b31_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b31_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b31_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b31_branch2c') .batch_normalization(scale=True, center=True, name='bn4b31_branch2c')) (self.feed('res4b30_relu', 'bn4b31_branch2c') .add(name='res4b31') .relu(name='res4b31_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b32_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b32_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b32_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b32_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b32_branch2c') .batch_normalization(scale=True, center=True, name='bn4b32_branch2c')) (self.feed('res4b31_relu', 'bn4b32_branch2c') .add(name='res4b32') .relu(name='res4b32_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b33_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b33_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b33_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b33_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b33_branch2c') .batch_normalization(scale=True, center=True, name='bn4b33_branch2c')) (self.feed('res4b32_relu', 'bn4b33_branch2c') .add(name='res4b33') .relu(name='res4b33_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b34_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b34_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b34_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b34_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b34_branch2c') .batch_normalization(scale=True, center=True, name='bn4b34_branch2c')) (self.feed('res4b33_relu', 'bn4b34_branch2c') .add(name='res4b34') .relu(name='res4b34_relu') .conv(1, 256, 1, biased=False, relu=False, name='res4b35_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn4b35_branch2a') .conv(3, 256, 1, biased=False, relu=False, name='res4b35_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn4b35_branch2b') .conv(1, 1024, 1, biased=False, relu=False, name='res4b35_branch2c') .batch_normalization(scale=True, center=True, name='bn4b35_branch2c')) (self.feed('res4b34_relu', 'bn4b35_branch2c') .add(name='res4b35') .relu(name='res4b35_relu') .conv(1, 2048, 2, biased=False, relu=False, name='res5a_branch1') .batch_normalization(scale=True, center=True, name='bn5a_branch1')) (self.feed('res4b35_relu') .conv(1, 512, 2, biased=False, relu=False, name='res5a_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn5a_branch2a') .conv(3, 512, 1, biased=False, relu=False, name='res5a_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn5a_branch2b') .conv(1, 2048, 1, biased=False, relu=False, name='res5a_branch2c') .batch_normalization(scale=True, center=True, name='bn5a_branch2c')) (self.feed('bn5a_branch1', 'bn5a_branch2c') .add(name='res5a') .relu(name='res5a_relu') .conv(1, 512, 1, biased=False, relu=False, name='res5b_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn5b_branch2a') .conv(3, 512, 1, biased=False, relu=False, name='res5b_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn5b_branch2b') .conv(1, 2048, 1, biased=False, relu=False, name='res5b_branch2c') .batch_normalization(scale=True, center=True, name='bn5b_branch2c')) (self.feed('res5a_relu', 'bn5b_branch2c') .add(name='res5b') .relu(name='res5b_relu') .conv(1, 512, 1, biased=False, relu=False, name='res5c_branch2a') .batch_normalization(scale=True, center=True, relu=True, name='bn5c_branch2a') .conv(3, 512, 1, biased=False, relu=False, name='res5c_branch2b') .batch_normalization(scale=True, center=True, relu=True, name='bn5c_branch2b') .conv(1, 2048, 1, biased=False, relu=False, name='res5c_branch2c') .batch_normalization(scale=True, center=True, name='bn5c_branch2c')) (self.feed('res5b_relu', 'bn5c_branch2c') .add(name='res5c') .relu(name='res5c_relu') .avg_pool(7, 1, padding='VALID', name='pool5')) if not self.fcn: (self.feed('pool5') .fc(1000, relu=False, name='fc1000') .softmax(name='prob'))
58.117797
93
0.601642
8,094
68,579
4.943662
0.02125
0.07085
0.102339
0.148148
0.953341
0.951717
0.950817
0.946944
0.908582
0.908582
0
0.08765
0.252366
68,579
1,179
94
58.167091
0.692776
0
0
0.754717
0
0
0.195555
0
0
0
0
0
0
1
0.00283
false
0
0.000943
0
0.006604
0
0
0
0
null
0
0
0
1
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
7
16648173ad23a422483b74d64cbfe94477a921fe
33,305
py
Python
inventory/categories/api/tests/test_categories_api.py
cnobile2012/inventory
bc09ccdead39a5cd758088dbfe5c56dec43c7e29
[ "MIT" ]
10
2015-02-16T17:12:44.000Z
2021-06-04T18:14:01.000Z
inventory/categories/api/tests/test_categories_api.py
cnobile2012/inventory
bc09ccdead39a5cd758088dbfe5c56dec43c7e29
[ "MIT" ]
1
2021-09-20T01:17:38.000Z
2021-09-20T01:17:50.000Z
inventory/categories/api/tests/test_categories_api.py
cnobile2012/inventory
bc09ccdead39a5cd758088dbfe5c56dec43c7e29
[ "MIT" ]
5
2015-09-09T02:01:33.000Z
2021-05-29T09:09:14.000Z
# -*- coding: utf-8 -*- # # inventory/categories/api/tests/test_categories_api.py # from django.contrib.auth import get_user_model from rest_framework.reverse import reverse from rest_framework import status from rest_framework.test import APITestCase from inventory.categories.models import Category from inventory.common.api.tests.base_test import BaseTest from inventory.projects.models import Membership UserModel = get_user_model() class TestCategoryAPI(BaseTest, APITestCase): DEFAULT_USER = UserModel.ROLE_MAP[UserModel.DEFAULT_USER] PROJECT_USER = Membership.ROLE_MAP[Membership.PROJECT_USER] def __init__(self, name): super().__init__(name) def setUp(self): super().setUp() # Create an InventoryType and Project. self.in_type = self._create_inventory_type() members = [ {'user': self.user, 'role_text': self.PROJECT_USER} ] self.project = self._create_project(self.in_type, members=members) kwargs = {'public_id': self.project.public_id} self.project_uri = reverse('project-detail', kwargs=kwargs) def get_category_field(self, uri, field): """ Get a category and return the value of the provided field. """ response = self.client.get(uri, format='json') return response.data.get(field) def test_GET_category_list_with_invalid_permissions(self): """ Test the category_list endpoint with no permissions. """ #self.skipTest("Temporarily skipped") method = 'get' category = self._create_category(self.project, "Test Root Category") uri = reverse('category-list') self._test_users_with_invalid_permissions(uri, method) self._test_project_users_with_invalid_permissions(uri, method) def test_GET_category_list_with_valid_permissions(self): """ Test the category_list endpoint with valid permissions. """ #self.skipTest("Temporarily skipped") method = 'get' category = self._create_category(self.project, "Test Root Category") uri = reverse('category-list') self._test_users_with_valid_permissions( uri, method, default_user=False) self._test_project_users_with_valid_permissions(uri, method) def test_POST_category_list_with_invalid_permissions(self): """ Test that a POST to category_list fails with invalid permissions. """ #self.skipTest("Temporarily skipped") method = 'post' uri = reverse('category-list') data = {} su = data.setdefault('SU', {}) su['name'] = 'TestCategory-01' su['project'] = self.project_uri data.setdefault('AD', su.copy()) data.setdefault('DU', su.copy()) self._test_users_with_invalid_permissions( uri, method, request_data=data) data.setdefault('POW', su.copy()) data.setdefault('PMA', su.copy()) data.setdefault('PDU', su.copy()) self._test_project_users_with_invalid_permissions( uri, method, request_data=data) def test_POST_category_list_with_valid_permissions(self): """ Test that a POST to category_list passes with valid permissions. """ #self.skipTest("Temporarily skipped") method = 'post' uri = reverse('category-list') data = {} su = data.setdefault('SU', {}) su['name'] = 'TestCategory-01' su['project'] = self.project_uri ad = data.setdefault('AD', su.copy()) ad['name'] = 'TestCategory-02' du = data.setdefault('DU', su.copy()) du['name'] = 'TestCategory-03' self._test_users_with_valid_permissions( uri, method, request_data=data) pow = data.setdefault('POW', su.copy()) pow['name'] = 'TestCategory-04' pma = data.setdefault('PMA', su.copy()) pma['name'] = 'TestCategory-05' pdu = data.setdefault('PDU', su.copy()) pdu['name'] = 'TestCategory-06' self._test_project_users_with_valid_permissions( uri, method, project_user=False, request_data=data) def test_OPTIONS_category_list_with_invalid_permissions(self): """ Test that the method OPTIONS fails with invald permissions. """ #self.skipTest("Temporarily skipped") method = 'options' uri = reverse('category-list') self._test_users_with_invalid_permissions(uri, method) self._test_project_users_with_invalid_permissions(uri, method) def test_OPTIONS_category_list_with_valid_permissions(self): """ Test that the method OPTIONS brings back the correct data. """ method = 'options' uri = reverse('category-list') self._test_users_with_valid_permissions(uri, method) self._test_project_users_with_valid_permissions(uri, method) def test_GET_category_detail_with_invalid_permissions(self): """ Test that a GET on the category_detail fails with invalid permissions. """ #self.skipTest("Temporarily skipped") category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) method = 'get' self._test_users_with_invalid_permissions(uri, method) self._test_project_users_with_invalid_permissions(uri, method) def test_GET_category_detail_with_valid_permissions(self): """ Test that a GET to category_detail passes with valid permissions. """ #self.skipTest("Temporarily skipped") category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) method = 'get' self._test_users_with_valid_permissions(uri, method) self._test_project_users_with_valid_permissions(uri, method) def test_PUT_category_detail_with_invalid_permissions(self): """ Test that a PUT to category_detail fails with invalid permissions. """ #self.skipTest("Temporarily skipped") category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) method = 'put' data = {} su = data.setdefault('SU', {}) su['name'] = 'TestCategory-01' su['project'] = self.project_uri data.setdefault('AD', su.copy()) data.setdefault('DU', su.copy()) self._test_users_with_invalid_permissions( uri, method, request_data=data) data.setdefault('POW', su.copy()) data.setdefault('PMA', su.copy()) data.setdefault('PDU', su.copy()) self._test_project_users_with_invalid_permissions( uri, method, request_data=data) def test_PUT_category_detail_with_valid_permissions(self): """ Test that a PUT to category_detail passes with valid permissions. """ #self.skipTest("Temporarily skipped") category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) method = 'put' data = {} su = data.setdefault('SU', {}) su['name'] = 'TestCategory-01' su['project'] = self.project_uri ad = data.setdefault('AD', su.copy()) ad['name'] = 'TestCategory-02' du = data.setdefault('DU', su.copy()) du['name'] = 'TestCategory-03' self._test_users_with_valid_permissions( uri, method, request_data=data) pow = data.setdefault('POW', su.copy()) pow['name'] = 'TestCategory-04' pma = data.setdefault('PMA', su.copy()) pma['name'] = 'TestCategory-05' pdu = data.setdefault('PDU', su.copy()) pdu['name'] = 'TestCategory-06' self._test_project_users_with_valid_permissions( uri, method, project_user=False, request_data=data) def test_PATCH_category_detail_with_invalid_permissions(self): """ Test that a PATCH to category_detail fails with invalid permissions. """ #self.skipTest("Temporarily skipped") category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) method = 'patch' data = {} su = data.setdefault('SU', {}) su['name'] = 'TestCategory-01' su['project'] = self.project_uri data.setdefault('AD', su.copy()) data.setdefault('DU', su.copy()) self._test_users_with_invalid_permissions( uri, method, request_data=data) data.setdefault('POW', su.copy()) data.setdefault('PMA', su.copy()) data.setdefault('PDU', su.copy()) self._test_project_users_with_invalid_permissions( uri, method, request_data=data) def test_PATCH_category_detail_with_valid_permissions(self): """ Test that a PATCH to category_detail passes with valid permissions. """ #self.skipTest("Temporarily skipped") category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) method = 'patch' data = {} su = data.setdefault('SU', {}) su['name'] = 'TestCategory-01' su['project'] = self.project_uri ad = data.setdefault('AD', {}) ad['name'] = 'TestCategory-02' du = data.setdefault('DU', {}) du['name'] = 'TestCategory-03' self._test_users_with_valid_permissions( uri, method, request_data=data) pow = data.setdefault('POW', {}) pow['name'] = 'TestCategory-04' pma = data.setdefault('PMA', {}) pma['name'] = 'TestCategory-05' pdu = data.setdefault('PDU', {}) pdu['name'] = 'TestCategory-06' self._test_project_users_with_valid_permissions( uri, method, project_user=False, request_data=data) def test_DELETE_category_detail_with_invalid_permissions(self): """ Test that a DELETE to category_detail fails with invalid permissions. """ #self.skipTest("Temporarily skipped") method = 'delete' category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) self._test_users_with_invalid_permissions(uri, method) self._test_project_users_with_invalid_permissions(uri, method) def test_DELETE_category_detail_with_valid_permissions(self): """ Test that a DELETE to category_detail pass' with valid permissions. """ #self.skipTest("Temporarily skipped") method = 'delete' # Test SUPERUSER category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) self._test_superuser_with_valid_permissions(uri, method) self._test_valid_GET_with_errors(uri) # Test ADMINISTRATOR category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) self._test_administrator_with_valid_permissions(uri, method) self._test_valid_GET_with_errors(uri) # Test DEFAULT_USER ## This is an invalid test since the DEFAULT_USER has no access. # Test PROJECT_OWNER category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) self._test_project_owner_with_valid_permissions(uri, method) self._test_valid_GET_with_errors(uri) # Test PROJECT_MANAGER category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) self._test_project_manager_with_valid_permissions(uri, method) self._test_valid_GET_with_errors(uri) # Test PROJECT_USER ## This is an invalid test since the PROJECT_USER has no access. def test_OPTIONS_category_detail_with_invalid_permissions(self): """ Test that the method OPTIONS fails with invald permissions. """ #self.skipTest("Temporarily skipped") method = 'options' category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) self._test_users_with_invalid_permissions(uri, method) self._test_project_users_with_invalid_permissions(uri, method) def test_OPTIONS_category_detail_with_valid_permissions(self): """ Test that the method OPTIONS brings back the correct data. """ method = 'options' category = self._create_category(self.project, "Test Root Category") uri = reverse('category-detail', kwargs={'public_id': category.public_id}) self._test_users_with_valid_permissions(uri, method) self._test_project_users_with_valid_permissions(uri, method) def test_create_category_twice_to_same_parent(self): """ Test that a category is not created twice with the same composite key. """ #self.skipTest("Temporarily skipped") # Create Category one. uri = reverse('category-list') new_data = {'name': 'TestCategory-1', 'project': self.project_uri} response = self.client.post(uri, new_data, format='json') msg = "Response: {} should be {}, content: {}".format( response.status_code, status.HTTP_201_CREATED, response.data) self.assertEqual(response.status_code, status.HTTP_201_CREATED, msg) # Create Category two. parent_uri = response.data.get('href') uri = reverse('category-list') new_data = {'name': 'TestCategory-2', 'parent': parent_uri, 'project': self.project_uri} response = self.client.post(uri, new_data, format='json') msg = "Response: {} should be {}, content: {}".format( response.status_code, status.HTTP_201_CREATED, response.data) self.assertEqual(response.status_code, status.HTTP_201_CREATED, msg) # Create Category two again--should fail. uri = reverse('category-list') new_data = {'name': 'TestCategory-2', 'parent': parent_uri, 'project': self.project_uri} response = self.client.post(uri, new_data, format='json') msg = "Response: {} should be {}, content: {}".format( response.status_code, status.HTTP_400_BAD_REQUEST, response.data) self.assertEqual( response.status_code, status.HTTP_400_BAD_REQUEST, msg) def test_delimitor_in_category_name(self): """ Test that the delimitor is not in the category name. """ #self.skipTest("Temporarily skipped") # Create Category one. uri = reverse('category-list') new_data = {'name': 'Test{}Category-1'.format( Category.DEFAULT_SEPARATOR), 'project': self.project_uri} response = self.client.post(uri, new_data, format='json') msg = "Response: {} should be {}, content: {}".format( response.status_code, status.HTTP_400_BAD_REQUEST, response.data) self.assertEqual( response.status_code, status.HTTP_400_BAD_REQUEST, msg) self.assertTrue(self._has_error(response, 'name'), msg) self._test_errors(response, tests={ 'name': u"A category name cannot ", }) def test_category_is_not_parent(self): """ Test that this category does not exist in the current tree. """ #self.skipTest("Temporarily skipped") # Create three catagories. name = "Test Category 1" cat0 = self._create_category(self.project, name=name) name = "Test Category 2" cat1 = self._create_category(self.project, name=name, parent=cat0) name = "Test Category 3" cat2 = self._create_category(self.project, name=name, parent=cat1) # Try adding 'Test Category 2' to the tree using the API. uri = reverse('category-list') cat2_uri = reverse('category-detail', kwargs={'public_id': cat2.public_id}) new_data = {'name': "Test Category 2", 'project': self.project_uri, 'parent': cat2_uri} response = self.client.post(uri, new_data, format='json') msg = "Response: {} should be {}, content: {}".format( response.status_code, status.HTTP_400_BAD_REQUEST, response.data) self.assertEqual( response.status_code, status.HTTP_400_BAD_REQUEST, msg) self.assertTrue(self._has_error(response, 'name'), msg) self._test_errors(response, tests={ 'name': u"A category in this tree ", }) def test_root_level_category_exists(self): """ Test that there are no root level categories with this name that already exist for this owner. """ #self.skipTest("Temporarily skipped") # Create a catagory. name = "Duplicate Name" cat = self._create_category(self.project, name=name) # Create a category through the API. new_data = {'name': name, 'project': self.project_uri} uri = reverse('category-list') response = self.client.post(uri, new_data, format='json') msg = "Response: {} should be {}, content: {}".format( response.status_code, status.HTTP_400_BAD_REQUEST, response.data) self.assertEqual( response.status_code, status.HTTP_400_BAD_REQUEST, msg) self.assertTrue(self._has_error(response, 'name'), msg) self._test_errors(response, tests={ 'name': u"A root level category name ", }) def test_wrong_user_gets_no_results(self): """ Test that the request user gets no results of categories that are in a different project. This test determines that a user of one project does not have access to another project's objects. """ #self.skipTest("Temporarily skipped") # Create new user user, client = self._create_user( username="SecondUser", password="0987654321") # Create a new project p_name = "Test Project_1" project = self._create_project(self.in_type, name=p_name) # Create a category c_name = "Test Category 1" category = self._create_category(project, name=c_name) # GET category on the API uri = reverse('category-list') response = client.get(uri, format='json', **self.HEADERS) msg = "Response: {} should be {}, content: {}".format( response.status_code, status.HTTP_403_FORBIDDEN, response.data) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN, msg) self.assertTrue(self._has_error(response), msg) self._test_errors(response, tests={ 'detail': "You do not have permission to perform this action.", }) # Test GET on a category detail uri = reverse('category-detail', kwargs={'public_id': category.public_id}) response = client.get(uri, format='json', **self.HEADERS) msg = "Response: {} should be {}, content: {}".format( response.status_code, status.HTTP_403_FORBIDDEN, response.data) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN, msg) self.assertTrue(self._has_error(response), msg) self._test_errors(response, tests={ 'detail': "You do not have permission to perform this action.", }) # Test PUT to a specific category data = {'name': 'Changed Category'} response = client.patch(uri, data=data, format='json', **self.HEADERS) msg = ("Response: {} should be {}, content: {}, user: {}, " "project creator: {}").format( response.status_code, status.HTTP_403_FORBIDDEN, response.data, user, project.creator) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN, msg) self.assertTrue(self._has_error(response), msg) self._test_errors(response, tests={ 'detail': "You do not have permission to perform this action.", }) class TestCategoryCloneAPI(BaseTest): def __init__(self, name): super().__init__(name) def setUp(self): super().setUp() # Create an InventoryType and Project. self.in_type = self._create_inventory_type() self.project = self._create_project(self.in_type, members=[self.user]) kwargs = {'public_id': self.project.public_id} self.project_uri = reverse('project-detail', kwargs=kwargs) def flatten(self, items): """ Given a list, possibly nested to any level, return it flattened. http://code.activestate.com/recipes/578948-flattening-an-arbitrarily-nested-list-in-python/ """ flattened = [] for item in items: if isinstance(item, list): flattened.extend(self.flatten(item)) else: flattened.append(item) return flattened def test_GET_category_clone_with_invalid_permissions(self): """ Test the category_clone endpoint with no permissions. """ #self.skipTest("Temporarily skipped") method = 'get' category = self._create_category(self.project, "Test Root Category") uri = reverse('category-clone') data = {} su = data.setdefault('SU', {}) su['categories'] = [category.public_id] su['project'] = self.project.public_id data.setdefault('AD', su.copy()) data.setdefault('DU', su.copy()) self._test_users_with_invalid_permissions( uri, method, request_data=data) data.setdefault('POW', su.copy()) data.setdefault('PMA', su.copy()) data.setdefault('PDU', su.copy()) self._test_project_users_with_invalid_permissions( uri, method, request_data=data) def test_GET_category_clone_with_valid_permissions(self): """ Test the category_clone endpoint with valid permissions. """ #self.skipTest("Temporarily skipped") method = 'get' create_list = [['TestLevel-0', (('TestLevel-1', 'TestLevel-2',), ('TestLevel-1a', 'TestLevel-2a',))]] categories = Category.objects.create_category_tree( self.project, create_list) uri = reverse('category-clone') data = {} su = data.setdefault('SU', {}) su['categories'] = [categories[0][0].public_id] # 'TestLevel-0' su['project'] = self.project.public_id data.setdefault('AD', su.copy()) data.setdefault('DU', su.copy()) self._test_users_with_valid_permissions( uri, method, request_data=data, default_user=False) data.setdefault('POW', su.copy()) data.setdefault('PMA', su.copy()) data.setdefault('PDU', su.copy()) self._test_project_users_with_valid_permissions( uri, method, request_data=data) def test_GET_category_clone_with_parameters(self): """ Test the location_clone endpoint with various parameters. """ #self.skipTest("Temporarily skipped") method = 'get' create_list = [['TestLevel-0', (('TestLevel-1', 'TestLevel-2',), ('TestLevel-1a', 'TestLevel-2a',))]] categories = Category.objects.create_category_tree( self.project, create_list) uri = reverse('category-clone') data = {} data['categories'] = [categories[0][0].public_id] # 'TestLevel-0' data['project'] = self.project.public_id # Test with default arguments. response = self.client.get(uri, data=data, format='json', **self.HEADERS) res_data = self.flatten(response.data) msg = ("data: {}, found '{}' records , should be 5 records" ).format(res_data, len(res_data)) self.assertEqual(len(res_data), 5, msg) # Test with with_root=False data['with_root'] = False response = self.client.get(uri, data=data, format='json', **self.HEADERS) res_data = self.flatten(response.data) msg = ("data: {}, found '{}' records , should be 4 records" ).format(res_data, len(res_data)) self.assertEqual(len(res_data), 4, msg) def test_POST_category_clone_with_invalid_permissions(self): """ Test the category_clone endpoint with no permissions. """ #self.skipTest("Temporarily skipped") method = 'post' create_list = [['TestLevel-0', (('TestLevel-1', 'TestLevel-2',), ('TestLevel-1a', 'TestLevel-2a',))]] uri = reverse('category-clone') data = {} su = data.setdefault('SU', {}) su['categories'] = create_list su['project'] = self.project.public_id data.setdefault('AD', su.copy()) data.setdefault('DU', su.copy()) self._test_users_with_invalid_permissions( uri, method, request_data=data) data.setdefault('POW', su.copy()) data.setdefault('PMA', su.copy()) data.setdefault('PDU', su.copy()) self._test_project_users_with_invalid_permissions( uri, method, request_data=data) categories = Category.objects.all() msg = "categories: {}, count: {}, should be 0".format( categories, categories.count()) self.assertEqual(categories.count(), 0, msg) def test_POST_category_clone_with_valid_permissions(self): """ Test the category_clone endpoint with valid permissions. """ #self.skipTest("Temporarily skipped") method = 'post' create_list = [['TestLevel-0', (('TestLevel-1', 'TestLevel-2',), ('TestLevel-1a', 'TestLevel-2a',))]] uri = reverse('category-clone') data = {} su = data.setdefault('SU', {}) su['categories'] = create_list su['project'] = self.project.public_id data.setdefault('AD', su.copy()) data.setdefault('DU', su.copy()) self._test_users_with_valid_permissions( uri, method, request_data=data, default_user=False) data.setdefault('POW', su.copy()) data.setdefault('PMA', su.copy()) data.setdefault('PDU', su.copy()) self._test_project_users_with_valid_permissions( uri, method, request_data=data, project_user=False) categories = Category.objects.all() msg = "categories: {}, count: {}, should be 5".format( categories, categories.count()) self.assertEqual(categories.count(), 5, msg) def test_DELETE_category_clone_with_invalid_permissions(self): """ Test the category_clone endpoint with no permissions. """ #self.skipTest("Temporarily skipped") method = 'delete' create_list = [['TestLevel-0', (('TestLevel-1', 'TestLevel-2',), ('TestLevel-1a', 'TestLevel-2a',))]] categories = Category.objects.create_category_tree( self.project, create_list) uri = reverse('category-clone') data = {} su = data.setdefault('SU', {}) su['categories'] = [categories[0][0].public_id] su['project'] = self.project.public_id data.setdefault('AD', su.copy()) data.setdefault('DU', su.copy()) self._test_users_with_invalid_permissions( uri, method, request_data=data) data.setdefault('POW', su.copy()) data.setdefault('PMA', su.copy()) data.setdefault('PDU', su.copy()) self._test_project_users_with_invalid_permissions( uri, method, request_data=data) categories = Category.objects.all() msg = "categories: {}, count: {}, should be 5".format( categories, categories.count()) self.assertEqual(categories.count(), 5, msg) def test_DELETE_category_clone_with_valid_permissions(self): """ Test the category_clone endpoint with valid permissions. """ #self.skipTest("Temporarily skipped") method = 'delete' create_list = [['TestLevel-0', (('TestLevel-1', 'TestLevel-2',), ('TestLevel-1a', 'TestLevel-2a',))]] categories = Category.objects.create_category_tree( self.project, create_list) uri = reverse('category-clone') data = {} su = data.setdefault('SU', {}) su['categories'] = [categories[0][0].public_id] su['project'] = self.project.public_id data.setdefault('AD', su.copy()) data.setdefault('DU', su.copy()) self._test_users_with_valid_permissions( uri, method, request_data=data, default_user=False) data.setdefault('POW', su.copy()) data.setdefault('PMA', su.copy()) data.setdefault('PDU', su.copy()) self._test_project_users_with_valid_permissions( uri, method, request_data=data, project_user=False) categories = Category.objects.all() msg = "categories: {}, count: {}, should be 0".format( categories, categories.count()) self.assertEqual(categories.count(), 0, msg) def test_category_clone_serializer_validation_errors_on_project(self): """ Test that invalid data causes validation errors. """ #self.skipTest("Temporarily skipped") create_list = [['TestLevel-0', (('TestLevel-1', 'TestLevel-2',), ('TestLevel-1a', 'TestLevel-2a',))]] categories = Category.objects.create_category_tree( self.project, create_list) uri = reverse('category-clone') data = {} data['categories'] = [categories[0][0].public_id] data['project'] = 'junk' kwargs = self._setup_user_credentials() kwargs['login'] = True kwargs['is_superuser'] = False kwargs['role'] = self.DEFAULT_USER user, client = self._create_user(**kwargs) self.project.process_members([self.user, user]) self.project.set_role(user, self.PROJECT_USER) response = client.get(uri, data=data, format='json', **self.HEADERS) msg = "Response: {} should be {}, content: {}".format( response.status_code, status.HTTP_400_BAD_REQUEST, response.data) self.assertEqual( response.status_code, status.HTTP_400_BAD_REQUEST, msg) self.assertTrue(self._has_error(response, error_key='project'), msg) self._test_errors(response, tests={ 'project': "A project with the public_id 'junk' does not exist.", }) def test_category_clone_serializer_validation_errors_on_categories(self): """ Test that invalid data causes validation errors. """ #self.skipTest("Temporarily skipped") create_list = [['TestLevel-0', (('TestLevel-1', 'TestLevel-2',), ('TestLevel-1a', 'TestLevel-2a',))]] categories = Category.objects.create_category_tree( self.project, create_list) uri = reverse('category-clone') data = {} data['categories'] = [] data['project'] = self.project.public_id kwargs = self._setup_user_credentials() kwargs['login'] = True kwargs['is_superuser'] = False kwargs['role'] = self.DEFAULT_USER user, client = self._create_user(**kwargs) self.project.process_members([self.user, user]) self.project.set_role(user, self.PROJECT_USER) status_code = status.HTTP_400_BAD_REQUEST response = client.get(uri, data=data, **self.HEADERS) msg = "Response: {} should be {}, content: {}".format( response.status_code, status_code, response.data) self.assertEqual(response.status_code, status_code, msg) self.assertTrue(self._has_error(response, error_key='categories'), msg) self._test_errors(response, tests={ 'categories': "This field is required.", })
43.707349
99
0.615193
3,735
33,305
5.255957
0.067202
0.035862
0.046865
0.042789
0.869085
0.85854
0.843003
0.83251
0.800163
0.761347
0
0.008364
0.264074
33,305
761
100
43.764783
0.792574
0.121603
0
0.788151
0
0
0.133967
0
0
0
0
0
0.044883
1
0.064632
false
0.001795
0.012567
0
0.087971
0
0
0
0
null
0
0
0
1
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
7
16b662960cce6b499c7cf16d11016419ea30ac8d
4,472
py
Python
tests/application_directories_test.py
mwtoews/absolufy-imports
e8d184d59900f29497bf9998c947d8fe43b7d8e3
[ "MIT" ]
76
2021-02-28T21:34:31.000Z
2022-03-23T21:11:27.000Z
tests/application_directories_test.py
mwtoews/absolufy-imports
e8d184d59900f29497bf9998c947d8fe43b7d8e3
[ "MIT" ]
39
2021-03-01T16:47:44.000Z
2022-03-21T21:48:49.000Z
tests/application_directories_test.py
mwtoews/absolufy-imports
e8d184d59900f29497bf9998c947d8fe43b7d8e3
[ "MIT" ]
6
2021-03-02T20:23:48.000Z
2022-01-20T08:44:53.000Z
import os import shutil from absolufy_imports import main def test_main(tmpdir): # make src/mypackage/mysubpackage/bar.py os.mkdir(os.path.join(str(tmpdir), 'src')) os.mkdir(os.path.join(str(tmpdir), 'src', 'mypackage')) os.mkdir(os.path.join(str(tmpdir), 'src', 'mypackage', 'mysubpackage')) tmp_file = os.path.join( str(tmpdir), 'src', 'mypackage', 'mysubpackage', 'bar.py', ) shutil.copy( os.path.join('tests', 'data', 'bar.py'), tmp_file, ) # make mypackage/mysubpackage/bar.py os.mkdir(os.path.join(str(tmpdir), 'mypackage')) os.mkdir(os.path.join(str(tmpdir), 'mypackage', 'mysubpackage')) tmp_file_1 = os.path.join( str(tmpdir), 'mypackage', 'mysubpackage', 'bar.py', ) shutil.copy( os.path.join('tests', 'data', 'bar.py'), tmp_file_1, ) cwd = os.getcwd() os.chdir(str(tmpdir)) try: main( ( os.path.join( str(tmpdir), 'mypackage', 'mysubpackage', 'bar.py', ), os.path.join( str(tmpdir), 'src', 'mypackage', 'mysubpackage', 'bar.py', ), '--application-directories', '.:src', ), ) finally: os.chdir(cwd) with open(tmp_file) as fd: result = fd.read() expected = ( 'from mypackage.mysubpackage import B\n' 'from mypackage.mysubpackage.bar import baz\n' 'from mypackage.foo import T\n' 'from mypackage.mysubpackage.bar import D\n' 'from mypackage.mysubpackage import O\n' 'from datetime import datetime\n' '\n' 'print(T)\n' 'print(D)\n' ) assert result == expected with open(tmp_file_1) as fd: result = fd.read() expected = ( 'from mypackage.mysubpackage import B\n' 'from mypackage.mysubpackage.bar import baz\n' 'from mypackage.foo import T\n' 'from mypackage.mysubpackage.bar import D\n' 'from mypackage.mysubpackage import O\n' 'from datetime import datetime\n' '\n' 'print(T)\n' 'print(D)\n' ) assert result == expected def test_main_inverted_order(tmpdir): # make src/mypackage/mysubpackage/bar.py os.mkdir(os.path.join(str(tmpdir), 'src')) os.mkdir(os.path.join(str(tmpdir), 'src', 'mypackage')) os.mkdir(os.path.join(str(tmpdir), 'src', 'mypackage', 'mysubpackage')) tmp_file = os.path.join( str(tmpdir), 'src', 'mypackage', 'mysubpackage', 'bar.py', ) shutil.copy( os.path.join('tests', 'data', 'bar.py'), tmp_file, ) # make mypackage/mysubpackage/bar.py os.mkdir(os.path.join(str(tmpdir), 'mypackage')) os.mkdir(os.path.join(str(tmpdir), 'mypackage', 'mysubpackage')) tmp_file_1 = os.path.join( str(tmpdir), 'mypackage', 'mysubpackage', 'bar.py', ) shutil.copy( os.path.join('tests', 'data', 'bar.py'), tmp_file_1, ) cwd = os.getcwd() os.chdir(str(tmpdir)) try: main( ( os.path.join( str(tmpdir), 'mypackage', 'mysubpackage', 'bar.py', ), os.path.join( str(tmpdir), 'src', 'mypackage', 'mysubpackage', 'bar.py', ), '--application-directories', '.:src', ), ) finally: os.chdir(cwd) with open(tmp_file) as fd: result = fd.read() expected = ( 'from mypackage.mysubpackage import B\n' 'from mypackage.mysubpackage.bar import baz\n' 'from mypackage.foo import T\n' 'from mypackage.mysubpackage.bar import D\n' 'from mypackage.mysubpackage import O\n' 'from datetime import datetime\n' '\n' 'print(T)\n' 'print(D)\n' ) assert result == expected with open(tmp_file_1) as fd: result = fd.read() expected = ( 'from mypackage.mysubpackage import B\n' 'from mypackage.mysubpackage.bar import baz\n' 'from mypackage.foo import T\n' 'from mypackage.mysubpackage.bar import D\n' 'from mypackage.mysubpackage import O\n' 'from datetime import datetime\n' '\n' 'print(T)\n' 'print(D)\n' ) assert result == expected
29.615894
75
0.542263
523
4,472
4.592734
0.099426
0.279767
0.09159
0.097419
0.965029
0.965029
0.965029
0.965029
0.965029
0.965029
0
0.001947
0.311047
4,472
150
76
29.813333
0.77767
0.032871
0
0.842105
0
0
0.338426
0.100463
0
0
0
0
0.030075
1
0.015038
false
0
0.203008
0
0.218045
0.06015
0
0
0
null
1
0
0
1
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
8
bc474e563d51c8f57624ed4c2cdc1cece6ae2dcf
637
py
Python
jats_vae/jats_cls_types.py
kiwi0fruit/jats-semi-supervised-pytorch
67e9bb85f09f8ef02e17e495784d1d9a71c3adec
[ "MIT" ]
null
null
null
jats_vae/jats_cls_types.py
kiwi0fruit/jats-semi-supervised-pytorch
67e9bb85f09f8ef02e17e495784d1d9a71c3adec
[ "MIT" ]
null
null
null
jats_vae/jats_cls_types.py
kiwi0fruit/jats-semi-supervised-pytorch
67e9bb85f09f8ef02e17e495784d1d9a71c3adec
[ "MIT" ]
null
null
null
from abc import abstractmethod from torch import Tensor from torch.nn import Module class ModuleXYToX(Module): @abstractmethod def forward_(self, x: Tensor, y: Tensor) -> Tensor: raise NotImplementedError def forward(self, x: Tensor, y: Tensor) -> Tensor: # pylint: disable=arguments-differ return self.forward_(x=x, y=y) class ModuleXOptYToX(Module): @abstractmethod def forward_(self, x: Tensor, y: Tensor=None) -> Tensor: raise NotImplementedError def forward(self, x: Tensor, y: Tensor=None) -> Tensor: # pylint: disable=arguments-differ return self.forward_(x=x, y=y)
28.954545
95
0.690738
81
637
5.382716
0.296296
0.091743
0.12844
0.137615
0.756881
0.756881
0.756881
0.756881
0.756881
0.518349
0
0
0.204082
637
21
96
30.333333
0.859961
0.102041
0
0.4
0
0
0
0
0
0
0
0
0
1
0.266667
false
0
0.2
0.133333
0.733333
0
0
0
0
null
0
0
0
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
1
0
0
0
1
1
0
0
7
bc5389889b3a1673e81e87b6e1f89d2f3e4c5bcc
44,776
py
Python
sdk/lusid/api/property_definitions_api.py
bogdanLicaFinbourne/lusid-sdk-python-preview
f0f91f992e0417733c4c8abd2674d080a52b6890
[ "MIT" ]
null
null
null
sdk/lusid/api/property_definitions_api.py
bogdanLicaFinbourne/lusid-sdk-python-preview
f0f91f992e0417733c4c8abd2674d080a52b6890
[ "MIT" ]
null
null
null
sdk/lusid/api/property_definitions_api.py
bogdanLicaFinbourne/lusid-sdk-python-preview
f0f91f992e0417733c4c8abd2674d080a52b6890
[ "MIT" ]
null
null
null
# coding: utf-8 """ LUSID API FINBOURNE Technology # noqa: E501 The version of the OpenAPI document: 0.11.2863 Contact: info@finbourne.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from lusid.api_client import ApiClient from lusid.exceptions import ( ApiTypeError, ApiValueError ) class PropertyDefinitionsApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def create_derived_property_definition(self, create_derived_property_definition_request, **kwargs): # noqa: E501 """[EXPERIMENTAL] Create derived property definition # noqa: E501 Define a new derived property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_derived_property_definition(create_derived_property_definition_request, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param CreateDerivedPropertyDefinitionRequest create_derived_property_definition_request: The definition of the new derived property. (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: PropertyDefinition If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.create_derived_property_definition_with_http_info(create_derived_property_definition_request, **kwargs) # noqa: E501 def create_derived_property_definition_with_http_info(self, create_derived_property_definition_request, **kwargs): # noqa: E501 """[EXPERIMENTAL] Create derived property definition # noqa: E501 Define a new derived property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_derived_property_definition_with_http_info(create_derived_property_definition_request, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param CreateDerivedPropertyDefinitionRequest create_derived_property_definition_request: The definition of the new derived property. (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(PropertyDefinition, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['create_derived_property_definition_request'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_derived_property_definition" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'create_derived_property_definition_request' is set if ('create_derived_property_definition_request' not in local_var_params or local_var_params['create_derived_property_definition_request'] is None): raise ApiValueError("Missing the required parameter `create_derived_property_definition_request` when calling `create_derived_property_definition`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'create_derived_property_definition_request' in local_var_params: body_params = local_var_params['create_derived_property_definition_request'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 # set the LUSID header header_params['X-LUSID-SDK-Language'] = 'Python' header_params['X-LUSID-SDK-Version'] = '0.11.2863' return self.api_client.call_api( '/api/propertydefinitions/derived', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='PropertyDefinition', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def create_property_definition(self, create_property_definition_request, **kwargs): # noqa: E501 """Create property definition # noqa: E501 Define a new property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_property_definition(create_property_definition_request, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param CreatePropertyDefinitionRequest create_property_definition_request: The definition of the new property. (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: PropertyDefinition If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.create_property_definition_with_http_info(create_property_definition_request, **kwargs) # noqa: E501 def create_property_definition_with_http_info(self, create_property_definition_request, **kwargs): # noqa: E501 """Create property definition # noqa: E501 Define a new property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_property_definition_with_http_info(create_property_definition_request, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param CreatePropertyDefinitionRequest create_property_definition_request: The definition of the new property. (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(PropertyDefinition, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['create_property_definition_request'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_property_definition" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'create_property_definition_request' is set if ('create_property_definition_request' not in local_var_params or local_var_params['create_property_definition_request'] is None): raise ApiValueError("Missing the required parameter `create_property_definition_request` when calling `create_property_definition`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'create_property_definition_request' in local_var_params: body_params = local_var_params['create_property_definition_request'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 # set the LUSID header header_params['X-LUSID-SDK-Language'] = 'Python' header_params['X-LUSID-SDK-Version'] = '0.11.2863' return self.api_client.call_api( '/api/propertydefinitions', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='PropertyDefinition', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def delete_property_definition(self, domain, scope, code, **kwargs): # noqa: E501 """Delete property definition # noqa: E501 Delete the definition of the specified property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_property_definition(domain, scope, code, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str domain: The domain of the property to be deleted. (required) :param str scope: The scope of the property to be deleted. (required) :param str code: The code of the property to be deleted. Together with the domain and scope this uniquely identifies the property. (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: DeletedEntityResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.delete_property_definition_with_http_info(domain, scope, code, **kwargs) # noqa: E501 def delete_property_definition_with_http_info(self, domain, scope, code, **kwargs): # noqa: E501 """Delete property definition # noqa: E501 Delete the definition of the specified property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_property_definition_with_http_info(domain, scope, code, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str domain: The domain of the property to be deleted. (required) :param str scope: The scope of the property to be deleted. (required) :param str code: The code of the property to be deleted. Together with the domain and scope this uniquely identifies the property. (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(DeletedEntityResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['domain', 'scope', 'code'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_property_definition" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'domain' is set if ('domain' not in local_var_params or local_var_params['domain'] is None): raise ApiValueError("Missing the required parameter `domain` when calling `delete_property_definition`") # noqa: E501 if ('scope' in local_var_params and len(local_var_params['scope']) > 64): raise ApiValueError("Invalid value for parameter `scope` when calling `delete_property_definition`, length must be less than or equal to `64`") # noqa: E501 if ('scope' in local_var_params and len(local_var_params['scope']) < 1): raise ApiValueError("Invalid value for parameter `scope` when calling `delete_property_definition`, length must be greater than or equal to `1`") # noqa: E501 if 'scope' in local_var_params and not re.search(r'^[a-zA-Z0-9\-_]+$', local_var_params['scope']): # noqa: E501 raise ApiValueError("Invalid value for parameter `scope` when calling `delete_property_definition`, must conform to the pattern `/^[a-zA-Z0-9\-_]+$/`") # noqa: E501 if ('code' in local_var_params and len(local_var_params['code']) > 64): raise ApiValueError("Invalid value for parameter `code` when calling `delete_property_definition`, length must be less than or equal to `64`") # noqa: E501 if ('code' in local_var_params and len(local_var_params['code']) < 1): raise ApiValueError("Invalid value for parameter `code` when calling `delete_property_definition`, length must be greater than or equal to `1`") # noqa: E501 if 'code' in local_var_params and not re.search(r'^[a-zA-Z0-9\-_]+$', local_var_params['code']): # noqa: E501 raise ApiValueError("Invalid value for parameter `code` when calling `delete_property_definition`, must conform to the pattern `/^[a-zA-Z0-9\-_]+$/`") # noqa: E501 collection_formats = {} path_params = {} if 'domain' in local_var_params: path_params['domain'] = local_var_params['domain'] # noqa: E501 if 'scope' in local_var_params: path_params['scope'] = local_var_params['scope'] # noqa: E501 if 'code' in local_var_params: path_params['code'] = local_var_params['code'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 # set the LUSID header header_params['X-LUSID-SDK-Language'] = 'Python' header_params['X-LUSID-SDK-Version'] = '0.11.2863' return self.api_client.call_api( '/api/propertydefinitions/{domain}/{scope}/{code}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='DeletedEntityResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_multiple_property_definitions(self, property_keys, **kwargs): # noqa: E501 """Get multiple property definitions # noqa: E501 Retrieve the definition of one or more specified properties. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_multiple_property_definitions(property_keys, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param list[str] property_keys: One or more property keys which identify each property that a definition should be retrieved for. The format for each property key is {domain}/{scope}/{code}, e.g. 'Portfolio/Manager/Id'. (required) :param datetime as_at: The asAt datetime at which to retrieve the property definitions. Defaults to return the latest version of each definition if not specified. :param str filter: Expression to filter the result set. For example, to filter on the Lifetime, use \"lifeTime eq 'Perpetual'\" Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: ResourceListOfPropertyDefinition If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_multiple_property_definitions_with_http_info(property_keys, **kwargs) # noqa: E501 def get_multiple_property_definitions_with_http_info(self, property_keys, **kwargs): # noqa: E501 """Get multiple property definitions # noqa: E501 Retrieve the definition of one or more specified properties. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_multiple_property_definitions_with_http_info(property_keys, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param list[str] property_keys: One or more property keys which identify each property that a definition should be retrieved for. The format for each property key is {domain}/{scope}/{code}, e.g. 'Portfolio/Manager/Id'. (required) :param datetime as_at: The asAt datetime at which to retrieve the property definitions. Defaults to return the latest version of each definition if not specified. :param str filter: Expression to filter the result set. For example, to filter on the Lifetime, use \"lifeTime eq 'Perpetual'\" Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(ResourceListOfPropertyDefinition, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['property_keys', 'as_at', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_multiple_property_definitions" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'property_keys' is set if ('property_keys' not in local_var_params or local_var_params['property_keys'] is None): raise ApiValueError("Missing the required parameter `property_keys` when calling `get_multiple_property_definitions`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'as_at' in local_var_params: query_params.append(('asAt', local_var_params['as_at'])) # noqa: E501 if 'filter' in local_var_params: query_params.append(('filter', local_var_params['filter'])) # noqa: E501 if 'property_keys' in local_var_params: query_params.append(('propertyKeys', local_var_params['property_keys'])) # noqa: E501 collection_formats['propertyKeys'] = 'multi' # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 # set the LUSID header header_params['X-LUSID-SDK-Language'] = 'Python' header_params['X-LUSID-SDK-Version'] = '0.11.2863' return self.api_client.call_api( '/api/propertydefinitions', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ResourceListOfPropertyDefinition', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_property_definition(self, domain, scope, code, **kwargs): # noqa: E501 """Get property definition # noqa: E501 Retrieve the definition of a specified property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_property_definition(domain, scope, code, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str domain: The domain of the specified property. (required) :param str scope: The scope of the specified property. (required) :param str code: The code of the specified property. Together with the domain and scope this uniquely identifies the property. (required) :param datetime as_at: The asAt datetime at which to retrieve the property definition. Defaults to return the latest version of the definition if not specified. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: PropertyDefinition If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_property_definition_with_http_info(domain, scope, code, **kwargs) # noqa: E501 def get_property_definition_with_http_info(self, domain, scope, code, **kwargs): # noqa: E501 """Get property definition # noqa: E501 Retrieve the definition of a specified property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_property_definition_with_http_info(domain, scope, code, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str domain: The domain of the specified property. (required) :param str scope: The scope of the specified property. (required) :param str code: The code of the specified property. Together with the domain and scope this uniquely identifies the property. (required) :param datetime as_at: The asAt datetime at which to retrieve the property definition. Defaults to return the latest version of the definition if not specified. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(PropertyDefinition, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['domain', 'scope', 'code', 'as_at'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_property_definition" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'domain' is set if ('domain' not in local_var_params or local_var_params['domain'] is None): raise ApiValueError("Missing the required parameter `domain` when calling `get_property_definition`") # noqa: E501 if ('scope' in local_var_params and len(local_var_params['scope']) > 64): raise ApiValueError("Invalid value for parameter `scope` when calling `get_property_definition`, length must be less than or equal to `64`") # noqa: E501 if ('scope' in local_var_params and len(local_var_params['scope']) < 1): raise ApiValueError("Invalid value for parameter `scope` when calling `get_property_definition`, length must be greater than or equal to `1`") # noqa: E501 if 'scope' in local_var_params and not re.search(r'^[a-zA-Z0-9\-_]+$', local_var_params['scope']): # noqa: E501 raise ApiValueError("Invalid value for parameter `scope` when calling `get_property_definition`, must conform to the pattern `/^[a-zA-Z0-9\-_]+$/`") # noqa: E501 if ('code' in local_var_params and len(local_var_params['code']) > 64): raise ApiValueError("Invalid value for parameter `code` when calling `get_property_definition`, length must be less than or equal to `64`") # noqa: E501 if ('code' in local_var_params and len(local_var_params['code']) < 1): raise ApiValueError("Invalid value for parameter `code` when calling `get_property_definition`, length must be greater than or equal to `1`") # noqa: E501 if 'code' in local_var_params and not re.search(r'^[a-zA-Z0-9\-_]+$', local_var_params['code']): # noqa: E501 raise ApiValueError("Invalid value for parameter `code` when calling `get_property_definition`, must conform to the pattern `/^[a-zA-Z0-9\-_]+$/`") # noqa: E501 collection_formats = {} path_params = {} if 'domain' in local_var_params: path_params['domain'] = local_var_params['domain'] # noqa: E501 if 'scope' in local_var_params: path_params['scope'] = local_var_params['scope'] # noqa: E501 if 'code' in local_var_params: path_params['code'] = local_var_params['code'] # noqa: E501 query_params = [] if 'as_at' in local_var_params: query_params.append(('asAt', local_var_params['as_at'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 # set the LUSID header header_params['X-LUSID-SDK-Language'] = 'Python' header_params['X-LUSID-SDK-Version'] = '0.11.2863' return self.api_client.call_api( '/api/propertydefinitions/{domain}/{scope}/{code}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='PropertyDefinition', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def update_property_definition(self, domain, scope, code, update_property_definition_request, **kwargs): # noqa: E501 """Update property definition # noqa: E501 Update the definition of a specified existing property. Not all elements within a property definition are modifiable due to the potential implications for values already stored against the property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_property_definition(domain, scope, code, update_property_definition_request, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str domain: The domain of the property being updated. (required) :param str scope: The scope of the property being updated. (required) :param str code: The code of the property being updated. Together with the domain and scope this uniquely identifies the property. (required) :param UpdatePropertyDefinitionRequest update_property_definition_request: The updated definition of the property. (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: PropertyDefinition If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.update_property_definition_with_http_info(domain, scope, code, update_property_definition_request, **kwargs) # noqa: E501 def update_property_definition_with_http_info(self, domain, scope, code, update_property_definition_request, **kwargs): # noqa: E501 """Update property definition # noqa: E501 Update the definition of a specified existing property. Not all elements within a property definition are modifiable due to the potential implications for values already stored against the property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_property_definition_with_http_info(domain, scope, code, update_property_definition_request, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str domain: The domain of the property being updated. (required) :param str scope: The scope of the property being updated. (required) :param str code: The code of the property being updated. Together with the domain and scope this uniquely identifies the property. (required) :param UpdatePropertyDefinitionRequest update_property_definition_request: The updated definition of the property. (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(PropertyDefinition, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['domain', 'scope', 'code', 'update_property_definition_request'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method update_property_definition" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'domain' is set if ('domain' not in local_var_params or local_var_params['domain'] is None): raise ApiValueError("Missing the required parameter `domain` when calling `update_property_definition`") # noqa: E501 # verify the required parameter 'update_property_definition_request' is set if ('update_property_definition_request' not in local_var_params or local_var_params['update_property_definition_request'] is None): raise ApiValueError("Missing the required parameter `update_property_definition_request` when calling `update_property_definition`") # noqa: E501 if ('scope' in local_var_params and len(local_var_params['scope']) > 64): raise ApiValueError("Invalid value for parameter `scope` when calling `update_property_definition`, length must be less than or equal to `64`") # noqa: E501 if ('scope' in local_var_params and len(local_var_params['scope']) < 1): raise ApiValueError("Invalid value for parameter `scope` when calling `update_property_definition`, length must be greater than or equal to `1`") # noqa: E501 if 'scope' in local_var_params and not re.search(r'^[a-zA-Z0-9\-_]+$', local_var_params['scope']): # noqa: E501 raise ApiValueError("Invalid value for parameter `scope` when calling `update_property_definition`, must conform to the pattern `/^[a-zA-Z0-9\-_]+$/`") # noqa: E501 if ('code' in local_var_params and len(local_var_params['code']) > 64): raise ApiValueError("Invalid value for parameter `code` when calling `update_property_definition`, length must be less than or equal to `64`") # noqa: E501 if ('code' in local_var_params and len(local_var_params['code']) < 1): raise ApiValueError("Invalid value for parameter `code` when calling `update_property_definition`, length must be greater than or equal to `1`") # noqa: E501 if 'code' in local_var_params and not re.search(r'^[a-zA-Z0-9\-_]+$', local_var_params['code']): # noqa: E501 raise ApiValueError("Invalid value for parameter `code` when calling `update_property_definition`, must conform to the pattern `/^[a-zA-Z0-9\-_]+$/`") # noqa: E501 collection_formats = {} path_params = {} if 'domain' in local_var_params: path_params['domain'] = local_var_params['domain'] # noqa: E501 if 'scope' in local_var_params: path_params['scope'] = local_var_params['scope'] # noqa: E501 if 'code' in local_var_params: path_params['code'] = local_var_params['code'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'update_property_definition_request' in local_var_params: body_params = local_var_params['update_property_definition_request'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 # set the LUSID header header_params['X-LUSID-SDK-Language'] = 'Python' header_params['X-LUSID-SDK-Version'] = '0.11.2863' return self.api_client.call_api( '/api/propertydefinitions/{domain}/{scope}/{code}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='PropertyDefinition', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
54.671551
268
0.639986
5,222
44,776
5.259862
0.051704
0.041359
0.066261
0.023883
0.965122
0.95926
0.954454
0.939782
0.932137
0.925948
0
0.01568
0.280731
44,776
818
269
54.738386
0.837173
0.435993
0
0.741688
1
0.046036
0.291455
0.105391
0
0
0
0
0
1
0.033248
false
0
0.012788
0
0.079284
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
bcaae85b57974a66cc3e1d060a6307b6dddec2be
2,519
py
Python
tests/test_parser.py
harukaeru/KaeruParser
45f37c5503b5d2557b8252e6ac4694b4182aef55
[ "BSD-3-Clause" ]
1
2017-08-18T07:29:31.000Z
2017-08-18T07:29:31.000Z
tests/test_parser.py
harukaeru/KaeruParser
45f37c5503b5d2557b8252e6ac4694b4182aef55
[ "BSD-3-Clause" ]
null
null
null
tests/test_parser.py
harukaeru/KaeruParser
45f37c5503b5d2557b8252e6ac4694b4182aef55
[ "BSD-3-Clause" ]
2
2017-05-21T15:49:38.000Z
2020-07-03T10:04:38.000Z
import pytest from kaeru_parser import Compiler class TestClass: def setup_method(self, method): self.compiler = Compiler() def test_A(self): text = open('tests/A.txt', 'r').read() self.compiler.compile(text) entity_table = self.compiler.entity_table home = entity_table.get('Home') assert home.actions[0].name == 'click' assert home.actions[0].entity == entity_table.get("TodoList") assert home.actions[1].name == 'quit' assert home.actions[1].entity == entity_table.get("End") todo_list = entity_table.get('TodoList') assert todo_list.actions[0].name == "addTodo" assert todo_list.actions[0].entity == entity_table.get("TodoList") assert todo_list.actions[1].name == "removeTodo" assert todo_list.actions[1].entity == entity_table.get("TodoList") assert todo_list.actions[2].name == "back" assert todo_list.actions[2].entity == entity_table.get("Home") assert todo_list.actions[3].name == "quit" assert todo_list.actions[3].entity == entity_table.get("End") assert len(entity_table.items()) == 3 def test_B(self): text = open('tests/B.txt', 'r').read() with pytest.raises(SyntaxError): self.compiler.compile(text) def test_C(self): text = open('tests/C.txt', 'r').read() with pytest.raises(SyntaxError): self.compiler.compile(text) def test_D(self): print("--- C ---") text = open('tests/D.txt', 'r').read() self.compiler.compile(text) entity_table = self.compiler.entity_table home = entity_table.get('Home') assert home.actions[0].name == 'click' assert home.actions[0].entity == entity_table.get("TodoList") assert home.actions[1].name == 'quit' assert home.actions[1].entity == entity_table.get("End") todo_list = entity_table.get('TodoList') assert todo_list.actions[0].name == "addTodo" assert todo_list.actions[0].entity == entity_table.get("TodoList") assert todo_list.actions[1].name == "removeTodo" assert todo_list.actions[1].entity == entity_table.get("TodoList") assert todo_list.actions[2].name == "back" assert todo_list.actions[2].entity == entity_table.get("Home") assert todo_list.actions[3].name == "quit" assert todo_list.actions[3].entity == entity_table.get("End") assert len(entity_table.items()) == 3
38.753846
74
0.626042
329
2,519
4.653495
0.151976
0.158067
0.14631
0.219464
0.872632
0.872632
0.872632
0.872632
0.872632
0.872632
0
0.013292
0.223501
2,519
64
75
39.359375
0.769427
0
0
0.730769
0
0
0.086145
0
0
0
0
0
0.5
1
0.096154
false
0
0.038462
0
0.153846
0.019231
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
9
bcc8bfce670cee9b04bfd6cf876bc4ec198dc330
1,242
py
Python
tests/helpers/misc/test_version_is_newer_than_version.py
traibnn/integration
cf5920a677fdaa8408074e533371141828b0b30f
[ "MIT" ]
1
2021-05-22T04:35:29.000Z
2021-05-22T04:35:29.000Z
tests/helpers/misc/test_version_is_newer_than_version.py
traibnn/integration
cf5920a677fdaa8408074e533371141828b0b30f
[ "MIT" ]
45
2021-07-21T13:32:44.000Z
2022-03-28T06:15:40.000Z
tests/helpers/misc/test_version_is_newer_than_version.py
traibnn/integration
cf5920a677fdaa8408074e533371141828b0b30f
[ "MIT" ]
null
null
null
"""Helpers: Misc: version_left_higher_then_right.""" # pylint: disable=missing-docstring from custom_components.hacs.helpers.functions.misc import version_left_higher_then_right def test_basic(): assert version_left_higher_then_right("1.0.0", "0.9.9") assert version_left_higher_then_right("1", "0.9.9") assert version_left_higher_then_right("1.1", "0.9.9") assert version_left_higher_then_right("0.10.0", "0.9.9") assert not version_left_higher_then_right("0.0.10", "0.9.9") assert not version_left_higher_then_right("0.9.0", "0.9.9") assert version_left_higher_then_right("1.0.0", "1.0.0") def test_beta(): assert version_left_higher_then_right("1.0.0b1", "1.0.0b0") assert not version_left_higher_then_right("1.0.0b1", "1.0.0") assert version_left_higher_then_right("1.0.0", "1.0.0b1") def test_wierd_stuff(): assert version_left_higher_then_right("1.0.0rc1", "1.0.0b1") assert not version_left_higher_then_right("1.0.0a1", "1.0.0b1") assert version_left_higher_then_right("1.0.0", "1.0.0a0") assert version_left_higher_then_right("1.0.0", "1.0.0b0") assert version_left_higher_then_right("1.0.0", "1.0.0rc0") assert not version_left_higher_then_right("0", "1.0.0rc0")
42.827586
88
0.729469
226
1,242
3.668142
0.154867
0.053076
0.369119
0.455971
0.78649
0.722557
0.721351
0.721351
0.629674
0.533173
0
0.095195
0.111916
1,242
28
89
44.357143
0.656392
0.065217
0
0
0
0
0.154978
0
0
0
0
0
0.8
1
0.15
true
0
0.05
0
0.2
0
0
0
0
null
0
1
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
1
0
0
0
0
0
0
7
4c0c044816b32d6e89ad4afd2eccdce0534e40a5
21,116
py
Python
optimization/second_sdEta_mjj_optimization/lumi_and_kin_plots/four_cuts_lum150/Output/Histos/MadAnalysis5job_0/selection_15.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
optimization/second_sdEta_mjj_optimization/lumi_and_kin_plots/four_cuts_lum150/Output/Histos/MadAnalysis5job_0/selection_15.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
optimization/second_sdEta_mjj_optimization/lumi_and_kin_plots/four_cuts_lum150/Output/Histos/MadAnalysis5job_0/selection_15.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
def selection_15(): # Library import import numpy import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # Library version matplotlib_version = matplotlib.__version__ numpy_version = numpy.__version__ # Histo binning xBinning = numpy.linspace(0.0,8000.0,81,endpoint=True) # Creating data sequence: middle of each bin xData = numpy.array([50.0,150.0,250.0,350.0,450.0,550.0,650.0,750.0,850.0,950.0,1050.0,1150.0,1250.0,1350.0,1450.0,1550.0,1650.0,1750.0,1850.0,1950.0,2050.0,2150.0,2250.0,2350.0,2450.0,2550.0,2650.0,2750.0,2850.0,2950.0,3050.0,3150.0,3250.0,3350.0,3450.0,3550.0,3650.0,3750.0,3850.0,3950.0,4050.0,4150.0,4250.0,4350.0,4450.0,4550.0,4650.0,4750.0,4850.0,4950.0,5050.0,5150.0,5250.0,5350.0,5450.0,5550.0,5650.0,5750.0,5850.0,5950.0,6050.0,6150.0,6250.0,6350.0,6450.0,6550.0,6650.0,6750.0,6850.0,6950.0,7050.0,7150.0,7250.0,7350.0,7450.0,7550.0,7650.0,7750.0,7850.0,7950.0]) # Creating weights for histo: y16_TET_0 y16_TET_0_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,26.0230298503,88.6778613367,146.189511805,177.110112863,198.358346411,204.975441287,202.196543439,192.171151202,183.895957609,168.619969437,153.451381182,139.265397167,123.789759149,112.336563018,98.4883187404,88.3861565625,78.4068292895,67.1378630151,59.6456838163,50.7717656874,44.4464055851,38.0596355304,33.6533739422,29.4006372351,24.4416860748,20.7416539397,19.0374902593,15.85945772,13.4797725626,11.6988464416,9.74903845131,8.58222385478,6.95482561487,6.47888798339,5.51166173232,4.28343568333,3.79214556374,3.25479647981,2.84027030078,2.45645059797,1.65810471613,1.7502211448,1.6273982399,1.04399154164,0.79834648184,0.844404846177,0.690876665054,0.552701422043,0.429878817144,0.260997847909,0.383820452808,0.368467514695,0.276350636021,0.184233757348,0.168880969235,0.153528181123,0.122822529898,0.0460584543369,0.0460584543369,0.0153528181123,0.0153528181123,0.0153528181123,0.0460584543369,0.0,0.0307056362246,0.0,0.0,0.0153528181123,0.0153528181123,0.0153528181123,0.0307056362246,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_1 y16_TET_1_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0456393479265,0.0911228234141,0.0,0.0,0.0454926886594,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_2 y16_TET_2_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.828296612194,1.65660686011,0.865534681963,0.452041510286,0.188269176512,0.188173571513,0.0377049537616,0.113048092737,0.0377612630918,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_3 y16_TET_3_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,1.91816910708,5.17651940819,5.87837580287,4.39384007468,2.53753741416,1.23771238772,0.722027851392,0.247396773218,0.288826527567,0.10309566703,0.0206389019058,0.0411875841322,0.0206041059335,0.0,0.0411480197101,0.0,0.0206099255751,0.0,0.0,0.0,0.0,0.0206783139813,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_4 y16_TET_4_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.344112029979,2.37584629364,3.71171439333,3.94134126591,2.79035550628,1.6282497503,0.799330530173,0.43298527147,0.236898159732,0.136907326859,0.0591894648972,0.0740442198024,0.0296066671297,0.0185172289686,0.018508946841,0.0036908226889,0.00740061761273,0.00368965777985,0.0037056478476,0.0,0.00738767434582,0.00369535756711,0.00370835494593,0.0,0.0,0.0,0.00370047865762,0.0,0.0,0.00369858925029,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_5 y16_TET_5_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0567020327819,0.418701316851,0.981214380156,1.28660360725,1.24305238893,0.896118006328,0.609670243273,0.301553400948,0.142752914397,0.0841563150938,0.052006225371,0.0274184822681,0.0132323578442,0.0113471374447,0.00851022404736,0.0028375450746,0.00283281274695,0.0037771221734,0.00283684887929,0.0,0.00189102252726,0.000945066988988,0.0,0.0,0.000944843126183,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_6 y16_TET_6_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0139700355712,0.0687038533727,0.135308351836,0.256586014406,0.319950288149,0.348965803038,0.308046283381,0.266317935313,0.201874311454,0.134198073171,0.0998561373431,0.0740463946455,0.0515488183475,0.0278767294746,0.00860207290584,0.00750434185889,0.00537996294224,0.00215147457467,0.00214853055173,0.0,0.00214569712177,0.0,0.00107318914981,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_7 y16_TET_7_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000567125633315,0.00413019084775,0.00826206488779,0.0155494404236,0.0150683507479,0.0143318778963,0.013846214841,0.0142498053772,0.0183035139159,0.0190228860996,0.0208859646586,0.0160331845454,0.0153914828065,0.010605040272,0.00752792115945,0.00469855663703,0.00315236613756,0.00186235090447,0.000810296785484,0.000567290809328,0.000405315218944,8.09752380432e-05,8.11095162408e-05,8.10828146188e-05,8.12819530834e-05,0.0,0.000161643509589,0.0,0.0,0.0,0.0,0.0,0.0,8.09353349131e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_8 y16_TET_8_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000213219487073,0.000319253925172,0.000850643544829,0.000319605166625,0.00106425380751,0.00117006557367,0.000852048956097,0.000425892678981,0.000532289383551,0.000742993162181,0.00106494593358,0.00148777538395,0.00191528601203,0.00117201444033,0.00212385483508,0.00106543593434,0.00127705835303,0.00105882370819,0.000638434238867,0.00116517002063,0.000527390823691,0.000212991581038,0.00031810626544,0.000106683410696,0.00021292175593,0.0,0.000212995423089,0.000425714441205,0.000212693794213,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000104897747703,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_9 y16_TET_9_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_10 y16_TET_10_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,7.90028331531,0.0,3.948593127,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_11 y16_TET_11_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,2.59436247568,19.8668183501,19.0005538207,19.005525313,5.17790439019,2.58985498928,1.72887465182,0.862982047614,0.0,0.0,0.865024394312,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_12 y16_TET_12_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.24663412243,6.0217594445,7.99640701578,9.44882440703,9.86577563241,5.19291018736,2.69904300273,1.24552005408,0.934730036618,0.519009580518,0.415550381441,0.103973981458,0.103761063565,0.207838734306,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_13 y16_TET_13_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.226806815862,0.566789855622,1.51205021831,1.7018570448,2.79822909781,2.41927270253,2.00381529207,0.869069221526,0.642990782823,0.264663197443,0.2648605113,0.0756564593003,0.0378575877672,0.0376610932072,0.0,0.0,0.0378021259601,0.0,0.0,0.0,0.0,0.0378656896972,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_14 y16_TET_14_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0424409358938,0.19102305148,0.233488024287,0.371157496717,0.38191610741,0.572929925022,0.74263659175,0.944503811484,0.530447350154,0.44561537011,0.403078113429,0.233306953903,0.169763801287,0.159084544149,0.0424634290197,0.0318271670802,0.0,0.0106130286614,0.0105880481623,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_15 y16_TET_15_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0114686091,0.011413340788,0.0,0.0229657254802,0.0171544463985,0.0114335600374,0.0,0.0229393500412,0.0114150205546,0.0284815163209,0.0398872826465,0.0685400199323,0.0227551430174,0.0399550938073,0.0170772879346,0.0115087240553,0.011406869919,0.0229110953909,0.00566683687717,0.0057683054206,0.0,0.0,0.00567245235042,0.0,0.0,0.00571686201256,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y16_TET_16 y16_TET_16_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000677073862503,0.0,0.00270659766913,0.000677348019468,0.000677753696703,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000677051774027,0.00948240220668,0.00473432408017,0.000677464236612,0.00135439964913,0.00406095472936,0.00203105411933,0.00135190119708,0.00135639208739,0.00135593631407,0.00135626937364,0.00135523410266,0.0,0.0,0.000675761258437,0.0,0.0,0.000677876121719,0.0,0.0,0.0,0.0,0.000677831367291,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating a new Canvas fig = plt.figure(figsize=(12,6),dpi=80) frame = gridspec.GridSpec(1,1,right=0.7) pad = fig.add_subplot(frame[0]) # Creating a new Stack pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights+y16_TET_8_weights+y16_TET_9_weights+y16_TET_10_weights+y16_TET_11_weights+y16_TET_12_weights+y16_TET_13_weights+y16_TET_14_weights+y16_TET_15_weights+y16_TET_16_weights,\ label="$bg\_dip\_1600\_inf$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#e5e5e5", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights+y16_TET_8_weights+y16_TET_9_weights+y16_TET_10_weights+y16_TET_11_weights+y16_TET_12_weights+y16_TET_13_weights+y16_TET_14_weights+y16_TET_15_weights,\ label="$bg\_dip\_1200\_1600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#f2f2f2", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights+y16_TET_8_weights+y16_TET_9_weights+y16_TET_10_weights+y16_TET_11_weights+y16_TET_12_weights+y16_TET_13_weights+y16_TET_14_weights,\ label="$bg\_dip\_800\_1200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#ccc6aa", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights+y16_TET_8_weights+y16_TET_9_weights+y16_TET_10_weights+y16_TET_11_weights+y16_TET_12_weights+y16_TET_13_weights,\ label="$bg\_dip\_600\_800$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#ccc6aa", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights+y16_TET_8_weights+y16_TET_9_weights+y16_TET_10_weights+y16_TET_11_weights+y16_TET_12_weights,\ label="$bg\_dip\_400\_600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#c1bfa8", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights+y16_TET_8_weights+y16_TET_9_weights+y16_TET_10_weights+y16_TET_11_weights,\ label="$bg\_dip\_200\_400$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#bab5a3", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights+y16_TET_8_weights+y16_TET_9_weights+y16_TET_10_weights,\ label="$bg\_dip\_100\_200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#b2a596", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights+y16_TET_8_weights+y16_TET_9_weights,\ label="$bg\_dip\_0\_100$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#b7a39b", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights+y16_TET_8_weights,\ label="$bg\_vbf\_1600\_inf$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#ad998c", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights,\ label="$bg\_vbf\_1200\_1600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#9b8e82", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights,\ label="$bg\_vbf\_800\_1200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#876656", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights,\ label="$bg\_vbf\_600\_800$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#afcec6", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights,\ label="$bg\_vbf\_400\_600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#84c1a3", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights,\ label="$bg\_vbf\_200\_400$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#89a8a0", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights,\ label="$bg\_vbf\_100\_200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#829e8c", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights+y16_TET_1_weights,\ label="$bg\_vbf\_0\_100$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#adbcc6", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y16_TET_0_weights,\ label="$signal$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#7a8e99", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") # Axis plt.rc('text',usetex=False) plt.xlabel(r"TET",\ fontsize=16,color="black") plt.ylabel(r"$\mathrm{Events}$ $(\mathcal{L}_{\mathrm{int}} = 150.0\ \mathrm{fb}^{-1})$ ",\ fontsize=16,color="black") # Boundary of y-axis ymax=(y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights+y16_TET_8_weights+y16_TET_9_weights+y16_TET_10_weights+y16_TET_11_weights+y16_TET_12_weights+y16_TET_13_weights+y16_TET_14_weights+y16_TET_15_weights+y16_TET_16_weights).max()*1.1 ymin=0 # linear scale #ymin=min([x for x in (y16_TET_0_weights+y16_TET_1_weights+y16_TET_2_weights+y16_TET_3_weights+y16_TET_4_weights+y16_TET_5_weights+y16_TET_6_weights+y16_TET_7_weights+y16_TET_8_weights+y16_TET_9_weights+y16_TET_10_weights+y16_TET_11_weights+y16_TET_12_weights+y16_TET_13_weights+y16_TET_14_weights+y16_TET_15_weights+y16_TET_16_weights) if x])/100. # log scale plt.gca().set_ylim(ymin,ymax) # Log/Linear scale for X-axis plt.gca().set_xscale("linear") #plt.gca().set_xscale("log",nonposx="clip") # Log/Linear scale for Y-axis plt.gca().set_yscale("linear") #plt.gca().set_yscale("log",nonposy="clip") # Legend plt.legend(bbox_to_anchor=(1.05,1), loc=2, borderaxespad=0.) # Saving the image plt.savefig('../../HTML/MadAnalysis5job_0/selection_15.png') plt.savefig('../../PDF/MadAnalysis5job_0/selection_15.png') plt.savefig('../../DVI/MadAnalysis5job_0/selection_15.eps') # Running! if __name__ == '__main__': selection_15()
108.845361
1,068
0.716281
4,670
21,116
3.082655
0.124197
0.286607
0.416366
0.537649
0.591206
0.58808
0.58808
0.571826
0.569186
0.56731
0
0.397483
0.07795
21,116
193
1,069
109.409326
0.341911
0.06398
0
0.185841
0
0.00885
0.051701
0.010289
0
0
0
0
0
1
0.00885
false
0
0.035398
0
0.044248
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
4c697e033ab09b8a2927c014191de0022d675382
31,804
py
Python
azure-mgmt-web/azure/mgmt/web/operations/managed_hosting_environments_operations.py
Berryliao84/Python-Azure
a96ed6e8bbf4290372980a2919b31110da90b164
[ "MIT" ]
1
2017-10-29T15:14:35.000Z
2017-10-29T15:14:35.000Z
azure-mgmt-web/azure/mgmt/web/operations/managed_hosting_environments_operations.py
Berryliao84/Python-Azure
a96ed6e8bbf4290372980a2919b31110da90b164
[ "MIT" ]
null
null
null
azure-mgmt-web/azure/mgmt/web/operations/managed_hosting_environments_operations.py
Berryliao84/Python-Azure
a96ed6e8bbf4290372980a2919b31110da90b164
[ "MIT" ]
null
null
null
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrestazure.azure_operation import AzureOperationPoller import uuid from .. import models class ManagedHostingEnvironmentsOperations(object): """ManagedHostingEnvironmentsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. """ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self.config = config def get_managed_hosting_environment( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """Get properties of a managed hosting environment. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of managed hosting environment :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`ManagedHostingEnvironment <azure.mgmt.web.models.ManagedHostingEnvironment>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('ManagedHostingEnvironment', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def create_or_update_managed_hosting_environment( self, resource_group_name, name, managed_hosting_environment_envelope, custom_headers=None, raw=False, **operation_config): """Create or update a managed hosting environment. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of managed hosting environment :type name: str :param managed_hosting_environment_envelope: Properties of managed hosting environment :type managed_hosting_environment_envelope: :class:`HostingEnvironment <azure.mgmt.web.models.HostingEnvironment>` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :rtype: :class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>` instance that returns :class:`HostingEnvironment <azure.mgmt.web.models.HostingEnvironment>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body body_content = self._serialize.body(managed_hosting_environment_envelope, 'HostingEnvironment') # Construct and send request def long_running_send(): request = self._client.put(url, query_parameters) return self._client.send( request, header_parameters, body_content, **operation_config) def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) return self._client.send( request, header_parameters, **operation_config) def get_long_running_output(response): if response.status_code not in [202, 400, 404, 409]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 202: deserialized = self._deserialize('HostingEnvironment', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized if raw: response = long_running_send() return get_long_running_output(response) long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) def delete_managed_hosting_environment( self, resource_group_name, name, force_delete=None, custom_headers=None, raw=False, **operation_config): """Delete a managed hosting environment. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of managed hosting environment :type name: str :param force_delete: Delete even if the managed hosting environment contains resources :type force_delete: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :rtype: :class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>` instance that returns object :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if force_delete is not None: query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request def long_running_send(): request = self._client.delete(url, query_parameters) return self._client.send(request, header_parameters, **operation_config) def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) return self._client.send( request, header_parameters, **operation_config) def get_long_running_output(response): if response.status_code not in [202, 400, 404, 409]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 202: deserialized = self._deserialize('object', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized if raw: response = long_running_send() return get_long_running_output(response) long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) def get_managed_hosting_environments( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Get all managed hosting environments in a resource group. :param resource_group_name: Name of resource group :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`HostingEnvironmentPaged <azure.mgmt.web.models.HostingEnvironmentPaged>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.HostingEnvironmentPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.HostingEnvironmentPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized def get_managed_hosting_environment_vips( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """Get list of ip addresses assigned to a managed hosting environment. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of managed hosting environment :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`AddressResponse <azure.mgmt.web.models.AddressResponse>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/capacities/virtualip' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('AddressResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def get_managed_hosting_environment_operation( self, resource_group_name, name, operation_id, custom_headers=None, raw=False, **operation_config): """Get status of an operation on a managed hosting environment. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of managed hosting environment :type name: str :param operation_id: operation identifier GUID :type operation_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: object :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/operations/{operationId}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'operationId': self._serialize.url("operation_id", operation_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200, 202, 404, 500]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('object', response) if response.status_code == 202: deserialized = self._deserialize('object', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def get_managed_hosting_environment_sites( self, resource_group_name, name, properties_to_include=None, custom_headers=None, raw=False, **operation_config): """Get all sites on the managed hosting environment. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of managed hosting environment :type name: str :param properties_to_include: Comma separated list of site properties to include :type properties_to_include: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`SitePaged <azure.mgmt.web.models.SitePaged>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/sites' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if properties_to_include is not None: query_parameters['propertiesToInclude'] = self._serialize.query("properties_to_include", properties_to_include, 'str') query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.SitePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.SitePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized def get_managed_hosting_environment_web_hosting_plans( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """Get all serverfarms (App Service Plans) on the managed hosting environment. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of managed hosting environment :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`ServerFarmWithRichSkuPaged <azure.mgmt.web.models.ServerFarmWithRichSkuPaged>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/webhostingplans' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.ServerFarmWithRichSkuPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.ServerFarmWithRichSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized def get_managed_hosting_environment_server_farms( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """Get all serverfarms (App Service Plans) on the managed hosting environment. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of managed hosting environment :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`ServerFarmWithRichSkuPaged <azure.mgmt.web.models.ServerFarmWithRichSkuPaged>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/serverfarms' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.ServerFarmWithRichSkuPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.ServerFarmWithRichSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
46.294032
165
0.657213
3,288
31,804
6.135645
0.061436
0.037177
0.03792
0.032121
0.89769
0.890998
0.890304
0.8793
0.868593
0.866313
0
0.003814
0.249843
31,804
686
166
46.361516
0.841772
0.242925
0
0.841096
0
0.005479
0.163262
0.09563
0
0
0
0
0
1
0.054795
false
0
0.013699
0
0.153425
0
0
0
0
null
0
0
0
1
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
7
d5c243eb8f017e84cb52cd4f0a167deb9ca1b544
135
py
Python
nlstruct/models/__init__.py
percevalw/nlstruct
395db91c005536c64eca47a6dab4c5e460a9cfd0
[ "MIT" ]
6
2020-02-10T09:02:34.000Z
2021-11-22T12:57:23.000Z
nlstruct/models/__init__.py
percevalw/nlstruct
395db91c005536c64eca47a6dab4c5e460a9cfd0
[ "MIT" ]
null
null
null
nlstruct/models/__init__.py
percevalw/nlstruct
395db91c005536c64eca47a6dab4c5e460a9cfd0
[ "MIT" ]
4
2020-03-04T08:18:39.000Z
2022-03-15T12:18:03.000Z
from nlstruct.models.bitag import BiTagSpanScorer from nlstruct.models.ner import SpanScorer, ContiguousEntityDecoder, NERPreprocessor
45
84
0.881481
14
135
8.5
0.714286
0.201681
0.302521
0
0
0
0
0
0
0
0
0
0.074074
135
2
85
67.5
0.952
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
d5d02658cc9757ad409bf4b42c3425eecb4c2ed9
250,958
py
Python
sympy/integrals/rubi/rubi_tests/tests/test_exponential.py
bigfooted/sympy
1fb2490fa2fa9b476da450f02a25b03c1dc07cf0
[ "BSD-3-Clause" ]
8,323
2015-01-02T15:51:43.000Z
2022-03-31T13:13:19.000Z
sympy/integrals/rubi/rubi_tests/tests/test_exponential.py
bigfooted/sympy
1fb2490fa2fa9b476da450f02a25b03c1dc07cf0
[ "BSD-3-Clause" ]
15,102
2015-01-01T01:33:17.000Z
2022-03-31T22:53:13.000Z
sympy/integrals/rubi/rubi_tests/tests/test_exponential.py
bigfooted/sympy
1fb2490fa2fa9b476da450f02a25b03c1dc07cf0
[ "BSD-3-Clause" ]
4,490
2015-01-01T17:48:07.000Z
2022-03-31T17:24:05.000Z
import sys from sympy.external import import_module matchpy = import_module("matchpy") if not matchpy: #bin/test will not execute any tests now disabled = True if sys.version_info[:2] < (3, 6): disabled = True from sympy.integrals.rubi.rubi import rubi_integrate from sympy.functions import log, sqrt, exp, cos, sin, tan, sec, csc, cot, sinh, sech, atan, asin, acos, atanh, asinh, acosh from sympy import acsch as arccsch, acsc as arccsc from sympy.integrals.rubi.utility_function import (EllipticE, EllipticF, Int, ArcCsch, ArcCsc, Gamma, hypergeom, rubi_test, AppellF1, EllipticPi, Log, Sqrt, ArcTan, ArcTanh, ArcSin, ArcSinh, ArcCosh, ArcTanh, ArcCos, Hypergeometric2F1) from sympy import pi from sympy import S, hyper, I, simplify, exp_polar, symbols, Ei,erf, erfi,gamma,uppergamma, polylog, Integral, exp from sympy.testing.pytest import SKIP a, b, c, d, e, f, m, n, x, u , k, p, r, s, t= symbols('a b c d e f m n x u k p r s t') A, B, C, D, a, b, c, d, e, f, g, h, i, y, z, m, n, p, q, u, v, w, E, F, G, H = symbols('A B C D a b c d e f g h i y z m n p q u v w E F G H') def test_1(): assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x)**m, x), x, F**(c*(a - b*d/e))*(-b*c*(d + e*x)*log(F)/e)**(-m)*(d + e*x)**m*Gamma(m + S(1), -b*c*(d + e*x)*log(F)/e)/(b*c*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x)**S(4), x), x, F**(c*(a + b*x))*(d + e*x)**S(4)/(b*c*log(F)) - S(4)*F**(c*(a + b*x))*e*(d + e*x)**S(3)/(b**S(2)*c**S(2)*log(F)**S(2)) + S(12)*F**(c*(a + b*x))*e**S(2)*(d + e*x)**S(2)/(b**S(3)*c**S(3)*log(F)**S(3)) - S(24)*F**(c*(a + b*x))*e**S(3)*(d + e*x)/(b**S(4)*c**S(4)*log(F)**S(4)) + S(24)*F**(c*(a + b*x))*e**S(4)/(b**S(5)*c**S(5)*log(F)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x)**S(3), x), x, F**(c*(a + b*x))*(d + e*x)**S(3)/(b*c*log(F)) - S(3)*F**(c*(a + b*x))*e*(d + e*x)**S(2)/(b**S(2)*c**S(2)*log(F)**S(2)) + S(6)*F**(c*(a + b*x))*e**S(2)*(d + e*x)/(b**S(3)*c**S(3)*log(F)**S(3)) - S(6)*F**(c*(a + b*x))*e**S(3)/(b**S(4)*c**S(4)*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x)**S(2), x), x, F**(c*(a + b*x))*(d + e*x)**S(2)/(b*c*log(F)) - S(2)*F**(c*(a + b*x))*e*(d + e*x)/(b**S(2)*c**S(2)*log(F)**S(2)) + S(2)*F**(c*(a + b*x))*e**S(2)/(b**S(3)*c**S(3)*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x), x), x, F**(c*(a + b*x))*(d + e*x)/(b*c*log(F)) - F**(c*(a + b*x))*e/(b**S(2)*c**S(2)*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x)), x), x, F**(c*(a + b*x))/(b*c*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d + e*x), x), x, F**(c*(a - b*d/e))*Ei(b*c*(d + e*x)*log(F)/e)/e, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d + e*x)**S(2), x), x, -F**(c*(a + b*x))/(e*(d + e*x)) + F**(c*(a - b*d/e))*b*c*log(F)*Ei(b*c*(d + e*x)*log(F)/e)/e**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d + e*x)**S(3), x), x, -F**(c*(a + b*x))*b*c*log(F)/(S(2)*e**S(2)*(d + e*x)) - F**(c*(a + b*x))/(S(2)*e*(d + e*x)**S(2)) + F**(c*(a - b*d/e))*b**S(2)*c**S(2)*log(F)**S(2)*Ei(b*c*(d + e*x)*log(F)/e)/(S(2)*e**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d + e*x)**S(4), x), x, -F**(c*(a + b*x))*b**S(2)*c**S(2)*log(F)**S(2)/(S(6)*e**S(3)*(d + e*x)) - F**(c*(a + b*x))*b*c*log(F)/(S(6)*e**S(2)*(d + e*x)**S(2)) - F**(c*(a + b*x))/(S(3)*e*(d + e*x)**S(3)) + F**(c*(a - b*d/e))*b**S(3)*c**S(3)*log(F)**S(3)*Ei(b*c*(d + e*x)*log(F)/e)/(S(6)*e**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d + e*x)**S(5), x), x, -F**(c*(a + b*x))*b**S(3)*c**S(3)*log(F)**S(3)/(S(24)*e**S(4)*(d + e*x)) - F**(c*(a + b*x))*b**S(2)*c**S(2)*log(F)**S(2)/(S(24)*e**S(3)*(d + e*x)**S(2)) - F**(c*(a + b*x))*b*c*log(F)/(S(12)*e**S(2)*(d + e*x)**S(3)) - F**(c*(a + b*x))/(S(4)*e*(d + e*x)**S(4)) + F**(c*(a - b*d/e))*b**S(4)*c**S(4)*log(F)**S(4)*Ei(b*c*(d + e*x)*log(F)/e)/(S(24)*e**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d**S(4) + S(4)*d**S(3)*e*x + S(6)*d**S(2)*e**S(2)*x**S(2) + S(4)*d*e**S(3)*x**S(3) + e**S(4)*x**S(4)), x), x, F**(c*(a + b*x))*(d + e*x)**S(4)/(b*c*log(F)) - S(4)*F**(c*(a + b*x))*e*(d + e*x)**S(3)/(b**S(2)*c**S(2)*log(F)**S(2)) + S(12)*F**(c*(a + b*x))*e**S(2)*(d + e*x)**S(2)/(b**S(3)*c**S(3)*log(F)**S(3)) - S(24)*F**(c*(a + b*x))*e**S(3)*(d + e*x)/(b**S(4)*c**S(4)*log(F)**S(4)) + S(24)*F**(c*(a + b*x))*e**S(4)/(b**S(5)*c**S(5)*log(F)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d**S(3) + S(3)*d**S(2)*e*x + S(3)*d*e**S(2)*x**S(2) + e**S(3)*x**S(3)), x), x, F**(c*(a + b*x))*(d + e*x)**S(3)/(b*c*log(F)) - S(3)*F**(c*(a + b*x))*e*(d + e*x)**S(2)/(b**S(2)*c**S(2)*log(F)**S(2)) + S(6)*F**(c*(a + b*x))*e**S(2)*(d + e*x)/(b**S(3)*c**S(3)*log(F)**S(3)) - S(6)*F**(c*(a + b*x))*e**S(3)/(b**S(4)*c**S(4)*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d**S(2) + S(2)*d*e*x + e**S(2)*x**S(2)), x), x, F**(c*(a + b*x))*(d + e*x)**S(2)/(b*c*log(F)) - S(2)*F**(c*(a + b*x))*e*(d + e*x)/(b**S(2)*c**S(2)*log(F)**S(2)) + S(2)*F**(c*(a + b*x))*e**S(2)/(b**S(3)*c**S(3)*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d**S(2) + S(2)*d*e*x + e**S(2)*x**S(2)), x), x, -F**(c*(a + b*x))/(e*(d + e*x)) + F**(c*(a - b*d/e))*b*c*log(F)*Ei(b*c*(d + e*x)*log(F)/e)/e**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d**S(3) + S(3)*d**S(2)*e*x + S(3)*d*e**S(2)*x**S(2) + e**S(3)*x**S(3)), x), x, -F**(c*(a + b*x))*b*c*log(F)/(S(2)*e**S(2)*(d + e*x)) - F**(c*(a + b*x))/(S(2)*e*(d + e*x)**S(2)) + F**(c*(a - b*d/e))*b**S(2)*c**S(2)*log(F)**S(2)*Ei(b*c*(d + e*x)*log(F)/e)/(S(2)*e**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d**S(4) + S(4)*d**S(3)*e*x + S(6)*d**S(2)*e**S(2)*x**S(2) + S(4)*d*e**S(3)*x**S(3) + e**S(4)*x**S(4)), x), x, -F**(c*(a + b*x))*b**S(2)*c**S(2)*log(F)**S(2)/(S(6)*e**S(3)*(d + e*x)) - F**(c*(a + b*x))*b*c*log(F)/(S(6)*e**S(2)*(d + e*x)**S(2)) - F**(c*(a + b*x))/(S(3)*e*(d + e*x)**S(3)) + F**(c*(a - b*d/e))*b**S(3)*c**S(3)*log(F)**S(3)*Ei(b*c*(d + e*x)*log(F)/e)/(S(6)*e**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d**S(5) + S(5)*d**S(4)*e*x + S(10)*d**S(3)*e**S(2)*x**S(2) + S(10)*d**S(2)*e**S(3)*x**S(3) + S(5)*d*e**S(4)*x**S(4) + e**S(5)*x**S(5)), x), x, -F**(c*(a + b*x))*b**S(3)*c**S(3)*log(F)**S(3)/(S(24)*e**S(4)*(d + e*x)) - F**(c*(a + b*x))*b**S(2)*c**S(2)*log(F)**S(2)/(S(24)*e**S(3)*(d + e*x)**S(2)) - F**(c*(a + b*x))*b*c*log(F)/(S(12)*e**S(2)*(d + e*x)**S(3)) - F**(c*(a + b*x))/(S(4)*e*(d + e*x)**S(4)) + F**(c*(a - b*d/e))*b**S(4)*c**S(4)*log(F)**S(4)*Ei(b*c*(d + e*x)*log(F)/e)/(S(24)*e**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*((d + e*x)**n)**m, x), x, F**(c*(a - b*d/e))*(-b*c*(d + e*x)*log(F)/e)**(-m*n)*((d + e*x)**n)**m*Gamma(m*n + S(1), -b*c*(d + e*x)*log(F)/e)/(b*c*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d**S(4) + S(4)*d**S(3)*e*x + S(6)*d**S(2)*e**S(2)*x**S(2) + S(4)*d*e**S(3)*x**S(3) + e**S(4)*x**S(4))**m, x), x, F**(c*(a - b*d/e))*(-b*c*(d + e*x)*log(F)/e)**(-S(4)*m)*((d + e*x)**S(4))**m*Gamma(S(4)*m + S(1), -b*c*(d + e*x)*log(F)/e)/(b*c*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d**S(3) + S(3)*d**S(2)*e*x + S(3)*d*e**S(2)*x**S(2) + e**S(3)*x**S(3))**m, x), x, F**(c*(a - b*d/e))*(-b*c*(d + e*x)*log(F)/e)**(-S(3)*m)*((d + e*x)**S(3))**m*Gamma(S(3)*m + S(1), -b*c*(d + e*x)*log(F)/e)/(b*c*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d**S(2) + S(2)*d*e*x + e**S(2)*x**S(2))**m, x), x, F**(c*(a - b*d/e))*(-b*c*(d + e*x)*log(F)/e)**(-S(2)*m)*((d + e*x)**S(2))**m*Gamma(S(2)*m + S(1), -b*c*(d + e*x)*log(F)/e)/(b*c*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x)**m, x), x, F**(c*(a - b*d/e))*(-b*c*(d + e*x)*log(F)/e)**(-m)*(d + e*x)**m*Gamma(m + S(1), -b*c*(d + e*x)*log(F)/e)/(b*c*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x)**(-m), x), x, F**(c*(a - b*d/e))*(-b*c*(d + e*x)*log(F)/e)**m*(d + e*x)**(-m)*Gamma(-m + S(1), -b*c*(d + e*x)*log(F)/e)/(b*c*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d**S(2) + S(2)*d*e*x + e**S(2)*x**S(2))**(-m), x), x, F**(c*(a - b*d/e))*(-b*c*(d + e*x)*log(F)/e)**(S(2)*m)*((d + e*x)**S(2))**(-m)*Gamma(-S(2)*m + S(1), -b*c*(d + e*x)*log(F)/e)/(b*c*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d**S(3) + S(3)*d**S(2)*e*x + S(3)*d*e**S(2)*x**S(2) + e**S(3)*x**S(3))**(-m), x), x, F**(c*(a - b*d/e))*(-b*c*(d + e*x)*log(F)/e)**(S(3)*m)*((d + e*x)**S(3))**(-m)*Gamma(-S(3)*m + S(1), -b*c*(d + e*x)*log(F)/e)/(b*c*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(S(5)*x + S(2)), x), x, F**(S(5)*x + S(2))/(S(5)*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*x), x), x, F**(a + b*x)/(b*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(10)**(S(5)*x + S(2)), x), x, S(2)**(S(5)*x + S(2))*S(5)**(S(5)*x + S(1))/log(S(10)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*x)*x**(S(7)/2), x), x, S(105)*sqrt(pi)*F**a*erfi(sqrt(b)*sqrt(x)*sqrt(log(F)))/(S(16)*b**(S(9)/2)*log(F)**(S(9)/2)) + F**(a + b*x)*x**(S(7)/2)/(b*log(F)) - S(7)*F**(a + b*x)*x**(S(5)/2)/(S(2)*b**S(2)*log(F)**S(2)) + S(35)*F**(a + b*x)*x**(S(3)/2)/(S(4)*b**S(3)*log(F)**S(3)) - S(105)*F**(a + b*x)*sqrt(x)/(S(8)*b**S(4)*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*x)*x**(S(5)/2), x), x, -S(15)*sqrt(pi)*F**a*erfi(sqrt(b)*sqrt(x)*sqrt(log(F)))/(S(8)*b**(S(7)/2)*log(F)**(S(7)/2)) + F**(a + b*x)*x**(S(5)/2)/(b*log(F)) - S(5)*F**(a + b*x)*x**(S(3)/2)/(S(2)*b**S(2)*log(F)**S(2)) + S(15)*F**(a + b*x)*sqrt(x)/(S(4)*b**S(3)*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*x)*x**(S(3)/2), x), x, S(3)*sqrt(pi)*F**a*erfi(sqrt(b)*sqrt(x)*sqrt(log(F)))/(S(4)*b**(S(5)/2)*log(F)**(S(5)/2)) + F**(a + b*x)*x**(S(3)/2)/(b*log(F)) - S(3)*F**(a + b*x)*sqrt(x)/(S(2)*b**S(2)*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*x)*sqrt(x), x), x, -sqrt(pi)*F**a*erfi(sqrt(b)*sqrt(x)*sqrt(log(F)))/(S(2)*b**(S(3)/2)*log(F)**(S(3)/2)) + F**(a + b*x)*sqrt(x)/(b*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*x)/sqrt(x), x), x, sqrt(pi)*F**a*erfi(sqrt(b)*sqrt(x)*sqrt(log(F)))/(sqrt(b)*sqrt(log(F))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*x)/x**(S(3)/2), x), x, S(2)*sqrt(pi)*F**a*sqrt(b)*sqrt(log(F))*erfi(sqrt(b)*sqrt(x)*sqrt(log(F))) - S(2)*F**(a + b*x)/sqrt(x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*x)/x**(S(5)/2), x), x, S(4)*sqrt(pi)*F**a*b**(S(3)/2)*log(F)**(S(3)/2)*erfi(sqrt(b)*sqrt(x)*sqrt(log(F)))/S(3) - S(4)*F**(a + b*x)*b*log(F)/(S(3)*sqrt(x)) - S(2)*F**(a + b*x)/(S(3)*x**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*x)/x**(S(7)/2), x), x, S(8)*sqrt(pi)*F**a*b**(S(5)/2)*log(F)**(S(5)/2)*erfi(sqrt(b)*sqrt(x)*sqrt(log(F)))/S(15) - S(8)*F**(a + b*x)*b**S(2)*log(F)**S(2)/(S(15)*sqrt(x)) - S(4)*F**(a + b*x)*b*log(F)/(S(15)*x**(S(3)/2)) - S(2)*F**(a + b*x)/(S(5)*x**(S(5)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*x)/x**(S(9)/2), x), x, S(16)*sqrt(pi)*F**a*b**(S(7)/2)*log(F)**(S(7)/2)*erfi(sqrt(b)*sqrt(x)*sqrt(log(F)))/S(105) - S(16)*F**(a + b*x)*b**S(3)*log(F)**S(3)/(S(105)*sqrt(x)) - S(8)*F**(a + b*x)*b**S(2)*log(F)**S(2)/(S(105)*x**(S(3)/2)) - S(4)*F**(a + b*x)*b*log(F)/(S(35)*x**(S(5)/2)) - S(2)*F**(a + b*x)/(S(7)*x**(S(7)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x)**(S(7)/2), x), x, F**(c*(a + b*x))*(d + e*x)**(S(7)/2)/(b*c*log(F)) - S(7)*F**(c*(a + b*x))*e*(d + e*x)**(S(5)/2)/(S(2)*b**S(2)*c**S(2)*log(F)**S(2)) + S(35)*F**(c*(a + b*x))*e**S(2)*(d + e*x)**(S(3)/2)/(S(4)*b**S(3)*c**S(3)*log(F)**S(3)) - S(105)*F**(c*(a + b*x))*e**S(3)*sqrt(d + e*x)/(S(8)*b**S(4)*c**S(4)*log(F)**S(4)) + S(105)*sqrt(pi)*F**(c*(a - b*d/e))*e**(S(7)/2)*erfi(sqrt(b)*sqrt(c)*sqrt(d + e*x)*sqrt(log(F))/sqrt(e))/(S(16)*b**(S(9)/2)*c**(S(9)/2)*log(F)**(S(9)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x)**(S(5)/2), x), x, F**(c*(a + b*x))*(d + e*x)**(S(5)/2)/(b*c*log(F)) - S(5)*F**(c*(a + b*x))*e*(d + e*x)**(S(3)/2)/(S(2)*b**S(2)*c**S(2)*log(F)**S(2)) + S(15)*F**(c*(a + b*x))*e**S(2)*sqrt(d + e*x)/(S(4)*b**S(3)*c**S(3)*log(F)**S(3)) - S(15)*sqrt(pi)*F**(c*(a - b*d/e))*e**(S(5)/2)*erfi(sqrt(b)*sqrt(c)*sqrt(d + e*x)*sqrt(log(F))/sqrt(e))/(S(8)*b**(S(7)/2)*c**(S(7)/2)*log(F)**(S(7)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x)**(S(3)/2), x), x, F**(c*(a + b*x))*(d + e*x)**(S(3)/2)/(b*c*log(F)) - S(3)*F**(c*(a + b*x))*e*sqrt(d + e*x)/(S(2)*b**S(2)*c**S(2)*log(F)**S(2)) + S(3)*sqrt(pi)*F**(c*(a - b*d/e))*e**(S(3)/2)*erfi(sqrt(b)*sqrt(c)*sqrt(d + e*x)*sqrt(log(F))/sqrt(e))/(S(4)*b**(S(5)/2)*c**(S(5)/2)*log(F)**(S(5)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*sqrt(d + e*x), x), x, F**(c*(a + b*x))*sqrt(d + e*x)/(b*c*log(F)) - sqrt(pi)*F**(c*(a - b*d/e))*sqrt(e)*erfi(sqrt(b)*sqrt(c)*sqrt(d + e*x)*sqrt(log(F))/sqrt(e))/(S(2)*b**(S(3)/2)*c**(S(3)/2)*log(F)**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/sqrt(d + e*x), x), x, sqrt(pi)*F**(c*(a - b*d/e))*erfi(sqrt(b)*sqrt(c)*sqrt(d + e*x)*sqrt(log(F))/sqrt(e))/(sqrt(b)*sqrt(c)*sqrt(e)*sqrt(log(F))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d + e*x)**(S(3)/2), x), x, -S(2)*F**(c*(a + b*x))/(e*sqrt(d + e*x)) + S(2)*sqrt(pi)*F**(c*(a - b*d/e))*sqrt(b)*sqrt(c)*sqrt(log(F))*erfi(sqrt(b)*sqrt(c)*sqrt(d + e*x)*sqrt(log(F))/sqrt(e))/e**(S(3)/2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d + e*x)**(S(5)/2), x), x, -S(4)*F**(c*(a + b*x))*b*c*log(F)/(S(3)*e**S(2)*sqrt(d + e*x)) - S(2)*F**(c*(a + b*x))/(S(3)*e*(d + e*x)**(S(3)/2)) + S(4)*sqrt(pi)*F**(c*(a - b*d/e))*b**(S(3)/2)*c**(S(3)/2)*log(F)**(S(3)/2)*erfi(sqrt(b)*sqrt(c)*sqrt(d + e*x)*sqrt(log(F))/sqrt(e))/(S(3)*e**(S(5)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d + e*x)**(S(7)/2), x), x, -S(8)*F**(c*(a + b*x))*b**S(2)*c**S(2)*log(F)**S(2)/(S(15)*e**S(3)*sqrt(d + e*x)) - S(4)*F**(c*(a + b*x))*b*c*log(F)/(S(15)*e**S(2)*(d + e*x)**(S(3)/2)) - S(2)*F**(c*(a + b*x))/(S(5)*e*(d + e*x)**(S(5)/2)) + S(8)*sqrt(pi)*F**(c*(a - b*d/e))*b**(S(5)/2)*c**(S(5)/2)*log(F)**(S(5)/2)*erfi(sqrt(b)*sqrt(c)*sqrt(d + e*x)*sqrt(log(F))/sqrt(e))/(S(15)*e**(S(7)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))/(d + e*x)**(S(9)/2), x), x, -S(16)*F**(c*(a + b*x))*b**S(3)*c**S(3)*log(F)**S(3)/(S(105)*e**S(4)*sqrt(d + e*x)) - S(8)*F**(c*(a + b*x))*b**S(2)*c**S(2)*log(F)**S(2)/(S(105)*e**S(3)*(d + e*x)**(S(3)/2)) - S(4)*F**(c*(a + b*x))*b*c*log(F)/(S(35)*e**S(2)*(d + e*x)**(S(5)/2)) - S(2)*F**(c*(a + b*x))/(S(7)*e*(d + e*x)**(S(7)/2)) + S(16)*sqrt(pi)*F**(c*(a - b*d/e))*b**(S(7)/2)*c**(S(7)/2)*log(F)**(S(7)/2)*erfi(sqrt(b)*sqrt(c)*sqrt(d + e*x)*sqrt(log(F))/sqrt(e))/(S(105)*e**(S(9)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**(S(13)/2)*exp(-b*x), x), x, -x**(S(13)/2)*exp(-b*x)/b - S(13)*x**(S(11)/2)*exp(-b*x)/(S(2)*b**S(2)) - S(143)*x**(S(9)/2)*exp(-b*x)/(S(4)*b**S(3)) - S(1287)*x**(S(7)/2)*exp(-b*x)/(S(8)*b**S(4)) - S(9009)*x**(S(5)/2)*exp(-b*x)/(S(16)*b**S(5)) - S(45045)*x**(S(3)/2)*exp(-b*x)/(S(32)*b**S(6)) - S(135135)*sqrt(x)*exp(-b*x)/(S(64)*b**S(7)) + S(135135)*sqrt(pi)*erf(sqrt(b)*sqrt(x))/(S(128)*b**(S(15)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x)**(S(4)/3), x), x, -F**(c*(a - b*d/e))*e*(d + e*x)**(S(1)/3)*Gamma(S(7)/3, -b*c*(d + e*x)*log(F)/e)/(b**S(2)*c**S(2)*(-b*c*(d + e*x)*log(F)/e)**(S(1)/3)*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((d + e*x)**(S(4)/3)*(F**(c*(a + b*x)))**n, x), x, -F**(-c*n*(a + b*x) + c*n*(a - b*d/e))*e*(d + e*x)**(S(1)/3)*(F**(c*(a + b*x)))**n*Gamma(S(7)/3, -b*c*n*(d + e*x)*log(F)/e)/(b**S(2)*c**S(2)*n**S(2)*(-b*c*n*(d + e*x)*log(F)/e)**(S(1)/3)*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x), x), x, F**(c*(a + b*x))*(d + e*x)/(b*c*log(F)) - F**(c*(a + b*x))*e/(b**S(2)*c**S(2)*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x + f*x**S(2)), x), x, F**(c*(a + b*x))*d/(b*c*log(F)) + F**(c*(a + b*x))*e*x/(b*c*log(F)) + F**(c*(a + b*x))*f*x**S(2)/(b*c*log(F)) - F**(c*(a + b*x))*e/(b**S(2)*c**S(2)*log(F)**S(2)) - S(2)*F**(c*(a + b*x))*f*x/(b**S(2)*c**S(2)*log(F)**S(2)) + S(2)*F**(c*(a + b*x))*f/(b**S(3)*c**S(3)*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x + f*x**S(2) + g*x**S(3)), x), x, F**(c*(a + b*x))*d/(b*c*log(F)) + F**(c*(a + b*x))*e*x/(b*c*log(F)) + F**(c*(a + b*x))*f*x**S(2)/(b*c*log(F)) + F**(c*(a + b*x))*g*x**S(3)/(b*c*log(F)) - F**(c*(a + b*x))*e/(b**S(2)*c**S(2)*log(F)**S(2)) - S(2)*F**(c*(a + b*x))*f*x/(b**S(2)*c**S(2)*log(F)**S(2)) - S(3)*F**(c*(a + b*x))*g*x**S(2)/(b**S(2)*c**S(2)*log(F)**S(2)) + S(2)*F**(c*(a + b*x))*f/(b**S(3)*c**S(3)*log(F)**S(3)) + S(6)*F**(c*(a + b*x))*g*x/(b**S(3)*c**S(3)*log(F)**S(3)) - S(6)*F**(c*(a + b*x))*g/(b**S(4)*c**S(4)*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(d + e*x + f*x**S(2) + g*x**S(3) + h*x**S(4)), x), x, F**(c*(a + b*x))*d/(b*c*log(F)) + F**(c*(a + b*x))*e*x/(b*c*log(F)) + F**(c*(a + b*x))*f*x**S(2)/(b*c*log(F)) + F**(c*(a + b*x))*g*x**S(3)/(b*c*log(F)) + F**(c*(a + b*x))*h*x**S(4)/(b*c*log(F)) - F**(c*(a + b*x))*e/(b**S(2)*c**S(2)*log(F)**S(2)) - S(2)*F**(c*(a + b*x))*f*x/(b**S(2)*c**S(2)*log(F)**S(2)) - S(3)*F**(c*(a + b*x))*g*x**S(2)/(b**S(2)*c**S(2)*log(F)**S(2)) - S(4)*F**(c*(a + b*x))*h*x**S(3)/(b**S(2)*c**S(2)*log(F)**S(2)) + S(2)*F**(c*(a + b*x))*f/(b**S(3)*c**S(3)*log(F)**S(3)) + S(6)*F**(c*(a + b*x))*g*x/(b**S(3)*c**S(3)*log(F)**S(3)) + S(12)*F**(c*(a + b*x))*h*x**S(2)/(b**S(3)*c**S(3)*log(F)**S(3)) - S(6)*F**(c*(a + b*x))*g/(b**S(4)*c**S(4)*log(F)**S(4)) - S(24)*F**(c*(a + b*x))*h*x/(b**S(4)*c**S(4)*log(F)**S(4)) + S(24)*F**(c*(a + b*x))*h/(b**S(5)*c**S(5)*log(F)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**m*(a + b*x)**S(3)*exp(-a - b*x), x), x, -a**S(3)*x**m*(b*x)**(-m)*Gamma(m + S(1), b*x)*exp(-a)/b - S(3)*a**S(2)*x**m*(b*x)**(-m)*Gamma(m + S(2), b*x)*exp(-a)/b - S(3)*a*x**m*(b*x)**(-m)*Gamma(m + S(3), b*x)*exp(-a)/b - x**m*(b*x)**(-m)*Gamma(m + S(4), b*x)*exp(-a)/b, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*(a + b*x)**S(3)*exp(-a - b*x), x), x, -a**S(3)*x**S(3)*exp(-a - b*x)/b - S(3)*a**S(3)*x**S(2)*exp(-a - b*x)/b**S(2) - S(6)*a**S(3)*x*exp(-a - b*x)/b**S(3) - S(6)*a**S(3)*exp(-a - b*x)/b**S(4) - S(3)*a**S(2)*x**S(4)*exp(-a - b*x) - S(12)*a**S(2)*x**S(3)*exp(-a - b*x)/b - S(36)*a**S(2)*x**S(2)*exp(-a - b*x)/b**S(2) - S(72)*a**S(2)*x*exp(-a - b*x)/b**S(3) - S(72)*a**S(2)*exp(-a - b*x)/b**S(4) - S(3)*a*b*x**S(5)*exp(-a - b*x) - S(15)*a*x**S(4)*exp(-a - b*x) - S(60)*a*x**S(3)*exp(-a - b*x)/b - S(180)*a*x**S(2)*exp(-a - b*x)/b**S(2) - S(360)*a*x*exp(-a - b*x)/b**S(3) - S(360)*a*exp(-a - b*x)/b**S(4) - b**S(2)*x**S(6)*exp(-a - b*x) - S(6)*b*x**S(5)*exp(-a - b*x) - S(30)*x**S(4)*exp(-a - b*x) - S(120)*x**S(3)*exp(-a - b*x)/b - S(360)*x**S(2)*exp(-a - b*x)/b**S(2) - S(720)*x*exp(-a - b*x)/b**S(3) - S(720)*exp(-a - b*x)/b**S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*(a + b*x)**S(3)*exp(-a - b*x), x), x, -a**S(3)*x**S(2)*exp(-a - b*x)/b - S(2)*a**S(3)*x*exp(-a - b*x)/b**S(2) - S(2)*a**S(3)*exp(-a - b*x)/b**S(3) - S(3)*a**S(2)*x**S(3)*exp(-a - b*x) - S(9)*a**S(2)*x**S(2)*exp(-a - b*x)/b - S(18)*a**S(2)*x*exp(-a - b*x)/b**S(2) - S(18)*a**S(2)*exp(-a - b*x)/b**S(3) - S(3)*a*b*x**S(4)*exp(-a - b*x) - S(12)*a*x**S(3)*exp(-a - b*x) - S(36)*a*x**S(2)*exp(-a - b*x)/b - S(72)*a*x*exp(-a - b*x)/b**S(2) - S(72)*a*exp(-a - b*x)/b**S(3) - b**S(2)*x**S(5)*exp(-a - b*x) - S(5)*b*x**S(4)*exp(-a - b*x) - S(20)*x**S(3)*exp(-a - b*x) - S(60)*x**S(2)*exp(-a - b*x)/b - S(120)*x*exp(-a - b*x)/b**S(2) - S(120)*exp(-a - b*x)/b**S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*(a + b*x)**S(3)*exp(-a - b*x), x), x, a*(a + b*x)**S(3)*exp(-a - b*x)/b**S(2) + S(3)*a*(a + b*x)**S(2)*exp(-a - b*x)/b**S(2) + S(6)*a*(a + b*x)*exp(-a - b*x)/b**S(2) + S(6)*a*exp(-a - b*x)/b**S(2) - (a + b*x)**S(4)*exp(-a - b*x)/b**S(2) - S(4)*(a + b*x)**S(3)*exp(-a - b*x)/b**S(2) - S(12)*(a + b*x)**S(2)*exp(-a - b*x)/b**S(2) - S(24)*(a + b*x)*exp(-a - b*x)/b**S(2) - S(24)*exp(-a - b*x)/b**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(3)*exp(-a - b*x), x), x, -(a + b*x)**S(3)*exp(-a - b*x)/b - S(3)*(a + b*x)**S(2)*exp(-a - b*x)/b - S(6)*(a + b*x)*exp(-a - b*x)/b - S(6)*exp(-a - b*x)/b, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(3)*exp(-a - b*x)/x, x), x, a**S(3)*exp(-a)*Ei(-b*x) - S(3)*a**S(2)*exp(-a - b*x) - S(3)*a*b*x*exp(-a - b*x) - S(3)*a*exp(-a - b*x) - b**S(2)*x**S(2)*exp(-a - b*x) - S(2)*b*x*exp(-a - b*x) - S(2)*exp(-a - b*x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(3)*exp(-a - b*x)/x**S(2), x), x, -a**S(3)*b*exp(-a)*Ei(-b*x) - a**S(3)*exp(-a - b*x)/x + S(3)*a**S(2)*b*exp(-a)*Ei(-b*x) - S(3)*a*b*exp(-a - b*x) - b**S(2)*x*exp(-a - b*x) - b*exp(-a - b*x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(3)*exp(-a - b*x)/x**S(3), x), x, a**S(3)*b**S(2)*exp(-a)*Ei(-b*x)/S(2) + a**S(3)*b*exp(-a - b*x)/(S(2)*x) - a**S(3)*exp(-a - b*x)/(S(2)*x**S(2)) - S(3)*a**S(2)*b**S(2)*exp(-a)*Ei(-b*x) - S(3)*a**S(2)*b*exp(-a - b*x)/x + S(3)*a*b**S(2)*exp(-a)*Ei(-b*x) - b**S(2)*exp(-a - b*x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(3)*exp(-a - b*x)/x**S(4), x), x, -a**S(3)*b**S(3)*exp(-a)*Ei(-b*x)/S(6) - a**S(3)*b**S(2)*exp(-a - b*x)/(S(6)*x) + a**S(3)*b*exp(-a - b*x)/(S(6)*x**S(2)) - a**S(3)*exp(-a - b*x)/(S(3)*x**S(3)) + S(3)*a**S(2)*b**S(3)*exp(-a)*Ei(-b*x)/S(2) + S(3)*a**S(2)*b**S(2)*exp(-a - b*x)/(S(2)*x) - S(3)*a**S(2)*b*exp(-a - b*x)/(S(2)*x**S(2)) - S(3)*a*b**S(3)*exp(-a)*Ei(-b*x) - S(3)*a*b**S(2)*exp(-a - b*x)/x + b**S(3)*exp(-a)*Ei(-b*x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x))*x**m*(e + f*x)**S(2), x), x, F**(a + b*c)*e**S(2)*x**m*(-b*d*x*log(F))**(-m)*Gamma(m + S(1), -b*d*x*log(F))/(b*d*log(F)) - S(2)*F**(a + b*c)*e*f*x**m*(-b*d*x*log(F))**(-m)*Gamma(m + S(2), -b*d*x*log(F))/(b**S(2)*d**S(2)*log(F)**S(2)) + F**(a + b*c)*f**S(2)*x**m*(-b*d*x*log(F))**(-m)*Gamma(m + S(3), -b*d*x*log(F))/(b**S(3)*d**S(3)*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x))*x**S(3)*(e + f*x)**S(2), x), x, F**(a + b*c + b*d*x)*e**S(2)*x**S(3)/(b*d*log(F)) + S(2)*F**(a + b*c + b*d*x)*e*f*x**S(4)/(b*d*log(F)) + F**(a + b*c + b*d*x)*f**S(2)*x**S(5)/(b*d*log(F)) - S(3)*F**(a + b*c + b*d*x)*e**S(2)*x**S(2)/(b**S(2)*d**S(2)*log(F)**S(2)) - S(8)*F**(a + b*c + b*d*x)*e*f*x**S(3)/(b**S(2)*d**S(2)*log(F)**S(2)) - S(5)*F**(a + b*c + b*d*x)*f**S(2)*x**S(4)/(b**S(2)*d**S(2)*log(F)**S(2)) + S(6)*F**(a + b*c + b*d*x)*e**S(2)*x/(b**S(3)*d**S(3)*log(F)**S(3)) + S(24)*F**(a + b*c + b*d*x)*e*f*x**S(2)/(b**S(3)*d**S(3)*log(F)**S(3)) + S(20)*F**(a + b*c + b*d*x)*f**S(2)*x**S(3)/(b**S(3)*d**S(3)*log(F)**S(3)) - S(6)*F**(a + b*c + b*d*x)*e**S(2)/(b**S(4)*d**S(4)*log(F)**S(4)) - S(48)*F**(a + b*c + b*d*x)*e*f*x/(b**S(4)*d**S(4)*log(F)**S(4)) - S(60)*F**(a + b*c + b*d*x)*f**S(2)*x**S(2)/(b**S(4)*d**S(4)*log(F)**S(4)) + S(48)*F**(a + b*c + b*d*x)*e*f/(b**S(5)*d**S(5)*log(F)**S(5)) + S(120)*F**(a + b*c + b*d*x)*f**S(2)*x/(b**S(5)*d**S(5)*log(F)**S(5)) - S(120)*F**(a + b*c + b*d*x)*f**S(2)/(b**S(6)*d**S(6)*log(F)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x))*x**S(2)*(e + f*x)**S(2), x), x, F**(a + b*c + b*d*x)*e**S(2)*x**S(2)/(b*d*log(F)) + S(2)*F**(a + b*c + b*d*x)*e*f*x**S(3)/(b*d*log(F)) + F**(a + b*c + b*d*x)*f**S(2)*x**S(4)/(b*d*log(F)) - S(2)*F**(a + b*c + b*d*x)*e**S(2)*x/(b**S(2)*d**S(2)*log(F)**S(2)) - S(6)*F**(a + b*c + b*d*x)*e*f*x**S(2)/(b**S(2)*d**S(2)*log(F)**S(2)) - S(4)*F**(a + b*c + b*d*x)*f**S(2)*x**S(3)/(b**S(2)*d**S(2)*log(F)**S(2)) + S(2)*F**(a + b*c + b*d*x)*e**S(2)/(b**S(3)*d**S(3)*log(F)**S(3)) + S(12)*F**(a + b*c + b*d*x)*e*f*x/(b**S(3)*d**S(3)*log(F)**S(3)) + S(12)*F**(a + b*c + b*d*x)*f**S(2)*x**S(2)/(b**S(3)*d**S(3)*log(F)**S(3)) - S(12)*F**(a + b*c + b*d*x)*e*f/(b**S(4)*d**S(4)*log(F)**S(4)) - S(24)*F**(a + b*c + b*d*x)*f**S(2)*x/(b**S(4)*d**S(4)*log(F)**S(4)) + S(24)*F**(a + b*c + b*d*x)*f**S(2)/(b**S(5)*d**S(5)*log(F)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x))*x*(e + f*x)**S(2), x), x, F**(a + b*c + b*d*x)*e**S(2)*x/(b*d*log(F)) + S(2)*F**(a + b*c + b*d*x)*e*f*x**S(2)/(b*d*log(F)) + F**(a + b*c + b*d*x)*f**S(2)*x**S(3)/(b*d*log(F)) - F**(a + b*c + b*d*x)*e**S(2)/(b**S(2)*d**S(2)*log(F)**S(2)) - S(4)*F**(a + b*c + b*d*x)*e*f*x/(b**S(2)*d**S(2)*log(F)**S(2)) - S(3)*F**(a + b*c + b*d*x)*f**S(2)*x**S(2)/(b**S(2)*d**S(2)*log(F)**S(2)) + S(4)*F**(a + b*c + b*d*x)*e*f/(b**S(3)*d**S(3)*log(F)**S(3)) + S(6)*F**(a + b*c + b*d*x)*f**S(2)*x/(b**S(3)*d**S(3)*log(F)**S(3)) - S(6)*F**(a + b*c + b*d*x)*f**S(2)/(b**S(4)*d**S(4)*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x))*(e + f*x)**S(2), x), x, F**(a + b*c + b*d*x)*(e + f*x)**S(2)/(b*d*log(F)) - S(2)*F**(a + b*c + b*d*x)*f*(e + f*x)/(b**S(2)*d**S(2)*log(F)**S(2)) + S(2)*F**(a + b*c + b*d*x)*f**S(2)/(b**S(3)*d**S(3)*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x))*(e + f*x)**S(2)/x, x), x, F**(a + b*c)*e**S(2)*Ei(b*d*x*log(F)) + S(2)*F**(a + b*c + b*d*x)*e*f/(b*d*log(F)) + F**(a + b*c + b*d*x)*f**S(2)*x/(b*d*log(F)) - F**(a + b*c + b*d*x)*f**S(2)/(b**S(2)*d**S(2)*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x))*(e + f*x)**S(2)/x**S(2), x), x, F**(a + b*c)*b*d*e**S(2)*log(F)*Ei(b*d*x*log(F)) + S(2)*F**(a + b*c)*e*f*Ei(b*d*x*log(F)) - F**(a + b*c + b*d*x)*e**S(2)/x + F**(a + b*c + b*d*x)*f**S(2)/(b*d*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x))*(e + f*x)**S(2)/x**S(3), x), x, F**(a + b*c)*b**S(2)*d**S(2)*e**S(2)*log(F)**S(2)*Ei(b*d*x*log(F))/S(2) + S(2)*F**(a + b*c)*b*d*e*f*log(F)*Ei(b*d*x*log(F)) + F**(a + b*c)*f**S(2)*Ei(b*d*x*log(F)) - F**(a + b*c + b*d*x)*b*d*e**S(2)*log(F)/(S(2)*x) - F**(a + b*c + b*d*x)*e**S(2)/(S(2)*x**S(2)) - S(2)*F**(a + b*c + b*d*x)*e*f/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x))*(e + f*x)**S(2)/x**S(4), x), x, F**(a + b*c)*b**S(3)*d**S(3)*e**S(2)*log(F)**S(3)*Ei(b*d*x*log(F))/S(6) + F**(a + b*c)*b**S(2)*d**S(2)*e*f*log(F)**S(2)*Ei(b*d*x*log(F)) + F**(a + b*c)*b*d*f**S(2)*log(F)*Ei(b*d*x*log(F)) - F**(a + b*c + b*d*x)*b**S(2)*d**S(2)*e**S(2)*log(F)**S(2)/(S(6)*x) - F**(a + b*c + b*d*x)*b*d*e**S(2)*log(F)/(S(6)*x**S(2)) - F**(a + b*c + b*d*x)*b*d*e*f*log(F)/x - F**(a + b*c + b*d*x)*e**S(2)/(S(3)*x**S(3)) - F**(a + b*c + b*d*x)*e*f/x**S(2) - F**(a + b*c + b*d*x)*f**S(2)/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x))*(e + f*x)**S(2)/x**S(5), x), x, F**(a + b*c)*b**S(4)*d**S(4)*e**S(2)*log(F)**S(4)*Ei(b*d*x*log(F))/S(24) + F**(a + b*c)*b**S(3)*d**S(3)*e*f*log(F)**S(3)*Ei(b*d*x*log(F))/S(3) + F**(a + b*c)*b**S(2)*d**S(2)*f**S(2)*log(F)**S(2)*Ei(b*d*x*log(F))/S(2) - F**(a + b*c + b*d*x)*b**S(3)*d**S(3)*e**S(2)*log(F)**S(3)/(S(24)*x) - F**(a + b*c + b*d*x)*b**S(2)*d**S(2)*e**S(2)*log(F)**S(2)/(S(24)*x**S(2)) - F**(a + b*c + b*d*x)*b**S(2)*d**S(2)*e*f*log(F)**S(2)/(S(3)*x) - F**(a + b*c + b*d*x)*b*d*e**S(2)*log(F)/(S(12)*x**S(3)) - F**(a + b*c + b*d*x)*b*d*e*f*log(F)/(S(3)*x**S(2)) - F**(a + b*c + b*d*x)*b*d*f**S(2)*log(F)/(S(2)*x) - F**(a + b*c + b*d*x)*e**S(2)/(S(4)*x**S(4)) - S(2)*F**(a + b*c + b*d*x)*e*f/(S(3)*x**S(3)) - F**(a + b*c + b*d*x)*f**S(2)/(S(2)*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(4)*(c + d*x)**S(3)*exp(-a - b*x), x), x, -d**S(3)*(a + b*x)**S(7)*exp(-a - b*x)/b**S(4) - S(7)*d**S(3)*(a + b*x)**S(6)*exp(-a - b*x)/b**S(4) - S(42)*d**S(3)*(a + b*x)**S(5)*exp(-a - b*x)/b**S(4) - S(210)*d**S(3)*(a + b*x)**S(4)*exp(-a - b*x)/b**S(4) - S(840)*d**S(3)*(a + b*x)**S(3)*exp(-a - b*x)/b**S(4) - S(2520)*d**S(3)*(a + b*x)**S(2)*exp(-a - b*x)/b**S(4) - S(5040)*d**S(3)*(a + b*x)*exp(-a - b*x)/b**S(4) - S(5040)*d**S(3)*exp(-a - b*x)/b**S(4) - S(3)*d**S(2)*(a + b*x)**S(6)*(-a*d + b*c)*exp(-a - b*x)/b**S(4) - S(18)*d**S(2)*(a + b*x)**S(5)*(-a*d + b*c)*exp(-a - b*x)/b**S(4) - S(90)*d**S(2)*(a + b*x)**S(4)*(-a*d + b*c)*exp(-a - b*x)/b**S(4) - S(360)*d**S(2)*(a + b*x)**S(3)*(-a*d + b*c)*exp(-a - b*x)/b**S(4) - S(1080)*d**S(2)*(a + b*x)**S(2)*(-a*d + b*c)*exp(-a - b*x)/b**S(4) - S(2160)*d**S(2)*(a + b*x)*(-a*d + b*c)*exp(-a - b*x)/b**S(4) - S(2160)*d**S(2)*(-a*d + b*c)*exp(-a - b*x)/b**S(4) - S(3)*d*(a + b*x)**S(5)*(-a*d + b*c)**S(2)*exp(-a - b*x)/b**S(4) - S(15)*d*(a + b*x)**S(4)*(-a*d + b*c)**S(2)*exp(-a - b*x)/b**S(4) - S(60)*d*(a + b*x)**S(3)*(-a*d + b*c)**S(2)*exp(-a - b*x)/b**S(4) - S(180)*d*(a + b*x)**S(2)*(-a*d + b*c)**S(2)*exp(-a - b*x)/b**S(4) - S(360)*d*(a + b*x)*(-a*d + b*c)**S(2)*exp(-a - b*x)/b**S(4) - S(360)*d*(-a*d + b*c)**S(2)*exp(-a - b*x)/b**S(4) - (a + b*x)**S(4)*(-a*d + b*c)**S(3)*exp(-a - b*x)/b**S(4) - S(4)*(a + b*x)**S(3)*(-a*d + b*c)**S(3)*exp(-a - b*x)/b**S(4) - S(12)*(a + b*x)**S(2)*(-a*d + b*c)**S(3)*exp(-a - b*x)/b**S(4) - S(24)*(a + b*x)*(-a*d + b*c)**S(3)*exp(-a - b*x)/b**S(4) - S(24)*(-a*d + b*c)**S(3)*exp(-a - b*x)/b**S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(4)*(c + d*x)**S(2)*exp(-a - b*x), x), x, -d**S(2)*(a + b*x)**S(6)*exp(-a - b*x)/b**S(3) - S(6)*d**S(2)*(a + b*x)**S(5)*exp(-a - b*x)/b**S(3) - S(30)*d**S(2)*(a + b*x)**S(4)*exp(-a - b*x)/b**S(3) - S(120)*d**S(2)*(a + b*x)**S(3)*exp(-a - b*x)/b**S(3) - S(360)*d**S(2)*(a + b*x)**S(2)*exp(-a - b*x)/b**S(3) - S(720)*d**S(2)*(a + b*x)*exp(-a - b*x)/b**S(3) - S(720)*d**S(2)*exp(-a - b*x)/b**S(3) - S(2)*d*(a + b*x)**S(5)*(-a*d + b*c)*exp(-a - b*x)/b**S(3) - S(10)*d*(a + b*x)**S(4)*(-a*d + b*c)*exp(-a - b*x)/b**S(3) - S(40)*d*(a + b*x)**S(3)*(-a*d + b*c)*exp(-a - b*x)/b**S(3) - S(120)*d*(a + b*x)**S(2)*(-a*d + b*c)*exp(-a - b*x)/b**S(3) - S(240)*d*(a + b*x)*(-a*d + b*c)*exp(-a - b*x)/b**S(3) - S(240)*d*(-a*d + b*c)*exp(-a - b*x)/b**S(3) - (a + b*x)**S(4)*(-a*d + b*c)**S(2)*exp(-a - b*x)/b**S(3) - S(4)*(a + b*x)**S(3)*(-a*d + b*c)**S(2)*exp(-a - b*x)/b**S(3) - S(12)*(a + b*x)**S(2)*(-a*d + b*c)**S(2)*exp(-a - b*x)/b**S(3) - S(24)*(a + b*x)*(-a*d + b*c)**S(2)*exp(-a - b*x)/b**S(3) - S(24)*(-a*d + b*c)**S(2)*exp(-a - b*x)/b**S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(4)*(c + d*x)*exp(-a - b*x), x), x, -d*(a + b*x)**S(5)*exp(-a - b*x)/b**S(2) - S(5)*d*(a + b*x)**S(4)*exp(-a - b*x)/b**S(2) - S(20)*d*(a + b*x)**S(3)*exp(-a - b*x)/b**S(2) - S(60)*d*(a + b*x)**S(2)*exp(-a - b*x)/b**S(2) - S(120)*d*(a + b*x)*exp(-a - b*x)/b**S(2) - S(120)*d*exp(-a - b*x)/b**S(2) - (a + b*x)**S(4)*(-a*d + b*c)*exp(-a - b*x)/b**S(2) - (a + b*x)**S(3)*(-S(4)*a*d + S(4)*b*c)*exp(-a - b*x)/b**S(2) - (a + b*x)**S(2)*(-S(12)*a*d + S(12)*b*c)*exp(-a - b*x)/b**S(2) - (a + b*x)*(-S(24)*a*d + S(24)*b*c)*exp(-a - b*x)/b**S(2) - (-S(24)*a*d + S(24)*b*c)*exp(-a - b*x)/b**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(4)*exp(-a - b*x), x), x, -(a + b*x)**S(4)*exp(-a - b*x)/b - S(4)*(a + b*x)**S(3)*exp(-a - b*x)/b - S(12)*(a + b*x)**S(2)*exp(-a - b*x)/b - S(24)*(a + b*x)*exp(-a - b*x)/b - S(24)*exp(-a - b*x)/b, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(4)*exp(-a - b*x)/(c + d*x), x), x, -(a + b*x)**S(3)*exp(-a - b*x)/d - S(3)*(a + b*x)**S(2)*exp(-a - b*x)/d - S(6)*(a + b*x)*exp(-a - b*x)/d - S(6)*exp(-a - b*x)/d + (a + b*x)**S(2)*(-a*d + b*c)*exp(-a - b*x)/d**S(2) + (a + b*x)*(-S(2)*a*d + S(2)*b*c)*exp(-a - b*x)/d**S(2) + (-S(2)*a*d + S(2)*b*c)*exp(-a - b*x)/d**S(2) - (a + b*x)*(-a*d + b*c)**S(2)*exp(-a - b*x)/d**S(3) - (-a*d + b*c)**S(2)*exp(-a - b*x)/d**S(3) + (-a*d + b*c)**S(3)*exp(-a - b*x)/d**S(4) + (-a*d + b*c)**S(4)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/d**S(5), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(4)*exp(-a - b*x)/(c + d*x)**S(2), x), x, -b**S(3)*(c + d*x)**S(2)*exp(-a - b*x)/d**S(4) - S(2)*b**S(2)*(c + d*x)*exp(-a - b*x)/d**S(3) + S(4)*b**S(2)*(c + d*x)*(-a*d + b*c)*exp(-a - b*x)/d**S(4) - S(2)*b*exp(-a - b*x)/d**S(2) + S(4)*b*(-a*d + b*c)*exp(-a - b*x)/d**S(3) - S(6)*b*(-a*d + b*c)**S(2)*exp(-a - b*x)/d**S(4) - S(4)*b*(-a*d + b*c)**S(3)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/d**S(5) - b*(-a*d + b*c)**S(4)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/d**S(6) - (-a*d + b*c)**S(4)*exp(-a - b*x)/(d**S(5)*(c + d*x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(4)*exp(-a - b*x)/(c + d*x)**S(3), x), x, -b**S(3)*x*exp(-a - b*x)/d**S(3) - b**S(2)*exp(-a - b*x)/d**S(3) + b**S(2)*(-S(4)*a*d + S(3)*b*c)*exp(-a - b*x)/d**S(4) + S(6)*b**S(2)*(-a*d + b*c)**S(2)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/d**S(5) + S(4)*b**S(2)*(-a*d + b*c)**S(3)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/d**S(6) + b**S(2)*(-a*d + b*c)**S(4)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/(S(2)*d**S(7)) + S(4)*b*(-a*d + b*c)**S(3)*exp(-a - b*x)/(d**S(5)*(c + d*x)) + b*(-a*d + b*c)**S(4)*exp(-a - b*x)/(S(2)*d**S(6)*(c + d*x)) - (-a*d + b*c)**S(4)*exp(-a - b*x)/(S(2)*d**S(5)*(c + d*x)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(4)*exp(-a - b*x)/(c + d*x)**S(4), x), x, -b**S(3)*exp(-a - b*x)/d**S(4) - S(4)*b**S(3)*(-a*d + b*c)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/d**S(5) - S(6)*b**S(3)*(-a*d + b*c)**S(2)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/d**S(6) - S(2)*b**S(3)*(-a*d + b*c)**S(3)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/d**S(7) - b**S(3)*(-a*d + b*c)**S(4)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/(S(6)*d**S(8)) - S(6)*b**S(2)*(-a*d + b*c)**S(2)*exp(-a - b*x)/(d**S(5)*(c + d*x)) - S(2)*b**S(2)*(-a*d + b*c)**S(3)*exp(-a - b*x)/(d**S(6)*(c + d*x)) - b**S(2)*(-a*d + b*c)**S(4)*exp(-a - b*x)/(S(6)*d**S(7)*(c + d*x)) + S(2)*b*(-a*d + b*c)**S(3)*exp(-a - b*x)/(d**S(5)*(c + d*x)**S(2)) + b*(-a*d + b*c)**S(4)*exp(-a - b*x)/(S(6)*d**S(6)*(c + d*x)**S(2)) - (-a*d + b*c)**S(4)*exp(-a - b*x)/(S(3)*d**S(5)*(c + d*x)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(4)*exp(-a - b*x)/(c + d*x)**S(5), x), x, b**S(4)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/d**S(5) + S(4)*b**S(4)*(-a*d + b*c)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/d**S(6) + S(3)*b**S(4)*(-a*d + b*c)**S(2)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/d**S(7) + S(2)*b**S(4)*(-a*d + b*c)**S(3)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/(S(3)*d**S(8)) + b**S(4)*(-a*d + b*c)**S(4)*exp(-a + b*c/d)*Ei(-b*(c + d*x)/d)/(S(24)*d**S(9)) + S(4)*b**S(3)*(-a*d + b*c)*exp(-a - b*x)/(d**S(5)*(c + d*x)) + S(3)*b**S(3)*(-a*d + b*c)**S(2)*exp(-a - b*x)/(d**S(6)*(c + d*x)) + S(2)*b**S(3)*(-a*d + b*c)**S(3)*exp(-a - b*x)/(S(3)*d**S(7)*(c + d*x)) + b**S(3)*(-a*d + b*c)**S(4)*exp(-a - b*x)/(S(24)*d**S(8)*(c + d*x)) - S(3)*b**S(2)*(-a*d + b*c)**S(2)*exp(-a - b*x)/(d**S(5)*(c + d*x)**S(2)) - S(2)*b**S(2)*(-a*d + b*c)**S(3)*exp(-a - b*x)/(S(3)*d**S(6)*(c + d*x)**S(2)) - b**S(2)*(-a*d + b*c)**S(4)*exp(-a - b*x)/(S(24)*d**S(7)*(c + d*x)**S(2)) + S(4)*b*(-a*d + b*c)**S(3)*exp(-a - b*x)/(S(3)*d**S(5)*(c + d*x)**S(3)) + b*(-a*d + b*c)**S(4)*exp(-a - b*x)/(S(12)*d**S(6)*(c + d*x)**S(3)) - (-a*d + b*c)**S(4)*exp(-a - b*x)/(S(4)*d**S(5)*(c + d*x)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*x**m*(e*n + e*(b*c*x*log(F) + m + S(1))*log(d*x) + e)*log(d*x)**n, x), x, F**(c*(a + b*x))*e*x**(m + S(1))*log(d*x)**(n + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*x**S(2)*(e*n + e*(b*c*x*log(F) + S(3))*log(d*x) + e)*log(d*x)**n, x), x, F**(c*(a + b*x))*e*x**S(3)*log(d*x)**(n + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*x*(e*n + e*(b*c*x*log(F) + S(2))*log(d*x) + e)*log(d*x)**n, x), x, F**(c*(a + b*x))*e*x**S(2)*log(d*x)**(n + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(e*n + e*(b*c*x*log(F) + S(1))*log(d*x) + e)*log(d*x)**n, x), x, F**(c*(a + b*x))*e*x*log(d*x)**(n + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(b*c*e*x*log(F)*log(d*x) + e*n + e)*log(d*x)**n/x, x), x, F**(c*(a + b*x))*e*log(d*x)**(n + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(e*n + e*(b*c*x*log(F) + S(-1))*log(d*x) + e)*log(d*x)**n/x**S(2), x), x, F**(c*(a + b*x))*e*log(d*x)**(n + S(1))/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x))*(e*n + e*(b*c*x*log(F) + S(-2))*log(d*x) + e)*log(d*x)**n/x**S(3), x), x, F**(c*(a + b*x))*e*log(d*x)**(n + S(1))/x**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(4)*sqrt(exp(a + b*x)), x), x, S(2)*x**S(4)*sqrt(exp(a + b*x))/b - S(16)*x**S(3)*sqrt(exp(a + b*x))/b**S(2) + S(96)*x**S(2)*sqrt(exp(a + b*x))/b**S(3) - S(384)*x*sqrt(exp(a + b*x))/b**S(4) + S(768)*sqrt(exp(a + b*x))/b**S(5), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*sqrt(exp(a + b*x)), x), x, S(2)*x**S(3)*sqrt(exp(a + b*x))/b - S(12)*x**S(2)*sqrt(exp(a + b*x))/b**S(2) + S(48)*x*sqrt(exp(a + b*x))/b**S(3) - S(96)*sqrt(exp(a + b*x))/b**S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*sqrt(exp(a + b*x)), x), x, S(2)*x**S(2)*sqrt(exp(a + b*x))/b - S(8)*x*sqrt(exp(a + b*x))/b**S(2) + S(16)*sqrt(exp(a + b*x))/b**S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*sqrt(exp(a + b*x)), x), x, S(2)*x*sqrt(exp(a + b*x))/b - S(4)*sqrt(exp(a + b*x))/b**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(exp(a + b*x)), x), x, S(2)*sqrt(exp(a + b*x))/b, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(exp(a + b*x))/x, x), x, exp(-b*x/S(2))*sqrt(exp(a + b*x))*Ei(b*x/S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(exp(a + b*x))/x**S(2), x), x, b*exp(-b*x/S(2))*sqrt(exp(a + b*x))*Ei(b*x/S(2))/S(2) - sqrt(exp(a + b*x))/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(exp(a + b*x))/x**S(3), x), x, b**S(2)*exp(-b*x/S(2))*sqrt(exp(a + b*x))*Ei(b*x/S(2))/S(8) - b*sqrt(exp(a + b*x))/(S(4)*x) - sqrt(exp(a + b*x))/(S(2)*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(exp(a + b*x))/x**S(4), x), x, b**S(3)*exp(-b*x/S(2))*sqrt(exp(a + b*x))*Ei(b*x/S(2))/S(48) - b**S(2)*sqrt(exp(a + b*x))/(S(24)*x) - b*sqrt(exp(a + b*x))/(S(12)*x**S(2)) - sqrt(exp(a + b*x))/(S(3)*x**S(3)), expand=True, _diff=True, _numerical=True) def test_2(): assert rubi_test(rubi_integrate(f**(c + d*x)*x**S(3)/(a + b*f**(c + d*x)), x), x, x**S(3)*log(S(1) + b*f**(c + d*x)/a)/(b*d*log(f)) + S(3)*x**S(2)*polylog(S(2), -b*f**(c + d*x)/a)/(b*d**S(2)*log(f)**S(2)) - S(6)*x*polylog(S(3), -b*f**(c + d*x)/a)/(b*d**S(3)*log(f)**S(3)) + S(6)*polylog(S(4), -b*f**(c + d*x)/a)/(b*d**S(4)*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)*x**S(2)/(a + b*f**(c + d*x)), x), x, x**S(2)*log(S(1) + b*f**(c + d*x)/a)/(b*d*log(f)) + S(2)*x*polylog(S(2), -b*f**(c + d*x)/a)/(b*d**S(2)*log(f)**S(2)) - S(2)*polylog(S(3), -b*f**(c + d*x)/a)/(b*d**S(3)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)*x/(a + b*f**(c + d*x)), x), x, x*log(S(1) + b*f**(c + d*x)/a)/(b*d*log(f)) + polylog(S(2), -b*f**(c + d*x)/a)/(b*d**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)/(a + b*f**(c + d*x)), x), x, log(a + b*f**(c + d*x))/(b*d*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)/(x*(a + b*f**(c + d*x))), x), x, Integral(f**(c + d*x)/(x*(a + b*f**(c + d*x))), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)/(x**S(2)*(a + b*f**(c + d*x))), x), x, Integral(f**(c + d*x)/(x**S(2)*(a + b*f**(c + d*x))), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)*x**S(3)/(a + b*f**(c + d*x))**S(2), x), x, -x**S(3)/(b*d*(a + b*f**(c + d*x))*log(f)) - S(3)*x**S(2)*log(a*f**(-c - d*x)/b + S(1))/(a*b*d**S(2)*log(f)**S(2)) + S(6)*x*polylog(S(2), -a*f**(-c - d*x)/b)/(a*b*d**S(3)*log(f)**S(3)) + S(6)*polylog(S(3), -a*f**(-c - d*x)/b)/(a*b*d**S(4)*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)*x**S(2)/(a + b*f**(c + d*x))**S(2), x), x, -x**S(2)/(b*d*(a + b*f**(c + d*x))*log(f)) - S(2)*x*log(a*f**(-c - d*x)/b + S(1))/(a*b*d**S(2)*log(f)**S(2)) + S(2)*polylog(S(2), -a*f**(-c - d*x)/b)/(a*b*d**S(3)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)*x/(a + b*f**(c + d*x))**S(2), x), x, -x/(b*d*(a + b*f**(c + d*x))*log(f)) + x/(a*b*d*log(f)) - log(a + b*f**(c + d*x))/(a*b*d**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)/(a + b*f**(c + d*x))**S(2), x), x, -S(1)/(b*d*(a + b*f**(c + d*x))*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)/(x*(a + b*f**(c + d*x))**S(2)), x), x, -Integral(S(1)/(x**S(2)*(a + b*f**(c + d*x))), x)/(b*d*log(f)) - S(1)/(b*d*x*(a + b*f**(c + d*x))*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)/(x**S(2)*(a + b*f**(c + d*x))**S(2)), x), x, -S(2)*Integral(S(1)/(x**S(3)*(a + b*f**(c + d*x))), x)/(b*d*log(f)) - S(1)/(b*d*x**S(2)*(a + b*f**(c + d*x))*log(f)), expand=True, _diff=True, _numerical=True) # recursion assert rubi_test(rubi_integrate(f**(c + d*x)*x**S(3)/(a + b*f**(c + d*x))**S(3), x), x, -x**S(3)/(S(2)*b*d*(a + b*f**(c + d*x))**S(2)*log(f)) + S(3)*x**S(2)/(S(2)*a*b*d**S(2)*(a + b*f**(c + d*x))*log(f)**S(2)) + x**S(3)/(S(2)*a**S(2)*b*d*log(f)) - S(3)*x**S(2)*log(S(1) + b*f**(c + d*x)/a)/(S(2)*a**S(2)*b*d**S(2)*log(f)**S(2)) + S(3)*x*log(a*f**(-c - d*x)/b + S(1))/(a**S(2)*b*d**S(3)*log(f)**S(3)) - S(3)*x*polylog(S(2), -b*f**(c + d*x)/a)/(a**S(2)*b*d**S(3)*log(f)**S(3)) - S(3)*polylog(S(2), -a*f**(-c - d*x)/b)/(a**S(2)*b*d**S(4)*log(f)**S(4)) + S(3)*polylog(S(3), -b*f**(c + d*x)/a)/(a**S(2)*b*d**S(4)*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)*x**S(2)/(a + b*f**(c + d*x))**S(3), x), x, -x**S(2)/(S(2)*b*d*(a + b*f**(c + d*x))**S(2)*log(f)) + x/(a*b*d**S(2)*(a + b*f**(c + d*x))*log(f)**S(2)) + x**S(2)/(S(2)*a**S(2)*b*d*log(f)) - x*log(S(1) + b*f**(c + d*x)/a)/(a**S(2)*b*d**S(2)*log(f)**S(2)) - x/(a**S(2)*b*d**S(2)*log(f)**S(2)) + log(a + b*f**(c + d*x))/(a**S(2)*b*d**S(3)*log(f)**S(3)) - polylog(S(2), -b*f**(c + d*x)/a)/(a**S(2)*b*d**S(3)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)*x/(a + b*f**(c + d*x))**S(3), x), x, -x/(S(2)*b*d*(a + b*f**(c + d*x))**S(2)*log(f)) + S(1)/(S(2)*a*b*d**S(2)*(a + b*f**(c + d*x))*log(f)**S(2)) + x/(S(2)*a**S(2)*b*d*log(f)) - log(a + b*f**(c + d*x))/(S(2)*a**S(2)*b*d**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)/(a + b*f**(c + d*x))**S(3), x), x, -S(1)/(S(2)*b*d*(a + b*f**(c + d*x))**S(2)*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)/(x*(a + b*f**(c + d*x))**S(3)), x), x, -Integral(S(1)/(x**S(2)*(a + b*f**(c + d*x))**S(2)), x)/(S(2)*b*d*log(f)) - S(1)/(S(2)*b*d*x*(a + b*f**(c + d*x))**S(2)*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c + d*x)/(x**S(2)*(a + b*f**(c + d*x))**S(3)), x), x, -Integral(S(1)/(x**S(3)*(a + b*f**(c + d*x))**S(2)), x)/(b*d*log(f)) - S(1)/(S(2)*b*d*x**S(2)*(a + b*f**(c + d*x))**S(2)*log(f)), expand=True, _diff=True, _numerical=True) def test_3(): assert rubi_test(rubi_integrate(exp(x)/(S(6)*exp(x) + S(4)), x), x, log(S(3)*exp(x) + S(2))/S(6), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(a + b*exp(x)), x), x, log(a + b*exp(x))/b, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(d*x)/(a + b*exp(c + d*x)), x), x, exp(-c)*log(a + b*exp(c + d*x))/(b*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(c + d*x)/(a + b*exp(c + d*x)), x), x, log(a + b*exp(c + d*x))/(b*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(x))**n*exp(x), x), x, (a + b*exp(x))**(n + S(1))/(b*(n + S(1))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(c + d*x))**n*exp(d*x), x), x, (a + b*exp(c + d*x))**(n + S(1))*exp(-c)/(b*d*(n + S(1))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(c + d*x))**n*exp(c + d*x), x), x, (a + b*exp(c + d*x))**(n + S(1))/(b*d*(n + S(1))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**x/(F**x*b + a), x), x, log(F**x*b + a)/(b*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(d*x)/(F**(c + d*x)*b + a), x), x, F**(-c)*log(F**(c + d*x)*b + a)/(b*d*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c + d*x)/(F**(c + d*x)*b + a), x), x, log(F**(c + d*x)*b + a)/(b*d*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**x*(F**x*b + a)**n, x), x, (F**x*b + a)**(n + S(1))/(b*(n + S(1))*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(d*x)*(F**(c + d*x)*b + a)**n, x), x, F**(-c)*(F**(c + d*x)*b + a)**(n + S(1))/(b*d*(n + S(1))*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c + d*x)*(F**(c + d*x)*b + a)**n, x), x, (F**(c + d*x)*b + a)**(n + S(1))/(b*d*(n + S(1))*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**m, x), x, -f**a*x**(m + S(1))*(-b*x**S(2)*log(f))**(-m/S(2) + S(-1)/2)*Gamma(m/S(2) + S(1)/2, -b*x**S(2)*log(f))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**S(11), x), x, -f**a*Gamma(S(6), -b*x**S(2)*log(f))/(S(2)*b**S(6)*log(f)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**S(9), x), x, f**a*Gamma(S(5), -b*x**S(2)*log(f))/(S(2)*b**S(5)*log(f)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**S(7), x), x, f**(a + b*x**S(2))*x**S(6)/(S(2)*b*log(f)) - S(3)*f**(a + b*x**S(2))*x**S(4)/(S(2)*b**S(2)*log(f)**S(2)) + S(3)*f**(a + b*x**S(2))*x**S(2)/(b**S(3)*log(f)**S(3)) - S(3)*f**(a + b*x**S(2))/(b**S(4)*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**S(5), x), x, f**(a + b*x**S(2))*x**S(4)/(S(2)*b*log(f)) - f**(a + b*x**S(2))*x**S(2)/(b**S(2)*log(f)**S(2)) + f**(a + b*x**S(2))/(b**S(3)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**S(3), x), x, f**(a + b*x**S(2))*x**S(2)/(S(2)*b*log(f)) - f**(a + b*x**S(2))/(S(2)*b**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x, x), x, f**(a + b*x**S(2))/(S(2)*b*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x, x), x, f**a*Ei(b*x**S(2)*log(f))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x**S(3), x), x, b*f**a*log(f)*Ei(b*x**S(2)*log(f))/S(2) - f**(a + b*x**S(2))/(S(2)*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x**S(5), x), x, b**S(2)*f**a*log(f)**S(2)*Ei(b*x**S(2)*log(f))/S(4) - b*f**(a + b*x**S(2))*log(f)/(S(4)*x**S(2)) - f**(a + b*x**S(2))/(S(4)*x**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x**S(7), x), x, b**S(3)*f**a*log(f)**S(3)*Ei(b*x**S(2)*log(f))/S(12) - b**S(2)*f**(a + b*x**S(2))*log(f)**S(2)/(S(12)*x**S(2)) - b*f**(a + b*x**S(2))*log(f)/(S(12)*x**S(4)) - f**(a + b*x**S(2))/(S(6)*x**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x**S(9), x), x, -b**S(4)*f**a*Gamma(S(-4), -b*x**S(2)*log(f))*log(f)**S(4)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x**S(11), x), x, b**S(5)*f**a*Gamma(S(-5), -b*x**S(2)*log(f))*log(f)**S(5)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**S(12), x), x, -f**a*x**S(13)*Gamma(S(13)/2, -b*x**S(2)*log(f))/(S(2)*(-b*x**S(2)*log(f))**(S(13)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**S(10), x), x, -f**a*x**S(11)*Gamma(S(11)/2, -b*x**S(2)*log(f))/(S(2)*(-b*x**S(2)*log(f))**(S(11)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**S(8), x), x, f**(a + b*x**S(2))*x**S(7)/(S(2)*b*log(f)) - S(7)*f**(a + b*x**S(2))*x**S(5)/(S(4)*b**S(2)*log(f)**S(2)) + S(35)*f**(a + b*x**S(2))*x**S(3)/(S(8)*b**S(3)*log(f)**S(3)) - S(105)*f**(a + b*x**S(2))*x/(S(16)*b**S(4)*log(f)**S(4)) + S(105)*sqrt(pi)*f**a*erfi(sqrt(b)*x*sqrt(log(f)))/(S(32)*b**(S(9)/2)*log(f)**(S(9)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**S(6), x), x, f**(a + b*x**S(2))*x**S(5)/(S(2)*b*log(f)) - S(5)*f**(a + b*x**S(2))*x**S(3)/(S(4)*b**S(2)*log(f)**S(2)) + S(15)*f**(a + b*x**S(2))*x/(S(8)*b**S(3)*log(f)**S(3)) - S(15)*sqrt(pi)*f**a*erfi(sqrt(b)*x*sqrt(log(f)))/(S(16)*b**(S(7)/2)*log(f)**(S(7)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**S(4), x), x, f**(a + b*x**S(2))*x**S(3)/(S(2)*b*log(f)) - S(3)*f**(a + b*x**S(2))*x/(S(4)*b**S(2)*log(f)**S(2)) + S(3)*sqrt(pi)*f**a*erfi(sqrt(b)*x*sqrt(log(f)))/(S(8)*b**(S(5)/2)*log(f)**(S(5)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))*x**S(2), x), x, f**(a + b*x**S(2))*x/(S(2)*b*log(f)) - sqrt(pi)*f**a*erfi(sqrt(b)*x*sqrt(log(f)))/(S(4)*b**(S(3)/2)*log(f)**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2)), x), x, sqrt(pi)*f**a*erfi(sqrt(b)*x*sqrt(log(f)))/(S(2)*sqrt(b)*sqrt(log(f))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x**S(2), x), x, sqrt(pi)*sqrt(b)*f**a*sqrt(log(f))*erfi(sqrt(b)*x*sqrt(log(f))) - f**(a + b*x**S(2))/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x**S(4), x), x, S(2)*sqrt(pi)*b**(S(3)/2)*f**a*log(f)**(S(3)/2)*erfi(sqrt(b)*x*sqrt(log(f)))/S(3) - S(2)*b*f**(a + b*x**S(2))*log(f)/(S(3)*x) - f**(a + b*x**S(2))/(S(3)*x**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x**S(6), x), x, S(4)*sqrt(pi)*b**(S(5)/2)*f**a*log(f)**(S(5)/2)*erfi(sqrt(b)*x*sqrt(log(f)))/S(15) - S(4)*b**S(2)*f**(a + b*x**S(2))*log(f)**S(2)/(S(15)*x) - S(2)*b*f**(a + b*x**S(2))*log(f)/(S(15)*x**S(3)) - f**(a + b*x**S(2))/(S(5)*x**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x**S(8), x), x, S(8)*sqrt(pi)*b**(S(7)/2)*f**a*log(f)**(S(7)/2)*erfi(sqrt(b)*x*sqrt(log(f)))/S(105) - S(8)*b**S(3)*f**(a + b*x**S(2))*log(f)**S(3)/(S(105)*x) - S(4)*b**S(2)*f**(a + b*x**S(2))*log(f)**S(2)/(S(105)*x**S(3)) - S(2)*b*f**(a + b*x**S(2))*log(f)/(S(35)*x**S(5)) - f**(a + b*x**S(2))/(S(7)*x**S(7)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x**S(10), x), x, -f**a*(-b*x**S(2)*log(f))**(S(9)/2)*Gamma(S(-9)/2, -b*x**S(2)*log(f))/(S(2)*x**S(9)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(2))/x**S(12), x), x, -f**a*(-b*x**S(2)*log(f))**(S(11)/2)*Gamma(S(-11)/2, -b*x**S(2)*log(f))/(S(2)*x**S(11)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))*x**m, x), x, -f**a*x**(m + S(1))*(-b*x**S(3)*log(f))**(-m/S(3) + S(-1)/3)*Gamma(m/S(3) + S(1)/3, -b*x**S(3)*log(f))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))*x**S(17), x), x, -f**a*Gamma(S(6), -b*x**S(3)*log(f))/(S(3)*b**S(6)*log(f)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))*x**S(14), x), x, f**a*Gamma(S(5), -b*x**S(3)*log(f))/(S(3)*b**S(5)*log(f)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))*x**S(11), x), x, f**(a + b*x**S(3))*x**S(9)/(S(3)*b*log(f)) - f**(a + b*x**S(3))*x**S(6)/(b**S(2)*log(f)**S(2)) + S(2)*f**(a + b*x**S(3))*x**S(3)/(b**S(3)*log(f)**S(3)) - S(2)*f**(a + b*x**S(3))/(b**S(4)*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))*x**S(8), x), x, f**(a + b*x**S(3))*x**S(6)/(S(3)*b*log(f)) - S(2)*f**(a + b*x**S(3))*x**S(3)/(S(3)*b**S(2)*log(f)**S(2)) + S(2)*f**(a + b*x**S(3))/(S(3)*b**S(3)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))*x**S(5), x), x, f**(a + b*x**S(3))*x**S(3)/(S(3)*b*log(f)) - f**(a + b*x**S(3))/(S(3)*b**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))*x**S(2), x), x, f**(a + b*x**S(3))/(S(3)*b*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))/x, x), x, f**a*Ei(b*x**S(3)*log(f))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))/x**S(4), x), x, b*f**a*log(f)*Ei(b*x**S(3)*log(f))/S(3) - f**(a + b*x**S(3))/(S(3)*x**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))/x**S(7), x), x, b**S(2)*f**a*log(f)**S(2)*Ei(b*x**S(3)*log(f))/S(6) - b*f**(a + b*x**S(3))*log(f)/(S(6)*x**S(3)) - f**(a + b*x**S(3))/(S(6)*x**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))/x**S(10), x), x, b**S(3)*f**a*log(f)**S(3)*Ei(b*x**S(3)*log(f))/S(18) - b**S(2)*f**(a + b*x**S(3))*log(f)**S(2)/(S(18)*x**S(3)) - b*f**(a + b*x**S(3))*log(f)/(S(18)*x**S(6)) - f**(a + b*x**S(3))/(S(9)*x**S(9)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))/x**S(13), x), x, -b**S(4)*f**a*Gamma(S(-4), -b*x**S(3)*log(f))*log(f)**S(4)/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))/x**S(16), x), x, b**S(5)*f**a*Gamma(S(-5), -b*x**S(3)*log(f))*log(f)**S(5)/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))*x**S(4), x), x, -f**a*x**S(5)*Gamma(S(5)/3, -b*x**S(3)*log(f))/(S(3)*(-b*x**S(3)*log(f))**(S(5)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))*x**S(3), x), x, -f**a*x**S(4)*Gamma(S(4)/3, -b*x**S(3)*log(f))/(S(3)*(-b*x**S(3)*log(f))**(S(4)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))*x, x), x, -f**a*x**S(2)*Gamma(S(2)/3, -b*x**S(3)*log(f))/(S(3)*(-b*x**S(3)*log(f))**(S(2)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3)), x), x, -f**a*x*Gamma(S(1)/3, -b*x**S(3)*log(f))/(S(3)*(-b*x**S(3)*log(f))**(S(1)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))/x**S(2), x), x, -f**a*(-b*x**S(3)*log(f))**(S(1)/3)*Gamma(S(-1)/3, -b*x**S(3)*log(f))/(S(3)*x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**S(3))/x**S(3), x), x, -f**a*(-b*x**S(3)*log(f))**(S(2)/3)*Gamma(S(-2)/3, -b*x**S(3)*log(f))/(S(3)*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*exp(S(4)*x**S(3)), x), x, exp(S(4)*x**S(3))/S(12), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)*x**m, x), x, f**a*x**(m + S(1))*(-b*log(f)/x)**(m + S(1))*Gamma(-m + S(-1), -b*log(f)/x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)*x**S(4), x), x, -b**S(5)*f**a*Gamma(S(-5), -b*log(f)/x)*log(f)**S(5), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)*x**S(3), x), x, b**S(4)*f**a*Gamma(S(-4), -b*log(f)/x)*log(f)**S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)*x**S(2), x), x, -b**S(3)*f**a*log(f)**S(3)*Ei(b*log(f)/x)/S(6) + b**S(2)*f**(a + b/x)*x*log(f)**S(2)/S(6) + b*f**(a + b/x)*x**S(2)*log(f)/S(6) + f**(a + b/x)*x**S(3)/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)*x, x), x, -b**S(2)*f**a*log(f)**S(2)*Ei(b*log(f)/x)/S(2) + b*f**(a + b/x)*x*log(f)/S(2) + f**(a + b/x)*x**S(2)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x), x), x, -b*f**a*log(f)*Ei(b*log(f)/x) + f**(a + b/x)*x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)/x, x), x, -f**a*Ei(b*log(f)/x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)/x**S(2), x), x, -f**(a + b/x)/(b*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)/x**S(3), x), x, -f**(a + b/x)/(b*x*log(f)) + f**(a + b/x)/(b**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)/x**S(4), x), x, -f**(a + b/x)/(b*x**S(2)*log(f)) + S(2)*f**(a + b/x)/(b**S(2)*x*log(f)**S(2)) - S(2)*f**(a + b/x)/(b**S(3)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)/x**S(5), x), x, -f**(a + b/x)/(b*x**S(3)*log(f)) + S(3)*f**(a + b/x)/(b**S(2)*x**S(2)*log(f)**S(2)) - S(6)*f**(a + b/x)/(b**S(3)*x*log(f)**S(3)) + S(6)*f**(a + b/x)/(b**S(4)*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)/x**S(6), x), x, -f**a*Gamma(S(5), -b*log(f)/x)/(b**S(5)*log(f)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x)/x**S(7), x), x, f**a*Gamma(S(6), -b*log(f)/x)/(b**S(6)*log(f)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))*x**m, x), x, f**a*x**(m + S(1))*(-b*log(f)/x**S(2))**(m/S(2) + S(1)/2)*Gamma(-m/S(2) + S(-1)/2, -b*log(f)/x**S(2))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))*x**S(9), x), x, -b**S(5)*f**a*Gamma(S(-5), -b*log(f)/x**S(2))*log(f)**S(5)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))*x**S(7), x), x, b**S(4)*f**a*Gamma(S(-4), -b*log(f)/x**S(2))*log(f)**S(4)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))*x**S(5), x), x, -b**S(3)*f**a*log(f)**S(3)*Ei(b*log(f)/x**S(2))/S(12) + b**S(2)*f**(a + b/x**S(2))*x**S(2)*log(f)**S(2)/S(12) + b*f**(a + b/x**S(2))*x**S(4)*log(f)/S(12) + f**(a + b/x**S(2))*x**S(6)/S(6), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))*x**S(3), x), x, -b**S(2)*f**a*log(f)**S(2)*Ei(b*log(f)/x**S(2))/S(4) + b*f**(a + b/x**S(2))*x**S(2)*log(f)/S(4) + f**(a + b/x**S(2))*x**S(4)/S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))*x, x), x, -b*f**a*log(f)*Ei(b*log(f)/x**S(2))/S(2) + f**(a + b/x**S(2))*x**S(2)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x, x), x, -f**a*Ei(b*log(f)/x**S(2))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(3), x), x, -f**(a + b/x**S(2))/(S(2)*b*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(5), x), x, -f**(a + b/x**S(2))/(S(2)*b*x**S(2)*log(f)) + f**(a + b/x**S(2))/(S(2)*b**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(7), x), x, -f**(a + b/x**S(2))/(S(2)*b*x**S(4)*log(f)) + f**(a + b/x**S(2))/(b**S(2)*x**S(2)*log(f)**S(2)) - f**(a + b/x**S(2))/(b**S(3)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(9), x), x, -f**(a + b/x**S(2))/(S(2)*b*x**S(6)*log(f)) + S(3)*f**(a + b/x**S(2))/(S(2)*b**S(2)*x**S(4)*log(f)**S(2)) - S(3)*f**(a + b/x**S(2))/(b**S(3)*x**S(2)*log(f)**S(3)) + S(3)*f**(a + b/x**S(2))/(b**S(4)*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(11), x), x, -f**a*Gamma(S(5), -b*log(f)/x**S(2))/(S(2)*b**S(5)*log(f)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(13), x), x, f**a*Gamma(S(6), -b*log(f)/x**S(2))/(S(2)*b**S(6)*log(f)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))*x**S(10), x), x, f**a*x**S(11)*(-b*log(f)/x**S(2))**(S(11)/2)*Gamma(S(-11)/2, -b*log(f)/x**S(2))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))*x**S(8), x), x, f**a*x**S(9)*(-b*log(f)/x**S(2))**(S(9)/2)*Gamma(S(-9)/2, -b*log(f)/x**S(2))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))*x**S(6), x), x, -S(8)*sqrt(pi)*b**(S(7)/2)*f**a*log(f)**(S(7)/2)*erfi(sqrt(b)*sqrt(log(f))/x)/S(105) + S(8)*b**S(3)*f**(a + b/x**S(2))*x*log(f)**S(3)/S(105) + S(4)*b**S(2)*f**(a + b/x**S(2))*x**S(3)*log(f)**S(2)/S(105) + S(2)*b*f**(a + b/x**S(2))*x**S(5)*log(f)/S(35) + f**(a + b/x**S(2))*x**S(7)/S(7), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))*x**S(4), x), x, -S(4)*sqrt(pi)*b**(S(5)/2)*f**a*log(f)**(S(5)/2)*erfi(sqrt(b)*sqrt(log(f))/x)/S(15) + S(4)*b**S(2)*f**(a + b/x**S(2))*x*log(f)**S(2)/S(15) + S(2)*b*f**(a + b/x**S(2))*x**S(3)*log(f)/S(15) + f**(a + b/x**S(2))*x**S(5)/S(5), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))*x**S(2), x), x, -S(2)*sqrt(pi)*b**(S(3)/2)*f**a*log(f)**(S(3)/2)*erfi(sqrt(b)*sqrt(log(f))/x)/S(3) + S(2)*b*f**(a + b/x**S(2))*x*log(f)/S(3) + f**(a + b/x**S(2))*x**S(3)/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2)), x), x, -sqrt(pi)*sqrt(b)*f**a*sqrt(log(f))*erfi(sqrt(b)*sqrt(log(f))/x) + f**(a + b/x**S(2))*x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(2), x), x, -sqrt(pi)*f**a*erfi(sqrt(b)*sqrt(log(f))/x)/(S(2)*sqrt(b)*sqrt(log(f))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(4), x), x, -f**(a + b/x**S(2))/(S(2)*b*x*log(f)) + sqrt(pi)*f**a*erfi(sqrt(b)*sqrt(log(f))/x)/(S(4)*b**(S(3)/2)*log(f)**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(6), x), x, -f**(a + b/x**S(2))/(S(2)*b*x**S(3)*log(f)) + S(3)*f**(a + b/x**S(2))/(S(4)*b**S(2)*x*log(f)**S(2)) - S(3)*sqrt(pi)*f**a*erfi(sqrt(b)*sqrt(log(f))/x)/(S(8)*b**(S(5)/2)*log(f)**(S(5)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(8), x), x, -f**(a + b/x**S(2))/(S(2)*b*x**S(5)*log(f)) + S(5)*f**(a + b/x**S(2))/(S(4)*b**S(2)*x**S(3)*log(f)**S(2)) - S(15)*f**(a + b/x**S(2))/(S(8)*b**S(3)*x*log(f)**S(3)) + S(15)*sqrt(pi)*f**a*erfi(sqrt(b)*sqrt(log(f))/x)/(S(16)*b**(S(7)/2)*log(f)**(S(7)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(10), x), x, -f**(a + b/x**S(2))/(S(2)*b*x**S(7)*log(f)) + S(7)*f**(a + b/x**S(2))/(S(4)*b**S(2)*x**S(5)*log(f)**S(2)) - S(35)*f**(a + b/x**S(2))/(S(8)*b**S(3)*x**S(3)*log(f)**S(3)) + S(105)*f**(a + b/x**S(2))/(S(16)*b**S(4)*x*log(f)**S(4)) - S(105)*sqrt(pi)*f**a*erfi(sqrt(b)*sqrt(log(f))/x)/(S(32)*b**(S(9)/2)*log(f)**(S(9)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(12), x), x, f**a*Gamma(S(11)/2, -b*log(f)/x**S(2))/(S(2)*x**S(11)*(-b*log(f)/x**S(2))**(S(11)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(2))/x**S(14), x), x, f**a*Gamma(S(13)/2, -b*log(f)/x**S(2))/(S(2)*x**S(13)*(-b*log(f)/x**S(2))**(S(13)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))*x**m, x), x, f**a*x**(m + S(1))*(-b*log(f)/x**S(3))**(m/S(3) + S(1)/3)*Gamma(-m/S(3) + S(-1)/3, -b*log(f)/x**S(3))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))*x**S(14), x), x, -b**S(5)*f**a*Gamma(S(-5), -b*log(f)/x**S(3))*log(f)**S(5)/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))*x**S(11), x), x, b**S(4)*f**a*Gamma(S(-4), -b*log(f)/x**S(3))*log(f)**S(4)/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))*x**S(8), x), x, -b**S(3)*f**a*log(f)**S(3)*Ei(b*log(f)/x**S(3))/S(18) + b**S(2)*f**(a + b/x**S(3))*x**S(3)*log(f)**S(2)/S(18) + b*f**(a + b/x**S(3))*x**S(6)*log(f)/S(18) + f**(a + b/x**S(3))*x**S(9)/S(9), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))*x**S(5), x), x, -b**S(2)*f**a*log(f)**S(2)*Ei(b*log(f)/x**S(3))/S(6) + b*f**(a + b/x**S(3))*x**S(3)*log(f)/S(6) + f**(a + b/x**S(3))*x**S(6)/S(6), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))*x**S(2), x), x, -b*f**a*log(f)*Ei(b*log(f)/x**S(3))/S(3) + f**(a + b/x**S(3))*x**S(3)/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))/x, x), x, -f**a*Ei(b*log(f)/x**S(3))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))/x**S(4), x), x, -f**(a + b/x**S(3))/(S(3)*b*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))/x**S(7), x), x, -f**(a + b/x**S(3))/(S(3)*b*x**S(3)*log(f)) + f**(a + b/x**S(3))/(S(3)*b**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))/x**S(10), x), x, -f**(a + b/x**S(3))/(S(3)*b*x**S(6)*log(f)) + S(2)*f**(a + b/x**S(3))/(S(3)*b**S(2)*x**S(3)*log(f)**S(2)) - S(2)*f**(a + b/x**S(3))/(S(3)*b**S(3)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))/x**S(13), x), x, -f**(a + b/x**S(3))/(S(3)*b*x**S(9)*log(f)) + f**(a + b/x**S(3))/(b**S(2)*x**S(6)*log(f)**S(2)) - S(2)*f**(a + b/x**S(3))/(b**S(3)*x**S(3)*log(f)**S(3)) + S(2)*f**(a + b/x**S(3))/(b**S(4)*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))/x**S(16), x), x, -f**a*Gamma(S(5), -b*log(f)/x**S(3))/(S(3)*b**S(5)*log(f)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))/x**S(19), x), x, f**a*Gamma(S(6), -b*log(f)/x**S(3))/(S(3)*b**S(6)*log(f)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))*x**S(4), x), x, f**a*x**S(5)*(-b*log(f)/x**S(3))**(S(5)/3)*Gamma(S(-5)/3, -b*log(f)/x**S(3))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))*x**S(3), x), x, f**a*x**S(4)*(-b*log(f)/x**S(3))**(S(4)/3)*Gamma(S(-4)/3, -b*log(f)/x**S(3))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))*x, x), x, f**a*x**S(2)*(-b*log(f)/x**S(3))**(S(2)/3)*Gamma(S(-2)/3, -b*log(f)/x**S(3))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3)), x), x, f**a*x*(-b*log(f)/x**S(3))**(S(1)/3)*Gamma(S(-1)/3, -b*log(f)/x**S(3))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))/x**S(2), x), x, f**a*Gamma(S(1)/3, -b*log(f)/x**S(3))/(S(3)*x*(-b*log(f)/x**S(3))**(S(1)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))/x**S(3), x), x, f**a*Gamma(S(2)/3, -b*log(f)/x**S(3))/(S(3)*x**S(2)*(-b*log(f)/x**S(3))**(S(2)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b/x**S(3))/x**S(5), x), x, f**a*Gamma(S(4)/3, -b*log(f)/x**S(3))/(S(3)*x**S(4)*(-b*log(f)/x**S(3))**(S(4)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**m, x), x, -f**a*x**(m + S(1))*(-b*x**n*log(f))**(-(m + S(1))/n)*Gamma((m + S(1))/n, -b*x**n*log(f))/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**S(3), x), x, -f**a*x**S(4)*(-b*x**n*log(f))**(-S(4)/n)*Gamma(S(4)/n, -b*x**n*log(f))/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**S(2), x), x, -f**a*x**S(3)*(-b*x**n*log(f))**(-S(3)/n)*Gamma(S(3)/n, -b*x**n*log(f))/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x, x), x, -f**a*x**S(2)*(-b*x**n*log(f))**(-S(2)/n)*Gamma(S(2)/n, -b*x**n*log(f))/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n), x), x, -f**a*x*(-b*x**n*log(f))**(-S(1)/n)*Gamma(S(1)/n, -b*x**n*log(f))/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)/x, x), x, f**a*Ei(b*x**n*log(f))/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)/x**S(2), x), x, -f**a*(-b*x**n*log(f))**(S(1)/n)*Gamma(-S(1)/n, -b*x**n*log(f))/(n*x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)/x**S(3), x), x, -f**a*(-b*x**n*log(f))**(S(2)/n)*Gamma(-S(2)/n, -b*x**n*log(f))/(n*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)/x**S(4), x), x, -f**a*(-b*x**n*log(f))**(S(3)/n)*Gamma(-S(3)/n, -b*x**n*log(f))/(n*x**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**(S(3)*n + S(-1)), x), x, f**(a + b*x**n)*x**(S(2)*n)/(b*n*log(f)) - S(2)*f**(a + b*x**n)*x**n/(b**S(2)*n*log(f)**S(2)) + S(2)*f**(a + b*x**n)/(b**S(3)*n*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**(S(2)*n + S(-1)), x), x, f**(a + b*x**n)*x**n/(b*n*log(f)) - f**(a + b*x**n)/(b**S(2)*n*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**(n + S(-1)), x), x, f**(a + b*x**n)/(b*n*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)/x, x), x, f**a*Ei(b*x**n*log(f))/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**(-n + S(-1)), x), x, b*f**a*log(f)*Ei(b*x**n*log(f))/n - f**(a + b*x**n)*x**(-n)/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**(-S(2)*n + S(-1)), x), x, b**S(2)*f**a*log(f)**S(2)*Ei(b*x**n*log(f))/(S(2)*n) - b*f**(a + b*x**n)*x**(-n)*log(f)/(S(2)*n) - f**(a + b*x**n)*x**(-S(2)*n)/(S(2)*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**(S(5)*n/S(2) + S(-1)), x), x, f**(a + b*x**n)*x**(S(3)*n/S(2))/(b*n*log(f)) - S(3)*f**(a + b*x**n)*x**(n/S(2))/(S(2)*b**S(2)*n*log(f)**S(2)) + S(3)*sqrt(pi)*f**a*erfi(sqrt(b)*x**(n/S(2))*sqrt(log(f)))/(S(4)*b**(S(5)/2)*n*log(f)**(S(5)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**(S(3)*n/S(2) + S(-1)), x), x, f**(a + b*x**n)*x**(n/S(2))/(b*n*log(f)) - sqrt(pi)*f**a*erfi(sqrt(b)*x**(n/S(2))*sqrt(log(f)))/(S(2)*b**(S(3)/2)*n*log(f)**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**(n/S(2) + S(-1)), x), x, sqrt(pi)*f**a*erfi(sqrt(b)*x**(n/S(2))*sqrt(log(f)))/(sqrt(b)*n*sqrt(log(f))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**(-n/S(2) + S(-1)), x), x, S(2)*sqrt(pi)*sqrt(b)*f**a*sqrt(log(f))*erfi(sqrt(b)*x**(n/S(2))*sqrt(log(f)))/n - S(2)*f**(a + b*x**n)*x**(-n/S(2))/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x**n)*x**(-S(3)*n/S(2) + S(-1)), x), x, S(4)*sqrt(pi)*b**(S(3)/2)*f**a*log(f)**(S(3)/2)*erfi(sqrt(b)*x**(n/S(2))*sqrt(log(f)))/(S(3)*n) - S(4)*b*f**(a + b*x**n)*x**(-n/S(2))*log(f)/(S(3)*n) - S(2)*f**(a + b*x**n)*x**(-S(3)*n/S(2))/(S(3)*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(-0.1*x), x), x, -10.0*x*exp(-0.1*x) - 100.0*exp(-0.1*x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(2))*x**m, x), x, Integral(f**(a**S(2)*c + S(2)*a*b*c*x + b**S(2)*c*x**S(2))*x**m, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(2))*x**S(3), x), x, -sqrt(pi)*a**S(3)*erfi(sqrt(c)*(a + b*x)*sqrt(log(f)))/(S(2)*b**S(4)*sqrt(c)*sqrt(log(f))) + S(3)*a**S(2)*f**(c*(a + b*x)**S(2))/(S(2)*b**S(4)*c*log(f)) - S(3)*a*f**(c*(a + b*x)**S(2))*(a + b*x)/(S(2)*b**S(4)*c*log(f)) + S(3)*sqrt(pi)*a*erfi(sqrt(c)*(a + b*x)*sqrt(log(f)))/(S(4)*b**S(4)*c**(S(3)/2)*log(f)**(S(3)/2)) + f**(c*(a + b*x)**S(2))*(a + b*x)**S(2)/(S(2)*b**S(4)*c*log(f)) - f**(c*(a + b*x)**S(2))/(S(2)*b**S(4)*c**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(2))*x**S(2), x), x, sqrt(pi)*a**S(2)*erfi(sqrt(c)*(a + b*x)*sqrt(log(f)))/(S(2)*b**S(3)*sqrt(c)*sqrt(log(f))) - a*f**(c*(a + b*x)**S(2))/(b**S(3)*c*log(f)) + f**(c*(a + b*x)**S(2))*(a + b*x)/(S(2)*b**S(3)*c*log(f)) - sqrt(pi)*erfi(sqrt(c)*(a + b*x)*sqrt(log(f)))/(S(4)*b**S(3)*c**(S(3)/2)*log(f)**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(2))*x, x), x, -sqrt(pi)*a*erfi(sqrt(c)*(a + b*x)*sqrt(log(f)))/(S(2)*b**S(2)*sqrt(c)*sqrt(log(f))) + f**(c*(a + b*x)**S(2))/(S(2)*b**S(2)*c*log(f)), expand=True, _diff=True, _numerical=True) # long time in rubi_test(1940 is matched before 1909) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(2)), x), x, sqrt(pi)*erfi(sqrt(c)*(a + b*x)*sqrt(log(f)))/(S(2)*b*sqrt(c)*sqrt(log(f))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(2))/x, x), x, Integral(f**(c*(a + b*x)**S(2))/x, x), expand=True, _diff=True, _numerical=True) # long time in rubi_test(1940 is matched before 1909) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(2))/x**S(2), x), x, S(2)*a*b*c*log(f)*Integral(f**(c*(a + b*x)**S(2))/x, x) + sqrt(pi)*b*sqrt(c)*sqrt(log(f))*erfi(sqrt(c)*(a + b*x)*sqrt(log(f))) - f**(c*(a + b*x)**S(2))/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(2))/x**S(3), x), x, S(2)*a**S(2)*b**S(2)*c**S(2)*log(f)**S(2)*Integral(f**(c*(a + b*x)**S(2))/x, x) + sqrt(pi)*a*b**S(2)*c**(S(3)/2)*log(f)**(S(3)/2)*erfi(sqrt(c)*(a + b*x)*sqrt(log(f))) - a*b*c*f**(c*(a + b*x)**S(2))*log(f)/x + b**S(2)*c*log(f)*Integral(f**(c*(a + b*x)**S(2))/x, x) - f**(c*(a + b*x)**S(2))/(S(2)*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(3))*x**m, x), x, Integral(f**(c*(a + b*x)**S(3))*x**m, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(3))*x**S(2), x), x, -a**S(2)*(a + b*x)*Gamma(S(1)/3, -c*(a + b*x)**S(3)*log(f))/(S(3)*b**S(3)*(-c*(a + b*x)**S(3)*log(f))**(S(1)/3)) + S(2)*a*(a + b*x)**S(2)*Gamma(S(2)/3, -c*(a + b*x)**S(3)*log(f))/(S(3)*b**S(3)*(-c*(a + b*x)**S(3)*log(f))**(S(2)/3)) + f**(c*(a + b*x)**S(3))/(S(3)*b**S(3)*c*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(3))*x, x), x, a*(a + b*x)*Gamma(S(1)/3, -c*(a + b*x)**S(3)*log(f))/(S(3)*b**S(2)*(-c*(a + b*x)**S(3)*log(f))**(S(1)/3)) - (a + b*x)**S(2)*Gamma(S(2)/3, -c*(a + b*x)**S(3)*log(f))/(S(3)*b**S(2)*(-c*(a + b*x)**S(3)*log(f))**(S(2)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(3)), x), x, (-a/S(3) - b*x/S(3))*Gamma(S(1)/3, -c*(a + b*x)**S(3)*log(f))/(b*(-c*(a + b*x)**S(3)*log(f))**(S(1)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(3))/x, x), x, Integral(f**(c*(a + b*x)**S(3))/x, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(3))/x**S(2), x), x, S(3)*a**S(2)*b*c*log(f)*Integral(f**(c*(a + b*x)**S(3))/x, x) - a*b*c*(a + b*x)*Gamma(S(1)/3, -c*(a + b*x)**S(3)*log(f))*log(f)/(-c*(a + b*x)**S(3)*log(f))**(S(1)/3) - b*c*(a + b*x)**S(2)*Gamma(S(2)/3, -c*(a + b*x)**S(3)*log(f))*log(f)/(-c*(a + b*x)**S(3)*log(f))**(S(2)/3) - f**(c*(a + b*x)**S(3))/x, expand=True, _diff=True, _numerical=True) # difference in simplify of sympy and mathematica assert rubi_test(rubi_integrate(f**(c*(a + b*x)**S(3))/x**S(3), x), x, S(9)*a**S(4)*b**S(2)*c**S(2)*log(f)**S(2)*Integral(f**(c*(a + b*x)**S(3))/x, x)/S(2) - S(3)*a**S(3)*b**S(2)*c**S(2)*(a + b*x)*Gamma(S(1)/3, -c*(a + b*x)**S(3)*log(f))*log(f)**S(2)/(S(2)*(-c*(a + b*x)**S(3)*log(f))**(S(1)/3)) - S(3)*a**S(2)*b**S(2)*c**S(2)*(a + b*x)**S(2)*Gamma(S(2)/3, -c*(a + b*x)**S(3)*log(f))*log(f)**S(2)/(S(2)*(-c*(a + b*x)**S(3)*log(f))**(S(2)/3)) - S(3)*a**S(2)*b*c*f**(c*(a + b*x)**S(3))*log(f)/(S(2)*x) + S(3)*a*b**S(2)*c*log(f)*Integral(f**(c*(a + b*x)**S(3))/x, x) - b**S(2)*c*(a + b*x)*Gamma(S(1)/3, -c*(a + b*x)**S(3)*log(f))*log(f)/(S(2)*(-c*(a + b*x)**S(3)*log(f))**(S(1)/3)) - f**(c*(a + b*x)**S(3))/(S(2)*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**m*exp(a**S(3) + S(3)*a**S(2)*b*x + S(3)*a*b**S(2)*x**S(2) + b**S(3)*x**S(3)), x), x, Integral(x**m*exp(a**S(3) + S(3)*a**S(2)*b*x + S(3)*a*b**S(2)*x**S(2) + b**S(3)*x**S(3)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(4)*exp(a**S(3) + S(3)*a**S(2)*b*x + S(3)*a*b**S(2)*x**S(2) + b**S(3)*x**S(3)), x), x, -a**S(4)*(a + b*x)*Gamma(S(1)/3, -(a + b*x)**S(3))/(S(3)*b**S(5)*(-(a + b*x)**S(3))**(S(1)/3)) + S(4)*a**S(3)*(a + b*x)**S(2)*Gamma(S(2)/3, -(a + b*x)**S(3))/(S(3)*b**S(5)*(-(a + b*x)**S(3))**(S(2)/3)) + S(2)*a**S(2)*exp((a + b*x)**S(3))/b**S(5) + S(4)*a*(a + b*x)**S(4)*Gamma(S(4)/3, -(a + b*x)**S(3))/(S(3)*b**S(5)*(-(a + b*x)**S(3))**(S(4)/3)) - (a + b*x)**S(5)*Gamma(S(5)/3, -(a + b*x)**S(3))/(S(3)*b**S(5)*(-(a + b*x)**S(3))**(S(5)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*exp(a**S(3) + S(3)*a**S(2)*b*x + S(3)*a*b**S(2)*x**S(2) + b**S(3)*x**S(3)), x), x, a**S(3)*(a + b*x)*Gamma(S(1)/3, -(a + b*x)**S(3))/(S(3)*b**S(4)*(-(a + b*x)**S(3))**(S(1)/3)) - a**S(2)*(a + b*x)**S(2)*Gamma(S(2)/3, -(a + b*x)**S(3))/(b**S(4)*(-(a + b*x)**S(3))**(S(2)/3)) - a*exp((a + b*x)**S(3))/b**S(4) - (a + b*x)**S(4)*Gamma(S(4)/3, -(a + b*x)**S(3))/(S(3)*b**S(4)*(-(a + b*x)**S(3))**(S(4)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*exp(a**S(3) + S(3)*a**S(2)*b*x + S(3)*a*b**S(2)*x**S(2) + b**S(3)*x**S(3)), x), x, -a**S(2)*(a + b*x)*Gamma(S(1)/3, -(a + b*x)**S(3))/(S(3)*b**S(3)*(-(a + b*x)**S(3))**(S(1)/3)) + S(2)*a*(a + b*x)**S(2)*Gamma(S(2)/3, -(a + b*x)**S(3))/(S(3)*b**S(3)*(-(a + b*x)**S(3))**(S(2)/3)) + exp((a + b*x)**S(3))/(S(3)*b**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(a**S(3) + S(3)*a**S(2)*b*x + S(3)*a*b**S(2)*x**S(2) + b**S(3)*x**S(3)), x), x, a*(a + b*x)*Gamma(S(1)/3, -(a + b*x)**S(3))/(S(3)*b**S(2)*(-(a + b*x)**S(3))**(S(1)/3)) - (a + b*x)**S(2)*Gamma(S(2)/3, -(a + b*x)**S(3))/(S(3)*b**S(2)*(-(a + b*x)**S(3))**(S(2)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(a**S(3) + S(3)*a**S(2)*b*x + S(3)*a*b**S(2)*x**S(2) + b**S(3)*x**S(3)), x), x, (-a/S(3) - b*x/S(3))*Gamma(S(1)/3, -(a + b*x)**S(3))/(b*(-(a + b*x)**S(3))**(S(1)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(a**S(3) + S(3)*a**S(2)*b*x + S(3)*a*b**S(2)*x**S(2) + b**S(3)*x**S(3))/x, x), x, Integral(exp(a**S(3) + S(3)*a**S(2)*b*x + S(3)*a*b**S(2)*x**S(2) + b**S(3)*x**S(3))/x, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(sqrt(S(3)*x + S(5))), x), x, S(2)*sqrt(S(3)*x + S(5))*exp(sqrt(S(3)*x + S(5)))/S(3) - S(2)*exp(sqrt(S(3)*x + S(5)))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x))*x**m, x), x, Integral(f**(c/(a + b*x))*x**m, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x))*x**S(4), x), x, -a**S(4)*c*log(f)*Ei(c*log(f)/(a + b*x))/b**S(5) + a**S(4)*f**(c/(a + b*x))*(a + b*x)/b**S(5) + S(2)*a**S(3)*c**S(2)*log(f)**S(2)*Ei(c*log(f)/(a + b*x))/b**S(5) - S(2)*a**S(3)*c*f**(c/(a + b*x))*(a + b*x)*log(f)/b**S(5) - S(2)*a**S(3)*f**(c/(a + b*x))*(a + b*x)**S(2)/b**S(5) - a**S(2)*c**S(3)*log(f)**S(3)*Ei(c*log(f)/(a + b*x))/b**S(5) + a**S(2)*c**S(2)*f**(c/(a + b*x))*(a + b*x)*log(f)**S(2)/b**S(5) + a**S(2)*c*f**(c/(a + b*x))*(a + b*x)**S(2)*log(f)/b**S(5) + S(2)*a**S(2)*f**(c/(a + b*x))*(a + b*x)**S(3)/b**S(5) - S(4)*a*c**S(4)*Gamma(S(-4), -c*log(f)/(a + b*x))*log(f)**S(4)/b**S(5) - c**S(5)*Gamma(S(-5), -c*log(f)/(a + b*x))*log(f)**S(5)/b**S(5), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x))*x**S(3), x), x, a**S(3)*c*log(f)*Ei(c*log(f)/(a + b*x))/b**S(4) - a**S(3)*f**(c/(a + b*x))*(a + b*x)/b**S(4) - S(3)*a**S(2)*c**S(2)*log(f)**S(2)*Ei(c*log(f)/(a + b*x))/(S(2)*b**S(4)) + S(3)*a**S(2)*c*f**(c/(a + b*x))*(a + b*x)*log(f)/(S(2)*b**S(4)) + S(3)*a**S(2)*f**(c/(a + b*x))*(a + b*x)**S(2)/(S(2)*b**S(4)) + a*c**S(3)*log(f)**S(3)*Ei(c*log(f)/(a + b*x))/(S(2)*b**S(4)) - a*c**S(2)*f**(c/(a + b*x))*(a + b*x)*log(f)**S(2)/(S(2)*b**S(4)) - a*c*f**(c/(a + b*x))*(a + b*x)**S(2)*log(f)/(S(2)*b**S(4)) - a*f**(c/(a + b*x))*(a + b*x)**S(3)/b**S(4) + c**S(4)*Gamma(S(-4), -c*log(f)/(a + b*x))*log(f)**S(4)/b**S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x))*x**S(2), x), x, -a**S(2)*c*log(f)*Ei(c*log(f)/(a + b*x))/b**S(3) + a**S(2)*f**(c/(a + b*x))*(a + b*x)/b**S(3) + a*c**S(2)*log(f)**S(2)*Ei(c*log(f)/(a + b*x))/b**S(3) - a*c*f**(c/(a + b*x))*(a + b*x)*log(f)/b**S(3) - a*f**(c/(a + b*x))*(a + b*x)**S(2)/b**S(3) - c**S(3)*log(f)**S(3)*Ei(c*log(f)/(a + b*x))/(S(6)*b**S(3)) + c**S(2)*f**(c/(a + b*x))*(a + b*x)*log(f)**S(2)/(S(6)*b**S(3)) + c*f**(c/(a + b*x))*(a + b*x)**S(2)*log(f)/(S(6)*b**S(3)) + f**(c/(a + b*x))*(a + b*x)**S(3)/(S(3)*b**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x))*x, x), x, a*c*log(f)*Ei(c*log(f)/(a + b*x))/b**S(2) - a*f**(c/(a + b*x))*(a + b*x)/b**S(2) - c**S(2)*log(f)**S(2)*Ei(c*log(f)/(a + b*x))/(S(2)*b**S(2)) + c*f**(c/(a + b*x))*(a + b*x)*log(f)/(S(2)*b**S(2)) + f**(c/(a + b*x))*(a + b*x)**S(2)/(S(2)*b**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)), x), x, -c*log(f)*Ei(c*log(f)/(a + b*x))/b + f**(c/(a + b*x))*(a + b*x)/b, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x))/x, x), x, f**(c/a)*Ei(-b*c*x*log(f)/(a*(a + b*x))) - Ei(c*log(f)/(a + b*x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x))/x**S(2), x), x, -f**(c/(a + b*x))/x - b*f**(c/(a + b*x))/a - b*c*f**(c/a)*log(f)*Ei(-b*c*x*log(f)/(a*(a + b*x)))/a**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x))/x**S(3), x), x, -f**(c/(a + b*x))/(S(2)*x**S(2)) + b**S(2)*f**(c/(a + b*x))/(S(2)*a**S(2)) + b*c*f**(c/(a + b*x))*log(f)/(S(2)*a**S(2)*x) + b**S(2)*c*f**(c/a)*log(f)*Ei(-b*c*x*log(f)/(a*(a + b*x)))/a**S(3) + b**S(2)*c*f**(c/(a + b*x))*log(f)/(S(2)*a**S(3)) + b**S(2)*c**S(2)*f**(c/a)*log(f)**S(2)*Ei(-b*c*x*log(f)/(a*(a + b*x)))/(S(2)*a**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(2))*x**m, x), x, Integral(f**(c/(a + b*x)**S(2))*x**m, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(2))*x**S(4), x), x, -sqrt(pi)*a**S(4)*sqrt(c)*sqrt(log(f))*erfi(sqrt(c)*sqrt(log(f))/(a + b*x))/b**S(5) + a**S(4)*f**(c/(a + b*x)**S(2))*(a + b*x)/b**S(5) + S(2)*a**S(3)*c*log(f)*Ei(c*log(f)/(a + b*x)**S(2))/b**S(5) - S(2)*a**S(3)*f**(c/(a + b*x)**S(2))*(a + b*x)**S(2)/b**S(5) - S(4)*sqrt(pi)*a**S(2)*c**(S(3)/2)*log(f)**(S(3)/2)*erfi(sqrt(c)*sqrt(log(f))/(a + b*x))/b**S(5) + S(4)*a**S(2)*c*f**(c/(a + b*x)**S(2))*(a + b*x)*log(f)/b**S(5) + S(2)*a**S(2)*f**(c/(a + b*x)**S(2))*(a + b*x)**S(3)/b**S(5) + a*c**S(2)*log(f)**S(2)*Ei(c*log(f)/(a + b*x)**S(2))/b**S(5) - a*c*f**(c/(a + b*x)**S(2))*(a + b*x)**S(2)*log(f)/b**S(5) - a*f**(c/(a + b*x)**S(2))*(a + b*x)**S(4)/b**S(5) - S(4)*sqrt(pi)*c**(S(5)/2)*log(f)**(S(5)/2)*erfi(sqrt(c)*sqrt(log(f))/(a + b*x))/(S(15)*b**S(5)) + S(4)*c**S(2)*f**(c/(a + b*x)**S(2))*(a + b*x)*log(f)**S(2)/(S(15)*b**S(5)) + S(2)*c*f**(c/(a + b*x)**S(2))*(a + b*x)**S(3)*log(f)/(S(15)*b**S(5)) + f**(c/(a + b*x)**S(2))*(a + b*x)**S(5)/(S(5)*b**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(2))*x**S(3), x), x, sqrt(pi)*a**S(3)*sqrt(c)*sqrt(log(f))*erfi(sqrt(c)*sqrt(log(f))/(a + b*x))/b**S(4) - a**S(3)*f**(c/(a + b*x)**S(2))*(a + b*x)/b**S(4) - S(3)*a**S(2)*c*log(f)*Ei(c*log(f)/(a + b*x)**S(2))/(S(2)*b**S(4)) + S(3)*a**S(2)*f**(c/(a + b*x)**S(2))*(a + b*x)**S(2)/(S(2)*b**S(4)) + S(2)*sqrt(pi)*a*c**(S(3)/2)*log(f)**(S(3)/2)*erfi(sqrt(c)*sqrt(log(f))/(a + b*x))/b**S(4) - S(2)*a*c*f**(c/(a + b*x)**S(2))*(a + b*x)*log(f)/b**S(4) - a*f**(c/(a + b*x)**S(2))*(a + b*x)**S(3)/b**S(4) - c**S(2)*log(f)**S(2)*Ei(c*log(f)/(a + b*x)**S(2))/(S(4)*b**S(4)) + c*f**(c/(a + b*x)**S(2))*(a + b*x)**S(2)*log(f)/(S(4)*b**S(4)) + f**(c/(a + b*x)**S(2))*(a + b*x)**S(4)/(S(4)*b**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(2))*x**S(2), x), x, -sqrt(pi)*a**S(2)*sqrt(c)*sqrt(log(f))*erfi(sqrt(c)*sqrt(log(f))/(a + b*x))/b**S(3) + a**S(2)*f**(c/(a + b*x)**S(2))*(a + b*x)/b**S(3) + a*c*log(f)*Ei(c*log(f)/(a + b*x)**S(2))/b**S(3) - a*f**(c/(a + b*x)**S(2))*(a + b*x)**S(2)/b**S(3) - S(2)*sqrt(pi)*c**(S(3)/2)*log(f)**(S(3)/2)*erfi(sqrt(c)*sqrt(log(f))/(a + b*x))/(S(3)*b**S(3)) + S(2)*c*f**(c/(a + b*x)**S(2))*(a + b*x)*log(f)/(S(3)*b**S(3)) + f**(c/(a + b*x)**S(2))*(a + b*x)**S(3)/(S(3)*b**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(2))*x, x), x, sqrt(pi)*a*sqrt(c)*sqrt(log(f))*erfi(sqrt(c)*sqrt(log(f))/(a + b*x))/b**S(2) - a*f**(c/(a + b*x)**S(2))*(a + b*x)/b**S(2) - c*log(f)*Ei(c*log(f)/(a + b*x)**S(2))/(S(2)*b**S(2)) + f**(c/(a + b*x)**S(2))*(a + b*x)**S(2)/(S(2)*b**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(2)), x), x, -sqrt(pi)*sqrt(c)*sqrt(log(f))*erfi(sqrt(c)*sqrt(log(f))/(a + b*x))/b + f**(c/(a + b*x)**S(2))*(a + b*x)/b, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(2))/x, x), x, Integral(f**(c/(a + b*x)**S(2))/x, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(2))/x**S(2), x), x, Integral(f**(c/(a + b*x)**S(2))/x**S(2), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(2))/x**S(3), x), x, Integral(f**(c/(a + b*x)**S(2))/x**S(3), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(3))*x**m, x), x, Integral(f**(c/(a + b*x)**S(3))*x**m, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(3))*x**S(4), x), x, a**S(4)*(-c*log(f)/(a + b*x)**S(3))**(S(1)/3)*(a + b*x)*Gamma(S(-1)/3, -c*log(f)/(a + b*x)**S(3))/(S(3)*b**S(5)) - S(4)*a**S(3)*(-c*log(f)/(a + b*x)**S(3))**(S(2)/3)*(a + b*x)**S(2)*Gamma(S(-2)/3, -c*log(f)/(a + b*x)**S(3))/(S(3)*b**S(5)) - S(2)*a**S(2)*c*log(f)*Ei(c*log(f)/(a + b*x)**S(3))/b**S(5) + S(2)*a**S(2)*f**(c/(a + b*x)**S(3))*(a + b*x)**S(3)/b**S(5) - S(4)*a*(-c*log(f)/(a + b*x)**S(3))**(S(4)/3)*(a + b*x)**S(4)*Gamma(S(-4)/3, -c*log(f)/(a + b*x)**S(3))/(S(3)*b**S(5)) + (-c*log(f)/(a + b*x)**S(3))**(S(5)/3)*(a + b*x)**S(5)*Gamma(S(-5)/3, -c*log(f)/(a + b*x)**S(3))/(S(3)*b**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(3))*x**S(3), x), x, -a**S(3)*(-c*log(f)/(a + b*x)**S(3))**(S(1)/3)*(a + b*x)*Gamma(S(-1)/3, -c*log(f)/(a + b*x)**S(3))/(S(3)*b**S(4)) + a**S(2)*(-c*log(f)/(a + b*x)**S(3))**(S(2)/3)*(a + b*x)**S(2)*Gamma(S(-2)/3, -c*log(f)/(a + b*x)**S(3))/b**S(4) + a*c*log(f)*Ei(c*log(f)/(a + b*x)**S(3))/b**S(4) - a*f**(c/(a + b*x)**S(3))*(a + b*x)**S(3)/b**S(4) + (-c*log(f)/(a + b*x)**S(3))**(S(4)/3)*(a + b*x)**S(4)*Gamma(S(-4)/3, -c*log(f)/(a + b*x)**S(3))/(S(3)*b**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(3))*x**S(2), x), x, a**S(2)*(-c*log(f)/(a + b*x)**S(3))**(S(1)/3)*(a + b*x)*Gamma(S(-1)/3, -c*log(f)/(a + b*x)**S(3))/(S(3)*b**S(3)) - S(2)*a*(-c*log(f)/(a + b*x)**S(3))**(S(2)/3)*(a + b*x)**S(2)*Gamma(S(-2)/3, -c*log(f)/(a + b*x)**S(3))/(S(3)*b**S(3)) - c*log(f)*Ei(c*log(f)/(a + b*x)**S(3))/(S(3)*b**S(3)) + f**(c/(a + b*x)**S(3))*(a + b*x)**S(3)/(S(3)*b**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(3))*x, x), x, -a*(-c*log(f)/(a + b*x)**S(3))**(S(1)/3)*(a + b*x)*Gamma(S(-1)/3, -c*log(f)/(a + b*x)**S(3))/(S(3)*b**S(2)) + (-c*log(f)/(a + b*x)**S(3))**(S(2)/3)*(a + b*x)**S(2)*Gamma(S(-2)/3, -c*log(f)/(a + b*x)**S(3))/(S(3)*b**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(3)), x), x, (-c*log(f)/(a + b*x)**S(3))**(S(1)/3)*(a/S(3) + b*x/S(3))*Gamma(S(-1)/3, -c*log(f)/(a + b*x)**S(3))/b, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(3))/x, x), x, Integral(f**(c/(a + b*x)**S(3))/x, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(3))/x**S(2), x), x, Integral(f**(c/(a + b*x)**S(3))/x**S(2), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c/(a + b*x)**S(3))/x**S(3), x), x, Integral(f**(c/(a + b*x)**S(3))/x**S(3), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**n)*x**m, x), x, Integral(f**(c*(a + b*x)**n)*x**m, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**n)*x**S(3), x), x, a**S(3)*(-c*(a + b*x)**n*log(f))**(-S(1)/n)*(a + b*x)*Gamma(S(1)/n, -c*(a + b*x)**n*log(f))/(b**S(4)*n) - S(3)*a**S(2)*(-c*(a + b*x)**n*log(f))**(-S(2)/n)*(a + b*x)**S(2)*Gamma(S(2)/n, -c*(a + b*x)**n*log(f))/(b**S(4)*n) + S(3)*a*(-c*(a + b*x)**n*log(f))**(-S(3)/n)*(a + b*x)**S(3)*Gamma(S(3)/n, -c*(a + b*x)**n*log(f))/(b**S(4)*n) - (-c*(a + b*x)**n*log(f))**(-S(4)/n)*(a + b*x)**S(4)*Gamma(S(4)/n, -c*(a + b*x)**n*log(f))/(b**S(4)*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**n)*x**S(2), x), x, -a**S(2)*(-c*(a + b*x)**n*log(f))**(-S(1)/n)*(a + b*x)*Gamma(S(1)/n, -c*(a + b*x)**n*log(f))/(b**S(3)*n) + S(2)*a*(-c*(a + b*x)**n*log(f))**(-S(2)/n)*(a + b*x)**S(2)*Gamma(S(2)/n, -c*(a + b*x)**n*log(f))/(b**S(3)*n) - (-c*(a + b*x)**n*log(f))**(-S(3)/n)*(a + b*x)**S(3)*Gamma(S(3)/n, -c*(a + b*x)**n*log(f))/(b**S(3)*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**n)*x, x), x, a*(-c*(a + b*x)**n*log(f))**(-S(1)/n)*(a + b*x)*Gamma(S(1)/n, -c*(a + b*x)**n*log(f))/(b**S(2)*n) - (-c*(a + b*x)**n*log(f))**(-S(2)/n)*(a + b*x)**S(2)*Gamma(S(2)/n, -c*(a + b*x)**n*log(f))/(b**S(2)*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**n), x), x, (-c*(a + b*x)**n*log(f))**(-S(1)/n)*(-a - b*x)*Gamma(S(1)/n, -c*(a + b*x)**n*log(f))/(b*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**n)/x, x), x, Integral(f**(c*(a + b*x)**n)/x, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**n)/x**S(2), x), x, Integral(f**(c*(a + b*x)**n)/x**S(2), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(c*(a + b*x)**n)/x**S(3), x), x, Integral(f**(c*(a + b*x)**n)/x**S(3), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**m, x), x, -F**a*(-b*(c + d*x)**S(2)*log(F))**(-m/S(2) + S(-1)/2)*(c + d*x)**(m + S(1))*Gamma(m/S(2) + S(1)/2, -b*(c + d*x)**S(2)*log(F))/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(11), x), x, -F**a*Gamma(S(6), -b*(c + d*x)**S(2)*log(F))/(S(2)*b**S(6)*d*log(F)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(9), x), x, F**a*Gamma(S(5), -b*(c + d*x)**S(2)*log(F))/(S(2)*b**S(5)*d*log(F)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(7), x), x, F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(6)/(S(2)*b*d*log(F)) - S(3)*F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(4)/(S(2)*b**S(2)*d*log(F)**S(2)) + S(3)*F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(2)/(b**S(3)*d*log(F)**S(3)) - S(3)*F**(a + b*(c + d*x)**S(2))/(b**S(4)*d*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(5), x), x, F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(4)/(S(2)*b*d*log(F)) - F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(2)/(b**S(2)*d*log(F)**S(2)) + F**(a + b*(c + d*x)**S(2))/(b**S(3)*d*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(3), x), x, F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(2)/(S(2)*b*d*log(F)) - F**(a + b*(c + d*x)**S(2))/(S(2)*b**S(2)*d*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x), x), x, F**(a + b*(c + d*x)**S(2))/(S(2)*b*d*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x), x), x, F**a*Ei(b*(c + d*x)**S(2)*log(F))/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x)**S(3), x), x, F**a*b*log(F)*Ei(b*(c + d*x)**S(2)*log(F))/(S(2)*d) - F**(a + b*(c + d*x)**S(2))/(S(2)*d*(c + d*x)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x)**S(5), x), x, F**a*b**S(2)*log(F)**S(2)*Ei(b*(c + d*x)**S(2)*log(F))/(S(4)*d) - F**(a + b*(c + d*x)**S(2))*b*log(F)/(S(4)*d*(c + d*x)**S(2)) - F**(a + b*(c + d*x)**S(2))/(S(4)*d*(c + d*x)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x)**S(7), x), x, F**a*b**S(3)*log(F)**S(3)*Ei(b*(c + d*x)**S(2)*log(F))/(S(12)*d) - F**(a + b*(c + d*x)**S(2))*b**S(2)*log(F)**S(2)/(S(12)*d*(c + d*x)**S(2)) - F**(a + b*(c + d*x)**S(2))*b*log(F)/(S(12)*d*(c + d*x)**S(4)) - F**(a + b*(c + d*x)**S(2))/(S(6)*d*(c + d*x)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x)**S(9), x), x, -F**a*b**S(4)*Gamma(S(-4), -b*(c + d*x)**S(2)*log(F))*log(F)**S(4)/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x)**S(11), x), x, F**a*b**S(5)*Gamma(S(-5), -b*(c + d*x)**S(2)*log(F))*log(F)**S(5)/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(12), x), x, -F**a*(c + d*x)**S(13)*Gamma(S(13)/2, -b*(c + d*x)**S(2)*log(F))/(S(2)*d*(-b*(c + d*x)**S(2)*log(F))**(S(13)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(10), x), x, -F**a*(c + d*x)**S(11)*Gamma(S(11)/2, -b*(c + d*x)**S(2)*log(F))/(S(2)*d*(-b*(c + d*x)**S(2)*log(F))**(S(11)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(8), x), x, S(105)*sqrt(pi)*F**a*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(32)*b**(S(9)/2)*d*log(F)**(S(9)/2)) + F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(7)/(S(2)*b*d*log(F)) - S(7)*F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(5)/(S(4)*b**S(2)*d*log(F)**S(2)) + S(35)*F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(3)/(S(8)*b**S(3)*d*log(F)**S(3)) - S(105)*F**(a + b*(c + d*x)**S(2))*(c + d*x)/(S(16)*b**S(4)*d*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(6), x), x, -S(15)*sqrt(pi)*F**a*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(16)*b**(S(7)/2)*d*log(F)**(S(7)/2)) + F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(5)/(S(2)*b*d*log(F)) - S(5)*F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(3)/(S(4)*b**S(2)*d*log(F)**S(2)) + S(15)*F**(a + b*(c + d*x)**S(2))*(c + d*x)/(S(8)*b**S(3)*d*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(4), x), x, S(3)*sqrt(pi)*F**a*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(8)*b**(S(5)/2)*d*log(F)**(S(5)/2)) + F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(3)/(S(2)*b*d*log(F)) - S(3)*F**(a + b*(c + d*x)**S(2))*(c + d*x)/(S(4)*b**S(2)*d*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(c + d*x)**S(2), x), x, -sqrt(pi)*F**a*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(4)*b**(S(3)/2)*d*log(F)**(S(3)/2)) + F**(a + b*(c + d*x)**S(2))*(c + d*x)/(S(2)*b*d*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2)), x), x, sqrt(pi)*F**a*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(2)*sqrt(b)*d*sqrt(log(F))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x)**S(2), x), x, sqrt(pi)*F**a*sqrt(b)*sqrt(log(F))*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/d - F**(a + b*(c + d*x)**S(2))/(d*(c + d*x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x)**S(4), x), x, S(2)*sqrt(pi)*F**a*b**(S(3)/2)*log(F)**(S(3)/2)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(3)*d) - S(2)*F**(a + b*(c + d*x)**S(2))*b*log(F)/(S(3)*d*(c + d*x)) - F**(a + b*(c + d*x)**S(2))/(S(3)*d*(c + d*x)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x)**S(6), x), x, S(4)*sqrt(pi)*F**a*b**(S(5)/2)*log(F)**(S(5)/2)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(15)*d) - S(4)*F**(a + b*(c + d*x)**S(2))*b**S(2)*log(F)**S(2)/(S(15)*d*(c + d*x)) - S(2)*F**(a + b*(c + d*x)**S(2))*b*log(F)/(S(15)*d*(c + d*x)**S(3)) - F**(a + b*(c + d*x)**S(2))/(S(5)*d*(c + d*x)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x)**S(8), x), x, S(8)*sqrt(pi)*F**a*b**(S(7)/2)*log(F)**(S(7)/2)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(105)*d) - S(8)*F**(a + b*(c + d*x)**S(2))*b**S(3)*log(F)**S(3)/(S(105)*d*(c + d*x)) - S(4)*F**(a + b*(c + d*x)**S(2))*b**S(2)*log(F)**S(2)/(S(105)*d*(c + d*x)**S(3)) - S(2)*F**(a + b*(c + d*x)**S(2))*b*log(F)/(S(35)*d*(c + d*x)**S(5)) - F**(a + b*(c + d*x)**S(2))/(S(7)*d*(c + d*x)**S(7)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x)**S(10), x), x, -F**a*(-b*(c + d*x)**S(2)*log(F))**(S(9)/2)*Gamma(S(-9)/2, -b*(c + d*x)**S(2)*log(F))/(S(2)*d*(c + d*x)**S(9)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(c + d*x)**S(12), x), x, -F**a*(-b*(c + d*x)**S(2)*log(F))**(S(11)/2)*Gamma(S(-11)/2, -b*(c + d*x)**S(2)*log(F))/(S(2)*d*(c + d*x)**S(11)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))*(c + d*x)**m, x), x, -F**a*(-b*(c + d*x)**S(3)*log(F))**(-m/S(3) + S(-1)/3)*(c + d*x)**(m + S(1))*Gamma(m/S(3) + S(1)/3, -b*(c + d*x)**S(3)*log(F))/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(17), x), x, -F**a*Gamma(S(6), -b*(c + d*x)**S(3)*log(F))/(S(3)*b**S(6)*d*log(F)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(14), x), x, F**a*Gamma(S(5), -b*(c + d*x)**S(3)*log(F))/(S(3)*b**S(5)*d*log(F)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(11), x), x, F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(9)/(S(3)*b*d*log(F)) - F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(6)/(b**S(2)*d*log(F)**S(2)) + S(2)*F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(3)/(b**S(3)*d*log(F)**S(3)) - S(2)*F**(a + b*(c + d*x)**S(3))/(b**S(4)*d*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(8), x), x, F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(6)/(S(3)*b*d*log(F)) - S(2)*F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(3)/(S(3)*b**S(2)*d*log(F)**S(2)) + S(2)*F**(a + b*(c + d*x)**S(3))/(S(3)*b**S(3)*d*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(5), x), x, F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(3)/(S(3)*b*d*log(F)) - F**(a + b*(c + d*x)**S(3))/(S(3)*b**S(2)*d*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(2), x), x, F**(a + b*(c + d*x)**S(3))/(S(3)*b*d*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))/(c + d*x), x), x, F**a*Ei(b*(c + d*x)**S(3)*log(F))/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))/(c + d*x)**S(4), x), x, F**a*b*log(F)*Ei(b*(c + d*x)**S(3)*log(F))/(S(3)*d) - F**(a + b*(c + d*x)**S(3))/(S(3)*d*(c + d*x)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))/(c + d*x)**S(7), x), x, F**a*b**S(2)*log(F)**S(2)*Ei(b*(c + d*x)**S(3)*log(F))/(S(6)*d) - F**(a + b*(c + d*x)**S(3))*b*log(F)/(S(6)*d*(c + d*x)**S(3)) - F**(a + b*(c + d*x)**S(3))/(S(6)*d*(c + d*x)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))/(c + d*x)**S(10), x), x, F**a*b**S(3)*log(F)**S(3)*Ei(b*(c + d*x)**S(3)*log(F))/(S(18)*d) - F**(a + b*(c + d*x)**S(3))*b**S(2)*log(F)**S(2)/(S(18)*d*(c + d*x)**S(3)) - F**(a + b*(c + d*x)**S(3))*b*log(F)/(S(18)*d*(c + d*x)**S(6)) - F**(a + b*(c + d*x)**S(3))/(S(9)*d*(c + d*x)**S(9)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))/(c + d*x)**S(13), x), x, -F**a*b**S(4)*Gamma(S(-4), -b*(c + d*x)**S(3)*log(F))*log(F)**S(4)/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))/(c + d*x)**S(16), x), x, F**a*b**S(5)*Gamma(S(-5), -b*(c + d*x)**S(3)*log(F))*log(F)**S(5)/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))*(c + d*x)**S(3), x), x, -F**a*(c + d*x)**S(4)*Gamma(S(4)/3, -b*(c + d*x)**S(3)*log(F))/(S(3)*d*(-b*(c + d*x)**S(3)*log(F))**(S(4)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))*(c + d*x), x), x, -F**a*(c + d*x)**S(2)*Gamma(S(2)/3, -b*(c + d*x)**S(3)*log(F))/(S(3)*d*(-b*(c + d*x)**S(3)*log(F))**(S(2)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3)), x), x, -F**a*(c + d*x)*Gamma(S(1)/3, -b*(c + d*x)**S(3)*log(F))/(S(3)*d*(-b*(c + d*x)**S(3)*log(F))**(S(1)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))/(c + d*x)**S(2), x), x, -F**a*(-b*(c + d*x)**S(3)*log(F))**(S(1)/3)*Gamma(S(-1)/3, -b*(c + d*x)**S(3)*log(F))/(S(3)*d*(c + d*x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))/(c + d*x)**S(3), x), x, -F**a*(-b*(c + d*x)**S(3)*log(F))**(S(2)/3)*Gamma(S(-2)/3, -b*(c + d*x)**S(3)*log(F))/(S(3)*d*(c + d*x)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(3))/(c + d*x)**S(5), x), x, -F**a*(-b*(c + d*x)**S(3)*log(F))**(S(4)/3)*Gamma(S(-4)/3, -b*(c + d*x)**S(3)*log(F))/(S(3)*d*(c + d*x)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*sqrt(c + d*x)), x), x, S(2)*f**(a + b*sqrt(c + d*x))*sqrt(c + d*x)/(b*d*log(f)) - S(2)*f**(a + b*sqrt(c + d*x))/(b**S(2)*d*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*(c + d*x)**(S(1)/3)), x), x, S(3)*f**(a + b*(c + d*x)**(S(1)/3))*(c + d*x)**(S(2)/3)/(b*d*log(f)) - S(6)*f**(a + b*(c + d*x)**(S(1)/3))*(c + d*x)**(S(1)/3)/(b**S(2)*d*log(f)**S(2)) + S(6)*f**(a + b*(c + d*x)**(S(1)/3))/(b**S(3)*d*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))*(c + d*x)**m, x), x, F**a*(-b*log(F)/(c + d*x))**(m + S(1))*(c + d*x)**(m + S(1))*Gamma(-m + S(-1), -b*log(F)/(c + d*x))/d, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))*(c + d*x)**S(4), x), x, -F**a*b**S(5)*Gamma(S(-5), -b*log(F)/(c + d*x))*log(F)**S(5)/d, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))*(c + d*x)**S(3), x), x, F**a*b**S(4)*Gamma(S(-4), -b*log(F)/(c + d*x))*log(F)**S(4)/d, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))*(c + d*x)**S(2), x), x, -F**a*b**S(3)*log(F)**S(3)*Ei(b*log(F)/(c + d*x))/(S(6)*d) + F**(a + b/(c + d*x))*b**S(2)*(c + d*x)*log(F)**S(2)/(S(6)*d) + F**(a + b/(c + d*x))*b*(c + d*x)**S(2)*log(F)/(S(6)*d) + F**(a + b/(c + d*x))*(c + d*x)**S(3)/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))*(c + d*x), x), x, -F**a*b**S(2)*log(F)**S(2)*Ei(b*log(F)/(c + d*x))/(S(2)*d) + F**(a + b/(c + d*x))*b*(c + d*x)*log(F)/(S(2)*d) + F**(a + b/(c + d*x))*(c + d*x)**S(2)/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)), x), x, -F**a*b*log(F)*Ei(b*log(F)/(c + d*x))/d + F**(a + b/(c + d*x))*(c + d*x)/d, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))/(c + d*x), x), x, -F**a*Ei(b*log(F)/(c + d*x))/d, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))/(c + d*x)**S(2), x), x, -F**(a + b/(c + d*x))/(b*d*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))/(c + d*x)**S(3), x), x, -F**(a + b/(c + d*x))/(b*d*(c + d*x)*log(F)) + F**(a + b/(c + d*x))/(b**S(2)*d*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))/(c + d*x)**S(4), x), x, -F**(a + b/(c + d*x))/(b*d*(c + d*x)**S(2)*log(F)) + S(2)*F**(a + b/(c + d*x))/(b**S(2)*d*(c + d*x)*log(F)**S(2)) - S(2)*F**(a + b/(c + d*x))/(b**S(3)*d*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))/(c + d*x)**S(5), x), x, -F**(a + b/(c + d*x))/(b*d*(c + d*x)**S(3)*log(F)) + S(3)*F**(a + b/(c + d*x))/(b**S(2)*d*(c + d*x)**S(2)*log(F)**S(2)) - S(6)*F**(a + b/(c + d*x))/(b**S(3)*d*(c + d*x)*log(F)**S(3)) + S(6)*F**(a + b/(c + d*x))/(b**S(4)*d*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))/(c + d*x)**S(6), x), x, -F**a*Gamma(S(5), -b*log(F)/(c + d*x))/(b**S(5)*d*log(F)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))/(c + d*x)**S(7), x), x, F**a*Gamma(S(6), -b*log(F)/(c + d*x))/(b**S(6)*d*log(F)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))*(c + d*x)**m, x), x, F**a*(-b*log(F)/(c + d*x)**S(2))**(m/S(2) + S(1)/2)*(c + d*x)**(m + S(1))*Gamma(-m/S(2) + S(-1)/2, -b*log(F)/(c + d*x)**S(2))/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(9), x), x, -F**a*b**S(5)*Gamma(S(-5), -b*log(F)/(c + d*x)**S(2))*log(F)**S(5)/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(7), x), x, F**a*b**S(4)*Gamma(S(-4), -b*log(F)/(c + d*x)**S(2))*log(F)**S(4)/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(5), x), x, -F**a*b**S(3)*log(F)**S(3)*Ei(b*log(F)/(c + d*x)**S(2))/(S(12)*d) + F**(a + b/(c + d*x)**S(2))*b**S(2)*(c + d*x)**S(2)*log(F)**S(2)/(S(12)*d) + F**(a + b/(c + d*x)**S(2))*b*(c + d*x)**S(4)*log(F)/(S(12)*d) + F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(6)/(S(6)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(3), x), x, -F**a*b**S(2)*log(F)**S(2)*Ei(b*log(F)/(c + d*x)**S(2))/(S(4)*d) + F**(a + b/(c + d*x)**S(2))*b*(c + d*x)**S(2)*log(F)/(S(4)*d) + F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(4)/(S(4)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))*(c + d*x), x), x, -F**a*b*log(F)*Ei(b*log(F)/(c + d*x)**S(2))/(S(2)*d) + F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(2)/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x), x), x, -F**a*Ei(b*log(F)/(c + d*x)**S(2))/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(3), x), x, -F**(a + b/(c + d*x)**S(2))/(S(2)*b*d*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(5), x), x, -F**(a + b/(c + d*x)**S(2))/(S(2)*b*d*(c + d*x)**S(2)*log(F)) + F**(a + b/(c + d*x)**S(2))/(S(2)*b**S(2)*d*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(7), x), x, -F**(a + b/(c + d*x)**S(2))/(S(2)*b*d*(c + d*x)**S(4)*log(F)) + F**(a + b/(c + d*x)**S(2))/(b**S(2)*d*(c + d*x)**S(2)*log(F)**S(2)) - F**(a + b/(c + d*x)**S(2))/(b**S(3)*d*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(9), x), x, -F**(a + b/(c + d*x)**S(2))/(S(2)*b*d*(c + d*x)**S(6)*log(F)) + S(3)*F**(a + b/(c + d*x)**S(2))/(S(2)*b**S(2)*d*(c + d*x)**S(4)*log(F)**S(2)) - S(3)*F**(a + b/(c + d*x)**S(2))/(b**S(3)*d*(c + d*x)**S(2)*log(F)**S(3)) + S(3)*F**(a + b/(c + d*x)**S(2))/(b**S(4)*d*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(11), x), x, -F**a*Gamma(S(5), -b*log(F)/(c + d*x)**S(2))/(S(2)*b**S(5)*d*log(F)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(13), x), x, F**a*Gamma(S(6), -b*log(F)/(c + d*x)**S(2))/(S(2)*b**S(6)*d*log(F)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(10), x), x, F**a*(-b*log(F)/(c + d*x)**S(2))**(S(11)/2)*(c + d*x)**S(11)*Gamma(S(-11)/2, -b*log(F)/(c + d*x)**S(2))/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(8), x), x, F**a*(-b*log(F)/(c + d*x)**S(2))**(S(9)/2)*(c + d*x)**S(9)*Gamma(S(-9)/2, -b*log(F)/(c + d*x)**S(2))/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(6), x), x, -S(8)*sqrt(pi)*F**a*b**(S(7)/2)*log(F)**(S(7)/2)*erfi(sqrt(b)*sqrt(log(F))/(c + d*x))/(S(105)*d) + S(8)*F**(a + b/(c + d*x)**S(2))*b**S(3)*(c + d*x)*log(F)**S(3)/(S(105)*d) + S(4)*F**(a + b/(c + d*x)**S(2))*b**S(2)*(c + d*x)**S(3)*log(F)**S(2)/(S(105)*d) + S(2)*F**(a + b/(c + d*x)**S(2))*b*(c + d*x)**S(5)*log(F)/(S(35)*d) + F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(7)/(S(7)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(4), x), x, -S(4)*sqrt(pi)*F**a*b**(S(5)/2)*log(F)**(S(5)/2)*erfi(sqrt(b)*sqrt(log(F))/(c + d*x))/(S(15)*d) + S(4)*F**(a + b/(c + d*x)**S(2))*b**S(2)*(c + d*x)*log(F)**S(2)/(S(15)*d) + S(2)*F**(a + b/(c + d*x)**S(2))*b*(c + d*x)**S(3)*log(F)/(S(15)*d) + F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(5)/(S(5)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(2), x), x, -S(2)*sqrt(pi)*F**a*b**(S(3)/2)*log(F)**(S(3)/2)*erfi(sqrt(b)*sqrt(log(F))/(c + d*x))/(S(3)*d) + S(2)*F**(a + b/(c + d*x)**S(2))*b*(c + d*x)*log(F)/(S(3)*d) + F**(a + b/(c + d*x)**S(2))*(c + d*x)**S(3)/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2)), x), x, -sqrt(pi)*F**a*sqrt(b)*sqrt(log(F))*erfi(sqrt(b)*sqrt(log(F))/(c + d*x))/d + F**(a + b/(c + d*x)**S(2))*(c + d*x)/d, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(2), x), x, -sqrt(pi)*F**a*erfi(sqrt(b)*sqrt(log(F))/(c + d*x))/(S(2)*sqrt(b)*d*sqrt(log(F))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(4), x), x, sqrt(pi)*F**a*erfi(sqrt(b)*sqrt(log(F))/(c + d*x))/(S(4)*b**(S(3)/2)*d*log(F)**(S(3)/2)) - F**(a + b/(c + d*x)**S(2))/(S(2)*b*d*(c + d*x)*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(6), x), x, -S(3)*sqrt(pi)*F**a*erfi(sqrt(b)*sqrt(log(F))/(c + d*x))/(S(8)*b**(S(5)/2)*d*log(F)**(S(5)/2)) - F**(a + b/(c + d*x)**S(2))/(S(2)*b*d*(c + d*x)**S(3)*log(F)) + S(3)*F**(a + b/(c + d*x)**S(2))/(S(4)*b**S(2)*d*(c + d*x)*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(8), x), x, S(15)*sqrt(pi)*F**a*erfi(sqrt(b)*sqrt(log(F))/(c + d*x))/(S(16)*b**(S(7)/2)*d*log(F)**(S(7)/2)) - F**(a + b/(c + d*x)**S(2))/(S(2)*b*d*(c + d*x)**S(5)*log(F)) + S(5)*F**(a + b/(c + d*x)**S(2))/(S(4)*b**S(2)*d*(c + d*x)**S(3)*log(F)**S(2)) - S(15)*F**(a + b/(c + d*x)**S(2))/(S(8)*b**S(3)*d*(c + d*x)*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(10), x), x, -S(105)*sqrt(pi)*F**a*erfi(sqrt(b)*sqrt(log(F))/(c + d*x))/(S(32)*b**(S(9)/2)*d*log(F)**(S(9)/2)) - F**(a + b/(c + d*x)**S(2))/(S(2)*b*d*(c + d*x)**S(7)*log(F)) + S(7)*F**(a + b/(c + d*x)**S(2))/(S(4)*b**S(2)*d*(c + d*x)**S(5)*log(F)**S(2)) - S(35)*F**(a + b/(c + d*x)**S(2))/(S(8)*b**S(3)*d*(c + d*x)**S(3)*log(F)**S(3)) + S(105)*F**(a + b/(c + d*x)**S(2))/(S(16)*b**S(4)*d*(c + d*x)*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(12), x), x, F**a*Gamma(S(11)/2, -b*log(F)/(c + d*x)**S(2))/(S(2)*d*(-b*log(F)/(c + d*x)**S(2))**(S(11)/2)*(c + d*x)**S(11)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(2))/(c + d*x)**S(14), x), x, F**a*Gamma(S(13)/2, -b*log(F)/(c + d*x)**S(2))/(S(2)*d*(-b*log(F)/(c + d*x)**S(2))**(S(13)/2)*(c + d*x)**S(13)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))*(c + d*x)**m, x), x, F**a*(-b*log(F)/(c + d*x)**S(3))**(m/S(3) + S(1)/3)*(c + d*x)**(m + S(1))*Gamma(-m/S(3) + S(-1)/3, -b*log(F)/(c + d*x)**S(3))/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))*(c + d*x)**S(14), x), x, -F**a*b**S(5)*Gamma(S(-5), -b*log(F)/(c + d*x)**S(3))*log(F)**S(5)/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))*(c + d*x)**S(11), x), x, F**a*b**S(4)*Gamma(S(-4), -b*log(F)/(c + d*x)**S(3))*log(F)**S(4)/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))*(c + d*x)**S(8), x), x, -F**a*b**S(3)*log(F)**S(3)*Ei(b*log(F)/(c + d*x)**S(3))/(S(18)*d) + F**(a + b/(c + d*x)**S(3))*b**S(2)*(c + d*x)**S(3)*log(F)**S(2)/(S(18)*d) + F**(a + b/(c + d*x)**S(3))*b*(c + d*x)**S(6)*log(F)/(S(18)*d) + F**(a + b/(c + d*x)**S(3))*(c + d*x)**S(9)/(S(9)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))*(c + d*x)**S(5), x), x, -F**a*b**S(2)*log(F)**S(2)*Ei(b*log(F)/(c + d*x)**S(3))/(S(6)*d) + F**(a + b/(c + d*x)**S(3))*b*(c + d*x)**S(3)*log(F)/(S(6)*d) + F**(a + b/(c + d*x)**S(3))*(c + d*x)**S(6)/(S(6)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))*(c + d*x)**S(2), x), x, -F**a*b*log(F)*Ei(b*log(F)/(c + d*x)**S(3))/(S(3)*d) + F**(a + b/(c + d*x)**S(3))*(c + d*x)**S(3)/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))/(c + d*x), x), x, -F**a*Ei(b*log(F)/(c + d*x)**S(3))/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))/(c + d*x)**S(4), x), x, -F**(a + b/(c + d*x)**S(3))/(S(3)*b*d*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))/(c + d*x)**S(7), x), x, -F**(a + b/(c + d*x)**S(3))/(S(3)*b*d*(c + d*x)**S(3)*log(F)) + F**(a + b/(c + d*x)**S(3))/(S(3)*b**S(2)*d*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))/(c + d*x)**S(10), x), x, -F**(a + b/(c + d*x)**S(3))/(S(3)*b*d*(c + d*x)**S(6)*log(F)) + S(2)*F**(a + b/(c + d*x)**S(3))/(S(3)*b**S(2)*d*(c + d*x)**S(3)*log(F)**S(2)) - S(2)*F**(a + b/(c + d*x)**S(3))/(S(3)*b**S(3)*d*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))/(c + d*x)**S(13), x), x, -F**(a + b/(c + d*x)**S(3))/(S(3)*b*d*(c + d*x)**S(9)*log(F)) + F**(a + b/(c + d*x)**S(3))/(b**S(2)*d*(c + d*x)**S(6)*log(F)**S(2)) - S(2)*F**(a + b/(c + d*x)**S(3))/(b**S(3)*d*(c + d*x)**S(3)*log(F)**S(3)) + S(2)*F**(a + b/(c + d*x)**S(3))/(b**S(4)*d*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))/(c + d*x)**S(16), x), x, -F**a*Gamma(S(5), -b*log(F)/(c + d*x)**S(3))/(S(3)*b**S(5)*d*log(F)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))/(c + d*x)**S(19), x), x, F**a*Gamma(S(6), -b*log(F)/(c + d*x)**S(3))/(S(3)*b**S(6)*d*log(F)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))*(c + d*x)**S(3), x), x, F**a*(-b*log(F)/(c + d*x)**S(3))**(S(4)/3)*(c + d*x)**S(4)*Gamma(S(-4)/3, -b*log(F)/(c + d*x)**S(3))/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))*(c + d*x), x), x, F**a*(-b*log(F)/(c + d*x)**S(3))**(S(2)/3)*(c + d*x)**S(2)*Gamma(S(-2)/3, -b*log(F)/(c + d*x)**S(3))/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3)), x), x, F**a*(-b*log(F)/(c + d*x)**S(3))**(S(1)/3)*(c + d*x)*Gamma(S(-1)/3, -b*log(F)/(c + d*x)**S(3))/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))/(c + d*x)**S(2), x), x, F**a*Gamma(S(1)/3, -b*log(F)/(c + d*x)**S(3))/(S(3)*d*(-b*log(F)/(c + d*x)**S(3))**(S(1)/3)*(c + d*x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))/(c + d*x)**S(3), x), x, F**a*Gamma(S(2)/3, -b*log(F)/(c + d*x)**S(3))/(S(3)*d*(-b*log(F)/(c + d*x)**S(3))**(S(2)/3)*(c + d*x)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x)**S(3))/(c + d*x)**S(5), x), x, F**a*Gamma(S(4)/3, -b*log(F)/(c + d*x)**S(3))/(S(3)*d*(-b*log(F)/(c + d*x)**S(3))**(S(4)/3)*(c + d*x)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**m, x), x, -F**a*(-b*(c + d*x)**n*log(F))**(-(m + S(1))/n)*(c + d*x)**(m + S(1))*Gamma((m + S(1))/n, -b*(c + d*x)**n*log(F))/(d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**S(3), x), x, -F**a*(-b*(c + d*x)**n*log(F))**(-S(4)/n)*(c + d*x)**S(4)*Gamma(S(4)/n, -b*(c + d*x)**n*log(F))/(d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**S(2), x), x, -F**a*(-b*(c + d*x)**n*log(F))**(-S(3)/n)*(c + d*x)**S(3)*Gamma(S(3)/n, -b*(c + d*x)**n*log(F))/(d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x), x), x, -F**a*(-b*(c + d*x)**n*log(F))**(-S(2)/n)*(c + d*x)**S(2)*Gamma(S(2)/n, -b*(c + d*x)**n*log(F))/(d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n), x), x, -F**a*(-b*(c + d*x)**n*log(F))**(-S(1)/n)*(c + d*x)*Gamma(S(1)/n, -b*(c + d*x)**n*log(F))/(d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)/(c + d*x), x), x, F**a*Ei(b*(c + d*x)**n*log(F))/(d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)/(c + d*x)**S(2), x), x, -F**a*(-b*(c + d*x)**n*log(F))**(S(1)/n)*Gamma(-S(1)/n, -b*(c + d*x)**n*log(F))/(d*n*(c + d*x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)/(c + d*x)**S(3), x), x, -F**a*(-b*(c + d*x)**n*log(F))**(S(2)/n)*Gamma(-S(2)/n, -b*(c + d*x)**n*log(F))/(d*n*(c + d*x)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)/(c + d*x)**S(4), x), x, -F**a*(-b*(c + d*x)**n*log(F))**(S(3)/n)*Gamma(-S(3)/n, -b*(c + d*x)**n*log(F))/(d*n*(c + d*x)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**(S(6)*n + S(-1)), x), x, -F**a*Gamma(S(6), -b*(c + d*x)**n*log(F))/(b**S(6)*d*n*log(F)**S(6)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**(S(5)*n + S(-1)), x), x, F**a*Gamma(S(5), -b*(c + d*x)**n*log(F))/(b**S(5)*d*n*log(F)**S(5)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**(S(4)*n + S(-1)), x), x, F**(a + b*(c + d*x)**n)*(c + d*x)**(S(3)*n)/(b*d*n*log(F)) - S(3)*F**(a + b*(c + d*x)**n)*(c + d*x)**(S(2)*n)/(b**S(2)*d*n*log(F)**S(2)) + S(6)*F**(a + b*(c + d*x)**n)*(c + d*x)**n/(b**S(3)*d*n*log(F)**S(3)) - S(6)*F**(a + b*(c + d*x)**n)/(b**S(4)*d*n*log(F)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**(S(3)*n + S(-1)), x), x, F**(a + b*(c + d*x)**n)*(c + d*x)**(S(2)*n)/(b*d*n*log(F)) - S(2)*F**(a + b*(c + d*x)**n)*(c + d*x)**n/(b**S(2)*d*n*log(F)**S(2)) + S(2)*F**(a + b*(c + d*x)**n)/(b**S(3)*d*n*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**(S(2)*n + S(-1)), x), x, F**(a + b*(c + d*x)**n)*(c + d*x)**n/(b*d*n*log(F)) - F**(a + b*(c + d*x)**n)/(b**S(2)*d*n*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**(n + S(-1)), x), x, F**(a + b*(c + d*x)**n)/(b*d*n*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)/(c + d*x), x), x, F**a*Ei(b*(c + d*x)**n*log(F))/(d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**(-n + S(-1)), x), x, F**a*b*log(F)*Ei(b*(c + d*x)**n*log(F))/(d*n) - F**(a + b*(c + d*x)**n)*(c + d*x)**(-n)/(d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**(-S(2)*n + S(-1)), x), x, F**a*b**S(2)*log(F)**S(2)*Ei(b*(c + d*x)**n*log(F))/(S(2)*d*n) - F**(a + b*(c + d*x)**n)*b*(c + d*x)**(-n)*log(F)/(S(2)*d*n) - F**(a + b*(c + d*x)**n)*(c + d*x)**(-S(2)*n)/(S(2)*d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**(-S(3)*n + S(-1)), x), x, F**a*b**S(3)*log(F)**S(3)*Ei(b*(c + d*x)**n*log(F))/(S(6)*d*n) - F**(a + b*(c + d*x)**n)*b**S(2)*(c + d*x)**(-n)*log(F)**S(2)/(S(6)*d*n) - F**(a + b*(c + d*x)**n)*b*(c + d*x)**(-S(2)*n)*log(F)/(S(6)*d*n) - F**(a + b*(c + d*x)**n)*(c + d*x)**(-S(3)*n)/(S(3)*d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**(-S(4)*n + S(-1)), x), x, -F**a*b**S(4)*Gamma(S(-4), -b*(c + d*x)**n*log(F))*log(F)**S(4)/(d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**n)*(c + d*x)**(-S(5)*n + S(-1)), x), x, F**a*b**S(5)*Gamma(S(-5), -b*(c + d*x)**n*log(F))*log(F)**S(5)/(d*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(c*(a + b*x)**n)*(a + b*x)**(n/S(2) + S(-1)), x), x, sqrt(pi)*erfi(sqrt(c)*(a + b*x)**(n/S(2))*sqrt(log(F)))/(b*sqrt(c)*n*sqrt(log(F))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(-c*(a + b*x)**n)*(a + b*x)**(n/S(2) + S(-1)), x), x, sqrt(pi)*erf(sqrt(c)*(a + b*x)**(n/S(2))*sqrt(log(F)))/(b*sqrt(c)*n*sqrt(log(F))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(e + f*x)**S(5), x), x, sqrt(pi)*F**a*(-c*f + d*e)**S(5)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(2)*sqrt(b)*d**S(6)*sqrt(log(F))) - S(5)*sqrt(pi)*F**a*f**S(2)*(-c*f + d*e)**S(3)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(2)*b**(S(3)/2)*d**S(6)*log(F)**(S(3)/2)) + S(15)*sqrt(pi)*F**a*f**S(4)*(-c*f + d*e)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(8)*b**(S(5)/2)*d**S(6)*log(F)**(S(5)/2)) + F**(a + b*(c + d*x)**S(2))*f**S(5)*(c + d*x)**S(4)/(S(2)*b*d**S(6)*log(F)) + S(5)*F**(a + b*(c + d*x)**S(2))*f**S(4)*(c + d*x)**S(3)*(-c*f + d*e)/(S(2)*b*d**S(6)*log(F)) + S(5)*F**(a + b*(c + d*x)**S(2))*f**S(3)*(c + d*x)**S(2)*(-c*f + d*e)**S(2)/(b*d**S(6)*log(F)) + S(5)*F**(a + b*(c + d*x)**S(2))*f**S(2)*(c + d*x)*(-c*f + d*e)**S(3)/(b*d**S(6)*log(F)) + S(5)*F**(a + b*(c + d*x)**S(2))*f*(-c*f + d*e)**S(4)/(S(2)*b*d**S(6)*log(F)) - F**(a + b*(c + d*x)**S(2))*f**S(5)*(c + d*x)**S(2)/(b**S(2)*d**S(6)*log(F)**S(2)) - S(15)*F**(a + b*(c + d*x)**S(2))*f**S(4)*(c + d*x)*(-c*f + d*e)/(S(4)*b**S(2)*d**S(6)*log(F)**S(2)) - S(5)*F**(a + b*(c + d*x)**S(2))*f**S(3)*(-c*f + d*e)**S(2)/(b**S(2)*d**S(6)*log(F)**S(2)) + F**(a + b*(c + d*x)**S(2))*f**S(5)/(b**S(3)*d**S(6)*log(F)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(e + f*x)**S(4), x), x, sqrt(pi)*F**a*(-c*f + d*e)**S(4)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(2)*sqrt(b)*d**S(5)*sqrt(log(F))) - S(3)*sqrt(pi)*F**a*f**S(2)*(-c*f + d*e)**S(2)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(2)*b**(S(3)/2)*d**S(5)*log(F)**(S(3)/2)) + S(3)*sqrt(pi)*F**a*f**S(4)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(8)*b**(S(5)/2)*d**S(5)*log(F)**(S(5)/2)) + F**(a + b*(c + d*x)**S(2))*f**S(4)*(c + d*x)**S(3)/(S(2)*b*d**S(5)*log(F)) + S(2)*F**(a + b*(c + d*x)**S(2))*f**S(3)*(c + d*x)**S(2)*(-c*f + d*e)/(b*d**S(5)*log(F)) + S(3)*F**(a + b*(c + d*x)**S(2))*f**S(2)*(c + d*x)*(-c*f + d*e)**S(2)/(b*d**S(5)*log(F)) + S(2)*F**(a + b*(c + d*x)**S(2))*f*(-c*f + d*e)**S(3)/(b*d**S(5)*log(F)) - S(3)*F**(a + b*(c + d*x)**S(2))*f**S(4)*(c + d*x)/(S(4)*b**S(2)*d**S(5)*log(F)**S(2)) - S(2)*F**(a + b*(c + d*x)**S(2))*f**S(3)*(-c*f + d*e)/(b**S(2)*d**S(5)*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(e + f*x)**S(3), x), x, sqrt(pi)*F**a*(-c*f + d*e)**S(3)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(2)*sqrt(b)*d**S(4)*sqrt(log(F))) - S(3)*sqrt(pi)*F**a*f**S(2)*(-c*f + d*e)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(4)*b**(S(3)/2)*d**S(4)*log(F)**(S(3)/2)) + F**(a + b*(c + d*x)**S(2))*f**S(3)*(c + d*x)**S(2)/(S(2)*b*d**S(4)*log(F)) + S(3)*F**(a + b*(c + d*x)**S(2))*f**S(2)*(c + d*x)*(-c*f + d*e)/(S(2)*b*d**S(4)*log(F)) + S(3)*F**(a + b*(c + d*x)**S(2))*f*(-c*f + d*e)**S(2)/(S(2)*b*d**S(4)*log(F)) - F**(a + b*(c + d*x)**S(2))*f**S(3)/(S(2)*b**S(2)*d**S(4)*log(F)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(e + f*x)**S(2), x), x, sqrt(pi)*F**a*(-c*f + d*e)**S(2)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(2)*sqrt(b)*d**S(3)*sqrt(log(F))) - sqrt(pi)*F**a*f**S(2)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(4)*b**(S(3)/2)*d**S(3)*log(F)**(S(3)/2)) + F**(a + b*(c + d*x)**S(2))*f**S(2)*(c + d*x)/(S(2)*b*d**S(3)*log(F)) + F**(a + b*(c + d*x)**S(2))*f*(-c*f + d*e)/(b*d**S(3)*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))*(e + f*x), x), x, sqrt(pi)*F**a*(-c*f/S(2) + d*e/S(2))*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(sqrt(b)*d**S(2)*sqrt(log(F))) + F**(a + b*(c + d*x)**S(2))*f/(S(2)*b*d**S(2)*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2)), x), x, sqrt(pi)*F**a*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/(S(2)*sqrt(b)*d*sqrt(log(F))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(e + f*x), x), x, Integral(F**(a + b*(c + d*x)**S(2))/(e + f*x), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(e + f*x)**S(2), x), x, sqrt(pi)*F**a*sqrt(b)*d*sqrt(log(F))*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/f**S(2) - F**(a + b*(c + d*x)**S(2))/(f*(e + f*x)) - S(2)*b*d*(-c*f + d*e)*log(F)*Integral(F**(a + b*(c + d*x)**S(2))/(e + f*x), x)/f**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*(c + d*x)**S(2))/(e + f*x)**S(3), x), x, -sqrt(pi)*F**a*b**(S(3)/2)*d**S(2)*(-c*f + d*e)*log(F)**(S(3)/2)*erfi(sqrt(b)*(c + d*x)*sqrt(log(F)))/f**S(4) + F**(a + b*(c + d*x)**S(2))*b*d*(-c*f + d*e)*log(F)/(f**S(3)*(e + f*x)) - F**(a + b*(c + d*x)**S(2))/(S(2)*f*(e + f*x)**S(2)) + S(2)*b**S(2)*d**S(2)*(-c*f + d*e)**S(2)*log(F)**S(2)*Integral(F**(a + b*(c + d*x)**S(2))/(e + f*x), x)/f**S(4) + b*d**S(2)*log(F)*Integral(F**(a + b*(c + d*x)**S(2))/(e + f*x), x)/f**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(3)*exp(e*(c + d*x)**S(3)), x), x, -b**S(3)*(c + d*x)**S(4)*Gamma(S(4)/3, -e*(c + d*x)**S(3))/(S(3)*d**S(4)*(-e*(c + d*x)**S(3))**(S(4)/3)) - b**S(2)*(-a*d + b*c)*exp(e*(c + d*x)**S(3))/(d**S(4)*e) - b*(c + d*x)**S(2)*(-a*d + b*c)**S(2)*Gamma(S(2)/3, -e*(c + d*x)**S(3))/(d**S(4)*(-e*(c + d*x)**S(3))**(S(2)/3)) + (c + d*x)*(-a*d + b*c)**S(3)*Gamma(S(1)/3, -e*(c + d*x)**S(3))/(S(3)*d**S(4)*(-e*(c + d*x)**S(3))**(S(1)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(2)*exp(e*(c + d*x)**S(3)), x), x, b**S(2)*exp(e*(c + d*x)**S(3))/(S(3)*d**S(3)*e) + S(2)*b*(c + d*x)**S(2)*(-a*d + b*c)*Gamma(S(2)/3, -e*(c + d*x)**S(3))/(S(3)*d**S(3)*(-e*(c + d*x)**S(3))**(S(2)/3)) - (c + d*x)*(-a*d + b*c)**S(2)*Gamma(S(1)/3, -e*(c + d*x)**S(3))/(S(3)*d**S(3)*(-e*(c + d*x)**S(3))**(S(1)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)*exp(e*(c + d*x)**S(3)), x), x, -b*(c + d*x)**S(2)*Gamma(S(2)/3, -e*(c + d*x)**S(3))/(S(3)*d**S(2)*(-e*(c + d*x)**S(3))**(S(2)/3)) + (c + d*x)*(-a*d/S(3) + b*c/S(3))*Gamma(S(1)/3, -e*(c + d*x)**S(3))/(d**S(2)*(-e*(c + d*x)**S(3))**(S(1)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e*(c + d*x)**S(3)), x), x, (-c/S(3) - d*x/S(3))*Gamma(S(1)/3, -e*(c + d*x)**S(3))/(d*(-e*(c + d*x)**S(3))**(S(1)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e*(c + d*x)**S(3))/(a + b*x), x), x, Integral(exp(e*(c + d*x)**S(3))/(a + b*x), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e*(c + d*x)**S(3))/(a + b*x)**S(2), x), x, -exp(e*(c + d*x)**S(3))/(b*(a + b*x)) - d*e*(c + d*x)**S(2)*Gamma(S(2)/3, -e*(c + d*x)**S(3))/(b**S(2)*(-e*(c + d*x)**S(3))**(S(2)/3)) + S(3)*d*e*(-a*d + b*c)**S(2)*Integral(exp(e*(c + d*x)**S(3))/(a + b*x), x)/b**S(3) - d*e*(c + d*x)*(-a*d + b*c)*Gamma(S(1)/3, -e*(c + d*x)**S(3))/(b**S(3)*(-e*(c + d*x)**S(3))**(S(1)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))/(e + f*x), x), x, -F**a*Ei(b*log(F)/(c + d*x))/f + F**(a - b*f/(-c*f + d*e))*Ei(b*d*(e + f*x)*log(F)/((c + d*x)*(-c*f + d*e)))/f, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))/(e + f*x)**S(2), x), x, F**(a + b/(c + d*x))*d/(f*(-c*f + d*e)) - F**(a + b/(c + d*x))/(f*(e + f*x)) - F**(a - b*f/(-c*f + d*e))*b*d*log(F)*Ei(b*d*(e + f*x)*log(F)/((c + d*x)*(-c*f + d*e)))/(-c*f + d*e)**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))/(e + f*x)**S(3), x), x, -F**(a + b/(c + d*x))*b*d**S(2)*log(F)/(S(2)*(-c*f + d*e)**S(3)) + F**(a + b/(c + d*x))*b*d*log(F)/(S(2)*(e + f*x)*(-c*f + d*e)**S(2)) + F**(a + b/(c + d*x))*d**S(2)/(S(2)*f*(-c*f + d*e)**S(2)) - F**(a + b/(c + d*x))/(S(2)*f*(e + f*x)**S(2)) + F**(a - b*f/(-c*f + d*e))*b**S(2)*d**S(2)*f*log(F)**S(2)*Ei(b*d*(e + f*x)*log(F)/((c + d*x)*(-c*f + d*e)))/(S(2)*(-c*f + d*e)**S(4)) - F**(a - b*f/(-c*f + d*e))*b*d**S(2)*log(F)*Ei(b*d*(e + f*x)*log(F)/((c + d*x)*(-c*f + d*e)))/(-c*f + d*e)**S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b/(c + d*x))/(e + f*x)**S(4), x), x, F**(a + b/(c + d*x))*b**S(2)*d**S(3)*f*log(F)**S(2)/(S(6)*(-c*f + d*e)**S(5)) - F**(a + b/(c + d*x))*b**S(2)*d**S(2)*f*log(F)**S(2)/(S(6)*(e + f*x)*(-c*f + d*e)**S(4)) - S(5)*F**(a + b/(c + d*x))*b*d**S(3)*log(F)/(S(6)*(-c*f + d*e)**S(4)) + S(2)*F**(a + b/(c + d*x))*b*d**S(2)*log(F)/(S(3)*(e + f*x)*(-c*f + d*e)**S(3)) + F**(a + b/(c + d*x))*b*d*log(F)/(S(6)*(e + f*x)**S(2)*(-c*f + d*e)**S(2)) + F**(a + b/(c + d*x))*d**S(3)/(S(3)*f*(-c*f + d*e)**S(3)) - F**(a + b/(c + d*x))/(S(3)*f*(e + f*x)**S(3)) - F**(a - b*f/(-c*f + d*e))*b**S(3)*d**S(3)*f**S(2)*log(F)**S(3)*Ei(b*d*(e + f*x)*log(F)/((c + d*x)*(-c*f + d*e)))/(S(6)*(-c*f + d*e)**S(6)) + F**(a - b*f/(-c*f + d*e))*b**S(2)*d**S(3)*f*log(F)**S(2)*Ei(b*d*(e + f*x)*log(F)/((c + d*x)*(-c*f + d*e)))/(-c*f + d*e)**S(5) - F**(a - b*f/(-c*f + d*e))*b*d**S(3)*log(F)*Ei(b*d*(e + f*x)*log(F)/((c + d*x)*(-c*f + d*e)))/(-c*f + d*e)**S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(4)*exp(e/(c + d*x)), x), x, -b**S(4)*e**S(5)*Gamma(S(-5), -e/(c + d*x))/d**S(5) - S(4)*b**S(3)*e**S(4)*(-a*d + b*c)*Gamma(S(-4), -e/(c + d*x))/d**S(5) - b**S(2)*e**S(3)*(-a*d + b*c)**S(2)*Ei(e/(c + d*x))/d**S(5) + b**S(2)*e**S(2)*(c + d*x)*(-a*d + b*c)**S(2)*exp(e/(c + d*x))/d**S(5) + b**S(2)*e*(c + d*x)**S(2)*(-a*d + b*c)**S(2)*exp(e/(c + d*x))/d**S(5) + S(2)*b**S(2)*(c + d*x)**S(3)*(-a*d + b*c)**S(2)*exp(e/(c + d*x))/d**S(5) + S(2)*b*e**S(2)*(-a*d + b*c)**S(3)*Ei(e/(c + d*x))/d**S(5) - S(2)*b*e*(c + d*x)*(-a*d + b*c)**S(3)*exp(e/(c + d*x))/d**S(5) - S(2)*b*(c + d*x)**S(2)*(-a*d + b*c)**S(3)*exp(e/(c + d*x))/d**S(5) - e*(-a*d + b*c)**S(4)*Ei(e/(c + d*x))/d**S(5) + (c + d*x)*(-a*d + b*c)**S(4)*exp(e/(c + d*x))/d**S(5), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(3)*exp(e/(c + d*x)), x), x, b**S(3)*e**S(4)*Gamma(S(-4), -e/(c + d*x))/d**S(4) + b**S(2)*e**S(3)*(-a*d + b*c)*Ei(e/(c + d*x))/(S(2)*d**S(4)) - b**S(2)*e**S(2)*(c + d*x)*(-a*d + b*c)*exp(e/(c + d*x))/(S(2)*d**S(4)) - b**S(2)*e*(c + d*x)**S(2)*(-a*d + b*c)*exp(e/(c + d*x))/(S(2)*d**S(4)) - b**S(2)*(c + d*x)**S(3)*(-a*d + b*c)*exp(e/(c + d*x))/d**S(4) - S(3)*b*e**S(2)*(-a*d + b*c)**S(2)*Ei(e/(c + d*x))/(S(2)*d**S(4)) + S(3)*b*e*(c + d*x)*(-a*d + b*c)**S(2)*exp(e/(c + d*x))/(S(2)*d**S(4)) + S(3)*b*(c + d*x)**S(2)*(-a*d + b*c)**S(2)*exp(e/(c + d*x))/(S(2)*d**S(4)) + e*(-a*d + b*c)**S(3)*Ei(e/(c + d*x))/d**S(4) - (c + d*x)*(-a*d + b*c)**S(3)*exp(e/(c + d*x))/d**S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(2)*exp(e/(c + d*x)), x), x, -b**S(2)*e**S(3)*Ei(e/(c + d*x))/(S(6)*d**S(3)) + b**S(2)*e**S(2)*(c + d*x)*exp(e/(c + d*x))/(S(6)*d**S(3)) + b**S(2)*e*(c + d*x)**S(2)*exp(e/(c + d*x))/(S(6)*d**S(3)) + b**S(2)*(c + d*x)**S(3)*exp(e/(c + d*x))/(S(3)*d**S(3)) + b*e**S(2)*(-a*d + b*c)*Ei(e/(c + d*x))/d**S(3) - b*e*(c + d*x)*(-a*d + b*c)*exp(e/(c + d*x))/d**S(3) - b*(c + d*x)**S(2)*(-a*d + b*c)*exp(e/(c + d*x))/d**S(3) - e*(-a*d + b*c)**S(2)*Ei(e/(c + d*x))/d**S(3) + (c + d*x)*(-a*d + b*c)**S(2)*exp(e/(c + d*x))/d**S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)*exp(e/(c + d*x)), x), x, -b*e**S(2)*Ei(e/(c + d*x))/(S(2)*d**S(2)) + b*e*(c + d*x)*exp(e/(c + d*x))/(S(2)*d**S(2)) + b*(c + d*x)**S(2)*exp(e/(c + d*x))/(S(2)*d**S(2)) + e*(-a*d + b*c)*Ei(e/(c + d*x))/d**S(2) + (c + d*x)*(a*d - b*c)*exp(e/(c + d*x))/d**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e/(c + d*x)), x), x, -e*Ei(e/(c + d*x))/d + (c + d*x)*exp(e/(c + d*x))/d, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e/(c + d*x))/(a + b*x), x), x, exp(b*e/(-a*d + b*c))*Ei(-d*e*(a + b*x)/((c + d*x)*(-a*d + b*c)))/b - Ei(e/(c + d*x))/b, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e/(c + d*x))/(a + b*x)**S(2), x), x, -d*e*exp(b*e/(-a*d + b*c))*Ei(-d*e*(a + b*x)/((c + d*x)*(-a*d + b*c)))/(-a*d + b*c)**S(2) - d*exp(e/(c + d*x))/(b*(-a*d + b*c)) - exp(e/(c + d*x))/(b*(a + b*x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e/(c + d*x))/(a + b*x)**S(3), x), x, b*d**S(2)*e**S(2)*exp(b*e/(-a*d + b*c))*Ei(-d*e*(a + b*x)/((c + d*x)*(-a*d + b*c)))/(S(2)*(-a*d + b*c)**S(4)) + d**S(2)*e*exp(e/(c + d*x))/(S(2)*(-a*d + b*c)**S(3)) + d**S(2)*e*exp(b*e/(-a*d + b*c))*Ei(-d*e*(a + b*x)/((c + d*x)*(-a*d + b*c)))/(-a*d + b*c)**S(3) + d*e*exp(e/(c + d*x))/(S(2)*(a + b*x)*(-a*d + b*c)**S(2)) + d**S(2)*exp(e/(c + d*x))/(S(2)*b*(-a*d + b*c)**S(2)) - exp(e/(c + d*x))/(S(2)*b*(a + b*x)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(3)*exp(e/(c + d*x)**S(2)), x), x, -b**S(3)*e**S(2)*Ei(e/(c + d*x)**S(2))/(S(4)*d**S(4)) + b**S(3)*e*(c + d*x)**S(2)*exp(e/(c + d*x)**S(2))/(S(4)*d**S(4)) + b**S(3)*(c + d*x)**S(4)*exp(e/(c + d*x)**S(2))/(S(4)*d**S(4)) + S(2)*sqrt(pi)*b**S(2)*e**(S(3)/2)*(-a*d + b*c)*erfi(sqrt(e)/(c + d*x))/d**S(4) - S(2)*b**S(2)*e*(c + d*x)*(-a*d + b*c)*exp(e/(c + d*x)**S(2))/d**S(4) - b**S(2)*(c + d*x)**S(3)*(-a*d + b*c)*exp(e/(c + d*x)**S(2))/d**S(4) - S(3)*b*e*(-a*d + b*c)**S(2)*Ei(e/(c + d*x)**S(2))/(S(2)*d**S(4)) + S(3)*b*(c + d*x)**S(2)*(-a*d + b*c)**S(2)*exp(e/(c + d*x)**S(2))/(S(2)*d**S(4)) + sqrt(pi)*sqrt(e)*(-a*d + b*c)**S(3)*erfi(sqrt(e)/(c + d*x))/d**S(4) - (c + d*x)*(-a*d + b*c)**S(3)*exp(e/(c + d*x)**S(2))/d**S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(2)*exp(e/(c + d*x)**S(2)), x), x, -S(2)*sqrt(pi)*b**S(2)*e**(S(3)/2)*erfi(sqrt(e)/(c + d*x))/(S(3)*d**S(3)) + S(2)*b**S(2)*e*(c + d*x)*exp(e/(c + d*x)**S(2))/(S(3)*d**S(3)) + b**S(2)*(c + d*x)**S(3)*exp(e/(c + d*x)**S(2))/(S(3)*d**S(3)) + b*e*(-a*d + b*c)*Ei(e/(c + d*x)**S(2))/d**S(3) - b*(c + d*x)**S(2)*(-a*d + b*c)*exp(e/(c + d*x)**S(2))/d**S(3) - sqrt(pi)*sqrt(e)*(-a*d + b*c)**S(2)*erfi(sqrt(e)/(c + d*x))/d**S(3) + (c + d*x)*(-a*d + b*c)**S(2)*exp(e/(c + d*x)**S(2))/d**S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)*exp(e/(c + d*x)**S(2)), x), x, -b*e*Ei(e/(c + d*x)**S(2))/(S(2)*d**S(2)) + b*(c + d*x)**S(2)*exp(e/(c + d*x)**S(2))/(S(2)*d**S(2)) + sqrt(pi)*sqrt(e)*(-a*d + b*c)*erfi(sqrt(e)/(c + d*x))/d**S(2) + (c + d*x)*(a*d - b*c)*exp(e/(c + d*x)**S(2))/d**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e/(c + d*x)**S(2)), x), x, -sqrt(pi)*sqrt(e)*erfi(sqrt(e)/(c + d*x))/d + (c + d*x)*exp(e/(c + d*x)**S(2))/d, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e/(c + d*x)**S(2))/(a + b*x), x), x, Integral(exp(e/(c + d*x)**S(2))/(a + b*x), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e/(c + d*x)**S(2))/(a + b*x)**S(2), x), x, Integral(exp(e/(c + d*x)**S(2))/(a + b*x)**S(2), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e/(c + d*x)**S(2))/(a + b*x)**S(3), x), x, Integral(exp(e/(c + d*x)**S(2))/(a + b*x)**S(3), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(3)*exp(e/(c + d*x)**S(3)), x), x, b**S(3)*(-e/(c + d*x)**S(3))**(S(4)/3)*(c + d*x)**S(4)*Gamma(S(-4)/3, -e/(c + d*x)**S(3))/(S(3)*d**S(4)) + b**S(2)*e*(-a*d + b*c)*Ei(e/(c + d*x)**S(3))/d**S(4) - b**S(2)*(c + d*x)**S(3)*(-a*d + b*c)*exp(e/(c + d*x)**S(3))/d**S(4) + b*(-e/(c + d*x)**S(3))**(S(2)/3)*(c + d*x)**S(2)*(-a*d + b*c)**S(2)*Gamma(S(-2)/3, -e/(c + d*x)**S(3))/d**S(4) - (-e/(c + d*x)**S(3))**(S(1)/3)*(c + d*x)*(-a*d + b*c)**S(3)*Gamma(S(-1)/3, -e/(c + d*x)**S(3))/(S(3)*d**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(2)*exp(e/(c + d*x)**S(3)), x), x, -b**S(2)*e*Ei(e/(c + d*x)**S(3))/(S(3)*d**S(3)) + b**S(2)*(c + d*x)**S(3)*exp(e/(c + d*x)**S(3))/(S(3)*d**S(3)) - S(2)*b*(-e/(c + d*x)**S(3))**(S(2)/3)*(c + d*x)**S(2)*(-a*d + b*c)*Gamma(S(-2)/3, -e/(c + d*x)**S(3))/(S(3)*d**S(3)) + (-e/(c + d*x)**S(3))**(S(1)/3)*(c + d*x)*(-a*d + b*c)**S(2)*Gamma(S(-1)/3, -e/(c + d*x)**S(3))/(S(3)*d**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)*exp(e/(c + d*x)**S(3)), x), x, b*(-e/(c + d*x)**S(3))**(S(2)/3)*(c + d*x)**S(2)*Gamma(S(-2)/3, -e/(c + d*x)**S(3))/(S(3)*d**S(2)) - (-e/(c + d*x)**S(3))**(S(1)/3)*(c + d*x)*(-a*d/S(3) + b*c/S(3))*Gamma(S(-1)/3, -e/(c + d*x)**S(3))/d**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e/(c + d*x)**S(3)), x), x, (-e/(c + d*x)**S(3))**(S(1)/3)*(c + d*x)*Gamma(S(-1)/3, -e/(c + d*x)**S(3))/(S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e/(c + d*x)**S(3))/(a + b*x), x), x, Integral(exp(e/(c + d*x)**S(3))/(a + b*x), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(e/(c + d*x)**S(3))/(a + b*x)**S(2), x), x, Integral(exp(e/(c + d*x)**S(3))/(a + b*x)**S(2), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(e + f*(a + b*x)/(c + d*x))/(g + h*x), x), x, F**(e + f*(-a*h + b*g)/(-c*h + d*g))*Ei(f*(g + h*x)*(a*d - b*c)*log(F)/((c + d*x)*(-c*h + d*g)))/h - F**(b*f/d + e)*Ei(f*(a*d - b*c)*log(F)/(d*(c + d*x)))/h, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(e + f*(a + b*x)/(c + d*x))/(g + h*x)**S(2), x), x, -F**(e + f*(a + b*x)/(c + d*x))/(h*(g + h*x)) + F**(e + f*(-a*h + b*g)/(-c*h + d*g))*f*(-a*d + b*c)*log(F)*Ei(f*(g + h*x)*(a*d - b*c)*log(F)/((c + d*x)*(-c*h + d*g)))/(-c*h + d*g)**S(2) + F**(b*f/d + e - f*(-a*d + b*c)/(d*(c + d*x)))*d/(h*(-c*h + d*g)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(e + f*(a + b*x)/(c + d*x))/(g + h*x)**S(3), x), x, -F**(e + f*(a + b*x)/(c + d*x))*f*(-a*d/S(2) + b*c/S(2))*log(F)/((g + h*x)*(-c*h + d*g)**S(2)) - F**(e + f*(a + b*x)/(c + d*x))/(S(2)*h*(g + h*x)**S(2)) + F**(e + f*(-a*h + b*g)/(-c*h + d*g))*d*f*(-a*d + b*c)*log(F)*Ei(f*(g + h*x)*(a*d - b*c)*log(F)/((c + d*x)*(-c*h + d*g)))/(-c*h + d*g)**S(3) + F**(e + f*(-a*h + b*g)/(-c*h + d*g))*f**S(2)*h*(-a*d + b*c)**S(2)*log(F)**S(2)*Ei(f*(g + h*x)*(a*d - b*c)*log(F)/((c + d*x)*(-c*h + d*g)))/(S(2)*(-c*h + d*g)**S(4)) + F**(b*f/d + e - f*(-a*d + b*c)/(d*(c + d*x)))*d**S(2)/(S(2)*h*(-c*h + d*g)**S(2)) + F**(b*f/d + e - f*(-a*d + b*c)/(d*(c + d*x)))*d*f*(-a*d + b*c)*log(F)/(S(2)*(-c*h + d*g)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(e + f*(a + b*x)/(c + d*x))/(g + h*x)**S(4), x), x, -S(2)*F**(e + f*(a + b*x)/(c + d*x))*d*f*(-a*d + b*c)*log(F)/(S(3)*(g + h*x)*(-c*h + d*g)**S(3)) - F**(e + f*(a + b*x)/(c + d*x))*f**S(2)*h*(-a*d + b*c)**S(2)*log(F)**S(2)/(S(6)*(g + h*x)*(-c*h + d*g)**S(4)) - F**(e + f*(a + b*x)/(c + d*x))*f*(-a*d/S(6) + b*c/S(6))*log(F)/((g + h*x)**S(2)*(-c*h + d*g)**S(2)) - F**(e + f*(a + b*x)/(c + d*x))/(S(3)*h*(g + h*x)**S(3)) + F**(e + f*(-a*h + b*g)/(-c*h + d*g))*d**S(2)*f*(-a*d + b*c)*log(F)*Ei(f*(g + h*x)*(a*d - b*c)*log(F)/((c + d*x)*(-c*h + d*g)))/(-c*h + d*g)**S(4) + F**(e + f*(-a*h + b*g)/(-c*h + d*g))*d*f**S(2)*h*(-a*d + b*c)**S(2)*log(F)**S(2)*Ei(f*(g + h*x)*(a*d - b*c)*log(F)/((c + d*x)*(-c*h + d*g)))/(-c*h + d*g)**S(5) + F**(e + f*(-a*h + b*g)/(-c*h + d*g))*f**S(3)*h**S(2)*(-a*d + b*c)**S(3)*log(F)**S(3)*Ei(f*(g + h*x)*(a*d - b*c)*log(F)/((c + d*x)*(-c*h + d*g)))/(S(6)*(-c*h + d*g)**S(6)) + F**(b*f/d + e - f*(-a*d + b*c)/(d*(c + d*x)))*d**S(3)/(S(3)*h*(-c*h + d*g)**S(3)) + S(5)*F**(b*f/d + e - f*(-a*d + b*c)/(d*(c + d*x)))*d**S(2)*f*(-a*d + b*c)*log(F)/(S(6)*(-c*h + d*g)**S(4)) + F**(b*f/d + e - f*(-a*d + b*c)/(d*(c + d*x)))*d*f**S(2)*h*(-a*d + b*c)**S(2)*log(F)**S(2)/(S(6)*(-c*h + d*g)**S(5)), expand=True, _diff=True, _numerical=True) # fails 1940 and 1939 recursion assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))*x**S(3), x), x, -sqrt(pi)*b**S(3)*f**(a - b**S(2)/(S(4)*c))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(16)*c**(S(7)/2)*sqrt(log(f))) + b**S(2)*f**(a + b*x + c*x**S(2))/(S(8)*c**S(3)*log(f)) - b*f**(a + b*x + c*x**S(2))*x/(S(4)*c**S(2)*log(f)) + S(3)*sqrt(pi)*b*f**(a - b**S(2)/(S(4)*c))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(8)*c**(S(5)/2)*log(f)**(S(3)/2)) + f**(a + b*x + c*x**S(2))*x**S(2)/(S(2)*c*log(f)) - f**(a + b*x + c*x**S(2))/(S(2)*c**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))*x**S(2), x), x, sqrt(pi)*b**S(2)*f**(a - b**S(2)/(S(4)*c))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(8)*c**(S(5)/2)*sqrt(log(f))) - b*f**(a + b*x + c*x**S(2))/(S(4)*c**S(2)*log(f)) + f**(a + b*x + c*x**S(2))*x/(S(2)*c*log(f)) - sqrt(pi)*f**(a - b**S(2)/(S(4)*c))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(4)*c**(S(3)/2)*log(f)**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))*x, x), x, -sqrt(pi)*b*f**(a - b**S(2)/(S(4)*c))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(4)*c**(S(3)/2)*sqrt(log(f))) + f**(a + b*x + c*x**S(2))/(S(2)*c*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2)), x), x, sqrt(pi)*f**(a - b**S(2)/(S(4)*c))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(2)*sqrt(c)*sqrt(log(f))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))/x, x), x, Integral(f**(a + b*x + c*x**S(2))/x, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))/x**S(2), x), x, b*log(f)*Integral(f**(a + b*x + c*x**S(2))/x, x) + sqrt(pi)*sqrt(c)*f**(a - b**S(2)/(S(4)*c))*sqrt(log(f))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c)) - f**(a + b*x + c*x**S(2))/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*exp(a + b*x - c*x**S(2)), x), x, -sqrt(pi)*b**S(3)*exp(a + b**S(2)/(S(4)*c))*erf((b/S(2) - c*x)/sqrt(c))/(S(16)*c**(S(7)/2)) - b**S(2)*exp(a + b*x - c*x**S(2))/(S(8)*c**S(3)) - b*x*exp(a + b*x - c*x**S(2))/(S(4)*c**S(2)) - S(3)*sqrt(pi)*b*exp(a + b**S(2)/(S(4)*c))*erf((b/S(2) - c*x)/sqrt(c))/(S(8)*c**(S(5)/2)) - x**S(2)*exp(a + b*x - c*x**S(2))/(S(2)*c) - exp(a + b*x - c*x**S(2))/(S(2)*c**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*exp(a + b*x - c*x**S(2)), x), x, -sqrt(pi)*b**S(2)*exp(a + b**S(2)/(S(4)*c))*erf((b/S(2) - c*x)/sqrt(c))/(S(8)*c**(S(5)/2)) - b*exp(a + b*x - c*x**S(2))/(S(4)*c**S(2)) - x*exp(a + b*x - c*x**S(2))/(S(2)*c) - sqrt(pi)*exp(a + b**S(2)/(S(4)*c))*erf((b/S(2) - c*x)/sqrt(c))/(S(4)*c**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(a + b*x - c*x**S(2)), x), x, -sqrt(pi)*b*exp(a + b**S(2)/(S(4)*c))*erf((b/S(2) - c*x)/sqrt(c))/(S(4)*c**(S(3)/2)) - exp(a + b*x - c*x**S(2))/(S(2)*c), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(a + b*x - c*x**S(2)), x), x, -sqrt(pi)*exp(a + b**S(2)/(S(4)*c))*erf((b/S(2) - c*x)/sqrt(c))/(S(2)*sqrt(c)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(a + b*x - c*x**S(2))/x, x), x, Integral(exp(a + b*x - c*x**S(2))/x, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(a + b*x - c*x**S(2))/x**S(2), x), x, b*Integral(exp(a + b*x - c*x**S(2))/x, x) + sqrt(pi)*sqrt(c)*exp(a + b**S(2)/(S(4)*c))*erf((b/S(2) - c*x)/sqrt(c)) - exp(a + b*x - c*x**S(2))/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*exp((a + b*x)*(c + d*x)), x), x, x**S(2)*exp(a*c + b*d*x**S(2) + x*(a*d + b*c))/(S(2)*b*d) - x*(a*d/S(4) + b*c/S(4))*exp(a*c + b*d*x**S(2) + x*(a*d + b*c))/(b**S(2)*d**S(2)) - exp(a*c + b*d*x**S(2) + x*(a*d + b*c))/(S(2)*b**S(2)*d**S(2)) + (a*d + b*c)**S(2)*exp(a*c + b*d*x**S(2) + x*(a*d + b*c))/(S(8)*b**S(3)*d**S(3)) + sqrt(pi)*(S(3)*a*d/S(8) + S(3)*b*c/S(8))*exp(-(-a*d + b*c)**S(2)/(S(4)*b*d))*erfi((a*d/S(2) + b*c/S(2) + b*d*x)/(sqrt(b)*sqrt(d)))/(b**(S(5)/2)*d**(S(5)/2)) - sqrt(pi)*(a*d + b*c)**S(3)*exp(-(-a*d + b*c)**S(2)/(S(4)*b*d))*erfi((a*d/S(2) + b*c/S(2) + b*d*x)/(sqrt(b)*sqrt(d)))/(S(16)*b**(S(7)/2)*d**(S(7)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*exp((a + b*x)*(c + d*x)), x), x, x*exp(a*c + b*d*x**S(2) + x*(a*d + b*c))/(S(2)*b*d) + (-a*d/S(4) - b*c/S(4))*exp(a*c + b*d*x**S(2) + x*(a*d + b*c))/(b**S(2)*d**S(2)) - sqrt(pi)*exp(-(-a*d + b*c)**S(2)/(S(4)*b*d))*erfi((a*d/S(2) + b*c/S(2) + b*d*x)/(sqrt(b)*sqrt(d)))/(S(4)*b**(S(3)/2)*d**(S(3)/2)) + sqrt(pi)*(a*d + b*c)**S(2)*exp(-(-a*d + b*c)**S(2)/(S(4)*b*d))*erfi((a*d/S(2) + b*c/S(2) + b*d*x)/(sqrt(b)*sqrt(d)))/(S(8)*b**(S(5)/2)*d**(S(5)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp((a + b*x)*(c + d*x)), x), x, exp(a*c + b*d*x**S(2) + x*(a*d + b*c))/(S(2)*b*d) - sqrt(pi)*(a*d/S(4) + b*c/S(4))*exp(-(-a*d + b*c)**S(2)/(S(4)*b*d))*erfi((a*d/S(2) + b*c/S(2) + b*d*x)/(sqrt(b)*sqrt(d)))/(b**(S(3)/2)*d**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp((a + b*x)*(c + d*x)), x), x, sqrt(pi)*exp(-(-a*d + b*c)**S(2)/(S(4)*b*d))*erfi((a*d/S(2) + b*c/S(2) + b*d*x)/(sqrt(b)*sqrt(d)))/(S(2)*sqrt(b)*sqrt(d)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp((a + b*x)*(c + d*x))/x, x), x, Integral(exp(a*c + b*d*x**S(2) + x*(a*d + b*c))/x, x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp((a + b*x)*(c + d*x))/x**S(2), x), x, sqrt(pi)*sqrt(b)*sqrt(d)*exp(-(-a*d + b*c)**S(2)/(S(4)*b*d))*erfi((a*d/S(2) + b*c/S(2) + b*d*x)/(sqrt(b)*sqrt(d))) + (a*d + b*c)*Integral(exp(a*c + b*d*x**S(2) + x*(a*d + b*c))/x, x) - exp(a*c + b*d*x**S(2) + x*(a*d + b*c))/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))*(d + e*x)**S(3), x), x, e*f**(a + b*x + c*x**S(2))*(d + e*x)**S(2)/(S(2)*c*log(f)) - e**S(3)*f**(a + b*x + c*x**S(2))/(S(2)*c**S(2)*log(f)**S(2)) + e*f**(a + b*x + c*x**S(2))*(d + e*x)*(-b*e + S(2)*c*d)/(S(4)*c**S(2)*log(f)) + e*f**(a + b*x + c*x**S(2))*(-b*e + S(2)*c*d)**S(2)/(S(8)*c**S(3)*log(f)) - S(3)*sqrt(pi)*e**S(2)*f**(a - b**S(2)/(S(4)*c))*(-b*e + S(2)*c*d)*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(8)*c**(S(5)/2)*log(f)**(S(3)/2)) + sqrt(pi)*f**(a - b**S(2)/(S(4)*c))*(-b*e + S(2)*c*d)**S(3)*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(16)*c**(S(7)/2)*sqrt(log(f))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))*(d + e*x)**S(2), x), x, e*f**(a + b*x + c*x**S(2))*(d + e*x)/(S(2)*c*log(f)) + e*f**(a + b*x + c*x**S(2))*(-b*e + S(2)*c*d)/(S(4)*c**S(2)*log(f)) - sqrt(pi)*e**S(2)*f**(a - b**S(2)/(S(4)*c))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(4)*c**(S(3)/2)*log(f)**(S(3)/2)) + sqrt(pi)*f**(a - b**S(2)/(S(4)*c))*(-b*e + S(2)*c*d)**S(2)*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(8)*c**(S(5)/2)*sqrt(log(f))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))*(d + e*x), x), x, e*f**(a + b*x + c*x**S(2))/(S(2)*c*log(f)) + sqrt(pi)*f**(a - b**S(2)/(S(4)*c))*(-b*e/S(4) + c*d/S(2))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(c**(S(3)/2)*sqrt(log(f))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))/(d + e*x), x), x, Integral(f**(a + b*x + c*x**S(2))/(d + e*x), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))/(d + e*x)**S(2), x), x, sqrt(pi)*sqrt(c)*f**(a - b**S(2)/(S(4)*c))*sqrt(log(f))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/e**S(2) - f**(a + b*x + c*x**S(2))/(e*(d + e*x)) - (-b*e + S(2)*c*d)*log(f)*Integral(f**(a + b*x + c*x**S(2))/(d + e*x), x)/e**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))/(d + e*x)**S(3), x), x, -sqrt(pi)*sqrt(c)*f**(a - b**S(2)/(S(4)*c))*(-b*e/S(2) + c*d)*log(f)**(S(3)/2)*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/e**S(4) + c*log(f)*Integral(f**(a + b*x + c*x**S(2))/(d + e*x), x)/e**S(2) - f**(a + b*x + c*x**S(2))/(S(2)*e*(d + e*x)**S(2)) + f**(a + b*x + c*x**S(2))*(-b*e/S(2) + c*d)*log(f)/(e**S(3)*(d + e*x)) + (-b*e + S(2)*c*d)**S(2)*log(f)**S(2)*Integral(f**(a + b*x + c*x**S(2))/(d + e*x), x)/(S(2)*e**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))*(b + S(2)*c*x)**S(3), x), x, -S(4)*c*f**(a + b*x + c*x**S(2))/log(f)**S(2) + f**(a + b*x + c*x**S(2))*(b + S(2)*c*x)**S(2)/log(f), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))*(b + S(2)*c*x)**S(2), x), x, -sqrt(pi)*sqrt(c)*f**(a - b**S(2)/(S(4)*c))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/log(f)**(S(3)/2) + f**(a + b*x + c*x**S(2))*(b + S(2)*c*x)/log(f), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))*(b + S(2)*c*x), x), x, f**(a + b*x + c*x**S(2))/log(f), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))/(b + S(2)*c*x), x), x, f**(a - b**S(2)/(S(4)*c))*Ei((b + S(2)*c*x)**S(2)*log(f)/(S(4)*c))/(S(4)*c), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))/(b + S(2)*c*x)**S(2), x), x, -f**(a + b*x + c*x**S(2))/(S(2)*c*(b + S(2)*c*x)) + sqrt(pi)*f**(a - b**S(2)/(S(4)*c))*sqrt(log(f))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(4)*c**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))/(b + S(2)*c*x)**S(3), x), x, -f**(a + b*x + c*x**S(2))/(S(4)*c*(b + S(2)*c*x)**S(2)) + f**(a - b**S(2)/(S(4)*c))*log(f)*Ei((b + S(2)*c*x)**S(2)*log(f)/(S(4)*c))/(S(16)*c**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(b*x + c*x**S(2))*(b + S(2)*c*x)**S(3), x), x, -S(4)*c*f**(b*x + c*x**S(2))/log(f)**S(2) + f**(b*x + c*x**S(2))*(b + S(2)*c*x)**S(2)/log(f), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(b*x + c*x**S(2))*(b + S(2)*c*x)**S(2), x), x, -sqrt(pi)*sqrt(c)*f**(-b**S(2)/(S(4)*c))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/log(f)**(S(3)/2) + f**(b*x + c*x**S(2))*(b + S(2)*c*x)/log(f), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(b*x + c*x**S(2))*(b + S(2)*c*x), x), x, f**(b*x + c*x**S(2))/log(f), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(b*x + c*x**S(2))/(b + S(2)*c*x), x), x, f**(-b**S(2)/(S(4)*c))*Ei((b + S(2)*c*x)**S(2)*log(f)/(S(4)*c))/(S(4)*c), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(b*x + c*x**S(2))/(b + S(2)*c*x)**S(2), x), x, -f**(b*x + c*x**S(2))/(S(2)*c*(b + S(2)*c*x)) + sqrt(pi)*f**(-b**S(2)/(S(4)*c))*sqrt(log(f))*erfi((b/S(2) + c*x)*sqrt(log(f))/sqrt(c))/(S(4)*c**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(b*x + c*x**S(2))/(b + S(2)*c*x)**S(3), x), x, -f**(b*x + c*x**S(2))/(S(4)*c*(b + S(2)*c*x)**S(2)) + f**(-b**S(2)/(S(4)*c))*log(f)*Ei((b + S(2)*c*x)**S(2)*log(f)/(S(4)*c))/(S(16)*c**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(x*(a + b*exp(c + d*x))), x), x, Integral(S(1)/(x*(a + b*exp(c + d*x))), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(a + b*exp(c + d*x)), x), x, x/a - log(a + b*exp(c + d*x))/(a*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(a + b*exp(c + d*x)), x), x, -x*log(a*exp(-c - d*x)/b + S(1))/(a*d) + polylog(S(2), -a*exp(-c - d*x)/b)/(a*d**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(a + b*exp(c + d*x)), x), x, -x**S(2)*log(a*exp(-c - d*x)/b + S(1))/(a*d) + S(2)*x*polylog(S(2), -a*exp(-c - d*x)/b)/(a*d**S(2)) + S(2)*polylog(S(3), -a*exp(-c - d*x)/b)/(a*d**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)/(a + b*exp(c + d*x)), x), x, -x**S(3)*log(a*exp(-c - d*x)/b + S(1))/(a*d) + S(3)*x**S(2)*polylog(S(2), -a*exp(-c - d*x)/b)/(a*d**S(2)) + S(6)*x*polylog(S(3), -a*exp(-c - d*x)/b)/(a*d**S(3)) + S(6)*polylog(S(4), -a*exp(-c - d*x)/b)/(a*d**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(a + b*exp(c - d*x)), x), x, x/a + log(a + b*exp(c - d*x))/(a*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(a + b*exp(-c - d*x)), x), x, x/a + log(a + b*exp(-c - d*x))/(a*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(x*(a + b*exp(c + d*x))**S(2)), x), x, Integral(S(1)/(x*(a + b*exp(c + d*x))**S(2)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(c + d*x))**(S(-2)), x), x, S(1)/(a*d*(a + b*exp(c + d*x))) + x/a**S(2) - log(a + b*exp(c + d*x))/(a**S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(a + b*exp(c + d*x))**S(2), x), x, x/(a*d*(a + b*exp(c + d*x))) + x**S(2)/(S(2)*a**S(2)) - x*log(S(1) + b*exp(c + d*x)/a)/(a**S(2)*d) - x/(a**S(2)*d) + log(a + b*exp(c + d*x))/(a**S(2)*d**S(2)) - polylog(S(2), -b*exp(c + d*x)/a)/(a**S(2)*d**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(a + b*exp(c + d*x))**S(2), x), x, x**S(2)/(a*d*(a + b*exp(c + d*x))) + x**S(3)/(S(3)*a**S(2)) - x**S(2)*log(S(1) + b*exp(c + d*x)/a)/(a**S(2)*d) + S(2)*x*log(a*exp(-c - d*x)/b + S(1))/(a**S(2)*d**S(2)) - S(2)*x*polylog(S(2), -b*exp(c + d*x)/a)/(a**S(2)*d**S(2)) - S(2)*polylog(S(2), -a*exp(-c - d*x)/b)/(a**S(2)*d**S(3)) + S(2)*polylog(S(3), -b*exp(c + d*x)/a)/(a**S(2)*d**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)/(a + b*exp(c + d*x))**S(2), x), x, x**S(3)/(a*d*(a + b*exp(c + d*x))) + x**S(4)/(S(4)*a**S(2)) - x**S(3)*log(S(1) + b*exp(c + d*x)/a)/(a**S(2)*d) + S(3)*x**S(2)*log(a*exp(-c - d*x)/b + S(1))/(a**S(2)*d**S(2)) - S(3)*x**S(2)*polylog(S(2), -b*exp(c + d*x)/a)/(a**S(2)*d**S(2)) - S(6)*x*polylog(S(2), -a*exp(-c - d*x)/b)/(a**S(2)*d**S(3)) + S(6)*x*polylog(S(3), -b*exp(c + d*x)/a)/(a**S(2)*d**S(3)) - S(6)*polylog(S(3), -a*exp(-c - d*x)/b)/(a**S(2)*d**S(4)) - S(6)*polylog(S(4), -b*exp(c + d*x)/a)/(a**S(2)*d**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(c - d*x))**(S(-2)), x), x, -S(1)/(a*d*(a + b*exp(c - d*x))) + x/a**S(2) + log(a + b*exp(c - d*x))/(a**S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(-c - d*x))**(S(-2)), x), x, -S(1)/(a*d*(a + b*exp(-c - d*x))) + x/a**S(2) + log(a + b*exp(-c - d*x))/(a**S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(x*(a + b*exp(c + d*x))**S(3)), x), x, Integral(S(1)/(x*(a + b*exp(c + d*x))**S(3)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(c + d*x))**(S(-3)), x), x, S(1)/(S(2)*a*d*(a + b*exp(c + d*x))**S(2)) + S(1)/(a**S(2)*d*(a + b*exp(c + d*x))) + x/a**S(3) - log(a + b*exp(c + d*x))/(a**S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(a + b*exp(c + d*x))**S(3), x), x, x/(S(2)*a*d*(a + b*exp(c + d*x))**S(2)) + x/(a**S(2)*d*(a + b*exp(c + d*x))) - S(1)/(S(2)*a**S(2)*d**S(2)*(a + b*exp(c + d*x))) + x**S(2)/(S(2)*a**S(3)) - x*log(S(1) + b*exp(c + d*x)/a)/(a**S(3)*d) - S(3)*x/(S(2)*a**S(3)*d) + S(3)*log(a + b*exp(c + d*x))/(S(2)*a**S(3)*d**S(2)) - polylog(S(2), -b*exp(c + d*x)/a)/(a**S(3)*d**S(2)), expand=True, _diff=True, _numerical=True) # recursion assert rubi_test(rubi_integrate(x**S(2)/(a + b*exp(c + d*x))**S(3), x), x, x**S(2)/(S(2)*a*d*(a + b*exp(c + d*x))**S(2)) + x**S(2)/(a**S(2)*d*(a + b*exp(c + d*x))) - x/(a**S(2)*d**S(2)*(a + b*exp(c + d*x))) + x**S(3)/(S(3)*a**S(3)) - x**S(2)*log(S(1) + b*exp(c + d*x)/a)/(a**S(3)*d) - S(3)*x**S(2)/(S(2)*a**S(3)*d) + S(3)*x*log(S(1) + b*exp(c + d*x)/a)/(a**S(3)*d**S(2)) - S(2)*x*polylog(S(2), -b*exp(c + d*x)/a)/(a**S(3)*d**S(2)) + x/(a**S(3)*d**S(2)) - log(a + b*exp(c + d*x))/(a**S(3)*d**S(3)) + S(3)*polylog(S(2), -b*exp(c + d*x)/a)/(a**S(3)*d**S(3)) + S(2)*polylog(S(3), -b*exp(c + d*x)/a)/(a**S(3)*d**S(3)), expand=True, _diff=True, _numerical=True) or rubi_test(rubi_integrate(x**S(2)/(a + b*exp(c + d*x))**S(3), x), x, x**S(2)/(S(2)*a*d*(a + b*exp(c + d*x))**S(2)) + x**S(2)/(a**S(2)*d*(a + b*exp(c + d*x))) - x/(a**S(2)*d**S(2)*(a + b*exp(c + d*x))) + x**S(3)/(S(3)*a**S(3)) - x**S(2)*log(S(1) + b*exp(c + d*x)/a)/(a**S(3)*d) - x**S(2)/(S(2)*a**S(3)*d) + x*log(S(1) + b*exp(c + d*x)/a)/(a**S(3)*d**S(2)) + S(2)*x*log(a*exp(-c - d*x)/b + S(1))/(a**S(3)*d**S(2)) - S(2)*x*polylog(S(2), -b*exp(c + d*x)/a)/(a**S(3)*d**S(2)) + x/(a**S(3)*d**S(2)) - log(a + b*exp(c + d*x))/(a**S(3)*d**S(3)) + polylog(S(2), -b*exp(c + d*x)/a)/(a**S(3)*d**S(3)) - S(2)*polylog(S(2), -a*exp(-c - d*x)/b)/(a**S(3)*d**S(3)) + S(2)*polylog(S(3), -b*exp(c + d*x)/a)/(a**S(3)*d**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(c - d*x))**(S(-3)), x), x, -S(1)/(S(2)*a*d*(a + b*exp(c - d*x))**S(2)) - S(1)/(a**S(2)*d*(a + b*exp(c - d*x))) + x/a**S(3) + log(a + b*exp(c - d*x))/(a**S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(-c - d*x))**(S(-3)), x), x, -S(1)/(S(2)*a*d*(a + b*exp(-c - d*x))**S(2)) - S(1)/(a**S(2)*d*(a + b*exp(-c - d*x))) + x/a**S(3) + log(a + b*exp(-c - d*x))/(a**S(3)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(a + b*x)/(x**S(2)*(c + d*x**S(2))), x), x, b*exp(a)*Ei(b*x)/c - sqrt(d)*exp(a - b*sqrt(-c)/sqrt(d))*Ei(b*(sqrt(d)*x + sqrt(-c))/sqrt(d))/(S(2)*(-c)**(S(3)/2)) + sqrt(d)*exp(a + b*sqrt(-c)/sqrt(d))*Ei(-b*(-sqrt(d)*x + sqrt(-c))/sqrt(d))/(S(2)*(-c)**(S(3)/2)) - exp(a + b*x)/(c*x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(a + b*x)/(x*(c + d*x**S(2))), x), x, exp(a)*Ei(b*x)/c - exp(a - b*sqrt(-c)/sqrt(d))*Ei(b*(sqrt(d)*x + sqrt(-c))/sqrt(d))/(S(2)*c) - exp(a + b*sqrt(-c)/sqrt(d))*Ei(-b*(-sqrt(d)*x + sqrt(-c))/sqrt(d))/(S(2)*c), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(a + b*x)/(c + d*x**S(2)), x), x, -exp(a - b*sqrt(-c)/sqrt(d))*Ei(b*(sqrt(d)*x + sqrt(-c))/sqrt(d))/(S(2)*sqrt(d)*sqrt(-c)) + exp(a + b*sqrt(-c)/sqrt(d))*Ei(-b*(-sqrt(d)*x + sqrt(-c))/sqrt(d))/(S(2)*sqrt(d)*sqrt(-c)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(a + b*x)/(c + d*x**S(2)), x), x, exp(a - b*sqrt(-c)/sqrt(d))*Ei(b*(sqrt(d)*x + sqrt(-c))/sqrt(d))/(S(2)*d) + exp(a + b*sqrt(-c)/sqrt(d))*Ei(-b*(-sqrt(d)*x + sqrt(-c))/sqrt(d))/(S(2)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*exp(a + b*x)/(c + d*x**S(2)), x), x, -sqrt(-c)*exp(a - b*sqrt(-c)/sqrt(d))*Ei(b*(sqrt(d)*x + sqrt(-c))/sqrt(d))/(S(2)*d**(S(3)/2)) + sqrt(-c)*exp(a + b*sqrt(-c)/sqrt(d))*Ei(-b*(-sqrt(d)*x + sqrt(-c))/sqrt(d))/(S(2)*d**(S(3)/2)) + exp(a + b*x)/(b*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(d + e*x)/(x**S(2)*(a + b*x + c*x**S(2))), x), x, e*exp(d)*Ei(e*x)/a - exp(d + e*x)/(a*x) - b*exp(d)*Ei(e*x)/a**S(2) + (b + (-S(2)*a*c + b**S(2))/sqrt(-S(4)*a*c + b**S(2)))*exp(d - e*(b - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(S(2)*a**S(2)) + (b + (S(2)*a*c - b**S(2))/sqrt(-S(4)*a*c + b**S(2)))*exp(d - e*(b + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(S(2)*a**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(d + e*x)/(x*(a + b*x + c*x**S(2))), x), x, -(-b/sqrt(-S(4)*a*c + b**S(2)) + S(1))*exp(d - e*(b + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(S(2)*a) - (b/sqrt(-S(4)*a*c + b**S(2)) + S(1))*exp(d - e*(b - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(S(2)*a) + exp(d)*Ei(e*x)/a, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(d + e*x)/(a + b*x + c*x**S(2)), x), x, exp(d - e*(b - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/sqrt(-S(4)*a*c + b**S(2)) - exp(d - e*(b + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/sqrt(-S(4)*a*c + b**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(d + e*x)/(a + b*x + c*x**S(2)), x), x, (-b/sqrt(-S(4)*a*c + b**S(2)) + S(1))*exp(d - e*(b - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(S(2)*c) + (b/sqrt(-S(4)*a*c + b**S(2)) + S(1))*exp(d - e*(b + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(S(2)*c), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*exp(d + e*x)/(a + b*x + c*x**S(2)), x), x, exp(d + e*x)/(c*e) - (b + (-S(2)*a*c + b**S(2))/sqrt(-S(4)*a*c + b**S(2)))*exp(d - e*(b + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(S(2)*c**S(2)) - (b + (S(2)*a*c - b**S(2))/sqrt(-S(4)*a*c + b**S(2)))*exp(d - e*(b - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(S(2)*c**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*exp(d + e*x)/(a + b*x + c*x**S(2)), x), x, -b*exp(d + e*x)/(c**S(2)*e) + x*exp(d + e*x)/(c*e) - exp(d + e*x)/(c*e**S(2)) + (-a*c + b**S(2) - b*(-S(3)*a*c + b**S(2))/sqrt(-S(4)*a*c + b**S(2)))*exp(d - e*(b - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(S(2)*c**S(3)) + (-a*c + b**S(2) + b*(-S(3)*a*c + b**S(2))/sqrt(-S(4)*a*c + b**S(2)))*exp(d - e*(b + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))*Ei(e*(b + S(2)*c*x + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(S(2)*c**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(4)**x/(S(2)**x*b + a), x), x, S(2)**x/(b*log(S(2))) - a*log(S(2)**x*b + a)/(b**S(2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**(S(2)*x)/(S(2)**x*b + a), x), x, S(2)**x/(b*log(S(2))) - a*log(S(2)**x*b + a)/(b**S(2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(4)**x/(-S(2)**x*b + a), x), x, -S(2)**x/(b*log(S(2))) - a*log(-S(2)**x*b + a)/(b**S(2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**(S(2)*x)/(-S(2)**x*b + a), x), x, -S(2)**x/(b*log(S(2))) - a*log(-S(2)**x*b + a)/(b**S(2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(4)**x/(a + S(2)**(-x)*b), x), x, -S(2)**x*b/(a**S(2)*log(S(2))) + S(2)**(S(2)*x + S(-1))/(a*log(S(2))) + b**S(2)*x/a**S(3) + b**S(2)*log(a + S(2)**(-x)*b)/(a**S(3)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**(S(2)*x)/(a + S(2)**(-x)*b), x), x, -S(2)**x*b/(a**S(2)*log(S(2))) + S(2)**(S(2)*x + S(-1))/(a*log(S(2))) + b**S(2)*x/a**S(3) + b**S(2)*log(a + S(2)**(-x)*b)/(a**S(3)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(4)**x/(a - S(2)**(-x)*b), x), x, S(2)**x*b/(a**S(2)*log(S(2))) + S(2)**(S(2)*x + S(-1))/(a*log(S(2))) + b**S(2)*x/a**S(3) + b**S(2)*log(a - S(2)**(-x)*b)/(a**S(3)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**(S(2)*x)/(a - S(2)**(-x)*b), x), x, S(2)**x*b/(a**S(2)*log(S(2))) + S(2)**(S(2)*x + S(-1))/(a*log(S(2))) + b**S(2)*x/a**S(3) + b**S(2)*log(a - S(2)**(-x)*b)/(a**S(3)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/(S(4)**x*b + a), x), x, atan(S(2)**x*sqrt(b)/sqrt(a))/(sqrt(a)*sqrt(b)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/(S(2)**(S(2)*x)*b + a), x), x, atan(S(2)**x*sqrt(b)/sqrt(a))/(sqrt(a)*sqrt(b)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/(-S(4)**x*b + a), x), x, atanh(S(2)**x*sqrt(b)/sqrt(a))/(sqrt(a)*sqrt(b)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/(-S(2)**(S(2)*x)*b + a), x), x, atanh(S(2)**x*sqrt(b)/sqrt(a))/(sqrt(a)*sqrt(b)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/(a + S(4)**(-x)*b), x), x, S(2)**x/(a*log(S(2))) - sqrt(b)*atan(S(2)**x*sqrt(a)/sqrt(b))/(a**(S(3)/2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/(a + S(2)**(-S(2)*x)*b), x), x, S(2)**x/(a*log(S(2))) - sqrt(b)*atan(S(2)**x*sqrt(a)/sqrt(b))/(a**(S(3)/2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/(a - S(4)**(-x)*b), x), x, S(2)**x/(a*log(S(2))) - sqrt(b)*atanh(S(2)**x*sqrt(a)/sqrt(b))/(a**(S(3)/2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/(a - S(2)**(-S(2)*x)*b), x), x, S(2)**x/(a*log(S(2))) - sqrt(b)*atanh(S(2)**x*sqrt(a)/sqrt(b))/(a**(S(3)/2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/sqrt(S(4)**x*b + a), x), x, atanh(S(2)**x*sqrt(b)/sqrt(S(2)**(S(2)*x)*b + a))/(sqrt(b)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/sqrt(S(2)**(S(2)*x)*b + a), x), x, atanh(S(2)**x*sqrt(b)/sqrt(S(2)**(S(2)*x)*b + a))/(sqrt(b)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/sqrt(-S(4)**x*b + a), x), x, atan(S(2)**x*sqrt(b)/sqrt(-S(2)**(S(2)*x)*b + a))/(sqrt(b)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/sqrt(-S(2)**(S(2)*x)*b + a), x), x, atan(S(2)**x*sqrt(b)/sqrt(-S(2)**(S(2)*x)*b + a))/(sqrt(b)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/sqrt(a + S(4)**(-x)*b), x), x, S(2)**x*sqrt(a + S(2)**(-S(2)*x)*b)/(a*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/sqrt(a + S(2)**(-S(2)*x)*b), x), x, S(2)**x*sqrt(a + S(2)**(-S(2)*x)*b)/(a*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/sqrt(a - S(4)**(-x)*b), x), x, S(2)**x*sqrt(a - S(2)**(-S(2)*x)*b)/(a*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x/sqrt(a - S(2)**(-S(2)*x)*b), x), x, S(2)**x*sqrt(a - S(2)**(-S(2)*x)*b)/(a*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(4)**x/sqrt(S(2)**x*b + a), x), x, -S(2)*a*sqrt(S(2)**x*b + a)/(b**S(2)*log(S(2))) + S(2)*(S(2)**x*b + a)**(S(3)/2)/(S(3)*b**S(2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**(S(2)*x)/sqrt(S(2)**x*b + a), x), x, -S(2)*a*sqrt(S(2)**x*b + a)/(b**S(2)*log(S(2))) + S(2)*(S(2)**x*b + a)**(S(3)/2)/(S(3)*b**S(2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(4)**x/sqrt(-S(2)**x*b + a), x), x, -S(2)*a*sqrt(-S(2)**x*b + a)/(b**S(2)*log(S(2))) + S(2)*(-S(2)**x*b + a)**(S(3)/2)/(S(3)*b**S(2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**(S(2)*x)/sqrt(-S(2)**x*b + a), x), x, -S(2)*a*sqrt(-S(2)**x*b + a)/(b**S(2)*log(S(2))) + S(2)*(-S(2)**x*b + a)**(S(3)/2)/(S(3)*b**S(2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(4)**x/sqrt(a + S(2)**(-x)*b), x), x, -S(3)*S(2)**(x + S(-2))*b*sqrt(a + S(2)**(-x)*b)/(a**S(2)*log(S(2))) + S(2)**(S(2)*x + S(-1))*sqrt(a + S(2)**(-x)*b)/(a*log(S(2))) + S(3)*b**S(2)*atanh(sqrt(a + S(2)**(-x)*b)/sqrt(a))/(S(4)*a**(S(5)/2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**(S(2)*x)/sqrt(a + S(2)**(-x)*b), x), x, -S(3)*S(2)**(x + S(-2))*b*sqrt(a + S(2)**(-x)*b)/(a**S(2)*log(S(2))) + S(2)**(S(2)*x + S(-1))*sqrt(a + S(2)**(-x)*b)/(a*log(S(2))) + S(3)*b**S(2)*atanh(sqrt(a + S(2)**(-x)*b)/sqrt(a))/(S(4)*a**(S(5)/2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(4)**x/sqrt(a - S(2)**(-x)*b), x), x, S(3)*S(2)**(x + S(-2))*b*sqrt(a - S(2)**(-x)*b)/(a**S(2)*log(S(2))) + S(2)**(S(2)*x + S(-1))*sqrt(a - S(2)**(-x)*b)/(a*log(S(2))) + S(3)*b**S(2)*atanh(sqrt(a - S(2)**(-x)*b)/sqrt(a))/(S(4)*a**(S(5)/2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**(S(2)*x)/sqrt(a - S(2)**(-x)*b), x), x, S(3)*S(2)**(x + S(-2))*b*sqrt(a - S(2)**(-x)*b)/(a**S(2)*log(S(2))) + S(2)**(S(2)*x + S(-1))*sqrt(a - S(2)**(-x)*b)/(a*log(S(2))) + S(3)*b**S(2)*atanh(sqrt(a - S(2)**(-x)*b)/sqrt(a))/(S(4)*a**(S(5)/2)*log(S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(exp(S(2)*x) + S(2)*exp(x) + S(1)), x), x, x - log(exp(x) + S(1)) + S(1)/(exp(x) + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(exp(S(2)*x) + S(3)*exp(x) + S(2)), x), x, x/S(2) - log(exp(x) + S(1)) + log(exp(x) + S(2))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(exp(S(2)*x) + exp(x) + S(-1)), x), x, -x + (-sqrt(S(5)) + S(5))*log(S(2)*exp(x) + S(1) + sqrt(S(5)))/S(10) + (sqrt(S(5)) + S(5))*log(S(2)*exp(x) - sqrt(S(5)) + S(1))/S(10), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(exp(S(2)*x) + S(3)*exp(x) + S(3)), x), x, x/S(3) - log(exp(S(2)*x) + S(3)*exp(x) + S(3))/S(6) - sqrt(S(3))*atan(sqrt(S(3))*(S(2)*exp(x) + S(3))/S(3))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(a + b*exp(x) + c*exp(S(2)*x)), x), x, b*atanh((b + S(2)*c*exp(x))/sqrt(-S(4)*a*c + b**S(2)))/(a*sqrt(-S(4)*a*c + b**S(2))) + x/a - log(a + b*exp(x) + c*exp(S(2)*x))/(S(2)*a), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(exp(S(2)*x) + S(2)*exp(x) + S(1)), x), x, x**S(2)/S(2) - x*log(exp(x) + S(1)) - x + x/(exp(x) + S(1)) + log(exp(x) + S(1)) - polylog(S(2), -exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(exp(S(2)*x) + S(3)*exp(x) + S(2)), x), x, -x*log(S(1) + exp(-x)) + x*log(S(1) + S(2)*exp(-x))/S(2) - polylog(S(2), -S(2)*exp(-x))/S(2) + polylog(S(2), -exp(-x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(exp(S(2)*x) + exp(x) + S(-1)), x), x, S(2)*sqrt(S(5))*x*log(S(1) + (S(1)/2 + sqrt(S(5))/S(2))*exp(-x))/(S(5)*(S(1) + sqrt(S(5)))) - S(2)*sqrt(S(5))*x*log(S(1) + (-sqrt(S(5))/S(2) + S(1)/2)*exp(-x))/(S(5)*(-sqrt(S(5)) + S(1))) + S(2)*sqrt(S(5))*polylog(S(2), (S(-1)/2 + sqrt(S(5))/S(2))*exp(-x))/(S(5)*(-sqrt(S(5)) + S(1))) - S(2)*sqrt(S(5))*polylog(S(2), (-sqrt(S(5))/S(2) + S(-1)/2)*exp(-x))/(S(5)*(S(1) + sqrt(S(5)))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(exp(S(2)*x) + S(3)*exp(x) + S(3)), x), x, -S(2)*sqrt(S(3))*x*log(S(1) + (S(3)/2 - sqrt(S(3))*I/S(2))*exp(-x))/(S(3)*(sqrt(S(3)) + S(3)*I)) + S(2)*sqrt(S(3))*x*log(S(1) + (S(3)/2 + sqrt(S(3))*I/S(2))*exp(-x))/(S(3)*(-sqrt(S(3)) + S(3)*I)) - S(2)*sqrt(S(3))*polylog(S(2), (S(-3)/2 - sqrt(S(3))*I/S(2))*exp(-x))/(S(3)*(-sqrt(S(3)) + S(3)*I)) + S(2)*sqrt(S(3))*polylog(S(2), (S(-3)/2 + sqrt(S(3))*I/S(2))*exp(-x))/(S(3)*(sqrt(S(3)) + S(3)*I)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(a + b*exp(x) + c*exp(S(2)*x)), x), x, S(2)*c*x*log(S(1) + (b/S(2) + sqrt(-S(4)*a*c + b**S(2))/S(2))*exp(-x)/c)/(-S(4)*a*c + b**S(2) + b*sqrt(-S(4)*a*c + b**S(2))) + S(2)*c*x*log(S(1) + (b/S(2) - sqrt(-S(4)*a*c + b**S(2))/S(2))*exp(-x)/c)/(-S(4)*a*c + b**S(2) - b*sqrt(-S(4)*a*c + b**S(2))) - S(2)*c*polylog(S(2), (-b/S(2) - sqrt(-S(4)*a*c + b**S(2))/S(2))*exp(-x)/c)/(-S(4)*a*c + b**S(2) + b*sqrt(-S(4)*a*c + b**S(2))) - S(2)*c*polylog(S(2), (-b/S(2) + sqrt(-S(4)*a*c + b**S(2))/S(2))*exp(-x)/c)/(-S(4)*a*c + b**S(2) - b*sqrt(-S(4)*a*c + b**S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(exp(S(2)*x) + S(2)*exp(x) + S(1)), x), x, x**S(3)/S(3) - x**S(2)*log(exp(x) + S(1)) + x**S(2)/(exp(x) + S(1)) + S(2)*x*log(S(1) + exp(-x)) - S(2)*x*polylog(S(2), -exp(x)) - S(2)*polylog(S(2), -exp(-x)) + S(2)*polylog(S(3), -exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(exp(S(2)*x) + S(3)*exp(x) + S(2)), x), x, -x**S(2)*log(S(1) + exp(-x)) + x**S(2)*log(S(1) + S(2)*exp(-x))/S(2) - x*polylog(S(2), -S(2)*exp(-x)) + S(2)*x*polylog(S(2), -exp(-x)) - polylog(S(3), -S(2)*exp(-x)) + S(2)*polylog(S(3), -exp(-x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(exp(S(2)*x) + exp(x) + S(-1)), x), x, S(2)*sqrt(S(5))*x**S(2)*log(S(1) + (S(1)/2 + sqrt(S(5))/S(2))*exp(-x))/(S(5)*(S(1) + sqrt(S(5)))) - S(2)*sqrt(S(5))*x**S(2)*log(S(1) + (-sqrt(S(5))/S(2) + S(1)/2)*exp(-x))/(S(5)*(-sqrt(S(5)) + S(1))) + S(4)*sqrt(S(5))*x*polylog(S(2), (S(-1)/2 + sqrt(S(5))/S(2))*exp(-x))/(S(5)*(-sqrt(S(5)) + S(1))) - S(4)*sqrt(S(5))*x*polylog(S(2), (-sqrt(S(5))/S(2) + S(-1)/2)*exp(-x))/(S(5)*(S(1) + sqrt(S(5)))) + S(4)*sqrt(S(5))*polylog(S(3), (S(-1)/2 + sqrt(S(5))/S(2))*exp(-x))/(S(5)*(-sqrt(S(5)) + S(1))) - S(4)*sqrt(S(5))*polylog(S(3), (-sqrt(S(5))/S(2) + S(-1)/2)*exp(-x))/(S(5)*(S(1) + sqrt(S(5)))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(exp(S(2)*x) + S(3)*exp(x) + S(3)), x), x, -S(2)*sqrt(S(3))*x**S(2)*log(S(1) + (S(3)/2 - sqrt(S(3))*I/S(2))*exp(-x))/(S(3)*(sqrt(S(3)) + S(3)*I)) + S(2)*sqrt(S(3))*x**S(2)*log(S(1) + (S(3)/2 + sqrt(S(3))*I/S(2))*exp(-x))/(S(3)*(-sqrt(S(3)) + S(3)*I)) - S(4)*sqrt(S(3))*x*polylog(S(2), (S(-3)/2 - sqrt(S(3))*I/S(2))*exp(-x))/(S(3)*(-sqrt(S(3)) + S(3)*I)) + S(4)*sqrt(S(3))*x*polylog(S(2), (S(-3)/2 + sqrt(S(3))*I/S(2))*exp(-x))/(S(3)*(sqrt(S(3)) + S(3)*I)) - S(4)*sqrt(S(3))*polylog(S(3), (S(-3)/2 - sqrt(S(3))*I/S(2))*exp(-x))/(S(3)*(-sqrt(S(3)) + S(3)*I)) + S(4)*sqrt(S(3))*polylog(S(3), (S(-3)/2 + sqrt(S(3))*I/S(2))*exp(-x))/(S(3)*(sqrt(S(3)) + S(3)*I)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(a + b*exp(x) + c*exp(S(2)*x)), x), x, S(2)*c*x**S(2)*log(S(1) + (b/S(2) + sqrt(-S(4)*a*c + b**S(2))/S(2))*exp(-x)/c)/(-S(4)*a*c + b**S(2) + b*sqrt(-S(4)*a*c + b**S(2))) + S(2)*c*x**S(2)*log(S(1) + (b/S(2) - sqrt(-S(4)*a*c + b**S(2))/S(2))*exp(-x)/c)/(-S(4)*a*c + b**S(2) - b*sqrt(-S(4)*a*c + b**S(2))) - S(4)*c*x*polylog(S(2), (-b/S(2) - sqrt(-S(4)*a*c + b**S(2))/S(2))*exp(-x)/c)/(-S(4)*a*c + b**S(2) + b*sqrt(-S(4)*a*c + b**S(2))) - S(4)*c*x*polylog(S(2), (-b/S(2) + sqrt(-S(4)*a*c + b**S(2))/S(2))*exp(-x)/c)/(-S(4)*a*c + b**S(2) - b*sqrt(-S(4)*a*c + b**S(2))) - S(4)*c*polylog(S(3), (-b/S(2) - sqrt(-S(4)*a*c + b**S(2))/S(2))*exp(-x)/c)/(-S(4)*a*c + b**S(2) + b*sqrt(-S(4)*a*c + b**S(2))) - S(4)*c*polylog(S(3), (-b/S(2) + sqrt(-S(4)*a*c + b**S(2))/S(2))*exp(-x)/c)/(-S(4)*a*c + b**S(2) - b*sqrt(-S(4)*a*c + b**S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(S(2)*f**(c + d*x) + f**(S(2)*c + S(2)*d*x) + S(1)), x), x, x - log(f**(c + d*x) + S(1))/(d*log(f)) + S(1)/(d*(f**(c + d*x) + S(1))*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(a + b*f**(c + d*x) + c*f**(S(2)*c + S(2)*d*x)), x), x, b*atanh((b + S(2)*c*f**(c + d*x))/sqrt(-S(4)*a*c + b**S(2)))/(a*d*sqrt(-S(4)*a*c + b**S(2))*log(f)) + x/a - log(a + b*f**(c + d*x) + c*f**(S(2)*c + S(2)*d*x))/(S(2)*a*d*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(a + b*f**(g + h*x) + c*f**(S(2)*g + S(2)*h*x)), x), x, b*atanh((b + S(2)*c*f**(g + h*x))/sqrt(-S(4)*a*c + b**S(2)))/(a*h*sqrt(-S(4)*a*c + b**S(2))*log(f)) + x/a - log(a + b*f**(g + h*x) + c*f**(S(2)*g + S(2)*h*x))/(S(2)*a*h*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(S(2)*f**(c + d*x) + f**(S(2)*c + S(2)*d*x) + S(1)), x), x, x**S(2)/S(2) - x*log(f**(c + d*x) + S(1))/(d*log(f)) - x/(d*log(f)) + x/(d*(f**(c + d*x) + S(1))*log(f)) + log(f**(c + d*x) + S(1))/(d**S(2)*log(f)**S(2)) - polylog(S(2), -f**(c + d*x))/(d**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(a + b*f**(c + d*x) + c*f**(S(2)*c + S(2)*d*x)), x), x, S(2)*c*x*log(S(1) + f**(-c - d*x)*(b + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(d*(b + sqrt(-S(4)*a*c + b**S(2)))*sqrt(-S(4)*a*c + b**S(2))*log(f)) - S(2)*c*x*log(S(1) + f**(-c - d*x)*(b - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(d*(b - sqrt(-S(4)*a*c + b**S(2)))*sqrt(-S(4)*a*c + b**S(2))*log(f)) - S(2)*c*polylog(S(2), -f**(-c - d*x)*(b + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(d**S(2)*(b + sqrt(-S(4)*a*c + b**S(2)))*sqrt(-S(4)*a*c + b**S(2))*log(f)**S(2)) + S(2)*c*polylog(S(2), -f**(-c - d*x)*(b - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(d**S(2)*(b - sqrt(-S(4)*a*c + b**S(2)))*sqrt(-S(4)*a*c + b**S(2))*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(S(2)*f**(c + d*x) + f**(S(2)*c + S(2)*d*x) + S(1)), x), x, x**S(3)/S(3) - x**S(2)*log(f**(c + d*x) + S(1))/(d*log(f)) + x**S(2)/(d*(f**(c + d*x) + S(1))*log(f)) + S(2)*x*log(f**(-c - d*x) + S(1))/(d**S(2)*log(f)**S(2)) - S(2)*x*polylog(S(2), -f**(c + d*x))/(d**S(2)*log(f)**S(2)) - S(2)*polylog(S(2), -f**(-c - d*x))/(d**S(3)*log(f)**S(3)) + S(2)*polylog(S(3), -f**(c + d*x))/(d**S(3)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(a + b*f**(c + d*x) + c*f**(S(2)*c + S(2)*d*x)), x), x, S(2)*c*x**S(2)*log(S(1) + f**(-c - d*x)*(b + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(d*(b + sqrt(-S(4)*a*c + b**S(2)))*sqrt(-S(4)*a*c + b**S(2))*log(f)) - S(2)*c*x**S(2)*log(S(1) + f**(-c - d*x)*(b - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(d*(b - sqrt(-S(4)*a*c + b**S(2)))*sqrt(-S(4)*a*c + b**S(2))*log(f)) - S(4)*c*x*polylog(S(2), -f**(-c - d*x)*(b + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(d**S(2)*(b + sqrt(-S(4)*a*c + b**S(2)))*sqrt(-S(4)*a*c + b**S(2))*log(f)**S(2)) + S(4)*c*x*polylog(S(2), -f**(-c - d*x)*(b - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(d**S(2)*(b - sqrt(-S(4)*a*c + b**S(2)))*sqrt(-S(4)*a*c + b**S(2))*log(f)**S(2)) - S(4)*c*polylog(S(3), -f**(-c - d*x)*(b + sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(d**S(3)*(b + sqrt(-S(4)*a*c + b**S(2)))*sqrt(-S(4)*a*c + b**S(2))*log(f)**S(3)) + S(4)*c*polylog(S(3), -f**(-c - d*x)*(b - sqrt(-S(4)*a*c + b**S(2)))/(S(2)*c))/(d**S(3)*(b - sqrt(-S(4)*a*c + b**S(2)))*sqrt(-S(4)*a*c + b**S(2))*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((d + e*f**(g + h*x))/(a + b*f**(g + h*x) + c*f**(S(2)*g + S(2)*h*x)), x), x, d*x/a - d*log(a + b*f**(g + h*x) + c*f**(S(2)*g + S(2)*h*x))/(S(2)*a*h*log(f)) + (-S(2)*a*e + b*d)*atanh((b + S(2)*c*f**(g + h*x))/sqrt(-S(4)*a*c + b**S(2)))/(a*h*sqrt(-S(4)*a*c + b**S(2))*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((d + e*f**(g + h*x))/(a + b*f**(g + h*x) + c*f**(S(2)*g + S(2)*h*x)), x), x, d*x/a - d*log(a + b*f**(g + h*x) + c*f**(S(2)*g + S(2)*h*x))/(S(2)*a*h*log(f)) + (-S(2)*a*e + b*d)*atanh((b + S(2)*c*f**(g + h*x))/sqrt(-S(4)*a*c + b**S(2)))/(a*h*sqrt(-S(4)*a*c + b**S(2))*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(exp(x) + S(2) + exp(-x)), x), x, -S(1)/(exp(x) + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(exp(x) + S(2) + exp(-x)), x), x, x - x/(exp(x) + S(1)) - log(exp(x) + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(exp(x) + S(2) + exp(-x)), x), x, -x**S(2)/(exp(x) + S(1)) - S(2)*x*log(S(1) + exp(-x)) + S(2)*polylog(S(2), -exp(-x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(f**(-c - d*x) + f**(c + d*x) + S(2)), x), x, -S(1)/(d*(f**(c + d*x) + S(1))*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(f**(-c - d*x) + f**(c + d*x) + S(2)), x), x, x/(d*log(f)) - x/(d*(f**(c + d*x) + S(1))*log(f)) - log(f**(c + d*x) + S(1))/(d**S(2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(f**(-c - d*x) + f**(c + d*x) + S(2)), x), x, -x**S(2)/(d*(f**(c + d*x) + S(1))*log(f)) - S(2)*x*log(f**(-c - d*x) + S(1))/(d**S(2)*log(f)**S(2)) + S(2)*polylog(S(2), -f**(-c - d*x))/(d**S(3)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(S(3)**x + S(2) + S(3)**(-x)), x), x, -S(1)/((S(3)**x + S(1))*log(S(3))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(S(2)*exp(x) + S(1) - exp(-x)), x), x, log(-S(2)*exp(x) + S(1))/S(3) - log(exp(x) + S(1))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(a + b*exp(-x) + c*exp(x)), x), x, -S(2)*atanh((a + S(2)*c*exp(x))/sqrt(a**S(2) - S(4)*b*c))/sqrt(a**S(2) - S(4)*b*c), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(a + b*exp(-x) + c*exp(x)), x), x, x*log(S(2)*c*exp(x)/(a - sqrt(a**S(2) - S(4)*b*c)) + S(1))/sqrt(a**S(2) - S(4)*b*c) - x*log(S(2)*c*exp(x)/(a + sqrt(a**S(2) - S(4)*b*c)) + S(1))/sqrt(a**S(2) - S(4)*b*c) + polylog(S(2), -S(2)*c*exp(x)/(a - sqrt(a**S(2) - S(4)*b*c)))/sqrt(a**S(2) - S(4)*b*c) - polylog(S(2), -S(2)*c*exp(x)/(a + sqrt(a**S(2) - S(4)*b*c)))/sqrt(a**S(2) - S(4)*b*c), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(a + b*exp(-x) + c*exp(x)), x), x, x**S(2)*log(S(2)*c*exp(x)/(a - sqrt(a**S(2) - S(4)*b*c)) + S(1))/sqrt(a**S(2) - S(4)*b*c) - x**S(2)*log(S(2)*c*exp(x)/(a + sqrt(a**S(2) - S(4)*b*c)) + S(1))/sqrt(a**S(2) - S(4)*b*c) + S(2)*x*polylog(S(2), -S(2)*c*exp(x)/(a - sqrt(a**S(2) - S(4)*b*c)))/sqrt(a**S(2) - S(4)*b*c) - S(2)*x*polylog(S(2), -S(2)*c*exp(x)/(a + sqrt(a**S(2) - S(4)*b*c)))/sqrt(a**S(2) - S(4)*b*c) - S(2)*polylog(S(3), -S(2)*c*exp(x)/(a - sqrt(a**S(2) - S(4)*b*c)))/sqrt(a**S(2) - S(4)*b*c) + S(2)*polylog(S(3), -S(2)*c*exp(x)/(a + sqrt(a**S(2) - S(4)*b*c)))/sqrt(a**S(2) - S(4)*b*c), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(a + b*f**(-c - d*x) + c*f**(c + d*x)), x), x, -S(2)*atanh((a + S(2)*c*f**(c + d*x))/sqrt(a**S(2) - S(4)*b*c))/(d*sqrt(a**S(2) - S(4)*b*c)*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(a + b*f**(-c - d*x) + c*f**(c + d*x)), x), x, x*log(S(2)*c*f**(c + d*x)/(a - sqrt(a**S(2) - S(4)*b*c)) + S(1))/(d*sqrt(a**S(2) - S(4)*b*c)*log(f)) - x*log(S(2)*c*f**(c + d*x)/(a + sqrt(a**S(2) - S(4)*b*c)) + S(1))/(d*sqrt(a**S(2) - S(4)*b*c)*log(f)) + polylog(S(2), -S(2)*c*f**(c + d*x)/(a - sqrt(a**S(2) - S(4)*b*c)))/(d**S(2)*sqrt(a**S(2) - S(4)*b*c)*log(f)**S(2)) - polylog(S(2), -S(2)*c*f**(c + d*x)/(a + sqrt(a**S(2) - S(4)*b*c)))/(d**S(2)*sqrt(a**S(2) - S(4)*b*c)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(a + b*f**(-c - d*x) + c*f**(c + d*x)), x), x, x**S(2)*log(S(2)*c*f**(c + d*x)/(a - sqrt(a**S(2) - S(4)*b*c)) + S(1))/(d*sqrt(a**S(2) - S(4)*b*c)*log(f)) - x**S(2)*log(S(2)*c*f**(c + d*x)/(a + sqrt(a**S(2) - S(4)*b*c)) + S(1))/(d*sqrt(a**S(2) - S(4)*b*c)*log(f)) + S(2)*x*polylog(S(2), -S(2)*c*f**(c + d*x)/(a - sqrt(a**S(2) - S(4)*b*c)))/(d**S(2)*sqrt(a**S(2) - S(4)*b*c)*log(f)**S(2)) - S(2)*x*polylog(S(2), -S(2)*c*f**(c + d*x)/(a + sqrt(a**S(2) - S(4)*b*c)))/(d**S(2)*sqrt(a**S(2) - S(4)*b*c)*log(f)**S(2)) - S(2)*polylog(S(3), -S(2)*c*f**(c + d*x)/(a - sqrt(a**S(2) - S(4)*b*c)))/(d**S(3)*sqrt(a**S(2) - S(4)*b*c)*log(f)**S(3)) + S(2)*polylog(S(3), -S(2)*c*f**(c + d*x)/(a + sqrt(a**S(2) - S(4)*b*c)))/(d**S(3)*sqrt(a**S(2) - S(4)*b*c)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((F**(sqrt(-a*x + S(1))/sqrt(a*x + S(1))))**n/(-a**S(2)*x**S(2) + S(1)), x), x, -F**(-n*sqrt(-a*x + S(1))/sqrt(a*x + S(1)))*(F**(sqrt(-a*x + S(1))/sqrt(a*x + S(1))))**n*Ei(n*sqrt(-a*x + S(1))*log(F)/sqrt(a*x + S(1)))/a, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(S(3)*sqrt(-a*x + S(1))/sqrt(a*x + S(1)))/(-a**S(2)*x**S(2) + S(1)), x), x, -Ei(S(3)*sqrt(-a*x + S(1))*log(F)/sqrt(a*x + S(1)))/a, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(S(2)*sqrt(-a*x + S(1))/sqrt(a*x + S(1)))/(-a**S(2)*x**S(2) + S(1)), x), x, -Ei(S(2)*sqrt(-a*x + S(1))*log(F)/sqrt(a*x + S(1)))/a, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(sqrt(-a*x + S(1))/sqrt(a*x + S(1)))/(-a**S(2)*x**S(2) + S(1)), x), x, -Ei(sqrt(-a*x + S(1))*log(F)/sqrt(a*x + S(1)))/a, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(-sqrt(-a*x + S(1))/sqrt(a*x + S(1)))/(-a**S(2)*x**S(2) + S(1)), x), x, -Ei(-sqrt(-a*x + S(1))*log(F)/sqrt(a*x + S(1)))/a, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(-S(2)*sqrt(-a*x + S(1))/sqrt(a*x + S(1)))/(-a**S(2)*x**S(2) + S(1)), x), x, -Ei(-S(2)*sqrt(-a*x + S(1))*log(F)/sqrt(a*x + S(1)))/a, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((F**(sqrt(-c*x + S(1))/sqrt(c*x + S(1)))*b + a)**n/(-c**S(2)*x**S(2) + S(1)), x), x, -Integral((F**x*b + a)**n/x, (x, sqrt(-c*x + S(1))/sqrt(c*x + S(1))))/c, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((F**(sqrt(-c*x + S(1))/sqrt(c*x + S(1)))*b + a)**S(3)/(-c**S(2)*x**S(2) + S(1)), x), x, -a**S(3)*log(sqrt(-c*x + S(1))/sqrt(c*x + S(1)))/c - S(3)*a**S(2)*b*Ei(sqrt(-c*x + S(1))*log(F)/sqrt(c*x + S(1)))/c - S(3)*a*b**S(2)*Ei(S(2)*sqrt(-c*x + S(1))*log(F)/sqrt(c*x + S(1)))/c - b**S(3)*Ei(S(3)*sqrt(-c*x + S(1))*log(F)/sqrt(c*x + S(1)))/c, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((F**(sqrt(-c*x + S(1))/sqrt(c*x + S(1)))*b + a)**S(2)/(-c**S(2)*x**S(2) + S(1)), x), x, -a**S(2)*log(sqrt(-c*x + S(1))/sqrt(c*x + S(1)))/c - S(2)*a*b*Ei(sqrt(-c*x + S(1))*log(F)/sqrt(c*x + S(1)))/c - b**S(2)*Ei(S(2)*sqrt(-c*x + S(1))*log(F)/sqrt(c*x + S(1)))/c, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((F**(sqrt(-c*x + S(1))/sqrt(c*x + S(1)))*b + a)/(-c**S(2)*x**S(2) + S(1)), x), x, -a*log(sqrt(-c*x + S(1))/sqrt(c*x + S(1)))/c - b*Ei(sqrt(-c*x + S(1))*log(F)/sqrt(c*x + S(1)))/c, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/((F**(sqrt(-c*x + S(1))/sqrt(c*x + S(1)))*b + a)*(-c**S(2)*x**S(2) + S(1))), x), x, -Integral(S(1)/(x*(F**x*b + a)), (x, sqrt(-c*x + S(1))/sqrt(c*x + S(1))))/c, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/((F**(sqrt(-c*x + S(1))/sqrt(c*x + S(1)))*b + a)**S(2)*(-c**S(2)*x**S(2) + S(1))), x), x, -Integral(S(1)/(x*(F**x*b + a)**S(2)), (x, sqrt(-c*x + S(1))/sqrt(c*x + S(1))))/c, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(a**x*b**x*x**S(2), x), x, a**x*b**x*x**S(2)/(log(a) + log(b)) - S(2)*a**x*b**x*x/(log(a) + log(b))**S(2) + S(2)*a**x*b**x/(log(a) + log(b))**S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(a**x*b**x*x, x), x, a**x*b**x*x/(log(a) + log(b)) - a**x*b**x/(log(a) + log(b))**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(a**x*b**x, x), x, a**x*b**x/(log(a) + log(b)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(a**x*b**x/x, x), x, Ei(x*(log(a) + log(b))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(a**x*b**x/x**S(2), x), x, -a**x*b**x/x + (log(a) + log(b))*Ei(x*(log(a) + log(b))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(a**x*b**x/x**S(3), x), x, -a**x*b**x*(log(a) + log(b))/(S(2)*x) - a**x*b**x/(S(2)*x**S(2)) + (log(a) + log(b))**S(2)*Ei(x*(log(a) + log(b)))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(a**x*b**x*c**x, x), x, a**x*b**x*c**x/(log(a) + log(b) + log(c)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(a**x*b**(-x), x), x, a**x*b**(-x)/(log(a) - log(b)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(a**x*b**(-x)*x**S(2), x), x, a**x*b**(-x)*x**S(2)/(log(a) - log(b)) - S(2)*a**x*b**(-x)*x/(log(a) - log(b))**S(2) + S(2)*a**x*b**(-x)/(log(a) - log(b))**S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(2)*x)/(a + b*exp(x)), x), x, -a*log(a + b*exp(x))/b**S(2) + exp(x)/b, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(2)*x)/(a + b*exp(x))**S(2), x), x, a/(b**S(2)*(a + b*exp(x))) + log(a + b*exp(x))/b**S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(2)*x)/(a + b*exp(x))**S(3), x), x, exp(S(2)*x)/(S(2)*a*(a + b*exp(x))**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(2)*x)/(a + b*exp(x))**S(4), x), x, a/(S(3)*b**S(2)*(a + b*exp(x))**S(3)) - S(1)/(S(2)*b**S(2)*(a + b*exp(x))**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(4)*x)/(a + b*exp(S(2)*x)), x), x, -a*log(a + b*exp(S(2)*x))/(S(2)*b**S(2)) + exp(S(2)*x)/(S(2)*b), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(4)*x)/(a + b*exp(S(2)*x))**S(2), x), x, a/(S(2)*b**S(2)*(a + b*exp(S(2)*x))) + log(a + b*exp(S(2)*x))/(S(2)*b**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(4)*x)/(a + b*exp(S(2)*x))**S(3), x), x, exp(S(4)*x)/(S(4)*a*(a + b*exp(S(2)*x))**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(4)*x)/(a + b*exp(S(2)*x))**S(4), x), x, a/(S(6)*b**S(2)*(a + b*exp(S(2)*x))**S(3)) - S(1)/(S(4)*b**S(2)*(a + b*exp(S(2)*x))**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(4)*x)/(a + b*exp(S(2)*x))**(S(2)/3), x), x, -S(3)*a*(a + b*exp(S(2)*x))**(S(1)/3)/(S(2)*b**S(2)) + S(3)*(a + b*exp(S(2)*x))**(S(4)/3)/(S(8)*b**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(n*x))*exp(-n*x), x), x, -a*exp(-n*x)/n + b*x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(n*x))**S(2)*exp(-n*x), x), x, -a**S(2)*exp(-n*x)/n + S(2)*a*b*x + b**S(2)*exp(n*x)/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(n*x))**S(3)*exp(-n*x), x), x, -a**S(3)*exp(-n*x)/n + S(3)*a**S(2)*b*x + S(3)*a*b**S(2)*exp(n*x)/n + b**S(3)*exp(S(2)*n*x)/(S(2)*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(-n*x)/(a + b*exp(n*x)), x), x, -exp(-n*x)/(a*n) - b*x/a**S(2) + b*log(a + b*exp(n*x))/(a**S(2)*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(-n*x)/(a + b*exp(n*x))**S(2), x), x, -b/(a**S(2)*n*(a + b*exp(n*x))) - exp(-n*x)/(a**S(2)*n) - S(2)*b*x/a**S(3) + S(2)*b*log(a + b*exp(n*x))/(a**S(3)*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(-n*x)/(a + b*exp(n*x))**S(3), x), x, -b/(S(2)*a**S(2)*n*(a + b*exp(n*x))**S(2)) - S(2)*b/(a**S(3)*n*(a + b*exp(n*x))) - exp(-n*x)/(a**S(3)*n) - S(3)*b*x/a**S(4) + S(3)*b*log(a + b*exp(n*x))/(a**S(4)*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x)/(c + d*f**(S(2)*b*x + e)), x), x, f**(a - e/S(2))*atan(sqrt(d)*f**(b*x + e/S(2))/sqrt(c))/(b*sqrt(c)*sqrt(d)*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + S(2)*b*x)/(c + d*f**(S(2)*b*x + e)), x), x, f**(a - e)*log(c + d*f**(S(2)*b*x + e))/(S(2)*b*d*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + S(3)*b*x)/(c + d*f**(S(2)*b*x + e)), x), x, -sqrt(c)*f**(a - S(3)*e/S(2))*atan(sqrt(d)*f**(b*x + e/S(2))/sqrt(c))/(b*d**(S(3)/2)*log(f)) + f**(a + b*x - e)/(b*d*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + S(4)*b*x)/(c + d*f**(S(2)*b*x + e)), x), x, -c*f**(a - S(2)*e)*log(c + d*f**(S(2)*b*x + e))/(S(2)*b*d**S(2)*log(f)) + f**(a + S(2)*b*x - e)/(S(2)*b*d*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + S(5)*b*x)/(c + d*f**(S(2)*b*x + e)), x), x, c**(S(3)/2)*f**(a - S(5)*e/S(2))*atan(sqrt(d)*f**(b*x + e/S(2))/sqrt(c))/(b*d**(S(5)/2)*log(f)) - c*f**(a + b*x - S(2)*e)/(b*d**S(2)*log(f)) + f**(a + S(3)*b*x - e)/(S(3)*b*d*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(exp(S(2)*x) + S(1)), x), x, atan(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(-exp(S(2)*x) + S(1)), x), x, atanh(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(x)/(-exp(S(2)*x) + S(1)), x), x, x*atanh(exp(x)) + polylog(S(2), -exp(x))/S(2) - polylog(S(2), exp(x))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*exp(x)/(-exp(S(2)*x) + S(1)), x), x, x**S(2)*atanh(exp(x)) + x*polylog(S(2), -exp(x)) - x*polylog(S(2), exp(x)) - polylog(S(3), -exp(x)) + polylog(S(3), exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*exp(x)/(-exp(S(2)*x) + S(1)), x), x, x**S(3)*atanh(exp(x)) + S(3)*x**S(2)*polylog(S(2), -exp(x))/S(2) - S(3)*x**S(2)*polylog(S(2), exp(x))/S(2) - S(3)*x*polylog(S(3), -exp(x)) + S(3)*x*polylog(S(3), exp(x)) + S(3)*polylog(S(4), -exp(x)) - S(3)*polylog(S(4), exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**x/(a + b*f**(S(2)*x)), x), x, atan(sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**x*x/(a + b*f**(S(2)*x)), x), x, x*atan(sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)) - I*polylog(S(2), -I*sqrt(b)*f**x/sqrt(a))/(S(2)*sqrt(a)*sqrt(b)*log(f)**S(2)) + I*polylog(S(2), I*sqrt(b)*f**x/sqrt(a))/(S(2)*sqrt(a)*sqrt(b)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**x*x**S(2)/(a + b*f**(S(2)*x)), x), x, x**S(2)*atan(sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)) - I*x*polylog(S(2), -I*sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)**S(2)) + I*x*polylog(S(2), I*sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)**S(2)) + I*polylog(S(3), -I*sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)**S(3)) - I*polylog(S(3), I*sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**x*x**S(3)/(a + b*f**(S(2)*x)), x), x, x**S(3)*atan(sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)) - S(3)*I*x**S(2)*polylog(S(2), -I*sqrt(b)*f**x/sqrt(a))/(S(2)*sqrt(a)*sqrt(b)*log(f)**S(2)) + S(3)*I*x**S(2)*polylog(S(2), I*sqrt(b)*f**x/sqrt(a))/(S(2)*sqrt(a)*sqrt(b)*log(f)**S(2)) + S(3)*I*x*polylog(S(3), -I*sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)**S(3)) - S(3)*I*x*polylog(S(3), I*sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)**S(3)) - S(3)*I*polylog(S(4), -I*sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)**S(4)) + S(3)*I*polylog(S(4), I*sqrt(b)*f**x/sqrt(a))/(sqrt(a)*sqrt(b)*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**x/(a + b*f**(S(2)*x))**S(2), x), x, f**x/(S(2)*a*(a + b*f**(S(2)*x))*log(f)) + atan(sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**x*x/(a + b*f**(S(2)*x))**S(2), x), x, f**x*x/(S(2)*a*(a + b*f**(S(2)*x))*log(f)) + x*atan(sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)) - atan(sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(2)) - I*polylog(S(2), -I*sqrt(b)*f**x/sqrt(a))/(S(4)*a**(S(3)/2)*sqrt(b)*log(f)**S(2)) + I*polylog(S(2), I*sqrt(b)*f**x/sqrt(a))/(S(4)*a**(S(3)/2)*sqrt(b)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**x*x**S(2)/(a + b*f**(S(2)*x))**S(2), x), x, f**x*x**S(2)/(S(2)*a*(a + b*f**(S(2)*x))*log(f)) + x**S(2)*atan(sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)) - x*atan(sqrt(b)*f**x/sqrt(a))/(a**(S(3)/2)*sqrt(b)*log(f)**S(2)) - I*x*polylog(S(2), -I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(2)) + I*x*polylog(S(2), I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(2)) + I*polylog(S(2), -I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(3)) - I*polylog(S(2), I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(3)) + I*polylog(S(3), -I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(3)) - I*polylog(S(3), I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**x*x**S(3)/(a + b*f**(S(2)*x))**S(2), x), x, f**x*x**S(3)/(S(2)*a*(a + b*f**(S(2)*x))*log(f)) + x**S(3)*atan(sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)) - S(3)*x**S(2)*atan(sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(2)) - S(3)*I*x**S(2)*polylog(S(2), -I*sqrt(b)*f**x/sqrt(a))/(S(4)*a**(S(3)/2)*sqrt(b)*log(f)**S(2)) + S(3)*I*x**S(2)*polylog(S(2), I*sqrt(b)*f**x/sqrt(a))/(S(4)*a**(S(3)/2)*sqrt(b)*log(f)**S(2)) + S(3)*I*x*polylog(S(2), -I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(3)) - S(3)*I*x*polylog(S(2), I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(3)) + S(3)*I*x*polylog(S(3), -I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(3)) - S(3)*I*x*polylog(S(3), I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(3)) - S(3)*I*polylog(S(3), -I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(4)) + S(3)*I*polylog(S(3), I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(4)) - S(3)*I*polylog(S(4), -I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(4)) + S(3)*I*polylog(S(4), I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(3)/2)*sqrt(b)*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**x*x/(a + b*f**(S(2)*x))**S(3), x), x, f**x*x/(S(4)*a*(a + b*f**(S(2)*x))**S(2)*log(f)) + S(3)*f**x*x/(S(8)*a**S(2)*(a + b*f**(S(2)*x))*log(f)) - f**x/(S(8)*a**S(2)*(a + b*f**(S(2)*x))*log(f)**S(2)) + S(3)*x*atan(sqrt(b)*f**x/sqrt(a))/(S(8)*a**(S(5)/2)*sqrt(b)*log(f)) - atan(sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(5)/2)*sqrt(b)*log(f)**S(2)) - S(3)*I*polylog(S(2), -I*sqrt(b)*f**x/sqrt(a))/(S(16)*a**(S(5)/2)*sqrt(b)*log(f)**S(2)) + S(3)*I*polylog(S(2), I*sqrt(b)*f**x/sqrt(a))/(S(16)*a**(S(5)/2)*sqrt(b)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**x*x**S(2)/(a + b*f**(S(2)*x))**S(3), x), x, f**x*x**S(2)/(S(4)*a*(a + b*f**(S(2)*x))**S(2)*log(f)) + S(3)*f**x*x**S(2)/(S(8)*a**S(2)*(a + b*f**(S(2)*x))*log(f)) - f**x*x/(S(4)*a**S(2)*(a + b*f**(S(2)*x))*log(f)**S(2)) + S(3)*x**S(2)*atan(sqrt(b)*f**x/sqrt(a))/(S(8)*a**(S(5)/2)*sqrt(b)*log(f)) - x*atan(sqrt(b)*f**x/sqrt(a))/(a**(S(5)/2)*sqrt(b)*log(f)**S(2)) - S(3)*I*x*polylog(S(2), -I*sqrt(b)*f**x/sqrt(a))/(S(8)*a**(S(5)/2)*sqrt(b)*log(f)**S(2)) + S(3)*I*x*polylog(S(2), I*sqrt(b)*f**x/sqrt(a))/(S(8)*a**(S(5)/2)*sqrt(b)*log(f)**S(2)) + atan(sqrt(b)*f**x/sqrt(a))/(S(4)*a**(S(5)/2)*sqrt(b)*log(f)**S(3)) + I*polylog(S(2), -I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(5)/2)*sqrt(b)*log(f)**S(3)) - I*polylog(S(2), I*sqrt(b)*f**x/sqrt(a))/(S(2)*a**(S(5)/2)*sqrt(b)*log(f)**S(3)) + S(3)*I*polylog(S(3), -I*sqrt(b)*f**x/sqrt(a))/(S(8)*a**(S(5)/2)*sqrt(b)*log(f)**S(3)) - S(3)*I*polylog(S(3), I*sqrt(b)*f**x/sqrt(a))/(S(8)*a**(S(5)/2)*sqrt(b)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(a*f**x + b*f**(-x)), x), x, x*atan(sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)) - I*polylog(S(2), -I*sqrt(a)*f**x/sqrt(b))/(S(2)*sqrt(a)*sqrt(b)*log(f)**S(2)) + I*polylog(S(2), I*sqrt(a)*f**x/sqrt(b))/(S(2)*sqrt(a)*sqrt(b)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(a*f**x + b*f**(-x)), x), x, x**S(2)*atan(sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)) - I*x*polylog(S(2), -I*sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)**S(2)) + I*x*polylog(S(2), I*sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)**S(2)) + I*polylog(S(3), -I*sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)**S(3)) - I*polylog(S(3), I*sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)/(a*f**x + b*f**(-x)), x), x, x**S(3)*atan(sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)) - S(3)*I*x**S(2)*polylog(S(2), -I*sqrt(a)*f**x/sqrt(b))/(S(2)*sqrt(a)*sqrt(b)*log(f)**S(2)) + S(3)*I*x**S(2)*polylog(S(2), I*sqrt(a)*f**x/sqrt(b))/(S(2)*sqrt(a)*sqrt(b)*log(f)**S(2)) + S(3)*I*x*polylog(S(3), -I*sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)**S(3)) - S(3)*I*x*polylog(S(3), I*sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)**S(3)) - S(3)*I*polylog(S(4), -I*sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)**S(4)) + S(3)*I*polylog(S(4), I*sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**x/(a + b*f**(S(2)*x))**S(3), x), x, f**x/(S(4)*a*(a + b*f**(S(2)*x))**S(2)*log(f)) + S(3)*f**x/(S(8)*a**S(2)*(a + b*f**(S(2)*x))*log(f)) + S(3)*atan(sqrt(b)*f**x/sqrt(a))/(S(8)*a**(S(5)/2)*sqrt(b)*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(a*f**x + b*f**(-x)), x), x, atan(sqrt(a)*f**x/sqrt(b))/(sqrt(a)*sqrt(b)*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a*f**x + b*f**(-x))**(S(-2)), x), x, -S(1)/(S(2)*a*(a*f**(S(2)*x) + b)*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(a*f**x + b*f**(-x))**S(2), x), x, -x/(S(2)*a*(a*f**(S(2)*x) + b)*log(f)) + x/(S(2)*a*b*log(f)) - log(a*f**(S(2)*x) + b)/(S(4)*a*b*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(a*f**x + b*f**(-x))**S(2), x), x, -x**S(2)/(S(2)*a*(a*f**(S(2)*x) + b)*log(f)) - x*log(S(1) + b*f**(-S(2)*x)/a)/(S(2)*a*b*log(f)**S(2)) + polylog(S(2), -b*f**(-S(2)*x)/a)/(S(4)*a*b*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)/(a*f**x + b*f**(-x))**S(2), x), x, -x**S(3)/(S(2)*a*(a*f**(S(2)*x) + b)*log(f)) - S(3)*x**S(2)*log(S(1) + b*f**(-S(2)*x)/a)/(S(4)*a*b*log(f)**S(2)) + S(3)*x*polylog(S(2), -b*f**(-S(2)*x)/a)/(S(4)*a*b*log(f)**S(3)) + S(3)*polylog(S(3), -b*f**(-S(2)*x)/a)/(S(8)*a*b*log(f)**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a*f**x + b*f**(-x))**(S(-3)), x), x, -f**x/(S(4)*a*(a*f**(S(2)*x) + b)**S(2)*log(f)) + f**x/(S(8)*a*b*(a*f**(S(2)*x) + b)*log(f)) + atan(sqrt(a)*f**x/sqrt(b))/(S(8)*a**(S(3)/2)*b**(S(3)/2)*log(f)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(a*f**x + b*f**(-x))**S(3), x), x, -f**x*x/(S(4)*a*(a*f**(S(2)*x) + b)**S(2)*log(f)) + f**x*x/(S(8)*a*b*(a*f**(S(2)*x) + b)*log(f)) + f**x/(S(8)*a*b*(a*f**(S(2)*x) + b)*log(f)**S(2)) + x*atan(sqrt(a)*f**x/sqrt(b))/(S(8)*a**(S(3)/2)*b**(S(3)/2)*log(f)) - I*polylog(S(2), -I*sqrt(a)*f**x/sqrt(b))/(S(16)*a**(S(3)/2)*b**(S(3)/2)*log(f)**S(2)) + I*polylog(S(2), I*sqrt(a)*f**x/sqrt(b))/(S(16)*a**(S(3)/2)*b**(S(3)/2)*log(f)**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/(a*f**x + b*f**(-x))**S(3), x), x, -f**x*x**S(2)/(S(4)*a*(a*f**(S(2)*x) + b)**S(2)*log(f)) + f**x*x**S(2)/(S(8)*a*b*(a*f**(S(2)*x) + b)*log(f)) + f**x*x/(S(4)*a*b*(a*f**(S(2)*x) + b)*log(f)**S(2)) + x**S(2)*atan(sqrt(a)*f**x/sqrt(b))/(S(8)*a**(S(3)/2)*b**(S(3)/2)*log(f)) - I*x*polylog(S(2), -I*sqrt(a)*f**x/sqrt(b))/(S(8)*a**(S(3)/2)*b**(S(3)/2)*log(f)**S(2)) + I*x*polylog(S(2), I*sqrt(a)*f**x/sqrt(b))/(S(8)*a**(S(3)/2)*b**(S(3)/2)*log(f)**S(2)) - atan(sqrt(a)*f**x/sqrt(b))/(S(4)*a**(S(3)/2)*b**(S(3)/2)*log(f)**S(3)) + I*polylog(S(3), -I*sqrt(a)*f**x/sqrt(b))/(S(8)*a**(S(3)/2)*b**(S(3)/2)*log(f)**S(3)) - I*polylog(S(3), I*sqrt(a)*f**x/sqrt(b))/(S(8)*a**(S(3)/2)*b**(S(3)/2)*log(f)**S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(a + b*x + c*x**S(2))*g**(d + e*x + f*x**S(2)), x), x, sqrt(pi)*f**a*g**d*exp(-(b*log(f) + e*log(g))**S(2)/(S(4)*(c*log(f) + f*log(g))))*erfi((b*log(f)/S(2) + e*log(g)/S(2) + x*(c*log(f) + f*log(g)))/sqrt(c*log(f) + f*log(g)))/(S(2)*sqrt(c*log(f) + f*log(g))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(e*(c + d*x))*(G**(h*(f + g*x))*b + a)**n, x), x, F**(e*(c + d*x))*(G**(h*(f + g*x))*b + a)**(n + S(1))*hyper((S(1), d*e*log(F)/(g*h*log(G)) + n + S(1)), (d*e*log(F)/(g*h*log(G)) + S(1),), -G**(h*(f + g*x))*b/a)/(a*d*e*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(e*(c + d*x))*H**(t*(r + s*x))/(F**(e*(c + d*x))*b + a), x), x, H**(t*(r + s*x))*hyper((S(1), -s*t*log(H)/(d*e*log(F))), (S(1) - s*t*log(H)/(d*e*log(F)),), -F**(-e*(c + d*x))*a/b)/(b*s*t*log(H)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(e*(d*x + f))*H**(t*(r + s*x))/(F**(e*(c + d*x))*b + a), x), x, F**(-e*(c - f))*H**(t*(r + s*x))*hyper((S(1), -s*t*log(H)/(d*e*log(F))), (S(1) - s*t*log(H)/(d*e*log(F)),), -F**(-e*(c + d*x))*a/b)/(b*s*t*log(H)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((d + e*exp(h + i*x))*(f + g*x)**S(3)/(a + b*exp(h + i*x) + c*exp(S(2)*h + S(2)*i*x)), x), x, S(6)*g**S(3)*(e + (b*e - S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*polylog(S(4), -(b + sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(4)*(b + sqrt(-S(4)*a*c + b**S(2)))) + S(6)*g**S(3)*(e + (-b*e + S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*polylog(S(4), -(b - sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(4)*(b - sqrt(-S(4)*a*c + b**S(2)))) + S(6)*g**S(2)*(e + (b*e - S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(f + g*x)*polylog(S(3), -(b + sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(3)*(b + sqrt(-S(4)*a*c + b**S(2)))) + S(6)*g**S(2)*(e + (-b*e + S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(f + g*x)*polylog(S(3), -(b - sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(3)*(b - sqrt(-S(4)*a*c + b**S(2)))) + S(3)*g*(e + (b*e - S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(f + g*x)**S(2)*polylog(S(2), -(b + sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(2)*(b + sqrt(-S(4)*a*c + b**S(2)))) + S(3)*g*(e + (-b*e + S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(f + g*x)**S(2)*polylog(S(2), -(b - sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(2)*(b - sqrt(-S(4)*a*c + b**S(2)))) - (e + (b*e - S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(f + g*x)**S(3)*log(S(1) + (b + sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i*(b + sqrt(-S(4)*a*c + b**S(2)))) - (e + (-b*e + S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(f + g*x)**S(3)*log(S(1) + (b - sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i*(b - sqrt(-S(4)*a*c + b**S(2)))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((d + e*exp(h + i*x))*(f + g*x)**S(2)/(a + b*exp(h + i*x) + c*exp(S(2)*h + S(2)*i*x)), x), x, S(2)*g**S(2)*(e + (b*e - S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*polylog(S(3), -(b + sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(3)*(b + sqrt(-S(4)*a*c + b**S(2)))) + S(2)*g**S(2)*(e + (-b*e + S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*polylog(S(3), -(b - sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(3)*(b - sqrt(-S(4)*a*c + b**S(2)))) + S(2)*g*(e + (b*e - S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(f + g*x)*polylog(S(2), -(b + sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(2)*(b + sqrt(-S(4)*a*c + b**S(2)))) + S(2)*g*(e + (-b*e + S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(f + g*x)*polylog(S(2), -(b - sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(2)*(b - sqrt(-S(4)*a*c + b**S(2)))) - (e + (b*e - S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(f + g*x)**S(2)*log(S(1) + (b + sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i*(b + sqrt(-S(4)*a*c + b**S(2)))) - (e + (-b*e + S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(f + g*x)**S(2)*log(S(1) + (b - sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i*(b - sqrt(-S(4)*a*c + b**S(2)))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((d + e*exp(h + i*x))*(f + g*x)/(a + b*exp(h + i*x) + c*exp(S(2)*h + S(2)*i*x)), x), x, g*(e + (b*e - S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*polylog(S(2), -(b + sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(2)*(b + sqrt(-S(4)*a*c + b**S(2)))) + g*(e + (-b*e + S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*polylog(S(2), -(b - sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i**S(2)*(b - sqrt(-S(4)*a*c + b**S(2)))) - (e + (b*e - S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(f + g*x)*log(S(1) + (b + sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i*(b + sqrt(-S(4)*a*c + b**S(2)))) + (e + (-b*e + S(2)*c*d)/sqrt(-S(4)*a*c + b**S(2)))*(-f - g*x)*log(S(1) + (b - sqrt(-S(4)*a*c + b**S(2)))*exp(-h - i*x)/(S(2)*c))/(i*(b - sqrt(-S(4)*a*c + b**S(2)))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((d + e*exp(h + i*x))/(a + b*exp(h + i*x) + c*exp(S(2)*h + S(2)*i*x)), x), x, d*x/a - d*log(a + b*exp(h + i*x) + c*exp(S(2)*h + S(2)*i*x))/(S(2)*a*i) + (-S(2)*a*e + b*d)*atanh((b + S(2)*c*exp(h + i*x))/sqrt(-S(4)*a*c + b**S(2)))/(a*i*sqrt(-S(4)*a*c + b**S(2))), expand=True, _diff=True, _numerical=True) # long time assert rubi_test(rubi_integrate((d + e*exp(h + i*x))/((f + g*x)*(a + b*exp(h + i*x) + c*exp(S(2)*h + S(2)*i*x))), x), x, d*Integral(S(1)/((f + g*x)*(a + b*exp(h + i*x) + c*exp(S(2)*h + S(2)*i*x))), x) + e*Integral(exp(h + i*x)/((f + g*x)*(a + b*exp(h + i*x) + c*exp(S(2)*h + S(2)*i*x))), x), expand=True, _diff=True, _numerical=True) # long time assert rubi_test(rubi_integrate((d + e*exp(h + i*x))/((f + g*x)**S(2)*(a + b*exp(h + i*x) + c*exp(S(2)*h + S(2)*i*x))), x), x, d*Integral(S(1)/((f + g*x)**S(2)*(a + b*exp(h + i*x) + c*exp(S(2)*h + S(2)*i*x))), x) + e*Integral(exp(h + i*x)/((f + g*x)**S(2)*(a + b*exp(h + i*x) + c*exp(S(2)*h + S(2)*i*x))), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*(-a*e*exp(c + d*x) + b*e)/(-S(2)*a*e*exp(c + d*x) - b*e*exp(S(2)*c + S(2)*d*x) + b*e), x), x, -x*log(S(1) + (a - sqrt(a**S(2) + b**S(2)))*exp(-c - d*x)/b)/(S(2)*d) - x*log(S(1) + (a + sqrt(a**S(2) + b**S(2)))*exp(-c - d*x)/b)/(S(2)*d) + polylog(S(2), -(a - sqrt(a**S(2) + b**S(2)))*exp(-c - d*x)/b)/(S(2)*d**S(2)) + polylog(S(2), -(a + sqrt(a**S(2) + b**S(2)))*exp(-c - d*x)/b)/(S(2)*d**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(a + b*x + c*x**S(3))*(b + S(3)*c*x**S(2)), x), x, F**(a + b*x + c*x**S(3))/log(F), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(F**(S(1)/(a + b*x + c*x**S(2)))*(b + S(2)*c*x)/(a + b*x + c*x**S(2))**S(2), x), x, -F**(S(1)/(a + b*x + c*x**S(2)))/log(F), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*(a + b*x + c*x**S(2))**m*exp(a + b*x + c*x**S(2)), x), x, (-a - b*x - c*x**S(2))**(-m)*(a + b*x + c*x**S(2))**m*Gamma(m + S(1), -a - b*x - c*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*(a + b*x + c*x**S(2))**S(3)*exp(a + b*x + c*x**S(2)), x), x, (a + b*x + c*x**S(2))**S(3)*exp(a + b*x + c*x**S(2)) - S(3)*(a + b*x + c*x**S(2))**S(2)*exp(a + b*x + c*x**S(2)) + S(6)*(a + b*x + c*x**S(2))*exp(a + b*x + c*x**S(2)) - S(6)*exp(a + b*x + c*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*(a + b*x + c*x**S(2))**S(2)*exp(a + b*x + c*x**S(2)), x), x, (a + b*x + c*x**S(2))**S(2)*exp(a + b*x + c*x**S(2)) - S(2)*(a + b*x + c*x**S(2))*exp(a + b*x + c*x**S(2)) + S(2)*exp(a + b*x + c*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*(a + b*x + c*x**S(2))*exp(a + b*x + c*x**S(2)), x), x, (a + b*x + c*x**S(2))*exp(a + b*x + c*x**S(2)) - exp(a + b*x + c*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*exp(a + b*x + c*x**S(2)), x), x, exp(a + b*x + c*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*exp(a + b*x + c*x**S(2))/(a + b*x + c*x**S(2)), x), x, Ei(a + b*x + c*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*exp(a + b*x + c*x**S(2))/(a + b*x + c*x**S(2))**S(2), x), x, Ei(a + b*x + c*x**S(2)) - exp(a + b*x + c*x**S(2))/(a + b*x + c*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*exp(a + b*x + c*x**S(2))/(a + b*x + c*x**S(2))**S(3), x), x, Ei(a + b*x + c*x**S(2))/S(2) - exp(a + b*x + c*x**S(2))/(S(2)*(a + b*x + c*x**S(2))) - exp(a + b*x + c*x**S(2))/(S(2)*(a + b*x + c*x**S(2))**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*(a + b*x + c*x**S(2))**(S(7)/2)*exp(a + b*x + c*x**S(2)), x), x, (a + b*x + c*x**S(2))**(S(7)/2)*exp(a + b*x + c*x**S(2)) - S(7)*(a + b*x + c*x**S(2))**(S(5)/2)*exp(a + b*x + c*x**S(2))/S(2) + S(35)*(a + b*x + c*x**S(2))**(S(3)/2)*exp(a + b*x + c*x**S(2))/S(4) - S(105)*sqrt(a + b*x + c*x**S(2))*exp(a + b*x + c*x**S(2))/S(8) + S(105)*sqrt(pi)*erfi(sqrt(a + b*x + c*x**S(2)))/S(16), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*(a + b*x + c*x**S(2))**(S(5)/2)*exp(a + b*x + c*x**S(2)), x), x, (a + b*x + c*x**S(2))**(S(5)/2)*exp(a + b*x + c*x**S(2)) - S(5)*(a + b*x + c*x**S(2))**(S(3)/2)*exp(a + b*x + c*x**S(2))/S(2) + S(15)*sqrt(a + b*x + c*x**S(2))*exp(a + b*x + c*x**S(2))/S(4) - S(15)*sqrt(pi)*erfi(sqrt(a + b*x + c*x**S(2)))/S(8), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*(a + b*x + c*x**S(2))**(S(3)/2)*exp(a + b*x + c*x**S(2)), x), x, (a + b*x + c*x**S(2))**(S(3)/2)*exp(a + b*x + c*x**S(2)) - S(3)*sqrt(a + b*x + c*x**S(2))*exp(a + b*x + c*x**S(2))/S(2) + S(3)*sqrt(pi)*erfi(sqrt(a + b*x + c*x**S(2)))/S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*sqrt(a + b*x + c*x**S(2))*exp(a + b*x + c*x**S(2)), x), x, sqrt(a + b*x + c*x**S(2))*exp(a + b*x + c*x**S(2)) - sqrt(pi)*erfi(sqrt(a + b*x + c*x**S(2)))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*exp(a + b*x + c*x**S(2))/sqrt(a + b*x + c*x**S(2)), x), x, sqrt(pi)*erfi(sqrt(a + b*x + c*x**S(2))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*exp(a + b*x + c*x**S(2))/(a + b*x + c*x**S(2))**(S(3)/2), x), x, S(2)*sqrt(pi)*erfi(sqrt(a + b*x + c*x**S(2))) - S(2)*exp(a + b*x + c*x**S(2))/sqrt(a + b*x + c*x**S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*exp(a + b*x + c*x**S(2))/(a + b*x + c*x**S(2))**(S(5)/2), x), x, S(4)*sqrt(pi)*erfi(sqrt(a + b*x + c*x**S(2)))/S(3) - S(4)*exp(a + b*x + c*x**S(2))/(S(3)*sqrt(a + b*x + c*x**S(2))) - S(2)*exp(a + b*x + c*x**S(2))/(S(3)*(a + b*x + c*x**S(2))**(S(3)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*exp(a + b*x + c*x**S(2))/(a + b*x + c*x**S(2))**(S(7)/2), x), x, S(8)*sqrt(pi)*erfi(sqrt(a + b*x + c*x**S(2)))/S(15) - S(8)*exp(a + b*x + c*x**S(2))/(S(15)*sqrt(a + b*x + c*x**S(2))) - S(4)*exp(a + b*x + c*x**S(2))/(S(15)*(a + b*x + c*x**S(2))**(S(3)/2)) - S(2)*exp(a + b*x + c*x**S(2))/(S(5)*(a + b*x + c*x**S(2))**(S(5)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((b + S(2)*c*x)*exp(a + b*x + c*x**S(2))/(a + b*x + c*x**S(2))**(S(9)/2), x), x, S(16)*sqrt(pi)*erfi(sqrt(a + b*x + c*x**S(2)))/S(105) - S(16)*exp(a + b*x + c*x**S(2))/(S(105)*sqrt(a + b*x + c*x**S(2))) - S(8)*exp(a + b*x + c*x**S(2))/(S(105)*(a + b*x + c*x**S(2))**(S(3)/2)) - S(4)*exp(a + b*x + c*x**S(2))/(S(35)*(a + b*x + c*x**S(2))**(S(5)/2)) - S(2)*exp(a + b*x + c*x**S(2))/(S(7)*(a + b*x + c*x**S(2))**(S(7)/2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(-x)/sqrt(S(1) - exp(-S(2)*x)), x), x, -asin(exp(-x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(exp(S(2)*x) + S(4)), x), x, atan(exp(x)/S(2))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(-exp(S(2)*x) + S(1)), x), x, atanh(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(-S(4)*exp(S(2)*x) + S(3)), x), x, sqrt(S(3))*atanh(S(2)*sqrt(S(3))*exp(x)/S(3))/S(6), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(-S(4)*exp(S(2)*x) + S(3))*exp(x), x), x, sqrt(-S(4)*exp(S(2)*x) + S(3))*exp(x)/S(2) + S(3)*asin(S(2)*sqrt(S(3))*exp(x)/S(3))/S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*exp(x**S(2)), x), x, x**S(2)*exp(x**S(2))/S(2) - exp(x**S(2))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(-exp(S(2)*x) + S(1))*exp(x), x), x, sqrt(-exp(S(2)*x) + S(1))*exp(x)/S(2) + asin(exp(x))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/sqrt(exp(S(2)*x) + exp(x) + S(1)), x), x, asinh(sqrt(S(3))*(S(2)*exp(x) + S(1))/S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(exp(S(2)*x) + S(-4)), x), x, -atanh(exp(x)/S(2))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(-x**S(2) + S(2)), x), x, -exp(-x**S(2) + S(2))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(-x**E + exp(x), x), x, -x**(E + S(1))/(E + S(1)) + exp(x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(S(2)*x) + S(-1))/(exp(S(2)*x) + S(3)), x), x, -x/S(3) + S(2)*log(exp(S(2)*x) + S(3))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/sqrt(-exp(S(2)*x) + S(1)), x), x, asin(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(2)*x)/(exp(S(4)*x) + S(1)), x), x, atan(exp(S(2)*x))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(exp(S(2)*x) - S(3)*exp(x)), x), x, -x/S(9) + log(-exp(x) + S(3))/S(9) + exp(-x)/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(x) + S(-2))*exp(x)/(exp(x) + S(1)), x), x, exp(x) - S(3)*log(exp(x) + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(exp(S(2)*x) + S(-1)), x), x, -atanh(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(exp(S(2)*x) + S(1)), x), x, atan(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(x) + exp(-x))/(exp(x) - exp(-x)), x), x, log(-exp(x) + exp(-x)), expand=True, _diff=True, _numerical=True) or rubi_test(rubi_integrate((exp(x) + exp(-x))/(exp(x) - exp(-x)), x), x, -x + log(-exp(S(2)*x) + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(x) - exp(-x))/(exp(x) + exp(-x)), x), x, log(exp(x) + exp(-x)), expand=True, _diff=True, _numerical=True) or rubi_test(rubi_integrate((exp(x) - exp(-x))/(exp(x) + exp(-x)), x), x, -x + log(exp(S(2)*x) + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(S(2)*x) + exp(-S(2)*x))/(exp(S(2)*x) - exp(-S(2)*x)), x), x, -x + log(-exp(S(4)*x) + S(1))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/sqrt(exp(S(2)*x) + S(1)), x), x, asinh(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(sqrt(x + S(4)))/sqrt(x + S(4)), x), x, S(2)*exp(sqrt(x + S(4))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/sqrt(exp(S(2)*x**S(2)) + S(-1)), x), x, atan(sqrt(exp(S(2)*x**S(2)) + S(-1)))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(exp(S(2)*x) + S(9))*exp(x), x), x, sqrt(exp(S(2)*x) + S(9))*exp(x)/S(2) + S(9)*asinh(exp(x)/S(3))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(exp(S(2)*x) + S(1))*exp(x), x), x, sqrt(exp(S(2)*x) + S(1))*exp(x)/S(2) + asinh(exp(x))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(x**S(2))/(exp(S(2)*x**S(2)) + S(1)), x), x, atan(exp(x**S(2)))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*exp(x**(S(3)/2)), x), x, S(2)*x**(S(3)/2)*exp(x**(S(3)/2))/S(3) - S(2)*exp(x**(S(3)/2))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/sqrt(exp(S(2)*x) + S(-3)), x), x, atanh(exp(x)/sqrt(exp(S(2)*x) + S(-3))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(-exp(S(2)*x) + S(16)), x), x, atanh(exp(x)/S(4))/S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(5)*x)/(exp(S(10)*x) + S(1)), x), x, atan(exp(S(5)*x))/S(5), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(4)*x)/sqrt(exp(S(8)*x) + S(16)), x), x, asinh(exp(S(4)*x)/S(4))/S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*exp(S(4)*x**S(3))*cos(S(7)*x**S(3)), x), x, S(7)*exp(S(4)*x**S(3))*sin(S(7)*x**S(3))/S(195) + S(4)*exp(S(4)*x**S(3))*cos(S(7)*x**S(3))/S(195), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(x**S(2) + S(1)), x), x, exp(x**S(2) + S(1))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*exp(x**S(3) + S(1)), x), x, exp(x**S(3) + S(1))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(sqrt(x))/sqrt(x), x), x, S(2)*exp(sqrt(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x**(S(1)/3))/x**(S(2)/3), x), x, S(3)*exp(x**(S(1)/3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((x**S(5) + S(2)*x**S(3) + S(-8))*exp(S(3)*x), x), x, x**S(5)*exp(S(3)*x)/S(3) - S(5)*x**S(4)*exp(S(3)*x)/S(9) + S(38)*x**S(3)*exp(S(3)*x)/S(27) - S(38)*x**S(2)*exp(S(3)*x)/S(27) + S(76)*x*exp(S(3)*x)/S(81) - S(724)*exp(S(3)*x)/S(243), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((x + exp(x))**S(2), x), x, x**S(3)/S(3) + S(2)*x*exp(x) + exp(S(2)*x)/S(2) - S(2)*exp(x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(S(3)*x) + exp(S(2)*x) + exp(x))*exp(-S(4)*x), x), x, -exp(-x) - exp(-S(2)*x)/S(2) - exp(-S(3)*x)/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(exp(S(2)*x) + S(2)*exp(x) + S(1)), x), x, -S(1)/(exp(x) + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(-x)*cos(S(3)*x), x), x, S(3)*exp(-x)*sin(S(3)*x)/S(10) - exp(-x)*cos(S(3)*x)/S(10), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(2)*x)/(exp(S(2)*x) + S(3)*exp(x) + S(2)), x), x, -log(exp(x) + S(1)) + S(2)*log(exp(x) + S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(2)*x)/(exp(x) + S(1)), x), x, exp(x) - log(exp(x) + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(3)*x)*cos(S(5)*x), x), x, S(5)*exp(S(3)*x)*sin(S(5)*x)/S(34) + S(3)*exp(S(3)*x)*cos(S(5)*x)/S(34), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)*sech(exp(x)), x), x, atan(sinh(exp(x))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(-x)/(S(2)*exp(x) + S(1)), x), x, -S(2)*x + S(2)*log(S(2)*exp(x) + S(1)) - exp(-x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)*cos(S(3)*x + S(4)), x), x, S(3)*exp(x)*sin(S(3)*x + S(4))/S(10) + exp(x)*cos(S(3)*x + S(4))/S(10), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*(exp(x) + exp(-x)), x), x, x*exp(x) - x*exp(-x) - exp(x) - exp(-x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(exp(S(2)*x) + S(3)*exp(x) + S(2)), x), x, -S(2)*atanh(S(2)*exp(x) + S(3)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(2)*x)/(exp(x) + S(1))**(S(1)/3), x), x, S(3)*(exp(x) + S(1))**(S(5)/3)/S(5) - S(3)*(exp(x) + S(1))**(S(2)/3)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(2)*x)/(exp(x) + S(1))**(S(1)/4), x), x, S(4)*(exp(x) + S(1))**(S(7)/4)/S(7) - S(4)*(exp(x) + S(1))**(S(3)/4)/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((S(2)*exp(S(2)*x) - exp(x))/sqrt(S(3)*exp(S(2)*x) - S(6)*exp(x) + S(-1)), x), x, S(2)*sqrt(S(3)*exp(S(2)*x) - S(6)*exp(x) + S(-1))/S(3) - sqrt(S(3))*atanh(sqrt(S(3))*(-exp(x) + S(1))/sqrt(S(3)*exp(S(2)*x) - S(6)*exp(x) + S(-1)))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((x**S(2) - S(5)*x)*exp(x), x), x, x**S(2)*exp(x) - S(7)*x*exp(x) + S(7)*exp(x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((x**S(2) - x)*exp(S(3)*x), x), x, x**S(2)*exp(S(3)*x)/S(3) - S(5)*x*exp(S(3)*x)/S(9) + S(5)*exp(S(3)*x)/S(27), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**(S(2)*x)*(log(x) + S(1))*exp(x**x), x), x, (x**x + S(-1))*exp(x**x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(S(7)*x) + exp(S(5)*x))/(exp(x) + exp(-x)), x), x, exp(S(6)*x)/S(6), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**(S(-2) - S(1)/x)*(-log(x) + S(1)), x), x, -x**(-S(1)/x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(x))**S(2), x), x, a**S(2)*x + S(2)*a*b*exp(x) + b**S(2)*exp(S(2)*x)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(x))**S(3), x), x, a**S(3)*x + S(3)*a**S(2)*b*exp(x) + S(3)*a*b**S(2)*exp(S(2)*x)/S(2) + b**S(3)*exp(S(3)*x)/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*exp(x))**S(4), x), x, a**S(4)*x + S(4)*a**S(3)*b*exp(x) + S(3)*a**S(2)*b**S(2)*exp(S(2)*x) + S(4)*a*b**S(3)*exp(S(3)*x)/S(3) + b**S(4)*exp(S(4)*x)/S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/sqrt(a + b*exp(c + d*x)), x), x, -S(2)*atanh(sqrt(a + b*exp(c + d*x))/sqrt(a))/(sqrt(a)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/sqrt(-a + b*exp(c + d*x)), x), x, S(2)*atan(sqrt(-a + b*exp(c + d*x))/sqrt(a))/(sqrt(a)*d), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(a + b*exp(c + d*x)), x), x, -S(2)*sqrt(a)*atanh(sqrt(a + b*exp(c + d*x))/sqrt(a))/d + S(2)*sqrt(a + b*exp(c + d*x))/d, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(-a + b*exp(c + d*x)), x), x, -S(2)*sqrt(a)*atan(sqrt(-a + b*exp(c + d*x))/sqrt(a))/d + S(2)*sqrt(-a + b*exp(c + d*x))/d, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(6)*x)*sin(S(3)*x), x), x, S(2)*exp(S(6)*x)*sin(S(3)*x)/S(15) - exp(S(6)*x)*cos(S(3)*x)/S(15), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(3)*x)/(exp(S(2)*x) + S(1)), x), x, exp(x) - atan(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(3)*x)/(exp(S(2)*x) + S(-1)), x), x, exp(x) - atanh(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(-x)/sqrt(exp(S(2)*x) + S(1)), x), x, -sqrt(exp(S(2)*x) + S(1))*exp(-x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(exp(S(2)*x) - S(8)*exp(x) + S(-1)), x), x, sqrt(S(17))*atanh(sqrt(S(17))*(-exp(x) + S(4))/S(17))/S(17), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*exp(S(7)*x), x), x, x**S(3)*exp(S(7)*x)/S(7) - S(3)*x**S(2)*exp(S(7)*x)/S(49) + S(6)*x*exp(S(7)*x)/S(343) - S(6)*exp(S(7)*x)/S(2401), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*exp(-S(2)*x + S(8)), x), x, -x**S(3)*exp(-S(2)*x + S(8))/S(2) - S(3)*x**S(2)*exp(-S(2)*x + S(8))/S(4) - S(3)*x*exp(-S(2)*x + S(8))/S(4) - S(3)*exp(-S(2)*x + S(8))/S(8), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(-exp(S(2)*x) + S(9))*exp(x), x), x, sqrt(-exp(S(2)*x) + S(9))*exp(x)/S(2) + S(9)*asin(exp(x)/S(3))/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(sqrt(-exp(S(2)*x) + S(9))*exp(S(6)*x), x), x, -(-exp(S(2)*x) + S(9))**(S(7)/2)/S(7) + S(18)*(-exp(S(2)*x) + S(9))**(S(5)/2)/S(5) - S(27)*(-exp(S(2)*x) + S(9))**(S(3)/2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(6)*x)/(-exp(x) + S(9))**(S(5)/2), x), x, S(2)*(-exp(x) + S(9))**(S(7)/2)/S(7) - S(18)*(-exp(x) + S(9))**(S(5)/2) + S(540)*(-exp(x) + S(9))**(S(3)/2) - S(14580)*sqrt(-exp(x) + S(9)) - S(65610)/sqrt(-exp(x) + S(9)) + S(39366)/(-exp(x) + S(9))**(S(3)/2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*(-S(7)*exp(x**S(4)) + S(2))**S(5), x), x, S(8)*x**S(4) - S(16807)*exp(S(5)*x**S(4))/S(20) + S(12005)*exp(S(4)*x**S(4))/S(8) - S(3430)*exp(S(3)*x**S(4))/S(3) + S(490)*exp(S(2)*x**S(4)) - S(140)*exp(x**S(4)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*sqrt(-exp(S(2)*x**S(2)) + S(1))*exp(x**S(2)), x), x, sqrt(-exp(S(2)*x**S(2)) + S(1))*exp(x**S(2))/S(4) + asin(exp(x**S(2)))/S(4), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*(-exp(S(4)*x**S(3)) + S(1))**S(2)*exp(x**S(3)), x), x, exp(S(9)*x**S(3))/S(27) - S(2)*exp(S(5)*x**S(3))/S(15) + exp(x**S(3))/S(3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x + exp(x)), x), x, exp(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x + exp(x) + exp(exp(x))), x), x, exp(exp(exp(x))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(x) + exp(-x))**S(2), x), x, S(2)*x + exp(S(2)*x)/S(2) - exp(-S(2)*x)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(exp(x) + exp(-x)), x), x, atan(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(x) + exp(-x))**(S(-2)), x), x, -S(1)/(S(2)*(exp(S(2)*x) + S(1))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(exp(x) - exp(-x)), x), x, -atanh(exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(x) - exp(-x))**(S(-2)), x), x, S(1)/(S(2)*(-exp(S(2)*x) + S(1))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(x) - exp(-x))**S(2)*exp(x), x), x, exp(S(3)*x)/S(3) - S(2)*exp(x) - exp(-x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(x) - exp(-x))**S(3)*exp(x), x), x, S(3)*x + exp(S(4)*x)/S(4) - S(3)*exp(S(2)*x)/S(2) + exp(-S(2)*x)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((S(4)**x + S(1))/(S(2)**x + S(1)), x), x, S(2)**x/log(S(2)) + x - S(2)*log(S(2)**x + S(1))/log(S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((S(4)**x + S(1))/(S(1) + S(2)**(-x)), x), x, -S(2)**x/log(S(2)) + S(2)**(S(2)*x + S(-1))/log(S(2)) + S(2)*log(S(2)**x + S(1))/log(S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(-S(2)*a*exp((a + x)**S(2))/x + exp((a + x)**S(2))/x**S(2), x), x, sqrt(pi)*erfi(a + x) - exp((a + x)**S(2))/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((x**S(8) + x**S(6) + x**S(4))*exp(-x**S(2)), x), x, -x**S(7)*exp(-x**S(2))/S(2) - S(9)*x**S(5)*exp(-x**S(2))/S(4) - S(49)*x**S(3)*exp(-x**S(2))/S(8) - S(147)*x*exp(-x**S(2))/S(16) + S(147)*sqrt(pi)*erf(x)/S(32), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(1)/(exp(S(3)*x) - exp(x)), x), x, -atanh(exp(x)) + exp(-x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((x**S(2) + x + S(-5))*exp(x)/(x + S(-1))**S(2), x), x, exp(x) - S(3)*exp(x)/(-x + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(3)*exp(x**S(2))/(x**S(2) + S(1))**S(2), x), x, exp(x**S(2))/(S(2)*(x**S(2) + S(1))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(S(3)*x)/sqrt(S(16)*exp(S(2)*x) + S(25)), x), x, sqrt(S(16)*exp(S(2)*x) + S(25))*exp(x)/S(32) - S(25)*asinh(S(4)*exp(x)/S(5))/S(128), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(x) + S(1))/sqrt(x + exp(x)), x), x, S(2)*sqrt(x + exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(x) + S(1))/(x + exp(x)), x), x, log(x + exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x**S(2))/x**S(2), x), x, sqrt(pi)*erfi(x) - exp(x**S(2))/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((S(4)*x**S(4) + S(1))*exp(x**S(2))/x**S(2), x), x, S(2)*x*exp(x**S(2)) - exp(x**S(2))/x, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**S(2)*sqrt(f**x), x), x, S(16)*b**S(2)*sqrt(f**x)/log(f)**S(3) - S(8)*b*(a + b*x)*sqrt(f**x)/log(f)**S(2) + S(2)*(a + b*x)**S(2)*sqrt(f**x)/log(f), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(3)**(x**S(2) + S(1))*x, x), x, S(3)**(x**S(2) + S(1))/(S(2)*log(S(3))), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**(sqrt(x))/sqrt(x), x), x, S(2)**(sqrt(x) + S(1))/log(S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**(S(1)/x)/x**S(2), x), x, -S(2)**(S(1)/x)/log(S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)**x + S(2)**(-x), x), x, S(2)**x/log(S(2)) - S(2)**(-x)/log(S(2)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((x**S(2) - S(3)*x + S(2))*exp(-S(4)*x), x), x, -x**S(2)*exp(-S(4)*x)/S(4) + S(5)*x*exp(-S(4)*x)/S(8) - S(11)*exp(-S(4)*x)/S(32), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(k**(x/S(2)) + x**(sqrt(k)), x), x, S(2)*k**(x/S(2))/log(k) + x**(sqrt(k) + S(1))/(sqrt(k) + S(1)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(10)**(sqrt(x))/sqrt(x), x), x, S(2)**(sqrt(x) + S(1))*S(5)**(sqrt(x))/log(S(10)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/sqrt(x + exp(x)) + S(1)/sqrt(x + exp(x)), x), x, S(2)*sqrt(x + exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*(exp(x) + S(1))/sqrt(x + exp(x)) + S(2)*sqrt(x + exp(x)), x), x, S(2)*x*sqrt(x + exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(x)/sqrt(x + exp(x)) + x/sqrt(x + exp(x)) + S(2)*sqrt(x + exp(x)), x), x, S(2)*x*sqrt(x + exp(x)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*(exp(x) + S(1))/sqrt(x + exp(x)), x), x, S(2)*x*sqrt(x + exp(x)) - S(2)*Integral(sqrt(x + exp(x)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(x)/sqrt(x + exp(x)) + x/sqrt(x + exp(x)), x), x, S(2)*x*sqrt(x + exp(x)) - S(2)*Integral(sqrt(x + exp(x)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp(x)/sqrt(x + exp(x)), x), x, S(2)*x*sqrt(x + exp(x)) + S(2)*sqrt(x + exp(x)) - Integral(S(1)/sqrt(x + exp(x)), x) - S(3)*Integral(sqrt(x + exp(x)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*(S(3)*x**S(2) + S(5)*exp(x))/(S(5)*sqrt(x**S(3) + S(5)*exp(x))) + S(4)*x*sqrt(x**S(3) + S(5)*exp(x))/S(5), x), x, S(2)*x**S(2)*sqrt(x**S(3) + S(5)*exp(x))/S(5), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)*exp(x)/sqrt(x**S(3) + S(5)*exp(x)), x), x, S(2)*x**S(2)*sqrt(x**S(3) + S(5)*exp(x))/S(5) - S(4)*Integral(x*sqrt(x**S(3) + S(5)*exp(x)), x)/S(5) - S(3)*Integral(x**S(4)/sqrt(x**S(3) + S(5)*exp(x)), x)/S(5), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((-exp(x) + S(-1))/(x + exp(x))**(S(1)/3), x), x, -S(3)*(x + exp(x))**(S(2)/3)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(x + exp(x))**(S(1)/3) - (x + exp(x))**(S(2)/3) - S(1)/(x + exp(x))**(S(1)/3), x), x, -S(3)*(x + exp(x))**(S(2)/3)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(x + exp(x))**(S(1)/3), x), x, -S(3)*(x + exp(x))**(S(2)/3)/S(2) + Integral((x + exp(x))**(S(-1)/3), x) + Integral((x + exp(x))**(S(2)/3), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((S(5)*x + (S(2)*x + S(3))*exp(x))/(x + exp(x))**(S(1)/3), x), x, S(3)*x*(x + exp(x))**(S(2)/3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(S(2)*x*exp(x)/(x + exp(x))**(S(1)/3) + S(2)*x/(x + exp(x))**(S(1)/3) + S(3)*(x + exp(x))**(S(2)/3), x), x, S(3)*x*(x + exp(x))**(S(2)/3), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((exp(x) - exp(-x))*(exp(x) + exp(-x))**S(2)*exp(x), x), x, -x + exp(S(4)*x)/S(4) + exp(S(2)*x)/S(2) + exp(-S(2)*x)/S(2), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x/(x + exp(x)), x), x, Integral(x/(x + exp(x)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**S(2)/sqrt(x + exp(x)), x), x, Integral(x**S(2)/sqrt(x + exp(x)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(x + exp(x)), x), x, Integral(exp(x)/(x + exp(x)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(x)/(x**S(2) + exp(x)), x), x, Integral(exp(x)/(x**S(2) + exp(x)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f(x)/(x + f(x)), x), x, x - Integral(x/(x + f(x)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f(x)/(x**S(2) + f(x)), x), x, x - Integral(x**S(2)/(x**S(2) + f(x)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f(x)/(x + f(x))**S(2), x), x, -Integral(x/(x + f(x))**S(2), x) + Integral(S(1)/(x + f(x)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f(x)/(x**S(2) + f(x))**S(2), x), x, -Integral(x**S(2)/(x**S(2) + f(x))**S(2), x) + Integral(S(1)/(x**S(2) + f(x)), x), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((F**(c + d*x)*a)**m*(F**(e + f*x)*b)**n, x), x, (F**(c + d*x)*a)**m*(F**(e + f*x)*b)**n/((d*m + f*n)*log(F)), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(exp(a + b*x**n + c + d*x**n), x), x, -x*(x**n*(-b - d))**(-S(1)/n)*Gamma(S(1)/n, x**n*(-b - d))*exp(a + c)/n, expand=True, _diff=True, _numerical=True) # (difference in simplify `exp(a*log(f) + c*log(g))` converts to `f**a*g**c` in mathematica) # failing assert rubi_test(rubi_integrate(f**(a + b*x**n)*g**(c + d*x**n), x), x, -f**a*g**c*x*(-x**n*(b*log(f) + d*log(g)))**(-S(1)/n)*Gamma(S(1)/n, -x**n*(b*log(f) + d*log(g)))/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x**m*exp(x**n), x), x, -x**(m + S(1))*(-x**n)**(-(m + S(1))/n)*Gamma((m + S(1))/n, -x**n)/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**(x**n)*x**m, x), x, -x**(m + S(1))*(-x**n*log(f))**(-(m + S(1))/n)*Gamma((m + S(1))/n, -x**n*log(f))/n, expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate((a + b*x)**m*exp((a + b*x)**n), x), x, -(-(a + b*x)**n)**(-(m + S(1))/n)*(a + b*x)**(m + S(1))*Gamma((m + S(1))/n, -(a + b*x)**n)/(b*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(f**((a + b*x)**n)*(a + b*x)**m, x), x, -(-(a + b*x)**n*log(f))**(-(m + S(1))/n)*(a + b*x)**(m + S(1))*Gamma((m + S(1))/n, -(a + b*x)**n*log(f))/(b*n), expand=True, _diff=True, _numerical=True) assert rubi_test(rubi_integrate(x*exp((a + b*x)**S(3)), x), x, a*(a + b*x)*Gamma(S(1)/3, -(a + b*x)**S(3))/(S(3)*b**S(2)*(-(a + b*x)**S(3))**(S(1)/3)) - (a + b*x)**S(2)*Gamma(S(2)/3, -(a + b*x)**S(3))/(S(3)*b**S(2)*(-(a + b*x)**S(3))**(S(2)/3)), expand=True, _diff=True, _numerical=True)
275.778022
1,673
0.492082
64,011
250,958
1.875303
0.003124
0.072259
0.038237
0.15045
0.987096
0.981381
0.973392
0.96058
0.943036
0.926075
0
0.04798
0.103392
250,958
909
1,674
276.081408
0.485505
0.020398
0
0.020737
0
0.001152
0.000354
0
0
0
0
0
0.976959
1
0.003456
false
0
0.011521
0
0.014977
0
0
0
1
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
11
d5d715c2c7e546a892d4028e671a9bd265d0b85b
39,354
py
Python
sdk/python/pulumi_aws/iam/role.py
jen20/pulumi-aws
172e00c642adc03238f89cc9c5a16b914a77c2b1
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/iam/role.py
jen20/pulumi-aws
172e00c642adc03238f89cc9c5a16b914a77c2b1
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/iam/role.py
jen20/pulumi-aws
172e00c642adc03238f89cc9c5a16b914a77c2b1
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities, _tables from . import outputs from ._inputs import * __all__ = ['RoleArgs', 'Role'] @pulumi.input_type class RoleArgs: def __init__(__self__, *, assume_role_policy: pulumi.Input[str], description: Optional[pulumi.Input[str]] = None, force_detach_policies: Optional[pulumi.Input[bool]] = None, inline_policies: Optional[pulumi.Input[Sequence[pulumi.Input['RoleInlinePolicyArgs']]]] = None, managed_policy_arns: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, max_session_duration: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, name_prefix: Optional[pulumi.Input[str]] = None, path: Optional[pulumi.Input[str]] = None, permissions_boundary: Optional[pulumi.Input[str]] = None, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None): """ The set of arguments for constructing a Role resource. :param pulumi.Input[str] assume_role_policy: Policy that grants an entity permission to assume the role. :param pulumi.Input[str] description: Description of the role. :param pulumi.Input[bool] force_detach_policies: Whether to force detaching any policies the role has before destroying it. Defaults to `false`. :param pulumi.Input[Sequence[pulumi.Input['RoleInlinePolicyArgs']]] inline_policies: Configuration block defining an exclusive set of IAM inline policies associated with the IAM role. Defined below. If no blocks are configured, the provider will ignore any managing any inline policies in this resource. Configuring one empty block (i.e., `inline_policy {}`) will cause the provider to remove _all_ inline policies. :param pulumi.Input[Sequence[pulumi.Input[str]]] managed_policy_arns: Set of exclusive IAM managed policy ARNs to attach to the IAM role. If this attribute is not configured, the provider will ignore policy attachments to this resource. When configured, the provider will align the role's managed policy attachments with this set by attaching or detaching managed policies. Configuring an empty set (i.e., `managed_policy_arns = []`) will cause the provider to remove _all_ managed policy attachments. :param pulumi.Input[int] max_session_duration: Maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours. :param pulumi.Input[str] name: Name of the role policy. :param pulumi.Input[str] name_prefix: Creates a unique friendly name beginning with the specified prefix. Conflicts with `name`. :param pulumi.Input[str] path: Path to the role. See [IAM Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) for more information. :param pulumi.Input[str] permissions_boundary: ARN of the policy that is used to set the permissions boundary for the role. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Key-value mapping of tags for the IAM role """ pulumi.set(__self__, "assume_role_policy", assume_role_policy) if description is not None: pulumi.set(__self__, "description", description) if force_detach_policies is not None: pulumi.set(__self__, "force_detach_policies", force_detach_policies) if inline_policies is not None: pulumi.set(__self__, "inline_policies", inline_policies) if managed_policy_arns is not None: pulumi.set(__self__, "managed_policy_arns", managed_policy_arns) if max_session_duration is not None: pulumi.set(__self__, "max_session_duration", max_session_duration) if name is not None: pulumi.set(__self__, "name", name) if name_prefix is not None: pulumi.set(__self__, "name_prefix", name_prefix) if path is not None: pulumi.set(__self__, "path", path) if permissions_boundary is not None: pulumi.set(__self__, "permissions_boundary", permissions_boundary) if tags is not None: pulumi.set(__self__, "tags", tags) @property @pulumi.getter(name="assumeRolePolicy") def assume_role_policy(self) -> pulumi.Input[str]: """ Policy that grants an entity permission to assume the role. """ return pulumi.get(self, "assume_role_policy") @assume_role_policy.setter def assume_role_policy(self, value: pulumi.Input[str]): pulumi.set(self, "assume_role_policy", value) @property @pulumi.getter def description(self) -> Optional[pulumi.Input[str]]: """ Description of the role. """ return pulumi.get(self, "description") @description.setter def description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "description", value) @property @pulumi.getter(name="forceDetachPolicies") def force_detach_policies(self) -> Optional[pulumi.Input[bool]]: """ Whether to force detaching any policies the role has before destroying it. Defaults to `false`. """ return pulumi.get(self, "force_detach_policies") @force_detach_policies.setter def force_detach_policies(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "force_detach_policies", value) @property @pulumi.getter(name="inlinePolicies") def inline_policies(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['RoleInlinePolicyArgs']]]]: """ Configuration block defining an exclusive set of IAM inline policies associated with the IAM role. Defined below. If no blocks are configured, the provider will ignore any managing any inline policies in this resource. Configuring one empty block (i.e., `inline_policy {}`) will cause the provider to remove _all_ inline policies. """ return pulumi.get(self, "inline_policies") @inline_policies.setter def inline_policies(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['RoleInlinePolicyArgs']]]]): pulumi.set(self, "inline_policies", value) @property @pulumi.getter(name="managedPolicyArns") def managed_policy_arns(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ Set of exclusive IAM managed policy ARNs to attach to the IAM role. If this attribute is not configured, the provider will ignore policy attachments to this resource. When configured, the provider will align the role's managed policy attachments with this set by attaching or detaching managed policies. Configuring an empty set (i.e., `managed_policy_arns = []`) will cause the provider to remove _all_ managed policy attachments. """ return pulumi.get(self, "managed_policy_arns") @managed_policy_arns.setter def managed_policy_arns(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "managed_policy_arns", value) @property @pulumi.getter(name="maxSessionDuration") def max_session_duration(self) -> Optional[pulumi.Input[int]]: """ Maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours. """ return pulumi.get(self, "max_session_duration") @max_session_duration.setter def max_session_duration(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "max_session_duration", value) @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ Name of the role policy. """ return pulumi.get(self, "name") @name.setter def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) @property @pulumi.getter(name="namePrefix") def name_prefix(self) -> Optional[pulumi.Input[str]]: """ Creates a unique friendly name beginning with the specified prefix. Conflicts with `name`. """ return pulumi.get(self, "name_prefix") @name_prefix.setter def name_prefix(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name_prefix", value) @property @pulumi.getter def path(self) -> Optional[pulumi.Input[str]]: """ Path to the role. See [IAM Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) for more information. """ return pulumi.get(self, "path") @path.setter def path(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "path", value) @property @pulumi.getter(name="permissionsBoundary") def permissions_boundary(self) -> Optional[pulumi.Input[str]]: """ ARN of the policy that is used to set the permissions boundary for the role. """ return pulumi.get(self, "permissions_boundary") @permissions_boundary.setter def permissions_boundary(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "permissions_boundary", value) @property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: """ Key-value mapping of tags for the IAM role """ return pulumi.get(self, "tags") @tags.setter def tags(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]): pulumi.set(self, "tags", value) class Role(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, assume_role_policy: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, force_detach_policies: Optional[pulumi.Input[bool]] = None, inline_policies: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['RoleInlinePolicyArgs']]]]] = None, managed_policy_arns: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, max_session_duration: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, name_prefix: Optional[pulumi.Input[str]] = None, path: Optional[pulumi.Input[str]] = None, permissions_boundary: Optional[pulumi.Input[str]] = None, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, __props__=None, __name__=None, __opts__=None): """ Provides an IAM role. > **NOTE:** If policies are attached to the role via the `iam.PolicyAttachment` resource and you are modifying the role `name` or `path`, the `force_detach_policies` argument must be set to `true` and applied before attempting the operation otherwise you will encounter a `DeleteConflict` error. The `iam.RolePolicyAttachment` resource does not have this requirement. > **NOTE:** If you use this resource's `managed_policy_arns` argument or `inline_policy` configuration blocks, this resource will take over exclusive management of the role's respective policy types (e.g., both policy types if both arguments are used). These arguments are incompatible with other ways of managing a role's policies, such as `iam.PolicyAttachment`, `iam.RolePolicyAttachment`, and `iam.RolePolicy`. If you attempt to manage a role's policies by multiple means, you will get resource cycling and/or errors. ## Example Usage ### Basic Example ```python import pulumi import json import pulumi_aws as aws test_role = aws.iam.Role("testRole", assume_role_policy=json.dumps({ "Version": "2012-10-17", "Statement": [{ "Action": "sts:AssumeRole", "Effect": "Allow", "Sid": "", "Principal": { "Service": "ec2.amazonaws.com", }, }], }), tags={ "tag-key": "tag-value", }) ``` ### Example of Using Data Source for Assume Role Policy ```python import pulumi import pulumi_aws as aws instance_assume_role_policy = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs( actions=["sts:AssumeRole"], principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs( type="Service", identifiers=["ec2.amazonaws.com"], )], )]) instance = aws.iam.Role("instance", path="/system/", assume_role_policy=instance_assume_role_policy.json) ``` ### Example of Exclusive Inline Policies This example creates an IAM role with two inline IAM policies. If someone adds another inline policy out-of-band, on the next apply, the provider will remove that policy. If someone deletes these policies out-of-band, the provider will recreate them. ```python import pulumi import json import pulumi_aws as aws inline_policy = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs( actions=["ec2:DescribeAccountAttributes"], resources=["*"], )]) example = aws.iam.Role("example", assume_role_policy=data["aws_iam_policy_document"]["instance_assume_role_policy"]["json"], inline_policies=[ aws.iam.RoleInlinePolicyArgs( name="my_inline_policy", policy=json.dumps({ "Version": "2012-10-17", "Statement": [{ "Action": ["ec2:Describe*"], "Effect": "Allow", "Resource": "*", }], }), ), aws.iam.RoleInlinePolicyArgs( name="policy-8675309", policy=inline_policy.json, ), ]) ``` ### Example of Removing Inline Policies This example creates an IAM role with what appears to be empty IAM `inline_policy` argument instead of using `inline_policy` as a configuration block. The result is that if someone were to add an inline policy out-of-band, on the next apply, the provider will remove that policy. ```python import pulumi import pulumi_aws as aws example = aws.iam.Role("example", assume_role_policy=data["aws_iam_policy_document"]["instance_assume_role_policy"]["json"], inline_policies=[aws.iam.RoleInlinePolicyArgs()]) ``` ### Example of Exclusive Managed Policies This example creates an IAM role and attaches two managed IAM policies. If someone attaches another managed policy out-of-band, on the next apply, the provider will detach that policy. If someone detaches these policies out-of-band, the provider will attach them again. ```python import pulumi import json import pulumi_aws as aws policy_one = aws.iam.Policy("policyOne", policy=json.dumps({ "Version": "2012-10-17", "Statement": [{ "Action": ["ec2:Describe*"], "Effect": "Allow", "Resource": "*", }], })) policy_two = aws.iam.Policy("policyTwo", policy=json.dumps({ "Version": "2012-10-17", "Statement": [{ "Action": [ "s3:ListAllMyBuckets", "s3:ListBucket", "s3:HeadBucket", ], "Effect": "Allow", "Resource": "*", }], })) example = aws.iam.Role("example", assume_role_policy=data["aws_iam_policy_document"]["instance_assume_role_policy"]["json"], managed_policy_arns=[ policy_one.arn, policy_two.arn, ]) ``` ### Example of Removing Managed Policies This example creates an IAM role with an empty `managed_policy_arns` argument. If someone attaches a policy out-of-band, on the next apply, the provider will detach that policy. ```python import pulumi import pulumi_aws as aws example = aws.iam.Role("example", assume_role_policy=data["aws_iam_policy_document"]["instance_assume_role_policy"]["json"], managed_policy_arns=[]) ``` ## Import IAM Roles can be imported using the `name`, e.g. ```sh $ pulumi import aws:iam/role:Role developer developer_name ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] assume_role_policy: Policy that grants an entity permission to assume the role. :param pulumi.Input[str] description: Description of the role. :param pulumi.Input[bool] force_detach_policies: Whether to force detaching any policies the role has before destroying it. Defaults to `false`. :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['RoleInlinePolicyArgs']]]] inline_policies: Configuration block defining an exclusive set of IAM inline policies associated with the IAM role. Defined below. If no blocks are configured, the provider will ignore any managing any inline policies in this resource. Configuring one empty block (i.e., `inline_policy {}`) will cause the provider to remove _all_ inline policies. :param pulumi.Input[Sequence[pulumi.Input[str]]] managed_policy_arns: Set of exclusive IAM managed policy ARNs to attach to the IAM role. If this attribute is not configured, the provider will ignore policy attachments to this resource. When configured, the provider will align the role's managed policy attachments with this set by attaching or detaching managed policies. Configuring an empty set (i.e., `managed_policy_arns = []`) will cause the provider to remove _all_ managed policy attachments. :param pulumi.Input[int] max_session_duration: Maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours. :param pulumi.Input[str] name: Name of the role policy. :param pulumi.Input[str] name_prefix: Creates a unique friendly name beginning with the specified prefix. Conflicts with `name`. :param pulumi.Input[str] path: Path to the role. See [IAM Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) for more information. :param pulumi.Input[str] permissions_boundary: ARN of the policy that is used to set the permissions boundary for the role. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Key-value mapping of tags for the IAM role """ ... @overload def __init__(__self__, resource_name: str, args: RoleArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Provides an IAM role. > **NOTE:** If policies are attached to the role via the `iam.PolicyAttachment` resource and you are modifying the role `name` or `path`, the `force_detach_policies` argument must be set to `true` and applied before attempting the operation otherwise you will encounter a `DeleteConflict` error. The `iam.RolePolicyAttachment` resource does not have this requirement. > **NOTE:** If you use this resource's `managed_policy_arns` argument or `inline_policy` configuration blocks, this resource will take over exclusive management of the role's respective policy types (e.g., both policy types if both arguments are used). These arguments are incompatible with other ways of managing a role's policies, such as `iam.PolicyAttachment`, `iam.RolePolicyAttachment`, and `iam.RolePolicy`. If you attempt to manage a role's policies by multiple means, you will get resource cycling and/or errors. ## Example Usage ### Basic Example ```python import pulumi import json import pulumi_aws as aws test_role = aws.iam.Role("testRole", assume_role_policy=json.dumps({ "Version": "2012-10-17", "Statement": [{ "Action": "sts:AssumeRole", "Effect": "Allow", "Sid": "", "Principal": { "Service": "ec2.amazonaws.com", }, }], }), tags={ "tag-key": "tag-value", }) ``` ### Example of Using Data Source for Assume Role Policy ```python import pulumi import pulumi_aws as aws instance_assume_role_policy = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs( actions=["sts:AssumeRole"], principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs( type="Service", identifiers=["ec2.amazonaws.com"], )], )]) instance = aws.iam.Role("instance", path="/system/", assume_role_policy=instance_assume_role_policy.json) ``` ### Example of Exclusive Inline Policies This example creates an IAM role with two inline IAM policies. If someone adds another inline policy out-of-band, on the next apply, the provider will remove that policy. If someone deletes these policies out-of-band, the provider will recreate them. ```python import pulumi import json import pulumi_aws as aws inline_policy = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs( actions=["ec2:DescribeAccountAttributes"], resources=["*"], )]) example = aws.iam.Role("example", assume_role_policy=data["aws_iam_policy_document"]["instance_assume_role_policy"]["json"], inline_policies=[ aws.iam.RoleInlinePolicyArgs( name="my_inline_policy", policy=json.dumps({ "Version": "2012-10-17", "Statement": [{ "Action": ["ec2:Describe*"], "Effect": "Allow", "Resource": "*", }], }), ), aws.iam.RoleInlinePolicyArgs( name="policy-8675309", policy=inline_policy.json, ), ]) ``` ### Example of Removing Inline Policies This example creates an IAM role with what appears to be empty IAM `inline_policy` argument instead of using `inline_policy` as a configuration block. The result is that if someone were to add an inline policy out-of-band, on the next apply, the provider will remove that policy. ```python import pulumi import pulumi_aws as aws example = aws.iam.Role("example", assume_role_policy=data["aws_iam_policy_document"]["instance_assume_role_policy"]["json"], inline_policies=[aws.iam.RoleInlinePolicyArgs()]) ``` ### Example of Exclusive Managed Policies This example creates an IAM role and attaches two managed IAM policies. If someone attaches another managed policy out-of-band, on the next apply, the provider will detach that policy. If someone detaches these policies out-of-band, the provider will attach them again. ```python import pulumi import json import pulumi_aws as aws policy_one = aws.iam.Policy("policyOne", policy=json.dumps({ "Version": "2012-10-17", "Statement": [{ "Action": ["ec2:Describe*"], "Effect": "Allow", "Resource": "*", }], })) policy_two = aws.iam.Policy("policyTwo", policy=json.dumps({ "Version": "2012-10-17", "Statement": [{ "Action": [ "s3:ListAllMyBuckets", "s3:ListBucket", "s3:HeadBucket", ], "Effect": "Allow", "Resource": "*", }], })) example = aws.iam.Role("example", assume_role_policy=data["aws_iam_policy_document"]["instance_assume_role_policy"]["json"], managed_policy_arns=[ policy_one.arn, policy_two.arn, ]) ``` ### Example of Removing Managed Policies This example creates an IAM role with an empty `managed_policy_arns` argument. If someone attaches a policy out-of-band, on the next apply, the provider will detach that policy. ```python import pulumi import pulumi_aws as aws example = aws.iam.Role("example", assume_role_policy=data["aws_iam_policy_document"]["instance_assume_role_policy"]["json"], managed_policy_arns=[]) ``` ## Import IAM Roles can be imported using the `name`, e.g. ```sh $ pulumi import aws:iam/role:Role developer developer_name ``` :param str resource_name: The name of the resource. :param RoleArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(RoleArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, assume_role_policy: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, force_detach_policies: Optional[pulumi.Input[bool]] = None, inline_policies: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['RoleInlinePolicyArgs']]]]] = None, managed_policy_arns: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, max_session_duration: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, name_prefix: Optional[pulumi.Input[str]] = None, path: Optional[pulumi.Input[str]] = None, permissions_boundary: Optional[pulumi.Input[str]] = None, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, __props__=None, __name__=None, __opts__=None): if __name__ is not None: warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning) resource_name = __name__ if __opts__ is not None: warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning) opts = __opts__ if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() if assume_role_policy is None and not opts.urn: raise TypeError("Missing required property 'assume_role_policy'") __props__['assume_role_policy'] = assume_role_policy __props__['description'] = description __props__['force_detach_policies'] = force_detach_policies __props__['inline_policies'] = inline_policies __props__['managed_policy_arns'] = managed_policy_arns __props__['max_session_duration'] = max_session_duration __props__['name'] = name __props__['name_prefix'] = name_prefix __props__['path'] = path __props__['permissions_boundary'] = permissions_boundary __props__['tags'] = tags __props__['arn'] = None __props__['create_date'] = None __props__['unique_id'] = None super(Role, __self__).__init__( 'aws:iam/role:Role', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, arn: Optional[pulumi.Input[str]] = None, assume_role_policy: Optional[pulumi.Input[str]] = None, create_date: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, force_detach_policies: Optional[pulumi.Input[bool]] = None, inline_policies: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['RoleInlinePolicyArgs']]]]] = None, managed_policy_arns: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, max_session_duration: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, name_prefix: Optional[pulumi.Input[str]] = None, path: Optional[pulumi.Input[str]] = None, permissions_boundary: Optional[pulumi.Input[str]] = None, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, unique_id: Optional[pulumi.Input[str]] = None) -> 'Role': """ Get an existing Role resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] arn: Amazon Resource Name (ARN) specifying the role. :param pulumi.Input[str] assume_role_policy: Policy that grants an entity permission to assume the role. :param pulumi.Input[str] create_date: Creation date of the IAM role. :param pulumi.Input[str] description: Description of the role. :param pulumi.Input[bool] force_detach_policies: Whether to force detaching any policies the role has before destroying it. Defaults to `false`. :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['RoleInlinePolicyArgs']]]] inline_policies: Configuration block defining an exclusive set of IAM inline policies associated with the IAM role. Defined below. If no blocks are configured, the provider will ignore any managing any inline policies in this resource. Configuring one empty block (i.e., `inline_policy {}`) will cause the provider to remove _all_ inline policies. :param pulumi.Input[Sequence[pulumi.Input[str]]] managed_policy_arns: Set of exclusive IAM managed policy ARNs to attach to the IAM role. If this attribute is not configured, the provider will ignore policy attachments to this resource. When configured, the provider will align the role's managed policy attachments with this set by attaching or detaching managed policies. Configuring an empty set (i.e., `managed_policy_arns = []`) will cause the provider to remove _all_ managed policy attachments. :param pulumi.Input[int] max_session_duration: Maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours. :param pulumi.Input[str] name: Name of the role policy. :param pulumi.Input[str] name_prefix: Creates a unique friendly name beginning with the specified prefix. Conflicts with `name`. :param pulumi.Input[str] path: Path to the role. See [IAM Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) for more information. :param pulumi.Input[str] permissions_boundary: ARN of the policy that is used to set the permissions boundary for the role. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Key-value mapping of tags for the IAM role :param pulumi.Input[str] unique_id: Stable and unique string identifying the role. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = dict() __props__["arn"] = arn __props__["assume_role_policy"] = assume_role_policy __props__["create_date"] = create_date __props__["description"] = description __props__["force_detach_policies"] = force_detach_policies __props__["inline_policies"] = inline_policies __props__["managed_policy_arns"] = managed_policy_arns __props__["max_session_duration"] = max_session_duration __props__["name"] = name __props__["name_prefix"] = name_prefix __props__["path"] = path __props__["permissions_boundary"] = permissions_boundary __props__["tags"] = tags __props__["unique_id"] = unique_id return Role(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter def arn(self) -> pulumi.Output[str]: """ Amazon Resource Name (ARN) specifying the role. """ return pulumi.get(self, "arn") @property @pulumi.getter(name="assumeRolePolicy") def assume_role_policy(self) -> pulumi.Output[str]: """ Policy that grants an entity permission to assume the role. """ return pulumi.get(self, "assume_role_policy") @property @pulumi.getter(name="createDate") def create_date(self) -> pulumi.Output[str]: """ Creation date of the IAM role. """ return pulumi.get(self, "create_date") @property @pulumi.getter def description(self) -> pulumi.Output[Optional[str]]: """ Description of the role. """ return pulumi.get(self, "description") @property @pulumi.getter(name="forceDetachPolicies") def force_detach_policies(self) -> pulumi.Output[Optional[bool]]: """ Whether to force detaching any policies the role has before destroying it. Defaults to `false`. """ return pulumi.get(self, "force_detach_policies") @property @pulumi.getter(name="inlinePolicies") def inline_policies(self) -> pulumi.Output[Sequence['outputs.RoleInlinePolicy']]: """ Configuration block defining an exclusive set of IAM inline policies associated with the IAM role. Defined below. If no blocks are configured, the provider will ignore any managing any inline policies in this resource. Configuring one empty block (i.e., `inline_policy {}`) will cause the provider to remove _all_ inline policies. """ return pulumi.get(self, "inline_policies") @property @pulumi.getter(name="managedPolicyArns") def managed_policy_arns(self) -> pulumi.Output[Sequence[str]]: """ Set of exclusive IAM managed policy ARNs to attach to the IAM role. If this attribute is not configured, the provider will ignore policy attachments to this resource. When configured, the provider will align the role's managed policy attachments with this set by attaching or detaching managed policies. Configuring an empty set (i.e., `managed_policy_arns = []`) will cause the provider to remove _all_ managed policy attachments. """ return pulumi.get(self, "managed_policy_arns") @property @pulumi.getter(name="maxSessionDuration") def max_session_duration(self) -> pulumi.Output[Optional[int]]: """ Maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours. """ return pulumi.get(self, "max_session_duration") @property @pulumi.getter def name(self) -> pulumi.Output[str]: """ Name of the role policy. """ return pulumi.get(self, "name") @property @pulumi.getter(name="namePrefix") def name_prefix(self) -> pulumi.Output[Optional[str]]: """ Creates a unique friendly name beginning with the specified prefix. Conflicts with `name`. """ return pulumi.get(self, "name_prefix") @property @pulumi.getter def path(self) -> pulumi.Output[Optional[str]]: """ Path to the role. See [IAM Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) for more information. """ return pulumi.get(self, "path") @property @pulumi.getter(name="permissionsBoundary") def permissions_boundary(self) -> pulumi.Output[Optional[str]]: """ ARN of the policy that is used to set the permissions boundary for the role. """ return pulumi.get(self, "permissions_boundary") @property @pulumi.getter def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]: """ Key-value mapping of tags for the IAM role """ return pulumi.get(self, "tags") @property @pulumi.getter(name="uniqueId") def unique_id(self) -> pulumi.Output[str]: """ Stable and unique string identifying the role. """ return pulumi.get(self, "unique_id") def translate_output_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop def translate_input_property(self, prop): return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
50.260536
529
0.642781
4,692
39,354
5.225277
0.073529
0.06057
0.045683
0.032304
0.899865
0.867194
0.836358
0.806175
0.79088
0.769017
0
0.003782
0.261015
39,354
782
530
50.324808
0.839248
0.538827
0
0.435216
1
0
0.11053
0.009922
0
0
0
0
0
1
0.146179
false
0.003322
0.023256
0.006645
0.269103
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
d5ea8be802e3605d2cd459a3c1d97d9beaf3f02c
5,858
py
Python
networkx/classes/tests/test_filters.py
jmmcd/networkx
207ff7d1e9bfaff013ac77c8d6bb79619892c994
[ "BSD-3-Clause" ]
3
2020-08-04T20:29:41.000Z
2020-11-09T09:28:19.000Z
networkx/classes/tests/test_filters.py
jmmcd/networkx
207ff7d1e9bfaff013ac77c8d6bb79619892c994
[ "BSD-3-Clause" ]
30
2020-04-15T19:37:40.000Z
2020-04-22T21:19:35.000Z
networkx/classes/tests/test_filters.py
jmmcd/networkx
207ff7d1e9bfaff013ac77c8d6bb79619892c994
[ "BSD-3-Clause" ]
2
2020-02-13T10:33:34.000Z
2020-08-09T07:59:26.000Z
import pytest import networkx as nx class TestFilterFactory(object): def test_no_filter(self): nf = nx.filters.no_filter assert nf() assert nf(1) assert nf(2, 1) def test_hide_nodes(self): f = nx.classes.filters.hide_nodes([1, 2, 3]) assert not f(1) assert not f(2) assert not f(3) assert f(4) assert f(0) assert f('a') pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f) def test_show_nodes(self): f = nx.classes.filters.show_nodes([1, 2, 3]) assert f(1) assert f(2) assert f(3) assert not f(4) assert not f(0) assert not f('a') pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f) def test_hide_edges(self): factory = nx.classes.filters.hide_edges f = factory([(1, 2), (3, 4)]) assert not f(1, 2) assert not f(3, 4) assert not f(4, 3) assert f(2, 3) assert f(0, -1) assert f('a', 'b') pytest.raises(TypeError, f, 1, 2, 3) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2, 3)]) def test_show_edges(self): factory = nx.classes.filters.show_edges f = factory([(1, 2), (3, 4)]) assert f(1, 2) assert f(3, 4) assert f(4, 3) assert not f(2, 3) assert not f(0, -1) assert not f('a', 'b') pytest.raises(TypeError, f, 1, 2, 3) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2, 3)]) def test_hide_diedges(self): factory = nx.classes.filters.hide_diedges f = factory([(1, 2), (3, 4)]) assert not f(1, 2) assert not f(3, 4) assert f(4, 3) assert f(2, 3) assert f(0, -1) assert f('a', 'b') pytest.raises(TypeError, f, 1, 2, 3) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2, 3)]) def test_show_diedges(self): factory = nx.classes.filters.show_diedges f = factory([(1, 2), (3, 4)]) assert f(1, 2) assert f(3, 4) assert not f(4, 3) assert not f(2, 3) assert not f(0, -1) assert not f('a', 'b') pytest.raises(TypeError, f, 1, 2, 3) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2, 3)]) def test_hide_multiedges(self): factory = nx.classes.filters.hide_multiedges f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) assert not f(1, 2, 0) assert not f(1, 2, 1) assert f(1, 2, 2) assert f(3, 4, 0) assert not f(3, 4, 1) assert not f(4, 3, 1) assert f(4, 3, 0) assert f(2, 3, 0) assert f(0, -1, 0) assert f('a', 'b', 0) pytest.raises(TypeError, f, 1, 2, 3, 4) pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2)]) pytest.raises(ValueError, factory, [(1, 2, 3, 4)]) def test_show_multiedges(self): factory = nx.classes.filters.show_multiedges f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) assert f(1, 2, 0) assert f(1, 2, 1) assert not f(1, 2, 2) assert not f(3, 4, 0) assert f(3, 4, 1) assert f(4, 3, 1) assert not f(4, 3, 0) assert not f(2, 3, 0) assert not f(0, -1, 0) assert not f('a', 'b', 0) pytest.raises(TypeError, f, 1, 2, 3, 4) pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2)]) pytest.raises(ValueError, factory, [(1, 2, 3, 4)]) def test_hide_multidiedges(self): factory = nx.classes.filters.hide_multidiedges f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) assert not f(1, 2, 0) assert not f(1, 2, 1) assert f(1, 2, 2) assert f(3, 4, 0) assert not f(3, 4, 1) assert f(4, 3, 1) assert f(4, 3, 0) assert f(2, 3, 0) assert f(0, -1, 0) assert f('a', 'b', 0) pytest.raises(TypeError, f, 1, 2, 3, 4) pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2)]) pytest.raises(ValueError, factory, [(1, 2, 3, 4)]) def test_show_multidiedges(self): factory = nx.classes.filters.show_multidiedges f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) assert f(1, 2, 0) assert f(1, 2, 1) assert not f(1, 2, 2) assert not f(3, 4, 0) assert f(3, 4, 1) assert not f(4, 3, 1) assert not f(4, 3, 0) assert not f(2, 3, 0) assert not f(0, -1, 0) assert not f('a', 'b', 0) pytest.raises(TypeError, f, 1, 2, 3, 4) pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2)]) pytest.raises(ValueError, factory, [(1, 2, 3, 4)])
33.096045
58
0.520997
898
5,858
3.361915
0.041203
0.042398
0.278238
0.23319
0.925141
0.907254
0.785359
0.785359
0.77741
0.775422
0
0.083713
0.325026
5,858
176
59
33.284091
0.679818
0
0
0.756098
0
0
0.003073
0
0
0
0
0
0.481707
1
0.067073
false
0
0.012195
0
0.085366
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
10
914ac940c9448829e53d82b96febfa6ab64e7f67
29,728
py
Python
pkg/vtreat/vtreat_api.py
sdrees/pyvtreat
fed9a653b2524ba04b1e92b1087e58bead25f99a
[ "BSD-3-Clause" ]
null
null
null
pkg/vtreat/vtreat_api.py
sdrees/pyvtreat
fed9a653b2524ba04b1e92b1087e58bead25f99a
[ "BSD-3-Clause" ]
null
null
null
pkg/vtreat/vtreat_api.py
sdrees/pyvtreat
fed9a653b2524ba04b1e92b1087e58bead25f99a
[ "BSD-3-Clause" ]
null
null
null
""" Define user visible vtreat API. """ import warnings from typing import Any, Dict, Iterable, Optional import pandas import numpy import vtreat.vtreat_impl as vtreat_impl import vtreat.util import vtreat.cross_plan def vtreat_parameters(user_params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]: """ build a vtreat parameters dictionary, adding in user choices :param user_params: dictionary of user choices :return: dictionary of user and default choices """ params = { "use_hierarchical_estimate": True, "coders": { "clean_copy", "missing_indicator", "indicator_code", "impact_code", "deviation_code", "logit_code", "prevalence_code", }, "filter_to_recommended": True, "indicator_min_fraction": 0.02, "cross_validation_plan": vtreat.cross_plan.KWayCrossPlanYStratified(), "cross_validation_k": 5, "user_transforms": [], "sparse_indicators": False, "missingness_imputation": numpy.mean, "check_for_duplicate_frames": True, "error_on_duplicate_frames": False, "retain_cross_plan": True, "tunable_params": ["indicator_min_fraction"], } pkeys = set(params.keys()) if user_params is not None: for k in user_params.keys(): if k not in pkeys: raise KeyError("parameter key " + str(k) + " not recognized") params[k] = user_params[k] if params["error_on_duplicate_frames"]: params["check_for_duplicate_frames"] = True for k in params["tunable_params"]: if k not in pkeys: raise KeyError("tunable_params key " + str(k) + " not recognized") return params def unsupervised_parameters( user_params: Optional[Dict[str, Any]] = None ) -> Dict[str, Any]: """ build a vtreat parameters dictionary for unsupervised tasks, adding in user choices :param user_params: dictionary of user choices :return: dictionary of user and default choices """ params = { "coders": { "clean_copy", "missing_indicator", "indicator_code", "prevalence_code", }, "indicator_min_fraction": 0.0, "indicator_max_levels": 1000, "user_transforms": [], "sparse_indicators": False, "missingness_imputation": numpy.mean, "tunable_params": ["indicator_min_fraction", "indicator_max_levels"], } pkeys = set(params.keys()) if user_params is not None: for k in user_params.keys(): if k not in pkeys: raise KeyError("parameter key " + str(k) + " not recognized") params[k] = user_params[k] for k in params["tunable_params"]: if k not in pkeys: raise KeyError("tunable_params key " + str(k) + " not recognized") return params class NumericOutcomeTreatment(vtreat_impl.VariableTreatment): """manage a treatment plan for a numeric outcome (regression)""" def __init__( self, *, var_list: Optional[Iterable[str]] = None, outcome_name: Optional[str] = None, cols_to_copy: Optional[Iterable[str]] = None, params: Optional[Dict[str, Any]] = None, imputation_map: Optional[Dict[str, Any]] = None, ): """ :param var_list: list or tuple of column names, if empty all non outcome and copy columns are used :param outcome_name: name of column containing dependent variable :param cols_to_copy: list or tuple of column names :param params: vtreat.vtreat_parameters() :param imputation_map: map of column names to custom missing imputation values or functions """ params = self.merge_params(params) vtreat_impl.VariableTreatment.__init__( self, var_list=var_list, outcome_name=outcome_name, cols_to_copy=cols_to_copy, params=params, imputation_map=imputation_map, ) def merge_params(self, p: Optional[Dict[str, Any]]) -> Dict[str, Any]: """ Merge user parameters, returns new parameters does not alter object. :param p: :return: merged parameters """ return vtreat_parameters(p) # noinspection PyPep8Naming def transform(self, X): """ Apply transform to data. :param X: data :return: transformed data """ X, orig_type = vtreat_impl.ready_data_frame(X) self.check_column_names(X.columns) if self.last_fit_x_id_ is None: raise ValueError("called transform on not yet fit treatment") if self.params_["check_for_duplicate_frames"] and ( self.last_fit_x_id_ == vtreat.util.hash_data_frame(X) ): if self.params_["error_on_duplicate_frames"]: raise ValueError( "possibly called transform on same data used to fit\n" + "(this causes over-fit, please use fit_transform() instead)" ) warnings.warn( "possibly called transform on same data used to fit\n" + "(this causes over-fit, please use fit_transform() instead)" ) res = vtreat_impl.pre_prep_frame( X, col_list=self.plan_.num_list + self.plan_.cat_list, cols_to_copy=self.cols_to_copy_, cat_cols=self.plan_.cat_list, ) res = vtreat_impl.perform_transform(x=res, transform=self, params=self.params_) res = vtreat_impl.limit_to_appropriate_columns(res=res, transform=self) res, res_columns = vtreat_impl.back_to_orig_type_data_frame(res, orig_type) self.last_result_columns = res_columns return res # noinspection PyPep8Naming def fit_transform(self, X, y=None, **fit_params): """ fit_transform data, this is the way to fit with cross methods. :param X: explanatory values :param y: dependent values :param fit_params: :return: transformed data """ X, orig_type = vtreat_impl.ready_data_frame(X) self.check_column_names(X.columns) if y is None: if self.outcome_name_ is None: raise ValueError(".fit_transform(X) must have outcome_name set") y = numpy.asarray(X[self.outcome_name_]) else: y = numpy.asarray(y) if (self.outcome_name_ is not None) and (self.outcome_name_ in X.columns): if not numpy.all(X[self.outcome_name_] == y): raise ValueError( ".fit_transform(X, y) called with y != X[outcome_name]" ) if not X.shape[0] == len(y): raise ValueError("X.shape[0] should equal len(y)") y = vtreat.util.safe_to_numeric_array(y) if vtreat.util.is_bad(y).sum() > 0: raise ValueError("y should not have any missing/NA/NaN values") if numpy.max(y) <= numpy.min(y): raise ValueError("y does not vary") cross_rows = None cross_plan = None if self.params_["retain_cross_plan"]: cross_rows = self.cross_rows_ cross_plan = self.cross_plan_ self.clear() self.last_fit_x_id_ = vtreat.util.hash_data_frame(X) X = vtreat_impl.pre_prep_frame( X, col_list=self.var_list_, cols_to_copy=self.cols_to_copy_ ) if isinstance(y, pandas.Series): y = y.reset_index(inplace=False, drop=True) # model for independent transforms self.plan_ = None self.score_frame_ = None self.plan_ = vtreat_impl.fit_numeric_outcome_treatment( X=X, y=y, var_list=self.var_list_, outcome_name=self.outcome_name_, cols_to_copy=self.cols_to_copy_, params=self.params_, imputation_map=self.imputation_map_, ) cross_frame = vtreat_impl.perform_transform( x=X, transform=self, params=self.params_ ) if (cross_plan is None) or (cross_rows != X.shape[0]): if cross_plan is not None: warnings.warn( "Number of rows different than previous fit with retain_cross_plan==True" ) cross_plan = self.params_["cross_validation_plan"].split_plan( n_rows=X.shape[0], k_folds=self.params_["cross_validation_k"], data=X, y=y, ) cross_rows = X.shape[0] # patch in cross-frame versions of complex columns such as impact vtreat_impl.cross_patch_refit_y_aware_cols( x=X, y=y, res=cross_frame, plan=self.plan_, cross_plan=cross_plan ) vtreat_impl.cross_patch_user_y_aware_cols( x=cross_frame, y=y, res=cross_frame, params=self.params_, cross_plan=cross_plan, ) # use cross_frame to compute variable effects self.score_frame_ = vtreat_impl.score_plan_variables( cross_frame=cross_frame, outcome=y, plan=self.plan_, params=self.params_, is_classification=False, ) if ("filter_to_recommended" in self.params_.keys()) and self.params_[ "filter_to_recommended" ]: self.set_result_restriction( set( [ ci for ci in self.score_frame_["variable"][ self.score_frame_["recommended"] ] ] ) ) cross_frame = vtreat_impl.limit_to_appropriate_columns( res=cross_frame, transform=self ) cross_frame, res_columns = vtreat_impl.back_to_orig_type_data_frame( cross_frame, orig_type ) self.last_result_columns = res_columns if self.params_["retain_cross_plan"]: self.cross_plan_ = cross_plan self.cross_rows_ = cross_rows else: self.cross_plan_ = None self.cross_rows_ = None return cross_frame class BinomialOutcomeTreatment(vtreat_impl.VariableTreatment): """manage a treatment plan for a target outcome (binomial classification)""" def __init__( self, *, var_list: Optional[Iterable[str]] = None, outcome_name: Optional[str] = None, outcome_target=None, cols_to_copy: Optional[Iterable[str]] = None, params: Optional[Dict[str, Any]] = None, imputation_map: Optional[Dict[str, Any]] = None, ): """ :param var_list: list or tuple of column names, if empty all non outcome and copy columns are used :param outcome_name: name of column containing dependent variable :param outcome_target: value of outcome to consider "positive" :param cols_to_copy: list or tuple of column names :param params: vtreat.vtreat_parameters() :param imputation_map: map of column names to custom missing imputation values or functions """ params = self.merge_params(params) vtreat_impl.VariableTreatment.__init__( self, var_list=var_list, outcome_name=outcome_name, outcome_target=outcome_target, cols_to_copy=cols_to_copy, params=params, imputation_map=imputation_map, ) def merge_params(self, p: Optional[Dict[str, Any]]) -> Dict[str, Any]: """ Merge user parameters, returns new parameters does not alter object. :param p: :return: merged parameters """ return vtreat_parameters(p) # noinspection PyPep8Naming def transform(self, X): """ Apply transform to data. :param X: data :return: transformed data """ X, orig_type = vtreat_impl.ready_data_frame(X) self.check_column_names(X.columns) if self.last_fit_x_id_ is None: raise ValueError("called transform on not yet fit treatment") if self.params_["check_for_duplicate_frames"] and ( self.last_fit_x_id_ == vtreat.util.hash_data_frame(X) ): if self.params_["error_on_duplicate_frames"]: raise ValueError( "possibly called transform on same data used to fit\n" + "(this causes over-fit, please use fit_transform() instead)" ) warnings.warn( "possibly called transform on same data used to fit\n" + "(this causes over-fit, please use fit_transform() instead)" ) X = vtreat_impl.pre_prep_frame( X, col_list=self.plan_.num_list + self.plan_.cat_list, cols_to_copy=self.cols_to_copy_, cat_cols=self.plan_.cat_list, ) res = vtreat_impl.perform_transform(x=X, transform=self, params=self.params_) res = vtreat_impl.limit_to_appropriate_columns(res=res, transform=self) res, res_columns = vtreat_impl.back_to_orig_type_data_frame(res, orig_type) self.last_result_columns = res_columns return res # noinspection PyPep8Naming def fit_transform(self, X, y=None, **fit_params): """ fit_transform data, this is the way to fit with cross methods. :param X: explanatory values :param y: dependent values :param fit_params: :return: transformed data """ X, orig_type = vtreat_impl.ready_data_frame(X) self.check_column_names(X.columns) if y is None: if self.outcome_name_ is None: raise ValueError(".fit_transform(X) must have outcome_name set") y = numpy.asarray(X[self.outcome_name_]) else: y = numpy.asarray(y) if (self.outcome_name_ is not None) and (self.outcome_name_ in X.columns): if not numpy.all(X[self.outcome_name_] == y): raise ValueError( ".fit_transform(X, y) called with y != X[outcome_name]" ) if not X.shape[0] == len(y): raise ValueError("X.shape[0] should equal len(y)") y_mean = numpy.mean(y == self.outcome_target_) if y_mean <= 0 or y_mean >= 1: raise ValueError("y==outcome_target does not vary") cross_rows = None cross_plan = None if self.params_["retain_cross_plan"]: cross_rows = self.cross_rows_ cross_plan = self.cross_plan_ self.clear() self.last_fit_x_id_ = vtreat.util.hash_data_frame(X) X = vtreat_impl.pre_prep_frame( X, col_list=self.var_list_, cols_to_copy=self.cols_to_copy_ ) if isinstance(y, pandas.Series): y = y.reset_index(inplace=False, drop=True) # model for independent transforms self.plan_ = None self.score_frame_ = None self.plan_ = vtreat_impl.fit_binomial_outcome_treatment( X=X, y=y, outcome_target=self.outcome_target_, var_list=self.var_list_, outcome_name=self.outcome_name_, cols_to_copy=self.cols_to_copy_, params=self.params_, imputation_map=self.imputation_map_, ) cross_frame = vtreat_impl.perform_transform( x=X, transform=self, params=self.params_ ) if (cross_plan is None) or (cross_rows != X.shape[0]): if cross_plan is not None: warnings.warn( "Number of rows different than previous fit with retain_cross_plan==True" ) cross_plan = self.params_["cross_validation_plan"].split_plan( n_rows=X.shape[0], k_folds=self.params_["cross_validation_k"], data=X, y=y, ) cross_rows = X.shape[0] # patch in cross-frame versions of complex columns such as impact vtreat_impl.cross_patch_refit_y_aware_cols( x=X, y=y, res=cross_frame, plan=self.plan_, cross_plan=cross_plan ) vtreat_impl.cross_patch_user_y_aware_cols( x=cross_frame, y=y, res=cross_frame, params=self.params_, cross_plan=cross_plan, ) # use cross_frame to compute variable effects self.score_frame_ = vtreat_impl.score_plan_variables( cross_frame=cross_frame, outcome=numpy.asarray( numpy.asarray(y) == self.outcome_target_, dtype=float ), plan=self.plan_, params=self.params_, is_classification=True, ) if ("filter_to_recommended" in self.params_.keys()) and self.params_[ "filter_to_recommended" ]: self.set_result_restriction( set( [ ci for ci in self.score_frame_["variable"][ self.score_frame_["recommended"] ] ] ) ) cross_frame = vtreat_impl.limit_to_appropriate_columns( res=cross_frame, transform=self ) cross_frame, res_columns = vtreat_impl.back_to_orig_type_data_frame( cross_frame, orig_type ) self.last_result_columns = res_columns if self.params_["retain_cross_plan"]: self.cross_plan_ = cross_plan self.cross_rows_ = cross_rows else: self.cross_plan_ = None self.cross_rows_ = None return cross_frame class MultinomialOutcomeTreatment(vtreat_impl.VariableTreatment): """manage a treatment plan for a set of outcomes (multinomial classification)""" def __init__( self, *, var_list: Optional[Iterable[str]] = None, outcome_name: Optional[str] = None, cols_to_copy: Optional[Iterable[str]] = None, params: Optional[Dict[str, Any]] = None, imputation_map: Optional[Dict[str, Any]] = None, ): """ :param var_list: list or tuple of column names, if empty all non outcome and copy columns are used :param outcome_name: name of column containing dependent variable :param cols_to_copy: list or tuple of column names :param params: vtreat.vtreat_parameters() :param imputation_map: map of column names to custom missing imputation values or functions """ params = self.merge_params(params) vtreat_impl.VariableTreatment.__init__( self, var_list=var_list, outcome_name=outcome_name, cols_to_copy=cols_to_copy, params=params, imputation_map=imputation_map, ) self.outcomes_ = None def merge_params(self, p: Optional[Dict[str, Any]]) -> Dict[str, Any]: """ Merge user parameters, returns new parameters does not alter object. :param p: :return: merged parameters """ return vtreat_parameters(p) # noinspection PyPep8Naming def transform(self, X): """ Apply transform to data. :param X: data :return: transformed data """ X, orig_type = vtreat_impl.ready_data_frame(X) self.check_column_names(X.columns) if self.last_fit_x_id_ is None: raise ValueError("called transform on not yet fit treatment") if self.params_["check_for_duplicate_frames"] and ( self.last_fit_x_id_ == vtreat.util.hash_data_frame(X) ): if self.params_["error_on_duplicate_frames"]: raise ValueError( "possibly called transform on same data used to fit\n" + "(this causes over-fit, please use fit_transform() instead)" ) warnings.warn( "possibly called transform on same data used to fit\n" + "(this causes over-fit, please use fit_transform() instead)" ) X = vtreat_impl.pre_prep_frame( X, col_list=self.plan_.num_list + self.plan_.cat_list, cols_to_copy=self.cols_to_copy_, cat_cols=self.plan_.cat_list, ) res = vtreat_impl.perform_transform(x=X, transform=self, params=self.params_) res = vtreat_impl.limit_to_appropriate_columns(res=res, transform=self) res, res_columns = vtreat_impl.back_to_orig_type_data_frame(res, orig_type) self.last_result_columns = res_columns return res # noinspection PyPep8Naming def fit_transform(self, X, y=None, **fit_params): """ fit_transform data, this is the way to fit with cross methods. :param X: explanatory values :param y: dependent values :param fit_params: :return: transformed data """ X, orig_type = vtreat_impl.ready_data_frame(X) self.check_column_names(X.columns) if y is None: if self.outcome_name_ is None: raise ValueError(".fit_transform(X) must have outcome_name set") y = numpy.asarray(X[self.outcome_name_]) else: y = numpy.asarray(y) if (self.outcome_name_ is not None) and (self.outcome_name_ in X.columns): if not numpy.all(X[self.outcome_name_] == y): raise ValueError( ".fit_transform(X, y) called with y != X[outcome_name]" ) if not X.shape[0] == len(y): raise ValueError("X.shape[0] should equal len(y)") if len(numpy.unique(y)) <= 1: raise ValueError("y must take on at least 2 values") cross_rows = None cross_plan = None if self.params_["retain_cross_plan"]: cross_rows = self.cross_rows_ cross_plan = self.cross_plan_ self.clear() self.last_fit_x_id_ = vtreat.util.hash_data_frame(X) X = vtreat_impl.pre_prep_frame( X, col_list=self.var_list_, cols_to_copy=self.cols_to_copy_ ) if isinstance(y, pandas.Series): y = y.reset_index(inplace=False, drop=True) # model for independent transforms self.plan_ = None self.score_frame_ = None self.outcomes_ = numpy.unique(y) self.plan_ = vtreat_impl.fit_multinomial_outcome_treatment( X=X, y=y, var_list=self.var_list_, outcome_name=self.outcome_name_, cols_to_copy=self.cols_to_copy_, params=self.params_, imputation_map=self.imputation_map_, ) cross_frame = vtreat_impl.perform_transform( x=X, transform=self, params=self.params_ ) if (cross_plan is None) or (cross_rows != X.shape[0]): if cross_plan is not None: warnings.warn( "Number of rows different than previous fit with retain_cross_plan==True" ) cross_plan = self.params_["cross_validation_plan"].split_plan( n_rows=X.shape[0], k_folds=self.params_["cross_validation_k"], data=X, y=y, ) cross_rows = X.shape[0] vtreat_impl.cross_patch_refit_y_aware_cols( x=X, y=y, res=cross_frame, plan=self.plan_, cross_plan=cross_plan ) vtreat_impl.cross_patch_user_y_aware_cols( x=cross_frame, y=y, res=cross_frame, params=self.params_, cross_plan=cross_plan, ) # use cross_frame to compute variable effects def si(oi): """score i-th outcome group""" sf = vtreat_impl.score_plan_variables( cross_frame=cross_frame, outcome=numpy.asarray(numpy.asarray(y) == oi, dtype=float), plan=self.plan_, params=self.params_, is_classification=True, ) sf["outcome_target"] = oi return sf score_frames = [si(oi) for oi in self.outcomes_] self.score_frame_ = pandas.concat(score_frames, axis=0) self.score_frame_.reset_index(inplace=True, drop=True) if ("filter_to_recommended" in self.params_.keys()) and self.params_[ "filter_to_recommended" ]: self.set_result_restriction( set( [ ci for ci in self.score_frame_["variable"][ self.score_frame_["recommended"] ] ] ) ) cross_frame = vtreat_impl.limit_to_appropriate_columns( res=cross_frame, transform=self ) cross_frame, res_columns = vtreat_impl.back_to_orig_type_data_frame( cross_frame, orig_type ) self.last_result_columns = res_columns if self.params_["retain_cross_plan"]: self.cross_plan_ = cross_plan self.cross_rows_ = cross_rows else: self.cross_plan_ = None self.cross_rows_ = None return cross_frame class UnsupervisedTreatment(vtreat_impl.VariableTreatment): """manage an unsupervised treatment plan""" def __init__( self, *, var_list: Optional[Iterable[str]] = None, cols_to_copy: Optional[Iterable[str]] = None, params: Optional[Dict[str, Any]] = None, imputation_map: Optional[Dict[str, Any]] = None, ): """ :param var_list: list or tuple of column names, if empty all non copy columns are used :param cols_to_copy: list or tuple of column names :param params: vtreat.unsupervised_parameters() :param imputation_map: map of column names to custom missing imputation values or functions """ params = self.merge_params(params) vtreat_impl.VariableTreatment.__init__( self, var_list=var_list, outcome_name=None, cols_to_copy=cols_to_copy, params=params, imputation_map=imputation_map, ) def merge_params(self, p: Optional[Dict[str, Any]]) -> Dict[str, Any]: """ Merge user parameters, returns new parameters does not alter object. :param p: :return: merged parameters """ return unsupervised_parameters(p) # noinspection PyPep8Naming def transform(self, X): """ Apply transform to data. :param X: data :return: transformed data """ X, orig_type = vtreat_impl.ready_data_frame(X) self.check_column_names(X.columns) if self.last_fit_x_id_ is None: raise ValueError("called transform on not yet fit treatment") X = vtreat_impl.pre_prep_frame( X, col_list=self.plan_.num_list + self.plan_.cat_list, cols_to_copy=self.cols_to_copy_, cat_cols=self.plan_.cat_list, ) res = vtreat_impl.perform_transform(x=X, transform=self, params=self.params_) res = vtreat_impl.limit_to_appropriate_columns(res=res, transform=self) res, res_columns = vtreat_impl.back_to_orig_type_data_frame(res, orig_type) self.last_result_columns = res_columns return res # noinspection PyPep8Naming def fit_transform(self, X, y=None, **fit_params): """ fit_transform data. :param X: explanatory values :param y: dependent values :param fit_params: :return: transformed data """ X, orig_type = vtreat_impl.ready_data_frame(X) self.check_column_names(X.columns) assert y is None self.clear() self.last_fit_x_id_ = vtreat.util.hash_data_frame(X) X = vtreat_impl.pre_prep_frame( X, col_list=self.var_list_, cols_to_copy=self.cols_to_copy_ ) self.plan_ = vtreat_impl.fit_unsupervised_treatment( X=X, var_list=self.var_list_, outcome_name=self.outcome_name_, cols_to_copy=self.cols_to_copy_, params=self.params_, imputation_map=self.imputation_map_, ) res = vtreat_impl.perform_transform(x=X, transform=self, params=self.params_) self.score_frame_ = vtreat_impl.pseudo_score_plan_variables( cross_frame=res, plan=self.plan_, params=self.params_ ) if ("filter_to_recommended" in self.params_.keys()) and self.params_[ "filter_to_recommended" ]: self.set_result_restriction( set( [ ci for ci in self.score_frame_["variable"][ self.score_frame_["recommended"] ] ] ) ) res = vtreat_impl.limit_to_appropriate_columns(res=res, transform=self) res, res_columns = vtreat_impl.back_to_orig_type_data_frame(res, orig_type) self.last_result_columns = res_columns return res
36.929193
107
0.587964
3,549
29,728
4.62581
0.069879
0.038984
0.024365
0.01535
0.909606
0.893403
0.890479
0.885119
0.882439
0.86313
0
0.001948
0.326695
29,728
804
108
36.975124
0.818245
0.131459
0
0.761513
0
0
0.118218
0.030216
0
0
0
0
0.001645
1
0.03125
false
0
0.011513
0
0.074013
0
0
0
0
null
0
0
0
1
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
7
e69bac0d95a484cc682cc3b983cb1fd709bc597a
23
py
Python
ch5/5_4.py
hajin-kim/2020-HighSchool-Python-Tutoring
352025a954bff37d21cc3d59e7d5e0f0269a1f17
[ "MIT" ]
null
null
null
ch5/5_4.py
hajin-kim/2020-HighSchool-Python-Tutoring
352025a954bff37d21cc3d59e7d5e0f0269a1f17
[ "MIT" ]
null
null
null
ch5/5_4.py
hajin-kim/2020-HighSchool-Python-Tutoring
352025a954bff37d21cc3d59e7d5e0f0269a1f17
[ "MIT" ]
null
null
null
print(3 - 2 + 5 * 4)
5.75
20
0.391304
5
23
1.8
1
0
0
0
0
0
0
0
0
0
0
0.285714
0.391304
23
3
21
7.666667
0.357143
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
1
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
1
0
0
0
0
1
0
8
e6ad0019aa0debbceb0e97299bec21455f4fe791
37,465
py
Python
sdk/python/pulumi_aws/ec2/fleet.py
chivandikwa/pulumi-aws
19c08bf9dcb90544450ffa4eec7bf6751058fde2
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/ec2/fleet.py
chivandikwa/pulumi-aws
19c08bf9dcb90544450ffa4eec7bf6751058fde2
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/ec2/fleet.py
chivandikwa/pulumi-aws
19c08bf9dcb90544450ffa4eec7bf6751058fde2
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . import outputs from ._inputs import * __all__ = ['FleetArgs', 'Fleet'] @pulumi.input_type class FleetArgs: def __init__(__self__, *, launch_template_config: pulumi.Input['FleetLaunchTemplateConfigArgs'], target_capacity_specification: pulumi.Input['FleetTargetCapacitySpecificationArgs'], excess_capacity_termination_policy: Optional[pulumi.Input[str]] = None, on_demand_options: Optional[pulumi.Input['FleetOnDemandOptionsArgs']] = None, replace_unhealthy_instances: Optional[pulumi.Input[bool]] = None, spot_options: Optional[pulumi.Input['FleetSpotOptionsArgs']] = None, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, terminate_instances: Optional[pulumi.Input[bool]] = None, terminate_instances_with_expiration: Optional[pulumi.Input[bool]] = None, type: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a Fleet resource. :param pulumi.Input['FleetLaunchTemplateConfigArgs'] launch_template_config: Nested argument containing EC2 Launch Template configurations. Defined below. :param pulumi.Input['FleetTargetCapacitySpecificationArgs'] target_capacity_specification: Nested argument containing target capacity configurations. Defined below. :param pulumi.Input[str] excess_capacity_termination_policy: Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. :param pulumi.Input['FleetOnDemandOptionsArgs'] on_demand_options: Nested argument containing On-Demand configurations. Defined below. :param pulumi.Input[bool] replace_unhealthy_instances: Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. :param pulumi.Input['FleetSpotOptionsArgs'] spot_options: Nested argument containing Spot configurations. Defined below. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. :param pulumi.Input[bool] terminate_instances: Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`. :param pulumi.Input[bool] terminate_instances_with_expiration: Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`. :param pulumi.Input[str] type: The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`. Defaults to `maintain`. """ pulumi.set(__self__, "launch_template_config", launch_template_config) pulumi.set(__self__, "target_capacity_specification", target_capacity_specification) if excess_capacity_termination_policy is not None: pulumi.set(__self__, "excess_capacity_termination_policy", excess_capacity_termination_policy) if on_demand_options is not None: pulumi.set(__self__, "on_demand_options", on_demand_options) if replace_unhealthy_instances is not None: pulumi.set(__self__, "replace_unhealthy_instances", replace_unhealthy_instances) if spot_options is not None: pulumi.set(__self__, "spot_options", spot_options) if tags is not None: pulumi.set(__self__, "tags", tags) if terminate_instances is not None: pulumi.set(__self__, "terminate_instances", terminate_instances) if terminate_instances_with_expiration is not None: pulumi.set(__self__, "terminate_instances_with_expiration", terminate_instances_with_expiration) if type is not None: pulumi.set(__self__, "type", type) @property @pulumi.getter(name="launchTemplateConfig") def launch_template_config(self) -> pulumi.Input['FleetLaunchTemplateConfigArgs']: """ Nested argument containing EC2 Launch Template configurations. Defined below. """ return pulumi.get(self, "launch_template_config") @launch_template_config.setter def launch_template_config(self, value: pulumi.Input['FleetLaunchTemplateConfigArgs']): pulumi.set(self, "launch_template_config", value) @property @pulumi.getter(name="targetCapacitySpecification") def target_capacity_specification(self) -> pulumi.Input['FleetTargetCapacitySpecificationArgs']: """ Nested argument containing target capacity configurations. Defined below. """ return pulumi.get(self, "target_capacity_specification") @target_capacity_specification.setter def target_capacity_specification(self, value: pulumi.Input['FleetTargetCapacitySpecificationArgs']): pulumi.set(self, "target_capacity_specification", value) @property @pulumi.getter(name="excessCapacityTerminationPolicy") def excess_capacity_termination_policy(self) -> Optional[pulumi.Input[str]]: """ Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. """ return pulumi.get(self, "excess_capacity_termination_policy") @excess_capacity_termination_policy.setter def excess_capacity_termination_policy(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "excess_capacity_termination_policy", value) @property @pulumi.getter(name="onDemandOptions") def on_demand_options(self) -> Optional[pulumi.Input['FleetOnDemandOptionsArgs']]: """ Nested argument containing On-Demand configurations. Defined below. """ return pulumi.get(self, "on_demand_options") @on_demand_options.setter def on_demand_options(self, value: Optional[pulumi.Input['FleetOnDemandOptionsArgs']]): pulumi.set(self, "on_demand_options", value) @property @pulumi.getter(name="replaceUnhealthyInstances") def replace_unhealthy_instances(self) -> Optional[pulumi.Input[bool]]: """ Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. """ return pulumi.get(self, "replace_unhealthy_instances") @replace_unhealthy_instances.setter def replace_unhealthy_instances(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "replace_unhealthy_instances", value) @property @pulumi.getter(name="spotOptions") def spot_options(self) -> Optional[pulumi.Input['FleetSpotOptionsArgs']]: """ Nested argument containing Spot configurations. Defined below. """ return pulumi.get(self, "spot_options") @spot_options.setter def spot_options(self, value: Optional[pulumi.Input['FleetSpotOptionsArgs']]): pulumi.set(self, "spot_options", value) @property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: """ Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. """ return pulumi.get(self, "tags") @tags.setter def tags(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]): pulumi.set(self, "tags", value) @property @pulumi.getter(name="terminateInstances") def terminate_instances(self) -> Optional[pulumi.Input[bool]]: """ Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`. """ return pulumi.get(self, "terminate_instances") @terminate_instances.setter def terminate_instances(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "terminate_instances", value) @property @pulumi.getter(name="terminateInstancesWithExpiration") def terminate_instances_with_expiration(self) -> Optional[pulumi.Input[bool]]: """ Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`. """ return pulumi.get(self, "terminate_instances_with_expiration") @terminate_instances_with_expiration.setter def terminate_instances_with_expiration(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "terminate_instances_with_expiration", value) @property @pulumi.getter def type(self) -> Optional[pulumi.Input[str]]: """ The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`. Defaults to `maintain`. """ return pulumi.get(self, "type") @type.setter def type(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "type", value) @pulumi.input_type class _FleetState: def __init__(__self__, *, excess_capacity_termination_policy: Optional[pulumi.Input[str]] = None, launch_template_config: Optional[pulumi.Input['FleetLaunchTemplateConfigArgs']] = None, on_demand_options: Optional[pulumi.Input['FleetOnDemandOptionsArgs']] = None, replace_unhealthy_instances: Optional[pulumi.Input[bool]] = None, spot_options: Optional[pulumi.Input['FleetSpotOptionsArgs']] = None, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, tags_all: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, target_capacity_specification: Optional[pulumi.Input['FleetTargetCapacitySpecificationArgs']] = None, terminate_instances: Optional[pulumi.Input[bool]] = None, terminate_instances_with_expiration: Optional[pulumi.Input[bool]] = None, type: Optional[pulumi.Input[str]] = None): """ Input properties used for looking up and filtering Fleet resources. :param pulumi.Input[str] excess_capacity_termination_policy: Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. :param pulumi.Input['FleetLaunchTemplateConfigArgs'] launch_template_config: Nested argument containing EC2 Launch Template configurations. Defined below. :param pulumi.Input['FleetOnDemandOptionsArgs'] on_demand_options: Nested argument containing On-Demand configurations. Defined below. :param pulumi.Input[bool] replace_unhealthy_instances: Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. :param pulumi.Input['FleetSpotOptionsArgs'] spot_options: Nested argument containing Spot configurations. Defined below. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. :param pulumi.Input['FleetTargetCapacitySpecificationArgs'] target_capacity_specification: Nested argument containing target capacity configurations. Defined below. :param pulumi.Input[bool] terminate_instances: Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`. :param pulumi.Input[bool] terminate_instances_with_expiration: Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`. :param pulumi.Input[str] type: The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`. Defaults to `maintain`. """ if excess_capacity_termination_policy is not None: pulumi.set(__self__, "excess_capacity_termination_policy", excess_capacity_termination_policy) if launch_template_config is not None: pulumi.set(__self__, "launch_template_config", launch_template_config) if on_demand_options is not None: pulumi.set(__self__, "on_demand_options", on_demand_options) if replace_unhealthy_instances is not None: pulumi.set(__self__, "replace_unhealthy_instances", replace_unhealthy_instances) if spot_options is not None: pulumi.set(__self__, "spot_options", spot_options) if tags is not None: pulumi.set(__self__, "tags", tags) if tags_all is not None: pulumi.set(__self__, "tags_all", tags_all) if target_capacity_specification is not None: pulumi.set(__self__, "target_capacity_specification", target_capacity_specification) if terminate_instances is not None: pulumi.set(__self__, "terminate_instances", terminate_instances) if terminate_instances_with_expiration is not None: pulumi.set(__self__, "terminate_instances_with_expiration", terminate_instances_with_expiration) if type is not None: pulumi.set(__self__, "type", type) @property @pulumi.getter(name="excessCapacityTerminationPolicy") def excess_capacity_termination_policy(self) -> Optional[pulumi.Input[str]]: """ Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. """ return pulumi.get(self, "excess_capacity_termination_policy") @excess_capacity_termination_policy.setter def excess_capacity_termination_policy(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "excess_capacity_termination_policy", value) @property @pulumi.getter(name="launchTemplateConfig") def launch_template_config(self) -> Optional[pulumi.Input['FleetLaunchTemplateConfigArgs']]: """ Nested argument containing EC2 Launch Template configurations. Defined below. """ return pulumi.get(self, "launch_template_config") @launch_template_config.setter def launch_template_config(self, value: Optional[pulumi.Input['FleetLaunchTemplateConfigArgs']]): pulumi.set(self, "launch_template_config", value) @property @pulumi.getter(name="onDemandOptions") def on_demand_options(self) -> Optional[pulumi.Input['FleetOnDemandOptionsArgs']]: """ Nested argument containing On-Demand configurations. Defined below. """ return pulumi.get(self, "on_demand_options") @on_demand_options.setter def on_demand_options(self, value: Optional[pulumi.Input['FleetOnDemandOptionsArgs']]): pulumi.set(self, "on_demand_options", value) @property @pulumi.getter(name="replaceUnhealthyInstances") def replace_unhealthy_instances(self) -> Optional[pulumi.Input[bool]]: """ Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. """ return pulumi.get(self, "replace_unhealthy_instances") @replace_unhealthy_instances.setter def replace_unhealthy_instances(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "replace_unhealthy_instances", value) @property @pulumi.getter(name="spotOptions") def spot_options(self) -> Optional[pulumi.Input['FleetSpotOptionsArgs']]: """ Nested argument containing Spot configurations. Defined below. """ return pulumi.get(self, "spot_options") @spot_options.setter def spot_options(self, value: Optional[pulumi.Input['FleetSpotOptionsArgs']]): pulumi.set(self, "spot_options", value) @property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: """ Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. """ return pulumi.get(self, "tags") @tags.setter def tags(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]): pulumi.set(self, "tags", value) @property @pulumi.getter(name="tagsAll") def tags_all(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: """ A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. """ return pulumi.get(self, "tags_all") @tags_all.setter def tags_all(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]): pulumi.set(self, "tags_all", value) @property @pulumi.getter(name="targetCapacitySpecification") def target_capacity_specification(self) -> Optional[pulumi.Input['FleetTargetCapacitySpecificationArgs']]: """ Nested argument containing target capacity configurations. Defined below. """ return pulumi.get(self, "target_capacity_specification") @target_capacity_specification.setter def target_capacity_specification(self, value: Optional[pulumi.Input['FleetTargetCapacitySpecificationArgs']]): pulumi.set(self, "target_capacity_specification", value) @property @pulumi.getter(name="terminateInstances") def terminate_instances(self) -> Optional[pulumi.Input[bool]]: """ Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`. """ return pulumi.get(self, "terminate_instances") @terminate_instances.setter def terminate_instances(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "terminate_instances", value) @property @pulumi.getter(name="terminateInstancesWithExpiration") def terminate_instances_with_expiration(self) -> Optional[pulumi.Input[bool]]: """ Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`. """ return pulumi.get(self, "terminate_instances_with_expiration") @terminate_instances_with_expiration.setter def terminate_instances_with_expiration(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "terminate_instances_with_expiration", value) @property @pulumi.getter def type(self) -> Optional[pulumi.Input[str]]: """ The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`. Defaults to `maintain`. """ return pulumi.get(self, "type") @type.setter def type(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "type", value) class Fleet(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, excess_capacity_termination_policy: Optional[pulumi.Input[str]] = None, launch_template_config: Optional[pulumi.Input[pulumi.InputType['FleetLaunchTemplateConfigArgs']]] = None, on_demand_options: Optional[pulumi.Input[pulumi.InputType['FleetOnDemandOptionsArgs']]] = None, replace_unhealthy_instances: Optional[pulumi.Input[bool]] = None, spot_options: Optional[pulumi.Input[pulumi.InputType['FleetSpotOptionsArgs']]] = None, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, target_capacity_specification: Optional[pulumi.Input[pulumi.InputType['FleetTargetCapacitySpecificationArgs']]] = None, terminate_instances: Optional[pulumi.Input[bool]] = None, terminate_instances_with_expiration: Optional[pulumi.Input[bool]] = None, type: Optional[pulumi.Input[str]] = None, __props__=None): """ Provides a resource to manage EC2 Fleets. ## Example Usage ```python import pulumi import pulumi_aws as aws example = aws.ec2.Fleet("example", launch_template_config=aws.ec2.FleetLaunchTemplateConfigArgs( launch_template_specification=aws.ec2.FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs( launch_template_id=aws_launch_template["example"]["id"], version=aws_launch_template["example"]["latest_version"], ), ), target_capacity_specification=aws.ec2.FleetTargetCapacitySpecificationArgs( default_target_capacity_type="spot", total_target_capacity=5, )) ``` ## Import `aws_ec2_fleet` can be imported by using the Fleet identifier, e.g., ```sh $ pulumi import aws:ec2/fleet:Fleet example fleet-b9b55d27-c5fc-41ac-a6f3-48fcc91f080c ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] excess_capacity_termination_policy: Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. :param pulumi.Input[pulumi.InputType['FleetLaunchTemplateConfigArgs']] launch_template_config: Nested argument containing EC2 Launch Template configurations. Defined below. :param pulumi.Input[pulumi.InputType['FleetOnDemandOptionsArgs']] on_demand_options: Nested argument containing On-Demand configurations. Defined below. :param pulumi.Input[bool] replace_unhealthy_instances: Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. :param pulumi.Input[pulumi.InputType['FleetSpotOptionsArgs']] spot_options: Nested argument containing Spot configurations. Defined below. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. :param pulumi.Input[pulumi.InputType['FleetTargetCapacitySpecificationArgs']] target_capacity_specification: Nested argument containing target capacity configurations. Defined below. :param pulumi.Input[bool] terminate_instances: Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`. :param pulumi.Input[bool] terminate_instances_with_expiration: Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`. :param pulumi.Input[str] type: The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`. Defaults to `maintain`. """ ... @overload def __init__(__self__, resource_name: str, args: FleetArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Provides a resource to manage EC2 Fleets. ## Example Usage ```python import pulumi import pulumi_aws as aws example = aws.ec2.Fleet("example", launch_template_config=aws.ec2.FleetLaunchTemplateConfigArgs( launch_template_specification=aws.ec2.FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs( launch_template_id=aws_launch_template["example"]["id"], version=aws_launch_template["example"]["latest_version"], ), ), target_capacity_specification=aws.ec2.FleetTargetCapacitySpecificationArgs( default_target_capacity_type="spot", total_target_capacity=5, )) ``` ## Import `aws_ec2_fleet` can be imported by using the Fleet identifier, e.g., ```sh $ pulumi import aws:ec2/fleet:Fleet example fleet-b9b55d27-c5fc-41ac-a6f3-48fcc91f080c ``` :param str resource_name: The name of the resource. :param FleetArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(FleetArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, excess_capacity_termination_policy: Optional[pulumi.Input[str]] = None, launch_template_config: Optional[pulumi.Input[pulumi.InputType['FleetLaunchTemplateConfigArgs']]] = None, on_demand_options: Optional[pulumi.Input[pulumi.InputType['FleetOnDemandOptionsArgs']]] = None, replace_unhealthy_instances: Optional[pulumi.Input[bool]] = None, spot_options: Optional[pulumi.Input[pulumi.InputType['FleetSpotOptionsArgs']]] = None, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, target_capacity_specification: Optional[pulumi.Input[pulumi.InputType['FleetTargetCapacitySpecificationArgs']]] = None, terminate_instances: Optional[pulumi.Input[bool]] = None, terminate_instances_with_expiration: Optional[pulumi.Input[bool]] = None, type: Optional[pulumi.Input[str]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = FleetArgs.__new__(FleetArgs) __props__.__dict__["excess_capacity_termination_policy"] = excess_capacity_termination_policy if launch_template_config is None and not opts.urn: raise TypeError("Missing required property 'launch_template_config'") __props__.__dict__["launch_template_config"] = launch_template_config __props__.__dict__["on_demand_options"] = on_demand_options __props__.__dict__["replace_unhealthy_instances"] = replace_unhealthy_instances __props__.__dict__["spot_options"] = spot_options __props__.__dict__["tags"] = tags if target_capacity_specification is None and not opts.urn: raise TypeError("Missing required property 'target_capacity_specification'") __props__.__dict__["target_capacity_specification"] = target_capacity_specification __props__.__dict__["terminate_instances"] = terminate_instances __props__.__dict__["terminate_instances_with_expiration"] = terminate_instances_with_expiration __props__.__dict__["type"] = type __props__.__dict__["tags_all"] = None super(Fleet, __self__).__init__( 'aws:ec2/fleet:Fleet', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, excess_capacity_termination_policy: Optional[pulumi.Input[str]] = None, launch_template_config: Optional[pulumi.Input[pulumi.InputType['FleetLaunchTemplateConfigArgs']]] = None, on_demand_options: Optional[pulumi.Input[pulumi.InputType['FleetOnDemandOptionsArgs']]] = None, replace_unhealthy_instances: Optional[pulumi.Input[bool]] = None, spot_options: Optional[pulumi.Input[pulumi.InputType['FleetSpotOptionsArgs']]] = None, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, tags_all: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, target_capacity_specification: Optional[pulumi.Input[pulumi.InputType['FleetTargetCapacitySpecificationArgs']]] = None, terminate_instances: Optional[pulumi.Input[bool]] = None, terminate_instances_with_expiration: Optional[pulumi.Input[bool]] = None, type: Optional[pulumi.Input[str]] = None) -> 'Fleet': """ Get an existing Fleet resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] excess_capacity_termination_policy: Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. :param pulumi.Input[pulumi.InputType['FleetLaunchTemplateConfigArgs']] launch_template_config: Nested argument containing EC2 Launch Template configurations. Defined below. :param pulumi.Input[pulumi.InputType['FleetOnDemandOptionsArgs']] on_demand_options: Nested argument containing On-Demand configurations. Defined below. :param pulumi.Input[bool] replace_unhealthy_instances: Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. :param pulumi.Input[pulumi.InputType['FleetSpotOptionsArgs']] spot_options: Nested argument containing Spot configurations. Defined below. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. :param pulumi.Input[pulumi.InputType['FleetTargetCapacitySpecificationArgs']] target_capacity_specification: Nested argument containing target capacity configurations. Defined below. :param pulumi.Input[bool] terminate_instances: Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`. :param pulumi.Input[bool] terminate_instances_with_expiration: Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`. :param pulumi.Input[str] type: The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`. Defaults to `maintain`. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _FleetState.__new__(_FleetState) __props__.__dict__["excess_capacity_termination_policy"] = excess_capacity_termination_policy __props__.__dict__["launch_template_config"] = launch_template_config __props__.__dict__["on_demand_options"] = on_demand_options __props__.__dict__["replace_unhealthy_instances"] = replace_unhealthy_instances __props__.__dict__["spot_options"] = spot_options __props__.__dict__["tags"] = tags __props__.__dict__["tags_all"] = tags_all __props__.__dict__["target_capacity_specification"] = target_capacity_specification __props__.__dict__["terminate_instances"] = terminate_instances __props__.__dict__["terminate_instances_with_expiration"] = terminate_instances_with_expiration __props__.__dict__["type"] = type return Fleet(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="excessCapacityTerminationPolicy") def excess_capacity_termination_policy(self) -> pulumi.Output[Optional[str]]: """ Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. """ return pulumi.get(self, "excess_capacity_termination_policy") @property @pulumi.getter(name="launchTemplateConfig") def launch_template_config(self) -> pulumi.Output['outputs.FleetLaunchTemplateConfig']: """ Nested argument containing EC2 Launch Template configurations. Defined below. """ return pulumi.get(self, "launch_template_config") @property @pulumi.getter(name="onDemandOptions") def on_demand_options(self) -> pulumi.Output[Optional['outputs.FleetOnDemandOptions']]: """ Nested argument containing On-Demand configurations. Defined below. """ return pulumi.get(self, "on_demand_options") @property @pulumi.getter(name="replaceUnhealthyInstances") def replace_unhealthy_instances(self) -> pulumi.Output[Optional[bool]]: """ Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. """ return pulumi.get(self, "replace_unhealthy_instances") @property @pulumi.getter(name="spotOptions") def spot_options(self) -> pulumi.Output[Optional['outputs.FleetSpotOptions']]: """ Nested argument containing Spot configurations. Defined below. """ return pulumi.get(self, "spot_options") @property @pulumi.getter def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]: """ Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. """ return pulumi.get(self, "tags") @property @pulumi.getter(name="tagsAll") def tags_all(self) -> pulumi.Output[Mapping[str, str]]: """ A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. """ return pulumi.get(self, "tags_all") @property @pulumi.getter(name="targetCapacitySpecification") def target_capacity_specification(self) -> pulumi.Output['outputs.FleetTargetCapacitySpecification']: """ Nested argument containing target capacity configurations. Defined below. """ return pulumi.get(self, "target_capacity_specification") @property @pulumi.getter(name="terminateInstances") def terminate_instances(self) -> pulumi.Output[Optional[bool]]: """ Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`. """ return pulumi.get(self, "terminate_instances") @property @pulumi.getter(name="terminateInstancesWithExpiration") def terminate_instances_with_expiration(self) -> pulumi.Output[Optional[bool]]: """ Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`. """ return pulumi.get(self, "terminate_instances_with_expiration") @property @pulumi.getter def type(self) -> pulumi.Output[Optional[str]]: """ The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`. Defaults to `maintain`. """ return pulumi.get(self, "type")
57.024353
304
0.706419
4,154
37,465
6.136254
0.05585
0.068615
0.065594
0.023852
0.92703
0.914319
0.908356
0.902668
0.899529
0.884425
0
0.003381
0.202616
37,465
656
305
57.11128
0.849869
0.376405
0
0.785326
1
0
0.176162
0.121715
0
0
0
0
0
1
0.163043
false
0.002717
0.019022
0
0.279891
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
fc02a83cbe639e71fae049bf583bf8c42df5e753
6,241
py
Python
pandas/tseries/tests/test_cursor.py
ssalonen/pandas
1929563fdb5358a41420d103a388aa2bd494d543
[ "PSF-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
1
2015-11-25T19:12:03.000Z
2015-11-25T19:12:03.000Z
pandas/tseries/tests/test_cursor.py
pierre-haessig/pandas
f9e0b7df8ca8a92133d3cea0a26181140f991e2d
[ "PSF-2.0", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
pandas/tseries/tests/test_cursor.py
pierre-haessig/pandas
f9e0b7df8ca8a92133d3cea0a26181140f991e2d
[ "PSF-2.0", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
""" class TestNewOffsets(unittest.TestCase): def test_yearoffset(self): off = lib.YearOffset(dayoffset=0, biz=0, anchor=datetime(2002,1,1)) for i in range(500): t = lib.Timestamp(off.ts) self.assert_(t.day == 1) self.assert_(t.month == 1) self.assert_(t.year == 2002 + i) next(off) for i in range(499, -1, -1): off.prev() t = lib.Timestamp(off.ts) self.assert_(t.day == 1) self.assert_(t.month == 1) self.assert_(t.year == 2002 + i) off = lib.YearOffset(dayoffset=-1, biz=0, anchor=datetime(2002,1,1)) for i in range(500): t = lib.Timestamp(off.ts) self.assert_(t.month == 12) self.assert_(t.day == 31) self.assert_(t.year == 2001 + i) next(off) for i in range(499, -1, -1): off.prev() t = lib.Timestamp(off.ts) self.assert_(t.month == 12) self.assert_(t.day == 31) self.assert_(t.year == 2001 + i) off = lib.YearOffset(dayoffset=-1, biz=-1, anchor=datetime(2002,1,1)) stack = [] for i in range(500): t = lib.Timestamp(off.ts) stack.append(t) self.assert_(t.month == 12) self.assert_(t.day == 31 or t.day == 30 or t.day == 29) self.assert_(t.year == 2001 + i) self.assert_(t.weekday() < 5) next(off) for i in range(499, -1, -1): off.prev() t = lib.Timestamp(off.ts) self.assert_(t == stack.pop()) self.assert_(t.month == 12) self.assert_(t.day == 31 or t.day == 30 or t.day == 29) self.assert_(t.year == 2001 + i) self.assert_(t.weekday() < 5) def test_monthoffset(self): off = lib.MonthOffset(dayoffset=0, biz=0, anchor=datetime(2002,1,1)) for i in range(12): t = lib.Timestamp(off.ts) self.assert_(t.day == 1) self.assert_(t.month == 1 + i) self.assert_(t.year == 2002) next(off) for i in range(11, -1, -1): off.prev() t = lib.Timestamp(off.ts) self.assert_(t.day == 1) self.assert_(t.month == 1 + i) self.assert_(t.year == 2002) off = lib.MonthOffset(dayoffset=-1, biz=0, anchor=datetime(2002,1,1)) for i in range(12): t = lib.Timestamp(off.ts) self.assert_(t.day >= 28) self.assert_(t.month == (12 if i == 0 else i)) self.assert_(t.year == 2001 + (i != 0)) next(off) for i in range(11, -1, -1): off.prev() t = lib.Timestamp(off.ts) self.assert_(t.day >= 28) self.assert_(t.month == (12 if i == 0 else i)) self.assert_(t.year == 2001 + (i != 0)) off = lib.MonthOffset(dayoffset=-1, biz=-1, anchor=datetime(2002,1,1)) stack = [] for i in range(500): t = lib.Timestamp(off.ts) stack.append(t) if t.month != 2: self.assert_(t.day >= 28) else: self.assert_(t.day >= 26) self.assert_(t.weekday() < 5) next(off) for i in range(499, -1, -1): off.prev() t = lib.Timestamp(off.ts) self.assert_(t == stack.pop()) if t.month != 2: self.assert_(t.day >= 28) else: self.assert_(t.day >= 26) self.assert_(t.weekday() < 5) for i in (-2, -1, 1, 2): for j in (-1, 0, 1): off1 = lib.MonthOffset(dayoffset=i, biz=j, stride=12, anchor=datetime(2002,1,1)) off2 = lib.YearOffset(dayoffset=i, biz=j, anchor=datetime(2002,1,1)) for k in range(500): self.assert_(off1.ts == off2.ts) next(off1) next(off2) for k in range(500): self.assert_(off1.ts == off2.ts) off1.prev() off2.prev() def test_dayoffset(self): off = lib.DayOffset(biz=0, anchor=datetime(2002,1,1)) us_in_day = 1e6 * 60 * 60 * 24 t0 = lib.Timestamp(off.ts) for i in range(500): next(off) t1 = lib.Timestamp(off.ts) self.assert_(t1.value - t0.value == us_in_day) t0 = t1 t0 = lib.Timestamp(off.ts) for i in range(499, -1, -1): off.prev() t1 = lib.Timestamp(off.ts) self.assert_(t0.value - t1.value == us_in_day) t0 = t1 off = lib.DayOffset(biz=1, anchor=datetime(2002,1,1)) t0 = lib.Timestamp(off.ts) for i in range(500): next(off) t1 = lib.Timestamp(off.ts) self.assert_(t1.weekday() < 5) self.assert_(t1.value - t0.value == us_in_day or t1.value - t0.value == 3 * us_in_day) t0 = t1 t0 = lib.Timestamp(off.ts) for i in range(499, -1, -1): off.prev() t1 = lib.Timestamp(off.ts) self.assert_(t1.weekday() < 5) self.assert_(t0.value - t1.value == us_in_day or t0.value - t1.value == 3 * us_in_day) t0 = t1 def test_dayofmonthoffset(self): for week in (-1, 0, 1): for day in (0, 2, 4): off = lib.DayOfMonthOffset(week=-1, day=day, anchor=datetime(2002,1,1)) stack = [] for i in range(500): t = lib.Timestamp(off.ts) stack.append(t) self.assert_(t.weekday() == day) next(off) for i in range(499, -1, -1): off.prev() t = lib.Timestamp(off.ts) self.assert_(t == stack.pop()) self.assert_(t.weekday() == day) """
31.680203
78
0.452652
813
6,241
3.389914
0.081181
0.185051
0.171626
0.135704
0.854862
0.838897
0.817852
0.780479
0.780479
0.753266
0
0.08651
0.407307
6,241
196
79
31.841837
0.658556
0.997917
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
8
fc05d951deda111ddf5710180fc7f6ade078c7af
21,751
py
Python
src/nninst/statistics.py
uchuhimo/Ptolemy
5c8ae188af30ee49d38f27d54c67af2eab9489e7
[ "Apache-2.0" ]
15
2020-08-24T07:11:20.000Z
2021-09-13T08:03:42.000Z
src/nninst/statistics.py
uchuhimo/Ptolemy
5c8ae188af30ee49d38f27d54c67af2eab9489e7
[ "Apache-2.0" ]
5
2021-02-28T17:30:26.000Z
2021-06-15T09:33:00.000Z
src/nninst/statistics.py
uchuhimo/Ptolemy
5c8ae188af30ee49d38f27d54c67af2eab9489e7
[ "Apache-2.0" ]
3
2020-10-22T09:11:11.000Z
2021-01-16T14:49:34.000Z
import gc from functools import reduce from typing import Callable, Iterable, List, Optional, Tuple, TypeVar import numpy as np import pandas as pd from .graph import AttrMap, Graph from .trace import AddOp, TraceKey from .utils import filter_not_null from .utils.fs import IOAction from .utils.ray import ray_iter __all__ = [ "calc_iou", "calc_iou_compact", "calc_trace_side_overlap", "calc_weighted_iou", "calc_class_trace_side_overlap", "calc_class_trace_side_overlap_norm", "calc_trace_side_overlap_compact", "calc_class_trace_side_overlap_compact", "calc_trace_side_overlap_both_compact", "calc_density", "calc_density_compact", "calc_space", "calc_skip_ratio", "calc_trace_size", "calc_density_compact_per_layer", "self_similarity_matrix", "self_similarity_matrix_ray", ] T = TypeVar("T") def calc_iou(trace1: AttrMap, trace2: AttrMap, key: str = TraceKey.EDGE) -> float: def intersect_and_union(node_name: str) -> Optional[Tuple[int, int]]: node_trace1 = trace1.nodes[node_name] if key in node_trace1: node_trace2 = trace2.nodes[node_name] trace_set1 = TraceKey.to_array(node_trace1[key]) trace_set2 = TraceKey.to_array(node_trace2[key]) intersect = np.intersect1d(trace_set1, trace_set2) union = np.union1d(trace_set1, trace_set2) return len(intersect), len(union) else: return None def get_iou(args: Tuple[int, int]) -> float: intersect_size, union_size = args return intersect_size / union_size iou = get_iou( reduce( lambda x, y: (x[0] + y[0], x[1] + y[1]), filter_not_null( [intersect_and_union(node_name) for node_name in trace1.nodes] ), ) ) return iou def calc_iou_frequency( trace1: AttrMap, trace2: AttrMap, frequency: int, key: str = TraceKey.EDGE ) -> float: def intersect_and_union(node_name: str) -> Optional[Tuple[int, int]]: node_trace1 = trace1.nodes[node_name] if key in node_trace1: node_trace2 = trace2.nodes[node_name] trace_set1 = ( node_trace1[key].index[node_trace1[key]["count"] > frequency].values ) trace_set2 = ( node_trace2[key].index[node_trace2[key]["count"] > frequency].values ) intersect = np.intersect1d(trace_set1, trace_set2) union = np.union1d(trace_set1, trace_set2) return len(intersect), len(union) else: return None def get_iou(args: Tuple[int, int]) -> float: intersect_size, union_size = args if union_size == 0: return 0 else: return intersect_size / union_size iou = get_iou( reduce( lambda x, y: (x[0] + y[0], x[1] + y[1]), filter_not_null( [intersect_and_union(node_name) for node_name in trace1.nodes] ), ) ) return iou def calc_iou_frequency_per_layer( trace1: AttrMap, trace2: AttrMap, node_name: str, frequency: int, key: str = TraceKey.EDGE, ) -> float: node_trace1 = trace1.nodes[node_name] if key in node_trace1: node_trace2 = trace2.nodes[node_name] trace_set1 = ( node_trace1[key].index[node_trace1[key]["count"] > frequency].values ) trace_set2 = ( node_trace2[key].index[node_trace2[key]["count"] > frequency].values ) intersect = np.intersect1d(trace_set1, trace_set2) union = np.union1d(trace_set1, trace_set2) if len(union) != 0: return len(intersect) / len(union) else: return 0 else: return None def calc_iou_per_layer( trace1: AttrMap, trace2: AttrMap, node_name: str, key: str = TraceKey.EDGE ) -> float: node_trace1 = trace1.nodes[node_name] if key in node_trace1: node_trace2 = trace2.nodes[node_name] trace_set1 = TraceKey.to_array(node_trace1[key]) trace_set2 = TraceKey.to_array(node_trace2[key]) intersect = np.intersect1d(trace_set1, trace_set2) union = np.union1d(trace_set1, trace_set2) return len(intersect) / len(union) else: return None def calc_class_trace_side_overlap( class_trace: AttrMap, trace: AttrMap, key: str = TraceKey.EDGE ) -> float: def intersect(node_name: str) -> Optional[int]: node_class_trace = class_trace.nodes[node_name] if key in node_class_trace: node_trace = trace.nodes[node_name] class_trace_set = TraceKey.to_array(node_class_trace[key]) trace_set = TraceKey.to_array(node_trace[key]) intersect = np.intersect1d(class_trace_set, trace_set) return len(intersect) else: return None iou = ( sum(filter_not_null([intersect(node_name) for node_name in class_trace.nodes])) / class_trace.attrs[TraceKey.max_of(TraceKey.num_of(key))] ) return iou def calc_class_trace_side_overlap_norm( class_trace: AttrMap, trace: AttrMap, key: str = TraceKey.EDGE ) -> float: def intersect(node_name: str) -> Optional[int]: node_class_trace = class_trace.nodes[node_name] if key in node_class_trace: node_trace = trace.nodes[node_name] class_trace_set = TraceKey.to_array(node_class_trace[key]) trace_set = TraceKey.to_array(node_trace[key]) intersect = np.intersect1d(class_trace_set, trace_set) return len(intersect) else: return None iou = ( sum(filter_not_null([intersect(node_name) for node_name in class_trace.nodes])) - class_trace.attrs[TraceKey.min_of(TraceKey.num_of(key))] ) / class_trace.attrs[TraceKey.max_of(TraceKey.num_of(key))] return iou def calc_trace_side_overlap( class_trace: AttrMap, trace: AttrMap, key: str = TraceKey.EDGE, node_name: str = None, ) -> float: def intersect_and_union(node_name: str) -> Optional[Tuple[int, int]]: node_class_trace = class_trace.nodes[node_name] if key in node_class_trace: # if key == TraceKey.EDGE and node_name.startswith("max"): # return None node_trace = trace.nodes[node_name] class_trace_set = TraceKey.to_array(node_class_trace[key]) trace_set = TraceKey.to_array(node_trace[key]) intersect = np.intersect1d(class_trace_set, trace_set) return len(intersect), len(trace_set) else: return None def get_iou(args: Tuple[int, int]) -> float: intersect_size, union_size = args return intersect_size / union_size if node_name is None: iou = get_iou( reduce( lambda x, y: (x[0] + y[0], x[1] + y[1]), filter_not_null( [intersect_and_union(node_name) for node_name in class_trace.nodes] ), ) ) else: iou = intersect_and_union(node_name) if iou is not None: iou = get_iou(iou) return iou def calc_trace_size( trace: AttrMap, key: str = TraceKey.EDGE, compact: bool = False ) -> Optional[int]: def trace_size(node_name: str) -> Optional[int]: node_trace = trace.nodes[node_name] if key in node_trace: if compact: return np.count_nonzero(np.unpackbits(node_trace[key])) else: return TraceKey.to_array(node_trace[key]).size else: return None return sum(filter_not_null([trace_size(node_name) for node_name in trace.nodes])) def calc_trace_size_per_layer( trace: AttrMap, layer_name: str, key: str = TraceKey.EDGE, compact: bool = False ) -> Optional[int]: def trace_size(node_name: str) -> Optional[int]: node_trace = trace.nodes[node_name] if key in node_trace: if compact: return np.count_nonzero(np.unpackbits(node_trace[key])) else: return TraceKey.to_array(node_trace[key]).size else: return None return trace_size(layer_name) def calc_trace_path_num(trace: AttrMap, layer: str) -> int: return trace.tensors[layer][TraceKey.PATH]["count"].sum() def calc_trace_side_overlap_compact( class_trace: AttrMap, trace: AttrMap, key: str = TraceKey.EDGE, node_name: str = None, ) -> float: def intersect_and_union(node_name: str) -> Optional[Tuple[int, int]]: node_class_trace = class_trace.nodes[node_name] if key in node_class_trace: node_trace = trace.nodes[node_name] class_trace_set = TraceKey.to_array( np.argwhere(np.unpackbits(node_class_trace[key])) ) trace_set = TraceKey.to_array(node_trace[key]) intersect = np.intersect1d(class_trace_set, trace_set) return len(intersect), len(trace_set) else: return None def get_iou(args: Tuple[int, int]) -> float: intersect_size, union_size = args if union_size == 0: return 0 else: return intersect_size / union_size if node_name is None: iou = get_iou( reduce( lambda x, y: (x[0] + y[0], x[1] + y[1]), filter_not_null( [intersect_and_union(node_name) for node_name in class_trace.nodes] ), ) ) else: iou = intersect_and_union(node_name) if iou is not None: iou = get_iou(iou) return iou def calc_trace_side_overlap_both_compact( class_trace: AttrMap, trace: AttrMap, key: str = TraceKey.EDGE, node_name: str = None, return_size: bool = False, ) -> float: def intersect_and_union(node_name: str) -> Optional[Tuple[int, int]]: node_class_trace = class_trace.nodes[node_name] if key in node_class_trace: node_trace = trace.nodes[node_name] class_trace_set = node_class_trace[key] trace_set = node_trace[key] intersect = np.bitwise_and(class_trace_set, trace_set) return ( np.count_nonzero(np.unpackbits(intersect)), np.count_nonzero(np.unpackbits(trace_set)), ) else: return None def get_iou(args: Tuple[int, int]) -> float: intersect_size, union_size = args if union_size == 0: return 0 else: return intersect_size / union_size if node_name is None: intersect_size, union_size = reduce( lambda x, y: (x[0] + y[0], x[1] + y[1]), filter_not_null( [intersect_and_union(node_name) for node_name in class_trace.nodes] ), ) iou = get_iou((intersect_size, union_size)) if return_size: return iou, intersect_size else: iou = intersect_and_union(node_name) if iou is not None: iou = get_iou(iou) return iou def calc_class_trace_side_overlap_compact( class_trace: AttrMap, trace: AttrMap, key: str = TraceKey.EDGE, node_name: str = None, ) -> float: def intersect_and_union(node_name: str) -> Optional[Tuple[int, int]]: node_class_trace = class_trace.nodes[node_name] if key in node_class_trace: node_trace = trace.nodes[node_name] class_trace_set = TraceKey.to_array( np.argwhere(np.unpackbits(node_class_trace[key])) ) trace_set = TraceKey.to_array(node_trace[key]) intersect = np.intersect1d(class_trace_set, trace_set) return len(intersect), len(class_trace_set) else: return None def get_iou(args: Tuple[int, int]) -> float: intersect_size, union_size = args if union_size == 0: return 0 else: return intersect_size / union_size if node_name is None: iou = get_iou( reduce( lambda x, y: (x[0] + y[0], x[1] + y[1]), filter_not_null( [intersect_and_union(node_name) for node_name in class_trace.nodes] ), ) ) else: iou = intersect_and_union(node_name) if iou is not None: iou = get_iou(iou) return iou def calc_weighted_iou( class_trace: AttrMap, trace: AttrMap, key: str = TraceKey.EDGE, node_name: str = None, ) -> float: def intersect_and_union(node_name: str) -> Optional[Tuple[float, float]]: node_class_trace = class_trace.nodes[node_name] if key in node_class_trace: node_trace = trace.nodes[node_name] frame_class_trace = node_class_trace[key] intersect_mask = np.isin( TraceKey.to_array(frame_class_trace), node_trace[key], assume_unique=True, ) return ( frame_class_trace["count"].values[intersect_mask].sum() / class_trace.attrs[TraceKey.COUNT], frame_class_trace["count"].values.sum() / class_trace.attrs[TraceKey.COUNT], ) else: return None def get_iou(args: Tuple[float, float]) -> float: intersect_size, union_size = args return intersect_size / union_size if node_name is None: iou = get_iou( reduce( lambda x, y: (x[0] + y[0], x[1] + y[1]), filter_not_null( [intersect_and_union(node_name) for node_name in class_trace.nodes] ), ) ) else: iou = intersect_and_union(node_name) if iou is not None: iou = get_iou(iou) return iou def calc_iou_compact( trace1: AttrMap, trace2: AttrMap, key: str = TraceKey.EDGE ) -> float: def intersect_and_union(node_name: str) -> Optional[Tuple[int, int]]: node_trace1 = trace1.nodes[node_name] if key in node_trace1: node_trace2 = trace2.nodes[node_name] trace_set1 = node_trace1[key] trace_set2 = node_trace2[key] intersect = np.bitwise_and(trace_set1, trace_set2) union = np.bitwise_or(trace_set1, trace_set2) return ( np.count_nonzero(np.unpackbits(intersect)), np.count_nonzero(np.unpackbits(union)), ) else: return None def get_iou(args: Tuple[int, int]) -> float: intersect_size, union_size = args if union_size == 0: return 0 else: return intersect_size / union_size iou = get_iou( reduce( lambda x, y: (x[0] + y[0], x[1] + y[1]), filter_not_null( [intersect_and_union(node_name) for node_name in trace1.nodes] ), ) ) return iou def calc_iou_compact_per_layer( trace1: AttrMap, trace2: AttrMap, node_name: str, key: str = TraceKey.EDGE ) -> float: node_trace1 = trace1.nodes[node_name] if key in node_trace1: node_trace2 = trace2.nodes[node_name] trace_set1 = node_trace1[key] trace_set2 = node_trace2[key] intersect = np.bitwise_and(trace_set1, trace_set2) union = np.bitwise_or(trace_set1, trace_set2) return np.count_nonzero(np.unpackbits(intersect)) / np.count_nonzero( np.unpackbits(union) ) else: return None def self_similarity_matrix( iterable: Iterable[T], trace_fn: Callable[[T], AttrMap], similarity_fn: Callable[[AttrMap, AttrMap], float], ) -> np.ndarray: if not isinstance(iterable, list): iterable = list(iterable) size = len(iterable) matrix = np.eye(size, dtype=float) for i in range(0, size): for j in range(i + 1, size): trace_i = trace_fn(iterable[i]) trace_j = trace_fn(iterable[j]) similarity = similarity_fn(trace_i, trace_j) matrix[i][j] = similarity matrix[j][i] = similarity return matrix def self_similarity_matrix_ray( partial_path: str, iterable: Iterable[T], trace_fn: Callable[[T], AttrMap], similarity_fn: Callable[[AttrMap, AttrMap], float], key: str = TraceKey.EDGE, ) -> np.ndarray: if not isinstance(iterable, list): iterable = list(iterable) size = len(iterable) def calc_similarity(iter_i, iter_j): trace_i = trace_fn(iter_i) trace_j = trace_fn(iter_j) if trace_i is None or trace_j is None: return 0.0 else: similarity = similarity_fn(trace_i, trace_j, key=key) return similarity def save_and_load_similarity(i, j): # tr.print_diff() iter_i = iterable[i] iter_j = iterable[j] action = IOAction( f"{partial_path}/{iter_i}_{iter_j}.pkl", init_fn=lambda: calc_similarity(iter_i, iter_j), cache=True, ) action.save() return i, j, action.load() # tr = tracker.SummaryTracker() similarity_list = ray_iter( save_and_load_similarity, [(i, j) for i in range(0, size) for j in range(i + 1, size)], out_of_order=True, chunksize=1, ) matrix = np.eye(size, dtype=float) for i, j, similarity in similarity_list: matrix[i][j] = similarity matrix[j][i] = similarity print(f"finish i={i}, j={j}") return matrix def inter_class_similarity_matrix_ray( partial_path: str, iterable: Iterable[T], trace_fn: Callable[[T, str], AttrMap], similarity_fn: Callable[[AttrMap, AttrMap], float], key: str = TraceKey.EDGE, ) -> np.ndarray: if not isinstance(iterable, list): iterable = list(iterable) size = len(iterable) def calc_similarity(iter_i, iter_j): trace_i = trace_fn(iter_i, "left") trace_j = trace_fn(iter_j, "right") if trace_i is None or trace_j is None: return 0.0 else: similarity = similarity_fn(trace_i, trace_j, key=key) del trace_i del trace_j gc.collect() return similarity def save_and_load_similarity(i, j): # tr.print_diff() iter_i = iterable[i] iter_j = iterable[j] action = IOAction( f"{partial_path}/{iter_i}_{iter_j}.pkl", init_fn=lambda: calc_similarity(iter_i, iter_j), cache=True, ) action.save() return i, j, action.load() # tr = tracker.SummaryTracker() similarity_list = ray_iter( save_and_load_similarity, [(i, j) for i in range(0, size) for j in range(i, size)], out_of_order=True, chunksize=1, ) matrix = np.zeros((size, size), dtype=float) for i, j, similarity in similarity_list: matrix[i][j] = similarity matrix[j][i] = similarity print(f"finish i={i}, j={j}") return matrix def calc_density(trace: AttrMap, key: str) -> float: density = sum( node[key].size for name, node in trace.nodes.items() if key in node ) / sum( np.prod(node[key + "_shape"]) for name, node in trace.nodes.items() if key in node ) return density def calc_density_compact(trace: AttrMap, key: str) -> float: density = sum( np.count_nonzero(np.unpackbits(node[key])) for name, node in trace.nodes.items() if key in node ) / sum( np.prod(node[key + "_shape"]) for name, node in trace.nodes.items() if key in node ) return density def calc_density_compact_per_layer( trace: AttrMap, layers: List[str], key: str ) -> pd.DataFrame: result_layers = [] densities = [] for layer_name in layers: node = trace.nodes[layer_name] if key in node: result_layers.append(layer_name) densities.append( np.count_nonzero(np.unpackbits(node[key])) / np.prod(node[key + "_shape"]) ) return pd.DataFrame(dict(density=densities), index=result_layers).rename_axis( "layer" ) def calc_metrics_compact_per_layer(trace: AttrMap, layers: List[str]) -> pd.DataFrame: result_layers = [] metrics = [] for layer_name in layers: node = trace.nodes[layer_name] for metric_name in TraceKey.METRICS: result_layers.append(f"{layer_name}/{metric_name}") metrics.append(node[metric_name]) return pd.DataFrame(dict(value=metrics), index=result_layers).rename_axis( "layer_metric" ) def calc_skip_ratio(graph: Graph, layers: List[str]) -> pd.DataFrame: result_layers = [] skip_ratios = [] for node_name in layers: node = graph.node(graph.id(node_name)) if isinstance(node, AddOp): traced_edges = np.unpackbits(node.attrs[TraceKey.EDGE]).reshape( node.attrs[TraceKey.EDGE_SHAPE] ) result_layers.append(node.name) skip_ratios.append( np.count_nonzero(traced_edges[1]) / np.count_nonzero(traced_edges) ) return pd.DataFrame(dict(skip_ratio=skip_ratios), index=result_layers).rename_axis( "layer" ) def calc_space(trace: AttrMap, key: str) -> int: return sum( np.prod(node[key + "_shape"]) for name, node in trace.nodes.items() if key in node )
31.892962
87
0.600386
2,793
21,751
4.416398
0.05836
0.054479
0.02951
0.035752
0.868747
0.838022
0.810296
0.786299
0.764167
0.755006
0
0.010892
0.299297
21,751
681
88
31.939794
0.798438
0.00754
0
0.707563
0
0
0.028174
0.01696
0
0
0
0
0
1
0.082353
false
0
0.016807
0.003361
0.22521
0.003361
0
0
0
null
0
0
0
1
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
7
fc145b48c692098bc8639996347b86c2a5e6a87a
15,070
py
Python
tests/causal_refuters/test_dummy_outcome_refuter.py
Sid-darthvader/dowhy
535cdb47d7eed8988573770769ecea3856180b48
[ "MIT" ]
1
2020-12-03T17:28:42.000Z
2020-12-03T17:28:42.000Z
tests/causal_refuters/test_dummy_outcome_refuter.py
Sid-darthvader/dowhy
535cdb47d7eed8988573770769ecea3856180b48
[ "MIT" ]
null
null
null
tests/causal_refuters/test_dummy_outcome_refuter.py
Sid-darthvader/dowhy
535cdb47d7eed8988573770769ecea3856180b48
[ "MIT" ]
null
null
null
import pytest import numpy as np import pdb from .base import TestRefuter def simple_linear_outcome_model(X_train, output_train): # The outcome is a linear function of the confounder # The slope is 1,2 and the intercept is 3 return lambda X_train: X_train[:,0] + 2*X_train[:,1] + 3 @pytest.mark.usefixtures("fixed_seed") class TestDummyOutcomeRefuter(object): @pytest.mark.parametrize(["error_tolerence","estimator_method"], [(0.03, "iv.instrumental_variable")]) def test_refutation_dummy_outcome_refuter_default_continuous_treatment(self, error_tolerence, estimator_method): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter") refuter_tester.continuous_treatment_testsuite() @pytest.mark.parametrize(["error_tolerence","estimator_method","num_samples"], [(0.03, "backdoor.propensity_score_matching",1000)]) def test_refutation_dummy_outcome_refuter_default_binary_treatment(self, error_tolerence, estimator_method, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter") refuter_tester.binary_treatment_testsuite(tests_to_run="atleast-one-common-cause", num_samples=num_samples) @pytest.mark.parametrize(["error_tolerence","estimator_method", "transformations"], [(0.03, "iv.instrumental_variable", [("zero",""),("noise", {'std_dev': 1} )] )] ) def test_refutation_dummy_outcome_refuter_randomly_generated_continuous_treatment(self, error_tolerence, estimator_method, transformations): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.continuous_treatment_testsuite() @pytest.mark.parametrize(["error_tolerence","estimator_method", "transformations","num_samples"], [(0.03, "backdoor.propensity_score_matching", [("zero",""),("noise", {'std_dev': 1} )], 1000 )] ) def test_refutation_dummy_outcome_refuter_randomly_generated_binary_treatment(self, error_tolerence, estimator_method, transformations, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.binary_treatment_testsuite(tests_to_run="atleast-one-common-cause", num_samples=num_samples) @pytest.mark.parametrize(["error_tolerence", "estimator_method", "transformations"], [(0.03, "iv.instrumental_variable", [("permute", {'permute_fraction' :1} )] )] ) def test_refutation_dummy_outcome_refuter_permute_data_continuous_treatment(self, error_tolerence, estimator_method, transformations): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.continuous_treatment_testsuite() @pytest.mark.parametrize(["error_tolerence", "estimator_method", "transformations","num_samples"], [(0.05, "backdoor.propensity_score_matching", [("permute", {'permute_fraction' :1} )], 1000 )] ) def test_refutation_dummy_outcome_refuter_permute_data_binary_treatment(self, error_tolerence, estimator_method, transformations, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.binary_treatment_testsuite(tests_to_run="atleast-one-common-cause", num_samples=num_samples) @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations"], [(0.03, "iv.instrumental_variable",[(simple_linear_outcome_model, {}), ("noise", {'std_dev': 1} )] )]) def test_refutation_dummy_outcome_refuter_custom_function_linear_regression_with_noise_continuous_treatment(self, error_tolerence, estimator_method, transformations): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.continuous_treatment_testsuite(tests_to_run="atleast-one-common-cause") @pytest.mark.xfail @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations","num_samples"], [(0.03, "backdoor.propensity_score_matching",[(simple_linear_outcome_model, {}), ("noise", {'std_dev': 1} )], 1000 )]) def test_refutation_dummy_outcome_refuter_custom_function_linear_regression_with_noise_binary_treatment(self, error_tolerence, estimator_method, transformations, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.binary_treatment_testsuite(tests_to_run="atleast-one-common-cause", num_samples=num_samples) @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations"], [(0.03, "iv.instrumental_variable",[("permute", {'permute_fraction':0.5}),(simple_linear_outcome_model, {}), ("noise", {'std_dev': 1} )] )]) def test_refutation_dummy_outcome_refuter_custom_function_linear_regression_with_permute_continuous_treatment(self, error_tolerence, estimator_method, transformations): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.continuous_treatment_testsuite(tests_to_run="atleast-one-common-cause") @pytest.mark.xfail @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations","num_samples"], [(0.03, "backdoor.propensity_score_matching",[("permute", {'permute_fraction':0.5}),(simple_linear_outcome_model, {}), ("noise", {'std_dev': 1} )], 1000 )]) def test_refutation_dummy_outcome_refuter_custom_function_linear_regression_with_permute_binary_treatment(self, error_tolerence, estimator_method, transformations, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.binary_treatment_testsuite(tests_to_run="atleast-one-common-cause", num_samples=num_samples) @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations"], [(0.01, "iv.instrumental_variable",[("linear_regression",{}) , ("zero",""), ("noise", {'std_dev': 1} )] )]) def test_refutation_dummy_outcome_refuter_internal_linear_regression_continuous_treatment(self, error_tolerence, estimator_method, transformations): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.continuous_treatment_testsuite(tests_to_run="atleast-one-common-cause") @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations","num_samples"], [(0.01, "backdoor.propensity_score_matching",[("linear_regression",{}) , ("zero",""), ("noise", {'std_dev': 1} )], 1000 )]) def test_refutation_dummy_outcome_refuter_internal_linear_regression_binary_treatment(self, error_tolerence, estimator_method, transformations, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.binary_treatment_testsuite(tests_to_run="atleast-one-common-cause", num_samples=num_samples) @pytest.mark.parametrize(["error_tolerence","estimator_method", "transformations"], [(0.01, "iv.instrumental_variable",[("knn",{'n_neighbors':5}), ("zero",""), ("noise", {'std_dev': 1} )] )]) def test_refutation_dummy_outcome_refuter_internal_knn_continuous_treatment(self, error_tolerence, estimator_method, transformations): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.continuous_treatment_testsuite(tests_to_run="atleast-one-common-cause") @pytest.mark.parametrize(["error_tolerence","estimator_method", "transformations","num_samples"], [(0.01, "backdoor.propensity_score_matching",[("knn",{'n_neighbors':5}), ("zero",""), ("noise", {'std_dev': 1} )], 1000 )]) def test_refutation_dummy_outcome_refuter_internal_knn_binary_treatment(self, error_tolerence, estimator_method, transformations, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.binary_treatment_testsuite(tests_to_run="atleast-one-common-cause", num_samples=num_samples) @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations", "num_samples"], [(0.01, "iv.instrumental_variable",[("svm",{'C':1,'epsilon':0.2}), ("zero",""), ("noise", {'std_dev': 1} )], 10000 )]) def test_refutation_dummy_outcome_refuter_internal_svm_continuous_treatment(self, error_tolerence, estimator_method, transformations, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.continuous_treatment_testsuite(num_samples=num_samples, tests_to_run="atleast-one-common-cause") @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations", "num_samples"], [(0.01, "backdoor.propensity_score_matching",[("svm",{'C':1,'epsilon':0.2}), ("zero",""), ("noise", {'std_dev': 1} )], 1000 )]) def test_refutation_dummy_outcome_refuter_internal_svm_binary_treatment(self, error_tolerence, estimator_method, transformations, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.binary_treatment_testsuite(num_samples=num_samples, tests_to_run="atleast-one-common-cause") @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations","num_samples"], [(0.01, "iv.instrumental_variable",[("random_forest",{'max_depth':20}), ("zero",""), ("noise", {'std_dev': 1} )], 10000)]) def test_refutation_dummy_outcome_refuter_internal_random_forest_continuous_treatment(self, error_tolerence, estimator_method, transformations, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.continuous_treatment_testsuite(num_samples,tests_to_run="atleast-one-common-cause") @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations","num_samples"], [(0.01, "backdoor.propensity_score_matching",[("random_forest",{'max_depth':20}), ("zero",""), ("noise", {'std_dev': 1} )], 1000)]) def test_refutation_dummy_outcome_refuter_internal_random_forest_binary_treatment(self, error_tolerence, estimator_method, transformations, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.binary_treatment_testsuite(num_samples,tests_to_run="atleast-one-common-cause") # As we run with only one common cause and one instrument variable we run with (?, 2) @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations"], [(0.01, "iv.instrumental_variable",[("neural_network",{'solver':'lbfgs', 'alpha':1e-5, 'hidden_layer_sizes':(5,2)}), ("zero",""), ("noise", {'std_dev': 1} )] )]) def test_refutation_dummy_outcome_refuter_internal_neural_network_continuous_treatment(self, error_tolerence, estimator_method, transformations): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.continuous_treatment_testsuite(tests_to_run="atleast-one-common-cause") @pytest.mark.parametrize(["error_tolerence","estimator_method","transformations","num_samples"], [(0.01, "backdoor.propensity_score_matching",[("neural_network",{'solver':'lbfgs', 'alpha':1e-5, 'hidden_layer_sizes':(5,2)}), ("zero",""), ("noise", {'std_dev': 1} )], 1000 )]) def test_refutation_dummy_outcome_refuter_internal_neural_network_binary_treatment(self, error_tolerence, estimator_method, transformations, num_samples): refuter_tester = TestRefuter(error_tolerence, estimator_method, "dummy_outcome_refuter", transformations=transformations) refuter_tester.binary_treatment_testsuite(num_samples=num_samples, tests_to_run="atleast-one-common-cause")
77.680412
208
0.641407
1,415
15,070
6.417668
0.081272
0.092501
0.151966
0.191609
0.962559
0.959806
0.959806
0.923907
0.903094
0.890981
0
0.014211
0.252887
15,070
194
209
77.680412
0.792344
0.011546
0
0.676829
0
0
0.20381
0.095782
0
0
0
0
0
1
0.128049
false
0
0.02439
0.006098
0.164634
0
0
0
0
null
0
0
1
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
7
fc33705d12ed5c4e545f2568b37e0d216e10f078
39
py
Python
test/self/empty.py
Bin-CI/vaapi-fits
9c43ea65f7fe99f11fa3c49bb14d30f5de09f010
[ "BSD-3-Clause" ]
19
2019-03-05T01:59:05.000Z
2022-01-11T15:31:49.000Z
test/self/empty.py
Bin-CI/vaapi-fits
9c43ea65f7fe99f11fa3c49bb14d30f5de09f010
[ "BSD-3-Clause" ]
213
2019-01-29T18:44:05.000Z
2022-03-30T05:57:04.000Z
test/self/empty.py
Bin-CI/vaapi-fits
9c43ea65f7fe99f11fa3c49bb14d30f5de09f010
[ "BSD-3-Clause" ]
26
2019-01-29T05:21:22.000Z
2022-02-09T00:57:35.000Z
import slash def test_empty(): pass
7.8
17
0.717949
6
39
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.205128
39
4
18
9.75
0.870968
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
true
0.333333
0.333333
0
0.666667
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
1
1
1
0
0
0
0
7
fc59129eed8d7f230d4eca06d4fe4f49d700157f
15,194
py
Python
notebooks/scripts/.ipynb_checkpoints/santa_fe-checkpoint.py
Jarino/pycgp
c3281c0deff3388cb7cfd79339b84391f6499ae1
[ "MIT" ]
4
2018-02-08T17:34:58.000Z
2021-09-20T01:37:32.000Z
notebooks/scripts/.ipynb_checkpoints/santa_fe-checkpoint.py
Jarino/pycgp
c3281c0deff3388cb7cfd79339b84391f6499ae1
[ "MIT" ]
1
2018-02-09T09:59:09.000Z
2018-02-09T10:52:26.000Z
notebooks/scripts/.ipynb_checkpoints/santa_fe-checkpoint.py
Jarino/pycgp
c3281c0deff3388cb7cfd79339b84391f6499ae1
[ "MIT" ]
1
2018-12-12T03:51:33.000Z
2018-12-12T03:51:33.000Z
from pycgp.benchmarks.santafe import PARAMS, EV_PARAMS, X, santafe_cost_function from pycgp.evolution import evolution from pycgp.counter import Counter import random import numpy as np from time import time import pandas as pd experiment_count = 0 y=None def run_experiment(params, ev_params, x, y): global experiment_count experiment_count += 1 print('Experiment #{}'.format(experiment_count)) start = time() rstat = [] n_better = [] n_worse = [] n_same = [] for i in range(0, 10): print(i, end=', ') result = evolution(PARAMS, EV_PARAMS, X, None) rstat.append([EV_PARAMS['cost_func'](y, individual.execute(X)) for individual in result['final']]) n_better.append(Counter.get().dict['g_better']) n_worse.append(Counter.get().dict['g_worse']) n_same.append(Counter.get().dict['g_same_as_parent']) #print('Best fitness: {}'.format(np.min(stats))) #print('mean and std of fitness of last generation: {}, {}'.format(np.mean(stats), np.std(stats))) #print('Mean and std of best fitness: {}, {}'.format(np.mean(np.min(stats, axis=1)), np.std(np.min(stats, axis=1)))) # best fitness, mean of last generation, std of last generation, mean of best individual, std of best individual results = [ np.min(rstat), np.mean(rstat), np.std(rstat), np.mean(np.min(rstat, axis=1)), np.std(np.min(rstat, axis=1)), np.sum(n_better), np.mean(n_better), np.sum(n_worse), np.mean(n_worse), np.sum(n_same), np.mean(n_same) ] print(results) end = time() print('wall time {}'.format(end-start)) return results from pycgp.mutation import point_mutation all_measurements = {} EV_PARAMS['gems'] = 0 EV_PARAMS['mutation'] = point_mutation EV_PARAMS['expire_gems'] = 0 # # POINT MUTATION # without gems # random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # POINT MUTATION # with gems, 5, expire 0 # EV_PARAMS['gems'] = 5 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # POINT MUTATION # with gems, 5, expire 30 # EV_PARAMS['gems'] = 5 EV_PARAMS['expire_gems'] = 30 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # POINT MUTATION # with gems, 10, expire 30 # EV_PARAMS['gems'] = 10 EV_PARAMS['expire_gems'] = 0 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # POINT MUTATION # with gems, 10, expire 0 # EV_PARAMS['gems'] = 10 EV_PARAMS['expire_gems'] = 30 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) df = pd.DataFrame.from_dict(all_measurements, orient='index') df.columns = ['best fitness', 'mean of last gen', 'std of last gen', 'mean of best individual', 'std of best indvidiual', 'g_better', 'g_better avg', 'g_worse', 'g_worse avg', 'g_same', 'g_same avg'] df.to_csv('out/santafe_pm.csv') ######################################################################### # # Single mutation, match all # ######################################################################### from pycgp.mutation import single_mutation from pycgp.gems import GemSM, MatchSMStrategy all_measurements = {} EV_PARAMS['gems'] = 0 EV_PARAMS['gem_type'] = GemSM EV_PARAMS['match_strategy'] = MatchSMStrategy EV_PARAMS['mutation'] = single_mutation EV_PARAMS['expire_gems'] = 0 # # SINGLE MUTATION # without gems # random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # SINGLE MUTATION # with gems, 5, expire 0 # EV_PARAMS['gems'] = 5 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # SINGLE MUTATION # with gems, 5, expire 30 # EV_PARAMS['gems'] = 5 EV_PARAMS['expire_gems'] = 30 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # with gems, 10, expire 0 # EV_PARAMS['gems'] = 10 EV_PARAMS['expire_gems'] = 0 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # with gems, 10, expire 30 # EV_PARAMS['gems'] = 10 EV_PARAMS['expire_gems'] = 30 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) df = pd.DataFrame.from_dict(all_measurements, orient='index') df.columns = ['best fitness', 'mean of last gen', 'std of last gen', 'mean of best individual', 'std of best indvidiual', 'g_better', 'g_better avg', 'g_worse', 'g_worse avg', 'g_same', 'g_same avg'] df.to_csv('out/santafe_sm_all.csv') ######################################################################### # # Single mutation, match active # ######################################################################### from pycgp.mutation import single_mutation from pycgp.gems import MatchByActiveStrategy all_measurements = {} EV_PARAMS['gems'] = 0 EV_PARAMS['gem_type'] = GemSM EV_PARAMS['match_strategy'] = MatchByActiveStrategy EV_PARAMS['mutation'] = single_mutation # # SINGLE MUTATION # without gems # random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # SINGLE MUTATION # with gems, 5, expire 0 # EV_PARAMS['gems'] = 5 EV_PARAMS['expire_gems'] = 0 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # SINGLE MUTATION # with gems, 5, expire 30 # EV_PARAMS['gems'] = 5 EV_PARAMS['expire_gems'] = 30 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # SINGLE MUTATION # with gems, 10, expire 30 # EV_PARAMS['gems'] = 10 EV_PARAMS['expire_gems'] = 0 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # SINGLE MUTATION # with gems, 10, expire 0 # EV_PARAMS['gems'] = 10 EV_PARAMS['expire_gems'] = 30 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) df = pd.DataFrame.from_dict(all_measurements, orient='index') df.columns = ['best fitness', 'mean of last gen', 'std of last gen', 'mean of best individual', 'std of best indvidiual', 'g_better', 'g_better avg', 'g_worse', 'g_worse avg', 'g_same', 'g_same avg'] df.to_csv('out/santafe_sm_active.csv') ######################################################################### # # Probabilistic mutation, match all # ######################################################################### from pycgp.mutation import probabilistic_mutation all_measurements = {} EV_PARAMS['gems'] = 0 EV_PARAMS['gem_type'] = GemSM EV_PARAMS['match_strategy'] = MatchSMStrategy EV_PARAMS['mutation'] = probabilistic_mutation # # without gems # random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # with gems, 5, expire 0 # EV_PARAMS['gems'] = 5 EV_PARAMS['expire_gems'] = 0 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # with gems, 5, expire 30 # EV_PARAMS['gems'] = 5 EV_PARAMS['expire_gems'] = 30 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # with gems, 10, expire 30 # EV_PARAMS['gems'] = 10 EV_PARAMS['expire_gems'] = 0 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # with gems, 10, expire 0 # EV_PARAMS['gems'] = 10 EV_PARAMS['expire_gems'] = 30 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) df = pd.DataFrame.from_dict(all_measurements, orient='index') df.columns = ['best fitness', 'mean of last gen', 'std of last gen', 'mean of best individual', 'std of best indvidiual', 'g_better', 'g_better avg', 'g_worse', 'g_worse avg', 'g_same', 'g_same avg'] df.to_csv('out/santafe_probm_all.csv') ######################################################################### # # Probabilistic mutation, match active # ######################################################################### from pycgp.mutation import probabilistic_mutation all_measurements = {} EV_PARAMS['gems'] = 0 EV_PARAMS['gem_type'] = GemSM EV_PARAMS['match_strategy'] = MatchByActiveStrategy EV_PARAMS['mutation'] = probabilistic_mutation # # without gems # random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,0,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # with gems, 5, expire 0 # EV_PARAMS['gems'] = 5 EV_PARAMS['expire_gems'] = 0 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,5,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # with gems, 5, expire 30 # EV_PARAMS['gems'] = 5 EV_PARAMS['expire_gems'] = 30 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,5,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # with gems, 10, expire 30 # EV_PARAMS['gems'] = 10 EV_PARAMS['expire_gems'] = 0 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,10,0'] = run_experiment(PARAMS, EV_PARAMS, X, y) # # with gems, 10, expire 0 # EV_PARAMS['gems'] = 10 EV_PARAMS['expire_gems'] = 30 random.seed(1) PARAMS['n_cols'] = 10 all_measurements['10,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 50 all_measurements['50,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) random.seed(1) PARAMS['n_cols'] = 100 all_measurements['100,10,30'] = run_experiment(PARAMS, EV_PARAMS, X, y) df = pd.DataFrame.from_dict(all_measurements, orient='index') df.columns = ['best fitness', 'mean of last gen', 'std of last gen', 'mean of best individual', 'std of best indvidiual', 'g_better', 'g_better avg', 'g_worse', 'g_worse avg', 'g_same', 'g_same avg'] df.to_csv('out/santafe_probm_active.csv')
25.450586
121
0.672239
2,401
15,194
4.052478
0.043732
0.112641
0.11223
0.120247
0.902158
0.889414
0.873998
0.860843
0.860843
0.856321
0
0.057959
0.126761
15,194
596
122
25.493289
0.675384
0.082533
0
0.874286
0
0
0.178011
0.007546
0
0
0
0
0
1
0.002857
false
0
0.04
0
0.045714
0.011429
0
0
0
null
0
0
0
1
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
7
fc737465e85d6143b2252183acb00f0998fb4469
32,163
py
Python
tests/providers/captured_responses.py
cauethenorio/django-simplecep
acab8a99fe3df8c6a2f01909c07fa36b1ea2d922
[ "MIT" ]
3
2020-10-18T16:29:32.000Z
2021-09-22T12:10:19.000Z
tests/providers/captured_responses.py
cauethenorio/django-simplecep
acab8a99fe3df8c6a2f01909c07fa36b1ea2d922
[ "MIT" ]
6
2019-11-26T01:18:43.000Z
2022-02-10T12:50:16.000Z
tests/providers/captured_responses.py
cauethenorio/django-simplecep
acab8a99fe3df8c6a2f01909c07fa36b1ea2d922
[ "MIT" ]
1
2020-03-31T03:52:13.000Z
2020-03-31T03:52:13.000Z
# This file was generated by the "capture_real_responses.py" script. # On Wed, 20 Nov 2019 19:34:18 +0000. # # To update it run: # python -m tests.providers.capture_real_responses captured_responses = [ { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>01001000</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"><return><bairro>S\xe9</bairro><cep>01001000</cep><cidade>S\xe3o Paulo</cidade><complemento2>- lado \xedmpar</complemento2><end>Pra\xe7a da S\xe9</end><uf>SP</uf></return></ns2:consultaCEPResponse></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=01001000&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"resultado":"1","resultado_txt":"sucesso - cep completo","uf":"SP","cidade":"S\\u00e3o Paulo","bairro":"S\\u00e9","tipo_logradouro":"Pra\\u00e7a","logradouro":"da S\\u00e9"}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/01001000/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": { "type": "success", "data": b'{\n "cep": "01001-000",\n "logradouro": "Pra\\u00e7a da S\\u00e9",\n "complemento": "lado \\u00edmpar",\n "bairro": "S\\u00e9",\n "localidade": "S\\u00e3o Paulo",\n "uf": "SP",\n "unidade": "",\n "ibge": "3550308",\n "gia": "1004"\n}', }, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>57010240</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"><return><bairro>Prado</bairro><cep>57010240</cep><cidade>Macei\xf3</cidade><complemento2></complemento2><end>Rua Desembargador Inoc\xeancio Lins</end><uf>AL</uf></return></ns2:consultaCEPResponse></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=57010240&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"resultado":"1","resultado_txt":"sucesso - cep completo","uf":"AL","cidade":"Macei\\u00f3","bairro":"Prado","tipo_logradouro":"Rua","logradouro":"Desembargador Inoc\\u00eancio Lins"}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/57010240/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": { "type": "success", "data": b'{\n "cep": "57010-240",\n "logradouro": "Rua Desembargador Inoc\\u00eancio Lins",\n "complemento": "",\n "bairro": "Prado",\n "localidade": "Macei\\u00f3",\n "uf": "AL",\n "unidade": "",\n "ibge": "2704302",\n "gia": ""\n}', }, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>18170000</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"><return><bairro></bairro><cep>18170000</cep><cidade>Piedade</cidade><complemento2></complemento2><end></end><uf>SP</uf></return></ns2:consultaCEPResponse></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=18170000&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"resultado":"2","resultado_txt":"sucesso - cep \\u00fanico","uf":"SP","cidade":"Piedade","bairro":"","tipo_logradouro":"","logradouro":"","debug":" - encontrado via search_db cep unico - "}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/18170000/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": { "type": "success", "data": b'{\n "cep": "18170-000",\n "logradouro": "",\n "complemento": "",\n "bairro": "",\n "localidade": "Piedade",\n "uf": "SP",\n "unidade": "",\n "ibge": "3537800",\n "gia": "5265"\n}', }, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>78175000</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"><return><bairro></bairro><cep>78175000</cep><cidade>Pocon\xe9</cidade><complemento2></complemento2><end></end><uf>MT</uf></return></ns2:consultaCEPResponse></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=78175000&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"resultado":"2","resultado_txt":"sucesso - cep \\u00fanico","uf":"MT","cidade":"Pocon\\u00e9","bairro":"","tipo_logradouro":"","logradouro":"","debug":" - encontrado via search_db cep unico - "}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/78175000/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": { "type": "success", "data": b'{\n "cep": "78175-000",\n "logradouro": "",\n "complemento": "",\n "bairro": "",\n "localidade": "Pocon\\u00e9",\n "uf": "MT",\n "unidade": "",\n "ibge": "5106505",\n "gia": ""\n}', }, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>63200970</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"><return><bairro>Centro</bairro><cep>63200970</cep><cidade>Miss\xe3o Velha</cidade><complemento2></complemento2><end>Rua Jos\xe9 Sobreira da Cruz 271</end><uf>CE</uf></return></ns2:consultaCEPResponse></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=63200970&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"debug":" - nao encontrado via search_db cep unico - ","resultado":"1","resultado_txt":"sucesso - cep completo","uf":"CE","cidade":"Miss\\u00e3o Velha","bairro":"Centro\\u00a0","tipo_logradouro":"Rua","logradouro":"Jos\\u00e9 Sobreira da Cruz, 271 "}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/63200970/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": { "type": "success", "data": b'{\n "cep": "63200-970",\n "logradouro": "Rua Jos\\u00e9 Sobreira da Cruz 271",\n "complemento": "",\n "bairro": "Centro",\n "localidade": "Miss\\u00e3o Velha",\n "uf": "CE",\n "unidade": "",\n "ibge": "2308401",\n "gia": ""\n}', }, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>69096970</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"><return><bairro>Cidade Nova</bairro><cep>69096970</cep><cidade>Manaus</cidade><complemento2></complemento2><end>Avenida Noel Nutels 1350</end><uf>AM</uf></return></ns2:consultaCEPResponse></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=69096970&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"debug":" - nao encontrado via search_db cep unico - ","resultado":"1","resultado_txt":"sucesso - cep completo","uf":"AM","cidade":"Manaus","bairro":"Cidade Nova\\u00a0","tipo_logradouro":"Avenida","logradouro":"Noel Nutels, 1350 "}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/69096970/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": { "type": "success", "data": b'{\n "cep": "69096-970",\n "logradouro": "Avenida Noel Nutels 1350",\n "complemento": "",\n "bairro": "Cidade Nova",\n "localidade": "Manaus",\n "uf": "AM",\n "unidade": "",\n "ibge": "1302603",\n "gia": ""\n}', }, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>20010974</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"><return><bairro>Centro</bairro><cep>20010974</cep><cidade>Rio de Janeiro</cidade><complemento2></complemento2><end>Rua Primeiro de Mar\xe7o 64</end><uf>RJ</uf></return></ns2:consultaCEPResponse></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=20010974&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"debug":" - nao encontrado via search_db cep unico - ","resultado":"1","resultado_txt":"sucesso - cep completo","uf":"RJ","cidade":"Rio de Janeiro","bairro":"Centro\\u00a0","tipo_logradouro":"Rua","logradouro":"Primeiro de Mar\\u00e7o, 64 "}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/20010974/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": { "type": "success", "data": b'{\n "cep": "20010-974",\n "logradouro": "Rua Primeiro de Mar\\u00e7o",\n "complemento": "64",\n "bairro": "Centro",\n "localidade": "Rio de Janeiro",\n "uf": "RJ",\n "unidade": "",\n "ibge": "3304557",\n "gia": ""\n}', }, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>96010900</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"><return><bairro>Centro</bairro><cep>96010900</cep><cidade>Pelotas</cidade><complemento2></complemento2><end>Rua Tiradentes 2515</end><uf>RS</uf></return></ns2:consultaCEPResponse></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=96010900&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"debug":" - nao encontrado via search_db cep unico - ","resultado":"1","resultado_txt":"sucesso - cep completo","uf":"RS","cidade":"Pelotas","bairro":"Centro\\u00a0","tipo_logradouro":"Rua","logradouro":"Tiradentes, 2515 "}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/96010900/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": { "type": "success", "data": b'{\n "cep": "96010-900",\n "logradouro": "Rua Tiradentes",\n "complemento": "2515",\n "bairro": "Centro",\n "localidade": "Pelotas",\n "uf": "RS",\n "unidade": "",\n "ibge": "4314407",\n "gia": ""\n}', }, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>38101990</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"><return><bairro></bairro><cep>38101990</cep><cidade>Baixa (Uberaba)</cidade><complemento2></complemento2><end>Rua Bas\xedlio Eug\xeanio dos Santos</end><uf>MG</uf></return></ns2:consultaCEPResponse></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=38101990&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"debug":" - nao encontrado via search_db cep unico - ","resultado":"1","resultado_txt":"sucesso - cep completo","uf":"MG - Distrito","cidade":"Baixa (Uberaba)","bairro":"\\u00a0","tipo_logradouro":"Rua","logradouro":"Bas\\u00edlio Eug\\u00eanio dos Santos "}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/38101990/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": { "type": "success", "data": b'{\n "cep": "38101-990",\n "logradouro": "Rua Bas\\u00edlio Eug\\u00eanio dos Santos",\n "complemento": "",\n "bairro": "Baixa",\n "localidade": "Uberaba",\n "uf": "MG",\n "unidade": "",\n "ibge": "3170107",\n "gia": ""\n}', }, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>76840000</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"><return><bairro></bairro><cep>76840000</cep><cidade>Jaci Paran\xe1 (Porto Velho)</cidade><complemento2></complemento2><end></end><uf>RO</uf></return></ns2:consultaCEPResponse></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=76840000&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"debug":" - nao encontrado via search_db cep unico - ","resultado":"2","resultado_txt":"sucesso - cep \\u00fanico","uf":"RO - Distrito","cidade":"Jaci Paran\\u00e1 (Porto Velho)","bairro":"\\u00a0","tipo_logradouro":"","logradouro":""}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/76840000/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": { "type": "success", "data": b'{\n "cep": "76840-000",\n "logradouro": "",\n "complemento": "",\n "bairro": "",\n "localidade": "Jaci Paran\\u00e1 (Porto Velho)",\n "uf": "RO",\n "unidade": "",\n "ibge": "1100205",\n "gia": ""\n}', }, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>86055991</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"><return><bairro></bairro><cep>86055991</cep><cidade>Londrina</cidade><complemento2></complemento2><end>Rodovia M\xe1bio Gon\xe7alves Palhano, s/n</end><uf>PR</uf></return></ns2:consultaCEPResponse></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=86055991&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"debug":" - nao encontrado via search_db cep unico - ","resultado":"1","resultado_txt":"sucesso - cep completo","uf":"PR","cidade":"Londrina","bairro":"\\u00a0","tipo_logradouro":"Rodovia","logradouro":"M\\u00e1bio Gon\\u00e7alves Palhano, s\\/n "}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/86055991/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": { "type": "success", "data": b'{\n "cep": "86055-991",\n "logradouro": "Rodovia M\\u00e1bio Gon\\u00e7alves Palhano",\n "complemento": "s/n",\n "bairro": "",\n "localidade": "Londrina",\n "uf": "PR",\n "unidade": "",\n "ibge": "4113700",\n "gia": ""\n}', }, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>00000000</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "error", "status": 500, "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>CEP INV\xc1LIDO</faultstring><detail><ns2:SigepClienteException xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/">CEP INV\xc1LIDO</ns2:SigepClienteException></detail></soap:Fault></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=00000000&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"debug":" - nao encontrado via search_db cep unico - ","resultado":"0","resultado_txt":"sucesso - cep n\\u00e3o encontrado","uf":"","cidade":"","bairro":"","tipo_logradouro":"","logradouro":""}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/00000000/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": {"type": "success", "data": b'{\n "erro": true\n}'}, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>11111111</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "error", "status": 500, "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>CEP INV\xc1LIDO</faultstring><detail><ns2:SigepClienteException xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/">CEP INV\xc1LIDO</ns2:SigepClienteException></detail></soap:Fault></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=11111111&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"debug":" - nao encontrado via search_db cep unico - ","resultado":"0","resultado_txt":"sucesso - cep n\\u00e3o encontrado","uf":"","cidade":"","bairro":"","tipo_logradouro":"","logradouro":""}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/11111111/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": {"type": "success", "data": b'{\n "erro": true\n}'}, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>99999999</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "error", "status": 500, "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>CEP INV\xc1LIDO</faultstring><detail><ns2:SigepClienteException xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/">CEP INV\xc1LIDO</ns2:SigepClienteException></detail></soap:Fault></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=99999999&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"debug":" - nao encontrado via search_db cep unico - ","resultado":"0","resultado_txt":"sucesso - cep n\\u00e3o encontrado","uf":"","cidade":"","bairro":"","tipo_logradouro":"","logradouro":""}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/99999999/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": {"type": "success", "data": b'{\n "erro": true\n}'}, }, { "request": { "full_url": "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente", "method": "POST", "headers": {}, "data": bytearray( b'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">\n <soapenv:Header/>\n <soapenv:Body>\n <cli:consultaCEP>\n <cep>01111110</cep>\n </cli:consultaCEP>\n </soapenv:Body>\n </soapenv:Envelope>' ), }, "response": { "type": "success", "data": b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"/></soap:Body></soap:Envelope>', }, }, { "request": { "full_url": "http://cep.republicavirtual.com.br/web_cep.php?cep=01111110&formato=json", "method": "GET", "headers": {"Accept": "application/json"}, "data": None, }, "response": { "type": "success", "data": b'{"debug":" - nao encontrado via search_db cep unico - ","resultado":"0","resultado_txt":"sucesso - cep n\\u00e3o encontrado","uf":"","cidade":"","bairro":"","tipo_logradouro":"","logradouro":""}', }, }, { "request": { "full_url": "https://viacep.com.br/ws/01111110/json/unicode/", "method": "GET", "headers": {}, "data": None, }, "response": {"type": "success", "data": b'{\n "erro": true\n}'}, }, ]
56.327496
424
0.523117
3,273
32,163
5.107547
0.077605
0.022432
0.037686
0.057785
0.84752
0.824131
0.810911
0.800861
0.783514
0.775618
0
0.038748
0.270622
32,163
570
425
56.426316
0.673857
0.005254
0
0.543517
1
0.12611
0.718198
0.126551
0
0
0
0
0
1
0
false
0
0
0
0
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
1
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
fc7cd664e8b02837045ae83cd7514d3c76c6d7c2
131,101
py
Python
sdks/python/http_client/v1/polyaxon_sdk/api/projects_v1_api.py
gideonbros/polyaxon
482a756b781e3cb749cc871a275689d1ad16c028
[ "Apache-2.0" ]
null
null
null
sdks/python/http_client/v1/polyaxon_sdk/api/projects_v1_api.py
gideonbros/polyaxon
482a756b781e3cb749cc871a275689d1ad16c028
[ "Apache-2.0" ]
null
null
null
sdks/python/http_client/v1/polyaxon_sdk/api/projects_v1_api.py
gideonbros/polyaxon
482a756b781e3cb749cc871a275689d1ad16c028
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # 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. # coding: utf-8 """ Polyaxon SDKs and REST API specification. Polyaxon SDKs and REST API specification. # noqa: E501 The version of the OpenAPI document: 1.10.1 Contact: contact@polyaxon.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from polyaxon_sdk.api_client import ApiClient from polyaxon_sdk.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError ) class ProjectsV1Api(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def archive_project(self, owner, name, **kwargs): # noqa: E501 """Archive project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.archive_project(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.archive_project_with_http_info(owner, name, **kwargs) # noqa: E501 def archive_project_with_http_info(self, owner, name, **kwargs): # noqa: E501 """Archive project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.archive_project_with_http_info(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'name' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method archive_project" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `archive_project`") # noqa: E501 # verify the required parameter 'name' is set if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501 local_var_params['name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `name` when calling `archive_project`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{name}/archive', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def bookmark_project(self, owner, name, **kwargs): # noqa: E501 """Bookmark project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.bookmark_project(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.bookmark_project_with_http_info(owner, name, **kwargs) # noqa: E501 def bookmark_project_with_http_info(self, owner, name, **kwargs): # noqa: E501 """Bookmark project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.bookmark_project_with_http_info(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'name' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method bookmark_project" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `bookmark_project`") # noqa: E501 # verify the required parameter 'name' is set if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501 local_var_params['name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `name` when calling `bookmark_project`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{name}/bookmark', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def create_project(self, owner, body, **kwargs): # noqa: E501 """Create new project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_project(owner, body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param V1Project body: Project body (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1Project If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.create_project_with_http_info(owner, body, **kwargs) # noqa: E501 def create_project_with_http_info(self, owner, body, **kwargs): # noqa: E501 """Create new project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_project_with_http_info(owner, body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param V1Project body: Project body (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1Project, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'body' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_project" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `create_project`") # noqa: E501 # verify the required parameter 'body' is set if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_project`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/projects/create', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1Project', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def delete_project(self, owner, name, **kwargs): # noqa: E501 """Delete project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_project(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.delete_project_with_http_info(owner, name, **kwargs) # noqa: E501 def delete_project_with_http_info(self, owner, name, **kwargs): # noqa: E501 """Delete project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_project_with_http_info(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'name' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_project" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `delete_project`") # noqa: E501 # verify the required parameter 'name' is set if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501 local_var_params['name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `name` when calling `delete_project`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{name}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def disable_project_ci(self, owner, name, **kwargs): # noqa: E501 """Disbale project CI # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.disable_project_ci(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.disable_project_ci_with_http_info(owner, name, **kwargs) # noqa: E501 def disable_project_ci_with_http_info(self, owner, name, **kwargs): # noqa: E501 """Disbale project CI # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.disable_project_ci_with_http_info(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'name' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method disable_project_ci" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `disable_project_ci`") # noqa: E501 # verify the required parameter 'name' is set if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501 local_var_params['name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `name` when calling `disable_project_ci`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{name}/ci', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def enable_project_ci(self, owner, name, **kwargs): # noqa: E501 """Enable project CI # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.enable_project_ci(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.enable_project_ci_with_http_info(owner, name, **kwargs) # noqa: E501 def enable_project_ci_with_http_info(self, owner, name, **kwargs): # noqa: E501 """Enable project CI # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.enable_project_ci_with_http_info(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'name' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method enable_project_ci" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `enable_project_ci`") # noqa: E501 # verify the required parameter 'name' is set if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501 local_var_params['name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `name` when calling `enable_project_ci`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{name}/ci', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_project(self, owner, name, **kwargs): # noqa: E501 """Get project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_project(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1Project If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_project_with_http_info(owner, name, **kwargs) # noqa: E501 def get_project_with_http_info(self, owner, name, **kwargs): # noqa: E501 """Get project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_project_with_http_info(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1Project, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'name' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_project" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `get_project`") # noqa: E501 # verify the required parameter 'name' is set if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501 local_var_params['name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `name` when calling `get_project`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{name}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1Project', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_project_activities(self, owner, name, **kwargs): # noqa: E501 """Get project activities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_project_activities(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Entity managing the resource (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param str mode: Mode of the search. :param bool no_page: No pagination. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1ListActivitiesResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_project_activities_with_http_info(owner, name, **kwargs) # noqa: E501 def get_project_activities_with_http_info(self, owner, name, **kwargs): # noqa: E501 """Get project activities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_project_activities_with_http_info(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Entity managing the resource (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param str mode: Mode of the search. :param bool no_page: No pagination. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1ListActivitiesResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'name', 'offset', 'limit', 'sort', 'query', 'mode', 'no_page' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_project_activities" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `get_project_activities`") # noqa: E501 # verify the required parameter 'name' is set if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501 local_var_params['name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `name` when calling `get_project_activities`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 query_params = [] if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 query_params.append(('sort', local_var_params['sort'])) # noqa: E501 if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 if 'mode' in local_var_params and local_var_params['mode'] is not None: # noqa: E501 query_params.append(('mode', local_var_params['mode'])) # noqa: E501 if 'no_page' in local_var_params and local_var_params['no_page'] is not None: # noqa: E501 query_params.append(('no_page', local_var_params['no_page'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{name}/activities', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1ListActivitiesResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_project_settings(self, owner, name, **kwargs): # noqa: E501 """Get Project settings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_project_settings(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1ProjectSettings If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_project_settings_with_http_info(owner, name, **kwargs) # noqa: E501 def get_project_settings_with_http_info(self, owner, name, **kwargs): # noqa: E501 """Get Project settings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_project_settings_with_http_info(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1ProjectSettings, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'name' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_project_settings" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `get_project_settings`") # noqa: E501 # verify the required parameter 'name' is set if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501 local_var_params['name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `name` when calling `get_project_settings`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{name}/settings', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1ProjectSettings', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_project_stats(self, owner, name, **kwargs): # noqa: E501 """Get project stats # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_project_stats(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Entity managing the resource (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param str kind: Stats Kind. :param str aggregate: Stats aggregate. :param str groupby: Stats group. :param str trunc: Stats trunc. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: object If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_project_stats_with_http_info(owner, name, **kwargs) # noqa: E501 def get_project_stats_with_http_info(self, owner, name, **kwargs): # noqa: E501 """Get project stats # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_project_stats_with_http_info(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Entity managing the resource (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param str kind: Stats Kind. :param str aggregate: Stats aggregate. :param str groupby: Stats group. :param str trunc: Stats trunc. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(object, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'name', 'offset', 'limit', 'sort', 'query', 'kind', 'aggregate', 'groupby', 'trunc' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_project_stats" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `get_project_stats`") # noqa: E501 # verify the required parameter 'name' is set if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501 local_var_params['name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `name` when calling `get_project_stats`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 query_params = [] if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 query_params.append(('sort', local_var_params['sort'])) # noqa: E501 if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 if 'kind' in local_var_params and local_var_params['kind'] is not None: # noqa: E501 query_params.append(('kind', local_var_params['kind'])) # noqa: E501 if 'aggregate' in local_var_params and local_var_params['aggregate'] is not None: # noqa: E501 query_params.append(('aggregate', local_var_params['aggregate'])) # noqa: E501 if 'groupby' in local_var_params and local_var_params['groupby'] is not None: # noqa: E501 query_params.append(('groupby', local_var_params['groupby'])) # noqa: E501 if 'trunc' in local_var_params and local_var_params['trunc'] is not None: # noqa: E501 query_params.append(('trunc', local_var_params['trunc'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{name}/stats', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_archived_projects(self, user, **kwargs): # noqa: E501 """List archived projects for user # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_archived_projects(user, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str user: User (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param bool no_page: No pagination. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1ListProjectsResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_archived_projects_with_http_info(user, **kwargs) # noqa: E501 def list_archived_projects_with_http_info(self, user, **kwargs): # noqa: E501 """List archived projects for user # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_archived_projects_with_http_info(user, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str user: User (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param bool no_page: No pagination. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1ListProjectsResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'user', 'offset', 'limit', 'sort', 'query', 'no_page' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_archived_projects" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'user' is set if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 local_var_params['user'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `list_archived_projects`") # noqa: E501 collection_formats = {} path_params = {} if 'user' in local_var_params: path_params['user'] = local_var_params['user'] # noqa: E501 query_params = [] if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 query_params.append(('sort', local_var_params['sort'])) # noqa: E501 if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 if 'no_page' in local_var_params and local_var_params['no_page'] is not None: # noqa: E501 query_params.append(('no_page', local_var_params['no_page'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/archives/{user}/projects', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1ListProjectsResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_bookmarked_projects(self, user, **kwargs): # noqa: E501 """List bookmarked projects for user # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_bookmarked_projects(user, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str user: User (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param bool no_page: No pagination. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1ListBookmarksResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_bookmarked_projects_with_http_info(user, **kwargs) # noqa: E501 def list_bookmarked_projects_with_http_info(self, user, **kwargs): # noqa: E501 """List bookmarked projects for user # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_bookmarked_projects_with_http_info(user, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str user: User (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param bool no_page: No pagination. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1ListBookmarksResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'user', 'offset', 'limit', 'sort', 'query', 'no_page' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_bookmarked_projects" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'user' is set if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 local_var_params['user'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `list_bookmarked_projects`") # noqa: E501 collection_formats = {} path_params = {} if 'user' in local_var_params: path_params['user'] = local_var_params['user'] # noqa: E501 query_params = [] if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 query_params.append(('sort', local_var_params['sort'])) # noqa: E501 if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 if 'no_page' in local_var_params and local_var_params['no_page'] is not None: # noqa: E501 query_params.append(('no_page', local_var_params['no_page'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/bookmarks/{user}/projects', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1ListBookmarksResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_project_names(self, owner, **kwargs): # noqa: E501 """List project names # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_project_names(owner, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param bool no_page: No pagination. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1ListProjectsResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_project_names_with_http_info(owner, **kwargs) # noqa: E501 def list_project_names_with_http_info(self, owner, **kwargs): # noqa: E501 """List project names # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_project_names_with_http_info(owner, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param bool no_page: No pagination. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1ListProjectsResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'offset', 'limit', 'sort', 'query', 'no_page' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_project_names" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `list_project_names`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 query_params = [] if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 query_params.append(('sort', local_var_params['sort'])) # noqa: E501 if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 if 'no_page' in local_var_params and local_var_params['no_page'] is not None: # noqa: E501 query_params.append(('no_page', local_var_params['no_page'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/projects/names', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1ListProjectsResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_projects(self, owner, **kwargs): # noqa: E501 """List projects # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_projects(owner, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param bool no_page: No pagination. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1ListProjectsResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_projects_with_http_info(owner, **kwargs) # noqa: E501 def list_projects_with_http_info(self, owner, **kwargs): # noqa: E501 """List projects # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_projects_with_http_info(owner, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param int offset: Pagination offset. :param int limit: Limit size. :param str sort: Sort to order the search. :param str query: Query filter the search. :param bool no_page: No pagination. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1ListProjectsResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'offset', 'limit', 'sort', 'query', 'no_page' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_projects" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `list_projects`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 query_params = [] if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 query_params.append(('sort', local_var_params['sort'])) # noqa: E501 if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 if 'no_page' in local_var_params and local_var_params['no_page'] is not None: # noqa: E501 query_params.append(('no_page', local_var_params['no_page'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/projects/list', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1ListProjectsResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def patch_project(self, owner, project_name, body, **kwargs): # noqa: E501 """Patch project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_project(owner, project_name, body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str project_name: Required name (required) :param V1Project body: Project body (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1Project If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.patch_project_with_http_info(owner, project_name, body, **kwargs) # noqa: E501 def patch_project_with_http_info(self, owner, project_name, body, **kwargs): # noqa: E501 """Patch project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_project_with_http_info(owner, project_name, body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str project_name: Required name (required) :param V1Project body: Project body (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1Project, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'project_name', 'body' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method patch_project" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `patch_project`") # noqa: E501 # verify the required parameter 'project_name' is set if self.api_client.client_side_validation and ('project_name' not in local_var_params or # noqa: E501 local_var_params['project_name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `project_name` when calling `patch_project`") # noqa: E501 # verify the required parameter 'body' is set if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `patch_project`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'project_name' in local_var_params: path_params['project.name'] = local_var_params['project_name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{project.name}', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1Project', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def patch_project_settings(self, owner, project, body, **kwargs): # noqa: E501 """Patch project settings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_project_settings(owner, project, body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str project: Project name (required) :param V1ProjectSettings body: Project settings body (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1ProjectSettings If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.patch_project_settings_with_http_info(owner, project, body, **kwargs) # noqa: E501 def patch_project_settings_with_http_info(self, owner, project, body, **kwargs): # noqa: E501 """Patch project settings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_project_settings_with_http_info(owner, project, body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str project: Project name (required) :param V1ProjectSettings body: Project settings body (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1ProjectSettings, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'project', 'body' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method patch_project_settings" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `patch_project_settings`") # noqa: E501 # verify the required parameter 'project' is set if self.api_client.client_side_validation and ('project' not in local_var_params or # noqa: E501 local_var_params['project'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `project` when calling `patch_project_settings`") # noqa: E501 # verify the required parameter 'body' is set if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `patch_project_settings`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'project' in local_var_params: path_params['project'] = local_var_params['project'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{project}/settings', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1ProjectSettings', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def restore_project(self, owner, name, **kwargs): # noqa: E501 """Restore project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.restore_project(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.restore_project_with_http_info(owner, name, **kwargs) # noqa: E501 def restore_project_with_http_info(self, owner, name, **kwargs): # noqa: E501 """Restore project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.restore_project_with_http_info(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'name' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method restore_project" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `restore_project`") # noqa: E501 # verify the required parameter 'name' is set if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501 local_var_params['name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `name` when calling `restore_project`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{name}/restore', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def unbookmark_project(self, owner, name, **kwargs): # noqa: E501 """Unbookmark project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.unbookmark_project(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.unbookmark_project_with_http_info(owner, name, **kwargs) # noqa: E501 def unbookmark_project_with_http_info(self, owner, name, **kwargs): # noqa: E501 """Unbookmark project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.unbookmark_project_with_http_info(owner, name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str name: Component under namesapce (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'name' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method unbookmark_project" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `unbookmark_project`") # noqa: E501 # verify the required parameter 'name' is set if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501 local_var_params['name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `name` when calling `unbookmark_project`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{name}/unbookmark', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def update_project(self, owner, project_name, body, **kwargs): # noqa: E501 """Update project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_project(owner, project_name, body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str project_name: Required name (required) :param V1Project body: Project body (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1Project If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.update_project_with_http_info(owner, project_name, body, **kwargs) # noqa: E501 def update_project_with_http_info(self, owner, project_name, body, **kwargs): # noqa: E501 """Update project # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_project_with_http_info(owner, project_name, body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str project_name: Required name (required) :param V1Project body: Project body (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1Project, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'project_name', 'body' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method update_project" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `update_project`") # noqa: E501 # verify the required parameter 'project_name' is set if self.api_client.client_side_validation and ('project_name' not in local_var_params or # noqa: E501 local_var_params['project_name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `project_name` when calling `update_project`") # noqa: E501 # verify the required parameter 'body' is set if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `update_project`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'project_name' in local_var_params: path_params['project.name'] = local_var_params['project_name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{project.name}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1Project', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def update_project_settings(self, owner, project, body, **kwargs): # noqa: E501 """Update project settings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_project_settings(owner, project, body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str project: Project name (required) :param V1ProjectSettings body: Project settings body (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: V1ProjectSettings If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.update_project_settings_with_http_info(owner, project, body, **kwargs) # noqa: E501 def update_project_settings_with_http_info(self, owner, project, body, **kwargs): # noqa: E501 """Update project settings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_project_settings_with_http_info(owner, project, body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str project: Project name (required) :param V1ProjectSettings body: Project settings body (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(V1ProjectSettings, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'project', 'body' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method update_project_settings" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `update_project_settings`") # noqa: E501 # verify the required parameter 'project' is set if self.api_client.client_side_validation and ('project' not in local_var_params or # noqa: E501 local_var_params['project'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `project` when calling `update_project_settings`") # noqa: E501 # verify the required parameter 'body' is set if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `update_project_settings`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'project' in local_var_params: path_params['project'] = local_var_params['project'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{project}/settings', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1ProjectSettings', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def upload_project_artifact(self, owner, project, uuid, uploadfile, **kwargs): # noqa: E501 """Upload artifact to a store via project access # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.upload_project_artifact(owner, project, uuid, uploadfile, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str project: Project having access to the store (required) :param str uuid: Unique integer identifier of the entity (required) :param file uploadfile: The file to upload. (required) :param str path: File path query params. :param bool overwrite: File path query params. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.upload_project_artifact_with_http_info(owner, project, uuid, uploadfile, **kwargs) # noqa: E501 def upload_project_artifact_with_http_info(self, owner, project, uuid, uploadfile, **kwargs): # noqa: E501 """Upload artifact to a store via project access # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.upload_project_artifact_with_http_info(owner, project, uuid, uploadfile, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str owner: Owner of the namespace (required) :param str project: Project having access to the store (required) :param str uuid: Unique integer identifier of the entity (required) :param file uploadfile: The file to upload. (required) :param str path: File path query params. :param bool overwrite: File path query params. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'owner', 'project', 'uuid', 'uploadfile', 'path', 'overwrite' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method upload_project_artifact" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'owner' is set if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 local_var_params['owner'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `owner` when calling `upload_project_artifact`") # noqa: E501 # verify the required parameter 'project' is set if self.api_client.client_side_validation and ('project' not in local_var_params or # noqa: E501 local_var_params['project'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `project` when calling `upload_project_artifact`") # noqa: E501 # verify the required parameter 'uuid' is set if self.api_client.client_side_validation and ('uuid' not in local_var_params or # noqa: E501 local_var_params['uuid'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `uuid` when calling `upload_project_artifact`") # noqa: E501 # verify the required parameter 'uploadfile' is set if self.api_client.client_side_validation and ('uploadfile' not in local_var_params or # noqa: E501 local_var_params['uploadfile'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `uploadfile` when calling `upload_project_artifact`") # noqa: E501 collection_formats = {} path_params = {} if 'owner' in local_var_params: path_params['owner'] = local_var_params['owner'] # noqa: E501 if 'project' in local_var_params: path_params['project'] = local_var_params['project'] # noqa: E501 if 'uuid' in local_var_params: path_params['uuid'] = local_var_params['uuid'] # noqa: E501 query_params = [] if 'path' in local_var_params and local_var_params['path'] is not None: # noqa: E501 query_params.append(('path', local_var_params['path'])) # noqa: E501 if 'overwrite' in local_var_params and local_var_params['overwrite'] is not None: # noqa: E501 query_params.append(('overwrite', local_var_params['overwrite'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} if 'uploadfile' in local_var_params: local_var_files['uploadfile'] = local_var_params['uploadfile'] # noqa: E501 body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['multipart/form-data']) # noqa: E501 # Authentication setting auth_settings = ['ApiKey'] # noqa: E501 return self.api_client.call_api( '/api/v1/{owner}/{project}/artifacts/{uuid}/upload', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
46.522711
131
0.587227
14,602
131,101
5.041638
0.019586
0.053791
0.085957
0.02695
0.971855
0.970469
0.966367
0.962333
0.955011
0.952851
0
0.016873
0.335444
131,101
2,817
132
46.539226
0.828107
0.420805
0
0.785053
0
0
0.175397
0.039131
0
0
0
0
0
1
0.030605
false
0
0.003559
0
0.064769
0
0
0
0
null
0
0
0
1
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
7
fc886b148ca7d06bef895e6722bca063cd6305ca
70
py
Python
homeworks/yan_romanovich/hw05/level01.py
tgrx/Z22
b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff
[ "Apache-2.0" ]
null
null
null
homeworks/yan_romanovich/hw05/level01.py
tgrx/Z22
b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff
[ "Apache-2.0" ]
8
2019-11-15T18:15:56.000Z
2020-02-03T18:05:05.000Z
homeworks/yan_romanovich/hw05/level01.py
tgrx/Z22
b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff
[ "Apache-2.0" ]
null
null
null
def summa(parametr_1, parametr_2): return parametr_1 + parametr_2
23.333333
34
0.771429
11
70
4.545455
0.545455
0.36
0.68
0.72
0
0
0
0
0
0
0
0.067797
0.157143
70
2
35
35
0.779661
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
8
fca5afcba463e17e6e1c7612518e644ab47d3b1e
104
py
Python
cryptoxlib/clients/bibox/exceptions.py
PetrZufan/cryptoxlib-aio
8fbb817ee7a7a88693804e24877863370d1d53c7
[ "MIT" ]
90
2020-04-09T18:34:49.000Z
2022-03-09T14:29:32.000Z
cryptoxlib/clients/bibox/exceptions.py
PetrZufan/cryptoxlib-aio
8fbb817ee7a7a88693804e24877863370d1d53c7
[ "MIT" ]
44
2020-04-03T17:02:20.000Z
2022-01-29T14:51:51.000Z
cryptoxlib/clients/bibox/exceptions.py
PetrZufan/cryptoxlib-aio
8fbb817ee7a7a88693804e24877863370d1d53c7
[ "MIT" ]
28
2020-04-25T21:34:53.000Z
2022-03-31T07:20:07.000Z
from cryptoxlib.exceptions import CryptoXLibException class BiboxException(CryptoXLibException): pass
20.8
53
0.875
9
104
10.111111
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.086538
104
5
54
20.8
0.957895
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
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
1
1
0
1
0
0
7
5d9462f8184184d4436aaa6574a5b0dead6c285d
7,706
py
Python
x2_pci_collision_server.py
SigPloit/S1-X2-tools
f2f22c7247663fe0482fe5a9a2941d82eb9674ba
[ "Apache-2.0" ]
1
2022-02-07T13:39:55.000Z
2022-02-07T13:39:55.000Z
x2_pci_collision_server.py
SigPloit/S1-X2-tools
f2f22c7247663fe0482fe5a9a2941d82eb9674ba
[ "Apache-2.0" ]
null
null
null
x2_pci_collision_server.py
SigPloit/S1-X2-tools
f2f22c7247663fe0482fe5a9a2941d82eb9674ba
[ "Apache-2.0" ]
1
2021-11-01T22:51:15.000Z
2021-11-01T22:51:15.000Z
#!/usr/bin/env python import sctp import binascii import sys, socket import time, IPy from itertools import repeat #for local testing: sudo ncat --sctp -l -p 36422 #interface 3GPP S1-MME #verify that the following modules are loaded #sudo insmod /lib/modules/3.6.11-4.fc16.i686/kernel/lib/libcrc32c.ko #sudo insmod /lib/modules/3.6.11-4.fc16.i686/kernel/net/sctp/sctp.ko #echo 1 > /proc/sys/net/sctp/max_init_retransmits def usage(): print "usage : python x2_pci_collision_server.py <dst ip > <local_ip>" exit(0) if len(sys.argv) < 3 : usage() exit(0) #pci set to 159,157,161 payload = ("0006008ac9000004001500080022f2100000011000140089cd0540009f0022f210f" "4241015926022f210004c2c05dc55002e0022f210f4242010000105dc0022f210f4" "242020000005dc0022f210f4242030000205dc0022f210dbedd02000f505dc0022f" "210dbedd01000f305dc0022f210dbe7f010006005dc0022f210dbe7f030006105dc" "0022f210dbcd702000ac05dc0022f210dbea8040017b05dc0022f210dbd30020011" "105dc0022f210dbd30030011305dc0022f210dbf91010002905dc0022f210dbd810" "20007705dc0022f210dbcb5040003605dc0022f210dbf7f03000e105dc0022f210d" "be7f060006105dc0022f210dbc23040010705dc0022f210dbc23050010505dc0022" "f210dbf7f02000e305dc0022f210dbcb901001e605dc0022f210dbe7f040006005d" "c0022f210dbcac01001b705dc0022f210dbe7f050006205dc0022f210f424204000" "9d0c670022f210f424205000030c670022f210f424206000040c670022f210dbd54" "0100113189c0022f210dbd540200112189c0022f210dbd540300111189c0022f210" "dbc230100149189c0022f210dbc230200147189c0022f210dbcd50200193189c002" "2f210dbc4602001bf189c0022f210dbea8010018e189c0022f210dbeb4030009218" "9c0022f210dbdaf01001cc189c0022f210dbd55010010c189c0022f210dbd550200" "10b189c0022f210dbd55030010d189c0022f210dbe5a010013a189c0022f210dbcb" "5010012b189c0022f210dbe7f0100162189c0022f210dbe7f0300163189c0022f21" "0dbe66020005a189c0022f210dbcd50300194189c0022f210dbedb0300150189c40" "00a10022f210f4241025926022f210004c2c05dc55001f0022f210f424202000000" "5dc0022f210f4242010000105dc0022f210f4242030000205dc0022f210dbd30030" "011305dc0022f210dbcac01001b705dc0022f210dbea8040017b05dc0022f210dbf" "7f03000e105dc0022f210dbc23050010505dc0022f210dbea8050017a05dc0022f2" "10f424204000050c670022f210f424205000030c670022f210f424206000040c670" "022f210dbd540100113189c0022f210dbd540200112189c0022f210dbd540300111" "189c0022f210dbc230200147189c0022f210dbeb40100090189c0022f210dbeb402" "00091189c0022f210dbeb40300092189c0022f210dbeec01000e0189c0022f210db" "daf01001cc189c0022f210dbdaf02001cb189c0022f210dbdaf03001cd189c0022f" "210dbd55010010c189c0022f210dbd55020010b189c0022f210dbd55030010d189c" "0022f210dbdac0200172189c0022f210dbea8020018d189c0022f210dbea8010018" "e189c0022f210dbcd50300194189c0022f210dbe1302001bc189c40009f0022f210" "f4241035926022f210004c2c05dc5500290022f210f4242010000105dc0022f210f" "4242030000205dc0022f210f4242020000005dc0022f210dbedd02000f505dc0022" "f210dbedd01000f305dc0022f210dbcd702000ac05dc0022f210dbd30030011305d" "c0022f210dbd4202000b105dc0022f210dbf7f03000e105dc0022f210dbca301001" "0b05dc0022f210dbca3030010d05dc0022f210dbea8040017b05dc0022f210f4242" "04000050c670022f210f424205000030c670022f210f424206000040c670022f210" "dbd540100113189c0022f210dbd540200112189c0022f210dbd540300111189c002" "2f210dbe9003001e7189c0022f210dbc4602001bf189c0022f210dbc4603001c018" "9c0022f210dbcb90400196189c0022f210dbe1303001bd189c0022f210dbea80300" "18c189c0022f210dbe3201001d4189c0022f210dbedc010009a189c0022f210dbed" "b0300150189c0022f210dbe7903000ae189c0022f210dbcd705000ee189c0022f21" "0dbd55010010c189c0022f210dbe5a010013a189c0022f210dbe66010005b189c00" "22f210dbdaf01001cc189c0022f210dbea8010018e189c0022f210dbe66030005c1" "89c0022f210dbd55020010b189c0022f210dbe5a0300139189c0022f210dbcd7040" "00ed189c0022f210dbdaf03001cd189c0022f210dbe66020005a189c0022f210dbe" "5a0200138189c4000090022f210f4241045926022f2100052b70c6744001a0022f2" "10f424204000050c670022f210f424205000030c670022f210f424206000040c670" "022f210f4242010000105dc0022f210f4242020000005dc0022f210f42420300002" "05dc0022f210dbd30020011105dc0022f210dbcd702000ac05dc0022f210dbf7f03" "000e105dc0022f210dbea8040017b05dc0022f210dbf91010002905dc0022f210db" "d540100113189c0022f210dbd540200112189c0022f210dbd540300111189c0022f" "210dbc230100149189c0022f210dbc230200147189c0022f210dbcd50200193189c" "0022f210dbc4602001bf189c0022f210dbea8010018e189c0022f210dbeb4030009" "2189c0022f210dbdaf01001cc189c0022f210dbd55010010c189c0022f210dbd550" "20010b189c0022f210dbd55030010d189c0022f210dbe5a010013a189c0022f210d" "be7f0100162189c40000b0022f210f4241055926022f2100052b70c674400180022" "f210f424204000050c670022f210f424205000030c670022f210f424206000040c6" "70022f210f4242010000105dc0022f210f4242030000205dc0022f210f424202000" "0005dc0022f210dbea8040017b05dc0022f210dbf7f03000e105dc0022f210dbd54" "0100113189c0022f210dbd540200112189c0022f210dbd540300111189c0022f210" "dbc230200147189c0022f210dbeb40100090189c0022f210dbeb40200091189c002" "2f210dbeb40300092189c0022f210dbeec01000e0189c0022f210dbdaf01001cc18" "9c0022f210dbdaf02001cb189c0022f210dbdaf03001cd189c0022f210dbd550100" "10c189c0022f210dbd55020010b189c0022f210dbd55030010d189c0022f210dbda" "c0200172189c0022f210dbea8010018e189c40000a0022f210f4241065926022f21" "00052b70c6744001d0022f210f424204000050c670022f210f424205000030c6700" "22f210f424206000040c670022f210f4242010000105dc0022f210f424202000000" "5dc0022f210f4242030000205dc0022f210dbcd702000ac05dc0022f210dbd54010" "0113189c0022f210dbd540200112189c0022f210dbd540300111189c0022f210dbe" "9003001e7189c0022f210dbc4602001bf189c0022f210dbc4603001c0189c0022f2" "10dbcb90400196189c0022f210dbe1303001bd189c0022f210dbea8030018c189c0" "022f210dbe3201001d4189c0022f210dbedb0300150189c0022f210dbe7903000ae" "189c0022f210dbd55030010d189c0022f210dbd55010010c189c0022f210dbe5a03" "00139189c0022f210dbd55020010b189c0022f210dbdaf03001cd189c0022f210db" "e66010005b189c0022f210dbe5a010013a189c0022f210dbdaf01001cc189c0022f" "210dbe66030005c189c0022f210dbe66020005a189c001800060022f210801400c8" "4080d90b0022f210f4241010f80a0a010a000001f4100022f210f4241020f80a0a0" "10b000001f4100022f210f4241030f80a0a010c000001f4100022f210f4241040f8" "0a0a010d000001f4100022f210f4241050f80a0a010e000001f4100022f210f4241" "060f80a0a010f000001f4100022f210f4241070f80a0a0110000001f4100022f210" "f4241080f80a0a0111000001f4100022f210f4241090f80a0a0112000001f410002" "2f210f42410a0f80a0a0113000001f4100022f210f42410b0f80a0a0114000001f4" "100022f210f42410c0f80a0a0115000001f410") dest_ip = sys.argv[1] ip = IPy.IP(sys.argv[2]) local_ip = (ip.strNormal(0), 36422) s = sctp.sctpsocket_tcp(socket.AF_INET) s.bind(local_ip) s.listen(1) while 1 : opened_conn, client_address = s.accept() if dest_ip == client_address[0] : break opened_conn.settimeout(5) data = binascii.unhexlify(payload) opened_conn.send(data) time.sleep(1) raw_input("press ESC to quit....") s.close()
58.824427
80
0.811705
259
7,706
24.081081
0.702703
0.003367
0.004169
0.006413
0.012506
0.012506
0.012506
0.012506
0.012506
0.012506
0
0.646655
0.148326
7,706
130
81
59.276923
0.303672
0.043602
0
0.054545
0
0
0.762804
0.75506
0
1
0
0
0
0
null
null
0
0.045455
null
null
0.009091
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
1
1
null
1
0
0
0
1
0
0
0
0
0
0
0
0
7
5de04d8b815eaf7e74b7321dcfe420300d74e31f
2,487
py
Python
sportsbet/datasets/_soccer/_utils.py
gmoraitis/sports-betting
f80eb6eb2779581ef86f38c81d5a12a743b63b53
[ "MIT" ]
36
2019-09-30T06:20:45.000Z
2020-12-20T08:34:46.000Z
sportsbet/datasets/_soccer/_utils.py
gmoraitis/sports-betting
f80eb6eb2779581ef86f38c81d5a12a743b63b53
[ "MIT" ]
2
2020-01-09T18:16:46.000Z
2020-03-01T00:49:08.000Z
sportsbet/datasets/_soccer/_utils.py
gmoraitis/sports-betting
f80eb6eb2779581ef86f38c81d5a12a743b63b53
[ "MIT" ]
19
2019-07-20T05:13:03.000Z
2020-12-21T07:19:39.000Z
""" The :mod:`sportsbed.datasets._utils` includes utilities for soccer data. """ # Author: Georgios Douzas <gdouzas@icloud.com> # License: MIT import pandas as pd OUTPUTS = [ ( 'output__home_win__full_time_goals', lambda data: data['target__home_team__full_time_goals'] > data['target__away_team__full_time_goals'], ), ( 'output__away_win__full_time_goals', lambda data: data['target__home_team__full_time_goals'] < data['target__away_team__full_time_goals'], ), ( 'output__draw__full_time_goals', lambda data: data['target__home_team__full_time_goals'] == data['target__away_team__full_time_goals'], ), ( 'output__over_1.5__full_time_goals', lambda data: data['target__home_team__full_time_goals'] + data['target__away_team__full_time_goals'] > 1.5, ), ( 'output__over_2.5__full_time_goals', lambda data: data['target__home_team__full_time_goals'] + data['target__away_team__full_time_goals'] > 2.5, ), ( 'output__over_3.5__full_time_goals', lambda data: data['target__home_team__full_time_goals'] + data['target__away_team__full_time_goals'] > 3.5, ), ( 'output__over_4.5__full_time_goals', lambda data: data['target__home_team__full_time_goals'] + data['target__away_team__full_time_goals'] > 4.5, ), ( 'output__under_1.5__full_time_goals', lambda data: data['target__home_team__full_time_goals'] + data['target__away_team__full_time_goals'] < 1.5, ), ( 'output__under_2.5__full_time_goals', lambda data: data['target__home_team__full_time_goals'] + data['target__away_team__full_time_goals'] < 2.5, ), ( 'output__under_3.5__full_time_goals', lambda data: data['target__home_team__full_time_goals'] + data['target__away_team__full_time_goals'] < 3.5, ), ( 'output__under_4.5__full_time_goals', lambda data: data['target__home_team__full_time_goals'] + data['target__away_team__full_time_goals'] < 4.5, ), ] def _read_csv(url): """Read csv file from URL as a pandas dataframe.""" names = pd.read_csv(url, nrows=0, encoding='ISO-8859-1').columns return pd.read_csv( url, names=names, skiprows=1, encoding='ISO-8859-1', on_bad_lines='skip' )
29.607143
80
0.648573
330
2,487
4.169697
0.187879
0.19186
0.311773
0.271802
0.746366
0.746366
0.746366
0.746366
0.746366
0.746366
0
0.023293
0.24045
2,487
83
81
29.963855
0.705135
0.07117
0
0.422535
0
0
0.494338
0.483885
0
0
0
0
0
1
0.014085
false
0
0.014085
0
0.042254
0
0
0
0
null
0
1
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
5de58bcf945e5ec6ad4ea7cb9be676c8dae17fd4
21,923
py
Python
geoscilabs/em/TDEMDipolarfields.py
jcapriot/geosci-labs
044a73432b9cb1187924f7761942ab329259d875
[ "MIT" ]
1
2019-01-04T10:06:44.000Z
2019-01-04T10:06:44.000Z
geoscilabs/em/TDEMDipolarfields.py
jcapriot/geosci-labs
044a73432b9cb1187924f7761942ab329259d875
[ "MIT" ]
1
2018-12-30T20:09:25.000Z
2018-12-30T20:09:25.000Z
geoscilabs/em/TDEMDipolarfields.py
jcapriot/geosci-labs
044a73432b9cb1187924f7761942ab329259d875
[ "MIT" ]
null
null
null
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from __future__ import division import numpy as np from scipy.constants import mu_0, pi, epsilon_0 from scipy.special import erfc, erf from SimPEG import utils # TODO: # r = lambda dx, dy, dz: np.sqrt( dx**2. + dy**2. + dz**2.) def E_from_ElectricDipoleWholeSpace( XYZ, srcLoc, sig, t, current=1.0, length=1.0, orientation="X", kappa=0.0, epsr=1.0 ): """ Computing the analytic electric fields (E) from an electrical dipole in a wholespace - You have the option of computing E for multiple times at a single reciever location or a single time at multiple locations :param numpy.array XYZ: reciever locations at which to evaluate E :param numpy.array srcLoc: [x,y,z] triplet defining the location of the electric dipole source :param float sig: value specifying the conductivity (S/m) of the wholespace :param numpy.array t: array of times at which to measure :param float current: size of the injected current (A), default is 1.0 A :param float length: length of the dipole (m), default is 1.0 m :param str orientation: orientation of dipole: 'X', 'Y', or 'Z' :param float kappa: magnetic susceptiblity value (unitless), default is 0. :param float epsr: relative permitivitty value (unitless), default is 1.0 :rtype: numpy.array :return: Ex, Ey, Ez: arrays containing all 3 components of E evaluated at the specified locations and times. """ mu = mu_0 * (1 + kappa) # epsilon = epsilon_0 * epsr XYZ = utils.asArray_N_x_Dim(XYZ, 3) # Check if XYZ.shape[0] > 1 & t.shape[0] > 1: raise Exception( "I/O type error: For multiple field locations only a single time can be specified." ) dx = XYZ[:, 0] - srcLoc[0] dy = XYZ[:, 1] - srcLoc[1] dz = XYZ[:, 2] - srcLoc[2] r = np.sqrt(dx ** 2.0 + dy ** 2.0 + dz ** 2.0) theta = np.sqrt((mu * sig) / (4 * t)) front = current * length / (4.0 * pi * sig * r ** 3) mid = 3 * erf(theta * r) - ( 4 / np.sqrt(pi) * (theta) ** 3 * r ** 3 + 6 / np.sqrt(pi) * theta * r ) * np.exp(-((theta) ** 2) * (r) ** 2) extra = erf(theta * r) - ( 4 / np.sqrt(pi) * (theta) ** 3 * r ** 3 + 2 / np.sqrt(pi) * theta * r ) * np.exp(-((theta) ** 2) * (r) ** 2) if orientation.upper() == "X": Ex = front * (dx ** 2 / r ** 2) * mid - front * extra Ey = front * (dx * dy / r ** 2) * mid Ez = front * (dx * dz / r ** 2) * mid return Ex, Ey, Ez elif orientation.upper() == "Y": # x--> y, y--> z, z-->x Ey = front * (dy ** 2 / r ** 2) * mid - front * extra Ez = front * (dy * dz / r ** 2) * mid Ex = front * (dy * dx / r ** 2) * mid return Ex, Ey, Ez elif orientation.upper() == "Z": # x --> z, y --> x, z --> y Ez = front * (dz ** 2 / r ** 2) * mid - front * extra Ex = front * (dz * dx / r ** 2) * mid Ey = front * (dz * dy / r ** 2) * mid return Ex, Ey, Ez def J_from_ElectricDipoleWholeSpace( XYZ, srcLoc, sig, t, current=1.0, length=1.0, orientation="X", kappa=1.0, epsr=1.0 ): """ Computing the analytic current density (J) from an electrical dipole in a wholespace - You have the option of computing J for multiple times at a single reciever location or a single time at multiple locations :param numpy.array XYZ: reciever locations at which to evaluate J :param numpy.array srcLoc: [x,y,z] triplet defining the location of the electric dipole source :param float sig: value specifying the conductivity (S/m) of the wholespace :param numpy.array t: array of times at which to measure :param float current: size of the injected current (A), default is 1.0 A :param float length: length of the dipole (m), default is 1.0 m :param str orientation: orientation of dipole: 'X', 'Y', or 'Z' :param float kappa: magnetic susceptiblity value (unitless), default is 0. :param float epsr: relative permitivitty value (unitless), default is 1.0 :rtype: numpy.array :return: Jx, Jy, Jz: arrays containing all 3 components of J evaluated at the specified locations and times. """ Ex, Ey, Ez = E_from_ElectricDipoleWholeSpace( XYZ, srcLoc, sig, t, current=current, length=length, orientation=orientation, kappa=kappa, epsr=epsr, ) Jx = sig * Ex Jy = sig * Ey Jz = sig * Ez return Jx, Jy, Jz def H_from_ElectricDipoleWholeSpace( XYZ, srcLoc, sig, t, current=1.0, length=1.0, orientation="X", kappa=1.0, epsr=1.0 ): """ Computing the analytic magnetic fields (H) from an electrical dipole in a wholespace - You have the option of computing H for multiple times at a single reciever location or a single time at multiple locations :param numpy.array XYZ: reciever locations at which to evaluate H :param numpy.array srcLoc: [x,y,z] triplet defining the location of the electric dipole source :param float sig: value specifying the conductivity (S/m) of the wholespace :param numpy.array t: array of times at which to measure :param float current: size of the injected current (A), default is 1.0 A :param float length: length of the dipole (m), default is 1.0 m :param str orientation: orientation of dipole: 'X', 'Y', or 'Z' :param float kappa: magnetic susceptiblity value (unitless), default is 0. :param float epsr: relative permitivitty value (unitless), default is 1.0 :rtype: numpy.array :return: Hx, Hy, Hz: arrays containing all 3 components of H evaluated at the specified locations and times. """ mu = mu_0 * (1 + kappa) # epsilon = epsilon_0 * epsr XYZ = utils.asArray_N_x_Dim(XYZ, 3) # Check if XYZ.shape[0] > 1 & t.shape[0] > 1: raise Exception( "I/O type error: For multiple field locations only a single time can be specified." ) dx = XYZ[:, 0] - srcLoc[0] dy = XYZ[:, 1] - srcLoc[1] dz = XYZ[:, 2] - srcLoc[2] r = np.sqrt(dx ** 2.0 + dy ** 2.0 + dz ** 2.0) theta = np.sqrt((mu * sig) / (4 * t)) front = (current * length) / (4.0 * pi * (r) ** 3) mid = erf(theta * r) - (2 / np.sqrt(pi)) * theta * r * np.exp( -((theta) ** 2) * (r) ** 2 ) if orientation.upper() == "X": Hy = front * mid * -dz Hz = front * mid * dy Hx = np.zeros_like(Hy) return Hx, Hy, Hz elif orientation.upper() == "Y": Hx = front * mid * dz Hz = front * mid * -dx Hy = np.zeros_like(Hx) return Hx, Hy, Hz elif orientation.upper() == "Z": Hx = front * mid * -dy Hy = front * mid * dx Hz = np.zeros_like(Hx) return Hx, Hy, Hz def dHdt_from_ElectricDipoleWholeSpace( XYZ, srcLoc, sig, t, current=1.0, length=1.0, orientation="X", kappa=1.0, epsr=1.0 ): """ Computing the analytic timd derivative of magnetic fields (dH/dt) from an electrical dipole in a wholespace - You have the option of computing H for multiple times at a single reciever location or a single time at multiple locations :param numpy.array XYZ: reciever locations at which to evaluate H :param numpy.array srcLoc: [x,y,z] triplet defining the location of the electric dipole source :param float sig: value specifying the conductivity (S/m) of the wholespace :param numpy.array t: array of times at which to measure :param float current: size of the injected current (A), default is 1.0 A :param float length: length of the dipole (m), default is 1.0 m :param str orientation: orientation of dipole: 'X', 'Y', or 'Z' :param float kappa: magnetic susceptiblity value (unitless), default is 0. :param float epsr: relative permitivitty value (unitless), default is 1.0 :rtype: numpy.array :return: dHx/dt, dHy/dt, dHz/dt: arrays containing all 3 components of H evaluated at the specified locations and times. """ mu = mu_0 * (1 + kappa) # epsilon = epsilon_0 * epsr XYZ = utils.asArray_N_x_Dim(XYZ, 3) # Check if XYZ.shape[0] > 1 & t.shape[0] > 1: raise Exception( "I/O type error: For multiple field locations only a single time can be specified." ) dx = XYZ[:, 0] - srcLoc[0] dy = XYZ[:, 1] - srcLoc[1] dz = XYZ[:, 2] - srcLoc[2] r = np.sqrt(dx ** 2.0 + dy ** 2.0 + dz ** 2.0) theta = np.sqrt((mu * sig) / (4 * t)) front = -2.0 * (current * length) * theta ** 5 * np.exp(-((theta) ** 2) * (r) ** 2) mid = 1.0 / (np.pi ** 1.5 * mu * sig) if orientation.upper() == "X": Hy = front * mid * -dz Hz = front * mid * dy Hx = np.zeros_like(Hy) return Hx, Hy, Hz elif orientation.upper() == "Y": Hx = front * mid * dz Hz = front * mid * -dx Hy = np.zeros_like(Hx) return Hx, Hy, Hz elif orientation.upper() == "Z": Hx = front * mid * -dy Hy = front * mid * dx Hz = np.zeros_like(Hx) return Hx, Hy, Hz def B_from_ElectricDipoleWholeSpace( XYZ, srcLoc, sig, t, current=1.0, length=1.0, orientation="X", kappa=1.0, epsr=1.0 ): """ Computing the analytic magnetic flux density (B) from an electrical dipole in a wholespace - You have the option of computing B for multiple times at a single reciever location or a single time at multiple locations :param numpy.array XYZ: reciever locations at which to evaluate B :param numpy.array srcLoc: [x,y,z] triplet defining the location of the electric dipole source :param float sig: value specifying the conductivity (S/m) of the wholespace :param numpy.array t: array of times at which to measure :param float current: size of the injected current (A), default is 1.0 A :param float length: length of the dipole (m), default is 1.0 m :param str orientation: orientation of dipole: 'X', 'Y', or 'Z' :param float kappa: magnetic susceptiblity value (unitless), default is 0. :param float epsr: relative permitivitty value (unitless), default is 1.0 :rtype: numpy.array :return: Bx, By, Bz: arrays containing all 3 components of B evaluated at the specified locations and times. """ mu = mu_0 * (1 + kappa) Hx, Hy, Hz = dHdt_from_ElectricDipoleWholeSpace( XYZ, srcLoc, sig, t, current=current, length=length, orientation=orientation, kappa=kappa, epsr=epsr, ) Bx = mu * Hx By = mu * Hy Bz = mu * Hz return Bx, By, Bz def E_from_MagneticDipoleWholeSpace( XYZ, srcLoc, sig, t, current=1.0, length=1.0, orientation="X", kappa=0.0, epsr=1.0 ): """ Computing the analytic electric fields (E) from an magnetic dipole in a wholespace - You have the option of computing E for multiple times at a single reciever location or a single time at multiple locations :param numpy.array XYZ: reciever locations at which to evaluate E :param numpy.array srcLoc: [x,y,z] triplet defining the location of the electric dipole source :param float sig: value specifying the conductivity (S/m) of the wholespace :param numpy.array t: array of times at which to measure :param float current: size of the injected current (A), default is 1.0 A :param float length: length of the dipole (m), default is 1.0 m :param str orientation: orientation of dipole: 'X', 'Y', or 'Z' :param float kappa: magnetic susceptiblity value (unitless), default is 0. :param float epsr: relative permitivitty value (unitless), default is 1.0 :rtype: numpy.array :return: Ex, Ey, Ez: arrays containing all 3 components of E evaluated at the specified locations and times. """ mu = mu_0 * (1 + kappa) # epsilon = epsilon_0 * epsr XYZ = utils.asArray_N_x_Dim(XYZ, 3) # Check if XYZ.shape[0] > 1 & t.shape[0] > 1: raise Exception( "I/O type error: For multiple field locations only a single time can be specified." ) dx = XYZ[:, 0] - srcLoc[0] dy = XYZ[:, 1] - srcLoc[1] dz = XYZ[:, 2] - srcLoc[2] r = np.sqrt(dx ** 2.0 + dy ** 2.0 + dz ** 2.0) theta = np.sqrt((mu * sig) / (4 * t)) front = 2.0 * (current * length) * theta ** 5 * np.exp(-((theta) ** 2) * (r) ** 2) mid = 1.0 / (np.pi ** 1.5 * sig) if orientation.upper() == "X": Ey = front * mid * -dz Ez = front * mid * dy Ex = np.zeros_like(Ey) return Ex, Ey, Ez elif orientation.upper() == "Y": Ex = front * mid * dz Ez = front * mid * -dx Ey = np.zeros_like(Ex) return Ex, Ey, Ez elif orientation.upper() == "Z": Ex = front * mid * -dy Ey = front * mid * dx Ez = np.zeros_like(Ex) return Ex, Ey, Ez def J_from_MagneticDipoleWholeSpace( XYZ, srcLoc, sig, t, current=1.0, length=1.0, orientation="X", kappa=1.0, epsr=1.0 ): """ Computing the analytic current density (J) from an magnetic dipole in a wholespace - You have the option of computing J for multiple times at a single reciever location or a single time at multiple locations :param numpy.array XYZ: reciever locations at which to evaluate J :param numpy.array srcLoc: [x,y,z] triplet defining the location of the electric dipole source :param float sig: value specifying the conductivity (S/m) of the wholespace :param numpy.array t: array of times at which to measure :param float current: size of the injected current (A), default is 1.0 A :param float length: length of the dipole (m), default is 1.0 m :param str orientation: orientation of dipole: 'X', 'Y', or 'Z' :param float kappa: magnetic susceptiblity value (unitless), default is 0. :param float epsr: relative permitivitty value (unitless), default is 1.0 :rtype: numpy.array :return: Jx, Jy, Jz: arrays containing all 3 components of J evaluated at the specified locations and times. """ Ex, Ey, Ez = E_from_MagneticDipoleWholeSpace( XYZ, srcLoc, sig, t, current=current, length=length, orientation=orientation, kappa=kappa, epsr=epsr, ) Jx = sig * Ex Jy = sig * Ey Jz = sig * Ez return Jx, Jy, Jz def H_from_MagneticDipoleWholeSpace( XYZ, srcLoc, sig, t, current=1.0, length=1.0, orientation="X", kappa=0.0, epsr=1.0 ): """ Computing the analytic magnetic fields (H) from an magnetic dipole in a wholespace - You have the option of computing E for multiple times at a single reciever location or a single time at multiple locations :param numpy.array XYZ: reciever locations at which to evaluate E :param numpy.array srcLoc: [x,y,z] triplet defining the location of the electric dipole source :param float sig: value specifying the conductivity (S/m) of the wholespace :param numpy.array t: array of times at which to measure :param float current: size of the injected current (A), default is 1.0 A :param float length: length of the dipole (m), default is 1.0 m :param str orientation: orientation of dipole: 'X', 'Y', or 'Z' :param float kappa: magnetic susceptiblity value (unitless), default is 0. :param float epsr: relative permitivitty value (unitless), default is 1.0 :rtype: numpy.array :return: Hx, Hy, Hz: arrays containing all 3 components of E evaluated at the specified locations and times. """ mu = mu_0 * (1 + kappa) # epsilon = epsilon_0 * epsr XYZ = utils.asArray_N_x_Dim(XYZ, 3) # Check if XYZ.shape[0] > 1 & t.shape[0] > 1: raise Exception( "I/O type error: For multiple field locations only a single time can be specified." ) dx = XYZ[:, 0] - srcLoc[0] dy = XYZ[:, 1] - srcLoc[1] dz = XYZ[:, 2] - srcLoc[2] r = np.sqrt(dx ** 2.0 + dy ** 2.0 + dz ** 2.0) theta = np.sqrt((mu * sig) / (4 * t)) front = current * length / (4.0 * pi * r ** 3) mid = 3 * erf(theta * r) - ( 4 / np.sqrt(pi) * (theta) ** 3 * r ** 3 + 6 / np.sqrt(pi) * theta * r ) * np.exp(-((theta) ** 2) * (r) ** 2) extra = erf(theta * r) - ( 4 / np.sqrt(pi) * (theta) ** 3 * r ** 3 + 2 / np.sqrt(pi) * theta * r ) * np.exp(-((theta) ** 2) * (r) ** 2) if orientation.upper() == "X": Hx = front * (dx ** 2 / r ** 2) * mid - front * extra Hy = front * (dx * dy / r ** 2) * mid Hz = front * (dx * dz / r ** 2) * mid return Hx, Hy, Hz elif orientation.upper() == "Y": # x--> y, y--> z, z-->x Hy = front * (dy ** 2 / r ** 2) * mid - front * extra Hz = front * (dy * dz / r ** 2) * mid Hx = front * (dy * dx / r ** 2) * mid return Hx, Hy, Hz elif orientation.upper() == "Z": # x --> z, y --> x, z --> y Hz = front * (dz ** 2 / r ** 2) * mid - front * extra Hx = front * (dz * dx / r ** 2) * mid Hy = front * (dz * dy / r ** 2) * mid return Hx, Hy, Hz def dHdt_from_MagneticDipoleWholeSpace( XYZ, srcLoc, sig, t, current=1.0, length=1.0, orientation="X", kappa=1.0, epsr=1.0 ): """ Computing the analytic timd derivative of magnetic fields (dH/dt) from an magnetic dipole in a wholespace - You have the option of computing H for multiple times at a single reciever location or a single time at multiple locations :param numpy.array XYZ: reciever locations at which to evaluate H :param numpy.array srcLoc: [x,y,z] triplet defining the location of the electric dipole source :param float sig: value specifying the conductivity (S/m) of the wholespace :param numpy.array t: array of times at which to measure :param float current: size of the injected current (A), default is 1.0 A :param float length: length of the dipole (m), default is 1.0 m :param str orientation: orientation of dipole: 'X', 'Y', or 'Z' :param float kappa: magnetic susceptiblity value (unitless), default is 0. :param float epsr: relative permitivitty value (unitless), default is 1.0 :rtype: numpy.array :return: dHx/dt, dHy/dt, dHz/dt: arrays containing all 3 components of H evaluated at the specified locations and times. """ mu = mu_0 * (1 + kappa) # epsilon = epsilon_0 * epsr XYZ = utils.asArray_N_x_Dim(XYZ, 3) # Check if XYZ.shape[0] > 1 & t.shape[0] > 1: raise Exception( "I/O type error: For multiple field locations only a single time can be specified." ) dx = XYZ[:, 0] - srcLoc[0] dy = XYZ[:, 1] - srcLoc[1] dz = XYZ[:, 2] - srcLoc[2] r = np.sqrt(dx ** 2.0 + dy ** 2.0 + dz ** 2.0) theta = np.sqrt((mu * sig) / (4 * t)) front = -4 * (current * length) * theta ** 5 * np.exp(-((theta) ** 2) * (r) ** 2) front *= 1.0 / (np.pi ** 1.5 * mu * sig) mid = (theta) ** 2 * (r) ** 2 extra = 1 - (theta) ** 2 * (r) ** 2 if orientation.upper() == "X": Hx = front * (dx ** 2 / r ** 2) * mid + front * extra Hy = front * (dx * dy / r ** 2) * mid Hz = front * (dx * dz / r ** 2) * mid return Hx, Hy, Hz elif orientation.upper() == "Y": # x--> y, y--> z, z-->x Hy = front * (dy ** 2 / r ** 2) * mid + front * extra Hz = front * (dy * dz / r ** 2) * mid Hx = front * (dy * dx / r ** 2) * mid return Hx, Hy, Hz elif orientation.upper() == "Z": # x --> z, y --> x, z --> y Hz = front * (dz ** 2 / r ** 2) * mid + front * extra Hx = front * (dz * dx / r ** 2) * mid Hy = front * (dz * dy / r ** 2) * mid return Hx, Hy, Hz def B_from_MagneticDipoleWholeSpace( XYZ, srcLoc, sig, t, current=1.0, length=1.0, orientation="X", kappa=1.0, epsr=1.0 ): """ Computing the analytic magnetic flux density (B) from an electrical dipole in a wholespace - You have the option of computing B for multiple times at a single reciever location or a single time at multiple locations :param numpy.array XYZ: reciever locations at which to evaluate B :param numpy.array srcLoc: [x,y,z] triplet defining the location of the electric dipole source :param float sig: value specifying the conductivity (S/m) of the wholespace :param numpy.array t: array of times at which to measure :param float current: size of the injected current (A), default is 1.0 A :param float length: length of the dipole (m), default is 1.0 m :param str orientation: orientation of dipole: 'X', 'Y', or 'Z' :param float kappa: magnetic susceptiblity value (unitless), default is 0. :param float epsr: relative permitivitty value (unitless), default is 1.0 :rtype: numpy.array :return: Bx, By, Bz: arrays containing all 3 components of B evaluated at the specified locations and times. """ mu = mu_0 * (1 + kappa) Hx, Hy, Hz = dHdt_from_MagneticDipoleWholeSpace( XYZ, srcLoc, sig, t, current=current, length=length, orientation=orientation, kappa=kappa, epsr=epsr, ) Bx = mu * Hx By = mu * Hy Bz = mu * Hz return Bx, By, Bz
39.572202
128
0.590065
3,260
21,923
3.940491
0.049387
0.010898
0.03503
0.025689
0.973143
0.970419
0.964036
0.959832
0.944185
0.944185
0
0.025825
0.293482
21,923
553
129
39.643761
0.803538
0.472244
0
0.751773
0
0
0.049806
0
0
0
0
0.001808
0
1
0.035461
false
0
0.028369
0
0.141844
0.003546
0
0
0
null
0
0
0
1
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
7
b9066961b4de22180d81e4ac0842c1026d688f99
86,651
py
Python
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/mp_fdca92ca7688d207a32daf52e610fd90.py
rfrye-github/ixnetwork_restpy
23eeb24b21568a23d3f31bbd72814ff55eb1af44
[ "MIT" ]
null
null
null
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/mp_fdca92ca7688d207a32daf52e610fd90.py
rfrye-github/ixnetwork_restpy
23eeb24b21568a23d3f31bbd72814ff55eb1af44
[ "MIT" ]
null
null
null
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/mp_fdca92ca7688d207a32daf52e610fd90.py
rfrye-github/ixnetwork_restpy
23eeb24b21568a23d3f31bbd72814ff55eb1af44
[ "MIT" ]
null
null
null
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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. from ixnetwork_restpy.base import Base from ixnetwork_restpy.files import Files class Mp(Base): """This object contains the Maintenance Point (MP) configuration. The Mp class encapsulates a list of mp resources that are managed by the user. A list of resources can be retrieved from the server using the Mp.find() method. The list can be managed by using the Mp.add() and Mp.remove() methods. """ __slots__ = () _SDM_NAME = 'mp' _SDM_ATT_MAP = { 'AddCcmCustomTlvs': 'addCcmCustomTlvs', 'AddDataTlv': 'addDataTlv', 'AddInterfaceStatusTlv': 'addInterfaceStatusTlv', 'AddLbmCustomTlvs': 'addLbmCustomTlvs', 'AddLbrCustomTlvs': 'addLbrCustomTlvs', 'AddLmmCustomTlvs': 'addLmmCustomTlvs', 'AddLmrCustomTlvs': 'addLmrCustomTlvs', 'AddLtmCustomTlvs': 'addLtmCustomTlvs', 'AddLtrCustomTlvs': 'addLtrCustomTlvs', 'AddOrganizationSpecificTlv': 'addOrganizationSpecificTlv', 'AddPortStatusTlv': 'addPortStatusTlv', 'AddSenderIdTlv': 'addSenderIdTlv', 'AisEnableUnicastMac': 'aisEnableUnicastMac', 'AisInterval': 'aisInterval', 'AisMode': 'aisMode', 'AisPriority': 'aisPriority', 'AisUnicastMac': 'aisUnicastMac', 'AutoDmAllDestination': 'autoDmAllDestination', 'AutoDmDestination': 'autoDmDestination', 'AutoDmIteration': 'autoDmIteration', 'AutoDmTimeout': 'autoDmTimeout', 'AutoDmTimer': 'autoDmTimer', 'AutoLbAllDestination': 'autoLbAllDestination', 'AutoLbDestination': 'autoLbDestination', 'AutoLbIteration': 'autoLbIteration', 'AutoLbTimeout': 'autoLbTimeout', 'AutoLbTimer': 'autoLbTimer', 'AutoLmIteration': 'autoLmIteration', 'AutoLmTimeout': 'autoLmTimeout', 'AutoLmTimer': 'autoLmTimer', 'AutoLtAllDestination': 'autoLtAllDestination', 'AutoLtDestination': 'autoLtDestination', 'AutoLtIteration': 'autoLtIteration', 'AutoLtTimeout': 'autoLtTimeout', 'AutoLtTimer': 'autoLtTimer', 'CciInterval': 'cciInterval', 'CcmLmmTxFcf': 'ccmLmmTxFcf', 'CcmLmmTxFcfStep': 'ccmLmmTxFcfStep', 'CcmPriority': 'ccmPriority', 'CcmRxFcb': 'ccmRxFcb', 'CcmRxFcbStep': 'ccmRxFcbStep', 'ChassisId': 'chassisId', 'ChassisIdLength': 'chassisIdLength', 'ChassisIdSubType': 'chassisIdSubType', 'DataTlvLength': 'dataTlvLength', 'DataTlvValue': 'dataTlvValue', 'DmMethod': 'dmMethod', 'DmPriority': 'dmPriority', 'DmmPriority': 'dmmPriority', 'EnableAisRx': 'enableAisRx', 'EnableAutoDm': 'enableAutoDm', 'EnableAutoLb': 'enableAutoLb', 'EnableAutoLm': 'enableAutoLm', 'EnableAutoLt': 'enableAutoLt', 'EnableLckRx': 'enableLckRx', 'EnableLmCounterUpdate': 'enableLmCounterUpdate', 'EnableTstRx': 'enableTstRx', 'Enabled': 'enabled', 'InterRemoteMepRxIncrementStep': 'interRemoteMepRxIncrementStep', 'InterRemoteMepTxIncrementStep': 'interRemoteMepTxIncrementStep', 'LbmPriority': 'lbmPriority', 'LckEnableUnicastMac': 'lckEnableUnicastMac', 'LckInterval': 'lckInterval', 'LckMode': 'lckMode', 'LckPriority': 'lckPriority', 'LckSupportAisGeneration': 'lckSupportAisGeneration', 'LckUnicastMac': 'lckUnicastMac', 'LmAllRemoteMeps': 'lmAllRemoteMeps', 'LmDestinationMacAddress': 'lmDestinationMacAddress', 'LmMethod': 'lmMethod', 'LmmPriority': 'lmmPriority', 'LmrPriority': 'lmrPriority', 'LmrRxFcf': 'lmrRxFcf', 'LmrRxFcfStep': 'lmrRxFcfStep', 'LtmPriority': 'ltmPriority', 'MacAddress': 'macAddress', 'ManagementAddress': 'managementAddress', 'ManagementAddressDomain': 'managementAddressDomain', 'ManagementAddressDomainLength': 'managementAddressDomainLength', 'ManagementAddressLength': 'managementAddressLength', 'MdLevel': 'mdLevel', 'MegId': 'megId', 'MegIdFormat': 'megIdFormat', 'MepId': 'mepId', 'MipId': 'mipId', 'MpType': 'mpType', 'OrganizationSpecificTlvLength': 'organizationSpecificTlvLength', 'OrganizationSpecificTlvValue': 'organizationSpecificTlvValue', 'OverrideVlanPriority': 'overrideVlanPriority', 'Rdi': 'rdi', 'ShortMaName': 'shortMaName', 'ShortMaNameFormat': 'shortMaNameFormat', 'TstEnableUnicastMac': 'tstEnableUnicastMac', 'TstIncrPacketLength': 'tstIncrPacketLength', 'TstIncrPacketLengthStep': 'tstIncrPacketLengthStep', 'TstInitialPatternValue': 'tstInitialPatternValue', 'TstInterval': 'tstInterval', 'TstMode': 'tstMode', 'TstOverwriteSequenceNumber': 'tstOverwriteSequenceNumber', 'TstPacketLength': 'tstPacketLength', 'TstPatternType': 'tstPatternType', 'TstPriority': 'tstPriority', 'TstSequenceNumber': 'tstSequenceNumber', 'TstTestType': 'tstTestType', 'TstUnicastMac': 'tstUnicastMac', 'Ttl': 'ttl', 'Vlan': 'vlan', } def __init__(self, parent): super(Mp, self).__init__(parent) @property def AddCcmCustomTlvs(self): """ Returns ------- - bool: If true, adds a custom CCM TLV to bridge messages. """ return self._get_attribute(self._SDM_ATT_MAP['AddCcmCustomTlvs']) @AddCcmCustomTlvs.setter def AddCcmCustomTlvs(self, value): self._set_attribute(self._SDM_ATT_MAP['AddCcmCustomTlvs'], value) @property def AddDataTlv(self): """ Returns ------- - bool: If true, adds a data TLV to bridge messages. """ return self._get_attribute(self._SDM_ATT_MAP['AddDataTlv']) @AddDataTlv.setter def AddDataTlv(self, value): self._set_attribute(self._SDM_ATT_MAP['AddDataTlv'], value) @property def AddInterfaceStatusTlv(self): """ Returns ------- - bool: If true, adds an interface status TLV to bridge messages. """ return self._get_attribute(self._SDM_ATT_MAP['AddInterfaceStatusTlv']) @AddInterfaceStatusTlv.setter def AddInterfaceStatusTlv(self, value): self._set_attribute(self._SDM_ATT_MAP['AddInterfaceStatusTlv'], value) @property def AddLbmCustomTlvs(self): """ Returns ------- - bool: If true, adds a custom loopback message TLV to bridge messages. """ return self._get_attribute(self._SDM_ATT_MAP['AddLbmCustomTlvs']) @AddLbmCustomTlvs.setter def AddLbmCustomTlvs(self, value): self._set_attribute(self._SDM_ATT_MAP['AddLbmCustomTlvs'], value) @property def AddLbrCustomTlvs(self): """ Returns ------- - bool: If true, adds a custom loopback response message TLV to bridge messages. """ return self._get_attribute(self._SDM_ATT_MAP['AddLbrCustomTlvs']) @AddLbrCustomTlvs.setter def AddLbrCustomTlvs(self, value): self._set_attribute(self._SDM_ATT_MAP['AddLbrCustomTlvs'], value) @property def AddLmmCustomTlvs(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['AddLmmCustomTlvs']) @AddLmmCustomTlvs.setter def AddLmmCustomTlvs(self, value): self._set_attribute(self._SDM_ATT_MAP['AddLmmCustomTlvs'], value) @property def AddLmrCustomTlvs(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['AddLmrCustomTlvs']) @AddLmrCustomTlvs.setter def AddLmrCustomTlvs(self, value): self._set_attribute(self._SDM_ATT_MAP['AddLmrCustomTlvs'], value) @property def AddLtmCustomTlvs(self): """ Returns ------- - bool: If true, adds a custom link trace message TLV to bridge messages. """ return self._get_attribute(self._SDM_ATT_MAP['AddLtmCustomTlvs']) @AddLtmCustomTlvs.setter def AddLtmCustomTlvs(self, value): self._set_attribute(self._SDM_ATT_MAP['AddLtmCustomTlvs'], value) @property def AddLtrCustomTlvs(self): """ Returns ------- - bool: If true, adds a custom link trace message TLV to bridge messages. """ return self._get_attribute(self._SDM_ATT_MAP['AddLtrCustomTlvs']) @AddLtrCustomTlvs.setter def AddLtrCustomTlvs(self, value): self._set_attribute(self._SDM_ATT_MAP['AddLtrCustomTlvs'], value) @property def AddOrganizationSpecificTlv(self): """ Returns ------- - bool: If true, adds a custom organization specific message TLV to bridge messages. """ return self._get_attribute(self._SDM_ATT_MAP['AddOrganizationSpecificTlv']) @AddOrganizationSpecificTlv.setter def AddOrganizationSpecificTlv(self, value): self._set_attribute(self._SDM_ATT_MAP['AddOrganizationSpecificTlv'], value) @property def AddPortStatusTlv(self): """ Returns ------- - bool: If true, adds a custom port statust message TLV to bridge messages. """ return self._get_attribute(self._SDM_ATT_MAP['AddPortStatusTlv']) @AddPortStatusTlv.setter def AddPortStatusTlv(self, value): self._set_attribute(self._SDM_ATT_MAP['AddPortStatusTlv'], value) @property def AddSenderIdTlv(self): """ Returns ------- - bool: If true, adds a custom sender ID message TLV to bridge messages. """ return self._get_attribute(self._SDM_ATT_MAP['AddSenderIdTlv']) @AddSenderIdTlv.setter def AddSenderIdTlv(self, value): self._set_attribute(self._SDM_ATT_MAP['AddSenderIdTlv'], value) @property def AisEnableUnicastMac(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['AisEnableUnicastMac']) @AisEnableUnicastMac.setter def AisEnableUnicastMac(self, value): self._set_attribute(self._SDM_ATT_MAP['AisEnableUnicastMac'], value) @property def AisInterval(self): """ Returns ------- - str(oneSec | oneMin): NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['AisInterval']) @AisInterval.setter def AisInterval(self, value): self._set_attribute(self._SDM_ATT_MAP['AisInterval'], value) @property def AisMode(self): """ Returns ------- - str(auto | start | stop): NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['AisMode']) @AisMode.setter def AisMode(self, value): self._set_attribute(self._SDM_ATT_MAP['AisMode'], value) @property def AisPriority(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['AisPriority']) @AisPriority.setter def AisPriority(self, value): self._set_attribute(self._SDM_ATT_MAP['AisPriority'], value) @property def AisUnicastMac(self): """ Returns ------- - str: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['AisUnicastMac']) @AisUnicastMac.setter def AisUnicastMac(self, value): self._set_attribute(self._SDM_ATT_MAP['AisUnicastMac'], value) @property def AutoDmAllDestination(self): """ Returns ------- - bool: If true, enables the automatic sending of DM Messages. """ return self._get_attribute(self._SDM_ATT_MAP['AutoDmAllDestination']) @AutoDmAllDestination.setter def AutoDmAllDestination(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoDmAllDestination'], value) @property def AutoDmDestination(self): """ Returns ------- - str: The sent MAC address for the DM, if autoDmAllDestination is set to true. """ return self._get_attribute(self._SDM_ATT_MAP['AutoDmDestination']) @AutoDmDestination.setter def AutoDmDestination(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoDmDestination'], value) @property def AutoDmIteration(self): """ Returns ------- - number: The count for how many times DMMs will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 """ return self._get_attribute(self._SDM_ATT_MAP['AutoDmIteration']) @AutoDmIteration.setter def AutoDmIteration(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoDmIteration'], value) @property def AutoDmTimeout(self): """ Returns ------- - number: The timeout period in seconds to wait for a response to DMMs. This value should be less than the Auto LB Timer. Default is 30. Min: 1 Max: 65535 """ return self._get_attribute(self._SDM_ATT_MAP['AutoDmTimeout']) @AutoDmTimeout.setter def AutoDmTimeout(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoDmTimeout'], value) @property def AutoDmTimer(self): """ Returns ------- - number: The time period in seconds between DMMs. Default is 60. Min: 1 Max: 65535 """ return self._get_attribute(self._SDM_ATT_MAP['AutoDmTimer']) @AutoDmTimer.setter def AutoDmTimer(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoDmTimer'], value) @property def AutoLbAllDestination(self): """ Returns ------- - bool: If true, enables the automatic sending of Loopback Messages. """ return self._get_attribute(self._SDM_ATT_MAP['AutoLbAllDestination']) @AutoLbAllDestination.setter def AutoLbAllDestination(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLbAllDestination'], value) @property def AutoLbDestination(self): """ Returns ------- - str: Sets the loopback destination MAC address. """ return self._get_attribute(self._SDM_ATT_MAP['AutoLbDestination']) @AutoLbDestination.setter def AutoLbDestination(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLbDestination'], value) @property def AutoLbIteration(self): """ Returns ------- - number: The count for how many times LBM will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 """ return self._get_attribute(self._SDM_ATT_MAP['AutoLbIteration']) @AutoLbIteration.setter def AutoLbIteration(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLbIteration'], value) @property def AutoLbTimeout(self): """ Returns ------- - number: The timeout period in seconds to wait for a response to LTMs. This value should be less than the Auto LT Timer. Default is 30. Min: 1 Max: 65535 """ return self._get_attribute(self._SDM_ATT_MAP['AutoLbTimeout']) @AutoLbTimeout.setter def AutoLbTimeout(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLbTimeout'], value) @property def AutoLbTimer(self): """ Returns ------- - number: The time period in seconds between LBMs. Default is 60. Min: 1 Max: 65535 """ return self._get_attribute(self._SDM_ATT_MAP['AutoLbTimer']) @AutoLbTimer.setter def AutoLbTimer(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLbTimer'], value) @property def AutoLmIteration(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['AutoLmIteration']) @AutoLmIteration.setter def AutoLmIteration(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLmIteration'], value) @property def AutoLmTimeout(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['AutoLmTimeout']) @AutoLmTimeout.setter def AutoLmTimeout(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLmTimeout'], value) @property def AutoLmTimer(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['AutoLmTimer']) @AutoLmTimer.setter def AutoLmTimer(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLmTimer'], value) @property def AutoLtAllDestination(self): """ Returns ------- - bool: If true, enables the automatic sending to Link Trace Messages. """ return self._get_attribute(self._SDM_ATT_MAP['AutoLtAllDestination']) @AutoLtAllDestination.setter def AutoLtAllDestination(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLtAllDestination'], value) @property def AutoLtDestination(self): """ Returns ------- - str: Sets the link trance destination MAC address. """ return self._get_attribute(self._SDM_ATT_MAP['AutoLtDestination']) @AutoLtDestination.setter def AutoLtDestination(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLtDestination'], value) @property def AutoLtIteration(self): """ Returns ------- - number: The count for how many times LTM will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 """ return self._get_attribute(self._SDM_ATT_MAP['AutoLtIteration']) @AutoLtIteration.setter def AutoLtIteration(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLtIteration'], value) @property def AutoLtTimeout(self): """ Returns ------- - number: The timeout period in seconds to wait for a response to LTMs. This value should be less than the Auto LT Timer. Default is 30. Min: 1 Max: 65535 """ return self._get_attribute(self._SDM_ATT_MAP['AutoLtTimeout']) @AutoLtTimeout.setter def AutoLtTimeout(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLtTimeout'], value) @property def AutoLtTimer(self): """ Returns ------- - number: The time period in seconds between LTMs. Default is 60. Min: 1 Max: 65535 """ return self._get_attribute(self._SDM_ATT_MAP['AutoLtTimer']) @AutoLtTimer.setter def AutoLtTimer(self, value): self._set_attribute(self._SDM_ATT_MAP['AutoLtTimer'], value) @property def CciInterval(self): """ Returns ------- - str(3.33msec | 10msec | 100msec | 1sec | 10sec | 1min | 10min): Sets the Continuity Check Interval (CCI). """ return self._get_attribute(self._SDM_ATT_MAP['CciInterval']) @CciInterval.setter def CciInterval(self, value): self._set_attribute(self._SDM_ATT_MAP['CciInterval'], value) @property def CcmLmmTxFcf(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['CcmLmmTxFcf']) @CcmLmmTxFcf.setter def CcmLmmTxFcf(self, value): self._set_attribute(self._SDM_ATT_MAP['CcmLmmTxFcf'], value) @property def CcmLmmTxFcfStep(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['CcmLmmTxFcfStep']) @CcmLmmTxFcfStep.setter def CcmLmmTxFcfStep(self, value): self._set_attribute(self._SDM_ATT_MAP['CcmLmmTxFcfStep'], value) @property def CcmPriority(self): """ Returns ------- - number: Sets the priority for Continuity Check Messages. The default is 0. Min: 0 Max: 7 """ return self._get_attribute(self._SDM_ATT_MAP['CcmPriority']) @CcmPriority.setter def CcmPriority(self, value): self._set_attribute(self._SDM_ATT_MAP['CcmPriority'], value) @property def CcmRxFcb(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['CcmRxFcb']) @CcmRxFcb.setter def CcmRxFcb(self, value): self._set_attribute(self._SDM_ATT_MAP['CcmRxFcb'], value) @property def CcmRxFcbStep(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['CcmRxFcbStep']) @CcmRxFcbStep.setter def CcmRxFcbStep(self, value): self._set_attribute(self._SDM_ATT_MAP['CcmRxFcbStep'], value) @property def ChassisId(self): """ Returns ------- - str: Sets the chassis identification. Default is 00 00 00 00 00 00. This will take Hex value as input (0-255 byte). """ return self._get_attribute(self._SDM_ATT_MAP['ChassisId']) @ChassisId.setter def ChassisId(self, value): self._set_attribute(self._SDM_ATT_MAP['ChassisId'], value) @property def ChassisIdLength(self): """ Returns ------- - number: Sets the length of the Chassis ID field. Default is 6. Min: 0 Max: 255. """ return self._get_attribute(self._SDM_ATT_MAP['ChassisIdLength']) @ChassisIdLength.setter def ChassisIdLength(self, value): self._set_attribute(self._SDM_ATT_MAP['ChassisIdLength'], value) @property def ChassisIdSubType(self): """ Returns ------- - str(chassisComponent | interfaceAlias | portComponent | macAddress | networkAddress | interfaceName | locallyAssigned): Sets the chassis identifier sub-type for the optional TLV messages. Options are: """ return self._get_attribute(self._SDM_ATT_MAP['ChassisIdSubType']) @ChassisIdSubType.setter def ChassisIdSubType(self, value): self._set_attribute(self._SDM_ATT_MAP['ChassisIdSubType'], value) @property def DataTlvLength(self): """ Returns ------- - number: Sets the length of the Data TLV field. Default is 4. Min: 0 Max: 1500. """ return self._get_attribute(self._SDM_ATT_MAP['DataTlvLength']) @DataTlvLength.setter def DataTlvLength(self, value): self._set_attribute(self._SDM_ATT_MAP['DataTlvLength'], value) @property def DataTlvValue(self): """ Returns ------- - str: This attribute will take Hex value of data. This data TLV will be added both for periodic LBM and requested LBM transmit. Default is 44 61 74 61. """ return self._get_attribute(self._SDM_ATT_MAP['DataTlvValue']) @DataTlvValue.setter def DataTlvValue(self, value): self._set_attribute(self._SDM_ATT_MAP['DataTlvValue'], value) @property def DmMethod(self): """ Returns ------- - str(twoWay | oneWay): The type of Delay Measurment support. """ return self._get_attribute(self._SDM_ATT_MAP['DmMethod']) @DmMethod.setter def DmMethod(self, value): self._set_attribute(self._SDM_ATT_MAP['DmMethod'], value) @property def DmPriority(self): """ Returns ------- - number: Sets the priority for DM Messages. This priority will be used only for periodic DMMs one-way or two-way (for both type of DM Methodfor each MIP). The default is 0. """ return self._get_attribute(self._SDM_ATT_MAP['DmPriority']) @DmPriority.setter def DmPriority(self, value): self._set_attribute(self._SDM_ATT_MAP['DmPriority'], value) @property def DmmPriority(self): """DEPRECATED Returns ------- - number: Sets the priority for DM Messages. This priority will be used only for periodic DMMs. The default is 0. Min: 0 Max: 7 """ return self._get_attribute(self._SDM_ATT_MAP['DmmPriority']) @DmmPriority.setter def DmmPriority(self, value): self._set_attribute(self._SDM_ATT_MAP['DmmPriority'], value) @property def EnableAisRx(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['EnableAisRx']) @EnableAisRx.setter def EnableAisRx(self, value): self._set_attribute(self._SDM_ATT_MAP['EnableAisRx'], value) @property def EnableAutoDm(self): """ Returns ------- - bool: If true, enables the automatic sending of DM Messages. """ return self._get_attribute(self._SDM_ATT_MAP['EnableAutoDm']) @EnableAutoDm.setter def EnableAutoDm(self, value): self._set_attribute(self._SDM_ATT_MAP['EnableAutoDm'], value) @property def EnableAutoLb(self): """ Returns ------- - bool: If true, enables the automatic sending of Loopback messages. """ return self._get_attribute(self._SDM_ATT_MAP['EnableAutoLb']) @EnableAutoLb.setter def EnableAutoLb(self, value): self._set_attribute(self._SDM_ATT_MAP['EnableAutoLb'], value) @property def EnableAutoLm(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['EnableAutoLm']) @EnableAutoLm.setter def EnableAutoLm(self, value): self._set_attribute(self._SDM_ATT_MAP['EnableAutoLm'], value) @property def EnableAutoLt(self): """ Returns ------- - bool: If true, enables the automatic sending of Link Trace messages. """ return self._get_attribute(self._SDM_ATT_MAP['EnableAutoLt']) @EnableAutoLt.setter def EnableAutoLt(self, value): self._set_attribute(self._SDM_ATT_MAP['EnableAutoLt'], value) @property def EnableLckRx(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['EnableLckRx']) @EnableLckRx.setter def EnableLckRx(self, value): self._set_attribute(self._SDM_ATT_MAP['EnableLckRx'], value) @property def EnableLmCounterUpdate(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['EnableLmCounterUpdate']) @EnableLmCounterUpdate.setter def EnableLmCounterUpdate(self, value): self._set_attribute(self._SDM_ATT_MAP['EnableLmCounterUpdate'], value) @property def EnableTstRx(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['EnableTstRx']) @EnableTstRx.setter def EnableTstRx(self, value): self._set_attribute(self._SDM_ATT_MAP['EnableTstRx'], value) @property def Enabled(self): """ Returns ------- - bool: If true, the MP is enabled. """ return self._get_attribute(self._SDM_ATT_MAP['Enabled']) @Enabled.setter def Enabled(self, value): self._set_attribute(self._SDM_ATT_MAP['Enabled'], value) @property def InterRemoteMepRxIncrementStep(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['InterRemoteMepRxIncrementStep']) @InterRemoteMepRxIncrementStep.setter def InterRemoteMepRxIncrementStep(self, value): self._set_attribute(self._SDM_ATT_MAP['InterRemoteMepRxIncrementStep'], value) @property def InterRemoteMepTxIncrementStep(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['InterRemoteMepTxIncrementStep']) @InterRemoteMepTxIncrementStep.setter def InterRemoteMepTxIncrementStep(self, value): self._set_attribute(self._SDM_ATT_MAP['InterRemoteMepTxIncrementStep'], value) @property def LbmPriority(self): """ Returns ------- - number: Sets the priority for Loopback Messages. This priority will be used only for periodic LBMs. The default is 0. Min: 0 Max: 7 """ return self._get_attribute(self._SDM_ATT_MAP['LbmPriority']) @LbmPriority.setter def LbmPriority(self, value): self._set_attribute(self._SDM_ATT_MAP['LbmPriority'], value) @property def LckEnableUnicastMac(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LckEnableUnicastMac']) @LckEnableUnicastMac.setter def LckEnableUnicastMac(self, value): self._set_attribute(self._SDM_ATT_MAP['LckEnableUnicastMac'], value) @property def LckInterval(self): """ Returns ------- - str(oneSec | oneMin): NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LckInterval']) @LckInterval.setter def LckInterval(self, value): self._set_attribute(self._SDM_ATT_MAP['LckInterval'], value) @property def LckMode(self): """ Returns ------- - str(auto | start | stop): NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LckMode']) @LckMode.setter def LckMode(self, value): self._set_attribute(self._SDM_ATT_MAP['LckMode'], value) @property def LckPriority(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LckPriority']) @LckPriority.setter def LckPriority(self, value): self._set_attribute(self._SDM_ATT_MAP['LckPriority'], value) @property def LckSupportAisGeneration(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LckSupportAisGeneration']) @LckSupportAisGeneration.setter def LckSupportAisGeneration(self, value): self._set_attribute(self._SDM_ATT_MAP['LckSupportAisGeneration'], value) @property def LckUnicastMac(self): """ Returns ------- - str: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LckUnicastMac']) @LckUnicastMac.setter def LckUnicastMac(self, value): self._set_attribute(self._SDM_ATT_MAP['LckUnicastMac'], value) @property def LmAllRemoteMeps(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LmAllRemoteMeps']) @LmAllRemoteMeps.setter def LmAllRemoteMeps(self, value): self._set_attribute(self._SDM_ATT_MAP['LmAllRemoteMeps'], value) @property def LmDestinationMacAddress(self): """ Returns ------- - str: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LmDestinationMacAddress']) @LmDestinationMacAddress.setter def LmDestinationMacAddress(self, value): self._set_attribute(self._SDM_ATT_MAP['LmDestinationMacAddress'], value) @property def LmMethod(self): """ Returns ------- - str(singleEnded | dualEnded): NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LmMethod']) @LmMethod.setter def LmMethod(self, value): self._set_attribute(self._SDM_ATT_MAP['LmMethod'], value) @property def LmmPriority(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LmmPriority']) @LmmPriority.setter def LmmPriority(self, value): self._set_attribute(self._SDM_ATT_MAP['LmmPriority'], value) @property def LmrPriority(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LmrPriority']) @LmrPriority.setter def LmrPriority(self, value): self._set_attribute(self._SDM_ATT_MAP['LmrPriority'], value) @property def LmrRxFcf(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LmrRxFcf']) @LmrRxFcf.setter def LmrRxFcf(self, value): self._set_attribute(self._SDM_ATT_MAP['LmrRxFcf'], value) @property def LmrRxFcfStep(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['LmrRxFcfStep']) @LmrRxFcfStep.setter def LmrRxFcfStep(self, value): self._set_attribute(self._SDM_ATT_MAP['LmrRxFcfStep'], value) @property def LtmPriority(self): """ Returns ------- - number: Sets the priority for Link Trace Messages. This priority will be used only for periodic LTMs. The default is 0. Min: 0 Max: 7 """ return self._get_attribute(self._SDM_ATT_MAP['LtmPriority']) @LtmPriority.setter def LtmPriority(self, value): self._set_attribute(self._SDM_ATT_MAP['LtmPriority'], value) @property def MacAddress(self): """ Returns ------- - str: The MAC address of the MP. """ return self._get_attribute(self._SDM_ATT_MAP['MacAddress']) @MacAddress.setter def MacAddress(self, value): self._set_attribute(self._SDM_ATT_MAP['MacAddress'], value) @property def ManagementAddress(self): """ Returns ------- - str: Sets the MP management address. Input type is HEX (0-255 byte). Default is 01 02 03 03 04 05. """ return self._get_attribute(self._SDM_ATT_MAP['ManagementAddress']) @ManagementAddress.setter def ManagementAddress(self, value): self._set_attribute(self._SDM_ATT_MAP['ManagementAddress'], value) @property def ManagementAddressDomain(self): """ Returns ------- - str: Sets the MP management address domain. This will take HEX input (0-255 byte). Default is 4d 61 6e 61 67 65 6d 65 6e 74 20 41 64 64 72 20 44 6f 6d 61 69 6e (Management Addr Domain). """ return self._get_attribute(self._SDM_ATT_MAP['ManagementAddressDomain']) @ManagementAddressDomain.setter def ManagementAddressDomain(self, value): self._set_attribute(self._SDM_ATT_MAP['ManagementAddressDomain'], value) @property def ManagementAddressDomainLength(self): """ Returns ------- - number: Sets the length of the Management address domain field. Default is 22. Min: 0 Max: 255. """ return self._get_attribute(self._SDM_ATT_MAP['ManagementAddressDomainLength']) @ManagementAddressDomainLength.setter def ManagementAddressDomainLength(self, value): self._set_attribute(self._SDM_ATT_MAP['ManagementAddressDomainLength'], value) @property def ManagementAddressLength(self): """ Returns ------- - number: Sets the length of the Management address field. Default is 6. Min: 0 Max: 255. """ return self._get_attribute(self._SDM_ATT_MAP['ManagementAddressLength']) @ManagementAddressLength.setter def ManagementAddressLength(self, value): self._set_attribute(self._SDM_ATT_MAP['ManagementAddressLength'], value) @property def MdLevel(self): """ Returns ------- - str(None | /api/v1/sessions/1/ixnetwork/vport/.../mdLevel): The MD level of the MP. The MD level must be previously configured. """ return self._get_attribute(self._SDM_ATT_MAP['MdLevel']) @MdLevel.setter def MdLevel(self, value): self._set_attribute(self._SDM_ATT_MAP['MdLevel'], value) @property def MegId(self): """ Returns ------- - str: The MEG identifier of the MP. This is for use with ITU-T Y.1731. """ return self._get_attribute(self._SDM_ATT_MAP['MegId']) @MegId.setter def MegId(self, value): self._set_attribute(self._SDM_ATT_MAP['MegId'], value) @property def MegIdFormat(self): """ Returns ------- - str(iccBasedFormat | primaryVid | characterString | 2octetInteger | rfc2685VpnId): The MEG identifier format. """ return self._get_attribute(self._SDM_ATT_MAP['MegIdFormat']) @MegIdFormat.setter def MegIdFormat(self, value): self._set_attribute(self._SDM_ATT_MAP['MegIdFormat'], value) @property def MepId(self): """ Returns ------- - number: The MEP identifier. """ return self._get_attribute(self._SDM_ATT_MAP['MepId']) @MepId.setter def MepId(self, value): self._set_attribute(self._SDM_ATT_MAP['MepId'], value) @property def MipId(self): """ Returns ------- - number: The MIP identifier. """ return self._get_attribute(self._SDM_ATT_MAP['MipId']) @MipId.setter def MipId(self, value): self._set_attribute(self._SDM_ATT_MAP['MipId'], value) @property def MpType(self): """ Returns ------- - str(mip | mep): Sets the MP type. """ return self._get_attribute(self._SDM_ATT_MAP['MpType']) @MpType.setter def MpType(self, value): self._set_attribute(self._SDM_ATT_MAP['MpType'], value) @property def OrganizationSpecificTlvLength(self): """ Returns ------- - number: Sets the length of the organizational specific TLV field. Default is 4. Min: 4 Max: 1500 """ return self._get_attribute(self._SDM_ATT_MAP['OrganizationSpecificTlvLength']) @OrganizationSpecificTlvLength.setter def OrganizationSpecificTlvLength(self, value): self._set_attribute(self._SDM_ATT_MAP['OrganizationSpecificTlvLength'], value) @property def OrganizationSpecificTlvValue(self): """ Returns ------- - str: Sets the value of the organizational specific TLV field. This attribute will take Hex value. Default is NULL. """ return self._get_attribute(self._SDM_ATT_MAP['OrganizationSpecificTlvValue']) @OrganizationSpecificTlvValue.setter def OrganizationSpecificTlvValue(self, value): self._set_attribute(self._SDM_ATT_MAP['OrganizationSpecificTlvValue'], value) @property def OverrideVlanPriority(self): """ Returns ------- - bool: If true, overrides the set VLAN priority for this bridge, and uses the advanced settings instead. """ return self._get_attribute(self._SDM_ATT_MAP['OverrideVlanPriority']) @OverrideVlanPriority.setter def OverrideVlanPriority(self, value): self._set_attribute(self._SDM_ATT_MAP['OverrideVlanPriority'], value) @property def Rdi(self): """ Returns ------- - str(auto | on | off): The Remote Defect Identification. """ return self._get_attribute(self._SDM_ATT_MAP['Rdi']) @Rdi.setter def Rdi(self, value): self._set_attribute(self._SDM_ATT_MAP['Rdi'], value) @property def ShortMaName(self): """ Returns ------- - str: Sets the Short MA name. The format is determined in shortMaNameFormat. This is used with IEEE 802.1ag. """ return self._get_attribute(self._SDM_ATT_MAP['ShortMaName']) @ShortMaName.setter def ShortMaName(self, value): self._set_attribute(self._SDM_ATT_MAP['ShortMaName'], value) @property def ShortMaNameFormat(self): """ Returns ------- - str(primaryVid | characterString | 2octetInteger | rfc2685VpnId): Sets the Short MA Name format. """ return self._get_attribute(self._SDM_ATT_MAP['ShortMaNameFormat']) @ShortMaNameFormat.setter def ShortMaNameFormat(self, value): self._set_attribute(self._SDM_ATT_MAP['ShortMaNameFormat'], value) @property def TstEnableUnicastMac(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstEnableUnicastMac']) @TstEnableUnicastMac.setter def TstEnableUnicastMac(self, value): self._set_attribute(self._SDM_ATT_MAP['TstEnableUnicastMac'], value) @property def TstIncrPacketLength(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstIncrPacketLength']) @TstIncrPacketLength.setter def TstIncrPacketLength(self, value): self._set_attribute(self._SDM_ATT_MAP['TstIncrPacketLength'], value) @property def TstIncrPacketLengthStep(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstIncrPacketLengthStep']) @TstIncrPacketLengthStep.setter def TstIncrPacketLengthStep(self, value): self._set_attribute(self._SDM_ATT_MAP['TstIncrPacketLengthStep'], value) @property def TstInitialPatternValue(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstInitialPatternValue']) @TstInitialPatternValue.setter def TstInitialPatternValue(self, value): self._set_attribute(self._SDM_ATT_MAP['TstInitialPatternValue'], value) @property def TstInterval(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstInterval']) @TstInterval.setter def TstInterval(self, value): self._set_attribute(self._SDM_ATT_MAP['TstInterval'], value) @property def TstMode(self): """ Returns ------- - str(start | stop): NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstMode']) @TstMode.setter def TstMode(self, value): self._set_attribute(self._SDM_ATT_MAP['TstMode'], value) @property def TstOverwriteSequenceNumber(self): """ Returns ------- - bool: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstOverwriteSequenceNumber']) @TstOverwriteSequenceNumber.setter def TstOverwriteSequenceNumber(self, value): self._set_attribute(self._SDM_ATT_MAP['TstOverwriteSequenceNumber'], value) @property def TstPacketLength(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstPacketLength']) @TstPacketLength.setter def TstPacketLength(self, value): self._set_attribute(self._SDM_ATT_MAP['TstPacketLength'], value) @property def TstPatternType(self): """ Returns ------- - str(nullSignalWithoutCrc32 | nullSignalWithCrc32 | prbs2311WithoutCrc32 | prbs2311WithCrc32): NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstPatternType']) @TstPatternType.setter def TstPatternType(self, value): self._set_attribute(self._SDM_ATT_MAP['TstPatternType'], value) @property def TstPriority(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstPriority']) @TstPriority.setter def TstPriority(self, value): self._set_attribute(self._SDM_ATT_MAP['TstPriority'], value) @property def TstSequenceNumber(self): """ Returns ------- - number: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstSequenceNumber']) @TstSequenceNumber.setter def TstSequenceNumber(self, value): self._set_attribute(self._SDM_ATT_MAP['TstSequenceNumber'], value) @property def TstTestType(self): """ Returns ------- - str(inService | outOfService): NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstTestType']) @TstTestType.setter def TstTestType(self, value): self._set_attribute(self._SDM_ATT_MAP['TstTestType'], value) @property def TstUnicastMac(self): """ Returns ------- - str: NOT DEFINED """ return self._get_attribute(self._SDM_ATT_MAP['TstUnicastMac']) @TstUnicastMac.setter def TstUnicastMac(self, value): self._set_attribute(self._SDM_ATT_MAP['TstUnicastMac'], value) @property def Ttl(self): """ Returns ------- - number: Sets the MP Time-to-live value. Default is 64. Min: 1 Max: 255 """ return self._get_attribute(self._SDM_ATT_MAP['Ttl']) @Ttl.setter def Ttl(self, value): self._set_attribute(self._SDM_ATT_MAP['Ttl'], value) @property def Vlan(self): """ Returns ------- - str(None | /api/v1/sessions/1/ixnetwork/vport/.../vlans): Assigns a VLAN to the MP. The VLAN must be previously configured. """ return self._get_attribute(self._SDM_ATT_MAP['Vlan']) @Vlan.setter def Vlan(self, value): self._set_attribute(self._SDM_ATT_MAP['Vlan'], value) def update(self, AddCcmCustomTlvs=None, AddDataTlv=None, AddInterfaceStatusTlv=None, AddLbmCustomTlvs=None, AddLbrCustomTlvs=None, AddLmmCustomTlvs=None, AddLmrCustomTlvs=None, AddLtmCustomTlvs=None, AddLtrCustomTlvs=None, AddOrganizationSpecificTlv=None, AddPortStatusTlv=None, AddSenderIdTlv=None, AisEnableUnicastMac=None, AisInterval=None, AisMode=None, AisPriority=None, AisUnicastMac=None, AutoDmAllDestination=None, AutoDmDestination=None, AutoDmIteration=None, AutoDmTimeout=None, AutoDmTimer=None, AutoLbAllDestination=None, AutoLbDestination=None, AutoLbIteration=None, AutoLbTimeout=None, AutoLbTimer=None, AutoLmIteration=None, AutoLmTimeout=None, AutoLmTimer=None, AutoLtAllDestination=None, AutoLtDestination=None, AutoLtIteration=None, AutoLtTimeout=None, AutoLtTimer=None, CciInterval=None, CcmLmmTxFcf=None, CcmLmmTxFcfStep=None, CcmPriority=None, CcmRxFcb=None, CcmRxFcbStep=None, ChassisId=None, ChassisIdLength=None, ChassisIdSubType=None, DataTlvLength=None, DataTlvValue=None, DmMethod=None, DmPriority=None, DmmPriority=None, EnableAisRx=None, EnableAutoDm=None, EnableAutoLb=None, EnableAutoLm=None, EnableAutoLt=None, EnableLckRx=None, EnableLmCounterUpdate=None, EnableTstRx=None, Enabled=None, InterRemoteMepRxIncrementStep=None, InterRemoteMepTxIncrementStep=None, LbmPriority=None, LckEnableUnicastMac=None, LckInterval=None, LckMode=None, LckPriority=None, LckSupportAisGeneration=None, LckUnicastMac=None, LmAllRemoteMeps=None, LmDestinationMacAddress=None, LmMethod=None, LmmPriority=None, LmrPriority=None, LmrRxFcf=None, LmrRxFcfStep=None, LtmPriority=None, MacAddress=None, ManagementAddress=None, ManagementAddressDomain=None, ManagementAddressDomainLength=None, ManagementAddressLength=None, MdLevel=None, MegId=None, MegIdFormat=None, MepId=None, MipId=None, MpType=None, OrganizationSpecificTlvLength=None, OrganizationSpecificTlvValue=None, OverrideVlanPriority=None, Rdi=None, ShortMaName=None, ShortMaNameFormat=None, TstEnableUnicastMac=None, TstIncrPacketLength=None, TstIncrPacketLengthStep=None, TstInitialPatternValue=None, TstInterval=None, TstMode=None, TstOverwriteSequenceNumber=None, TstPacketLength=None, TstPatternType=None, TstPriority=None, TstSequenceNumber=None, TstTestType=None, TstUnicastMac=None, Ttl=None, Vlan=None): """Updates mp resource on the server. Args ---- - AddCcmCustomTlvs (bool): If true, adds a custom CCM TLV to bridge messages. - AddDataTlv (bool): If true, adds a data TLV to bridge messages. - AddInterfaceStatusTlv (bool): If true, adds an interface status TLV to bridge messages. - AddLbmCustomTlvs (bool): If true, adds a custom loopback message TLV to bridge messages. - AddLbrCustomTlvs (bool): If true, adds a custom loopback response message TLV to bridge messages. - AddLmmCustomTlvs (bool): NOT DEFINED - AddLmrCustomTlvs (bool): NOT DEFINED - AddLtmCustomTlvs (bool): If true, adds a custom link trace message TLV to bridge messages. - AddLtrCustomTlvs (bool): If true, adds a custom link trace message TLV to bridge messages. - AddOrganizationSpecificTlv (bool): If true, adds a custom organization specific message TLV to bridge messages. - AddPortStatusTlv (bool): If true, adds a custom port statust message TLV to bridge messages. - AddSenderIdTlv (bool): If true, adds a custom sender ID message TLV to bridge messages. - AisEnableUnicastMac (bool): NOT DEFINED - AisInterval (str(oneSec | oneMin)): NOT DEFINED - AisMode (str(auto | start | stop)): NOT DEFINED - AisPriority (number): NOT DEFINED - AisUnicastMac (str): NOT DEFINED - AutoDmAllDestination (bool): If true, enables the automatic sending of DM Messages. - AutoDmDestination (str): The sent MAC address for the DM, if autoDmAllDestination is set to true. - AutoDmIteration (number): The count for how many times DMMs will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 - AutoDmTimeout (number): The timeout period in seconds to wait for a response to DMMs. This value should be less than the Auto LB Timer. Default is 30. Min: 1 Max: 65535 - AutoDmTimer (number): The time period in seconds between DMMs. Default is 60. Min: 1 Max: 65535 - AutoLbAllDestination (bool): If true, enables the automatic sending of Loopback Messages. - AutoLbDestination (str): Sets the loopback destination MAC address. - AutoLbIteration (number): The count for how many times LBM will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 - AutoLbTimeout (number): The timeout period in seconds to wait for a response to LTMs. This value should be less than the Auto LT Timer. Default is 30. Min: 1 Max: 65535 - AutoLbTimer (number): The time period in seconds between LBMs. Default is 60. Min: 1 Max: 65535 - AutoLmIteration (number): NOT DEFINED - AutoLmTimeout (number): NOT DEFINED - AutoLmTimer (number): NOT DEFINED - AutoLtAllDestination (bool): If true, enables the automatic sending to Link Trace Messages. - AutoLtDestination (str): Sets the link trance destination MAC address. - AutoLtIteration (number): The count for how many times LTM will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 - AutoLtTimeout (number): The timeout period in seconds to wait for a response to LTMs. This value should be less than the Auto LT Timer. Default is 30. Min: 1 Max: 65535 - AutoLtTimer (number): The time period in seconds between LTMs. Default is 60. Min: 1 Max: 65535 - CciInterval (str(3.33msec | 10msec | 100msec | 1sec | 10sec | 1min | 10min)): Sets the Continuity Check Interval (CCI). - CcmLmmTxFcf (number): NOT DEFINED - CcmLmmTxFcfStep (number): NOT DEFINED - CcmPriority (number): Sets the priority for Continuity Check Messages. The default is 0. Min: 0 Max: 7 - CcmRxFcb (number): NOT DEFINED - CcmRxFcbStep (number): NOT DEFINED - ChassisId (str): Sets the chassis identification. Default is 00 00 00 00 00 00. This will take Hex value as input (0-255 byte). - ChassisIdLength (number): Sets the length of the Chassis ID field. Default is 6. Min: 0 Max: 255. - ChassisIdSubType (str(chassisComponent | interfaceAlias | portComponent | macAddress | networkAddress | interfaceName | locallyAssigned)): Sets the chassis identifier sub-type for the optional TLV messages. Options are: - DataTlvLength (number): Sets the length of the Data TLV field. Default is 4. Min: 0 Max: 1500. - DataTlvValue (str): This attribute will take Hex value of data. This data TLV will be added both for periodic LBM and requested LBM transmit. Default is 44 61 74 61. - DmMethod (str(twoWay | oneWay)): The type of Delay Measurment support. - DmPriority (number): Sets the priority for DM Messages. This priority will be used only for periodic DMMs one-way or two-way (for both type of DM Methodfor each MIP). The default is 0. - DmmPriority (number): Sets the priority for DM Messages. This priority will be used only for periodic DMMs. The default is 0. Min: 0 Max: 7 - EnableAisRx (bool): NOT DEFINED - EnableAutoDm (bool): If true, enables the automatic sending of DM Messages. - EnableAutoLb (bool): If true, enables the automatic sending of Loopback messages. - EnableAutoLm (bool): NOT DEFINED - EnableAutoLt (bool): If true, enables the automatic sending of Link Trace messages. - EnableLckRx (bool): NOT DEFINED - EnableLmCounterUpdate (bool): NOT DEFINED - EnableTstRx (bool): NOT DEFINED - Enabled (bool): If true, the MP is enabled. - InterRemoteMepRxIncrementStep (number): NOT DEFINED - InterRemoteMepTxIncrementStep (number): NOT DEFINED - LbmPriority (number): Sets the priority for Loopback Messages. This priority will be used only for periodic LBMs. The default is 0. Min: 0 Max: 7 - LckEnableUnicastMac (bool): NOT DEFINED - LckInterval (str(oneSec | oneMin)): NOT DEFINED - LckMode (str(auto | start | stop)): NOT DEFINED - LckPriority (number): NOT DEFINED - LckSupportAisGeneration (bool): NOT DEFINED - LckUnicastMac (str): NOT DEFINED - LmAllRemoteMeps (bool): NOT DEFINED - LmDestinationMacAddress (str): NOT DEFINED - LmMethod (str(singleEnded | dualEnded)): NOT DEFINED - LmmPriority (number): NOT DEFINED - LmrPriority (number): NOT DEFINED - LmrRxFcf (number): NOT DEFINED - LmrRxFcfStep (number): NOT DEFINED - LtmPriority (number): Sets the priority for Link Trace Messages. This priority will be used only for periodic LTMs. The default is 0. Min: 0 Max: 7 - MacAddress (str): The MAC address of the MP. - ManagementAddress (str): Sets the MP management address. Input type is HEX (0-255 byte). Default is 01 02 03 03 04 05. - ManagementAddressDomain (str): Sets the MP management address domain. This will take HEX input (0-255 byte). Default is 4d 61 6e 61 67 65 6d 65 6e 74 20 41 64 64 72 20 44 6f 6d 61 69 6e (Management Addr Domain). - ManagementAddressDomainLength (number): Sets the length of the Management address domain field. Default is 22. Min: 0 Max: 255. - ManagementAddressLength (number): Sets the length of the Management address field. Default is 6. Min: 0 Max: 255. - MdLevel (str(None | /api/v1/sessions/1/ixnetwork/vport/.../mdLevel)): The MD level of the MP. The MD level must be previously configured. - MegId (str): The MEG identifier of the MP. This is for use with ITU-T Y.1731. - MegIdFormat (str(iccBasedFormat | primaryVid | characterString | 2octetInteger | rfc2685VpnId)): The MEG identifier format. - MepId (number): The MEP identifier. - MipId (number): The MIP identifier. - MpType (str(mip | mep)): Sets the MP type. - OrganizationSpecificTlvLength (number): Sets the length of the organizational specific TLV field. Default is 4. Min: 4 Max: 1500 - OrganizationSpecificTlvValue (str): Sets the value of the organizational specific TLV field. This attribute will take Hex value. Default is NULL. - OverrideVlanPriority (bool): If true, overrides the set VLAN priority for this bridge, and uses the advanced settings instead. - Rdi (str(auto | on | off)): The Remote Defect Identification. - ShortMaName (str): Sets the Short MA name. The format is determined in shortMaNameFormat. This is used with IEEE 802.1ag. - ShortMaNameFormat (str(primaryVid | characterString | 2octetInteger | rfc2685VpnId)): Sets the Short MA Name format. - TstEnableUnicastMac (bool): NOT DEFINED - TstIncrPacketLength (bool): NOT DEFINED - TstIncrPacketLengthStep (number): NOT DEFINED - TstInitialPatternValue (number): NOT DEFINED - TstInterval (number): NOT DEFINED - TstMode (str(start | stop)): NOT DEFINED - TstOverwriteSequenceNumber (bool): NOT DEFINED - TstPacketLength (number): NOT DEFINED - TstPatternType (str(nullSignalWithoutCrc32 | nullSignalWithCrc32 | prbs2311WithoutCrc32 | prbs2311WithCrc32)): NOT DEFINED - TstPriority (number): NOT DEFINED - TstSequenceNumber (number): NOT DEFINED - TstTestType (str(inService | outOfService)): NOT DEFINED - TstUnicastMac (str): NOT DEFINED - Ttl (number): Sets the MP Time-to-live value. Default is 64. Min: 1 Max: 255 - Vlan (str(None | /api/v1/sessions/1/ixnetwork/vport/.../vlans)): Assigns a VLAN to the MP. The VLAN must be previously configured. Raises ------ - ServerError: The server has encountered an uncategorized error condition """ return self._update(self._map_locals(self._SDM_ATT_MAP, locals())) def add(self, AddCcmCustomTlvs=None, AddDataTlv=None, AddInterfaceStatusTlv=None, AddLbmCustomTlvs=None, AddLbrCustomTlvs=None, AddLmmCustomTlvs=None, AddLmrCustomTlvs=None, AddLtmCustomTlvs=None, AddLtrCustomTlvs=None, AddOrganizationSpecificTlv=None, AddPortStatusTlv=None, AddSenderIdTlv=None, AisEnableUnicastMac=None, AisInterval=None, AisMode=None, AisPriority=None, AisUnicastMac=None, AutoDmAllDestination=None, AutoDmDestination=None, AutoDmIteration=None, AutoDmTimeout=None, AutoDmTimer=None, AutoLbAllDestination=None, AutoLbDestination=None, AutoLbIteration=None, AutoLbTimeout=None, AutoLbTimer=None, AutoLmIteration=None, AutoLmTimeout=None, AutoLmTimer=None, AutoLtAllDestination=None, AutoLtDestination=None, AutoLtIteration=None, AutoLtTimeout=None, AutoLtTimer=None, CciInterval=None, CcmLmmTxFcf=None, CcmLmmTxFcfStep=None, CcmPriority=None, CcmRxFcb=None, CcmRxFcbStep=None, ChassisId=None, ChassisIdLength=None, ChassisIdSubType=None, DataTlvLength=None, DataTlvValue=None, DmMethod=None, DmPriority=None, DmmPriority=None, EnableAisRx=None, EnableAutoDm=None, EnableAutoLb=None, EnableAutoLm=None, EnableAutoLt=None, EnableLckRx=None, EnableLmCounterUpdate=None, EnableTstRx=None, Enabled=None, InterRemoteMepRxIncrementStep=None, InterRemoteMepTxIncrementStep=None, LbmPriority=None, LckEnableUnicastMac=None, LckInterval=None, LckMode=None, LckPriority=None, LckSupportAisGeneration=None, LckUnicastMac=None, LmAllRemoteMeps=None, LmDestinationMacAddress=None, LmMethod=None, LmmPriority=None, LmrPriority=None, LmrRxFcf=None, LmrRxFcfStep=None, LtmPriority=None, MacAddress=None, ManagementAddress=None, ManagementAddressDomain=None, ManagementAddressDomainLength=None, ManagementAddressLength=None, MdLevel=None, MegId=None, MegIdFormat=None, MepId=None, MipId=None, MpType=None, OrganizationSpecificTlvLength=None, OrganizationSpecificTlvValue=None, OverrideVlanPriority=None, Rdi=None, ShortMaName=None, ShortMaNameFormat=None, TstEnableUnicastMac=None, TstIncrPacketLength=None, TstIncrPacketLengthStep=None, TstInitialPatternValue=None, TstInterval=None, TstMode=None, TstOverwriteSequenceNumber=None, TstPacketLength=None, TstPatternType=None, TstPriority=None, TstSequenceNumber=None, TstTestType=None, TstUnicastMac=None, Ttl=None, Vlan=None): """Adds a new mp resource on the server and adds it to the container. Args ---- - AddCcmCustomTlvs (bool): If true, adds a custom CCM TLV to bridge messages. - AddDataTlv (bool): If true, adds a data TLV to bridge messages. - AddInterfaceStatusTlv (bool): If true, adds an interface status TLV to bridge messages. - AddLbmCustomTlvs (bool): If true, adds a custom loopback message TLV to bridge messages. - AddLbrCustomTlvs (bool): If true, adds a custom loopback response message TLV to bridge messages. - AddLmmCustomTlvs (bool): NOT DEFINED - AddLmrCustomTlvs (bool): NOT DEFINED - AddLtmCustomTlvs (bool): If true, adds a custom link trace message TLV to bridge messages. - AddLtrCustomTlvs (bool): If true, adds a custom link trace message TLV to bridge messages. - AddOrganizationSpecificTlv (bool): If true, adds a custom organization specific message TLV to bridge messages. - AddPortStatusTlv (bool): If true, adds a custom port statust message TLV to bridge messages. - AddSenderIdTlv (bool): If true, adds a custom sender ID message TLV to bridge messages. - AisEnableUnicastMac (bool): NOT DEFINED - AisInterval (str(oneSec | oneMin)): NOT DEFINED - AisMode (str(auto | start | stop)): NOT DEFINED - AisPriority (number): NOT DEFINED - AisUnicastMac (str): NOT DEFINED - AutoDmAllDestination (bool): If true, enables the automatic sending of DM Messages. - AutoDmDestination (str): The sent MAC address for the DM, if autoDmAllDestination is set to true. - AutoDmIteration (number): The count for how many times DMMs will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 - AutoDmTimeout (number): The timeout period in seconds to wait for a response to DMMs. This value should be less than the Auto LB Timer. Default is 30. Min: 1 Max: 65535 - AutoDmTimer (number): The time period in seconds between DMMs. Default is 60. Min: 1 Max: 65535 - AutoLbAllDestination (bool): If true, enables the automatic sending of Loopback Messages. - AutoLbDestination (str): Sets the loopback destination MAC address. - AutoLbIteration (number): The count for how many times LBM will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 - AutoLbTimeout (number): The timeout period in seconds to wait for a response to LTMs. This value should be less than the Auto LT Timer. Default is 30. Min: 1 Max: 65535 - AutoLbTimer (number): The time period in seconds between LBMs. Default is 60. Min: 1 Max: 65535 - AutoLmIteration (number): NOT DEFINED - AutoLmTimeout (number): NOT DEFINED - AutoLmTimer (number): NOT DEFINED - AutoLtAllDestination (bool): If true, enables the automatic sending to Link Trace Messages. - AutoLtDestination (str): Sets the link trance destination MAC address. - AutoLtIteration (number): The count for how many times LTM will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 - AutoLtTimeout (number): The timeout period in seconds to wait for a response to LTMs. This value should be less than the Auto LT Timer. Default is 30. Min: 1 Max: 65535 - AutoLtTimer (number): The time period in seconds between LTMs. Default is 60. Min: 1 Max: 65535 - CciInterval (str(3.33msec | 10msec | 100msec | 1sec | 10sec | 1min | 10min)): Sets the Continuity Check Interval (CCI). - CcmLmmTxFcf (number): NOT DEFINED - CcmLmmTxFcfStep (number): NOT DEFINED - CcmPriority (number): Sets the priority for Continuity Check Messages. The default is 0. Min: 0 Max: 7 - CcmRxFcb (number): NOT DEFINED - CcmRxFcbStep (number): NOT DEFINED - ChassisId (str): Sets the chassis identification. Default is 00 00 00 00 00 00. This will take Hex value as input (0-255 byte). - ChassisIdLength (number): Sets the length of the Chassis ID field. Default is 6. Min: 0 Max: 255. - ChassisIdSubType (str(chassisComponent | interfaceAlias | portComponent | macAddress | networkAddress | interfaceName | locallyAssigned)): Sets the chassis identifier sub-type for the optional TLV messages. Options are: - DataTlvLength (number): Sets the length of the Data TLV field. Default is 4. Min: 0 Max: 1500. - DataTlvValue (str): This attribute will take Hex value of data. This data TLV will be added both for periodic LBM and requested LBM transmit. Default is 44 61 74 61. - DmMethod (str(twoWay | oneWay)): The type of Delay Measurment support. - DmPriority (number): Sets the priority for DM Messages. This priority will be used only for periodic DMMs one-way or two-way (for both type of DM Methodfor each MIP). The default is 0. - DmmPriority (number): Sets the priority for DM Messages. This priority will be used only for periodic DMMs. The default is 0. Min: 0 Max: 7 - EnableAisRx (bool): NOT DEFINED - EnableAutoDm (bool): If true, enables the automatic sending of DM Messages. - EnableAutoLb (bool): If true, enables the automatic sending of Loopback messages. - EnableAutoLm (bool): NOT DEFINED - EnableAutoLt (bool): If true, enables the automatic sending of Link Trace messages. - EnableLckRx (bool): NOT DEFINED - EnableLmCounterUpdate (bool): NOT DEFINED - EnableTstRx (bool): NOT DEFINED - Enabled (bool): If true, the MP is enabled. - InterRemoteMepRxIncrementStep (number): NOT DEFINED - InterRemoteMepTxIncrementStep (number): NOT DEFINED - LbmPriority (number): Sets the priority for Loopback Messages. This priority will be used only for periodic LBMs. The default is 0. Min: 0 Max: 7 - LckEnableUnicastMac (bool): NOT DEFINED - LckInterval (str(oneSec | oneMin)): NOT DEFINED - LckMode (str(auto | start | stop)): NOT DEFINED - LckPriority (number): NOT DEFINED - LckSupportAisGeneration (bool): NOT DEFINED - LckUnicastMac (str): NOT DEFINED - LmAllRemoteMeps (bool): NOT DEFINED - LmDestinationMacAddress (str): NOT DEFINED - LmMethod (str(singleEnded | dualEnded)): NOT DEFINED - LmmPriority (number): NOT DEFINED - LmrPriority (number): NOT DEFINED - LmrRxFcf (number): NOT DEFINED - LmrRxFcfStep (number): NOT DEFINED - LtmPriority (number): Sets the priority for Link Trace Messages. This priority will be used only for periodic LTMs. The default is 0. Min: 0 Max: 7 - MacAddress (str): The MAC address of the MP. - ManagementAddress (str): Sets the MP management address. Input type is HEX (0-255 byte). Default is 01 02 03 03 04 05. - ManagementAddressDomain (str): Sets the MP management address domain. This will take HEX input (0-255 byte). Default is 4d 61 6e 61 67 65 6d 65 6e 74 20 41 64 64 72 20 44 6f 6d 61 69 6e (Management Addr Domain). - ManagementAddressDomainLength (number): Sets the length of the Management address domain field. Default is 22. Min: 0 Max: 255. - ManagementAddressLength (number): Sets the length of the Management address field. Default is 6. Min: 0 Max: 255. - MdLevel (str(None | /api/v1/sessions/1/ixnetwork/vport/.../mdLevel)): The MD level of the MP. The MD level must be previously configured. - MegId (str): The MEG identifier of the MP. This is for use with ITU-T Y.1731. - MegIdFormat (str(iccBasedFormat | primaryVid | characterString | 2octetInteger | rfc2685VpnId)): The MEG identifier format. - MepId (number): The MEP identifier. - MipId (number): The MIP identifier. - MpType (str(mip | mep)): Sets the MP type. - OrganizationSpecificTlvLength (number): Sets the length of the organizational specific TLV field. Default is 4. Min: 4 Max: 1500 - OrganizationSpecificTlvValue (str): Sets the value of the organizational specific TLV field. This attribute will take Hex value. Default is NULL. - OverrideVlanPriority (bool): If true, overrides the set VLAN priority for this bridge, and uses the advanced settings instead. - Rdi (str(auto | on | off)): The Remote Defect Identification. - ShortMaName (str): Sets the Short MA name. The format is determined in shortMaNameFormat. This is used with IEEE 802.1ag. - ShortMaNameFormat (str(primaryVid | characterString | 2octetInteger | rfc2685VpnId)): Sets the Short MA Name format. - TstEnableUnicastMac (bool): NOT DEFINED - TstIncrPacketLength (bool): NOT DEFINED - TstIncrPacketLengthStep (number): NOT DEFINED - TstInitialPatternValue (number): NOT DEFINED - TstInterval (number): NOT DEFINED - TstMode (str(start | stop)): NOT DEFINED - TstOverwriteSequenceNumber (bool): NOT DEFINED - TstPacketLength (number): NOT DEFINED - TstPatternType (str(nullSignalWithoutCrc32 | nullSignalWithCrc32 | prbs2311WithoutCrc32 | prbs2311WithCrc32)): NOT DEFINED - TstPriority (number): NOT DEFINED - TstSequenceNumber (number): NOT DEFINED - TstTestType (str(inService | outOfService)): NOT DEFINED - TstUnicastMac (str): NOT DEFINED - Ttl (number): Sets the MP Time-to-live value. Default is 64. Min: 1 Max: 255 - Vlan (str(None | /api/v1/sessions/1/ixnetwork/vport/.../vlans)): Assigns a VLAN to the MP. The VLAN must be previously configured. Returns ------- - self: This instance with all currently retrieved mp resources using find and the newly added mp resources available through an iterator or index Raises ------ - ServerError: The server has encountered an uncategorized error condition """ return self._create(self._map_locals(self._SDM_ATT_MAP, locals())) def remove(self): """Deletes all the contained mp resources in this instance from the server. Raises ------ - NotFoundError: The requested resource does not exist on the server - ServerError: The server has encountered an uncategorized error condition """ self._delete() def find(self, AddCcmCustomTlvs=None, AddDataTlv=None, AddInterfaceStatusTlv=None, AddLbmCustomTlvs=None, AddLbrCustomTlvs=None, AddLmmCustomTlvs=None, AddLmrCustomTlvs=None, AddLtmCustomTlvs=None, AddLtrCustomTlvs=None, AddOrganizationSpecificTlv=None, AddPortStatusTlv=None, AddSenderIdTlv=None, AisEnableUnicastMac=None, AisInterval=None, AisMode=None, AisPriority=None, AisUnicastMac=None, AutoDmAllDestination=None, AutoDmDestination=None, AutoDmIteration=None, AutoDmTimeout=None, AutoDmTimer=None, AutoLbAllDestination=None, AutoLbDestination=None, AutoLbIteration=None, AutoLbTimeout=None, AutoLbTimer=None, AutoLmIteration=None, AutoLmTimeout=None, AutoLmTimer=None, AutoLtAllDestination=None, AutoLtDestination=None, AutoLtIteration=None, AutoLtTimeout=None, AutoLtTimer=None, CciInterval=None, CcmLmmTxFcf=None, CcmLmmTxFcfStep=None, CcmPriority=None, CcmRxFcb=None, CcmRxFcbStep=None, ChassisId=None, ChassisIdLength=None, ChassisIdSubType=None, DataTlvLength=None, DataTlvValue=None, DmMethod=None, DmPriority=None, DmmPriority=None, EnableAisRx=None, EnableAutoDm=None, EnableAutoLb=None, EnableAutoLm=None, EnableAutoLt=None, EnableLckRx=None, EnableLmCounterUpdate=None, EnableTstRx=None, Enabled=None, InterRemoteMepRxIncrementStep=None, InterRemoteMepTxIncrementStep=None, LbmPriority=None, LckEnableUnicastMac=None, LckInterval=None, LckMode=None, LckPriority=None, LckSupportAisGeneration=None, LckUnicastMac=None, LmAllRemoteMeps=None, LmDestinationMacAddress=None, LmMethod=None, LmmPriority=None, LmrPriority=None, LmrRxFcf=None, LmrRxFcfStep=None, LtmPriority=None, MacAddress=None, ManagementAddress=None, ManagementAddressDomain=None, ManagementAddressDomainLength=None, ManagementAddressLength=None, MdLevel=None, MegId=None, MegIdFormat=None, MepId=None, MipId=None, MpType=None, OrganizationSpecificTlvLength=None, OrganizationSpecificTlvValue=None, OverrideVlanPriority=None, Rdi=None, ShortMaName=None, ShortMaNameFormat=None, TstEnableUnicastMac=None, TstIncrPacketLength=None, TstIncrPacketLengthStep=None, TstInitialPatternValue=None, TstInterval=None, TstMode=None, TstOverwriteSequenceNumber=None, TstPacketLength=None, TstPatternType=None, TstPriority=None, TstSequenceNumber=None, TstTestType=None, TstUnicastMac=None, Ttl=None, Vlan=None): """Finds and retrieves mp resources from the server. All named parameters are evaluated on the server using regex. The named parameters can be used to selectively retrieve mp resources from the server. To retrieve an exact match ensure the parameter value starts with ^ and ends with $ By default the find method takes no parameters and will retrieve all mp resources from the server. Args ---- - AddCcmCustomTlvs (bool): If true, adds a custom CCM TLV to bridge messages. - AddDataTlv (bool): If true, adds a data TLV to bridge messages. - AddInterfaceStatusTlv (bool): If true, adds an interface status TLV to bridge messages. - AddLbmCustomTlvs (bool): If true, adds a custom loopback message TLV to bridge messages. - AddLbrCustomTlvs (bool): If true, adds a custom loopback response message TLV to bridge messages. - AddLmmCustomTlvs (bool): NOT DEFINED - AddLmrCustomTlvs (bool): NOT DEFINED - AddLtmCustomTlvs (bool): If true, adds a custom link trace message TLV to bridge messages. - AddLtrCustomTlvs (bool): If true, adds a custom link trace message TLV to bridge messages. - AddOrganizationSpecificTlv (bool): If true, adds a custom organization specific message TLV to bridge messages. - AddPortStatusTlv (bool): If true, adds a custom port statust message TLV to bridge messages. - AddSenderIdTlv (bool): If true, adds a custom sender ID message TLV to bridge messages. - AisEnableUnicastMac (bool): NOT DEFINED - AisInterval (str(oneSec | oneMin)): NOT DEFINED - AisMode (str(auto | start | stop)): NOT DEFINED - AisPriority (number): NOT DEFINED - AisUnicastMac (str): NOT DEFINED - AutoDmAllDestination (bool): If true, enables the automatic sending of DM Messages. - AutoDmDestination (str): The sent MAC address for the DM, if autoDmAllDestination is set to true. - AutoDmIteration (number): The count for how many times DMMs will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 - AutoDmTimeout (number): The timeout period in seconds to wait for a response to DMMs. This value should be less than the Auto LB Timer. Default is 30. Min: 1 Max: 65535 - AutoDmTimer (number): The time period in seconds between DMMs. Default is 60. Min: 1 Max: 65535 - AutoLbAllDestination (bool): If true, enables the automatic sending of Loopback Messages. - AutoLbDestination (str): Sets the loopback destination MAC address. - AutoLbIteration (number): The count for how many times LBM will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 - AutoLbTimeout (number): The timeout period in seconds to wait for a response to LTMs. This value should be less than the Auto LT Timer. Default is 30. Min: 1 Max: 65535 - AutoLbTimer (number): The time period in seconds between LBMs. Default is 60. Min: 1 Max: 65535 - AutoLmIteration (number): NOT DEFINED - AutoLmTimeout (number): NOT DEFINED - AutoLmTimer (number): NOT DEFINED - AutoLtAllDestination (bool): If true, enables the automatic sending to Link Trace Messages. - AutoLtDestination (str): Sets the link trance destination MAC address. - AutoLtIteration (number): The count for how many times LTM will be transmitted. Default is 0 (no limit). Min: 0 Max: 2^32 - AutoLtTimeout (number): The timeout period in seconds to wait for a response to LTMs. This value should be less than the Auto LT Timer. Default is 30. Min: 1 Max: 65535 - AutoLtTimer (number): The time period in seconds between LTMs. Default is 60. Min: 1 Max: 65535 - CciInterval (str(3.33msec | 10msec | 100msec | 1sec | 10sec | 1min | 10min)): Sets the Continuity Check Interval (CCI). - CcmLmmTxFcf (number): NOT DEFINED - CcmLmmTxFcfStep (number): NOT DEFINED - CcmPriority (number): Sets the priority for Continuity Check Messages. The default is 0. Min: 0 Max: 7 - CcmRxFcb (number): NOT DEFINED - CcmRxFcbStep (number): NOT DEFINED - ChassisId (str): Sets the chassis identification. Default is 00 00 00 00 00 00. This will take Hex value as input (0-255 byte). - ChassisIdLength (number): Sets the length of the Chassis ID field. Default is 6. Min: 0 Max: 255. - ChassisIdSubType (str(chassisComponent | interfaceAlias | portComponent | macAddress | networkAddress | interfaceName | locallyAssigned)): Sets the chassis identifier sub-type for the optional TLV messages. Options are: - DataTlvLength (number): Sets the length of the Data TLV field. Default is 4. Min: 0 Max: 1500. - DataTlvValue (str): This attribute will take Hex value of data. This data TLV will be added both for periodic LBM and requested LBM transmit. Default is 44 61 74 61. - DmMethod (str(twoWay | oneWay)): The type of Delay Measurment support. - DmPriority (number): Sets the priority for DM Messages. This priority will be used only for periodic DMMs one-way or two-way (for both type of DM Methodfor each MIP). The default is 0. - DmmPriority (number): Sets the priority for DM Messages. This priority will be used only for periodic DMMs. The default is 0. Min: 0 Max: 7 - EnableAisRx (bool): NOT DEFINED - EnableAutoDm (bool): If true, enables the automatic sending of DM Messages. - EnableAutoLb (bool): If true, enables the automatic sending of Loopback messages. - EnableAutoLm (bool): NOT DEFINED - EnableAutoLt (bool): If true, enables the automatic sending of Link Trace messages. - EnableLckRx (bool): NOT DEFINED - EnableLmCounterUpdate (bool): NOT DEFINED - EnableTstRx (bool): NOT DEFINED - Enabled (bool): If true, the MP is enabled. - InterRemoteMepRxIncrementStep (number): NOT DEFINED - InterRemoteMepTxIncrementStep (number): NOT DEFINED - LbmPriority (number): Sets the priority for Loopback Messages. This priority will be used only for periodic LBMs. The default is 0. Min: 0 Max: 7 - LckEnableUnicastMac (bool): NOT DEFINED - LckInterval (str(oneSec | oneMin)): NOT DEFINED - LckMode (str(auto | start | stop)): NOT DEFINED - LckPriority (number): NOT DEFINED - LckSupportAisGeneration (bool): NOT DEFINED - LckUnicastMac (str): NOT DEFINED - LmAllRemoteMeps (bool): NOT DEFINED - LmDestinationMacAddress (str): NOT DEFINED - LmMethod (str(singleEnded | dualEnded)): NOT DEFINED - LmmPriority (number): NOT DEFINED - LmrPriority (number): NOT DEFINED - LmrRxFcf (number): NOT DEFINED - LmrRxFcfStep (number): NOT DEFINED - LtmPriority (number): Sets the priority for Link Trace Messages. This priority will be used only for periodic LTMs. The default is 0. Min: 0 Max: 7 - MacAddress (str): The MAC address of the MP. - ManagementAddress (str): Sets the MP management address. Input type is HEX (0-255 byte). Default is 01 02 03 03 04 05. - ManagementAddressDomain (str): Sets the MP management address domain. This will take HEX input (0-255 byte). Default is 4d 61 6e 61 67 65 6d 65 6e 74 20 41 64 64 72 20 44 6f 6d 61 69 6e (Management Addr Domain). - ManagementAddressDomainLength (number): Sets the length of the Management address domain field. Default is 22. Min: 0 Max: 255. - ManagementAddressLength (number): Sets the length of the Management address field. Default is 6. Min: 0 Max: 255. - MdLevel (str(None | /api/v1/sessions/1/ixnetwork/vport/.../mdLevel)): The MD level of the MP. The MD level must be previously configured. - MegId (str): The MEG identifier of the MP. This is for use with ITU-T Y.1731. - MegIdFormat (str(iccBasedFormat | primaryVid | characterString | 2octetInteger | rfc2685VpnId)): The MEG identifier format. - MepId (number): The MEP identifier. - MipId (number): The MIP identifier. - MpType (str(mip | mep)): Sets the MP type. - OrganizationSpecificTlvLength (number): Sets the length of the organizational specific TLV field. Default is 4. Min: 4 Max: 1500 - OrganizationSpecificTlvValue (str): Sets the value of the organizational specific TLV field. This attribute will take Hex value. Default is NULL. - OverrideVlanPriority (bool): If true, overrides the set VLAN priority for this bridge, and uses the advanced settings instead. - Rdi (str(auto | on | off)): The Remote Defect Identification. - ShortMaName (str): Sets the Short MA name. The format is determined in shortMaNameFormat. This is used with IEEE 802.1ag. - ShortMaNameFormat (str(primaryVid | characterString | 2octetInteger | rfc2685VpnId)): Sets the Short MA Name format. - TstEnableUnicastMac (bool): NOT DEFINED - TstIncrPacketLength (bool): NOT DEFINED - TstIncrPacketLengthStep (number): NOT DEFINED - TstInitialPatternValue (number): NOT DEFINED - TstInterval (number): NOT DEFINED - TstMode (str(start | stop)): NOT DEFINED - TstOverwriteSequenceNumber (bool): NOT DEFINED - TstPacketLength (number): NOT DEFINED - TstPatternType (str(nullSignalWithoutCrc32 | nullSignalWithCrc32 | prbs2311WithoutCrc32 | prbs2311WithCrc32)): NOT DEFINED - TstPriority (number): NOT DEFINED - TstSequenceNumber (number): NOT DEFINED - TstTestType (str(inService | outOfService)): NOT DEFINED - TstUnicastMac (str): NOT DEFINED - Ttl (number): Sets the MP Time-to-live value. Default is 64. Min: 1 Max: 255 - Vlan (str(None | /api/v1/sessions/1/ixnetwork/vport/.../vlans)): Assigns a VLAN to the MP. The VLAN must be previously configured. Returns ------- - self: This instance with matching mp resources retrieved from the server available through an iterator or index Raises ------ - ServerError: The server has encountered an uncategorized error condition """ return self._select(self._map_locals(self._SDM_ATT_MAP, locals())) def read(self, href): """Retrieves a single instance of mp data from the server. Args ---- - href (str): An href to the instance to be retrieved Returns ------- - self: This instance with the mp resources from the server available through an iterator or index Raises ------ - NotFoundError: The requested resource does not exist on the server - ServerError: The server has encountered an uncategorized error condition """ return self._read(href)
47.402079
2,285
0.653691
9,330
86,651
5.952197
0.054019
0.023553
0.03533
0.050798
0.779396
0.773472
0.718749
0.714859
0.701264
0.620665
0
0.015042
0.24811
86,651
1,827
2,286
47.428024
0.837334
0.43067
0
0.139323
0
0
0.150144
0.037177
0
0
0
0
0
1
0.286458
false
0
0.002604
0
0.438802
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
7
5d06a47c2f766659260cd9cc96ceedfc62f94242
22,517
py
Python
pytrx/transformation.py
dleshchev/trx
9a2ac79c539ec1e9db0faaf2fdcdd85dc5de430f
[ "MIT" ]
2
2021-01-27T16:50:43.000Z
2022-02-23T20:57:39.000Z
pytrx/transformation.py
dleshchev/trx
9a2ac79c539ec1e9db0faaf2fdcdd85dc5de430f
[ "MIT" ]
4
2020-06-09T02:02:02.000Z
2020-06-12T15:35:58.000Z
pytrx/transformation.py
dleshchev/trx
9a2ac79c539ec1e9db0faaf2fdcdd85dc5de430f
[ "MIT" ]
2
2020-02-03T15:40:37.000Z
2022-02-03T18:00:22.000Z
# -*- coding: utf-8 -*- """ Created on Thu Jun 4 17:33:17 2016 @author: darren A library of predefined moves for the Molecule class. """ import numpy as np import math import copy from pytrx.utils import AtomicMass from abc import (ABC as _ABC, abstractmethod as _abstractmethod) class Transformation(_ABC): ''' Abstract class for transformations ''' def __init__(self, dw=None, name=None): self.dw = copy.deepcopy(dw) # print('debug', name) self.name = name assert self.name is not None, 'Transofrmation must have name keyword that is not None' assert type(self.name) == str, 'Transformation name must be a string' @_abstractmethod def prepare(self, xyz, Z_num): '''computes the necessary ''' @_abstractmethod def describe(self): '''transformation description ''' @_abstractmethod def transform(self, xyz, Z_num, amplitude=None): pass class Transformation_move_vector(Transformation): # Move a group of atoms along a vector (normalized) def __init__(self, group1, vector, amplitude0=0, reprep=True, **kwargs): super().__init__(**kwargs) self.group1 = np.array(group1) self.vector = np.array(vector) self.unit_vector = np.array(vector) / np.linalg.norm(vector) self.amplitude0 = amplitude0 self.reprep = reprep def prepare(self, xyz, Z_num): assert (np.max(self.group1) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" # return self def describe(self): print(" Moving group1 along a predefined vector.") print(f' Group 1: {self.group1}') print(f' Vector : {self.unit_vector}') def transform(self, xyz, Z_num, amplitude=None): if amplitude is None: amplitude = self.amplitude0 if self.reprep: self.prepare(xyz, Z_num) xyz[self.group1] += self.unit_vector * amplitude return xyz class Transformation_group_vector(Transformation): # Move a group of atoms along a vector that is constructed by the center of coordinates of two other groups. # Vector will be from vector_group 1 to vector_group 2 def __init__(self, group1, vector_groups, amplitude0=0, reprep=True, **kwargs): super().__init__(**kwargs) self.group1 = np.array(group1) self.vector_groups = vector_groups self.amplitude0 = amplitude0 self.reprep = reprep def prepare(self, xyz, Z_num): assert (np.max(self.group1) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" assert (np.max(self.vector_groups[0]) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" assert (np.max(self.vector_groups[1]) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" self.vector = np.mean(xyz[self.vector_groups[1]], 0) - np.mean(xyz[self.vector_groups[0]], 0) self.unit_vector = np.array(self.vector) / np.linalg.norm(self.vector) # return self def describe(self): print(" Moving group1 along a vector constructed by two other groups (mean of coordinates).") print(" Vector will be from vector_group 1 to vector_group 2") print(f' Group 1: {self.group1}') print(f' Vector_group 1: {self.vector_groups[0]}') print(f' Vector_group 2: {self.vector_groups[1]}') def transform(self, xyz, Z_num, amplitude=None): if amplitude is None: amplitude = self.amplitude0 if self.reprep: self.prepare(xyz, Z_num) xyz[self.group1] -= self.unit_vector * amplitude return xyz class Transformation_vibration(Transformation): def __init__(self, dxyz, amplitude0=0, reprep=True, **kwargs): super().__init__(**kwargs) self.dxyz = dxyz self.amplitude0 = amplitude0 self.reprep = reprep def prepare(self, xyz, Z_num): assert self.dxyz.shape[0] == xyz.shape[0], \ 'number of atoms in transformation and in the molecule must match' return self def describe(self): print("Move all atoms along a predefined vibrational mode.") def transform(self, xyz, Z_num, amplitude=None): if amplitude is None: amplitude = self.amplitude0 if self.reprep: self.prepare(xyz, Z_num) return xyz + self.dxyz * amplitude class Transformation_distance(Transformation): # Move two groups of atoms closer/further in distance, using simple mean of coordinates as # reference centers for each group. # Vector is from group1 to group2. Negative amplitude is shrinking. def __init__(self, group1, group2, amplitude0=0, reprep=True, **kwargs): super().__init__(**kwargs) assert (len(group1) > 0) and (len(group2) > 0), 'Cannot operate on empty set' self.group1 = np.array(group1) self.group2 = np.array(group2) self.amplitude0 = amplitude0 self.reprep = reprep def prepare(self, xyz, Z_num): assert (np.max(self.group1) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" assert (np.max(self.group2) <= len(xyz)), \ "Index out of bound: largest index of group 2 > length of supplied molecule" self.group1_mean = np.mean(xyz[self.group1], 0) self.group2_mean = np.mean(xyz[self.group2], 0) self.unit_vec = (self.group2_mean - self.group1_mean) / np.linalg.norm(self.group2_mean - self.group1_mean) # return self def describe(self): print(f' Increasing / decreasing distance between group1 and group2 using ' f'simple mean of coordinates as centers.\n' f' Both groups move.') print(f' Group 1: {self.group1}') print(f' Group 2: {self.group2}') def transform(self, xyz, Z_num, amplitude=None): if amplitude is None: amplitude = self.amplitude0 if self.reprep: self.prepare(xyz, Z_num) xyz[self.group1] -= self.unit_vec * amplitude / 2 xyz[self.group2] += self.unit_vec * amplitude / 2 return xyz class Transformation_distance_1side(Transformation): # Move GROUP 2 toward/away from GROUP 1 in distance, using simple mean of coordinates as # reference centers for each group. # Vector is from group1 to group2. Negative amplitude is shrinking. # GROUP 1 is fixed. def __init__(self, group1, group2, amplitude0=0, reprep=True, **kwargs): super().__init__(**kwargs) assert (len(group1) > 0) and (len(group2) > 0), 'Cannot operate on empty set' self.group1 = np.array(group1) self.group2 = np.array(group2) self.amplitude0 = amplitude0 self.reprep = reprep def prepare(self, xyz, Z_num): assert (np.max(self.group1) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" assert (np.max(self.group2) <= len(xyz)), \ "Index out of bound: largest index of group 2 > length of supplied molecule" self.group1_mean = np.mean(xyz[self.group1], 0) self.group2_mean = np.mean(xyz[self.group2], 0) self.unit_vec = (self.group2_mean - self.group1_mean) / np.linalg.norm(self.group2_mean - self.group1_mean) # return self def describe(self): print(f' Increasing / decreasing distance between group1 and group2 using ' f'simple mean of coordinates as centers.\n' f' Only group 2 moves.') print(f' Group 1: {self.group1}') print(f' Group 2: {self.group2}') def transform(self, xyz, Z_num, amplitude=None): if amplitude is None: amplitude = self.amplitude0 if self.reprep: self.prepare(xyz, Z_num) xyz[self.group2] += self.unit_vec * amplitude return xyz class Transformation_distance_1side_expand(Transformation): # Move GROUP 2 toward/away from GROUP 1 in distance, using simple mean of coordinates as # reference centers for each group. # Vector is from group1 to group2. Negative amplitude is shrinking. # GROUP 1 is fixed. def __init__(self, group1, group2, amplitude0=0, reprep=True, **kwargs): super().__init__(**kwargs) assert (len(group1) > 0) and (len(group2) > 0), 'Cannot operate on empty set' self.group1 = np.array(group1) self.group2 = np.array(group2) self.amplitude0 = amplitude0 self.reprep = reprep def prepare(self, xyz, Z_num): assert (np.max(self.group1) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" assert (np.max(self.group2) <= len(xyz)), \ "Index out of bound: largest index of group 2 > length of supplied molecule" self.group1_mean = np.mean(xyz[self.group1], 0) # self.group2_mean = np.mean(xyz[self.group2], 0) self.vecs = (xyz[self.group2] - self.group1_mean) / np.mean(np.linalg.norm(xyz[self.group2] - self.group1_mean, axis=1)) #self.vecs = (xyz[self.group2] - self.group1_mean) / np.linalg.norm(xyz[self.group2] - self.group1_mean, axis=1)[:,None] # return self def describe(self): print(f' Increasing / decreasing distance between group1 and group2, ATOMWISE, using ' f'simple mean of coordinates as centers.\n' f' Only group 2 moves.') print(f' Group 1: {self.group1}') print(f' Group 2: {self.group2}') def transform(self, xyz, Z_num, amplitude=None): if amplitude is None: amplitude = self.amplitude0 if self.reprep: self.prepare(xyz, Z_num) xyz[self.group2] += self.vecs * amplitude return xyz class Transformation_distanceCOM(Transformation): # Move two group of atoms closer/further in distance, using center of mass as ref centers for each group # Vector is from group1 to group2. Negative amplitude is shrinking. def __init__(self, group1, group2, amplitude0=0, reprep=True, **kwargs): super().__init__(**kwargs) assert (len(group1) > 0) and (len(group2) > 0), 'Cannot operate on empty set' self.group1 = np.array(group1) self.group2 = np.array(group2) self.amplitude0 = amplitude0 self.reprep = reprep def prepare(self, xyz, Z_num): assert (np.max(self.group1) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" assert (np.max(self.group2) <= len(xyz)), \ "Index out of bound: largest index of group 2 > length of supplied molecule" self.group1_COM = np.sum(xyz[self.group1].T * AtomicMass()[Z_num[self.group1] - 1], 1) / np.sum(AtomicMass()[Z_num[self.group1] - 1]) self.group2_COM = np.sum(xyz[self.group2].T * AtomicMass()[Z_num[self.group2] - 1], 1) / np.sum(AtomicMass()[Z_num[self.group2] - 1]) self.unit_vec = (self.group2_COM - self.group1_COM) / np.linalg.norm(self.group2_COM - self.group1_COM) self.unit_vec = self.unit_vec.T # return self def describe(self): print(f' Increasing / decreasing distance between group1 and group2 using centers of masses as centers.\n' f' Both groups move.') print(f' Group 1: {self.group1}') print(f' Group 2: {self.group2}') def transform(self, xyz, Z_num, amplitude=None): if amplitude is None: amplitude = self.amplitude0 if self.reprep: self.prepare(xyz, Z_num) xyz[self.group1] -= self.unit_vec * amplitude / 2 xyz[self.group2] += self.unit_vec * amplitude / 2 return xyz class Transformation_distanceCOM_1side(Transformation): # Move GROUP 2 toward/away from GROUP 1 in distance, using center of mass as ref centers for each group # Vector is from group1 to group2. Negative amplitude is shrinking. # GROUP 1 is fixed. def __init__(self, group1, group2, amplitude0=0, reprep=True, **kwargs): super().__init__(**kwargs) assert (len(group1) > 0) and (len(group2) > 0), 'Cannot operate on empty set' self.group1 = np.array(group1) self.group2 = np.array(group2) self.amplitude0 = amplitude0 self.reprep = reprep def prepare(self, xyz, Z_num): assert (np.max(self.group1) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" assert (np.max(self.group2) <= len(xyz)), \ "Index out of bound: largest index of group 2 > length of supplied molecule" self.group1_COM = np.sum(xyz[self.group1].T * AtomicMass()[Z_num[self.group1] - 1], 1) / np.sum(AtomicMass()[Z_num[self.group1] - 1]) self.group2_COM = np.sum(xyz[self.group2].T * AtomicMass()[Z_num[self.group2] - 1], 1) / np.sum(AtomicMass()[Z_num[self.group2] - 1]) self.unit_vec = (self.group2_COM - self.group1_COM) / np.linalg.norm(self.group2_COM - self.group1_COM) self.unit_vec = self.unit_vec.T # return self def describe(self): print(f' Increasing / decreasing distance between group1 and group2 using centers of masses as centers.\n' f' Only group 2 moves.') print(f' Group 1: {self.group1}') print(f' Group 2: {self.group2}') def transform(self, xyz, Z_num, amplitude=None): if amplitude is None: amplitude = self.amplitude0 if self.reprep: self.prepare(xyz, Z_num) xyz[self.group2] += self.unit_vec * amplitude return xyz class Transformation_rotation(Transformation): def __init__(self, group1, axis_groups, amplitude0=0, reprep=True, **kwargs): # A, B, and C can be group of atoms. # Centers will be the mean of their coordinates. # If axis is length 2 (AB), use vector AB as the rotation axis # If axis is length 3 (ABC), use the center of central group as the center, # the cross vector of AB and BC as axis. # Amplitude is in degrees # Rotation is counterclockwise for an observer to whom the axis vector is pointing (right hand rule) super().__init__(**kwargs) assert (len(group1) > 0) and (len(axis_groups) > 0), 'Cannot operate on empty set' assert (len(axis_groups) == 2) or (len(axis_groups) == 3), 'Axis must be defined with 2 or 3 groups' for i in np.arange(len(axis_groups)): assert (len(axis_groups[i]) > 0), f'Axis group {i} is empty' self.group1 = group1 self.axis_groups = axis_groups self.amplitude0 = amplitude0 self.reprep = reprep def prepare(self, xyz, Z_num): assert (np.max(self.group1) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" for i in np.arange(len(self.axis_groups)): assert (np.max(self.axis_groups[i]) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" self.group1_mean = np.mean(xyz[self.group1], 0) self.A_mean = np.mean(xyz[self.axis_groups[0]], 0) self.B_mean = np.mean(xyz[self.axis_groups[1]], 0) if len(self.axis_groups) == 3: self.C_mean = np.mean(xyz[self.axis_groups[2]], 0) if len(self.axis_groups) == 2: # Then use AB as vector self.axis = self.B_mean - self.A_mean if len(self.axis_groups) == 3: # Use cross product of AB and BC as vector self.axis = np.cross(self.B_mean - self.A_mean, self.C_mean - self.B_mean) # return self def describe(self): if len(self.axis_groups) == 2: print(f' Rotate group 1 along the axis from center of axis_group 1 to center of axis_group 2.\n') elif len(self.axis_groups) == 3: print(f' Rotate group 1 along the axis normal to the plane spanned by\n' f' center of axis_group 1 to center of axis_group 2 and \n' f' center of axis_group 2 to center of axis_group 3. \n' f' Center is defined as simple mean of coordinates in that group.') print(f' Group 1: {self.group1}') print(f' Axis_group 1: {self.axis_groups[0]}') print(f' Axis_group 2: {self.axis_groups[1]}') if len(self.axis_groups) == 3: print(f' Axis_group 3: {self.axis_groups[2]}') def transform(self, xyz, Z_num, amplitude=None): if amplitude is None: amplitude = self.amplitude0 if self.reprep: self.prepare(xyz, Z_num) # Shift reference frame, rotate, then shift back if len(self.axis_groups) == 2: xyz[self.group1] = rotation3D((xyz[self.group1] - self.A_mean).T, self.axis, amplitude).T + self.A_mean if len(self.axis_groups) == 3: xyz[self.group1] = rotation3D((xyz[self.group1] - self.B_mean).T, self.axis, amplitude).T + self.B_mean return xyz class Transformation_rotationCOM(Transformation): def __init__(self, group1, axis_groups, amplitude0=0, reprep=True, **kwargs): # A, B, and C can be group of atoms. # Centers will be the mean of their coordinates. # If axis is length 2 (AB), use vector AB as the rotation axis # If axis is length 3 (ABC), use the center of central group as the center, # the cross vector of AB and BC as axis. # Amplitude is in degrees # Rotation is counterclockwise for an observer to whom the axis vector is pointing (right hand rule) super().__init__(**kwargs) assert (len(group1) > 0) and (len(axis_groups) > 0), 'Cannot operate on empty set' assert (len(axis_groups) == 2) or (len(axis_groups) == 3), 'Axis must be defined with 2 or 3 groups' for i in np.arange(len(axis_groups)): assert (len(axis_groups[i]) > 0), f'Axis group {i} is empty' self.group1 = group1 self.axis_groups = axis_groups self.amplitude0 = amplitude0 self.reprep = reprep def prepare(self, xyz, Z_num): assert (np.max(self.group1) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" for i in np.arange(len(self.axis_groups)): assert (np.max(self.axis_groups) <= len(xyz)), \ "Index out of bound: largest index of group 1 > length of supplied molecule" self.A_COM = np.sum(xyz[self.axis_groups[0]].T * AtomicMass()[Z_num[self.axis_groups[0]] - 1], 1) / np.sum(AtomicMass()[Z_num[self.axis_groups[0]] - 1]) self.B_COM = np.sum(xyz[self.axis_groups[1]].T * AtomicMass()[Z_num[self.axis_groups[1]] - 1], 1) / np.sum(AtomicMass()[Z_num[self.axis_groups[1]] - 1]) if len(self.axis_groups) == 3: self.C_COM = np.sum(xyz[self.axis_groups[2]].T * AtomicMass()[Z_num[self.axis_groups[2]] - 1], 1) / np.sum(AtomicMass()[Z_num[self.axis_groups[2]] - 1]) if len(self.axis_groups) == 2: # Then use AB as vector self.axis = self.B_COM - self.A_COM if len(self.axis_groups) == 3: # Use cross product of AB and BC as vector self.axis = np.cross(self.B_COM - self.A_COM, self.C_COM - self.B_COM) # return self def describe(self): if len(self.axis_groups) == 2: print(f' Rotate group 1 along the axis from center of axis_group 1 to center of axis_group 2\n') elif len(self.axis_groups) == 3: print(f' Rotate group 1 along the axis normal to the plane spanned by\n' f' center of axis_group 1 to center of axis_group 2 and \n' f' center of axis_group 2 to center of axis_group 3. \n' f' Center is defined as center of mass in that group.') print(f' Group 1: {self.group1}') print(f' Axis_group 1: {self.axis_groups[0]}') print(f' Axis_group 2: {self.axis_groups[1]}') if len(self.axis_groups) == 3: print(f' Axis_group 3: {self.axis_groups[2]}') def transform(self, xyz, Z_num, amplitude=None): if amplitude is None: amplitude = self.amplitude0 if self.reprep: self.prepare(xyz, Z_num) if len(self.axis_groups) == 2: xyz[self.group1] = rotation3D((xyz[self.group1] - self.A_COM).T, self.axis, amplitude).T + self.A_COM if len(self.axis_groups) == 3: xyz[self.group1] = rotation3D((xyz[self.group1] - self.B_COM).T, self.axis, amplitude).T + self.B_COM return xyz def rotation3D(v, axis, degrees): """ Return the rotation matrix associated with counterclockwise rotation about the given axis by theta radians. Using the Euler-Rodrigues formula: https://stackoverflow.com/questions/6802577/rotation-of-3d-vector """ axis = np.asarray(axis) axis = axis / math.sqrt(np.dot(axis, axis)) theta = degrees * math.pi / 180 a = math.cos(theta / 2.0) b, c, d = -axis * math.sin(theta / 2.0) aa, bb, cc, dd = a * a, b * b, c * c, d * d bc, ad, ac, ab, bd, cd = b * c, a * d, a * c, a * b, b * d, c * d rot_mat = np.array([[aa + bb - cc - dd, 2 * (bc + ad), 2 * (bd - ac)], [2 * (bc - ad), aa + cc - bb - dd, 2 * (cd + ab)], [2 * (bd + ac), 2 * (cd - ab), aa + dd - bb - cc]]) return np.dot(rot_mat, v) # this seems to fix the issues with links to the classes/subclasses all_classes = [Transformation_distance, Transformation_distance_1side, Transformation_distance_1side_expand, Transformation_move_vector, Transformation_group_vector, Transformation_vibration, Transformation_distanceCOM, Transformation_distanceCOM_1side, Transformation_rotation, Transformation_rotationCOM] [issubclass(i, Transformation) for i in all_classes]
43.469112
128
0.616823
3,151
22,517
4.301492
0.07458
0.056072
0.041316
0.017855
0.845286
0.833997
0.817618
0.795559
0.782352
0.766711
0
0.027442
0.27175
22,517
517
129
43.553191
0.799122
0.128303
0
0.736111
0
0
0.206053
0.008807
0
0
0
0
0.088889
1
0.125
false
0.002778
0.013889
0
0.202778
0.1
0
0
0
null
0
0
0
1
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
7
5d0a545b86f7503be447402d1d7841206cf36bce
3,386
py
Python
Cole/data_input.py
lhq1208/Cole
c64806415c6202f8d58f28c627dee11a6d64bcf4
[ "Apache-2.0" ]
null
null
null
Cole/data_input.py
lhq1208/Cole
c64806415c6202f8d58f28c627dee11a6d64bcf4
[ "Apache-2.0" ]
null
null
null
Cole/data_input.py
lhq1208/Cole
c64806415c6202f8d58f28c627dee11a6d64bcf4
[ "Apache-2.0" ]
null
null
null
__author__='lhq' import os import numpy as np from PIL import Image from torch.utils.data import Dataset def get_train_img(): """ 获取输入数据 :return: """ cwd=os.getcwd() mi_dir=cwd+'/dataset/train/mi/' shu_dir=cwd+'/dataset/train/shu/' file1=os.listdir(mi_dir) file0=os.listdir(shu_dir) # file1.sort(key=lambda x: int(x[:-4])) # file0.sort(key=lambda x: int(x[:-4])) mi_img_list=np.empty((1, 64, 64, 3)) shu_img_list = np.empty((1, 64, 64, 3)) label=[] for mi_img_content in file1: mi_img=Image.open(mi_dir+mi_img_content) mi_img = np.array(mi_img).reshape((1, 64, 64, 3)) mi_img_list = np.concatenate((mi_img_list, mi_img), axis=0) label.append(1) for shu_img_content in file0: shu_img=Image.open(shu_dir+shu_img_content) shu_img = np.array(shu_img).reshape((1, 64, 64, 3)) shu_img_list = np.concatenate((shu_img_list, shu_img), axis=0) label.append(0) mi_img_list = np.delete(mi_img_list, 0, 0) shu_img_list = np.delete(shu_img_list, 0, 0) label=[int(i) for i in label] label=np.array(label) img_list=np.concatenate((mi_img_list, shu_img_list), axis=0) return img_list,label def get_test_img(): """ 获取输入数据 :return: """ cwd=os.getcwd() mi_dir=cwd+'/dataset/test/mi/' shu_dir=cwd+'/dataset/test/shu/' file1=os.listdir(mi_dir) file0=os.listdir(shu_dir) # file1.sort(key=lambda x: int(x[:-4])) # file0.sort(key=lambda x: int(x[:-4])) mi_img_list=np.empty((1, 64, 64, 3)) shu_img_list = np.empty((1, 64, 64, 3)) label=[] for mi_img_content in file1: mi_img=Image.open(mi_dir+mi_img_content) mi_img = np.array(mi_img).reshape((1, 64, 64, 3)) mi_img_list = np.concatenate((mi_img_list, mi_img), axis=0) label.append(1) for shu_img_content in file0: shu_img=Image.open(shu_dir+shu_img_content) shu_img = np.array(shu_img).reshape((1, 64, 64, 3)) shu_img_list = np.concatenate((shu_img_list, shu_img), axis=0) label.append(0) mi_img_list = np.delete(mi_img_list, 0, 0) shu_img_list = np.delete(shu_img_list, 0, 0) label=[int(i) for i in label] label=np.array(label) img_list=np.concatenate((mi_img_list, shu_img_list), axis=0) return img_list,label class MyTrainDataset(Dataset): def __init__(self, transform=None, target_transform=None): imgs,label = get_train_img() self.imgs = imgs self.label=label self.transform = transform self.target_transform = target_transform def __getitem__(self, index): img = self.imgs[index] label=self.label[index] if self.transform is not None: img = self.transform(img) return img,label def __len__(self): return len(self.imgs) class MyTestDataset(Dataset): def __init__(self, transform=None, target_transform=None): imgs,label = get_test_img() self.imgs = imgs self.label=label self.transform = transform self.target_transform = target_transform def __getitem__(self, index): img = self.imgs[index] label=self.label[index] if self.transform is not None: img = self.transform(img) return img,label def __len__(self): return len(self.imgs)
31.351852
70
0.634377
532
3,386
3.778195
0.12782
0.097512
0.062687
0.023881
0.917413
0.899502
0.899502
0.899502
0.899502
0.899502
0
0.031575
0.233018
3,386
107
71
31.64486
0.742395
0.054341
0
0.823529
0
0
0.023742
0
0
0
0
0
0
1
0.094118
false
0
0.047059
0.023529
0.235294
0
0
0
0
null
0
0
0
1
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
7
5d40ddf440292d698e38f65d1a987e6f8365ade2
7,097
py
Python
tests/test_0006-notify-when-downloaded.py
ryuwd/uproot4
20d8575e941c32559c7b5e62b0ed5f92bc4927d0
[ "BSD-3-Clause" ]
null
null
null
tests/test_0006-notify-when-downloaded.py
ryuwd/uproot4
20d8575e941c32559c7b5e62b0ed5f92bc4927d0
[ "BSD-3-Clause" ]
null
null
null
tests/test_0006-notify-when-downloaded.py
ryuwd/uproot4
20d8575e941c32559c7b5e62b0ed5f92bc4927d0
[ "BSD-3-Clause" ]
null
null
null
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE from __future__ import absolute_import import sys import os try: from io import StringIO except ImportError: from StringIO import StringIO try: import queue except ImportError: import Queue as queue import numpy import pytest import uproot def test_file(tmpdir): filename = os.path.join(str(tmpdir), "tmp.raw") with open(filename, "wb") as tmp: tmp.write(b"****** ...+++++++!!!!!@@@@@") notifications = queue.Queue() with uproot.source.file.MultithreadedFileSource(filename, num_workers=1) as source: chunks = source.chunks( [(0, 6), (6, 10), (10, 13), (13, 20), (20, 25), (25, 30)], notifications=notifications, ) expected = dict(((chunk.start, chunk.stop), chunk) for chunk in chunks) while len(expected) > 0: chunk = notifications.get() expected.pop((chunk.start, chunk.stop)) def test_file_workers(tmpdir): filename = os.path.join(str(tmpdir), "tmp.raw") with open(filename, "wb") as tmp: tmp.write(b"****** ...+++++++!!!!!@@@@@") notifications = queue.Queue() with uproot.source.file.MultithreadedFileSource(filename, num_workers=5) as source: chunks = source.chunks( [(0, 6), (6, 10), (10, 13), (13, 20), (20, 25), (25, 30)], notifications=notifications, ) expected = dict(((chunk.start, chunk.stop), chunk) for chunk in chunks) while len(expected) > 0: chunk = notifications.get() expected.pop((chunk.start, chunk.stop)) def test_memmap(tmpdir): filename = os.path.join(str(tmpdir), "tmp.raw") with open(filename, "wb") as tmp: tmp.write(b"****** ...+++++++!!!!!@@@@@") notifications = queue.Queue() with uproot.source.file.MemmapSource(filename, num_fallback_workers=1) as source: chunks = source.chunks( [(0, 6), (6, 10), (10, 13), (13, 20), (20, 25), (25, 30)], notifications=notifications, ) expected = dict(((chunk.start, chunk.stop), chunk) for chunk in chunks) while len(expected) > 0: chunk = notifications.get() expected.pop((chunk.start, chunk.stop)) @pytest.mark.network def test_http_multipart(): notifications = queue.Queue() with uproot.source.http.HTTPSource( "https://example.com", timeout=10, num_fallback_workers=1 ) as source: chunks = source.chunks( [(0, 100), (50, 55), (200, 400)], notifications=notifications ) expected = dict(((chunk.start, chunk.stop), chunk) for chunk in chunks) while len(expected) > 0: chunk = notifications.get() expected.pop((chunk.start, chunk.stop)) @pytest.mark.network def test_http(): notifications = queue.Queue() with uproot.source.http.MultithreadedHTTPSource( "https://example.com", timeout=10, num_workers=1 ) as source: chunks = source.chunks( [(0, 100), (50, 55), (200, 400)], notifications=notifications ) expected = dict(((chunk.start, chunk.stop), chunk) for chunk in chunks) while len(expected) > 0: chunk = notifications.get() expected.pop((chunk.start, chunk.stop)) @pytest.mark.network def test_http_workers(): notifications = queue.Queue() with uproot.source.http.MultithreadedHTTPSource( "https://example.com", timeout=10, num_workers=2 ) as source: chunks = source.chunks( [(0, 100), (50, 55), (200, 400)], notifications=notifications ) expected = dict(((chunk.start, chunk.stop), chunk) for chunk in chunks) while len(expected) > 0: chunk = notifications.get() expected.pop((chunk.start, chunk.stop)) @pytest.mark.network def test_http_fallback(): notifications = queue.Queue() with uproot.source.http.HTTPSource( "https://scikit-hep.org/uproot3/examples/Zmumu.root", timeout=10, num_fallback_workers=1, ) as source: chunks = source.chunks( [(0, 100), (50, 55), (200, 400)], notifications=notifications ) expected = dict(((chunk.start, chunk.stop), chunk) for chunk in chunks) while len(expected) > 0: chunk = notifications.get() expected.pop((chunk.start, chunk.stop)) @pytest.mark.network def test_http_fallback_workers(): notifications = queue.Queue() with uproot.source.http.HTTPSource( "https://scikit-hep.org/uproot3/examples/Zmumu.root", timeout=10, num_fallback_workers=5, ) as source: chunks = source.chunks( [(0, 100), (50, 55), (200, 400)], notifications=notifications ) expected = dict(((chunk.start, chunk.stop), chunk) for chunk in chunks) while len(expected) > 0: chunk = notifications.get() expected.pop((chunk.start, chunk.stop)) @pytest.mark.network @pytest.mark.xrootd def test_xrootd(): pytest.importorskip("XRootD") notifications = queue.Queue() with uproot.source.xrootd.MultithreadedXRootDSource( "root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod/Run2012B_DoubleMuParked.root", num_workers=1, timeout=10, ) as source: chunks = source.chunks( [(0, 100), (50, 55), (200, 400)], notifications=notifications ) expected = dict(((chunk.start, chunk.stop), chunk) for chunk in chunks) while len(expected) > 0: chunk = notifications.get() expected.pop((chunk.start, chunk.stop)) @pytest.mark.network @pytest.mark.xrootd def test_xrootd_workers(): pytest.importorskip("XRootD") notifications = queue.Queue() with uproot.source.xrootd.MultithreadedXRootDSource( "root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod/Run2012B_DoubleMuParked.root", num_workers=5, timeout=10, ) as source: chunks = source.chunks( [(0, 100), (50, 55), (200, 400)], notifications=notifications ) expected = dict(((chunk.start, chunk.stop), chunk) for chunk in chunks) while len(expected) > 0: chunk = notifications.get() expected.pop((chunk.start, chunk.stop)) @pytest.mark.network @pytest.mark.xrootd def test_xrootd_vectorread(): pytest.importorskip("XRootD") notifications = queue.Queue() with uproot.source.xrootd.XRootDSource( "root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod/Run2012B_DoubleMuParked.root", timeout=10, max_num_elements=None, num_workers=1, ) as source: chunks = source.chunks( [(0, 100), (50, 55), (200, 400)], notifications=notifications ) expected = dict(((chunk.start, chunk.stop), chunk) for chunk in chunks) while len(expected) > 0: chunk = notifications.get() expected.pop((chunk.start, chunk.stop))
33.956938
104
0.611949
826
7,097
5.193705
0.133172
0.061538
0.076923
0.097436
0.911888
0.911888
0.909557
0.909557
0.905828
0.892308
0
0.044904
0.243765
7,097
208
105
34.120192
0.754425
0.011413
0
0.757062
0
0
0.081409
0.039778
0
0
0
0
0
1
0.062147
false
0
0.084746
0
0.146893
0
0
0
0
null
0
0
0
1
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
7
5d4689ba30a6ec018319e26f1c3c5b5763a05a1d
8,057
py
Python
tests/integration/ipu_copy_test.py
gglin001/popart
3225214343f6d98550b6620e809a3544e8bcbfc6
[ "MIT" ]
61
2020-07-06T17:11:46.000Z
2022-03-12T14:42:51.000Z
tests/integration/ipu_copy_test.py
gglin001/popart
3225214343f6d98550b6620e809a3544e8bcbfc6
[ "MIT" ]
1
2021-02-25T01:30:29.000Z
2021-11-09T11:13:14.000Z
tests/integration/ipu_copy_test.py
gglin001/popart
3225214343f6d98550b6620e809a3544e8bcbfc6
[ "MIT" ]
6
2020-07-15T12:33:13.000Z
2021-11-07T06:55:00.000Z
# Copyright (c) 2019 Graphcore Ltd. All rights reserved. import numpy as np import popart import pytest import test_util as tu @tu.requires_ipu_model def test_ipu_copy_bca1(): popart.getLogger().setLevel("TRACE") builder = popart.Builder() i1 = builder.addInputTensor(popart.TensorInfo("FLOAT", [1])) i2 = builder.addInputTensor(popart.TensorInfo("FLOAT", [1])) o1 = builder.aiOnnx.add([i1, i2]) o2 = builder.aiOnnx.add([i1, i2]) o = builder.aiOnnx.add([o1, o2]) builder.addOutputTensor(o) builder.virtualGraph(o1, 0) builder.virtualGraph(o2, 0) builder.virtualGraph(o, 1) proto = builder.getModelProto() dataFlow = popart.DataFlow(1, {o: popart.AnchorReturnType("All")}) opts = popart.SessionOptions() opts.virtualGraphMode = popart.VirtualGraphMode.Manual s = popart.InferenceSession(fnModel=proto, dataFlow=dataFlow, userOptions=opts, deviceInfo=tu.create_test_device(numIpus=3)) s.prepareDevice() # Will fail due to an invalid virtual graph @tu.requires_ipu_model def test_ipu_copy_aca1(): popart.getLogger().setLevel("TRACE") builder = popart.Builder() i1 = builder.addInputTensor(popart.TensorInfo("FLOAT", [1])) i2 = builder.addInputTensor(popart.TensorInfo("FLOAT", [1])) o1 = builder.aiOnnx.add([i1, i2]) o2 = builder.aiOnnx.add([i1, i2]) o = builder.aiOnnx.add([o1, o2]) builder.addOutputTensor(o) builder.virtualGraph(o1, 0) builder.virtualGraph(o2, 0) builder.virtualGraph(o, 10) # << Invalid virtual graph proto = builder.getModelProto() dataFlow = popart.DataFlow(1, {o: popart.AnchorReturnType("All")}) opts = popart.SessionOptions() opts.virtualGraphMode = popart.VirtualGraphMode.Manual s = popart.InferenceSession(fnModel=proto, dataFlow=dataFlow, userOptions=opts, deviceInfo=tu.create_test_device(numIpus=3)) with pytest.raises(popart.popart_exception) as e_info: s.prepareDevice() assert (("inputs=[{}, {}], outputs=[{}]) " + "has been assigned to an invalid virtual graph 10").format( o1 + "_c10", o2 + "_c10", o) in e_info.value.args[0]) # Test that an input stream tensor is correctly mapped to multiple ipus @tu.requires_ipu_model def test_ipu_copy_bca4(): popart.getLogger().setLevel("TRACE") builder = popart.Builder() i1 = builder.addInputTensor(popart.TensorInfo("FLOAT", [1])) i2 = builder.addInputTensor(popart.TensorInfo("FLOAT", [1])) o1 = builder.aiOnnx.add([i1, i2]) o2 = builder.aiOnnx.add([i1, i2]) t1 = builder.aiOnnx.transpose([i1], []) o3 = builder.aiOnnx.add([o1, o2]) o = builder.aiOnnx.add([o3, t1]) builder.addOutputTensor(o) builder.virtualGraph(o1, 0) builder.virtualGraph(o2, 2) builder.virtualGraph(t1, 2) builder.virtualGraph(o3, 1) builder.virtualGraph(o, 1) proto = builder.getModelProto() dataFlow = popart.DataFlow(1, {o: popart.AnchorReturnType("All")}) opts = popart.SessionOptions() opts.virtualGraphMode = popart.VirtualGraphMode.Manual s = popart.InferenceSession(fnModel=proto, dataFlow=dataFlow, userOptions=opts, deviceInfo=tu.create_test_device(numIpus=3)) s.prepareDevice() # Test to ensure that same tensor it not copied multiple times to the same IPU @tu.requires_ipu_model def test_ipu_copy_bca2(): popart.getLogger().setLevel("TRACE") builder = popart.Builder() i1 = builder.addInputTensor(popart.TensorInfo("FLOAT", [1])) i2 = builder.addInputTensor(popart.TensorInfo("FLOAT", [1])) o1 = builder.aiOnnx.add([i1, i2]) o2 = builder.aiOnnx.add([i1, i2]) o3 = builder.aiOnnx.add([o1, o2]) o4 = builder.aiOnnx.add([o1, o2]) o = builder.aiOnnx.add([o3, o4]) builder.addOutputTensor(o) builder.virtualGraph(o1, 0) builder.virtualGraph(o2, 0) builder.virtualGraph(o3, 1) builder.virtualGraph(o4, 1) builder.virtualGraph(o, 2) proto = builder.getModelProto() dataFlow = popart.DataFlow(1, {o: popart.AnchorReturnType("All")}) opts = popart.SessionOptions() opts.virtualGraphMode = popart.VirtualGraphMode.Manual s = popart.InferenceSession(fnModel=proto, dataFlow=dataFlow, userOptions=opts, deviceInfo=tu.create_test_device(numIpus=3)) s.prepareDevice() # Test to make sure that if a single op has multiple it mapped to multiple inputs then the copy does # the right thing @tu.requires_ipu_model def test_ipu_copy_bca3(): popart.getLogger().setLevel("TRACE") builder = popart.Builder() i1 = builder.addInputTensor(popart.TensorInfo("FLOAT", [1])) i2 = builder.addInputTensor(popart.TensorInfo("FLOAT", [1])) o1 = builder.aiOnnx.add([i1, i2]) o = builder.aiOnnx.add([o1, o1]) builder.addOutputTensor(o) builder.virtualGraph(o1, 0) builder.virtualGraph(o, 1) proto = builder.getModelProto() dataFlow = popart.DataFlow(1, {o: popart.AnchorReturnType("All")}) opts = popart.SessionOptions() opts.virtualGraphMode = popart.VirtualGraphMode.Manual s = popart.InferenceSession(fnModel=proto, dataFlow=dataFlow, userOptions=opts, deviceInfo=tu.create_test_device(numIpus=2)) s.prepareDevice() @tu.requires_ipu_model def test_ipu_copy_bca5(): popart.getLogger().setLevel("TRACE") builder = popart.Builder() constData = np.random.rand(2, 2).astype(np.float32) c1 = builder.aiOnnx.constant(constData, "constShapeData") i2 = builder.addInputTensor(popart.TensorInfo("FLOAT", [2, 2])) o1 = builder.aiOnnx.add([c1, i2]) o2 = builder.aiOnnx.add([c1, i2]) t1 = builder.aiOnnx.transpose([c1], []) o3 = builder.aiOnnx.add([o1, o2]) o = builder.aiOnnx.add([o3, t1]) builder.addOutputTensor(o) builder.virtualGraph(o1, 0) builder.virtualGraph(o2, 2) builder.virtualGraph(t1, 2) builder.virtualGraph(o3, 1) builder.virtualGraph(o, 1) proto = builder.getModelProto() dataFlow = popart.DataFlow(1, {o: popart.AnchorReturnType("All")}) opts = popart.SessionOptions() opts.virtualGraphMode = popart.VirtualGraphMode.Manual s = popart.InferenceSession(fnModel=proto, dataFlow=dataFlow, userOptions=opts, deviceInfo=tu.create_test_device(numIpus=3)) s.prepareDevice() # IPU 0 * IPU 1 # ========================================= # * # i1 -----> copy ---> mul # | * | # v * v # add -----> copy --> add # * | # * v # * output @tu.requires_ipu_model def test_copy_to_op_with_duplicate_inputs(): popart.getLogger().setLevel("TRACE") builder = popart.Builder() i1 = builder.addInputTensor(popart.TensorInfo("FLOAT", [1])) o1 = builder.aiOnnx.add([i1, i1]) builder.virtualGraph(o1, 0) o2 = builder.aiOnnx.mul([i1, i1]) builder.virtualGraph(o2, 1) o3 = builder.aiOnnx.add([o1, o2]) builder.virtualGraph(o3, 1) o = o3 builder.addOutputTensor(o) proto = builder.getModelProto() dataFlow = popart.DataFlow(1, {o: popart.AnchorReturnType("All")}) opts = popart.SessionOptions() opts.virtualGraphMode = popart.VirtualGraphMode.Manual s = popart.InferenceSession(fnModel=proto, dataFlow=dataFlow, userOptions=opts, deviceInfo=tu.create_test_device(numIpus=3)) s.prepareDevice()
29.512821
100
0.61611
884
8,057
5.549774
0.149321
0.071545
0.07501
0.090501
0.838361
0.81064
0.781696
0.771912
0.732776
0.723808
0
0.030555
0.252575
8,057
272
101
29.621324
0.784125
0.081916
0
0.809249
0
0
0.029408
0
0
0
0
0
0.00578
1
0.040462
false
0
0.023121
0
0.063584
0
0
0
0
null
0
0
0
1
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
7
537c1f786d320c3a7f49807d65abd0b8c2c122d5
10,605
py
Python
src/models/light/model.py
ab3llini/BlindLess
46c50fb2748b9d372044d00b901f0cde91946684
[ "MIT" ]
1
2022-03-19T09:19:12.000Z
2022-03-19T09:19:12.000Z
src/models/light/model.py
ab3llini/BlindLess
46c50fb2748b9d372044d00b901f0cde91946684
[ "MIT" ]
1
2020-02-06T18:26:07.000Z
2020-02-06T18:26:07.000Z
src/models/light/model.py
ab3llini/BlindLess
46c50fb2748b9d372044d00b901f0cde91946684
[ "MIT" ]
null
null
null
import sys import os this_path = os.path.dirname(os.path.realpath(__file__)) root_path = os.path.abspath(os.path.join(this_path, os.pardir, os.pardir)) sys.path.append(root_path) from torch import nn from modules.image_encoders import * from torchvision import models from transformers import GPT2LMHeadModel, GPT2Tokenizer gpt2_tokenizer = GPT2Tokenizer.from_pretrained('gpt2') class ModularGpt2(nn.Module): def __init__(self): super(ModularGpt2, self).__init__() gpt2 = GPT2LMHeadModel.from_pretrained('gpt2') self.head = list(gpt2.children())[1] self.gpt2 = list(gpt2.children())[0] def show_params(self): for name, param in self.named_parameters(): if param.requires_grad: print('Trainable : TRUE ->', name) else: print('Trainable : FALSE ->', name) print('Trainable parameters: {}'.format(sum(p.numel() for p in self.parameters() if p.requires_grad))) print('Total parameters: {}'.format(sum(p.numel() for p in self.parameters()))) class LightVggGpt2(ModularGpt2): def __init__(self): super(LightVggGpt2, self).__init__() # Image encoder self.image_encoder = VGGEncoder(models.vgg19(pretrained=True)) # Linear expansion (from 512 to 768) self.expansion = nn.Linear(in_features=512, out_features=768) # Disable weight update for both VGG and GPT-2 for p in self.image_encoder.parameters(): p.requires_grad = False for p in self.gpt2.parameters(): p.requires_grad = False # Enable weight updates for GPT-2 head and expander for p in self.expansion.parameters(): p.requires_grad = True for p in self.head.parameters(): p.requires_grad = True # 1 implement E S valdation loss # max limit # epochs to 100 # train cuncurr 2 model with vgg # 1 model avg # 2 model max def forward(self, sequence, image): # (Batch size, 49, 512) maps = self.image_encoder(image).reshape(-1, 49, 512) # (Batch size, 1, 49, 768) maps = self.expansion(maps).unsqueeze(1) # (Batch size, sequence length, 1, 768) hiddens = self.gpt2(sequence)[0].unsqueeze(2) # (Batch size, sequence length, 768) combined = (maps + hiddens).sum(dim=2).squeeze(2) # (Batch size, sequence length, voc_size) out = self.head(combined) return out class LightResGpt2(ModularGpt2): def __init__(self): super(LightResGpt2, self).__init__() # Image encoder self.image_encoder = ResNetEncoder(encoded_image_size=14, instance=models.resnet152(pretrained=True)) # Linear expansion (from 512 to 768) self.expansion = nn.Linear(in_features=2048, out_features=768) # Disable weight update for both VGG and GPT-2 for p in self.image_encoder.parameters(): p.requires_grad = False for p in self.gpt2.parameters(): p.requires_grad = False # Enable weight updates for GPT-2 head and expander for p in self.expansion.parameters(): p.requires_grad = True for p in self.head.parameters(): p.requires_grad = True def forward(self, sequence, image): # (Batch size, 192, 2048) maps = self.image_encoder(image).reshape(-1, 14 * 14, 2048) # (Batch size, 1, 192, 768) maps = self.expansion(maps).unsqueeze(1) # (Batch size, sequence length, 1, 768) hiddens = self.gpt2(sequence)[0].unsqueeze(2) # (Batch size, sequence length, 768) combined = (maps + hiddens).sum(dim=2).squeeze(2) # (Batch size, sequence length, voc_size) out = self.head(combined) return out class LightVggGpt2Avg(ModularGpt2): def __init__(self): super(LightVggGpt2Avg, self).__init__() # Image encoder self.image_encoder = VGGEncoder(models.vgg19(pretrained=True)) # Linear expansion (from 512 to 768) self.expansion = nn.Linear(in_features=512, out_features=768) # self.expansion.weight.data = torch.zeros(self.expansion.weight.size()) # Disable weight update for both VGG and GPT-2 for p in self.image_encoder.parameters(): p.requires_grad = False for p in self.gpt2.parameters(): p.requires_grad = False # Enable weight updates for GPT-2 head and expander for p in self.expansion.parameters(): p.requires_grad = True for p in self.head.parameters(): p.requires_grad = False # 1 implement E S valdation loss # max limit # epochs to 100 # train cuncurr 2 model with vgg # 1 model avg # 2 model max def forward(self, sequence, image): # (Batch size, 512) maps = self.image_encoder(image).reshape(-1, 49, 512).mean(dim=1) # (Batch size, 1, 768) maps = self.expansion(maps).unsqueeze(1) # (Batch size, sequence length, 768) hiddens = self.gpt2(sequence)[0] # (Batch size, sequence length, 768) combined = (maps + hiddens) # (Batch size, sequence length, voc_size) out = self.head(combined) return out class LightVggGpt2Max(ModularGpt2): def __init__(self): super(LightVggGpt2Max, self).__init__() # Image encoder self.image_encoder = VGGEncoder(models.vgg19(pretrained=True)) # Linear expansion (from 512 to 768) self.expansion = nn.Linear(in_features=512, out_features=768) # self.expansion.weight.data = torch.zeros(self.expansion.weight.size()) # Disable weight update for both VGG and GPT-2 for p in self.image_encoder.parameters(): p.requires_grad = False for p in self.gpt2.parameters(): p.requires_grad = False # Enable weight updates for GPT-2 head and expander for p in self.expansion.parameters(): p.requires_grad = True for p in self.head.parameters(): p.requires_grad = False def forward(self, sequence, image): # (Batch size, 512) maps = self.image_encoder(image).reshape(-1, 49, 512).max(dim=1)[0] # (Batch size, 1, 768) maps = self.expansion(maps).unsqueeze(1) # (Batch size, sequence length, 768) hiddens = self.gpt2(sequence)[0] # (Batch size, sequence length, 768) combined = (maps + hiddens) # (Batch size, sequence length, voc_size) out = self.head(combined) return out class LightVggGpt2AvgConcat(ModularGpt2): def __init__(self): super(LightVggGpt2AvgConcat, self).__init__() # Image encoder self.image_encoder = VGGEncoder(models.vgg19(pretrained=True)) # Linear expansion (from 512 to 768) self.expansion = nn.Linear(in_features=512, out_features=768) self.classifier = nn.Linear(in_features=768 * 2, out_features=len(gpt2_tokenizer)) # Copy the original weights and concat the new ones for the attention with torch.no_grad(): self.classifier.weight.copy_( torch.cat( [ self.head.weight, torch.zeros(self.head.weight.size()) ], dim=1 ) ) del self.head # Disable weight update for both VGG and GPT-2 for p in self.image_encoder.parameters(): p.requires_grad = False for p in self.gpt2.parameters(): p.requires_grad = False # Enable weight updates for GPT-2 head and expander for p in self.expansion.parameters(): p.requires_grad = True for p in self.classifier.parameters(): p.requires_grad = True def forward(self, sequence, image): # (Batch size, 512) maps = self.image_encoder(image).reshape(-1, 49, 512).mean(dim=1) # (Batch size, sequence length, 768) hiddens = self.gpt2(sequence)[0] # (Batch size, sequence length, 768) maps = self.expansion(maps).unsqueeze(1).expand(-1, hiddens.shape[1], -1) # (Batch size, sequence length, 768) concat = torch.cat([hiddens, maps], dim=2) # (Batch size, sequence length, voc_size) out = self.classifier(concat) return out class LightVggGpt2MaxConcat(ModularGpt2): def __init__(self): super(LightVggGpt2MaxConcat, self).__init__() # Image encoder self.image_encoder = VGGEncoder(models.vgg19(pretrained=True)) # Linear expansion (from 512 to 768) self.expansion = nn.Linear(in_features=512, out_features=768) self.classifier = nn.Linear(in_features=768 * 2, out_features=len(gpt2_tokenizer)) # Copy the original weights and concat the new ones for the attention with torch.no_grad(): self.classifier.weight.copy_( torch.cat( [ self.head.weight, torch.zeros(self.head.weight.size()) ], dim=1 ) ) del self.head # Disable weight update for both VGG and GPT-2 for p in self.image_encoder.parameters(): p.requires_grad = False for p in self.gpt2.parameters(): p.requires_grad = False # Enable weight updates for GPT-2 head and expander for p in self.expansion.parameters(): p.requires_grad = True for p in self.classifier.parameters(): p.requires_grad = True def forward(self, sequence, image): # (Batch size, 512) maps = self.image_encoder(image).reshape(-1, 49, 512).max(dim=1)[0] # (Batch size, sequence length, 768) hiddens = self.gpt2(sequence)[0] # (Batch size, sequence length, 768) maps = self.expansion(maps).unsqueeze(1).expand(-1, hiddens.shape[1], -1) # (Batch size, sequence length, 768) concat = torch.cat([hiddens, maps], dim=2) # (Batch size, sequence length, voc_size) out = self.classifier(concat) return out if __name__ == '__main__': """ LightResGpt2().show_params() LightVggGpt2().show_params() LightVggGpt2Avg().show_params() LightVggGpt2Max().show_params() """ LightVggGpt2AvgConcat().show_params()
35
110
0.603395
1,292
10,605
4.831269
0.109907
0.043255
0.024992
0.041653
0.833387
0.807434
0.807434
0.796379
0.796379
0.796379
0
0.044722
0.291561
10,605
302
111
35.115894
0.786104
0.217822
0
0.723529
0
0
0.01226
0
0
0
0
0
0
1
0.082353
false
0
0.035294
0
0.194118
0.023529
0
0
0
null
0
0
0
1
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
7
539bb8bf573c54bb556bb06b77eafcf39add7bce
210
py
Python
project/acorta/models.py
cborao/Django-url-shortener
fb3aea7a947546dbfbffa516c5590d8eb4c60c14
[ "MIT" ]
null
null
null
project/acorta/models.py
cborao/Django-url-shortener
fb3aea7a947546dbfbffa516c5590d8eb4c60c14
[ "MIT" ]
null
null
null
project/acorta/models.py
cborao/Django-url-shortener
fb3aea7a947546dbfbffa516c5590d8eb4c60c14
[ "MIT" ]
null
null
null
from django.db import models class Content(models.Model): key = models.CharField(max_length=200) url = models.CharField(max_length=200) def __str__(self): return self.key + ": " + self.url
26.25
42
0.680952
29
210
4.724138
0.62069
0.218978
0.262774
0.350365
0.394161
0
0
0
0
0
0
0.035714
0.2
210
7
43
30
0.779762
0
0
0
0
0
0.009524
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0.166667
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
7
53aa16faa7c602e62edd721652f7060aa128c59d
1,758
py
Python
test/docs/wiki_usage_test_2.py
acaceres2176/massweb
153d1e00ee293f467e88e7f5ce98617a5c13cfb7
[ "Apache-2.0" ]
null
null
null
test/docs/wiki_usage_test_2.py
acaceres2176/massweb
153d1e00ee293f467e88e7f5ce98617a5c13cfb7
[ "Apache-2.0" ]
null
null
null
test/docs/wiki_usage_test_2.py
acaceres2176/massweb
153d1e00ee293f467e88e7f5ce98617a5c13cfb7
[ "Apache-2.0" ]
null
null
null
""" >>> from massweb.mass_requests.mass_request import MassRequest >>> from massweb.targets.target import Target >>> >>> target_1 = Target(url=u"http://course.hyperiongray.com/vuln1", data={"password": "blh123"}, ttype="post") >>> target_2 = Target(url=u"http://course.hyperiongray.com/vuln2/898538a7335fd8e6bac310f079ba3fd1/", data={"how": "I'm good thx"}, ttype="post") >>> target_3 = Target(url=u"http://www.hyperiongray.com/", ttype="get") >>> targets = [target_1, target_2, target_3] >>> mr = MassRequest() >>> mr.request_targets(targets) >>> for r in mr.results: ... print r ... (<massweb.targets.target.Target object at 0x15496d0>, <Response [200]>) (<massweb.targets.target.Target object at 0x1549650>, <Response [200]>) (<massweb.targets.target.Target object at 0x1549490>, <Response [200]>) >>> for target, response in mr.results: ... print target, response.status_code ... http://course.hyperiongray.com/vuln2/898538a7335fd8e6bac310f079ba3fd1/ 200 http://www.hyperiongray.com/ 200 http://course.hyperiongray.com/vuln1 200`` """ from massweb.mass_requests.mass_request import MassRequest from massweb.targets.target import Target target_1 = Target(url=u"http://course.hyperiongray.com/vuln1", data={"password": "blh123"}, ttype="post") target_2 = Target(url=u"http://course.hyperiongray.com/vuln2/898538a7335fd8e6bac310f079ba3fd1/", data={"how": "I'm good thx"}, ttype="post") target_3 = Target(url=u"http://www.hyperiongray.com/", ttype="get") targets = [target_1, target_2, target_3] mr = MassRequest() mr.request_targets(targets) for result in mr.results: print result for target, response in mr.results: print target, response.status_code
46.263158
148
0.695677
225
1,758
5.346667
0.217778
0.112219
0.049875
0.069825
0.904406
0.879468
0.799668
0.799668
0.724855
0.724855
0
0.082563
0.138794
1,758
37
149
47.513514
0.712021
0
0
0
0
0
0.277955
0
0
0
0
0
0
0
null
null
0.083333
0.166667
null
null
0.166667
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
1
0
0
1
0
0
0
0
0
8
53c8799043541488e59b587eddc5ff78f1a8b319
20,503
py
Python
lucid/modelzoo/slim_models/Inception.py
dguliani/lucid
6da3ab010e3442e0b56709ff69ccf3c50a500db4
[ "Apache-2.0" ]
7
2018-11-06T20:49:27.000Z
2022-02-12T15:24:00.000Z
lucid/modelzoo/slim_models/Inception.py
dguliani/lucid
6da3ab010e3442e0b56709ff69ccf3c50a500db4
[ "Apache-2.0" ]
2
2020-07-19T11:08:01.000Z
2022-01-22T10:29:30.000Z
lucid/modelzoo/slim_models/Inception.py
dguliani/lucid
6da3ab010e3442e0b56709ff69ccf3c50a500db4
[ "Apache-2.0" ]
3
2019-04-02T15:57:30.000Z
2019-10-23T22:32:06.000Z
# Copyright 2018 The Lucid Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== from __future__ import absolute_import, division, print_function from lucid.modelzoo.vision_base import Model, _layers_from_list_of_dicts, IMAGENET_MEAN class InceptionV1_slim(Model): """InceptionV1 as implemented by the TensorFlow slim framework. InceptionV1 was introduced by Szegedy, et al (2014): https://arxiv.org/pdf/1409.4842v1.pdf This function provides the pre-trained reimplementation from TF slim: https://github.com/tensorflow/models/tree/master/research/slim corresponding to the name "inception_v1". """ layers = None model_path = 'gs://modelzoo/vision/slim_models/InceptionV1.pb' labels_path = 'gs://modelzoo/labels/ImageNet_standard_with_dummy.txt' dataset = 'ImageNet' image_shape = [224, 224, 3] # inpute range taken from: # https://github.com/tensorflow/models/blob/master/research/slim/preprocessing/inception_preprocessing.py#L280 image_value_range = (-1, 1) input_name = 'input' InceptionV1_slim.layers = _layers_from_list_of_dicts(InceptionV1_slim, [ {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Conv2d_1a_7x7/Relu', 'depth': 64}, {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Conv2d_2b_1x1/Relu', 'depth': 64}, {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Conv2d_2c_3x3/Relu', 'depth': 192}, {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Mixed_3b/concat', 'depth': 256}, {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Mixed_3c/concat', 'depth': 480}, {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Mixed_4b/concat', 'depth': 512}, {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Mixed_4c/concat', 'depth': 512}, {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Mixed_4d/concat', 'depth': 512}, {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Mixed_4e/concat', 'depth': 528}, {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Mixed_4f/concat', 'depth': 832}, {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Mixed_5b/concat', 'depth': 832}, {'tags': ['conv'], 'name': 'InceptionV1/InceptionV1/Mixed_5c/concat', 'depth': 1024}, {'tags': ['dense'], 'name': 'InceptionV1/Logits/Predictions/Softmax', 'depth': 1001}, ]) class InceptionV2_slim(Model): """InceptionV2 as implemented by the TensorFlow slim framework. InceptionV2 was introduced by Ioffe & Szegedy (2015): https://arxiv.org/pdf/1502.03167.pdf This function provides the pre-trained reimplementation from TF slim: https://github.com/tensorflow/models/tree/master/research/slim corresponding to the name "inception_v2". """ model_path = 'gs://modelzoo/vision/slim_models/InceptionV2.pb' labels_path = 'gs://modelzoo/labels/ImageNet_standard_with_dummy.txt' dataset = 'ImageNet' image_shape = [224, 224, 3] # inpute range taken from: # https://github.com/tensorflow/models/blob/master/research/slim/preprocessing/inception_preprocessing.py#L280 image_value_range = (-1, 1) input_name = 'input' InceptionV2_slim.layers = _layers_from_list_of_dicts(InceptionV2_slim, [ {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Conv2d_1a_7x7/Relu', 'depth': 64}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Conv2d_2b_1x1/Relu', 'depth': 64}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Conv2d_2c_3x3/Relu', 'depth': 192}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Mixed_3b/concat', 'depth': 256}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Mixed_3c/concat', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Mixed_4a/concat', 'depth': 576}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Mixed_4b/concat', 'depth': 576}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Mixed_4c/concat', 'depth': 576}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Mixed_4d/concat', 'depth': 576}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Mixed_4e/concat', 'depth': 576}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Mixed_5a/concat', 'depth': 1024}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Mixed_5b/concat', 'depth': 1024}, {'tags': ['conv'], 'name': 'InceptionV2/InceptionV2/Mixed_5c/concat', 'depth': 1024}, {'tags': ['dense'], 'name': 'InceptionV2/Predictions/Softmax', 'depth': 1001}, ]) class InceptionV3_slim(Model): """InceptionV3 as implemented by the TensorFlow slim framework. InceptionV3 was introduced by Szegedy, et al (2015) https://arxiv.org/pdf/1512.00567.pdf This function provides the pre-trained reimplementation from TF slim: https://github.com/tensorflow/models/tree/master/research/slim corresponding to the name "inception_v3". """ model_path = 'gs://modelzoo/vision/slim_models/InceptionV3.pb' labels_path = 'gs://modelzoo/labels/ImageNet_standard_with_dummy.txt' dataset = 'ImageNet' image_shape = [299, 299, 3] # inpute range taken from: # https://github.com/tensorflow/models/blob/master/research/slim/preprocessing/inception_preprocessing.py#L280 image_value_range = (-1, 1) input_name = 'input' InceptionV3_slim.layers = _layers_from_list_of_dicts(InceptionV3_slim, [ {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Conv2d_1a_3x3/Relu', 'depth': 32}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Conv2d_2a_3x3/Relu', 'depth': 32}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Conv2d_2b_3x3/Relu', 'depth': 64}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Conv2d_3b_1x1/Relu', 'depth': 80}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Conv2d_4a_3x3/Relu', 'depth': 192}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Mixed_5b/concat', 'depth': 256}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Mixed_5c/concat', 'depth': 288}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Mixed_5d/concat', 'depth': 288}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Mixed_6a/concat', 'depth': 768}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Mixed_6b/concat', 'depth': 768}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Mixed_6c/concat', 'depth': 768}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Mixed_6d/concat', 'depth': 768}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Mixed_6e/concat', 'depth': 768}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Mixed_7a/concat', 'depth': 1280}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Mixed_7b/concat', 'depth': 2048}, {'tags': ['conv'], 'name': 'InceptionV3/InceptionV3/Mixed_7c/concat', 'depth': 2048}, {'tags': ['dense'], 'name': 'InceptionV3/Predictions/Softmax', 'depth': 1001}, ]) class InceptionV4_slim(Model): """InceptionV4 as implemented by the TensorFlow slim framework. InceptionV4 was introduced by Szegedy, et al (2016): https://arxiv.org/pdf/1602.07261.pdf This function provides the pre-trained reimplementation from TF slim: https://github.com/tensorflow/models/tree/master/research/slim corresponding to the name "inception_v4". """ model_path = 'gs://modelzoo/vision/slim_models/InceptionV4.pb' labels_path = 'gs://modelzoo/labels/ImageNet_standard_with_dummy.txt' dataset = 'ImageNet' image_shape = [299, 299, 3] # inpute range taken from: # https://github.com/tensorflow/models/blob/master/research/slim/preprocessing/inception_preprocessing.py#L280 image_value_range = (-1, 1) input_name = 'input' InceptionV4_slim.layers = _layers_from_list_of_dicts(InceptionV4_slim, [ {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Conv2d_1a_3x3/Relu', 'depth': 32}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Conv2d_2a_3x3/Relu', 'depth': 32}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Conv2d_2b_3x3/Relu', 'depth': 64}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_3a/concat', 'depth': 160}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_4a/concat', 'depth': 192}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_5a/concat', 'depth': 384}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_5b/concat', 'depth': 384}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_5c/concat', 'depth': 384}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_5d/concat', 'depth': 384}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_5e/concat', 'depth': 384}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_6a/concat', 'depth': 1024}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_6b/concat', 'depth': 1024}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_6c/concat', 'depth': 1024}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_6d/concat', 'depth': 1024}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_6e/concat', 'depth': 1024}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_6f/concat', 'depth': 1024}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_6g/concat', 'depth': 1024}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_6h/concat', 'depth': 1024}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_7a/concat', 'depth': 1536}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_7b/concat', 'depth': 1536}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_7c/concat', 'depth': 1536}, {'tags': ['conv'], 'name': 'InceptionV4/InceptionV4/Mixed_7d/concat', 'depth': 1536}, {'tags': ['dense'], 'name': 'InceptionV4/Logits/Predictions', 'depth': 1001}, ]) class InceptionResnetV2_slim(Model): """InceptionResnetV2 as implemented by the TensorFlow slim framework. InceptionResnetV2 was introduced in this paper by Szegedy, et al (2016): https://arxiv.org/pdf/1602.07261.pdf This function provides the pre-trained reimplementation from TF slim: https://github.com/tensorflow/models/tree/master/research/slim corresponding to the name "inception_resnet_v2". """ model_path = 'gs://modelzoo/vision/slim_models/InceptionResnetV2.pb' labels_path = 'gs://modelzoo/labels/ImageNet_standard_with_dummy.txt' dataset = 'ImageNet' image_shape = [299, 299, 3] # inpute range taken from: # https://github.com/tensorflow/models/blob/master/research/slim/preprocessing/inception_preprocessing.py#L280 image_value_range = (-1, 1) input_name = 'input' # TODO: understand this graph, see if we can delete some add or relu nodes from layers InceptionResnetV2_slim.layers = _layers_from_list_of_dicts(InceptionResnetV2_slim, [ {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Conv2d_1a_3x3/Relu', 'depth': 32}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Conv2d_2a_3x3/Relu', 'depth': 32}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Conv2d_2b_3x3/Relu', 'depth': 64}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Conv2d_3b_1x1/Relu', 'depth': 80}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Conv2d_4a_3x3/Relu', 'depth': 192}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Mixed_5b/concat', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_1/add', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_1/Relu', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_2/add', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_2/Relu', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_3/add', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_3/Relu', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_4/add', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_4/Relu', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_5/add', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_5/Relu', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_6/add', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_6/Relu', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_7/add', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_7/Relu', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_8/add', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_8/Relu', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_9/add', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_9/Relu', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_10/add', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat/block35_10/Relu', 'depth': 320}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Mixed_6a/concat', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_1/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_1/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_2/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_2/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_3/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_3/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_4/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_4/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_5/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_5/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_6/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_6/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_7/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_7/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_8/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_8/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_9/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_9/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_10/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_10/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_11/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_11/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_12/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_12/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_13/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_13/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_14/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_14/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_15/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_15/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_16/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_16/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_17/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_17/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_18/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_18/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_19/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_19/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_20/add', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_1/block17_20/Relu', 'depth': 1088}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Mixed_7a/concat', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_1/add', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_1/Relu', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_2/add', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_2/Relu', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_3/add', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_3/Relu', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_4/add', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_4/Relu', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_5/add', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_5/Relu', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_6/add', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_6/Relu', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_7/add', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_7/Relu', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_8/add', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_8/Relu', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_9/add', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Repeat_2/block8_9/Relu', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Block8/add', 'depth': 2080}, {'tags': ['conv'], 'name': 'InceptionResnetV2/InceptionResnetV2/Conv2d_7b_1x1/Relu', 'depth': 1536}, {'tags': ['dense'], 'name': 'InceptionResnetV2/Logits/Predictions', 'depth': 1001}, ])
70.944637
112
0.698678
2,413
20,503
5.794861
0.104849
0.086391
0.129586
0.182507
0.889509
0.874562
0.80934
0.776085
0.745048
0.572409
0
0.077713
0.093108
20,503
288
113
71.190972
0.674304
0.149978
0
0.147059
0
0
0.632367
0.475098
0
0
0
0.003472
0
1
0
false
0
0.009804
0
0.186275
0.004902
0
0
0
null
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
53e39b988bbbfc1830bfae11f36bc40533867931
42
py
Python
tbn/app.py
RabidGuy/tbn
005abdadcaeccaf4a2737dc5c1b76870165bfa1a
[ "MIT" ]
null
null
null
tbn/app.py
RabidGuy/tbn
005abdadcaeccaf4a2737dc5c1b76870165bfa1a
[ "MIT" ]
null
null
null
tbn/app.py
RabidGuy/tbn
005abdadcaeccaf4a2737dc5c1b76870165bfa1a
[ "MIT" ]
null
null
null
import cmd class App(cmd.Cmd): pass
7
19
0.642857
7
42
3.857143
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.261905
42
5
20
8.4
0.870968
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
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
1
1
0
1
0
0
7
54d807743d979e6f69e2be357519b982d511d6bf
172
py
Python
ibsng/handler/stat/get_user_queue_stats.py
ParspooyeshFanavar/pyibsng
d48bcf4f25e3f23461528bf0ff8870cc3d537444
[ "MIT" ]
6
2018-03-06T10:16:36.000Z
2021-12-05T12:43:10.000Z
ibsng/handler/stat/get_user_queue_stats.py
ParspooyeshFanavar/pyibsng
d48bcf4f25e3f23461528bf0ff8870cc3d537444
[ "MIT" ]
3
2018-03-06T10:27:08.000Z
2022-01-02T15:21:27.000Z
ibsng/handler/stat/get_user_queue_stats.py
ParspooyeshFanavar/pyibsng
d48bcf4f25e3f23461528bf0ff8870cc3d537444
[ "MIT" ]
3
2018-01-06T16:28:31.000Z
2018-09-17T19:47:19.000Z
"""Get user queue stats API method.""" from ibsng.handler.handler import Handler class getUserQueueStats(Handler): """Get user queue stats method class.""" pass
19.111111
44
0.715116
22
172
5.590909
0.590909
0.113821
0.195122
0.276423
0
0
0
0
0
0
0
0
0.174419
172
8
45
21.5
0.866197
0.389535
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
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
1
1
0
1
0
0
8
54db02a38363e2aaab17bad4a8d4d3e8e482cf69
21,879
py
Python
lib/output.py
1modm/CCToolkit
65cfc518c7ed2d54883ef452303a0f1ea15275b7
[ "BSD-3-Clause" ]
2
2020-01-09T18:03:32.000Z
2021-11-06T18:23:36.000Z
lib/output.py
1modm/CCToolkit
65cfc518c7ed2d54883ef452303a0f1ea15275b7
[ "BSD-3-Clause" ]
null
null
null
lib/output.py
1modm/CCToolkit
65cfc518c7ed2d54883ef452303a0f1ea15275b7
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- __license__ = """ CCParser Author: https://twitter.com/1_mod_m/ Project site: https://github.com/1modm/ Copyright (c) 2016, MM All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ #------------------------------------------------------------------------------ # Plugins #------------------------------------------------------------------------------ from lib.htmloutput import htmlinfo, htmltitle, htmlinfolist, htmlinfoitem, htmlinfolistend,\ htmltitle_subclase, htmltitle_figure, htmlinfotable, htmlinfotr, htmlinfotrend, htmlinforowtd,\ htmlinforowth, htmlinforowtd, htmlinfotableend from lib.txtoutput import print_result_txt, print_title_txt #------------------------------------------------------------------------------ # Output html cc1_html_file = 'CCpart1.html' cc2_html_file = 'CCpart2.html' cc3_html_file = 'CCpart3.html' cem_html_file = 'CEM.html' # Create the txt results file cc_txt_file = 'cc.txt' #------------------------------------------------------------------------------ def results(e1, e2, e3, e4, e5, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt') outputdirectoryhtml = (outputdirectory + '/html') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) element1 = e1 element2 = e2 element3 = e3 element4 = e4 element5 = e5 if (cc1 > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinfo(childtext, cc1_html_file, outputdirectoryhtml) if (cc2 > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinfo(childtext, cc2_html_file, outputdirectoryhtml) if (cc3 > 0): if (element2 not in ("ac-overview", "ma-introduction", "ma-objectives", "ma-application-notes", "msa-objectives")): if (element3 not in ("af-overview", "msa-objectives")): if (element4 not in ("msa-objectives", "msa-input", "ae-evaluator", "msa-application-notes")): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinfo(childtext, cc3_html_file, outputdirectoryhtml) if (cem > 0): if (element2 not in ("ac-introduction", "ac-overview")): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinfo(childtext, cem_html_file, outputdirectoryhtml) #------------------------------------------------------------------------------ def titles(e1, e2, e3, e4, e5, title_name, hrefsection, cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt') outputdirectoryhtml = (outputdirectory + '/html') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) element1 = e1 element2 = e2 element3 = e3 element4 = e4 element5 = e5 if (cc1 > 0): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle(cc1_html_file, outputdirectoryhtml, title_name, hrefsection) if (cc2 > 0): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle(cc2_html_file, outputdirectoryhtml, title_name, hrefsection) if (cc3 > 0): if (element2 not in ("ac-overview", "ma-introduction", "ma-objectives", "ma-application-notes", "msa-objectives")): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle(cc3_html_file, outputdirectoryhtml, title_name, hrefsection) if (cem > 0): if (element2 not in ("ac-introduction", "ac-overview")): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle(cem_html_file, outputdirectoryhtml, title_name, hrefsection) #------------------------------------------------------------------------------ def list(e1, e2, e3, e4, e5, cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt') outputdirectoryhtml = (outputdirectory + '/html') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) element1 = e1 element2 = e2 element3 = e3 element4 = e4 element5 = e5 if (cc1 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfolist(cc1_html_file, outputdirectoryhtml) if (cc2 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfolist(cc2_html_file, outputdirectoryhtml) if (cc3 > 0): if (element2 not in ("ac-overview", "ma-introduction", "ma-objectives", "ma-application-notes", "msa-objectives")): if (element3 not in ("af-overview")): if (element4 not in ("msa-objectives", "msa-input")): if (element5 not in ("m-workunit")): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfolist(cc3_html_file, outputdirectoryhtml) if (cem > 0): if (element2 not in ("ac-introduction", "ac-overview")): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfolist(cem_html_file, outputdirectoryhtml) #------------------------------------------------------------------------------ def listend(e1, e2, e3, e4, e5, cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt') outputdirectoryhtml = (outputdirectory + '/html') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) element1 = e1 element2 = e2 element3 = e3 element4 = e4 element5 = e5 if (cc1 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfolistend(cc1_html_file, outputdirectoryhtml) if (cc2 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfolistend(cc2_html_file, outputdirectoryhtml) if (cc3 > 0): if (element2 not in ("ac-overview", "ma-introduction", "ma-objectives", "ma-application-notes", "msa-objectives")): if (element3 not in ("af-overview")): if (element4 not in ("msa-objectives", "msa-input")): if (element5 not in ("m-workunit")): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfolistend(cc3_html_file, outputdirectoryhtml) if (cem > 0): if (element2 not in ("ac-introduction", "ac-overview")): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfolistend(cem_html_file, outputdirectoryhtml) #------------------------------------------------------------------------------ def item(e1, e2, e3, e4, e5, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt') outputdirectoryhtml = (outputdirectory + '/html') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) element1 = e1 element2 = e2 element3 = e3 element4 = e4 element5 = e5 if (cc1 > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinfoitem(childtext, cc1_html_file, outputdirectoryhtml) if (cc2 > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinfoitem(childtext, cc2_html_file, outputdirectoryhtml) if (cc3 > 0): if (element2 not in ("ac-overview", "ma-introduction", "ma-objectives", "ma-application-notes", "msa-objectives")): if (element3 not in ("af-overview")): if (element4 not in ("msa-objectives", "msa-input")): if (element5 not in ("m-workunit")): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinfoitem(childtext, cc3_html_file, outputdirectoryhtml) if (cem > 0): if (element2 not in ("ac-introduction", "ac-overview")): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinfoitem(childtext, cem_html_file, outputdirectoryhtml) #------------------------------------------------------------------------------ def print_results(childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = "None" e2 = "None" e3 = "None" e4 = "None" e5 = "None" results(e1, e2, e3, e4, e5, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_aclass(element1, element2, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = "None" e4 = "None" e5 = "None" results(e1, e2, e3, e4, e5, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_aclass_child4(element1, element2, element3, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = "None" e4 = "None" e5 = "None" results(e1, e2, e3, e4, e5, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_aclass_child5(element1, element2, element3, element4, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = element3 e4 = element4 e5 = "None" results(e1, e2, e3, e4, e5, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_titles(title_name, hrefsection, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = "None" e2 = "None" e3 = "None" e4 = "None" e5 = "None" titles(e1, e2, e3, e4, e5, title_name, hrefsection, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_titles_aclass(element1, element2, title_name, hrefsection, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = "None" e4 = "None" e5 = "None" titles(e1, e2, e3, e4, e5, title_name, hrefsection, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_list_aclass(element1, element2, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = "None" e4 = "None" e5 = "None" list(e1, e2, e3, e4, e5, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_list_aclass_child6(element1, element2, element3, element4, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = element3 e4 = element4 e5 = "None" list(e1, e2, e3, e4, e5, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_list_aclass_child7(element1, element2, element3, element4, element5, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = element3 e4 = element4 e5 = element5 list(e1, e2, e3, e4, e5, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_list(cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = "None" e2 = "None" e3 = "None" e4 = "None" e5 = "None" list(e1, e2, e3, e4, e5, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_list_end_aclass(element1, element2, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = "None" e4 = "None" e5 = "None" listend(e1, e2, e3, e4, e5, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_list_end(cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = "None" e2 = "None" e3 = "None" e4 = "None" e5 = "None" listend(e1, e2, e3, e4, e5, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_list_end_aclass_child6(element1, element2, element3, element4, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = element3 e4 = element4 e5 = "None" listend(e1, e2, e3, e4, e5, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_list_end_aclass_child7(element1, element2, element3, element4, element5, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = element3 e4 = element4 e5 = element5 listend(e1, e2, e3, e4, e5, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_item_aclass(element1, element2, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = "None" e4 = "None" e5 = "None" item(e1, e2, e3, e4, e5, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_item_aclass_child6(element1, element2, element3, element4, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = element3 e4 = element4 e5 = "None" item(e1, e2, e3, e4, e5, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_item_aclass_child7(element1, element2, element3, element4, element5, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = element1 e2 = element2 e3 = element3 e4 = element4 e5 = element5 item(e1, e2, e3, e4, e5, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_item(childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory): e1 = "None" e2 = "None" e3 = "None" e4 = "None" e5 = "None" item(e1, e2, e3, e4, e5, childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory) def print_results_table(cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt') outputdirectoryhtml = (outputdirectory + '/html') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) if (cc1 > 0): print_result_txt("None", cc_txt_file, outputdirectorytxt) htmlinfotable(cc1_html_file, outputdirectoryhtml) if (cc2 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotable(cc2_html_file, outputdirectoryhtml) if (cc3 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotable(cc3_html_file, outputdirectoryhtml) if (cem > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotable(cem_html_file, outputdirectoryhtml) def print_results_tr(cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt') outputdirectoryhtml = (outputdirectory + '/html') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) if (cc1 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotr(cc1_html_file, outputdirectoryhtml) if (cc2 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotr(cc2_html_file, outputdirectoryhtml) if (cc3 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotr(cc3_html_file, outputdirectoryhtml) if (cem > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotr(cem_html_file, outputdirectoryhtml) def print_results_tr_end(cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt') outputdirectoryhtml = (outputdirectory + '/html') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) if (cc1 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotrend(cc1_html_file, outputdirectoryhtml) if (cc2 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotrend(cc2_html_file, outputdirectoryhtml) if (cc3 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotrend(cc3_html_file, outputdirectoryhtml) if (cem > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotrend(cem_html_file, outputdirectoryhtml) def print_results_rowtd(childtext, cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt') outputdirectoryhtml = (outputdirectory + '/html') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) if (cc1 > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinforowtd(childtext, cc1_html_file, outputdirectoryhtml) if (cc2 > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinforowtd(childtext, cc2_html_file, outputdirectoryhtml) if (cc3 > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinforowtd(childtext, cc3_html_file, outputdirectoryhtml) if (cem > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinforowtd(childtext, cem_html_file, outputdirectoryhtml) def print_results_rowth(childtext, columnspan, cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt') outputdirectoryhtml = (outputdirectory + '/html') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) if (cc1 > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinforowth(childtext, columnspan, cc1_html_file, outputdirectoryhtml) if (cc2 > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinforowth(childtext, columnspan, cc2_html_file, outputdirectoryhtml) if (cc3 > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinforowth(childtext, columnspan, cc3_html_file, outputdirectoryhtml) if (cem > 0): print_result_txt(childtext, cc_txt_file, outputdirectorytxt) htmlinforowth(childtext, columnspan, cem_html_file, outputdirectoryhtml) def print_results_table_end(cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt') outputdirectoryhtml = (outputdirectory + '/html') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) if (cc1 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotableend(cc1_html_file, outputdirectoryhtml) if (cc2 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotableend(cc2_html_file, outputdirectoryhtml) if (cc3 > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotableend(cc3_html_file, outputdirectoryhtml) if (cem > 0): print_result_txt("", cc_txt_file, outputdirectorytxt) htmlinfotableend(cem_html_file, outputdirectoryhtml) def print_titles_subclase(title_name, hrefsection, cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt/') outputdirectoryhtml = (outputdirectory + '/html/') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) if (cc1 > 0): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle_subclase(cc1_html_file, outputdirectoryhtml, title_name, hrefsection) if (cc2 > 0): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle_subclase(cc2_html_file, outputdirectoryhtml, title_name, hrefsection) if (cc3 > 0): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle_subclase(cc3_html_file, outputdirectoryhtml, title_name, hrefsection) if (cem > 0): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle_subclase(cem_html_file, outputdirectoryhtml, title_name, hrefsection) def print_results_figure(title_name, entity, width, height, cc1file, cc2file, cc3file, cemfile, outputdirectory): outputdirectorytxt = (outputdirectory + '/txt/') outputdirectoryhtml = (outputdirectory + '/html/') cc1 = int(cc1file) cc2 = int(cc2file) cc3 = int(cc3file) cem = int(cemfile) if (cc1 > 0): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle_figure(cc1_html_file, outputdirectoryhtml, title_name, entity, width, height) if (cc2 > 0): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle_figure(cc2_html_file, outputdirectoryhtml, title_name, entity, width, height) if (cc3 > 0): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle_figure(cc3_html_file, outputdirectoryhtml, title_name, entity, width, height) if (cem > 0): print_title_txt(title_name, cc_txt_file, outputdirectorytxt) htmltitle_figure(cem_html_file, outputdirectoryhtml, title_name, entity, width, height)
37.657487
151
0.67823
2,461
21,879
5.848436
0.093864
0.031126
0.033141
0.097547
0.883346
0.87084
0.864656
0.855207
0.82429
0.793163
0
0.041883
0.190274
21,879
580
152
37.722414
0.770546
0.036199
0
0.728665
0
0
0.125528
0.000997
0
0
0
0
0
1
0.067834
false
0
0.004376
0
0.07221
0.172867
0
0
0
null
0
0
0
1
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
7
070d89b5a98b684a478c0c748a49b5f348dbeab7
2,571
py
Python
bluebottle/exports/tasks.py
terrameijar/bluebottle
b4f5ba9c4f03e678fdd36091b29240307ea69ffd
[ "BSD-3-Clause" ]
10
2015-05-28T18:26:40.000Z
2021-09-06T10:07:03.000Z
bluebottle/exports/tasks.py
terrameijar/bluebottle
b4f5ba9c4f03e678fdd36091b29240307ea69ffd
[ "BSD-3-Clause" ]
762
2015-01-15T10:00:59.000Z
2022-03-31T15:35:14.000Z
bluebottle/exports/tasks.py
terrameijar/bluebottle
b4f5ba9c4f03e678fdd36091b29240307ea69ffd
[ "BSD-3-Clause" ]
9
2015-02-20T13:19:30.000Z
2022-03-08T14:09:17.000Z
import logging import os import posixpath from django.conf import settings from django.utils import timezone from celery import shared_task, current_task from .exporter import get_export_models, get_resource_for_model logger = logging.getLogger(__name__) @shared_task def export(exporter_class, format='xlsx', **kwargs): """ Generates the export. Support for django-tenant-schemas is built in. """ tenant = kwargs.pop('tenant', None) if tenant is not None: logger.debug('Settings tenant to %s' % tenant) from django.db import connection connection.set_tenant(tenant) export_root = settings.EXPORTDB_EXPORT_ROOT % tenant.schema_name else: export_root = settings.EXPORTDB_EXPORT_ROOT filename = u'export-{timestamp}.{ext}'.format( timestamp=timezone.now().strftime('%Y-%m-%d_%H%M%S'), ext=format ) models = get_export_models() resources = [get_resource_for_model(model, **kwargs) for model in models] exporter = exporter_class(resources) logger.info('Exporting resources: %s' % resources) databook = exporter.export(task=current_task) export_to = os.path.join(export_root, filename) if not os.path.exists(export_root): os.makedirs(export_root) with open(export_to, 'wb') as outfile: outfile.write(getattr(databook, format)) return filename def plain_export(exporter_class, format='xlsx', **kwargs): """ Generates the export. Support for django-tenant-schemas is built in. """ tenant = kwargs.pop('tenant', None) if tenant is not None: logger.debug('Settings tenant to %s' % tenant) from django.db import connection connection.set_tenant(tenant) export_root = settings.EXPORTDB_EXPORT_ROOT % tenant.schema_name else: export_root = settings.EXPORTDB_EXPORT_ROOT filename = u'export-{timestamp}.{ext}'.format( timestamp=timezone.now().strftime('%Y-%m-%d_%H%M%S'), ext=format ) models = get_export_models() resources = [get_resource_for_model(model, **kwargs) for model in models] exporter = exporter_class(resources) logger.info('Exporting resources: %s' % resources) databook = exporter.export() export_to = os.path.join(export_root, filename) if not os.path.exists(export_root): os.makedirs(export_root) with open(export_to, 'wb') as outfile: outfile.write(getattr(databook, format)) return posixpath.join(settings.EXPORTDB_EXPORT_ROOT % tenant.schema_name, filename)
30.607143
87
0.692338
330
2,571
5.215152
0.236364
0.087159
0.063916
0.075537
0.841371
0.841371
0.841371
0.816967
0.816967
0.816967
0
0
0.200311
2,571
83
88
30.975904
0.837062
0.054065
0
0.701754
0
0
0.079398
0.020059
0
0
0
0
0
1
0.035088
false
0
0.157895
0
0.22807
0
0
0
0
null
0
0
0
1
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
7
075dd661cae7283897d4bccf701174dd9a178f16
6,407
py
Python
BS4 Source codes/yahoo-finance/yahoo-web-source/app-basics/app.py
rabiyulfahimhasim786/beautiful-soup4-basics
1b030468524d97b94c5bde6e7469a9f57a2f4a56
[ "MIT" ]
null
null
null
BS4 Source codes/yahoo-finance/yahoo-web-source/app-basics/app.py
rabiyulfahimhasim786/beautiful-soup4-basics
1b030468524d97b94c5bde6e7469a9f57a2f4a56
[ "MIT" ]
null
null
null
BS4 Source codes/yahoo-finance/yahoo-web-source/app-basics/app.py
rabiyulfahimhasim786/beautiful-soup4-basics
1b030468524d97b94c5bde6e7469a9f57a2f4a56
[ "MIT" ]
null
null
null
from flask import Flask, request, redirect, render_template, url_for from matplotlib.pyplot import xlim import yfinance as yf import requests from bs4 import BeautifulSoup import pandas as pd import json import gspread from oauth2client.service_account import ServiceAccountCredentials from df2gspread import df2gspread as d2g app = Flask(__name__) @app.route('/hello/<name>') def hello_name(name): return 'Welcome %s!' % name @app.route('/info/', methods =["GET", "POST"]) def display_quote(): if request.method == "POST": # getting input with name = fname in HTML form x = request.form['text'] symbol = request.args.get('symbol', x) quote = yf.Ticker(symbol) return quote.info #return redirect(url_for("datas", x=x)) else: return render_template("form.html") @app.route("/info/<x>", methods =["GET", "POST"]) def datas(x): #x = request.form['text'] symbol = request.args.get('symbol', x) quote = yf.Ticker(symbol) return quote.info @app.route("/gainers/<url>", methods =["GET", "POST"]) def ygainers(url): if request.method == "POST": # getting input with name = fname in HTML form url = request.form['text'] html = requests.get(url).content soup = BeautifulSoup(html, 'lxml') a = soup.find_all('a', attrs={'data-test': 'quoteLink'}) b = soup.find_all('td', attrs={'aria-label': 'Name'}) c = soup.find_all('td', attrs={'aria-label': 'Price (Intraday)'}) d = soup.find_all('td', attrs={'aria-label': 'Change'}) e = soup.find_all('td', attrs={'aria-label': '% Change'}) f = soup.find_all('td', attrs={'aria-label': 'Volume'}) g = soup.find_all('td', attrs={'aria-label': 'Avg Vol (3 month)'}) h = soup.find_all('td', attrs={'aria-label': 'Market Cap'}) i = soup.find_all('td', attrs={'aria-label': 'PE Ratio (TTM)'}) a_ = [] b_ = [] c_ = [] d_ = [] e_ = [] f_ = [] g_ = [] h_ = [] i_ = [] for title in a: a_.append(title.text.strip()) for title in b: b_.append(title.text.strip()) for title in c: c_.append(title.text.strip()) for title in d: d_.append(title.text.strip()) for title in e: e_.append(title.text.strip()) for title in f: f_.append(title.text.strip()) for title in g: g_.append(title.text.strip()) for title in h: h_.append(title.text.strip()) for title in i: i_.append(title.text.strip()) # dataframe Name and Age columns df = pd.DataFrame({'Symbol': a_, 'Name': b_, 'Price': c_, 'Change': d_, 'Change %': e_, 'Volume': f_, 'Avg volume': g_, 'Market cap': h_, 'Ration': i_,}) scope = ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive','https://www.googleapis.com/auth/drive.file','https://www.googleapis.com/auth/spreadsheets'] creds = ServiceAccountCredentials.from_json_keyfile_name('service_account.json', scope) client = gspread.authorize(creds) spreadsheet_key = '1NbMXC3uHlK0sxcHCzA7WLjh1gYnEl3D8U3N6VdJ0pYQ' wks_name = 'Sheet4' cell_of_start_df = 'A2' d2g.upload(df, spreadsheet_key, wks_name, credentials=creds, col_names=False, row_names=False, start_cell = cell_of_start_df, clean=False) return 'ok' else: return render_template("gainers.html") @app.route("/ganiers-file/<url>", methods =["GET", "POST"]) def gainersdatas(url): if request.method == "POST": url = request.form['text'] # getting input with name = fname in HTML form html = requests.get(url).content soup = BeautifulSoup(html, 'lxml') a = soup.find_all('a', attrs={'data-test': 'quoteLink'}) b = soup.find_all('td', attrs={'aria-label': 'Name'}) c = soup.find_all('td', attrs={'aria-label': 'Price (Intraday)'}) d = soup.find_all('td', attrs={'aria-label': 'Change'}) e = soup.find_all('td', attrs={'aria-label': '% Change'}) f = soup.find_all('td', attrs={'aria-label': 'Volume'}) g = soup.find_all('td', attrs={'aria-label': 'Avg Vol (3 month)'}) h = soup.find_all('td', attrs={'aria-label': 'Market Cap'}) i = soup.find_all('td', attrs={'aria-label': 'PE Ratio (TTM)'}) a_ = [] b_ = [] c_ = [] d_ = [] e_ = [] f_ = [] g_ = [] h_ = [] i_ = [] for title in a: a_.append(title.text.strip()) for title in b: b_.append(title.text.strip()) for title in c: c_.append(title.text.strip()) for title in d: d_.append(title.text.strip()) for title in e: e_.append(title.text.strip()) for title in f: f_.append(title.text.strip()) for title in g: g_.append(title.text.strip()) for title in h: h_.append(title.text.strip()) for title in i: i_.append(title.text.strip()) # dataframe Name and Age columns df = pd.DataFrame({'Symbol': a_, 'Name': b_, 'Price': c_, 'Change': d_, 'Change %': e_, 'Volume': f_, 'Avg volume': g_, 'Market cap': h_, 'Ration': i_,}) scope = ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive','https://www.googleapis.com/auth/drive.file','https://www.googleapis.com/auth/spreadsheets'] creds = ServiceAccountCredentials.from_json_keyfile_name('service_account.json', scope) client = gspread.authorize(creds) spreadsheet_key = '1NbMXC3uHlK0sxcHCzA7WLjh1gYnEl3D8U3N6VdJ0pYQ' wks_name = 'Sheet4' cell_of_start_df = 'A2' d2g.upload(df, spreadsheet_key, wks_name, credentials=creds, col_names=False, row_names=False, start_cell = cell_of_start_df, clean=False) return 'ok' else: return render_template("gainers.html") if __name__ == '__main__': app.run(debug = True)
36.821839
190
0.558296
790
6,407
4.367089
0.178481
0.041739
0.057391
0.104348
0.828406
0.809565
0.809565
0.809565
0.79942
0.79942
0
0.007218
0.286405
6,407
174
191
36.821839
0.747375
0.040425
0
0.826667
0
0
0.195543
0.014745
0
0
0
0
0
1
0.033333
false
0
0.066667
0.006667
0.153333
0
0
0
0
null
0
0
0
1
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
7
4adb251f27efc731964f97b2df71d1e5cac36cc7
43
py
Python
tests/collagen/__init__.py
newskylabs/newskylabs-collagen
3e2e331605745e6709f57dce8730ceb9ceaa002c
[ "Apache-2.0" ]
null
null
null
tests/collagen/__init__.py
newskylabs/newskylabs-collagen
3e2e331605745e6709f57dce8730ceb9ceaa002c
[ "Apache-2.0" ]
null
null
null
tests/collagen/__init__.py
newskylabs/newskylabs-collagen
3e2e331605745e6709f57dce8730ceb9ceaa002c
[ "Apache-2.0" ]
null
null
null
from . import datasets from . import utils
14.333333
22
0.767442
6
43
5.5
0.666667
0.606061
0
0
0
0
0
0
0
0
0
0
0.186047
43
2
23
21.5
0.942857
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
4afc786bc4cc731cb0621fab424c437b2d964190
8,347
py
Python
opensfm/test/test_reconstruction_alignment.py
vik748/OpenSfM
bd949246e3e0d6d3a707a08224038034d27e3ee8
[ "BSD-2-Clause" ]
1
2020-10-04T06:49:36.000Z
2020-10-04T06:49:36.000Z
opensfm/test/test_reconstruction_alignment.py
silwalanish/OpenSfM
a1b611a8c8056791f5e0e250ebd9f736fb9eda86
[ "BSD-2-Clause" ]
3
2021-06-08T22:22:02.000Z
2022-03-12T00:47:52.000Z
opensfm/test/test_reconstruction_alignment.py
silwalanish/OpenSfM
a1b611a8c8056791f5e0e250ebd9f736fb9eda86
[ "BSD-2-Clause" ]
null
null
null
import numpy as np from opensfm import pygeometry from opensfm import pybundle def get_shot_origin(shot): """Compute the origin of a shot.""" pose = pygeometry.Pose([shot.rx, shot.ry, shot.rz], [shot.tx, shot.ty, shot.tz]) return pose.get_origin() def get_reconstruction_origin(r): """Compute the origin of a reconstruction.""" s = r.scale pose = pygeometry.Pose([r.rx, r.ry, r.rz], [r.tx / s, r.ty / s, r.tz / s]) return pose.get_origin() def test_single_shot(): """Single shot test.""" ra = pybundle.ReconstructionAlignment() ra.add_shot('1', 0.5, 0, 0, 0, 0, 0, False) ra.add_absolute_position_constraint('1', 1, 0, 0, 1) ra.run() s1 = ra.get_shot('1') assert np.allclose(get_shot_origin(s1), [1, 0, 0], atol=1e-6) def test_singleton_reconstruction(): """Single shot in a single reconstruction.""" ra = pybundle.ReconstructionAlignment() ra.add_shot('1', 0, 0, 0, 0, 0, 0, False) ra.add_reconstruction('a', 0, 0, 0, 0, 0, 0, 4, False) ra.add_relative_motion_constraint( pybundle.RARelativeMotionConstraint('a', '1', 0, 0, 0, -1, 0, 0)) ra.add_absolute_position_constraint('1', 1, 0, 0, 1) ra.run() s1 = ra.get_shot('1') assert np.allclose(get_shot_origin(s1), [1, 0, 0], atol=1e-6) def test_pair(): """Simple single reconstruction two shots test.""" ra = pybundle.ReconstructionAlignment() ra.add_shot('1', 0, 0, 0, 0, 0, 0, False) ra.add_shot('2', 0, 0, 0, 0, 0, 0, False) ra.add_reconstruction('a', 0, 0, 0, 0, 0, 0, 4, False) ra.add_relative_motion_constraint( pybundle.RARelativeMotionConstraint('a', '1', 0, 0, 0, 0, 0, 0)) ra.add_relative_motion_constraint( pybundle.RARelativeMotionConstraint('a', '2', 0, 0, 0, -1, 0, 0)) ra.add_absolute_position_constraint('1', 1, 0, 0, 1) ra.add_absolute_position_constraint('2', 3, 0, 0, 1) ra.run() s1 = ra.get_shot('1') s2 = ra.get_shot('2') rec_a = ra.get_reconstruction('a') assert np.allclose(get_shot_origin(s1), [1, 0, 0], atol=1e-6) assert np.allclose(get_shot_origin(s2), [3, 0, 0], atol=1e-6) assert np.allclose(get_reconstruction_origin(rec_a), [1, 0, 0], atol=1e-6) assert np.allclose(rec_a.scale, 0.5) def test_two_shots_one_fixed(): """Two shot, one reconstruction. One shot is fixed""" ra = pybundle.ReconstructionAlignment() ra.add_shot('1', 0, 0, 0, -1, 0, 0, True) ra.add_shot('2', 0, 0, 0, 0, 0, 0, False) ra.add_reconstruction('a', 0, 0, 0, 0, 0, 0, 1, False) ra.add_relative_motion_constraint( pybundle.RARelativeMotionConstraint('a', '1', 0, 0, 0, 0, 0, 0)) ra.add_relative_motion_constraint( pybundle.RARelativeMotionConstraint('a', '2', 0, 0, 0, -1, 0, 0)) # Next line should be ignored because shot 1 is fixed ra.add_absolute_position_constraint('1', 100, 0, 0, 1) ra.add_absolute_position_constraint('2', 3, 0, 0, 1) ra.run() s1 = ra.get_shot('1') s2 = ra.get_shot('2') rec_a = ra.get_reconstruction('a') assert np.allclose(get_shot_origin(s1), [1, 0, 0], atol=1e-6) assert np.allclose(get_shot_origin(s2), [3, 0, 0], atol=1e-6) assert np.allclose(get_reconstruction_origin(rec_a), [1, 0, 0], atol=1e-6) assert np.allclose(rec_a.scale, 0.5) def test_two_reconstructions_soft_alignment(): """Two reconstructions""" ra = pybundle.ReconstructionAlignment() ra.add_shot('1', 0, 0, 0, 0, 0, 0, False) ra.add_shot('2', 0, 0, 0, 0, 0, 0, False) ra.add_shot('3', 0, 0, 0, 0, 0, 0, False) ra.add_shot('4', 0, 0, 0, 0, 0, 0, False) ra.add_reconstruction('a', 0, 0, 0, 0, 0, 0, 1, False) ra.add_relative_motion_constraint( pybundle.RARelativeMotionConstraint('a', '1', 0, 0, 0, 0, 0, 0)) ra.add_relative_motion_constraint( pybundle.RARelativeMotionConstraint('a', '2', 0, 0, 0, -1, 0, 0)) ra.add_relative_motion_constraint( pybundle.RARelativeMotionConstraint('a', '3', 0, 0, 0, -2, 0, 0)) ra.add_reconstruction('b', 0, 0, 0, 0, 0, 0, 1, False) ra.add_relative_motion_constraint( pybundle.RARelativeMotionConstraint('b', '2', 0, 0, 0, 0, 0, 0)) ra.add_relative_motion_constraint( pybundle.RARelativeMotionConstraint('b', '3', 0, 0, 0, -1, 0, 0)) ra.add_relative_motion_constraint( pybundle.RARelativeMotionConstraint('b', '4', 0, 0, 0, -2, 0, 0)) ra.add_absolute_position_constraint('1', 1, 0, 0, 1) ra.add_absolute_position_constraint('2', 2, 0, 0, 1) ra.run() s1 = ra.get_shot('1') s2 = ra.get_shot('2') s3 = ra.get_shot('3') s4 = ra.get_shot('4') rec_a = ra.get_reconstruction('a') rec_b = ra.get_reconstruction('b') assert np.allclose(get_shot_origin(s1), [1, 0, 0], atol=1e-6) assert np.allclose(get_shot_origin(s2), [2, 0, 0], atol=1e-6) assert np.allclose(get_shot_origin(s3), [3, 0, 0], atol=1e-6) assert np.allclose(get_shot_origin(s4), [4, 0, 0], atol=1e-6) assert np.allclose(get_reconstruction_origin(rec_a), [1, 0, 0], atol=1e-6) assert np.allclose(get_reconstruction_origin(rec_b), [2, 0, 0], atol=1e-6) assert np.allclose(rec_a.scale, 1) assert np.allclose(rec_b.scale, 1) def test_two_reconstructions_rigid_alignment(): """Two reconstructions""" ra = pybundle.ReconstructionAlignment() ra.add_shot('a_1', 0, 0, 0, -1, 0, 0, True) ra.add_shot('a_2', 0, 0, 0, -2, 0, 0, True) ra.add_shot('a_3', 0, 0, 0, 0, 0, 0, True) ra.add_shot('a_4', 0, 0, 0, 0, -1, 0, True) ra.add_shot('a_5', 0, 0, 0, -1, 0, 0, True) ra.add_reconstruction('a', 0, 0, 0, 0, 0, 0, 1, False) ra.add_shot('b_3', 0, 0, 0, -1, -1, 0, True) ra.add_shot('b_4', 0, 0, 0, -1, -2, 0, True) ra.add_shot('b_5', 0, 0, 0, -2, -1, 0, True) ra.add_shot('b_6', 0, 0, 0, -4, 0, 0, True) ra.add_shot('b_7', 0, 0, 0, -5, 0, 0, True) ra.add_reconstruction('b', 0, 0, 0, 0, 0, 0, 1, False) ra.add_relative_absolute_position_constraint('a', 'a_3', 5, 5, 0, 1) ra.add_relative_absolute_position_constraint('a', 'a_4', 5, 6, 0, 1) ra.add_relative_absolute_position_constraint('b', 'b_3', 5, 5, 0, 1) ra.add_relative_absolute_position_constraint('b', 'b_4', 5, 6, 0, 1) ra.run() rec_a = ra.get_reconstruction('a') rec_b = ra.get_reconstruction('b') assert np.allclose(get_reconstruction_origin(rec_a), [5, 5, 0], atol=1e-6) assert np.allclose(get_reconstruction_origin(rec_b), [4, 4, 0], atol=1e-6) assert np.allclose(rec_a.scale, 1) assert np.allclose(rec_b.scale, 1) def test_two_reconstructions_common_camera(): """Two reconstructions""" ra = pybundle.ReconstructionAlignment() ra.add_shot('a_1', 0, 0, 0, -1, 0, 0, True) ra.add_shot('a_2', 0, 0, 0, -2, 0, 0, True) ra.add_shot('a_3', 0, 0, 0, 0, 0, 0, True) ra.add_shot('a_4', 0, 0, 0, 0, -1, 0, True) ra.add_shot('a_5', 0, 0, 0, -1, 0, 0, True) ra.add_reconstruction('a', 0, 0, 0, 0, 0, 0, 1, True) ra.add_shot('b_3', 0, 0, 0, -1, -1, 0, True) ra.add_shot('b_4', 0, 0, 0, -1, -2, 0, True) ra.add_shot('b_5', 0, 0, 0, -2, -1, 0, True) ra.add_shot('b_6', 0, 0, 0, -4, 0, 0, True) ra.add_shot('b_7', 0, 0, 0, -5, 0, 0, True) ra.add_reconstruction('b', 0, 0, 0, 0, 0, 0, 1, False) ra.add_common_camera_constraint('a', 'a_3', 'b', 'b_3', 1, 1) ra.add_common_camera_constraint('a', 'a_4', 'b', 'b_4', 1, 1) ra.add_common_camera_constraint('a', 'a_5', 'b', 'b_5', 1, 1) ra.run() rec_a = ra.get_reconstruction('a') rec_b = ra.get_reconstruction('b') assert np.allclose(get_reconstruction_origin(rec_a), [0, 0, 0], atol=1e-6) assert np.allclose(get_reconstruction_origin(rec_b), [-1, -1, 0], atol=1e-6) assert np.allclose(rec_a.scale, 1) assert np.allclose(rec_b.scale, 1) def test_common_points(): """Two reconstructions, two common points""" ra = pybundle.ReconstructionAlignment() ra.add_reconstruction('a', 0, 0, 0, 0, 0, 0, 1, True) ra.add_reconstruction('b', 0, 0, 0, 0, 0, 0, 1, False) ra.add_common_point_constraint('a', 0, 0, 0, 'b', -1, 0, 0, 1.0) ra.add_common_point_constraint('a', 1, 0, 0, 'b', 0, 0, 0, 1.0) ra.run() rec_b = ra.get_reconstruction('b') o_b = get_reconstruction_origin(rec_b) assert np.allclose(o_b, [1, 0, 0], atol=1e-6)
38.643519
84
0.622978
1,472
8,347
3.347147
0.057745
0.094175
0.081591
0.064136
0.876801
0.845139
0.821392
0.817333
0.806982
0.776132
0
0.087764
0.193243
8,347
215
85
38.823256
0.643897
0.044567
0
0.701863
0
0
0.021961
0
0
0
0
0
0.167702
1
0.062112
false
0
0.018634
0
0.093168
0
0
0
0
null
0
0
0
1
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
7
ab0318eb07992d87053496a7262d0a0db7ecaf91
3,983
py
Python
Tests/test_dis.py
amaeckelberghe/Pyjion
cdf8fbd3f3808d398a71fca085420f71c7dff106
[ "MIT" ]
null
null
null
Tests/test_dis.py
amaeckelberghe/Pyjion
cdf8fbd3f3808d398a71fca085420f71c7dff106
[ "MIT" ]
null
null
null
Tests/test_dis.py
amaeckelberghe/Pyjion
cdf8fbd3f3808d398a71fca085420f71c7dff106
[ "MIT" ]
null
null
null
from pyjion.dis import print_il, dis import pyjion import unittest import io import contextlib class DisassemblerModuleTestCase(unittest.TestCase): def setUp(self) -> None: pyjion.enable() def tearDown(self) -> None: pyjion.disable() def test_fat(self): def test_f(): a = 1 b = 2 c = 3 d = 4 return a+b+c+d self.assertTrue(test_f() == 10) f = io.StringIO() with contextlib.redirect_stdout(f): dis(test_f) self.assertIn("ldarg.1", f.getvalue()) def test_fat_static(self): test_method = bytearray(b'\x03 h\x00\x00\x00\xd3X\n\x03(A\x00\x00\x00\x16\r!0\x19Rc\xd1\x7f\x00\x00\xd3% \x00\x00\x00\x00\xd3X%J\x17XT\x06\x18T\x13\n\x03 h\x01\x00\x00\xd3XM\x03 h\x01\x00\x00\xd3X\x11\n\xdf(\x10\x00\x00\x00!P\x19Rc\xd1\x7f\x00\x00\xd3% \x00\x00\x00\x00\xd3X%J\x17XT\x06\x1cT\x13\n\x03 p\x01\x00\x00\xd3XM\x03 p\x01\x00\x00\xd3X\x11\n\xdf(\x10\x00\x00\x00!p\x19Rc\xd1\x7f\x00\x00\xd3% \x00\x00\x00\x00\xd3X%J\x17XT\x06\x1f\nT\x13\n\x03 x\x01\x00\x00\xd3XM\x03 x\x01\x00\x00\xd3X\x11\n\xdf(\x10\x00\x00\x00!\x90\x19Rc\xd1\x7f\x00\x00\xd3% \x00\x00\x00\x00\xd3X%J\x17XT\x06\x1f\x0eT\x13\n\x03 \x80\x01\x00\x00\xd3XM\x03 \x80\x01\x00\x00\xd3X\x11\n\xdf(\x10\x00\x00\x00\x06\x1f\x10T\x03 h\x01\x00\x00\xd3XM%\x0c\x16\xd3@\x1a\x00\x00\x00!0 nc\xd1\x7f\x00\x00\xd3(:\x00\x00\x00\x03(8\x00\x00\x008G\x01\x00\x00\x08% \x00\x00\x00\x00\xd3X%J\x17XT\x06\x1f\x12T\x03 p\x01\x00\x00\xd3XM%\x0c\x16\xd3@\x1c\x00\x00\x00!\xf0\xbeac\xd1\x7f\x00\x00\xd3(:\x00\x00\x00\x03(8\x00\x00\x00\x13\x0b8\x07\x01\x00\x00\x08% \x00\x00\x00\x00\xd3X%J\x17XT\x06\x1f\x14T(\x00\x00\x00\x00%\x0c\x16\xd3@\x0b\x00\x00\x00\x03(8\x00\x00\x008\xdc\x00\x00\x00\x08\x06\x1f\x16T\x03 x\x01\x00\x00\xd3XM%\x0c\x16\xd3@\x1c\x00\x00\x00!\xb0\x8c]c\xd1\x7f\x00\x00\xd3(:\x00\x00\x00\x03(8\x00\x00\x00\x13\x0b8\xa9\x00\x00\x00\x08% \x00\x00\x00\x00\xd3X%J\x17XT\x06\x1f\x18T(\x00\x00\x00\x00%\x0c\x16\xd3@\x0b\x00\x00\x00\x03(8\x00\x00\x008~\x00\x00\x00\x08\x06\x1f\x1aT\x03 \x80\x01\x00\x00\xd3XM%\x0c\x16\xd3@\x1c\x00\x00\x00!\xb0\x8b]c\xd1\x7f\x00\x00\xd3(:\x00\x00\x00\x03(8\x00\x00\x00\x13\x0b8K\x00\x00\x00\x08% \x00\x00\x00\x00\xd3X%J\x17XT\x06\x1f\x1cT(\x00\x00\x00\x00%\x0c\x16\xd3@\x0b\x00\x00\x00\x03(8\x00\x00\x008 \x00\x00\x00\x08\x06\x1f\x1eT\x0b8\x1c\x00\x00\x00\t\x16>\t\x00\x00\x00&&&\t\x19\xda\r+\xf08\x00\x00\x00\x00\x16\xd38\x01\x00\x00\x00\x07\x03(B\x00\x00\x00*') f = io.StringIO() with contextlib.redirect_stdout(f): print_il(test_method) self.assertIn("ldarg.1", f.getvalue()) def test_thin(self): test_method = bytearray(b'\x03 h\x00\x00\x00\xd3X\n\x03(A\x00\x00\x00\x16\r\x06 ' b'\x00\x00\x00\x00\xd3T\x03!\xb0\xc6V)\x91\x7f\x00\x00\xd3(' b'\x00\x00\x03\x00%\x0c\x16\xd3@\x0b\x00\x00\x00\x03(' b'8\x00\x00\x008\x91\x00\x00\x00\x08\x06 ' b'\x02\x00\x00\x00\xd3T!\xf0\xc3\x13*\x91\x7f\x00\x00\xd3% ' b'\x00\x00\x00\x00\xd3X%J\x17XT\x06 \x04\x00\x00\x00\xd3T(' b'\x01\x00\x01\x00%\x0c\x16\xd3@\x0b\x00\x00\x00\x03(' b'8\x00\x00\x008P\x00\x00\x00\x08\x06 \x06\x00\x00\x00\xd3T(\x10\x00\x00\x00\x06 ' b'\x08\x00\x00\x00\xd3T!\xe0\x1e\xda\x02\x01\x00\x00\x00\xd3% ' b'\x00\x00\x00\x00\xd3X%J\x17XT\x06 ' b'\n\x00\x00\x00\xd3T\x0b\xdd\x1c\x00\x00\x00\t\x16>\t\x00\x00\x00&&&\x19\tY\r+\xf08' b'\x00\x00\x00\x00\x16\xd38\x01\x00\x00\x00\x07\x03(B\x00\x00\x00*') f = io.StringIO() with contextlib.redirect_stdout(f): print_il(test_method) self.assertIn("ldarg.1", f.getvalue()) if __name__ == "__main__": unittest.main()
68.672414
1,866
0.611599
755
3,983
3.193377
0.156291
0.42555
0.291165
0.079635
0.755703
0.722522
0.676898
0.667358
0.622148
0.622148
0
0.304949
0.183279
3,983
57
1,867
69.877193
0.436213
0
0
0.234043
0
0.234043
0.638463
0.62114
0
0
0
0
0.085106
1
0.12766
false
0
0.106383
0
0.276596
0.06383
0
0
0
null
1
1
0
0
1
0
0
0
1
0
1
0
0
0
1
0
1
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
ab3eab49358a14dc8881a213b3bd84eb80939c72
22,612
py
Python
tests/test_sc.py
herrmannlab/highdicom
95f39dd722ae6d357af3f942e2130d0ff4d68bfc
[ "MIT" ]
2
2022-02-23T02:09:40.000Z
2022-03-14T18:46:51.000Z
tests/test_sc.py
herrmannlab/highdicom
95f39dd722ae6d357af3f942e2130d0ff4d68bfc
[ "MIT" ]
9
2022-02-19T13:55:14.000Z
2022-03-31T13:16:47.000Z
tests/test_sc.py
herrmannlab/highdicom
95f39dd722ae6d357af3f942e2130d0ff4d68bfc
[ "MIT" ]
null
null
null
from pathlib import Path from io import BytesIO import unittest import numpy as np import pytest from pydicom.encaps import generate_pixel_data_frame from pydicom.filereader import dcmread from pydicom.uid import ( RLELossless, JPEGBaseline8Bit, JPEG2000Lossless, JPEGLSLossless, ) from pydicom.valuerep import DA, TM from highdicom import SpecimenDescription from highdicom.sc import SCImage from highdicom import UID from highdicom.frame import decode_frame class TestSCImage(unittest.TestCase): def setUp(self): super().setUp() self._rgb_pixel_array = np.zeros((10, 10, 3), dtype=np.uint8) self._monochrome_pixel_array = np.zeros((10, 10), dtype=np.uint16) self._study_instance_uid = UID() self._series_instance_uid = UID() self._sop_instance_uid = UID() self._series_number = int(np.random.choice(100)) + 1 self._instance_number = int(np.random.choice(100)) + 1 self._manufacturer = 'ABC' self._laterality = 'L' self._pixel_spacing = [0.5, 0.5] self._patient_orientation = ['A', 'R'] self._container_identifier = str(np.random.choice(100)) self._specimen_identifier = str(np.random.choice(100)) self._specimen_uid = UID() file_path = Path(__file__) data_dir = file_path.parent.parent.joinpath('data') self._ref_dataset = dcmread( str(data_dir.joinpath('test_files', 'ct_image.dcm')) ) @staticmethod def get_array_after_writing(instance): # Write DICOM object to buffer, read it again and reconstruct the mask with BytesIO() as fp: instance.save_as(fp) fp.seek(0) ds = dcmread(fp) decoded_frame_arrays = [ decode_frame( value, transfer_syntax_uid=ds.file_meta.TransferSyntaxUID, rows=ds.Rows, columns=ds.Columns, samples_per_pixel=ds.SamplesPerPixel, bits_allocated=ds.BitsAllocated, bits_stored=ds.BitsStored, photometric_interpretation=ds.PhotometricInterpretation, pixel_representation=ds.PixelRepresentation, planar_configuration=getattr(ds, 'PlanarConfiguration', None) ) for value in generate_pixel_data_frame(instance.PixelData) ] if len(decoded_frame_arrays) > 1: return np.stack(decoded_frame_arrays) return decoded_frame_arrays[0] def test_construct_rgb_patient(self): bits_allocated = 8 photometric_interpretation = 'RGB' coordinate_system = 'PATIENT' instance = SCImage( pixel_array=self._rgb_pixel_array, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, patient_orientation=self._patient_orientation, laterality=self._laterality, pixel_spacing=self._pixel_spacing, ) assert instance.BitsAllocated == bits_allocated assert instance.SamplesPerPixel == 3 assert instance.PlanarConfiguration == 0 assert instance.PhotometricInterpretation == photometric_interpretation assert instance.StudyInstanceUID == self._study_instance_uid assert instance.SeriesInstanceUID == self._series_instance_uid assert instance.SOPInstanceUID == self._sop_instance_uid assert instance.SeriesNumber == self._series_number assert instance.InstanceNumber == self._instance_number assert instance.Manufacturer == self._manufacturer assert instance.Laterality == self._laterality assert instance.PatientOrientation == self._patient_orientation assert instance.AccessionNumber is None assert instance.PatientName is None assert instance.PatientSex is None assert instance.StudyTime is None assert instance.StudyTime is None assert instance.PixelSpacing == [0.5, 0.5] assert instance.PixelData == self._rgb_pixel_array.tobytes() with pytest.raises(AttributeError): instance.ContainerIdentifier instance.SpecimenDescriptionSequence instance.ContainerTypeCodeSequence instance.IssuerOfTheContainerIdentifierSequence def test_construct_rgb_patient_missing_parameter(self): with pytest.raises(TypeError): bits_allocated = 8 photometric_interpretation = 'RGB' coordinate_system = 'PATIENT' SCImage( pixel_array=self._rgb_pixel_array, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, ) def test_construct_rgb_slide_single_specimen(self): bits_allocated = 8 photometric_interpretation = 'RGB' coordinate_system = 'SLIDE' specimen_description = SpecimenDescription( specimen_id=self._specimen_identifier, specimen_uid=self._specimen_uid ) instance = SCImage( pixel_array=self._rgb_pixel_array, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, container_identifier=self._container_identifier, specimen_descriptions=[specimen_description] ) assert instance.BitsAllocated == bits_allocated assert instance.SamplesPerPixel == 3 assert instance.PlanarConfiguration == 0 assert instance.PhotometricInterpretation == photometric_interpretation assert instance.StudyInstanceUID == self._study_instance_uid assert instance.SeriesInstanceUID == self._series_instance_uid assert instance.SOPInstanceUID == self._sop_instance_uid assert instance.SeriesNumber == self._series_number assert instance.InstanceNumber == self._instance_number assert instance.Manufacturer == self._manufacturer assert instance.ContainerIdentifier == self._container_identifier assert len(instance.ContainerTypeCodeSequence) == 1 assert len(instance.IssuerOfTheContainerIdentifierSequence) == 0 assert len(instance.SpecimenDescriptionSequence) == 1 specimen_item = instance.SpecimenDescriptionSequence[0] assert specimen_item.SpecimenIdentifier == self._specimen_identifier assert specimen_item.SpecimenUID == self._specimen_uid assert instance.AccessionNumber is None assert instance.PatientName is None assert instance.PatientSex is None assert instance.StudyTime is None assert instance.StudyTime is None assert instance.PixelData == self._rgb_pixel_array.tobytes() with pytest.raises(AttributeError): instance.Laterality instance.PatientOrientation def test_construct_rgb_slide_single_specimen_missing_parameter(self): bits_allocated = 8 photometric_interpretation = 'RGB' coordinate_system = 'SLIDE' specimen_description = SpecimenDescription( specimen_id=self._specimen_identifier, specimen_uid=self._specimen_uid ) with pytest.raises(TypeError): SCImage( pixel_array=self._rgb_pixel_array, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, specimen_descriptions=[specimen_description] ) def test_construct_rgb_slide_single_specimen_missing_parameter_1(self): bits_allocated = 8 photometric_interpretation = 'RGB' coordinate_system = 'SLIDE' with pytest.raises(TypeError): SCImage( pixel_array=self._rgb_pixel_array, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, container_identifier=self._container_identifier, ) def test_construct_monochrome_patient(self): bits_allocated = 12 photometric_interpretation = 'MONOCHROME2' coordinate_system = 'PATIENT' instance = SCImage( pixel_array=self._monochrome_pixel_array, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, patient_orientation=self._patient_orientation ) assert instance.BitsAllocated == bits_allocated assert instance.SamplesPerPixel == 1 assert instance.PhotometricInterpretation == photometric_interpretation assert instance.StudyInstanceUID == self._study_instance_uid assert instance.SeriesInstanceUID == self._series_instance_uid assert instance.SOPInstanceUID == self._sop_instance_uid assert instance.SeriesNumber == self._series_number assert instance.InstanceNumber == self._instance_number assert instance.Manufacturer == self._manufacturer assert instance.PatientOrientation == self._patient_orientation assert instance.AccessionNumber is None assert instance.PatientName is None assert instance.PatientSex is None assert instance.StudyTime is None assert instance.StudyDate is None assert instance.PixelData == self._monochrome_pixel_array.tobytes() with pytest.raises(AttributeError): instance.ContainerIdentifier instance.SpecimenDescriptionSequence instance.ContainerTypeCodeSequence instance.IssuerOfTheContainerIdentifierSequence def test_monochrome_rle(self): bits_allocated = 8 # RLE requires multiple of 8 bits photometric_interpretation = 'MONOCHROME2' coordinate_system = 'PATIENT' frame = np.random.randint(0, 256, size=(256, 256), dtype=np.uint8) instance = SCImage( pixel_array=frame, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, patient_orientation=self._patient_orientation, transfer_syntax_uid=RLELossless ) assert instance.file_meta.TransferSyntaxUID == RLELossless assert np.array_equal( self.get_array_after_writing(instance), frame ) def test_rgb_rle(self): bits_allocated = 8 # RLE requires multiple of 8 bits photometric_interpretation = 'RGB' coordinate_system = 'PATIENT' frame = np.random.randint(0, 256, size=(256, 256, 3), dtype=np.uint8) instance = SCImage( pixel_array=frame, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, patient_orientation=self._patient_orientation, transfer_syntax_uid=RLELossless ) assert instance.file_meta.TransferSyntaxUID == RLELossless assert np.array_equal( self.get_array_after_writing(instance), frame ) def test_monochrome_jpeg_baseline(self): bits_allocated = 8 photometric_interpretation = 'MONOCHROME2' coordinate_system = 'PATIENT' frame = np.zeros((256, 256), dtype=np.uint8) frame[25:55, 25:55] = 255 instance = SCImage( pixel_array=frame, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, patient_orientation=self._patient_orientation, transfer_syntax_uid=JPEGBaseline8Bit ) assert instance.file_meta.TransferSyntaxUID == JPEGBaseline8Bit assert np.allclose( self.get_array_after_writing(instance), frame, atol=5 # tolerance for lossy compression ) def test_rgb_jpeg_baseline(self): bits_allocated = 8 photometric_interpretation = 'YBR_FULL_422' coordinate_system = 'PATIENT' frame = np.zeros((256, 256, 3), dtype=np.uint8) frame[25:55, 25:55, 0] = 255 frame[35:65, 35:55, 1] = 255 instance = SCImage( pixel_array=frame, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, patient_orientation=self._patient_orientation, transfer_syntax_uid=JPEGBaseline8Bit ) assert instance.file_meta.TransferSyntaxUID == JPEGBaseline8Bit reread_frame = self.get_array_after_writing(instance) np.testing.assert_allclose(frame, reread_frame, rtol=1.2) def test_monochrome_jpeg2000(self): bits_allocated = 8 photometric_interpretation = 'MONOCHROME2' coordinate_system = 'PATIENT' frame = np.random.randint(0, 256, size=(256, 256), dtype=np.uint8) instance = SCImage( pixel_array=frame, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, patient_orientation=self._patient_orientation, transfer_syntax_uid=JPEG2000Lossless ) assert instance.file_meta.TransferSyntaxUID == JPEG2000Lossless assert np.array_equal( self.get_array_after_writing(instance), frame ) def test_rgb_jpeg2000(self): bits_allocated = 8 photometric_interpretation = 'YBR_FULL' coordinate_system = 'PATIENT' frame = np.random.randint(0, 256, size=(256, 256, 3), dtype=np.uint8) instance = SCImage( pixel_array=frame, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, patient_orientation=self._patient_orientation, transfer_syntax_uid=JPEG2000Lossless ) assert instance.file_meta.TransferSyntaxUID == JPEG2000Lossless assert np.array_equal( self.get_array_after_writing(instance), frame ) def test_monochrome_jpegls(self): bits_allocated = 16 photometric_interpretation = 'MONOCHROME2' coordinate_system = 'PATIENT' frame = np.random.randint(0, 2**16, size=(256, 256), dtype=np.uint16) instance = SCImage( pixel_array=frame, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, patient_orientation=self._patient_orientation, transfer_syntax_uid=JPEGLSLossless ) assert instance.file_meta.TransferSyntaxUID == JPEGLSLossless assert np.array_equal( self.get_array_after_writing(instance), frame ) def test_rgb_jpegls(self): bits_allocated = 8 photometric_interpretation = 'YBR_FULL' coordinate_system = 'PATIENT' frame = np.random.randint(0, 256, size=(256, 256, 3), dtype=np.uint8) instance = SCImage( pixel_array=frame, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, study_instance_uid=self._study_instance_uid, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, patient_orientation=self._patient_orientation, transfer_syntax_uid=JPEGLSLossless ) assert instance.file_meta.TransferSyntaxUID == JPEGLSLossless assert np.array_equal( self.get_array_after_writing(instance), frame ) def test_construct_rgb_from_ref_dataset(self): bits_allocated = 8 photometric_interpretation = 'RGB' coordinate_system = 'PATIENT' instance = SCImage.from_ref_dataset( ref_dataset=self._ref_dataset, pixel_array=self._rgb_pixel_array, photometric_interpretation=photometric_interpretation, bits_allocated=bits_allocated, coordinate_system=coordinate_system, series_instance_uid=self._series_instance_uid, sop_instance_uid=self._sop_instance_uid, series_number=self._series_number, instance_number=self._instance_number, manufacturer=self._manufacturer, patient_orientation=self._patient_orientation, laterality=self._laterality ) assert instance.BitsAllocated == bits_allocated assert instance.SamplesPerPixel == 3 assert instance.PlanarConfiguration == 0 assert instance.PhotometricInterpretation == photometric_interpretation assert instance.StudyInstanceUID == self._ref_dataset.StudyInstanceUID assert instance.SeriesInstanceUID == self._series_instance_uid assert instance.SOPInstanceUID == self._sop_instance_uid assert instance.SeriesNumber == self._series_number assert instance.InstanceNumber == self._instance_number assert instance.Manufacturer == self._manufacturer assert instance.Laterality == self._laterality assert instance.PatientOrientation == self._patient_orientation assert instance.AccessionNumber == self._ref_dataset.AccessionNumber assert instance.PatientName == self._ref_dataset.PatientName assert instance.PatientSex == self._ref_dataset.PatientSex assert instance.StudyTime == TM(self._ref_dataset.StudyTime) assert instance.StudyDate == DA(self._ref_dataset.StudyDate) assert instance.StudyID == self._ref_dataset.StudyID assert instance.PixelData == self._rgb_pixel_array.tobytes()
43.401152
79
0.677782
2,222
22,612
6.512601
0.093609
0.077534
0.045608
0.029024
0.829245
0.818257
0.808099
0.801811
0.76795
0.755995
0
0.013852
0.259331
22,612
520
80
43.484615
0.850191
0.007253
0
0.700624
1
0
0.011318
0
0
0
0
0
0.191268
1
0.035343
false
0
0.027027
0
0.068607
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
db779ba72b47ace7a4aba561f4b5f489995d388a
300
py
Python
cloudperf/__init__.py
bra-fsn/ec2bench
2c9b22b89198aa52c85b42f268468bab3f293e49
[ "MIT" ]
6
2019-01-18T18:42:18.000Z
2022-02-24T21:24:21.000Z
cloudperf/__init__.py
bra-fsn/ec2bench
2c9b22b89198aa52c85b42f268468bab3f293e49
[ "MIT" ]
4
2019-10-05T01:11:40.000Z
2021-10-06T13:12:57.000Z
cloudperf/__init__.py
bra-fsn/ec2bench
2c9b22b89198aa52c85b42f268468bab3f293e49
[ "MIT" ]
3
2019-03-01T22:25:40.000Z
2020-06-12T23:51:29.000Z
from __future__ import absolute_import from .core import get_prices, get_performance, get_combined, prices_url, performance_url, terminate_instances __all__ = ['get_prices', 'get_performance', 'get_combined', 'prices_url', 'performance_url', 'terminate_instances'] __version__ = '0.0.42'
42.857143
109
0.776667
37
300
5.621622
0.432432
0.086538
0.115385
0.221154
0.721154
0.721154
0.721154
0.721154
0.721154
0.721154
0
0.015152
0.12
300
6
110
50
0.772727
0
0
0
0
0
0.29
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
0
0
0
null
0
0
1
0
1
1
1
1
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
8
db82f758d7e5f505141facfe5d220b8a9b3cfa68
6,553
py
Python
xlsxwriter/test/drawing/test_drawing_image01.py
Rippling/XlsxWriter-1
be8d1cb8f8b156cf87bbe5d591f1f5475804be44
[ "BSD-2-Clause" ]
null
null
null
xlsxwriter/test/drawing/test_drawing_image01.py
Rippling/XlsxWriter-1
be8d1cb8f8b156cf87bbe5d591f1f5475804be44
[ "BSD-2-Clause" ]
null
null
null
xlsxwriter/test/drawing/test_drawing_image01.py
Rippling/XlsxWriter-1
be8d1cb8f8b156cf87bbe5d591f1f5475804be44
[ "BSD-2-Clause" ]
null
null
null
############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org # import unittest from io import StringIO from ..helperfunctions import _xml_to_list from ...drawing import Drawing class TestAssembleDrawing(unittest.TestCase): """ Test assembling a complete Drawing file. """ def test_assemble_xml_file(self): """Test writing a drawing with no cell data.""" self.maxDiff = None fh = StringIO() drawing = Drawing() drawing._set_filehandle(fh) dimensions = [2, 1, 0, 0, 3, 6, 533257, 190357, 1219200, 190500, 0, 0] drawing_object = drawing._add_drawing_object() drawing_object['type'] = 2 drawing_object['dimensions'] = dimensions drawing_object['width'] = 1142857 drawing_object['height'] = 1142857 drawing_object['description'] = 'republic.png' drawing_object['shape'] = None drawing_object['anchor'] = 2 drawing_object['rel_index'] = 1 drawing_object['url_rel_index'] = 0 drawing_object['tip'] = None drawing.embedded = 1 drawing._assemble_xml_file() exp = _xml_to_list(""" <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <xdr:wsDr xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"> <xdr:twoCellAnchor editAs="oneCell"> <xdr:from> <xdr:col>2</xdr:col> <xdr:colOff>0</xdr:colOff> <xdr:row>1</xdr:row> <xdr:rowOff>0</xdr:rowOff> </xdr:from> <xdr:to> <xdr:col>3</xdr:col> <xdr:colOff>533257</xdr:colOff> <xdr:row>6</xdr:row> <xdr:rowOff>190357</xdr:rowOff> </xdr:to> <xdr:pic> <xdr:nvPicPr> <xdr:cNvPr id="2" name="Picture 1" descr="republic.png"/> <xdr:cNvPicPr> <a:picLocks noChangeAspect="1"/> </xdr:cNvPicPr> </xdr:nvPicPr> <xdr:blipFill> <a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId1"/> <a:stretch> <a:fillRect/> </a:stretch> </xdr:blipFill> <xdr:spPr> <a:xfrm> <a:off x="1219200" y="190500"/> <a:ext cx="1142857" cy="1142857"/> </a:xfrm> <a:prstGeom prst="rect"> <a:avLst/> </a:prstGeom> </xdr:spPr> </xdr:pic> <xdr:clientData/> </xdr:twoCellAnchor> </xdr:wsDr> """) got = _xml_to_list(fh.getvalue()) self.assertEqual(got, exp) def test_assemble_xml_file_with_url(self): """Test writing a drawing with no cell data.""" self.maxDiff = None fh = StringIO() drawing = Drawing() drawing._set_filehandle(fh) drawing = Drawing() drawing._set_filehandle(fh) dimensions = [2, 1, 0, 0, 3, 6, 533257, 190357, 1219200, 190500, 0, 0] drawing_object = drawing._add_drawing_object() drawing_object['type'] = 2 drawing_object['dimensions'] = dimensions drawing_object['width'] = 1142857 drawing_object['height'] = 1142857 drawing_object['description'] = 'republic.png' drawing_object['shape'] = None drawing_object['anchor'] = 2 drawing_object['rel_index'] = 2 drawing_object['url_rel_index'] = 1 drawing_object['tip'] = 'this is a tooltip' drawing.embedded = 1 drawing._assemble_xml_file() exp = _xml_to_list(""" <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <xdr:wsDr xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"> <xdr:twoCellAnchor editAs="oneCell"> <xdr:from> <xdr:col>2</xdr:col> <xdr:colOff>0</xdr:colOff> <xdr:row>1</xdr:row> <xdr:rowOff>0</xdr:rowOff> </xdr:from> <xdr:to> <xdr:col>3</xdr:col> <xdr:colOff>533257</xdr:colOff> <xdr:row>6</xdr:row> <xdr:rowOff>190357</xdr:rowOff> </xdr:to> <xdr:pic> <xdr:nvPicPr> <xdr:cNvPr id="2" name="Picture 1" descr="republic.png"> <a:hlinkClick xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:id="rId1" tooltip="this is a tooltip"/> </xdr:cNvPr> <xdr:cNvPicPr> <a:picLocks noChangeAspect="1"/> </xdr:cNvPicPr> </xdr:nvPicPr> <xdr:blipFill> <a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId2"/> <a:stretch> <a:fillRect/> </a:stretch> </xdr:blipFill> <xdr:spPr> <a:xfrm> <a:off x="1219200" y="190500"/> <a:ext cx="1142857" cy="1142857"/> </a:xfrm> <a:prstGeom prst="rect"> <a:avLst/> </a:prstGeom> </xdr:spPr> </xdr:pic> <xdr:clientData/> </xdr:twoCellAnchor> </xdr:wsDr> """) got = _xml_to_list(fh.getvalue()) self.assertEqual(got, exp)
38.547059
170
0.462536
624
6,553
4.746795
0.221154
0.105334
0.059082
0.066172
0.878123
0.841999
0.841999
0.841999
0.841999
0.841999
0
0.062627
0.40058
6,553
169
171
38.775148
0.691446
0.037387
0
0.861314
0
0.036496
0.695336
0.043731
0
0
0
0
0.014599
1
0.014599
false
0
0.029197
0
0.051095
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
db8be45a37e081a649d39f13fec40d44b9b4988e
2,203
py
Python
tests/integration/cli/test_test.py
gamechanger/dusty
dd9778e3a4f0c623209e53e98aa9dc1fe76fc309
[ "MIT" ]
421
2015-06-02T16:29:59.000Z
2021-06-03T18:44:42.000Z
tests/integration/cli/test_test.py
gamechanger/dusty
dd9778e3a4f0c623209e53e98aa9dc1fe76fc309
[ "MIT" ]
404
2015-06-02T20:23:42.000Z
2019-08-21T16:59:41.000Z
tests/integration/cli/test_test.py
gamechanger/dusty
dd9778e3a4f0c623209e53e98aa9dc1fe76fc309
[ "MIT" ]
16
2015-06-16T17:21:02.000Z
2020-03-27T02:27:09.000Z
import subprocess import sys from ...testcases import DustyIntegrationTestCase from ...fixtures import busybox_single_app_bundle_fixture class TestTestCLI(DustyIntegrationTestCase): def setUp(self): super(TestTestCLI, self).setUp() busybox_single_app_bundle_fixture(num_bundles=1) def test_basic_test_run(self): result = self.run_command('test --recreate busyboxa test1') self.assertEqual(self.handler.log_to_client_output.count('TESTS test1 PASSED'), 1) self.assertEqual(self.handler.log_to_client_output.count('OK'), 1) self.assertTrue('Running commands to create new image:' in result) def test_basic_test_args(self): result = self.run_command('test --recreate busyboxa test3') self.assertEqual(self.handler.log_to_client_output.count('var\n'), 0) self.assertEqual(self.handler.log_to_client_output.count('etc\n'), 0) self.assertEqual(self.handler.log_to_client_output.count('sbin\n'), 0) self.handler.log_to_client_output = '' self.run_command('test --recreate busyboxa test3 /') self.assertEqual(self.handler.log_to_client_output.count('var\n'), 1) self.assertEqual(self.handler.log_to_client_output.count('etc\n'), 1) self.assertEqual(self.handler.log_to_client_output.count('sbin\n'), 1) def test_basic_test_all(self): result = self.run_command('test --recreate busyboxa all') self.assertEqual(self.handler.log_to_client_output.count('TESTS PASSED'), 1) self.assertEqual(self.handler.log_to_client_output.count('OK'), 2) self.assertTrue('Running commands to create new image:' in result) def test_basic_test_no_recreate(self): result = self.run_command('test --recreate busyboxa test1') self.assertTrue('Running commands to create new image:' in result) self.handler.log_to_client_output = '' result = self.run_command('test busyboxa test1') self.assertFalse('Running commands to create new image:' in result) self.assertEqual(self.handler.log_to_client_output.count('TESTS test1 PASSED'), 1) self.assertEqual(self.handler.log_to_client_output.count('OK'), 1)
48.955556
90
0.720835
300
2,203
5.06
0.19
0.101449
0.129117
0.147563
0.85112
0.774704
0.740448
0.740448
0.704875
0.676548
0
0.010875
0.165229
2,203
44
91
50.068182
0.814573
0
0
0.305556
0
0
0.182932
0
0
0
0
0
0.444444
1
0.138889
false
0.083333
0.111111
0
0.277778
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
1
0
0
0
1
0
0
0
0
0
8
dbb9980addda011561e2ee72dd709d8b8262fd2a
260,009
py
Python
leetcode/hard/smallest_range/srcs/a_with_q.py
BillionsRichard/pycharmWorkspace
709e2681fc6d85ff52fb25717215a365f51073aa
[ "Apache-2.0" ]
null
null
null
leetcode/hard/smallest_range/srcs/a_with_q.py
BillionsRichard/pycharmWorkspace
709e2681fc6d85ff52fb25717215a365f51073aa
[ "Apache-2.0" ]
null
null
null
leetcode/hard/smallest_range/srcs/a_with_q.py
BillionsRichard/pycharmWorkspace
709e2681fc6d85ff52fb25717215a365f51073aa
[ "Apache-2.0" ]
null
null
null
# encoding: utf-8 """ @version: v1.0 @author: Richard @license: Apache Licence @contact: billions.richard@qq.com @site: @software: PyCharm @time: 2019/9/12 20:37 """ from pprint import pprint as pp from operator import itemgetter from collections import deque import time class Solution: """ 输入:[[4,10,15,24,26], [0,9,12,20], [5,18,22,30]] 输出: [20,24] """ def smallestRange(self, nums): start_time = time.time() k = len(nums) print('k-->', k) k_tagged_merged_list = [] for i in range(k): row = nums[i] k_tagged_merged_list.extend([(e, i) for e in row]) k_tagged_merged_list.sort(key=itemgetter(0)) # print(k_tagged_merged_list) k_dque = deque(maxlen=k) min_range = None min_range_len = None # print('min_range_len', min_range_len) tot_len = len(k_tagged_merged_list) # print('tot_len', tot_len) i = 0 while i < tot_len: this_tag = k_tagged_merged_list[i][1] cur_tag_set = {t[1] for t in k_dque} if not cur_tag_set or this_tag not in cur_tag_set: k_dque.append(k_tagged_merged_list[i]) else: k_dque_head_tag = k_dque[0][1] if k_dque_head_tag == this_tag: k_dque.popleft() k_dque.append(k_tagged_merged_list[i]) else: existing_t = list(filter(lambda t: t[1] == this_tag, k_dque))[0] k_dque.remove(existing_t) k_dque.append(k_tagged_merged_list[i]) k_dque_tags = {e[1] for e in k_dque} # print('len_k_dque-->', len(k_dque)) # print('len_k_dque_tags-->', len(k_dque_tags)) if len(k_dque_tags) == k: # print('found') k_range_len = k_dque[-1][0] - k_dque[0][0] if min_range_len is None or k_range_len < min_range_len: min_range_len = k_range_len min_range = k_dque[0][0], k_dque[-1][0] i += 1 print('Elapsed seconds:', time.time()-start_time) return min_range if __name__ == '__main__': s = Solution() nums = [[4, 10, 15, 24, 26], [0, 9, 12, 20], [5, 18, 22, 30]] # nums = [[10], [11]] # nums = [[11,38,83, # 84,84,85,88,89,89,92],[28,61,89],[52,77,79,80,81],[21,25,26,26,26,27],[9,83,85,90],[84,85,87],[26,68,70,71],[36,40,41,42,45],[-34,21],[-28,-28,-23,1,13,21,28,37,37,38],[-74,1,2,22,33,35,43,45],[54,96,98,98,99],[43,54,60,65,71,75],[43,46],[50,50,58,67,69],[7,14,15],[78,80,89,89,90],[35,47,63,69,77,92,94]] # [-74, 1, 2, 22, 33, 35, 43, 45], [54, 96, 98, 98, 99], [43, 54, 60, 65, 71, 75], [43, 46], # [50, 50, 58, 67, 69], [7, 14, 15], [78, 80, 89, 89, 90], [35, 47, 63, 69, 77, 92, 94]] nums = [[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000],[95387,95790,97307,98168,99868,99995,99995,100000],[-69454,-17042,8172,50983,63432,72854,73012,80848,83723,85916,91759,99779,99913,99944,99994,99999,99999],[65641,95910,97995,98196,98969,99008,99591,99732,99735,99896,99952,99989,99999,100000],[57459,95855,97360,98320,99147,99865,99955,99989,99997,99998,100000],[-81589,-3474,84141,92981,95255,99192,99962,99970,99994,99998,99999,100000],[-23262,92924,95548,96462,99338,99553,99555,99569,99644,99903,99909,99999,99999,100000],[-58466,24432,87898,92795,95701,98143,98163,99182,99351,99746,99811,99943,99955,99978,99997,100000],[-97588,7867,10356,20288,67836,69868,73038,77753,81937,88474,89979,92182,98091,99635,99902,99941,99975,99987,99991,99998,99998,99998,99998,99998,99999,99999,99999,100000],[-96955,41521,84537,89794,96226,97103,97490,99347,99957,99997,100000],[-49247,93963,99006,99428,99964,99992,100000],[46062,48599,95745,98620,98677,99516,99802,99973,99993,100000],[-3786,59724,62870,80033,90471,98836,99395,99574,99682,99724,99909,99963,99979,99999,100000],[-62512,-19463,84187,89388,91368,95524,98987,99085,99230,99809,99978,100000],[18183,83019,98718,99570,99777,99980,100000],[19925,20448,81509,93698,98451,98776,98915,99007,99925,99994,99996,99999,100000],[-96129,93245,95417,98492,99013,99921,99934,99989,99995,100000],[-25468,61948,68372,85478,91239,98906,98988,99653,99915,99957,99998,99999,99999,100000],[36648,65266,95679,98905,99868,99977,99983,99983,99995,99995,99996,99997,100000],[56006,78969,86785,89834,92494,93887,98268,99771,99982,99998,99999,100000]] min_range = s.smallestRange(nums) print(min_range)
3,058.929412
257,052
0.803391
41,484
260,009
5.032808
0.008196
0.070811
0.038624
0.032187
0.99498
0.99477
0.994386
0.994386
0.994248
0.993931
0
0.801386
0.003415
260,009
84
257,053
3,095.345238
0.004342
0.003669
0
0.104167
0
0
0.000108
0
0
0
0
0
0
1
0.020833
false
0
0.083333
0
0.145833
0.083333
0
0
0
null
0
0
0
1
1
1
1
1
1
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
918d821519c1f1373bfc3701b7eba09c2add0e9c
11,971
py
Python
tests/test_engine.py
benthomasson/ansible-events
bd90edb68778f9f5ad82591f46993335fada8ed4
[ "Apache-2.0" ]
null
null
null
tests/test_engine.py
benthomasson/ansible-events
bd90edb68778f9f5ad82591f46993335fada8ed4
[ "Apache-2.0" ]
17
2022-03-07T17:57:07.000Z
2022-03-23T18:58:48.000Z
tests/test_engine.py
benthomasson/ansible-events
bd90edb68778f9f5ad82591f46993335fada8ed4
[ "Apache-2.0" ]
null
null
null
from durable.lang import * import durable.lang import yaml import os import asyncio import janus import pytest from queue import Queue from pprint import pprint from ansible_events.rules_parser import parse_rule_sets from ansible_events.engine import run_rulesets, start_source from ansible_events.messages import Shutdown from ansible_events.rule_types import EventSource, EventSourceFilter from ansible_events.util import load_inventory HERE = os.path.dirname(os.path.abspath(__file__)) def test_start_source(): os.chdir(HERE) queue = Queue() start_source( EventSource("range", "range", dict(limit=1), [EventSourceFilter('noop', {})]), ["sources"], dict(limit=1), queue, ) assert queue.get() == dict(i=0) @pytest.fixture def new_event_loop(): loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) return loop def load_rules(rules_file): os.chdir(HERE) with open(rules_file) as f: data = yaml.safe_load(f.read()) rulesets = parse_rule_sets(data) pprint(rulesets) queue = janus.Queue() ruleset_queues = [(ruleset, queue.async_q) for ruleset in rulesets] event_log = asyncio.Queue() return ruleset_queues, queue.sync_q, queue.async_q, event_log @pytest.mark.asyncio async def test_run_rulesets(new_event_loop): ruleset_queues, queue, aqueue, event_log = load_rules("test_rules.yml") queue.put(dict()) queue.put(dict(i=1)) queue.put(dict(i=2)) queue.put(dict(i=3)) queue.put(dict(i=4)) queue.put(dict(i=5)) queue.put(Shutdown()) await run_rulesets( event_log, ruleset_queues, dict(), dict(), ) assert event_log.get_nowait()['type'] == 'EmptyEvent', '0' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '1' assert event_log.get_nowait()['type'] == 'Job', '1.0' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.2' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.3' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.4' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '2' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '3' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '4' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '5' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '6' assert event_log.get_nowait()['type'] == 'Shutdown', '7' assert event_log.empty() @pytest.mark.asyncio async def test_run_rules_with_assignment(new_event_loop): ruleset_queues, queue, aqueue, event_log = load_rules("rules_with_assignment.yml") queue.put(dict(i=0)) queue.put(dict(i=1)) queue.put(Shutdown()) await run_rulesets( event_log, ruleset_queues, dict(), dict(), ) assert event_log.get_nowait()['type'] == 'ProcessedEvent', '0' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '1' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '2' assert event_log.get_nowait()['type'] == 'Shutdown', '3' assert event_log.empty() @pytest.mark.asyncio async def test_run_rules_with_assignment2(new_event_loop): ruleset_queues, queue, aqueue, event_log = load_rules("rules_with_assignment2.yml") queue.put(dict(i=0)) queue.put(dict(i=1)) queue.put(Shutdown()) await run_rulesets( event_log, ruleset_queues, dict(), dict(), ) assert event_log.get_nowait()['type'] == 'ProcessedEvent', '0' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '1' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '2' assert event_log.get_nowait()['type'] == 'Shutdown', '3' assert event_log.empty() @pytest.mark.asyncio async def test_run_rules_simple(new_event_loop): ruleset_queues, queue, aqueue, event_log = load_rules("test_simple.yml") queue.put(dict(i=0)) queue.put(dict(i=1)) queue.put(dict(i=2)) queue.put(Shutdown()) await run_rulesets( event_log, ruleset_queues, dict(), dict(), ) assert event_log.get_nowait()['type'] == 'ProcessedEvent', '0' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '1' assert event_log.get_nowait()['type'] == 'Job', '1.0' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.2' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.3' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.4' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '2' assert event_log.get_nowait()['type'] == 'Shutdown', '3' assert event_log.empty() @pytest.mark.asyncio async def test_run_multiple_hosts(new_event_loop): ruleset_queues, queue, aqueue, event_log = load_rules("test_rules_multiple_hosts.yml") queue.put(dict(i=0)) queue.put(dict(i=1)) queue.put(dict(i=2)) queue.put(dict(i=3)) queue.put(dict(i=4)) queue.put(dict(i=5)) queue.put(Shutdown()) await run_rulesets( event_log, ruleset_queues, dict(), load_inventory('inventory1.yml'), ) #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '0' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '1' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '1.1' assert event_log.get_nowait()['type'] == 'Job', '1.1.0' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.1' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.2' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.3' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.4' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.5' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.6' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.7' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.8' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.9' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.10' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.11' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.12' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1.13' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '1.2' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '1.3' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '1.4' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '2' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '3' assert event_log.get_nowait()['type'] == 'Shutdown', '4' assert event_log.empty() @pytest.mark.asyncio async def test_run_multiple_hosts2(new_event_loop): ruleset_queues, queue, aqueue, event_log = load_rules("test_rules_multiple_hosts2.yml") queue.put(dict(i=0)) queue.put(dict(i=1)) queue.put(dict(i=2)) queue.put(dict(i=3)) queue.put(dict(i=4)) queue.put(dict(i=5)) queue.put(Shutdown()) await run_rulesets( event_log, ruleset_queues, dict(), load_inventory('inventory1.yml'), ) #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '0' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '1' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '2' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '2.5' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '3' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '4' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '5' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '6' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '7' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '8' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '9' assert event_log.get_nowait()['type'] == 'Shutdown', '10' assert event_log.empty() @pytest.mark.asyncio async def test_run_multiple_hosts3(new_event_loop): ruleset_queues, queue, aqueue, event_log = load_rules("test_rules_multiple_hosts3.yml") queue.put(dict(i=0)) queue.put(dict(i=1)) queue.put(dict(i=2)) queue.put(dict(i=3)) queue.put(dict(i=4)) queue.put(dict(i=5)) queue.put(Shutdown()) await run_rulesets( event_log, ruleset_queues, dict(), load_inventory('inventory.yml'), ) #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '0' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '1' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '2' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '3' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '4' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '5' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '6' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '7' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '8' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '9' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '10' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '11' assert event_log.get_nowait()['type'] == 'Shutdown', '12' assert event_log.empty() @pytest.mark.asyncio async def test_filters(new_event_loop): ruleset_queues, queue, aqueue, event_log = load_rules("test_filters.yml") queue.put(dict(i=0)) queue.put(dict(i=1)) queue.put(dict(i=2)) queue.put(Shutdown()) await run_rulesets( event_log, ruleset_queues, dict(), dict(), ) assert event_log.get_nowait()['type'] == 'ProcessedEvent', '0' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '1' assert event_log.get_nowait()['type'] == 'Job', '1.0' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.2' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.3' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.4' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '2' assert event_log.get_nowait()['type'] == 'Shutdown', '3' assert event_log.empty() @pytest.mark.asyncio async def test_run_rulesets_on_hosts(new_event_loop): ruleset_queues, queue, aqueue, event_log = load_rules("test_host_rules.yml") queue.put(dict()) queue.put(dict(i=1, meta=dict(hosts='localhost0'))) queue.put(dict(i=2, meta=dict(hosts='localhost0'))) queue.put(dict(i=3, meta=dict(hosts='localhost0'))) queue.put(dict(i=4, meta=dict(hosts='localhost0'))) queue.put(dict(i=5, meta=dict(hosts='localhost0'))) queue.put(Shutdown()) await run_rulesets( event_log, ruleset_queues, dict(), dict(), ) assert event_log.get_nowait()['type'] == 'EmptyEvent', '0' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '1' assert event_log.get_nowait()['type'] == 'Job', '1.0' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.1' assert event_log.get_nowait()['type'] == 'AnsibleEvent', '1.2' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '2' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '3' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '4' #assert event_log.get_nowait()['type'] == 'MessageNotHandled', '5' assert event_log.get_nowait()['type'] == 'ProcessedEvent', '6' assert event_log.get_nowait()['type'] == 'Shutdown', '7' assert event_log.empty()
34.799419
91
0.652661
1,595
11,971
4.670846
0.067712
0.136376
0.201074
0.223624
0.865772
0.865235
0.862148
0.845772
0.805638
0.745906
0
0.021195
0.168407
11,971
343
92
34.900875
0.727172
0.092557
0
0.642308
0
0
0.16513
0.012908
0
0
0
0
0.35
1
0.011538
false
0
0.053846
0
0.073077
0.007692
0
0
0
null
0
1
1
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
8
919a07e3008dced4f32ea44c5ca26bfef562a71c
4,256
py
Python
test_tscribe.py
craigmayhew/aws_transcribe_to_docx
1aded9a7c0f14b8242991e564aec3275fc9f83f9
[ "MIT" ]
null
null
null
test_tscribe.py
craigmayhew/aws_transcribe_to_docx
1aded9a7c0f14b8242991e564aec3275fc9f83f9
[ "MIT" ]
null
null
null
test_tscribe.py
craigmayhew/aws_transcribe_to_docx
1aded9a7c0f14b8242991e564aec3275fc9f83f9
[ "MIT" ]
null
null
null
import tscribe import os def test_multiple_speakers(): """ Test output exists with multiple speaker input # GIVEN a sample file containing multiple speakers # WHEN calling tscribe.write(...) # THEN produce the .docx without errors """ # Setup input_file = "sample_multiple.json" output_file = "sample_multiple.docx" assert os.access(input_file, os.F_OK), "Input file not found" # Function tscribe.write(input_file) assert os.access(output_file, os.F_OK), "Output file not found" # Teardown os.remove(output_file) os.remove("chart.png") def test_multiple_speakers_with_save_as(): """ Test output exists with multiple speaker input, and save_as defined # GIVEN a sample file containing multiple speakers, and an output filename # WHEN calling tscribe.write(...) # THEN produce the .docx, named correctly, without errors """ # Setup input_file = "sample_multiple.json" output_file = "test_sample.docx" assert os.access(input_file, os.F_OK), "Input file not found" # Function tscribe.write(input_file, save_as=output_file) assert os.access(output_file, os.F_OK), "Output file not found" # Teardown os.remove(output_file) os.remove("chart.png") def test_multiple_speakers_with_save_as_with_tmp_dir(): """ Test output exists with multiple speaker input, and save_as defined, and tmp_dir defined # GIVEN a sample file containing multiple speakers, and an output filename, and a writable tmp directory # WHEN calling tscribe.write(...) # THEN produce the .docx, with a chart, named correctly, without errors """ # Setup input_file = "sample_multiple.json" output_file = "test_sample.docx" tmp_dir = "/tmp/" assert os.access(input_file, os.F_OK), "Input file not found" # Function tscribe.write(input_file, save_as=output_file, tmp_dir=tmp_dir) assert os.access(tmp_dir+"chart.png", os.F_OK), "Chart file not found" assert os.access(output_file, os.F_OK), "Output file not found" # Teardown os.remove(output_file) os.remove(tmp_dir+"chart.png") def test_single_speaker(): """ Test output exists with single speaker input # GIVEN a sample file containing single speaker # WHEN calling tscribe.write(...) # THEN produce the .docx without errors """ # Setup input_file = "sample_single.json" output_file = "sample_single.docx" assert os.access(input_file, os.F_OK), "Input file not found" # Function tscribe.write(input_file) assert os.access(output_file, os.F_OK), "Output file not found" # Teardown os.remove(output_file) os.remove("chart.png") def test_single_speaker_with_save_as(): """ Test output exists with single speaker input, and save_as defined # GIVEN a sample file containing single speaker, and an output filename # WHEN calling tscribe.write(...) # THEN produce the .docx, named correctly, without errors """ # Setup input_file = "sample_single.json" output_file = "test_sample.docx" assert os.access(input_file, os.F_OK), "Input file not found" # Function tscribe.write(input_file, save_as=output_file) assert os.access(output_file, os.F_OK), "Output file not found" # Teardown os.remove(output_file) os.remove("chart.png") def test_single_speaker_with_save_as_with_tmp_dir(): """ Test output exists with single speaker input, and save_as defined, and tmp_dir defined # GIVEN a sample file containing single speaker, and an output filename, and a writable tmp directory # WHEN calling tscribe.write(...) # THEN produce the .docx, with a chart, named correctly, without errors """ # Setup input_file = "sample_single.json" output_file = "test_sample.docx" tmp_dir = "/tmp/" assert os.access(input_file, os.F_OK), "Input file not found" # Function tscribe.write(input_file, save_as=output_file, tmp_dir=tmp_dir) assert os.access(tmp_dir+"chart.png", os.F_OK), "Chart file not found" assert os.access(output_file, os.F_OK), "Output file not found" # Teardown os.remove(output_file) os.remove(tmp_dir+"chart.png")
28.373333
108
0.694314
610
4,256
4.654098
0.085246
0.098626
0.069038
0.038042
0.975343
0.975343
0.968299
0.912293
0.912293
0.912293
0
0
0.207472
4,256
150
109
28.373333
0.841684
0.363957
0
0.814815
0
0
0.231562
0
0
0
0
0
0.259259
1
0.111111
false
0
0.037037
0
0.148148
0
0
0
0
null
0
0
0
1
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
7
37ce570ea17404c0b92df14d2829ebd67d4d2da6
110
py
Python
controllers/charlas.py
bkahlerventer/web2congress
30463ef05a64b95f9ec8a5575e1f45a99986b607
[ "BSD-3-Clause" ]
3
2016-12-29T23:02:35.000Z
2021-07-01T01:10:12.000Z
controllers/charlas.py
reingart/web2conf
a5e01d9fc2c25b271db7cee528faef58a46e7106
[ "BSD-3-Clause" ]
null
null
null
controllers/charlas.py
reingart/web2conf
a5e01d9fc2c25b271db7cee528faef58a46e7106
[ "BSD-3-Clause" ]
null
null
null
# coding: utf8 # try something like def index(): return plugin_flatpage() def rfp(): return plugin_flatpage()
22
37
0.745455
15
110
5.333333
0.733333
0.3
0.5
0
0
0
0
0
0
0
0
0.010526
0.136364
110
4
38
27.5
0.831579
0.281818
0
0
0
0
0
0
0
0
0
0
0
1
1
true
0
0
1
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
1
1
0
0
1
1
0
0
8
5305c66e383c26c9dc6b388b901f7cff240eb184
178
py
Python
sportsdataverse/nba/__init__.py
saiemgilani/sportsdataverse-py
77ae3accbb071b5308335b931e4e55a65e1500cd
[ "MIT" ]
12
2021-10-15T01:24:18.000Z
2022-03-15T17:00:22.000Z
sportsdataverse/nba/__init__.py
saiemgilani/sportsdataverse-py
77ae3accbb071b5308335b931e4e55a65e1500cd
[ "MIT" ]
19
2021-11-02T05:53:41.000Z
2022-03-16T14:16:51.000Z
sportsdataverse/nba/__init__.py
saiemgilani/sportsdataverse-py
77ae3accbb071b5308335b931e4e55a65e1500cd
[ "MIT" ]
1
2021-12-21T14:49:25.000Z
2021-12-21T14:49:25.000Z
from sportsdataverse.nba.nba_loaders import * from sportsdataverse.nba.nba_pbp import * from sportsdataverse.nba.nba_schedule import * from sportsdataverse.nba.nba_teams import *
44.5
46
0.848315
24
178
6.125
0.333333
0.517007
0.598639
0.680272
0.632653
0
0
0
0
0
0
0
0.08427
178
4
47
44.5
0.90184
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
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
7
5313c5fe044e92ee0cd4a770248cf8afced9e898
34
py
Python
tests/test_import.py
meads2/googlesearch
63e6a5afd7f7956a78de5b1543489acbd5de428a
[ "MIT" ]
null
null
null
tests/test_import.py
meads2/googlesearch
63e6a5afd7f7956a78de5b1543489acbd5de428a
[ "MIT" ]
null
null
null
tests/test_import.py
meads2/googlesearch
63e6a5afd7f7956a78de5b1543489acbd5de428a
[ "MIT" ]
null
null
null
def test_import_class(): pass
11.333333
24
0.705882
5
34
4.4
1
0
0
0
0
0
0
0
0
0
0
0
0.205882
34
2
25
17
0.814815
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0.5
0.5
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
1
1
1
1
0
1
0
0
8
532dc80453825adca54a242b4ab8b4cd9cf2455d
24,731
py
Python
mrpy/spatial_operators/haar/2nd_order_ctr_finite_diff/laplacian.py
marc-nguessan/mrpy
6fb0bce485234a45bb863f71bc2bdf0a22014de3
[ "BSD-3-Clause" ]
2
2020-01-06T10:48:44.000Z
2020-01-09T20:07:08.000Z
mrpy/spatial_operators/haar/2nd_order_ctr_finite_diff/laplacian.py
marc-nguessan/mrpy
6fb0bce485234a45bb863f71bc2bdf0a22014de3
[ "BSD-3-Clause" ]
1
2020-01-09T20:08:50.000Z
2020-01-09T20:11:20.000Z
mrpy/spatial_operators/haar/2nd_order_ctr_finite_diff/laplacian.py
marc-nguessan/mrpy
6fb0bce485234a45bb863f71bc2bdf0a22014de3
[ "BSD-3-Clause" ]
null
null
null
from __future__ import print_function, division """This module is used to compute the laplacian operator in the x-direction. The procedure "create_matrix" returns the matrix representing the linear combination of this operation on a cartesian grid representation of a variable. Since the spatial operator depends on the specific boundary conditions applied to the computed variable, this matrix depends on the boundary conditions. The procedure "create_bc_scalar" returns an array of the values needed to complete the computation of the spatial operation on the meshes located at the boundary of the domain. We assume that the type and the values of the variable at the boundray do not change with time, so that this array is built with the type of boundary condition applied to the varialbe computed, and the values at the north, south, east and west boundaries of the variable. ... ... """ import petsc4py.PETSc as petsc from six.moves import range import config as cfg from mrpy.mr_utils import mesh from mrpy.mr_utils import op import numpy as np import math import importlib from .matrix_aux import matrix_add #!!!!!!! penser a rajouter un mr_bc_scalar !!!!!!!! def create_matrix(tree, axis): matrix = petsc.Mat().create() number_of_rows = tree.number_of_leaves size_row = (number_of_rows, number_of_rows) size_col = (number_of_rows, number_of_rows) matrix.setSizes((size_row, size_col)) matrix.setUp() # matrix = np.zeros(shape=(number_of_rows, number_of_rows), dtype=np.float) if tree.dimension == 2: for row in range(number_of_rows): index = tree.tree_leaves[row] i = tree.nindex_x[index] j = tree.nindex_y[index] k = tree.nindex_z[index] level = tree.nlevel[index] dx = tree.ndx[index] dy = tree.ndy[index] dz = tree.ndz[index] # left flux for axis 0 if mesh.bc_compatible_local_indexes(tree, level, i-1, j, k) is not None: i_left, j_left, k_left = mesh.bc_compatible_local_indexes(tree, level, i-1, j, k) index_left = mesh.z_curve_index(tree.dimension, level, i_left, j_left, k_left) if index_left in tree.tree_nodes and tree.nisleaf[index_left] \ or index_left not in tree.tree_nodes: # the finest level for the left flux is the node's level matrix_add(tree, matrix, row, -(dy)/(dx), level, i, j, k) matrix_add(tree, matrix, row, (dy)/(dx), level, i_left, j_left, k_left) else: for n in range(2): matrix_add(tree, matrix, row, -(dy/2)/((dx/2)), level+1, 2*i, 2*j+n, 2*k) matrix_add(tree, matrix, row, (dy/2)/((dx/2)), level+1, 2*i_left+1, 2*j+n, 2*k) elif tree.bc["west"][0] == "dirichlet": # the finest level for the left flux is the node's level; this node # receives a second contribution because of the boundary condition matrix_add(tree, matrix, row, -2*(dy)/(dx), level, i, j, k) elif tree.bc["west"][0] == "neumann": #the left flux depends only on the boundary condition scalar pass # right flux for axis 0 if mesh.bc_compatible_local_indexes(tree, level, i+1, j, k) is not None: i_right, j_right, k_right = mesh.bc_compatible_local_indexes(tree, level, i+1, j, k) index_right = mesh.z_curve_index(tree.dimension, level, i_right, j_right, k_right) if index_right in tree.tree_nodes and tree.nisleaf[index_right] \ or index_right not in tree.tree_nodes: # the finest level for the right flux is the node's level matrix_add(tree, matrix, row, -dy/(dx), level, i, j, k) matrix_add(tree, matrix, row, dy/(dx), level, i_right, j_right, k_right) else: for n in range(2): matrix_add(tree, matrix, row, -(dy/2)/((dx/2)), level+1, 2*i+1, 2*j+n, 2*k) matrix_add(tree, matrix, row, (dy/2)/((dx/2)), level+1, 2*i_right, 2*j+n, 2*k) elif tree.bc["east"][0] == "dirichlet": # the finest level for the right flux is the node's level; this node # receives a second contribution because of the boundary condition matrix_add(tree, matrix, row, -2*(dy)/(dx), level, i, j, k) elif tree.bc["east"][0] == "neumann": #the left flux depends only on the boundary condition scalar pass # left flux for axis 1 if mesh.bc_compatible_local_indexes(tree, level, i, j-1, k) is not None: i_left, j_left, k_left = mesh.bc_compatible_local_indexes(tree, level, i, j-1, k) index_left = mesh.z_curve_index(tree.dimension, level, i_left, j_left, k_left) if index_left in tree.tree_nodes and tree.nisleaf[index_left] \ or index_left not in tree.tree_nodes: # the finest level for the left flux is the node's level matrix_add(tree, matrix, row, -(dx)/(dy), level, i, j, k) matrix_add(tree, matrix, row, (dx)/(dy), level, i_left, j_left, k_left) else: for m in range(2): matrix_add(tree, matrix, row, -(dx/2)/((dy/2)), level+1, 2*i+m, 2*j, 2*k) matrix_add(tree, matrix, row, (dx/2)/((dy/2)), level+1, 2*i+m, 2*j_left+1, 2*k) elif tree.bc["south"][0] == "dirichlet": # the finest level for the left flux is the node's level; this node # receives a second contribution because of the boundary condition matrix_add(tree, matrix, row, -2*(dx)/(dy), level, i, j, k) elif tree.bc["south"][0] == "neumann": #the left flux depends only on the boundary condition scalar pass # right flux for axis 1 if mesh.bc_compatible_local_indexes(tree, level, i, j+1, k) is not None: i_right, j_right, k_right = mesh.bc_compatible_local_indexes(tree, level, i, j+1, k) index_right = mesh.z_curve_index(tree.dimension, level, i_right, j_right, k_right) if index_right in tree.tree_nodes and tree.nisleaf[index_right] \ or index_right not in tree.tree_nodes: # the finest level for the right flux is the node's level matrix_add(tree, matrix, row, -dx/(dy), level, i, j, k) matrix_add(tree, matrix, row, dx/(dy), level, i_right, j_right, k_right) else: for m in range(2): matrix_add(tree, matrix, row, -(dx/2)/((dy/2)), level+1, 2*i+m, 2*j+1, 2*k) matrix_add(tree, matrix, row, (dx/2)/((dy/2)), level+1, 2*i+m, 2*j_right, 2*k) elif tree.bc["north"][0] == "dirichlet": # the finest level for the right flux is the node's level; this node # receives a second contribution because of the boundary condition matrix_add(tree, matrix, row, -2*(dx)/(dy), level, i, j, k) elif tree.bc["north"][0] == "neumann": #the left flux depends only on the boundary condition scalar pass matrix.assemble() return matrix if tree.dimension == 3: for row in range(number_of_rows): index = tree.tree_leaves[row] i = tree.nindex_x[index] j = tree.nindex_y[index] k = tree.nindex_z[index] level = tree.nlevel[index] dx = tree.ndx[index] dy = tree.ndy[index] dz = tree.ndz[index] node = tree.tree_leaves[row] i = node.index_x j = node.index_y k = node.index_z # left flux for axis 0 if mesh.bc_compatible_local_indexes(tree, level, i-1, j, k) is not None: i_left, j_left, k_left = mesh.bc_compatible_local_indexes(tree, level, i-1, j, k) index_left = mesh.z_curve_index(tree.dimension, level, i_left, j_left, k_left) if index_left in tree.tree_nodes and tree.nisleaf[index_left] \ or index_left not in tree.tree_nodes: # the finest level for the left flux is the node's level matrix_add(tree, matrix, row, -(dy*dz)/(dx), level, i, j, k) matrix_add(tree, matrix, row, (dy*dz)/(dx), level, i_left, j_left, k_left) else: for o in range(2): for n in range(2): matrix_add(tree, matrix, row, -((dy/2)*(dz/2))/((dx/2)), level+1, 2*i, 2*j+n, 2*k+o) matrix_add(tree, matrix, row, ((dy/2)*(dz/2))/((dx/2)), level+1, 2*i_left+1, 2*j+n, 2*k+o) elif tree.bc["west"][0] == "dirichlet": # the finest level for the left flux is the node's level; this node # receives a second contribution because of the boundary condition matrix_add(tree, matrix, row, -2*(dy*dz)/(dx), level, i, j, k) elif tree.bc["west"][0] == "neumann": #the left flux depends only on the boundary condition scalar pass # right flux for axis 0 if mesh.bc_compatible_local_indexes(tree, level, i+1, j, k) is not None: i_right, j_right, k_right = mesh.bc_compatible_local_indexes(tree, level, i+1, j, k) index_right = mesh.z_curve_index(tree.dimension, level, i_right, j_right, k_right) if index_right in tree.tree_nodes and tree.nisleaf[index_right] \ or index_right not in tree.tree_nodes: # the finest level for the right flux is the node's level matrix_add(tree, matrix, row, -dy*dz/(dx), level, i, j, k) matrix_add(tree, matrix, row, dy*dz/(dx), level, i_right, j_right, k_right) else: for o in range(2): for n in range(2): matrix_add(tree, matrix, row, -(dy/2)*(dz/2)/((dx/2)), level+1, 2*i+1, 2*j+n, 2*k+o) matrix_add(tree, matrix, row, (dy/2)*(dz/2)/((dx/2)), level+1, 2*i_right, 2*j+n, 2*k+o) elif tree.bc["east"][0] == "dirichlet": # the finest level for the right flux is the node's level; this node # receives a second contribution because of the boundary condition matrix_add(tree, matrix, row, -2*(dy*dz)/(dx), level, i, j, k) elif tree.bc["east"][0] == "neumann": #the left flux depends only on the boundary condition scalar pass # left flux for axis 1 if mesh.bc_compatible_local_indexes(tree, level, i, j-1, k) is not None: i_left, j_left, k_left = mesh.bc_compatible_local_indexes(tree, level, i, j-1, k) index_left = mesh.z_curve_index(tree.dimension, level, i_left, j_left, k_left) if index_left in tree.tree_nodes and tree.nisleaf[index_left] \ or index_left not in tree.tree_nodes: # the finest level for the left flux is the node's level matrix_add(tree, matrix, row, -(dx*dz)/(dy), level, i, j, k) matrix_add(tree, matrix, row, (dx*dz)/(dy), level, i_left, j_left, k_left) else: for o in range(2): for m in range(2): matrix_add(tree, matrix, row, -(dx/2)*(dz/2)/((dy/2)), level+1, 2*i+m, 2*j, 2*k+o) matrix_add(tree, matrix, row, (dx/2)*(dz/2)/((dy/2)), level+1, 2*i+m, 2*j_left+1, 2*k+o) elif tree.bc["south"][0] == "dirichlet": # the finest level for the left flux is the node's level; this node # receives a second contribution because of the boundary condition matrix_add(tree, matrix, row, -2*(dx*dz)/(dy), level, i, j, k) elif tree.bc["south"][0] == "neumann": #the left flux depends only on the boundary condition scalar pass # right flux for axis 1 if mesh.bc_compatible_local_indexes(tree, level, i, j+1, k) is not None: i_right, j_right, k_right = mesh.bc_compatible_local_indexes(tree, level, i, j+1, k) index_right = mesh.z_curve_index(tree.dimension, level, i_right, j_right, k_right) if index_right in tree.tree_nodes and tree.nisleaf[index_right] \ or index_right not in tree.tree_nodes: # the finest level for the right flux is the node's level matrix_add(tree, matrix, row, -dx*dz/(dy), level, i, j, k) matrix_add(tree, matrix, row, dx*dz/(dy), level, i_right, j_right, k_right) else: for o in range(2): for m in range(2): matrix_add(tree, matrix, row, -(dx/2)*(dz/2)/((dy/2)), level+1, 2*i+m, 2*j, 2*k+o) matrix_add(tree, matrix, row, (dx/2)*(dz/2)/((dy/2)), level+1, 2*i+m, 2*j_right, 2*k+o) elif tree.bc["north"][0] == "dirichlet": # the finest level for the right flux is the node's level; this node # receives a second contribution because of the boundary condition matrix_add(tree, matrix, row, -2*(dx*dz)/(dy), level, i, j, k) elif tree.bc["north"][0] == "neumann": #the left flux depends only on the boundary condition scalar pass # left flux for axis 2 if mesh.bc_compatible_local_indexes(tree, level, i, j, k-1) is not None: i_left, j_left, k_left = mesh.bc_compatible_local_indexes(tree, level, i, j, k-1) index_left = mesh.z_curve_index(tree.dimension, level, i_left, j_left, k_left) if index_left in tree.tree_nodes and tree.nisleaf[index_left] \ or index_left not in tree.tree_nodes: # the finest level for the left flux is the node's level matrix_add(tree, matrix, row, -(dx*dy)/(dz), level, i, j, k) matrix_add(tree, matrix, row, (dx*dy)/(dz), level, i_left, j_left, k_left) else: for n in range(2): for m in range(2): matrix_add(tree, matrix, row, -(dx/2)*(dy/2)/((dz/2)), level+1, 2*i+m, 2*j+n, 2*k) matrix_add(tree, matrix, row, (dx/2)*(dy/2)/((dz/2)), level+1, 2*i+m, 2*j+n, 2*k_left+1) elif tree.bc["back"][0] == "dirichlet": # the finest level for the left flux is the node's level; this node # receives a second contribution because of the boundary condition matrix_add(tree, matrix, row, -2*(dx*dy)/(dz), level, i, j, k) elif tree.bc["back"][0] == "neumann": #the left flux depends only on the boundary condition scalar pass # right flux for axis 2 if mesh.bc_compatible_local_indexes(tree, level, i, j, k+1) is not None: i_right, j_right, k_right = mesh.bc_compatible_local_indexes(tree, level, i, j, k+1) index_right = mesh.z_curve_index(tree.dimension, level, i_right, j_right, k_right) if index_right in tree.tree_nodes and tree.nisleaf[index_right] \ or index_right not in tree.tree_nodes: # the finest level for the right flux is the node's level matrix_add(tree, matrix, row, -(dx*dy)/(dz), level, i, j, k) matrix_add(tree, matrix, row, (dx*dy)/(dz), level, i_right, j_right, k_right) else: for n in range(2): for m in range(2): matrix_add(tree, matrix, row, -(dx/2)*(dy/2)/((dz/2)), level+1, 2*i+m, 2*j+n, 2*k+1) matrix_add(tree, matrix, row, (dx/2)*(dy/2)/((dz/2)), level+1, 2*i+m, 2*j+n, 2*k_right) elif tree.bc["forth"][0] == "dirichlet": # the finest level for the right flux is the node's level; this node # receives a second contribution because of the boundary condition matrix_add(tree, matrix, row, -2*(dx*dy)/(dz), level, i, j, k) elif tree.bc["forth"][0] == "neumann": #the left flux depends only on the boundary condition scalar pass matrix.assemble() return matrix def create_bc_scalar(tree, axis, north=None, south=None, east=None, west=None, front=None, back=None): scalar = petsc.Vec().create() number_of_rows = tree.number_of_leaves scalar.setSizes(number_of_rows, number_of_rows) scalar.setUp() if north is None and south is None and east is None and west is None and front is None and back is None: north = tree.bc["north"][1] south = tree.bc["south"][1] west = tree.bc["west"][1] east = tree.bc["east"][1] forth = tree.bc["forth"][1] back = tree.bc["back"][1] if tree.dimension == 2: for row in range(number_of_rows): index = tree.tree_leaves[row] level = tree.nlevel[index] i = tree.nindex_x[index] j = tree.nindex_y[index] k = tree.nindex_z[index] dx = tree.ndx[index] dy = tree.ndy[index] dz = tree.ndz[index] #left flux if i == 0: if tree.bc["west"][0] == "dirichlet": coords = mesh.boundary_coords(tree, "west", level, 0, j, k) scalar.setValue(row, 2*west(coords)*dy/(dx), True) elif tree.bc["west"][0] == "neumann": coords = mesh.boundary_coords(tree, "west", level, 0, j, k) scalar.setValue(row, west(coords)*dy, True) elif tree.bc["west"][0] == "periodic": pass if j == 0: if tree.bc["south"][0] == "dirichlet": coords = mesh.boundary_coords(tree, "south", level, i, 0, k) scalar.setValue(row, 2*south(coords)*dx/(dy), True) elif tree.bc["south"][0] == "neumann": coords = mesh.boundary_coords(tree, "south", level, i, 0, k) scalar.setValue(row, south(coords)*dx, True) elif tree.bc["south"][0] == "periodic": pass #right flux if i == 2**level-1: if tree.bc["east"][0] == "dirichlet": coords = mesh.boundary_coords(tree, "east", level, 0, j, k) scalar.setValue(row, 2*east(coords)*dy/(dx), True) elif tree.bc["east"][0] == "neumann": coords = mesh.boundary_coords(tree, "east", level, 0, j, k) scalar.setValue(row, east(coords)*dy, True) elif tree.bc["east"][0] == "periodic": pass if j == 2**level-1: if tree.bc["north"][0] == "dirichlet": coords = mesh.boundary_coords(tree, "north", level, i, 0, k) scalar.setValue(row, 2*north(coords)*dx/(dy), True) elif tree.bc["north"][0] == "neumann": coords = mesh.boundary_coords(tree, "north", level, i, 0, k) scalar.setValue(row, north(coords)*dx, True) elif tree.bc["north"][0] == "periodic": pass return scalar elif tree.dimension == 3: for row in range(number_of_rows): index = tree.tree_leaves[row] level = tree.nlevel[index] i = tree.nindex_x[index] j = tree.nindex_y[index] k = tree.nindex_z[index] dx = tree.ndx[index] dy = tree.ndy[index] dz = tree.ndz[index] #left flux if i == 0: if tree.bc["west"][0] == "dirichlet": coords = mesh.boundary_coords(tree, "west", level, 0, j, k) scalar.setValue(row, 2*west(coords)*dy*dz/(dx), True) elif tree.bc["west"][0] == "neumann": coords = mesh.boundary_coords(tree, "west", level, 0, j, k) scalar.setValue(row, west(coords)*dy*dz, True) elif tree.bc["west"][0] == "periodic": pass if j == 0: if tree.bc["south"][0] == "dirichlet": coords = mesh.boundary_coords(tree, "south", level, i, 0, k) scalar.setValue(row, 2*south(coords)*dx*dz/(dy), True) elif tree.bc["south"][0] == "neumann": coords = mesh.boundary_coords(tree, "south", level, i, 0, k) scalar.setValue(row, south(coords)*dx*dz, True) elif tree.bc["south"][0] == "periodic": pass if k == 0: if tree.bc["back"][0] == "dirichlet": coords = mesh.boundary_coords(tree, "back", level, i, j, 0) scalar.setValue(row, 2*back(coords)*dx*dy/(dz), True) elif tree.bc["back"][0] == "neumann": coords = mesh.boundary_coords(tree, "back", level, i, j, 0) scalar.setValue(row, back(coords)*dx*dy, True) elif tree.bc["back"][0] == "periodic": pass #right flux if i == 2**level-1: if tree.bc["east"][0] == "dirichlet": coords = mesh.boundary_coords(tree, "east", level, 0, j, k) scalar.setValue(row, 2*east(coords)*dy*dz/(dx), True) elif tree.bc["east"][0] == "neumann": coords = mesh.boundary_coords(tree, "east", level, 0, j, k) scalar.setValue(row, east(coords)*dy*dz, True) elif tree.bc["east"][0] == "periodic": pass if j == 2**level-1: if tree.bc["north"][0] == "dirichlet": coords = mesh.boundary_coords(tree, "north", level, i, 0, k) scalar.setValue(row, 2*north(coords)*dx*dz/(dy), True) elif tree.bc["north"][0] == "neumann": coords = mesh.boundary_coords(tree, "north", level, i, 0, k) scalar.setValue(row, north(coords)*dx*dz, True) elif tree.bc["north"][0] == "periodic": pass if k == 2**level-1: if tree.bc["forth"][0] == "dirichlet": coords = mesh.boundary_coords(tree, "forth", level, i, j, 0) scalar.setValue(row, 2*forth(coords)*dx*dy/(dz), True) elif tree.bc["forth"][0] == "neumann": coords = mesh.boundary_coords(tree, "forth", level, i, j, 0) scalar.setValue(row, forth(coords)*dx*dy, True) elif tree.bc["forth"][0] == "periodic": pass return scalar if __name__ == "__main__": output_module = importlib.import_module(cfg.output_module_name) tree = mesh.create_new_tree(cfg.dimension, cfg.min_level, cfg.max_level, cfg.stencil_graduation, cfg.stencil_prediction) tree.tag = "u" mesh.listing_of_leaves(tree) print(tree.number_of_leaves) print("") laplacian_matrix = create_matrix(tree, 0) laplacian_matrix.view() print("") for index in tree.tree_leaves: tree.nvalue[index] = cfg.function(tree.ncoord_x[index], tree.ncoord_y[index]) output_module.write(tree, "test_finest_grid.dat") op.run_projection(tree) op.encode_details(tree) op.run_thresholding(tree) op.run_grading(tree) op.run_pruning(tree) mesh.listing_of_leaves(tree) print(tree.number_of_leaves) print("") output_module.write(tree, "test_adapted_grid.dat") laplacian_matrix = create_matrix(tree, 0) laplacian_matrix.view() print("") laplacian_bc = create_bc_scalar(tree, 0) laplacian_bc.view() print("")
44.400359
124
0.539161
3,498
24,731
3.688107
0.056032
0.033486
0.050384
0.073638
0.861794
0.846601
0.835672
0.82854
0.80924
0.809085
0
0.018685
0.337795
24,731
556
125
44.480216
0.769066
0.114836
0
0.671388
0
0
0.037734
0.001001
0
0
0
0
0
1
0.005666
false
0.056657
0.031161
0
0.048159
0.022663
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
1
0
0
0
0
0
7
7259a096295c97945756dcb2fcac45d03a040b8e
41,187
py
Python
Lib/site-packages/tensorflow/python/ops/gen_debug_ops.py
caiyongji/tf2.3.1-py3.7.9-full-built
ace4efcbf05b2b494388739718a18c13eab83c71
[ "CNRI-Python-GPL-Compatible" ]
null
null
null
Lib/site-packages/tensorflow/python/ops/gen_debug_ops.py
caiyongji/tf2.3.1-py3.7.9-full-built
ace4efcbf05b2b494388739718a18c13eab83c71
[ "CNRI-Python-GPL-Compatible" ]
null
null
null
Lib/site-packages/tensorflow/python/ops/gen_debug_ops.py
caiyongji/tf2.3.1-py3.7.9-full-built
ace4efcbf05b2b494388739718a18c13eab83c71
[ "CNRI-Python-GPL-Compatible" ]
null
null
null
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. """ import collections from tensorflow.python import pywrap_tfe as pywrap_tfe from tensorflow.python.eager import context as _context from tensorflow.python.eager import core as _core from tensorflow.python.eager import execute as _execute from tensorflow.python.framework import dtypes as _dtypes from tensorflow.python.framework import op_def_registry as _op_def_registry from tensorflow.python.framework import ops as _ops from tensorflow.python.framework import op_def_library as _op_def_library from tensorflow.python.util.deprecation import deprecated_endpoints from tensorflow.python.util import dispatch as _dispatch from tensorflow.python.util.tf_export import tf_export def copy(input, tensor_name="", debug_ops_spec=[], name=None): r"""Copy a tensor from CPU-to-CPU or GPU-to-GPU. Performs CPU-to-CPU or GPU-to-GPU deep-copying of tensor, depending on the device on which the tensor is allocated. N.B.: If the all downstream attached debug ops are disabled given the current gRPC gating status, the output will simply forward the input tensor without deep-copying. See the documentation of Debug* ops for more details. Unlike the CopyHost Op, this op does not have HostMemory constraint on its input or output. Args: input: A `Tensor`. Input tensor. tensor_name: An optional `string`. Defaults to `""`. The name of the input tensor. debug_ops_spec: An optional list of `strings`. Defaults to `[]`. A list of debug op spec (op, url, gated_grpc) for attached debug ops. Each element of the list has the format <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", "DebugIdentity;file:///tmp/tfdbg_1;0". name: A name for the operation (optional). Returns: A `Tensor`. Has the same type as `input`. """ _ctx = _context._context or _context.context() tld = _ctx._thread_local_data if tld.is_eager: try: _result = pywrap_tfe.TFE_Py_FastPathExecute( _ctx._context_handle, tld.device_name, "Copy", name, tld.op_callbacks, input, "tensor_name", tensor_name, "debug_ops_spec", debug_ops_spec) return _result except _core._NotOkStatusException as e: _ops.raise_from_not_ok_status(e, name) except _core._FallbackException: pass try: return copy_eager_fallback( input, tensor_name=tensor_name, debug_ops_spec=debug_ops_spec, name=name, ctx=_ctx) except _core._SymbolicException: pass # Add nodes to the TensorFlow graph. # Add nodes to the TensorFlow graph. if tensor_name is None: tensor_name = "" tensor_name = _execute.make_str(tensor_name, "tensor_name") if debug_ops_spec is None: debug_ops_spec = [] if not isinstance(debug_ops_spec, (list, tuple)): raise TypeError( "Expected list for 'debug_ops_spec' argument to " "'copy' Op, not %r." % debug_ops_spec) debug_ops_spec = [_execute.make_str(_s, "debug_ops_spec") for _s in debug_ops_spec] _, _, _op, _outputs = _op_def_library._apply_op_helper( "Copy", input=input, tensor_name=tensor_name, debug_ops_spec=debug_ops_spec, name=name) _result = _outputs[:] if _execute.must_record_gradient(): _attrs = ("T", _op._get_attr_type("T"), "tensor_name", _op.get_attr("tensor_name"), "debug_ops_spec", _op.get_attr("debug_ops_spec")) _inputs_flat = _op.inputs _execute.record_gradient( "Copy", _inputs_flat, _attrs, _result) _result, = _result return _result Copy = tf_export("raw_ops.Copy")(_ops.to_raw_op(copy)) def copy_eager_fallback(input, tensor_name, debug_ops_spec, name, ctx): if tensor_name is None: tensor_name = "" tensor_name = _execute.make_str(tensor_name, "tensor_name") if debug_ops_spec is None: debug_ops_spec = [] if not isinstance(debug_ops_spec, (list, tuple)): raise TypeError( "Expected list for 'debug_ops_spec' argument to " "'copy' Op, not %r." % debug_ops_spec) debug_ops_spec = [_execute.make_str(_s, "debug_ops_spec") for _s in debug_ops_spec] _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx) _inputs_flat = [input] _attrs = ("T", _attr_T, "tensor_name", tensor_name, "debug_ops_spec", debug_ops_spec) _result = _execute.execute(b"Copy", 1, inputs=_inputs_flat, attrs=_attrs, ctx=ctx, name=name) if _execute.must_record_gradient(): _execute.record_gradient( "Copy", _inputs_flat, _attrs, _result) _result, = _result return _result def copy_host(input, tensor_name="", debug_ops_spec=[], name=None): r"""Copy a tensor to host. Performs CPU-to-CPU deep-copying of tensor. N.B.: If the all downstream attached debug ops are disabled given the current gRPC gating status, the output will simply forward the input tensor without deep-copying. See the documentation of Debug* ops for more details. Unlike the Copy Op, this op has HostMemory constraint on its input or output. Args: input: A `Tensor`. Input tensor. tensor_name: An optional `string`. Defaults to `""`. The name of the input tensor. debug_ops_spec: An optional list of `strings`. Defaults to `[]`. A list of debug op spec (op, url, gated_grpc) for attached debug ops. Each element of the list has the format <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", "DebugIdentity;file:///tmp/tfdbg_1;0". name: A name for the operation (optional). Returns: A `Tensor`. Has the same type as `input`. """ _ctx = _context._context or _context.context() tld = _ctx._thread_local_data if tld.is_eager: try: _result = pywrap_tfe.TFE_Py_FastPathExecute( _ctx._context_handle, tld.device_name, "CopyHost", name, tld.op_callbacks, input, "tensor_name", tensor_name, "debug_ops_spec", debug_ops_spec) return _result except _core._NotOkStatusException as e: _ops.raise_from_not_ok_status(e, name) except _core._FallbackException: pass try: return copy_host_eager_fallback( input, tensor_name=tensor_name, debug_ops_spec=debug_ops_spec, name=name, ctx=_ctx) except _core._SymbolicException: pass # Add nodes to the TensorFlow graph. # Add nodes to the TensorFlow graph. if tensor_name is None: tensor_name = "" tensor_name = _execute.make_str(tensor_name, "tensor_name") if debug_ops_spec is None: debug_ops_spec = [] if not isinstance(debug_ops_spec, (list, tuple)): raise TypeError( "Expected list for 'debug_ops_spec' argument to " "'copy_host' Op, not %r." % debug_ops_spec) debug_ops_spec = [_execute.make_str(_s, "debug_ops_spec") for _s in debug_ops_spec] _, _, _op, _outputs = _op_def_library._apply_op_helper( "CopyHost", input=input, tensor_name=tensor_name, debug_ops_spec=debug_ops_spec, name=name) _result = _outputs[:] if _execute.must_record_gradient(): _attrs = ("T", _op._get_attr_type("T"), "tensor_name", _op.get_attr("tensor_name"), "debug_ops_spec", _op.get_attr("debug_ops_spec")) _inputs_flat = _op.inputs _execute.record_gradient( "CopyHost", _inputs_flat, _attrs, _result) _result, = _result return _result CopyHost = tf_export("raw_ops.CopyHost")(_ops.to_raw_op(copy_host)) def copy_host_eager_fallback(input, tensor_name, debug_ops_spec, name, ctx): if tensor_name is None: tensor_name = "" tensor_name = _execute.make_str(tensor_name, "tensor_name") if debug_ops_spec is None: debug_ops_spec = [] if not isinstance(debug_ops_spec, (list, tuple)): raise TypeError( "Expected list for 'debug_ops_spec' argument to " "'copy_host' Op, not %r." % debug_ops_spec) debug_ops_spec = [_execute.make_str(_s, "debug_ops_spec") for _s in debug_ops_spec] _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx) _inputs_flat = [input] _attrs = ("T", _attr_T, "tensor_name", tensor_name, "debug_ops_spec", debug_ops_spec) _result = _execute.execute(b"CopyHost", 1, inputs=_inputs_flat, attrs=_attrs, ctx=ctx, name=name) if _execute.must_record_gradient(): _execute.record_gradient( "CopyHost", _inputs_flat, _attrs, _result) _result, = _result return _result def debug_identity(input, device_name="", tensor_name="", debug_urls=[], gated_grpc=False, name=None): r"""Provides an identity mapping of the non-Ref type input tensor for debugging. Provides an identity mapping of the non-Ref type input tensor for debugging. Args: input: A `Tensor`. Input tensor, non-Reference type device_name: An optional `string`. Defaults to `""`. Name of the device on which the tensor resides. tensor_name: An optional `string`. Defaults to `""`. Name of the input tensor. debug_urls: An optional list of `strings`. Defaults to `[]`. List of URLs to debug targets, e.g., file:///foo/tfdbg_dump, grpc:://localhost:11011 gated_grpc: An optional `bool`. Defaults to `False`. Whether this op will be gated. If any of the debug_urls of this debug node is of the grpc:// scheme, when the value of this attribute is set to True, the data will not actually be sent via the grpc stream unless this debug op has been enabled at the debug_url. If all of the debug_urls of this debug node are of the grpc:// scheme and the debug op is enabled at none of them, the output will be an empty Tensor. name: A name for the operation (optional). Returns: A `Tensor`. Has the same type as `input`. """ _ctx = _context._context or _context.context() tld = _ctx._thread_local_data if tld.is_eager: try: _result = pywrap_tfe.TFE_Py_FastPathExecute( _ctx._context_handle, tld.device_name, "DebugIdentity", name, tld.op_callbacks, input, "device_name", device_name, "tensor_name", tensor_name, "debug_urls", debug_urls, "gated_grpc", gated_grpc) return _result except _core._NotOkStatusException as e: _ops.raise_from_not_ok_status(e, name) except _core._FallbackException: pass try: return debug_identity_eager_fallback( input, device_name=device_name, tensor_name=tensor_name, debug_urls=debug_urls, gated_grpc=gated_grpc, name=name, ctx=_ctx) except _core._SymbolicException: pass # Add nodes to the TensorFlow graph. # Add nodes to the TensorFlow graph. if device_name is None: device_name = "" device_name = _execute.make_str(device_name, "device_name") if tensor_name is None: tensor_name = "" tensor_name = _execute.make_str(tensor_name, "tensor_name") if debug_urls is None: debug_urls = [] if not isinstance(debug_urls, (list, tuple)): raise TypeError( "Expected list for 'debug_urls' argument to " "'debug_identity' Op, not %r." % debug_urls) debug_urls = [_execute.make_str(_s, "debug_urls") for _s in debug_urls] if gated_grpc is None: gated_grpc = False gated_grpc = _execute.make_bool(gated_grpc, "gated_grpc") _, _, _op, _outputs = _op_def_library._apply_op_helper( "DebugIdentity", input=input, device_name=device_name, tensor_name=tensor_name, debug_urls=debug_urls, gated_grpc=gated_grpc, name=name) _result = _outputs[:] if _execute.must_record_gradient(): _attrs = ("T", _op._get_attr_type("T"), "device_name", _op.get_attr("device_name"), "tensor_name", _op.get_attr("tensor_name"), "debug_urls", _op.get_attr("debug_urls"), "gated_grpc", _op._get_attr_bool("gated_grpc")) _inputs_flat = _op.inputs _execute.record_gradient( "DebugIdentity", _inputs_flat, _attrs, _result) _result, = _result return _result DebugIdentity = tf_export("raw_ops.DebugIdentity")(_ops.to_raw_op(debug_identity)) def debug_identity_eager_fallback(input, device_name, tensor_name, debug_urls, gated_grpc, name, ctx): if device_name is None: device_name = "" device_name = _execute.make_str(device_name, "device_name") if tensor_name is None: tensor_name = "" tensor_name = _execute.make_str(tensor_name, "tensor_name") if debug_urls is None: debug_urls = [] if not isinstance(debug_urls, (list, tuple)): raise TypeError( "Expected list for 'debug_urls' argument to " "'debug_identity' Op, not %r." % debug_urls) debug_urls = [_execute.make_str(_s, "debug_urls") for _s in debug_urls] if gated_grpc is None: gated_grpc = False gated_grpc = _execute.make_bool(gated_grpc, "gated_grpc") _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx) _inputs_flat = [input] _attrs = ("T", _attr_T, "device_name", device_name, "tensor_name", tensor_name, "debug_urls", debug_urls, "gated_grpc", gated_grpc) _result = _execute.execute(b"DebugIdentity", 1, inputs=_inputs_flat, attrs=_attrs, ctx=ctx, name=name) if _execute.must_record_gradient(): _execute.record_gradient( "DebugIdentity", _inputs_flat, _attrs, _result) _result, = _result return _result def debug_identity_v2(input, tfdbg_context_id="", op_name="", output_slot=-1, tensor_debug_mode=-1, debug_urls=[], circular_buffer_size=1000, tfdbg_run_id="", name=None): r"""Debug Identity V2 Op. Provides an identity mapping from input to output, while writing the content of the input tensor by calling DebugEventsWriter. The semantics of the input tensor depends on tensor_debug_mode. In typical usage, the input tensor comes directly from the user computation only when graph_debug_mode is FULL_TENSOR (see protobuf/debug_event.proto for a list of all the possible values of graph_debug_mode). For the other debug modes, the input tensor should be produced by an additional op or subgraph that computes summary information about one or more tensors. Args: input: A `Tensor`. Input tensor, non-Reference type tfdbg_context_id: An optional `string`. Defaults to `""`. A tfdbg-generated ID for the context that the op belongs to, e.g., a concrete compiled tf.function. op_name: An optional `string`. Defaults to `""`. Optional. Name of the op that the debug op is concerned with. Used only for single-tensor trace. output_slot: An optional `int`. Defaults to `-1`. Optional. Output slot index of the tensor that the debug op is concerned with. Used only for single-tensor trace. tensor_debug_mode: An optional `int`. Defaults to `-1`. TensorDebugMode enum value. See debug_event.proto for details. debug_urls: An optional list of `strings`. Defaults to `[]`. List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. circular_buffer_size: An optional `int`. Defaults to `1000`. tfdbg_run_id: An optional `string`. Defaults to `""`. name: A name for the operation (optional). Returns: A `Tensor`. Has the same type as `input`. """ _ctx = _context._context or _context.context() tld = _ctx._thread_local_data if tld.is_eager: try: _result = pywrap_tfe.TFE_Py_FastPathExecute( _ctx._context_handle, tld.device_name, "DebugIdentityV2", name, tld.op_callbacks, input, "tfdbg_context_id", tfdbg_context_id, "op_name", op_name, "output_slot", output_slot, "tensor_debug_mode", tensor_debug_mode, "debug_urls", debug_urls, "circular_buffer_size", circular_buffer_size, "tfdbg_run_id", tfdbg_run_id) return _result except _core._NotOkStatusException as e: _ops.raise_from_not_ok_status(e, name) except _core._FallbackException: pass try: return debug_identity_v2_eager_fallback( input, tfdbg_context_id=tfdbg_context_id, op_name=op_name, output_slot=output_slot, tensor_debug_mode=tensor_debug_mode, debug_urls=debug_urls, circular_buffer_size=circular_buffer_size, tfdbg_run_id=tfdbg_run_id, name=name, ctx=_ctx) except _core._SymbolicException: pass # Add nodes to the TensorFlow graph. # Add nodes to the TensorFlow graph. if tfdbg_context_id is None: tfdbg_context_id = "" tfdbg_context_id = _execute.make_str(tfdbg_context_id, "tfdbg_context_id") if op_name is None: op_name = "" op_name = _execute.make_str(op_name, "op_name") if output_slot is None: output_slot = -1 output_slot = _execute.make_int(output_slot, "output_slot") if tensor_debug_mode is None: tensor_debug_mode = -1 tensor_debug_mode = _execute.make_int(tensor_debug_mode, "tensor_debug_mode") if debug_urls is None: debug_urls = [] if not isinstance(debug_urls, (list, tuple)): raise TypeError( "Expected list for 'debug_urls' argument to " "'debug_identity_v2' Op, not %r." % debug_urls) debug_urls = [_execute.make_str(_s, "debug_urls") for _s in debug_urls] if circular_buffer_size is None: circular_buffer_size = 1000 circular_buffer_size = _execute.make_int(circular_buffer_size, "circular_buffer_size") if tfdbg_run_id is None: tfdbg_run_id = "" tfdbg_run_id = _execute.make_str(tfdbg_run_id, "tfdbg_run_id") _, _, _op, _outputs = _op_def_library._apply_op_helper( "DebugIdentityV2", input=input, tfdbg_context_id=tfdbg_context_id, op_name=op_name, output_slot=output_slot, tensor_debug_mode=tensor_debug_mode, debug_urls=debug_urls, circular_buffer_size=circular_buffer_size, tfdbg_run_id=tfdbg_run_id, name=name) _result = _outputs[:] if _execute.must_record_gradient(): _attrs = ("T", _op._get_attr_type("T"), "tfdbg_context_id", _op.get_attr("tfdbg_context_id"), "op_name", _op.get_attr("op_name"), "output_slot", _op._get_attr_int("output_slot"), "tensor_debug_mode", _op._get_attr_int("tensor_debug_mode"), "debug_urls", _op.get_attr("debug_urls"), "circular_buffer_size", _op._get_attr_int("circular_buffer_size"), "tfdbg_run_id", _op.get_attr("tfdbg_run_id")) _inputs_flat = _op.inputs _execute.record_gradient( "DebugIdentityV2", _inputs_flat, _attrs, _result) _result, = _result return _result DebugIdentityV2 = tf_export("raw_ops.DebugIdentityV2")(_ops.to_raw_op(debug_identity_v2)) def debug_identity_v2_eager_fallback(input, tfdbg_context_id, op_name, output_slot, tensor_debug_mode, debug_urls, circular_buffer_size, tfdbg_run_id, name, ctx): if tfdbg_context_id is None: tfdbg_context_id = "" tfdbg_context_id = _execute.make_str(tfdbg_context_id, "tfdbg_context_id") if op_name is None: op_name = "" op_name = _execute.make_str(op_name, "op_name") if output_slot is None: output_slot = -1 output_slot = _execute.make_int(output_slot, "output_slot") if tensor_debug_mode is None: tensor_debug_mode = -1 tensor_debug_mode = _execute.make_int(tensor_debug_mode, "tensor_debug_mode") if debug_urls is None: debug_urls = [] if not isinstance(debug_urls, (list, tuple)): raise TypeError( "Expected list for 'debug_urls' argument to " "'debug_identity_v2' Op, not %r." % debug_urls) debug_urls = [_execute.make_str(_s, "debug_urls") for _s in debug_urls] if circular_buffer_size is None: circular_buffer_size = 1000 circular_buffer_size = _execute.make_int(circular_buffer_size, "circular_buffer_size") if tfdbg_run_id is None: tfdbg_run_id = "" tfdbg_run_id = _execute.make_str(tfdbg_run_id, "tfdbg_run_id") _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx) _inputs_flat = [input] _attrs = ("T", _attr_T, "tfdbg_context_id", tfdbg_context_id, "op_name", op_name, "output_slot", output_slot, "tensor_debug_mode", tensor_debug_mode, "debug_urls", debug_urls, "circular_buffer_size", circular_buffer_size, "tfdbg_run_id", tfdbg_run_id) _result = _execute.execute(b"DebugIdentityV2", 1, inputs=_inputs_flat, attrs=_attrs, ctx=ctx, name=name) if _execute.must_record_gradient(): _execute.record_gradient( "DebugIdentityV2", _inputs_flat, _attrs, _result) _result, = _result return _result def debug_nan_count(input, device_name="", tensor_name="", debug_urls=[], gated_grpc=False, name=None): r"""Debug NaN Value Counter Op. Counts number of NaNs in the input tensor, for debugging. Args: input: A `Tensor`. Input tensor, non-Reference type. device_name: An optional `string`. Defaults to `""`. tensor_name: An optional `string`. Defaults to `""`. Name of the input tensor. debug_urls: An optional list of `strings`. Defaults to `[]`. List of URLs to debug targets, e.g., file:///foo/tfdbg_dump, grpc:://localhost:11011. gated_grpc: An optional `bool`. Defaults to `False`. Whether this op will be gated. If any of the debug_urls of this debug node is of the grpc:// scheme, when the value of this attribute is set to True, the data will not actually be sent via the grpc stream unless this debug op has been enabled at the debug_url. If all of the debug_urls of this debug node are of the grpc:// scheme and the debug op is enabled at none of them, the output will be an empty Tensor. name: A name for the operation (optional). Returns: A `Tensor` of type `int64`. """ _ctx = _context._context or _context.context() tld = _ctx._thread_local_data if tld.is_eager: try: _result = pywrap_tfe.TFE_Py_FastPathExecute( _ctx._context_handle, tld.device_name, "DebugNanCount", name, tld.op_callbacks, input, "device_name", device_name, "tensor_name", tensor_name, "debug_urls", debug_urls, "gated_grpc", gated_grpc) return _result except _core._NotOkStatusException as e: _ops.raise_from_not_ok_status(e, name) except _core._FallbackException: pass try: return debug_nan_count_eager_fallback( input, device_name=device_name, tensor_name=tensor_name, debug_urls=debug_urls, gated_grpc=gated_grpc, name=name, ctx=_ctx) except _core._SymbolicException: pass # Add nodes to the TensorFlow graph. # Add nodes to the TensorFlow graph. if device_name is None: device_name = "" device_name = _execute.make_str(device_name, "device_name") if tensor_name is None: tensor_name = "" tensor_name = _execute.make_str(tensor_name, "tensor_name") if debug_urls is None: debug_urls = [] if not isinstance(debug_urls, (list, tuple)): raise TypeError( "Expected list for 'debug_urls' argument to " "'debug_nan_count' Op, not %r." % debug_urls) debug_urls = [_execute.make_str(_s, "debug_urls") for _s in debug_urls] if gated_grpc is None: gated_grpc = False gated_grpc = _execute.make_bool(gated_grpc, "gated_grpc") _, _, _op, _outputs = _op_def_library._apply_op_helper( "DebugNanCount", input=input, device_name=device_name, tensor_name=tensor_name, debug_urls=debug_urls, gated_grpc=gated_grpc, name=name) _result = _outputs[:] if _execute.must_record_gradient(): _attrs = ("T", _op._get_attr_type("T"), "device_name", _op.get_attr("device_name"), "tensor_name", _op.get_attr("tensor_name"), "debug_urls", _op.get_attr("debug_urls"), "gated_grpc", _op._get_attr_bool("gated_grpc")) _inputs_flat = _op.inputs _execute.record_gradient( "DebugNanCount", _inputs_flat, _attrs, _result) _result, = _result return _result DebugNanCount = tf_export("raw_ops.DebugNanCount")(_ops.to_raw_op(debug_nan_count)) def debug_nan_count_eager_fallback(input, device_name, tensor_name, debug_urls, gated_grpc, name, ctx): if device_name is None: device_name = "" device_name = _execute.make_str(device_name, "device_name") if tensor_name is None: tensor_name = "" tensor_name = _execute.make_str(tensor_name, "tensor_name") if debug_urls is None: debug_urls = [] if not isinstance(debug_urls, (list, tuple)): raise TypeError( "Expected list for 'debug_urls' argument to " "'debug_nan_count' Op, not %r." % debug_urls) debug_urls = [_execute.make_str(_s, "debug_urls") for _s in debug_urls] if gated_grpc is None: gated_grpc = False gated_grpc = _execute.make_bool(gated_grpc, "gated_grpc") _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx) _inputs_flat = [input] _attrs = ("T", _attr_T, "device_name", device_name, "tensor_name", tensor_name, "debug_urls", debug_urls, "gated_grpc", gated_grpc) _result = _execute.execute(b"DebugNanCount", 1, inputs=_inputs_flat, attrs=_attrs, ctx=ctx, name=name) if _execute.must_record_gradient(): _execute.record_gradient( "DebugNanCount", _inputs_flat, _attrs, _result) _result, = _result return _result def debug_numeric_summary(input, device_name="", tensor_name="", debug_urls=[], lower_bound=float('-inf'), upper_bound=float('inf'), mute_if_healthy=False, gated_grpc=False, name=None): r"""Debug Numeric Summary Op. Provide a basic summary of numeric value types, range and distribution. output: A double tensor of shape [14 + nDimensions], where nDimensions is the number of dimensions of the tensor's shape. The elements of output are: [0]: is initialized (1.0) or not (0.0). [1]: total number of elements [2]: NaN element count [3]: generalized -inf count: elements <= lower_bound. lower_bound is -inf by default. [4]: negative element count (excluding -inf), if lower_bound is the default -inf. Otherwise, this is the count of elements > lower_bound and < 0. [5]: zero element count [6]: positive element count (excluding +inf), if upper_bound is the default +inf. Otherwise, this is the count of elements < upper_bound and > 0. [7]: generalized +inf count, elements >= upper_bound. upper_bound is +inf by default. Output elements [1:8] are all zero, if the tensor is uninitialized. [8]: minimum of all non-inf and non-NaN elements. If uninitialized or no such element exists: +inf. [9]: maximum of all non-inf and non-NaN elements. If uninitialized or no such element exists: -inf. [10]: mean of all non-inf and non-NaN elements. If uninitialized or no such element exists: NaN. [11]: variance of all non-inf and non-NaN elements. If uninitialized or no such element exists: NaN. [12]: Data type of the tensor encoded as an enum integer. See the DataType proto for more details. [13]: Number of dimensions of the tensor (ndims). [14+]: Sizes of the dimensions. Args: input: A `Tensor`. Input tensor, non-Reference type. device_name: An optional `string`. Defaults to `""`. tensor_name: An optional `string`. Defaults to `""`. Name of the input tensor. debug_urls: An optional list of `strings`. Defaults to `[]`. List of URLs to debug targets, e.g., file:///foo/tfdbg_dump, grpc:://localhost:11011. lower_bound: An optional `float`. Defaults to `float('-inf')`. (float) The lower bound <= which values will be included in the generalized -inf count. Default: -inf. upper_bound: An optional `float`. Defaults to `float('inf')`. (float) The upper bound >= which values will be included in the generalized +inf count. Default: +inf. mute_if_healthy: An optional `bool`. Defaults to `False`. (bool) Do not send data to the debug URLs unless at least one of elements [2], [3] and [7] (i.e., the nan count and the generalized -inf and inf counts) is non-zero. gated_grpc: An optional `bool`. Defaults to `False`. Whether this op will be gated. If any of the debug_urls of this debug node is of the grpc:// scheme, when the value of this attribute is set to True, the data will not actually be sent via the grpc stream unless this debug op has been enabled at the debug_url. If all of the debug_urls of this debug node are of the grpc:// scheme and the debug op is enabled at none of them, the output will be an empty Tensor. name: A name for the operation (optional). Returns: A `Tensor` of type `float64`. """ _ctx = _context._context or _context.context() tld = _ctx._thread_local_data if tld.is_eager: try: _result = pywrap_tfe.TFE_Py_FastPathExecute( _ctx._context_handle, tld.device_name, "DebugNumericSummary", name, tld.op_callbacks, input, "device_name", device_name, "tensor_name", tensor_name, "debug_urls", debug_urls, "lower_bound", lower_bound, "upper_bound", upper_bound, "mute_if_healthy", mute_if_healthy, "gated_grpc", gated_grpc) return _result except _core._NotOkStatusException as e: _ops.raise_from_not_ok_status(e, name) except _core._FallbackException: pass try: return debug_numeric_summary_eager_fallback( input, device_name=device_name, tensor_name=tensor_name, debug_urls=debug_urls, lower_bound=lower_bound, upper_bound=upper_bound, mute_if_healthy=mute_if_healthy, gated_grpc=gated_grpc, name=name, ctx=_ctx) except _core._SymbolicException: pass # Add nodes to the TensorFlow graph. # Add nodes to the TensorFlow graph. if device_name is None: device_name = "" device_name = _execute.make_str(device_name, "device_name") if tensor_name is None: tensor_name = "" tensor_name = _execute.make_str(tensor_name, "tensor_name") if debug_urls is None: debug_urls = [] if not isinstance(debug_urls, (list, tuple)): raise TypeError( "Expected list for 'debug_urls' argument to " "'debug_numeric_summary' Op, not %r." % debug_urls) debug_urls = [_execute.make_str(_s, "debug_urls") for _s in debug_urls] if lower_bound is None: lower_bound = float('-inf') lower_bound = _execute.make_float(lower_bound, "lower_bound") if upper_bound is None: upper_bound = float('inf') upper_bound = _execute.make_float(upper_bound, "upper_bound") if mute_if_healthy is None: mute_if_healthy = False mute_if_healthy = _execute.make_bool(mute_if_healthy, "mute_if_healthy") if gated_grpc is None: gated_grpc = False gated_grpc = _execute.make_bool(gated_grpc, "gated_grpc") _, _, _op, _outputs = _op_def_library._apply_op_helper( "DebugNumericSummary", input=input, device_name=device_name, tensor_name=tensor_name, debug_urls=debug_urls, lower_bound=lower_bound, upper_bound=upper_bound, mute_if_healthy=mute_if_healthy, gated_grpc=gated_grpc, name=name) _result = _outputs[:] if _execute.must_record_gradient(): _attrs = ("T", _op._get_attr_type("T"), "device_name", _op.get_attr("device_name"), "tensor_name", _op.get_attr("tensor_name"), "debug_urls", _op.get_attr("debug_urls"), "lower_bound", _op.get_attr("lower_bound"), "upper_bound", _op.get_attr("upper_bound"), "mute_if_healthy", _op._get_attr_bool("mute_if_healthy"), "gated_grpc", _op._get_attr_bool("gated_grpc")) _inputs_flat = _op.inputs _execute.record_gradient( "DebugNumericSummary", _inputs_flat, _attrs, _result) _result, = _result return _result DebugNumericSummary = tf_export("raw_ops.DebugNumericSummary")(_ops.to_raw_op(debug_numeric_summary)) def debug_numeric_summary_eager_fallback(input, device_name, tensor_name, debug_urls, lower_bound, upper_bound, mute_if_healthy, gated_grpc, name, ctx): if device_name is None: device_name = "" device_name = _execute.make_str(device_name, "device_name") if tensor_name is None: tensor_name = "" tensor_name = _execute.make_str(tensor_name, "tensor_name") if debug_urls is None: debug_urls = [] if not isinstance(debug_urls, (list, tuple)): raise TypeError( "Expected list for 'debug_urls' argument to " "'debug_numeric_summary' Op, not %r." % debug_urls) debug_urls = [_execute.make_str(_s, "debug_urls") for _s in debug_urls] if lower_bound is None: lower_bound = float('-inf') lower_bound = _execute.make_float(lower_bound, "lower_bound") if upper_bound is None: upper_bound = float('inf') upper_bound = _execute.make_float(upper_bound, "upper_bound") if mute_if_healthy is None: mute_if_healthy = False mute_if_healthy = _execute.make_bool(mute_if_healthy, "mute_if_healthy") if gated_grpc is None: gated_grpc = False gated_grpc = _execute.make_bool(gated_grpc, "gated_grpc") _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx) _inputs_flat = [input] _attrs = ("T", _attr_T, "device_name", device_name, "tensor_name", tensor_name, "debug_urls", debug_urls, "lower_bound", lower_bound, "upper_bound", upper_bound, "mute_if_healthy", mute_if_healthy, "gated_grpc", gated_grpc) _result = _execute.execute(b"DebugNumericSummary", 1, inputs=_inputs_flat, attrs=_attrs, ctx=ctx, name=name) if _execute.must_record_gradient(): _execute.record_gradient( "DebugNumericSummary", _inputs_flat, _attrs, _result) _result, = _result return _result def debug_numeric_summary_v2(input, output_dtype=_dtypes.float32, tensor_debug_mode=-1, tensor_id=-1, name=None): r"""Debug Numeric Summary V2 Op. Computes a numeric summary of the input tensor. The shape of the output depends on the tensor_debug_mode attribute. This op is used internally by TensorFlow Debugger (tfdbg) v2. Args: input: A `Tensor`. Input tensor, to be summarized by the op. output_dtype: An optional `tf.DType` from: `tf.float32, tf.float64`. Defaults to `tf.float32`. Optional. The type of the output. Can be float32 or float64 (default: float32). tensor_debug_mode: An optional `int`. Defaults to `-1`. Tensor debug mode: the mode in which the input tensor is summarized by the op. See the TensorDebugMode enum in tensorflow/core/protobuf/debug_event.proto for details. Supported values: 2 (CURT_HEALTH): Output a float32/64 tensor of shape [2]. The 1st element is the tensor_id, if provided, and -1 otherwise. The 2nd element is a bit which is set to 1 if the input tensor has an infinity or nan value, or zero otherwise. 3 (CONCISE_HEALTH): Output a float32/64 tensor of shape [5]. The 1st element is the tensor_id, if provided, and -1 otherwise. The remaining four slots are the total number of elements, -infs, +infs, and nans in the input tensor respectively. 4 (FULL_HEALTH): Output a float32/64 tensor of shape [11]. The 1st element is the tensor_id, if provided, and -1 otherwise. The 2nd element is the device_id, if provided, and -1 otherwise. The 3rd element holds the datatype value of the input tensor as according to the enumerated type in tensorflow/core/framework/types.proto. The remaining elements hold the total number of elements, -infs, +infs, nans, negative finite numbers, zeros, and positive finite numbers in the input tensor respectively. 5 (SHAPE): Output a float32/64 tensor of shape [10]. The 1st element is the tensor_id, if provided, and -1 otherwise. The 2nd element holds the datatype value of the input tensor as according to the enumerated type in tensorflow/core/framework/types.proto. The 3rd element holds the rank of the tensor. The 4th element holds the number of elements within the tensor. Finally the remaining 6 elements hold the shape of the tensor. If the rank of the tensor is lower than 6, the shape is right padded with zeros. If the rank is greater than 6, the head of the shape is truncated. 6 (FULL_NUMERICS): Output a float32/64 tensor of shape [22]. The 1st element is the tensor_id, if provided, and -1 otherwise. The 2nd element is the device_id, if provided, and -1 otherwise. The 3rd element holds the datatype value of the input tensor as according to the enumerated type in tensorflow/core/framework/types.proto. The 4th element holds the rank of the tensor. The 5th to 11th elements hold the shape of the tensor. If the rank of the tensor is lower than 6, the shape is right padded with zeros. If the rank is greater than 6, the head of the shape is truncated. The 12th to 18th elements hold the number of elements, -infs, +infs, nans, denormal floats, negative finite numbers, zeros, and positive finite numbers in the input tensor respectively. The final four elements hold the min value, max value, mean, and variance of the input tensor. 8 (REDUCE_INF_NAN_THREE_SLOTS): Output a float32/64 tensor of shape [3]. The 1st element is -inf if any elements of the input tensor is -inf, or zero otherwise. The 2nd element is +inf if any elements of the input tensor is +inf, or zero otherwise. The 3rd element is nan if any element of the input tensor is nan, or zero otherwise. tensor_id: An optional `int`. Defaults to `-1`. Optional. An integer identifier for the tensor being summarized by this op. name: A name for the operation (optional). Returns: A `Tensor` of type `output_dtype`. """ _ctx = _context._context or _context.context() tld = _ctx._thread_local_data if tld.is_eager: try: _result = pywrap_tfe.TFE_Py_FastPathExecute( _ctx._context_handle, tld.device_name, "DebugNumericSummaryV2", name, tld.op_callbacks, input, "output_dtype", output_dtype, "tensor_debug_mode", tensor_debug_mode, "tensor_id", tensor_id) return _result except _core._NotOkStatusException as e: _ops.raise_from_not_ok_status(e, name) except _core._FallbackException: pass try: return debug_numeric_summary_v2_eager_fallback( input, output_dtype=output_dtype, tensor_debug_mode=tensor_debug_mode, tensor_id=tensor_id, name=name, ctx=_ctx) except _core._SymbolicException: pass # Add nodes to the TensorFlow graph. # Add nodes to the TensorFlow graph. if output_dtype is None: output_dtype = _dtypes.float32 output_dtype = _execute.make_type(output_dtype, "output_dtype") if tensor_debug_mode is None: tensor_debug_mode = -1 tensor_debug_mode = _execute.make_int(tensor_debug_mode, "tensor_debug_mode") if tensor_id is None: tensor_id = -1 tensor_id = _execute.make_int(tensor_id, "tensor_id") _, _, _op, _outputs = _op_def_library._apply_op_helper( "DebugNumericSummaryV2", input=input, output_dtype=output_dtype, tensor_debug_mode=tensor_debug_mode, tensor_id=tensor_id, name=name) _result = _outputs[:] if _execute.must_record_gradient(): _attrs = ("output_dtype", _op._get_attr_type("output_dtype"), "T", _op._get_attr_type("T"), "tensor_debug_mode", _op._get_attr_int("tensor_debug_mode"), "tensor_id", _op._get_attr_int("tensor_id")) _inputs_flat = _op.inputs _execute.record_gradient( "DebugNumericSummaryV2", _inputs_flat, _attrs, _result) _result, = _result return _result DebugNumericSummaryV2 = tf_export("raw_ops.DebugNumericSummaryV2")(_ops.to_raw_op(debug_numeric_summary_v2)) def debug_numeric_summary_v2_eager_fallback(input, output_dtype, tensor_debug_mode, tensor_id, name, ctx): if output_dtype is None: output_dtype = _dtypes.float32 output_dtype = _execute.make_type(output_dtype, "output_dtype") if tensor_debug_mode is None: tensor_debug_mode = -1 tensor_debug_mode = _execute.make_int(tensor_debug_mode, "tensor_debug_mode") if tensor_id is None: tensor_id = -1 tensor_id = _execute.make_int(tensor_id, "tensor_id") _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx) _inputs_flat = [input] _attrs = ("output_dtype", output_dtype, "T", _attr_T, "tensor_debug_mode", tensor_debug_mode, "tensor_id", tensor_id) _result = _execute.execute(b"DebugNumericSummaryV2", 1, inputs=_inputs_flat, attrs=_attrs, ctx=ctx, name=name) if _execute.must_record_gradient(): _execute.record_gradient( "DebugNumericSummaryV2", _inputs_flat, _attrs, _result) _result, = _result return _result
45.161184
185
0.700634
5,919
41,187
4.543842
0.064369
0.04116
0.031753
0.029745
0.859937
0.830935
0.812605
0.794423
0.782413
0.766462
0
0.007047
0.207541
41,187
911
186
45.210757
0.816967
0.327749
0
0.805324
1
0
0.131778
0.010012
0
0
0
0
0
1
0.023295
false
0.023295
0.019967
0
0.08985
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
727206351570781e0dcd436d92725f3516beb0fe
12,905
py
Python
bench/FEECa/plot.py
Airini/FEECa
3ffae7177fca159d965b70e3763a20ab84cd8a8b
[ "BSD-3-Clause" ]
32
2016-05-18T05:41:28.000Z
2021-07-15T12:51:19.000Z
bench/FEECa/plot.py
Airini/FEECa
3ffae7177fca159d965b70e3763a20ab84cd8a8b
[ "BSD-3-Clause" ]
4
2016-10-26T13:28:34.000Z
2017-02-08T16:37:41.000Z
bench/FEECa/plot.py
Airini/FEECa
3ffae7177fca159d965b70e3763a20ab84cd8a8b
[ "BSD-3-Clause" ]
8
2016-05-18T21:33:55.000Z
2021-09-13T19:33:06.000Z
import matplotlib import numpy as np import matplotlib.pyplot as plt import seaborn as sns from matplotlib.patches import Patch from itertools import dropwhile sns.set_style("whitegrid") #------------------------------------------------------------------------------# # Graphics settings. #------------------------------------------------------------------------------# plt.rc('text', usetex=True) plt.rc('font', family='sans') #------------------------------------------------------------------------------# # Parser functions. #------------------------------------------------------------------------------# def convSpace(string): if string == 'P': return 0.0 if string == 'P-': return 1.0 return -1.0 def convUnit(string): if string == 's': return 1.0 if string == 'ns': return 1e-9 if string == 'ms': return 1e-3 return 1e-6 def readCriterion(filename): bs = open(filename, 'r').read().replace("\n"," ").split("benchmarking") n = len(bs) - 1 types = np.empty((n,2), dtype="|S8") times = np.zeros((n,3)) for i,b in enumerate(bs[1:]): bw = b.split() times[i,2] = np.float64(bw[3]) * convUnit(bw[4]) times[i,0:2] = bw[1].split("/")[1][1:-1].split(",") types[i,0] = bw[0] types[i,1] = bw[1].split("/")[0] return types, times types, times = readCriterion("bench.dat") prlk_basis = times[np.all(types == ['PrLk','basis'],1),:] prlk_evaluate = times[np.all(types == ['PrLk','evaluate'],1)] prmlk_basis = times[np.all(types == ['PrmLk','basis'],1),:] prmlk_evaluate = times[np.all(types == ['PrmLk','evaluate'],1)] filename = "../fenics/timings_fenics.csv" data_fenics = np.loadtxt(filename, delimiter=',', converters={0: convSpace}) prlk_fenics = np.asarray(data_fenics[data_fenics[:,0] == 0.0,1:], dtype=np.float64) prmlk_fenics = np.asarray(data_fenics[data_fenics[:,0] == 1.0,1:], dtype=np.float64) prlk_fenics_basis = prlk_fenics[:,-10:-5] prlk_fenics_evaluate = prlk_fenics[:,-5:] prmlk_fenics_basis = prmlk_fenics[:,-10:-5] prmlk_fenics_evaluate = prmlk_fenics[:,-5:] #------------------------------------------------------------------------------# # PrLk Basis #------------------------------------------------------------------------------# rs = np.arange(1,6,1) pal = sns.color_palette("spring", 4)[1:] f,axs = plt.subplots(2,2) for n,ax in zip(range(1,5) ,axs.ravel()[:-1]): inds = np.where(prlk_basis[:,0] == n)[0] data = prlk_basis[inds,:] inds = np.where(prlk_fenics[:,0] == n)[0] data_fenics = prlk_fenics_basis[inds,:] ks = np.unique(data[:,1]) ls = [] for k,c in zip(ks, pal): print(k) ts = data[data[:,1] == k, 2] ts_fenics = np.ravel(data_fenics[prlk_fenics[inds,1] == k, :]) ls = ls + ax.plot(rs, ts_fenics / ts, c=c, lw=3) ax.set_yscale("log") ax.set_title("$n =" + str(n) + "$", fontsize=16) ax.set_xlabel("Polynomial Degree $r$", fontsize=12) ax.set_ylabel("Relative Speedup", fontsize=12) ax.set_xticks(np.arange(min(rs), max(rs) + 1, 1.0)) #ax.set_yticks(np.linspace(min(rs),max(rs), 10)) axs.ravel()[-1].set_axis_off() labels = ["$k =" + str(i) +"$" for i in range(5)] l = plt.legend( ls, labels, loc = 'center', ncol = 1, prop={'size':14}) f.suptitle("$\mathcal{P}_r\Lambda^k$ --- Basis Function Computation", fontsize=14) plt.tight_layout() f.savefig('prlk_compute_basis.pdf',bbox_inches='tight') #------------------------------------------------------------------------------# # PrLk Evaluate #------------------------------------------------------------------------------# rs = np.arange(1,6,1) pal = sns.color_palette("spring", 4)[1:] f,axs = plt.subplots(2,2) for n,ax in zip(range(1,5) ,axs.ravel()[:-1]): inds = np.where(prlk_evaluate[:,0] == n)[0] data = prlk_evaluate[inds,:] inds = np.where(prlk_fenics[:,0] == n)[0] data_fenics = prlk_fenics_evaluate[inds,:] ks = np.unique(data[:,1]) ls = [] for k,c in zip(ks, pal): print(k) ts = data[data[:,1] == k, 2] ts_fenics = np.ravel(data_fenics[prlk_fenics[inds,1] == k, :]) ls = ls + ax.plot(rs, ts_fenics / ts, c=c, lw=3) ax.set_yscale("log") ax.set_title("$n =" + str(n) + "$", fontsize=16) ax.set_xlabel("Polynomial Degree $r$", fontsize=12) ax.set_ylabel("Relative Speedup", fontsize=12) ax.set_xticks(np.arange(min(rs), max(rs) + 1, 1.0)) #ax.set_yticks(np.linspace(min(rs),max(rs), 10)) axs.ravel()[-1].set_axis_off() labels = ["$k =" + str(i) +"$" for i in range(5)] l = plt.legend( ls, labels, loc = 'center', ncol = 1, prop={'size':14}) f.suptitle("$\mathcal{P}_r\Lambda^k$ --- Basis Function Evaluation", fontsize=14) plt.tight_layout() f.savefig('prlk_evaluate_basis.pdf',bbox_inches='tight') #------------------------------------------------------------------------------# # PrmLk Basis #------------------------------------------------------------------------------# rs = np.arange(1,6,1) pal = sns.color_palette("spring", 4)[1:] f,axs = plt.subplots(2,2) for n,ax in zip(range(1,5) ,axs.ravel()[:-1]): inds = np.where(prmlk_basis[:,0] == n)[0] data = prmlk_basis[inds,:] inds = np.where(prmlk_fenics[:,0] == n)[0] data_fenics = prmlk_fenics_basis[inds,:] ks = np.unique(data[:,1]) ls = [] for k,c in zip(ks, pal): print(k) ts = data[data[:,1] == k, 2] ts_fenics = np.ravel(data_fenics[prmlk_fenics[inds,1] == k, :]) ls = ls + ax.plot(rs, ts_fenics / ts, c=c, lw=3) ax.set_yscale("log") ax.set_title("$n =" + str(n) + "$", fontsize=16) ax.set_xlabel("Polynomial Degree $r$", fontsize=12) ax.set_ylabel("Relative Speedup", fontsize=12) ax.set_xticks(np.arange(min(rs), max(rs) + 1, 1.0)) #ax.set_yticks(np.linspace(min(rs),max(rs), 10)) axs.ravel()[-1].set_axis_off() labels = ["$k =" + str(i) +"$" for i in range(5)] l = plt.legend( ls, labels, loc = 'center', ncol = 1, prop={'size':14}) f.suptitle("$\mathcal{P}_r^-\Lambda^k$ --- Basis Function Computation", fontsize=14) plt.tight_layout() f.savefig('prmlk_compute_basis.pdf',bbox_inches='tight') #------------------------------------------------------------------------------# # PrmLk Evaluate #------------------------------------------------------------------------------# rs = np.arange(1,6,1) pal = sns.color_palette("spring", 4)[1:] f,axs = plt.subplots(2,2) for n,ax in zip(range(1,5) ,axs.ravel()[:-1]): inds = np.where(prmlk_evaluate[:,0] == n)[0] data = prmlk_evaluate[inds,:] inds = np.where(prmlk_fenics[:,0] == n)[0] data_fenics = prmlk_fenics_evaluate[inds,:] ks = np.unique(data[:,1]) ls = [] for k,c in zip(ks, pal): print(k) ts = data[data[:,1] == k, 2] ts_fenics = np.ravel(data_fenics[prmlk_fenics[inds,1] == k, :]) ls = ls + ax.plot(rs, ts_fenics / ts, c=c, lw=3) ax.set_yscale("log") ax.set_title("$n =" + str(n) + "$", fontsize=16) ax.set_xlabel("Polynomial Degree $r$", fontsize=12) ax.set_ylabel("Relative Speedup", fontsize=12) ax.set_xticks(np.arange(min(rs), max(rs) + 1, 1.0)) #ax.set_yticks(np.linspace(min(rs),max(rs), 10)) axs.ravel()[-1].set_axis_off() labels = ["$k =" + str(i) +"$" for i in range(5)] l = plt.legend( ls, labels, loc = 'center', ncol = 1, prop={'size':14}) f.suptitle("$\mathcal{P}_r^-\Lambda^k$ --- Basis Function Evaluation", fontsize=14) plt.tight_layout() f.savefig('prmlk_evaluate_basis.pdf',bbox_inches='tight') #------------------------------------------------------------------------------# # PrLk Total #------------------------------------------------------------------------------# rs = np.arange(1,6,1) pal = sns.color_palette("spring", 4)[1:] f,axs = plt.subplots(2,2) for n,ax in zip(range(1,5) ,axs.ravel()[:-1]): inds = np.where(prlk_basis[:,0] == n)[0] data = prlk_basis[inds,:] inds = np.where(prlk_evaluate[:,0] == n)[0] data[:,-1] = data[:,-1] + prlk_evaluate[inds,-1] inds = np.where(prlk_fenics[:,0] == n)[0] data_fenics = prlk_fenics_basis[inds,:] data_fenics = data_fenics + prlk_fenics_evaluate[inds,:] ks = np.unique(data[:,1]) ls = [] for k,c in zip(ks, pal): print(k) ts = data[data[:,1] == k, 2] ts_fenics = np.ravel(data_fenics[prlk_fenics[inds,1] == k, :]) ls = ls + ax.plot(rs, ts_fenics / ts, c=c, lw=3) ax.set_yscale("log") ax.set_title("$n =" + str(n) + "$", fontsize=16) ax.set_xlabel("Polynomial Degree $r$", fontsize=12) ax.set_ylabel("Relative Speedup", fontsize=12) ax.set_xticks(np.arange(min(rs), max(rs) + 1, 1.0)) #ax.set_yticks(np.linspace(min(rs),max(rs), 10)) axs.ravel()[-1].set_axis_off() labels = ["$k =" + str(i) +"$" for i in range(5)] l = plt.legend( ls, labels, loc = 'center', ncol = 1, prop={'size':14}) f.suptitle("$\mathcal{P}_r^-\Lambda^k$ --- Total Time", fontsize=14) plt.tight_layout() f.savefig('prlk_total.pdf',bbox_inches='tight') #------------------------------------------------------------------------------# # PrmLk Total #------------------------------------------------------------------------------# rs = np.arange(1,6,1) pal = sns.color_palette("spring", 4)[1:] f,axs = plt.subplots(2,2) for n,ax in zip(range(1,5) ,axs.ravel()[:-1]): inds = np.where(prmlk_basis[:,0] == n)[0] data = prmlk_basis[inds,:] inds = np.where(prmlk_evaluate[:,0] == n)[0] data[:,-1] = data[:,-1] + prlk_evaluate[inds,-1] inds = np.where(prmlk_fenics[:,0] == n)[0] data_fenics = prmlk_fenics_basis[inds,:] data_fenics = data_fenics + prmlk_fenics_evaluate[inds,:] ks = np.unique(data[:,1]) ls = [] for k,c in zip(ks, pal): print(k) ts = data[data[:,1] == k, 2] ts_fenics = np.ravel(data_fenics[prmlk_fenics[inds,1] == k, :]) ls = ls + ax.plot(rs, ts_fenics / ts, c=c, lw=3) ax.set_yscale("log") ax.set_title("$n =" + str(n) + "$", fontsize=16) ax.set_xlabel("Polynomial Degree $r$", fontsize=12) ax.set_ylabel("Relative Speedup", fontsize=12) ax.set_xticks(np.arange(min(rs), max(rs) + 1, 1.0)) #ax.set_yticks(np.linspace(min(rs),max(rs), 10)) axs.ravel()[-1].set_axis_off() labels = ["$k =" + str(i) +"$" for i in range(5)] l = plt.legend( ls, labels, loc = 'center', ncol = 1, prop={'size':14}) f.suptitle("$\mathcal{P}_r^-\Lambda^k$ --- Total Time", fontsize=14) plt.tight_layout() f.savefig('prmlk_total.pdf',bbox_inches='tight') ##prlk evaluate #pal = sns.light_palette("navy", 6)[1:] #f,axs = plt.subplots(2,2) #for n,ax in zip(range(1,5) ,axs.ravel()): # inds = np.where(prlk[:,0] == n)[0] # ls = [] # for i,c in zip(inds, pal): # print(prlk[i,1]) # ls = ls + ax.plot(rs, prlk_evaluate[i,:].T, c=c) # ax.set_title("$\mathcal{P}_r\Lambda^k, n =" + str(n) + "$") # ax.set_xlabel("Polynomial Degree $r$") # ax.set_ylabel("Time to Solution $[s]$") # #labels = ["$k =" + str(i) +"$" for i in range(5)] #l = plt.legend( ls, labels, loc = 'lower center', ncol = 5, # bbox_to_anchor=(0.55,-0.03), bbox_transform=f.transFigure) #f.suptitle(" Basis Function Evaluation") #plt.tight_layout() #f.savefig('prlk_evaluate_basis.pdf',bbox_inches='tight') # ##prlmk evaluate #pal = sns.light_palette("green", 6)[1:] #f,axs = plt.subplots(2,2) #for n,ax in zip(range(1,5) ,axs.ravel()): # inds = np.where(prlk[:,0] == n)[0] # ls = [] # for i,c in zip(inds, pal): # print(prlk[i,1]) # ls = ls + ax.plot(rs, prmlk_basis[i,:].T, c=c) # ax.set_title("$\mathcal{P}_r^-\Lambda^k, n =" + str(n) + "$") # ax.set_xlabel("Polynomial Degree $r$") # ax.set_ylabel("Time to Solution $[s]$") # #labels = ["$k =" + str(i) +"$" for i in range(5)] #l = plt.legend( ls, labels, loc = 'lower center', ncol = 5, # bbox_to_anchor=(0.55,-0.03), bbox_transform=f.transFigure) #f.suptitle("Basis Function Computation") #plt.tight_layout() #f.savefig('prmlk_compute_basis.pdf',bbox_inches='tight') # ##prlmk evaluate #pal = sns.light_palette("green", 6)[1:] #f,axs = plt.subplots(2,2) #for n,ax in zip(range(1,5) ,axs.ravel()): # inds = np.where(prlk[:,0] == n)[0] # ls = [] # for i,c in zip(inds, pal): # print(prlk[i,1]) # ls = ls + ax.plot(rs, prmlk_evaluate[i,:].T, c=c) # ax.set_title("$\mathcal{P}_r^-\Lambda^k, n =" + str(n) + "$") # ax.set_xlabel("Polynomial Degree $r$") # ax.set_ylabel("Time to Solution $[s]$") # #labels = ["$k =" + str(i) +"$" for i in range(5)] #l = plt.legend( ls, labels, loc = 'lower center', ncol = 5, # bbox_to_anchor=(0.55,-0.03), bbox_transform=f.transFigure) #f.suptitle("Basis Function Evaluation") #plt.tight_layout() #f.savefig('prmlk_evaluate_basis.pdf',bbox_inches='tight')
36.558074
84
0.534599
1,903
12,905
3.510772
0.088282
0.033678
0.02799
0.014668
0.862146
0.830415
0.81874
0.815746
0.803024
0.798533
0
0.032032
0.170244
12,905
352
85
36.661932
0.591894
0.295389
0
0.704762
0
0
0.109516
0.030273
0
0
0
0
0
1
0.014286
false
0
0.028571
0
0.080952
0.028571
0
0
0
null
0
0
0
1
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
7
72856e485b9332ba73ae5cdc47184acd098b8405
10,255
py
Python
src/graphics/tests/test_cursor.py
Kautenja/very-good-semantic-segmentation-labeling-app
73a51ed17d1e22ae98ebae53058092b425708338
[ "MIT" ]
1
2020-04-07T01:29:29.000Z
2020-04-07T01:29:29.000Z
src/graphics/tests/test_cursor.py
Kautenja/very-good-semantic-segmentation-labeling-app
73a51ed17d1e22ae98ebae53058092b425708338
[ "MIT" ]
null
null
null
src/graphics/tests/test_cursor.py
Kautenja/very-good-semantic-segmentation-labeling-app
73a51ed17d1e22ae98ebae53058092b425708338
[ "MIT" ]
1
2019-02-27T06:01:14.000Z
2019-02-27T06:01:14.000Z
"""Test cases for the brush_cursor module.""" from unittest import TestCase import numpy as np from ..cursor import make_circle from ..cursor import make_cursor, make_ring from ..cursor import pyglet_cursor class ShouldCreateCircleWithRadius1(TestCase): def test(self): circle = make_circle(1) expected = np.array([ [0, 0, 0,], [0, 1, 0,], [0, 0, 0,], ]) self.assertTrue(np.array_equal(expected, circle)) class ShouldCreateCircleWithRadius2(TestCase): def test(self): circle = make_circle(2) expected = np.array([ [0, 0, 0, 0, 0,], [0, 1, 1, 1, 0,], [0, 1, 1, 1, 0,], [0, 1, 1, 1, 0,], [0, 0, 0, 0, 0,], ]) self.assertTrue(np.array_equal(expected, circle)) class ShouldCreateRingWithRadius2(TestCase): def test(self): circle = make_ring(1, 2) expected = np.array([ [0, 0, 0, 0, 0,], [0, 1, 1, 1, 0,], [0, 1, 0, 1, 0,], [0, 1, 1, 1, 0,], [0, 0, 0, 0, 0,], ]) self.assertTrue(np.array_equal(expected, circle)) class ShouldCreateCircleWithRadius3(TestCase): def test(self): circle = make_circle(3) expected = np.array([ [0, 0, 0, 0, 0, 0, 0,], [0, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 0,], [0, 0, 0, 0, 0, 0, 0,], ]) self.assertTrue(np.array_equal(expected, circle)) class ShouldCreateRingWithRadius3(TestCase): def test(self): circle = make_ring(2, 3) expected = np.array([ [0, 0, 0, 0, 0, 0, 0,], [0, 1, 1, 1, 1, 1, 0,], [0, 1, 0, 0, 0, 1, 0,], [0, 1, 0, 0, 0, 1, 0,], [0, 1, 0, 0, 0, 1, 0,], [0, 1, 1, 1, 1, 1, 0,], [0, 0, 0, 0, 0, 0, 0,], ]) self.assertTrue(np.array_equal(expected, circle)) class ShouldCreateCircleWithRadius10(TestCase): def test(self): circle = make_circle(10) expected = np.array([ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,], ]) self.assertTrue(np.array_equal(expected, circle)) class ShouldCreateRingWithRadius10(TestCase): def test(self): circle = make_ring(9, 10) expected = np.array([ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,], [0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0,], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,], [0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0,], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,], ]) self.assertTrue(np.array_equal(expected, circle)) class ShouldCreateCursorWithRadius1(TestCase): def test(self): circle = make_circle(1) circle = make_cursor(circle, color=(33, 66, 99)) expected = np.array([ [ [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 33, 66, 99, 255,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], ], ]) self.assertTrue(np.array_equal(expected, circle)) class ShouldCreateCursorWithRadius2(TestCase): def test(self): circle = make_circle(2) circle = make_cursor(circle, color=(33, 66, 99)) expected = np.array([ [ [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], ], ]) self.assertTrue(np.array_equal(expected, circle)) class ShouldCreateCursorWithRadius3(TestCase): def test(self): circle = make_circle(3) circle = make_cursor(circle, color=(33, 66, 99)) expected = np.array([ [ [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 33, 66, 99, 255,], [ 0, 0, 0, 0,], ], [ [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], [ 0, 0, 0, 0,], ], ]) self.assertTrue(np.array_equal(expected, circle)) class ShouldMakePygletCursor(TestCase): def test(self): circle = make_circle(3) cursor = make_cursor(circle, color=(33, 66, 99)) mouse_cursor = pyglet_cursor(cursor)
38.40824
77
0.312823
1,653
10,255
1.921355
0.029038
0.450882
0.587531
0.700252
0.838791
0.838791
0.838791
0.78306
0.704345
0.702771
0
0.297856
0.476841
10,255
266
78
38.552632
0.294129
0.003803
0
0.888889
0
0
0
0
0
0
0
0
0.041152
1
0.045267
false
0
0.020576
0
0.111111
0
0
0
1
null
1
1
1
1
1
1
1
1
1
0
1
0
0
0
0
0
1
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
13
728743fa71dcd0ee430d6b5eb8107c47123dd326
170
py
Python
library/rpi_ws281x/__init__.py
paulhayes/rpi-ws281x-python
baf174dfee61b58fdb01952ff52738d89cf7616e
[ "BSD-2-Clause" ]
219
2018-04-21T20:49:34.000Z
2022-03-22T18:10:37.000Z
library/rpi_ws281x/__init__.py
paulhayes/rpi-ws281x-python
baf174dfee61b58fdb01952ff52738d89cf7616e
[ "BSD-2-Clause" ]
80
2018-03-20T10:42:18.000Z
2022-03-28T20:52:05.000Z
library/rpi_ws281x/__init__.py
paulhayes/rpi-ws281x-python
baf174dfee61b58fdb01952ff52738d89cf7616e
[ "BSD-2-Clause" ]
83
2018-09-17T14:00:01.000Z
2022-03-23T19:30:39.000Z
# New canonical package, to support `import rpi_ws281x` from .rpi_ws281x import PixelStrip, Adafruit_NeoPixel, Color, ws from _rpi_ws281x import * __version__ = '4.3.0'
28.333333
64
0.782353
25
170
4.96
0.72
0.217742
0.209677
0.306452
0
0
0
0
0
0
0
0.081633
0.135294
170
5
65
34
0.761905
0.311765
0
0
0
0
0.043478
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
7
72b60dfdbd89cfef2bbc88d4e9dafb170ab0bd16
12,842
py
Python
Account/app/mod_service/schemas.py
TamSzaGot/mydata-sdk
9c8afb75077f0b993819aa534b904501a8112f76
[ "MIT" ]
4
2018-04-21T00:46:40.000Z
2019-12-03T13:52:03.000Z
Account/app/mod_service/schemas.py
TamSzaGot/mydata-sdk
9c8afb75077f0b993819aa534b904501a8112f76
[ "MIT" ]
1
2019-01-09T10:45:23.000Z
2019-01-09T10:45:23.000Z
Account/app/mod_service/schemas.py
TamSzaGot/mydata-sdk
9c8afb75077f0b993819aa534b904501a8112f76
[ "MIT" ]
4
2018-04-21T01:12:12.000Z
2020-09-24T06:19:29.000Z
# -*- coding: utf-8 -*- """ __author__ = "Jani Yli-Kantola" __copyright__ = "" __credits__ = ["Harri Hirvonsalo", "Aleksi Palomäki"] __license__ = "MIT" __version__ = "1.3.0" __maintainer__ = "Jani Yli-Kantola" __contact__ = "https://github.com/HIIT/mydata-stack" __status__ = "Development" """ schema_sl_init_sink = { "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {}, "properties": { "code": { "type": "string" }, "data": { "properties": { "attributes": { "properties": { "pop_key": { "properties": { "crv": { "type": "string" }, "kid": { "type": "string" }, "kty": { "type": "string" }, "x": { "type": "string" }, "y": { "type": "string" } }, "required": [ "crv", "y", "x", "kid", "kty" ], "type": "object" }, "slr_id": { "type": "string" } }, "required": [ "slr_id", "pop_key" ], "type": "object" } }, "required": [ "attributes" ], "type": "object" } }, "required": [ "code", "data" ], "type": "object" } schema_sl_init_source = { "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {}, "properties": { "code": { "type": "string" }, "data": { "properties": { "attributes": { "properties": { "slr_id": { "type": "string" } }, "required": [ "slr_id" ], "type": "object" } }, "required": [ "attributes" ], "type": "object" } }, "required": [ "code", "data" ], "type": "object" } schema_sl_sign = { "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {}, "properties": { "code": { "type": "string" }, "data": { "properties": { "attributes": { "properties": { "iat": { "type": "integer" }, "link_id": { "type": "string" }, "operator_id": { "type": "string" }, "operator_key": { "properties": { "crv": { "type": "string" }, "kid": { "type": "string" }, "kty": { "type": "string" }, "x": { "type": "string" }, "y": { "type": "string" } }, "required": [ "crv", "y", "x", "kid", "kty" ], "type": "object" }, "service_id": { "type": "string" }, "surrogate_id": { "type": "string" }, "version": { "type": "string" } }, "required": [ "operator_id", "surrogate_id", "link_id", "operator_key", "version", "iat", "service_id" ], "type": "object" }, "type": { "type": "string" } }, "required": [ "attributes", "type" ], "type": "object" } }, "required": [ "code", "data" ], "type": "object" } schema_sl_store = { "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {}, "id": "http://example.com/example.json", "properties": { "code": { "type": "string" }, "data": { "properties": { "slr": { "properties": { "attributes": { "properties": { "payload": { "type": "string" }, "signatures": { "items": { "properties": { "header": { "properties": { "kid": { "type": "string" } }, "required": [ "kid" ], "type": "object" }, "protected": { "type": "string" }, "signature": { "type": "string" } }, "required": [ "header", "protected", "signature" ], "type": "object" }, "type": "array" } }, "required": [ "signatures", "payload" ], "type": "object" }, "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "attributes", "type", "id" ], "type": "object" }, "ssr": { "properties": { "attributes": { "properties": { "iat": { "type": "integer" }, "prev_record_id": { "type": "string" }, "record_id": { "type": "string" }, "sl_status": { "type": "string" }, "slr_id": { "type": "string" }, "surrogate_id": { "type": "string" }, "version": { "type": "string" } }, "required": [ "slr_id", "surrogate_id", "sl_status", "version", "record_id", "iat", "prev_record_id" ], "type": "object" }, "type": { "type": "string" } }, "required": [ "attributes", "type" ], "type": "object" } }, "required": [ "slr", "ssr" ], "type": "object" } }, "required": [ "code", "data" ], "type": "object" } schema_sls_to_sign_by_account = { "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {}, "id": "http://example.com/example.json", "properties": { "data": { "properties": { "attributes": { "properties": { "iat": { "type": "integer" }, "prev_record_id": { "type": "string" }, "record_id": { "type": "string" }, "sl_status": { "type": "string" }, "slr_id": { "type": "string" }, "surrogate_id": { "type": "string" }, "version": { "type": "string" } }, "required": [ "slr_id", "surrogate_id", "sl_status", "version", "record_id", "iat", "prev_record_id" ], "type": "object" }, "type": { "type": "string" } }, "required": [ "attributes", "type" ], "type": "object" } }, "required": [ "data" ], "type": "object" } schema_sls_signed_by_operator = { "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {}, "id": "http://example.com/example.json", "properties": { "data": { "properties": { "ssr": { "properties": { "attributes": { "properties": { "header": { "properties": { "kid": { "type": "string" } }, "required": [ "kid" ], "type": "object" }, "payload": { "type": "string" }, "protected": { "type": "string" }, "signature": { "type": "string" } }, "required": [ "header", "protected", "payload", "signature" ], "type": "object" }, "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "attributes", "type", "id" ], "type": "object" }, "ssr_payload": { "properties": { "attributes": { "properties": { "iat": { "type": "integer" }, "prev_record_id": { "type": "string" }, "record_id": { "type": "string" }, "sl_status": { "type": "string" }, "slr_id": { "type": "string" }, "surrogate_id": { "type": "string" }, "version": { "type": "string" } }, "required": [ "slr_id", "surrogate_id", "sl_status", "version", "record_id", "iat", "prev_record_id" ], "type": "object" } }, "required": [ "attributes" ], "type": "object" } }, "required": [ "ssr_payload", "ssr" ], "type": "object" } }, "required": [ "data" ], "type": "object" }
25.632735
57
0.2456
580
12,842
5.256897
0.139655
0.177107
0.078714
0.039357
0.818629
0.814693
0.790423
0.768121
0.741883
0.693342
0
0.003292
0.621554
12,842
500
58
25.684
0.624074
0.022193
0
0.697479
0
0
0.231229
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
1
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
7
72cb4e67c65f45f51e651aa3048a878bb173fd44
40,041
py
Python
vendor/github.com/containers-ai/api/alameda_api/v1alpha1/datahub/recommendations/recommendations_pb2.py
imhd/alameda
a82b009133f53bd5406b3ff371453907192d0f75
[ "Apache-2.0" ]
null
null
null
vendor/github.com/containers-ai/api/alameda_api/v1alpha1/datahub/recommendations/recommendations_pb2.py
imhd/alameda
a82b009133f53bd5406b3ff371453907192d0f75
[ "Apache-2.0" ]
null
null
null
vendor/github.com/containers-ai/api/alameda_api/v1alpha1/datahub/recommendations/recommendations_pb2.py
imhd/alameda
a82b009133f53bd5406b3ff371453907192d0f75
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: alameda_api/v1alpha1/datahub/recommendations/recommendations.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from alameda_api.v1alpha1.datahub.common import metrics_pb2 as alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_metrics__pb2 from alameda_api.v1alpha1.datahub.common import rawdata_pb2 as alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_rawdata__pb2 from alameda_api.v1alpha1.datahub.common import types_pb2 as alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_types__pb2 from alameda_api.v1alpha1.datahub.resources import metadata_pb2 as alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2 from alameda_api.v1alpha1.datahub.resources import policies_pb2 as alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_policies__pb2 from alameda_api.v1alpha1.datahub.resources import resources_pb2 as alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_resources__pb2 from alameda_api.v1alpha1.datahub.recommendations import types_pb2 as alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='alameda_api/v1alpha1/datahub/recommendations/recommendations.proto', package='containersai.alameda.v1alpha1.datahub.recommendations', syntax='proto3', serialized_options=_b('ZIgithub.com/containers-ai/api/alameda_api/v1alpha1/datahub/recommendations'), serialized_pb=_b('\nBalameda_api/v1alpha1/datahub/recommendations/recommendations.proto\x12\x35\x63ontainersai.alameda.v1alpha1.datahub.recommendations\x1a\x31\x61lameda_api/v1alpha1/datahub/common/metrics.proto\x1a\x31\x61lameda_api/v1alpha1/datahub/common/rawdata.proto\x1a/alameda_api/v1alpha1/datahub/common/types.proto\x1a\x35\x61lameda_api/v1alpha1/datahub/resources/metadata.proto\x1a\x35\x61lameda_api/v1alpha1/datahub/resources/policies.proto\x1a\x36\x61lameda_api/v1alpha1/datahub/resources/resources.proto\x1a\x38\x61lameda_api/v1alpha1/datahub/recommendations/types.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9f\x03\n\x17\x43ontainerRecommendation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12W\n\x15limit_recommendations\x18\x02 \x03(\x0b\x32\x38.containersai.alameda.v1alpha1.datahub.common.MetricData\x12Y\n\x17request_recommendations\x18\x03 \x03(\x0b\x32\x38.containersai.alameda.v1alpha1.datahub.common.MetricData\x12_\n\x1dinitial_limit_recommendations\x18\x04 \x03(\x0b\x32\x38.containersai.alameda.v1alpha1.datahub.common.MetricData\x12\x61\n\x1finitial_request_recommendations\x18\x05 \x03(\x0b\x32\x38.containersai.alameda.v1alpha1.datahub.common.MetricData\"\xb9\x04\n\x11PodRecommendation\x12P\n\x0bobject_meta\x18\x01 \x01(\x0b\x32;.containersai.alameda.v1alpha1.datahub.resources.ObjectMeta\x12 \n\x18\x61pply_recommendation_now\x18\x02 \x01(\x08\x12[\n\x11\x61ssign_pod_policy\x18\x03 \x01(\x0b\x32@.containersai.alameda.v1alpha1.datahub.resources.AssignPodPolicy\x12q\n\x19\x63ontainer_recommendations\x18\x04 \x03(\x0b\x32N.containersai.alameda.v1alpha1.datahub.recommendations.ContainerRecommendation\x12.\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12S\n\x0etop_controller\x18\x07 \x01(\x0b\x32;.containersai.alameda.v1alpha1.datahub.resources.Controller\x12\x19\n\x11recommendation_id\x18\x08 \x01(\t\x12\x12\n\ntotal_cost\x18\t \x01(\x01\"\xfc\x03\n\x18\x43ontrollerRecommendation\x12P\n\x0bobject_meta\x18\x01 \x01(\x0b\x32;.containersai.alameda.v1alpha1.datahub.resources.ObjectMeta\x12\x43\n\x04kind\x18\x02 \x01(\x0e\x32\x35.containersai.alameda.v1alpha1.datahub.resources.Kind\x12j\n\x10recommended_type\x18\x03 \x01(\x0e\x32P.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedType\x12j\n\x10recommended_spec\x18\x04 \x01(\x0b\x32P.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedSpec\x12q\n\x14recommended_spec_k8s\x18\x05 \x01(\x0b\x32S.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedSpecK8s\"\xfd\x03\n\x19\x41pplicationRecommendation\x12P\n\x0bobject_meta\x18\x01 \x01(\x0b\x32;.containersai.alameda.v1alpha1.datahub.resources.ObjectMeta\x12\x43\n\x04kind\x18\x02 \x01(\x0e\x32\x35.containersai.alameda.v1alpha1.datahub.resources.Kind\x12j\n\x10recommended_type\x18\x03 \x01(\x0e\x32P.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedType\x12j\n\x10recommended_spec\x18\x04 \x01(\x0b\x32P.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedSpec\x12q\n\x14recommended_spec_k8s\x18\x05 \x01(\x0b\x32S.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedSpecK8s\"\xfb\x03\n\x17NamespaceRecommendation\x12P\n\x0bobject_meta\x18\x01 \x01(\x0b\x32;.containersai.alameda.v1alpha1.datahub.resources.ObjectMeta\x12\x43\n\x04kind\x18\x02 \x01(\x0e\x32\x35.containersai.alameda.v1alpha1.datahub.resources.Kind\x12j\n\x10recommended_type\x18\x03 \x01(\x0e\x32P.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedType\x12j\n\x10recommended_spec\x18\x04 \x01(\x0b\x32P.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedSpec\x12q\n\x14recommended_spec_k8s\x18\x05 \x01(\x0b\x32S.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedSpecK8s\"\xf6\x03\n\x12NodeRecommendation\x12P\n\x0bobject_meta\x18\x01 \x01(\x0b\x32;.containersai.alameda.v1alpha1.datahub.resources.ObjectMeta\x12\x43\n\x04kind\x18\x02 \x01(\x0e\x32\x35.containersai.alameda.v1alpha1.datahub.resources.Kind\x12j\n\x10recommended_type\x18\x03 \x01(\x0e\x32P.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedType\x12j\n\x10recommended_spec\x18\x04 \x01(\x0b\x32P.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedSpec\x12q\n\x14recommended_spec_k8s\x18\x05 \x01(\x0b\x32S.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedSpecK8s\"\xf9\x03\n\x15\x43lusterRecommendation\x12P\n\x0bobject_meta\x18\x01 \x01(\x0b\x32;.containersai.alameda.v1alpha1.datahub.resources.ObjectMeta\x12\x43\n\x04kind\x18\x02 \x01(\x0e\x32\x35.containersai.alameda.v1alpha1.datahub.resources.Kind\x12j\n\x10recommended_type\x18\x03 \x01(\x0e\x32P.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedType\x12j\n\x10recommended_spec\x18\x04 \x01(\x0b\x32P.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedSpec\x12q\n\x14recommended_spec_k8s\x18\x05 \x01(\x0b\x32S.containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendedSpecK8s\"\x86\x02\n\x13WriteRecommendation\x12M\n\x0bmetric_type\x18\x01 \x01(\x0e\x32\x38.containersai.alameda.v1alpha1.datahub.common.MetricType\x12S\n\x0eresource_quota\x18\x02 \x01(\x0e\x32;.containersai.alameda.v1alpha1.datahub.common.ResourceQuota\x12K\n\nwrite_data\x18\x03 \x01(\x0b\x32\x37.containersai.alameda.v1alpha1.datahub.common.WriteDataBKZIgithub.com/containers-ai/api/alameda_api/v1alpha1/datahub/recommendationsb\x06proto3') , dependencies=[alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_metrics__pb2.DESCRIPTOR,alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_rawdata__pb2.DESCRIPTOR,alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_types__pb2.DESCRIPTOR,alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2.DESCRIPTOR,alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_policies__pb2.DESCRIPTOR,alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_resources__pb2.DESCRIPTOR,alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) _CONTAINERRECOMMENDATION = _descriptor.Descriptor( name='ContainerRecommendation', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ContainerRecommendation', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='name', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ContainerRecommendation.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='limit_recommendations', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ContainerRecommendation.limit_recommendations', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='request_recommendations', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ContainerRecommendation.request_recommendations', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='initial_limit_recommendations', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ContainerRecommendation.initial_limit_recommendations', index=3, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='initial_request_recommendations', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ContainerRecommendation.initial_request_recommendations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=534, serialized_end=949, ) _PODRECOMMENDATION = _descriptor.Descriptor( name='PodRecommendation', full_name='containersai.alameda.v1alpha1.datahub.recommendations.PodRecommendation', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='object_meta', full_name='containersai.alameda.v1alpha1.datahub.recommendations.PodRecommendation.object_meta', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='apply_recommendation_now', full_name='containersai.alameda.v1alpha1.datahub.recommendations.PodRecommendation.apply_recommendation_now', index=1, number=2, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='assign_pod_policy', full_name='containersai.alameda.v1alpha1.datahub.recommendations.PodRecommendation.assign_pod_policy', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='container_recommendations', full_name='containersai.alameda.v1alpha1.datahub.recommendations.PodRecommendation.container_recommendations', index=3, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='start_time', full_name='containersai.alameda.v1alpha1.datahub.recommendations.PodRecommendation.start_time', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='end_time', full_name='containersai.alameda.v1alpha1.datahub.recommendations.PodRecommendation.end_time', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='top_controller', full_name='containersai.alameda.v1alpha1.datahub.recommendations.PodRecommendation.top_controller', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommendation_id', full_name='containersai.alameda.v1alpha1.datahub.recommendations.PodRecommendation.recommendation_id', index=7, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='total_cost', full_name='containersai.alameda.v1alpha1.datahub.recommendations.PodRecommendation.total_cost', index=8, number=9, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=952, serialized_end=1521, ) _CONTROLLERRECOMMENDATION = _descriptor.Descriptor( name='ControllerRecommendation', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendation', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='object_meta', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendation.object_meta', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kind', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendation.kind', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_type', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendation.recommended_type', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_spec', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendation.recommended_spec', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_spec_k8s', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendation.recommended_spec_k8s', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1524, serialized_end=2032, ) _APPLICATIONRECOMMENDATION = _descriptor.Descriptor( name='ApplicationRecommendation', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ApplicationRecommendation', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='object_meta', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ApplicationRecommendation.object_meta', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kind', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ApplicationRecommendation.kind', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_type', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ApplicationRecommendation.recommended_type', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_spec', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ApplicationRecommendation.recommended_spec', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_spec_k8s', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ApplicationRecommendation.recommended_spec_k8s', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=2035, serialized_end=2544, ) _NAMESPACERECOMMENDATION = _descriptor.Descriptor( name='NamespaceRecommendation', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NamespaceRecommendation', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='object_meta', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NamespaceRecommendation.object_meta', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kind', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NamespaceRecommendation.kind', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_type', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NamespaceRecommendation.recommended_type', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_spec', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NamespaceRecommendation.recommended_spec', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_spec_k8s', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NamespaceRecommendation.recommended_spec_k8s', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=2547, serialized_end=3054, ) _NODERECOMMENDATION = _descriptor.Descriptor( name='NodeRecommendation', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NodeRecommendation', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='object_meta', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NodeRecommendation.object_meta', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kind', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NodeRecommendation.kind', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_type', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NodeRecommendation.recommended_type', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_spec', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NodeRecommendation.recommended_spec', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_spec_k8s', full_name='containersai.alameda.v1alpha1.datahub.recommendations.NodeRecommendation.recommended_spec_k8s', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=3057, serialized_end=3559, ) _CLUSTERRECOMMENDATION = _descriptor.Descriptor( name='ClusterRecommendation', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ClusterRecommendation', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='object_meta', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ClusterRecommendation.object_meta', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kind', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ClusterRecommendation.kind', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_type', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ClusterRecommendation.recommended_type', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_spec', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ClusterRecommendation.recommended_spec', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recommended_spec_k8s', full_name='containersai.alameda.v1alpha1.datahub.recommendations.ClusterRecommendation.recommended_spec_k8s', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=3562, serialized_end=4067, ) _WRITERECOMMENDATION = _descriptor.Descriptor( name='WriteRecommendation', full_name='containersai.alameda.v1alpha1.datahub.recommendations.WriteRecommendation', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='metric_type', full_name='containersai.alameda.v1alpha1.datahub.recommendations.WriteRecommendation.metric_type', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='resource_quota', full_name='containersai.alameda.v1alpha1.datahub.recommendations.WriteRecommendation.resource_quota', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='write_data', full_name='containersai.alameda.v1alpha1.datahub.recommendations.WriteRecommendation.write_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=4070, serialized_end=4332, ) _CONTAINERRECOMMENDATION.fields_by_name['limit_recommendations'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_metrics__pb2._METRICDATA _CONTAINERRECOMMENDATION.fields_by_name['request_recommendations'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_metrics__pb2._METRICDATA _CONTAINERRECOMMENDATION.fields_by_name['initial_limit_recommendations'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_metrics__pb2._METRICDATA _CONTAINERRECOMMENDATION.fields_by_name['initial_request_recommendations'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_metrics__pb2._METRICDATA _PODRECOMMENDATION.fields_by_name['object_meta'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2._OBJECTMETA _PODRECOMMENDATION.fields_by_name['assign_pod_policy'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_policies__pb2._ASSIGNPODPOLICY _PODRECOMMENDATION.fields_by_name['container_recommendations'].message_type = _CONTAINERRECOMMENDATION _PODRECOMMENDATION.fields_by_name['start_time'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP _PODRECOMMENDATION.fields_by_name['end_time'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP _PODRECOMMENDATION.fields_by_name['top_controller'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_resources__pb2._CONTROLLER _CONTROLLERRECOMMENDATION.fields_by_name['object_meta'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2._OBJECTMETA _CONTROLLERRECOMMENDATION.fields_by_name['kind'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2._KIND _CONTROLLERRECOMMENDATION.fields_by_name['recommended_type'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDTYPE _CONTROLLERRECOMMENDATION.fields_by_name['recommended_spec'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDSPEC _CONTROLLERRECOMMENDATION.fields_by_name['recommended_spec_k8s'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDSPECK8S _APPLICATIONRECOMMENDATION.fields_by_name['object_meta'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2._OBJECTMETA _APPLICATIONRECOMMENDATION.fields_by_name['kind'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2._KIND _APPLICATIONRECOMMENDATION.fields_by_name['recommended_type'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDTYPE _APPLICATIONRECOMMENDATION.fields_by_name['recommended_spec'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDSPEC _APPLICATIONRECOMMENDATION.fields_by_name['recommended_spec_k8s'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDSPECK8S _NAMESPACERECOMMENDATION.fields_by_name['object_meta'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2._OBJECTMETA _NAMESPACERECOMMENDATION.fields_by_name['kind'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2._KIND _NAMESPACERECOMMENDATION.fields_by_name['recommended_type'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDTYPE _NAMESPACERECOMMENDATION.fields_by_name['recommended_spec'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDSPEC _NAMESPACERECOMMENDATION.fields_by_name['recommended_spec_k8s'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDSPECK8S _NODERECOMMENDATION.fields_by_name['object_meta'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2._OBJECTMETA _NODERECOMMENDATION.fields_by_name['kind'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2._KIND _NODERECOMMENDATION.fields_by_name['recommended_type'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDTYPE _NODERECOMMENDATION.fields_by_name['recommended_spec'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDSPEC _NODERECOMMENDATION.fields_by_name['recommended_spec_k8s'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDSPECK8S _CLUSTERRECOMMENDATION.fields_by_name['object_meta'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2._OBJECTMETA _CLUSTERRECOMMENDATION.fields_by_name['kind'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_resources_dot_metadata__pb2._KIND _CLUSTERRECOMMENDATION.fields_by_name['recommended_type'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDTYPE _CLUSTERRECOMMENDATION.fields_by_name['recommended_spec'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDSPEC _CLUSTERRECOMMENDATION.fields_by_name['recommended_spec_k8s'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_recommendations_dot_types__pb2._CONTROLLERRECOMMENDEDSPECK8S _WRITERECOMMENDATION.fields_by_name['metric_type'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_metrics__pb2._METRICTYPE _WRITERECOMMENDATION.fields_by_name['resource_quota'].enum_type = alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_types__pb2._RESOURCEQUOTA _WRITERECOMMENDATION.fields_by_name['write_data'].message_type = alameda__api_dot_v1alpha1_dot_datahub_dot_common_dot_rawdata__pb2._WRITEDATA DESCRIPTOR.message_types_by_name['ContainerRecommendation'] = _CONTAINERRECOMMENDATION DESCRIPTOR.message_types_by_name['PodRecommendation'] = _PODRECOMMENDATION DESCRIPTOR.message_types_by_name['ControllerRecommendation'] = _CONTROLLERRECOMMENDATION DESCRIPTOR.message_types_by_name['ApplicationRecommendation'] = _APPLICATIONRECOMMENDATION DESCRIPTOR.message_types_by_name['NamespaceRecommendation'] = _NAMESPACERECOMMENDATION DESCRIPTOR.message_types_by_name['NodeRecommendation'] = _NODERECOMMENDATION DESCRIPTOR.message_types_by_name['ClusterRecommendation'] = _CLUSTERRECOMMENDATION DESCRIPTOR.message_types_by_name['WriteRecommendation'] = _WRITERECOMMENDATION _sym_db.RegisterFileDescriptor(DESCRIPTOR) ContainerRecommendation = _reflection.GeneratedProtocolMessageType('ContainerRecommendation', (_message.Message,), { 'DESCRIPTOR' : _CONTAINERRECOMMENDATION, '__module__' : 'alameda_api.v1alpha1.datahub.recommendations.recommendations_pb2' # @@protoc_insertion_point(class_scope:containersai.alameda.v1alpha1.datahub.recommendations.ContainerRecommendation) }) _sym_db.RegisterMessage(ContainerRecommendation) PodRecommendation = _reflection.GeneratedProtocolMessageType('PodRecommendation', (_message.Message,), { 'DESCRIPTOR' : _PODRECOMMENDATION, '__module__' : 'alameda_api.v1alpha1.datahub.recommendations.recommendations_pb2' # @@protoc_insertion_point(class_scope:containersai.alameda.v1alpha1.datahub.recommendations.PodRecommendation) }) _sym_db.RegisterMessage(PodRecommendation) ControllerRecommendation = _reflection.GeneratedProtocolMessageType('ControllerRecommendation', (_message.Message,), { 'DESCRIPTOR' : _CONTROLLERRECOMMENDATION, '__module__' : 'alameda_api.v1alpha1.datahub.recommendations.recommendations_pb2' # @@protoc_insertion_point(class_scope:containersai.alameda.v1alpha1.datahub.recommendations.ControllerRecommendation) }) _sym_db.RegisterMessage(ControllerRecommendation) ApplicationRecommendation = _reflection.GeneratedProtocolMessageType('ApplicationRecommendation', (_message.Message,), { 'DESCRIPTOR' : _APPLICATIONRECOMMENDATION, '__module__' : 'alameda_api.v1alpha1.datahub.recommendations.recommendations_pb2' # @@protoc_insertion_point(class_scope:containersai.alameda.v1alpha1.datahub.recommendations.ApplicationRecommendation) }) _sym_db.RegisterMessage(ApplicationRecommendation) NamespaceRecommendation = _reflection.GeneratedProtocolMessageType('NamespaceRecommendation', (_message.Message,), { 'DESCRIPTOR' : _NAMESPACERECOMMENDATION, '__module__' : 'alameda_api.v1alpha1.datahub.recommendations.recommendations_pb2' # @@protoc_insertion_point(class_scope:containersai.alameda.v1alpha1.datahub.recommendations.NamespaceRecommendation) }) _sym_db.RegisterMessage(NamespaceRecommendation) NodeRecommendation = _reflection.GeneratedProtocolMessageType('NodeRecommendation', (_message.Message,), { 'DESCRIPTOR' : _NODERECOMMENDATION, '__module__' : 'alameda_api.v1alpha1.datahub.recommendations.recommendations_pb2' # @@protoc_insertion_point(class_scope:containersai.alameda.v1alpha1.datahub.recommendations.NodeRecommendation) }) _sym_db.RegisterMessage(NodeRecommendation) ClusterRecommendation = _reflection.GeneratedProtocolMessageType('ClusterRecommendation', (_message.Message,), { 'DESCRIPTOR' : _CLUSTERRECOMMENDATION, '__module__' : 'alameda_api.v1alpha1.datahub.recommendations.recommendations_pb2' # @@protoc_insertion_point(class_scope:containersai.alameda.v1alpha1.datahub.recommendations.ClusterRecommendation) }) _sym_db.RegisterMessage(ClusterRecommendation) WriteRecommendation = _reflection.GeneratedProtocolMessageType('WriteRecommendation', (_message.Message,), { 'DESCRIPTOR' : _WRITERECOMMENDATION, '__module__' : 'alameda_api.v1alpha1.datahub.recommendations.recommendations_pb2' # @@protoc_insertion_point(class_scope:containersai.alameda.v1alpha1.datahub.recommendations.WriteRecommendation) }) _sym_db.RegisterMessage(WriteRecommendation) DESCRIPTOR._options = None # @@protoc_insertion_point(module_scope)
63.557143
5,593
0.81454
4,752
40,041
6.491162
0.054082
0.034753
0.068469
0.104714
0.835538
0.812812
0.795111
0.780879
0.709427
0.700447
0
0.039945
0.085937
40,041
629
5,594
63.658188
0.802842
0.028471
0
0.662651
1
0.001721
0.323913
0.289814
0
0
0
0
0
1
0
false
0
0.022375
0
0.022375
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
72dc317a3aeadc0ea5274238f1d61855344e5c23
65,531
py
Python
tests/adapters/switches/remote_test.py
FrancoisLopez/netman
a40d3235f7ea0cdaf52daab97b0d5ad20857b00e
[ "Apache-2.0" ]
null
null
null
tests/adapters/switches/remote_test.py
FrancoisLopez/netman
a40d3235f7ea0cdaf52daab97b0d5ad20857b00e
[ "Apache-2.0" ]
null
null
null
tests/adapters/switches/remote_test.py
FrancoisLopez/netman
a40d3235f7ea0cdaf52daab97b0d5ad20857b00e
[ "Apache-2.0" ]
null
null
null
# Copyright 2015 Internap. # # 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 json import unittest from hamcrest import assert_that, equal_to, is_, instance_of import mock from ncclient.operations import RPCError from netaddr import IPAddress, IPNetwork from flexmock import flexmock, flexmock_teardown from netman.core.objects.interface_states import OFF, ON from tests import ExactIpNetwork, ignore_deprecation_warnings from tests.api import open_fixture from netman.adapters.switches.remote import RemoteSwitch, factory from netman.core.objects.access_groups import IN, OUT from netman.core.objects.exceptions import UnknownBond, VlanAlreadyExist, BadBondLinkSpeed, LockedSwitch, \ NetmanException, UnknownInterface, UnknownSession, UnknownVlan, BadMplsIpState from netman.core.objects.port_modes import ACCESS, TRUNK, DYNAMIC from netman.core.objects.switch_descriptor import SwitchDescriptor class AnException(Exception): pass @ignore_deprecation_warnings def test_factory(): switch = factory(SwitchDescriptor(hostname='hostname', model='juniper', username='username', password='password', port=22)) assert_that(switch, instance_of(RemoteSwitch)) assert_that(switch.switch_descriptor.hostname, equal_to("hostname")) assert_that(switch.switch_descriptor.model, equal_to("juniper")) assert_that(switch.switch_descriptor.username, equal_to("username")) assert_that(switch.switch_descriptor.password, equal_to("password")) assert_that(switch.switch_descriptor.port, equal_to(22)) class RemoteSwitchTest(unittest.TestCase): netman_url = 'http://netman.example.org:1234' def setUp(self): self.switch = RemoteSwitch(SwitchDescriptor( model="juniper", hostname="toto", username="tutu", password="titi", port=1234, netman_server=self.netman_url)) self.requests_mock = flexmock() self.switch.requests = self.requests_mock self.headers = { 'Netman-Port': "1234", 'Netman-Model': 'juniper', 'Netman-Password': 'titi', 'Netman-Username': 'tutu', 'Netman-Max-Version': "2", 'Netman-Verbose-Errors': 'yes', } def tearDown(self): flexmock_teardown() def test_switch_has_a_logger_configured_with_the_switch_name(self): assert_that(self.switch.logger.name, is_(RemoteSwitch.__module__ + ".toto")) @mock.patch('uuid.uuid4') def test_start_then_commit_returns_to_normal_behavior(self, m_uuid): m_uuid.return_value = '0123456789' self.headers['Netman-Session-Id'] = '0123456789' self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers=self.headers, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({'session_id': '0123456789'}), status_code=201)) self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789/actions', data='start_transaction', headers={'Netman-Verbose-Errors': "yes", 'Netman-Max-Version': "2", 'Netman-Session-Id': '0123456789'} ).and_return( Reply( content="", status_code=204)) self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789/actions', data='commit', headers={'Netman-Verbose-Errors': "yes", 'Netman-Max-Version': "2", 'Netman-Session-Id': '0123456789'} ).and_return( Reply( content="", status_code=204)) self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789/actions', data='end_transaction', headers={'Netman-Verbose-Errors': "yes", 'Netman-Max-Version': "2", 'Netman-Session-Id': '0123456789'} ).and_return( Reply( content="", status_code=204)) self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers={'Netman-Verbose-Errors': "yes", 'Netman-Max-Version': "2", 'Netman-Session-Id': '0123456789'} ).and_return( Reply( content="", status_code=204)) self.switch.connect() self.switch.start_transaction() self.switch.commit_transaction() self.switch.end_transaction() self.switch.disconnect() self.setUp() self.test_add_bond() @mock.patch('uuid.uuid4') def test_connect_fails_to_obtain_a_session(self, m_uuid): m_uuid.return_value = '0123456789' self.headers['Netman-Session-Id'] = '0123456789' self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers=self.headers, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({ "error": "", "error-module": AnException.__module__, "error-class": AnException.__name__ }), status_code=500)) with self.assertRaises(AnException): self.switch.connect() @mock.patch('uuid.uuid4') def test_disconnect_fails_and_return_to_normal_behavior(self, m_uuid): m_uuid.return_value = '0123456789' self.headers['Netman-Session-Id'] = '0123456789' self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers=self.headers, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({'session_id': '0123456789'}), status_code=201)) self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers={'Netman-Verbose-Errors': "yes", 'Netman-Max-Version': "2", 'Netman-Session-Id': '0123456789'} ).and_return( Reply( content=json.dumps({ "error": "", "error-module": AnException.__module__, "error-class": AnException.__name__ }), status_code=500)) self.switch.connect() with self.assertRaises(AnException): self.switch.disconnect() self.setUp() self.test_add_bond() @mock.patch('uuid.uuid4') def test_session_is_used_when_we_are_in_a_session(self, m_uuid): m_uuid.return_value = '0123456789' self.headers['Netman-Session-Id'] = '0123456789' self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers=self.headers, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({'session_id': '0123456789'}), status_code=201)) self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789/bonds', headers=self.headers, data=JsonData(number=6) ).and_return( Reply( content='', status_code=201)) self.switch.connect() self.switch.add_bond(6) @mock.patch('uuid.uuid4') def test_commit_transaction_fails_to_commit(self, m_uuid): m_uuid.return_value = '0123456789' self.headers['Netman-Session-Id'] = '0123456789' self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers=self.headers, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({'session_id': '0123456789'}), status_code=201)) self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789/actions', data='commit', headers={'Netman-Verbose-Errors': "yes", 'Netman-Max-Version': "2", 'Netman-Session-Id': '0123456789'} ).and_return( Reply( content=json.dumps({ "error": "", "error-module": AnException.__module__, "error-class": AnException.__name__ }), status_code=500)) self.switch.connect() with self.assertRaises(AnException): self.switch.commit_transaction() @mock.patch('uuid.uuid4') def test_rollback_transaction_fails_to_rollback(self, m_uuid): m_uuid.return_value = '0123456789' self.headers['Netman-Session-Id'] = '0123456789' self.requests_mock.should_receive("post").once().ordered().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers=self.headers, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({'session_id': '0123456789'}), status_code=201)) self.requests_mock.should_receive("post").once().ordered().with_args( url=self.netman_url+'/switches-sessions/0123456789/actions', data='rollback', headers={'Netman-Verbose-Errors': "yes", 'Netman-Max-Version': "2", 'Netman-Session-Id': '0123456789'} ).and_return( Reply( content=json.dumps({ "error": "", "error-module": AnException.__module__, "error-class": AnException.__name__ }), status_code=500)) self.switch.connect() with self.assertRaises(AnException): self.switch.rollback_transaction() @mock.patch('uuid.uuid4') def test_receiving_unknown_session_during_transaction_will_connect_again(self, m_uuid): m_uuid.return_value = '0123456789' first_connect_headers = self.headers.copy() first_connect_headers['Netman-Session-Id'] = '0123456789' self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers=first_connect_headers, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({'session_id': '0123456789'}), status_code=201)) self.switch.connect() self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789/bonds', headers=first_connect_headers, data=JsonData(number=6) ).and_return( Reply( content=json.dumps({ "error": "", "error-module": UnknownSession.__module__, "error-class": UnknownSession.__name__ }), status_code=500)) m_uuid.return_value = 'new-session-id' second_connect_headers = self.headers.copy() second_connect_headers['Netman-Session-Id'] = 'new-session-id' self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/new-session-id', headers=second_connect_headers, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({'session_id': 'new-session-id'}), status_code=201)) self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/new-session-id/bonds', headers=second_connect_headers, data=JsonData(number=6) ).and_return( Reply( content='', status_code=201)) self.switch.add_bond(6) @mock.patch('uuid.uuid4') def test_receiving_unknown_session_twice_during_transaction_will_raise_an_exception(self, m_uuid): m_uuid.return_value = '0123456789' first_connect_headers = self.headers.copy() first_connect_headers['Netman-Session-Id'] = '0123456789' self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers=first_connect_headers, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({'session_id': '0123456789'}), status_code=201)) self.switch.connect() self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/0123456789/bonds', headers=first_connect_headers, data=JsonData(number=6) ).and_return( Reply( content=json.dumps({ "error": "", "error-module": UnknownSession.__module__, "error-class": UnknownSession.__name__ }), status_code=500)) m_uuid.return_value = 'new-session-id' second_connect_headers = self.headers.copy() second_connect_headers['Netman-Session-Id'] = 'new-session-id' self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/new-session-id', headers=second_connect_headers, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({'session_id': 'new-session-id'}), status_code=201)) self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches-sessions/new-session-id/bonds', headers=second_connect_headers, data=JsonData(number=6) ).and_return( Reply( content=json.dumps({ "error": "", "error-module": UnknownSession.__module__, "error-class": UnknownSession.__name__ }), status_code=500)) with self.assertRaises(UnknownSession): self.switch.add_bond(6) @mock.patch('uuid.uuid4') def test_multi_proxy_1(self, m_uuid): self.switch = RemoteSwitch(SwitchDescriptor( model="juniper", hostname="toto", username="tutu", password="titi", port=1234, netman_server=[self.netman_url, "1.2.3.4"])) self.requests_mock = flexmock() self.switch.requests = self.requests_mock m_uuid.return_value = '0123456789' self.requests_mock.should_receive("post").once().ordered().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers={ 'Netman-Port': "1234", 'Netman-Model': 'juniper', 'Netman-Password': 'titi', 'Netman-Username': 'tutu', 'Netman-Verbose-Errors': 'yes', 'Netman-Proxy-Server': '1.2.3.4', 'Netman-Max-Version': "2", 'Netman-Session-Id': '0123456789' }, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({'session_id': '0123456789'}), status_code=201)) self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers={'Netman-Verbose-Errors': "yes", 'Netman-Max-Version': "2", 'Netman-Session-Id': '0123456789'} ).and_return( Reply( content="", status_code=204)) self.switch.connect() self.switch.disconnect() self.setUp() self.test_add_bond() @mock.patch('uuid.uuid4') def test_multi_proxy_few(self, m_uuid): self.switch = RemoteSwitch(SwitchDescriptor( model="juniper", hostname="toto", username="tutu", password="titi", port=1234, netman_server=[self.netman_url, "1.2.3.4", "5.6.7.8"])) self.requests_mock = flexmock() self.switch.requests = self.requests_mock m_uuid.return_value = '0123456789' self.requests_mock.should_receive("post").once().ordered().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers={ 'Netman-Port': "1234", 'Netman-Model': 'juniper', 'Netman-Password': 'titi', 'Netman-Username': 'tutu', 'Netman-Verbose-Errors': 'yes', 'Netman-Proxy-Server': '1.2.3.4,5.6.7.8', 'Netman-Max-Version': "2", 'Netman-Session-Id': '0123456789' }, data=JsonData(hostname="toto") ).and_return( Reply( content=json.dumps({'session_id': '0123456789'}), status_code=201)) self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches-sessions/0123456789', headers={'Netman-Verbose-Errors': "yes", 'Netman-Max-Version': "2", 'Netman-Session-Id': '0123456789'} ).and_return( Reply( content="", status_code=204)) self.switch.connect() self.switch.disconnect() self.setUp() self.test_add_bond() def test_get_vlan(self): self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/vlans/1', headers=self.headers ).and_return( Reply( content=open_fixture('get_switch_hostname_vlans_vlan.json').read(), status_code=200)) vlan1 = self.switch.get_vlan(1) assert_that(vlan1.number, is_(1)) assert_that(vlan1.name, is_('One')) assert_that(vlan1.ips, is_([ExactIpNetwork('1.1.1.1', 24)])) assert_that(vlan1.vrf_forwarding, is_("MY_VRF")) assert_that(vlan1.access_groups[IN], is_("Blah_blah")) assert_that(vlan1.access_groups[OUT], is_(None)) assert_that(vlan1.dhcp_relay_servers, is_([])) vrrp_group = vlan1.vrrp_groups[0] assert_that(vrrp_group.id, is_(1)) assert_that(vrrp_group.ips, is_([IPAddress("1.1.1.2")])) assert_that(vrrp_group.priority, is_(90)) assert_that(vrrp_group.hello_interval, is_(5)) assert_that(vrrp_group.dead_interval, is_(15)) assert_that(vrrp_group.track_id, is_("101")) assert_that(vrrp_group.track_decrement, is_(50)) assert_that(vlan1.varp_ips, is_([])) def test_get_vlans(self): self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/vlans', headers=self.headers ).and_return( Reply( content=open_fixture('get_switch_hostname_vlans.json').read(), status_code=200)) vlan1, vlan2 = self.switch.get_vlans() assert_that(vlan1.number, is_(1)) assert_that(vlan1.name, is_('One')) assert_that(vlan1.ips, is_([ExactIpNetwork('1.1.1.1', 24)])) assert_that(vlan1.vrf_forwarding, is_("MY_VRF")) assert_that(vlan1.access_groups[IN], is_("Blah_blah")) assert_that(vlan1.access_groups[OUT], is_(None)) assert_that(vlan1.dhcp_relay_servers, is_([])) vrrp_group = vlan1.vrrp_groups[0] assert_that(vrrp_group.id, is_(1)) assert_that(vrrp_group.ips, is_([IPAddress("1.1.1.2")])) assert_that(vrrp_group.priority, is_(90)) assert_that(vrrp_group.hello_interval, is_(5)) assert_that(vrrp_group.dead_interval, is_(15)) assert_that(vrrp_group.track_id, is_("101")) assert_that(vrrp_group.track_decrement, is_(50)) assert_that(vlan1.varp_ips, is_([IPNetwork('3.3.3.3/24')])) assert_that(vlan2.number, is_(2)) assert_that(vlan2.name, is_('')) assert_that(vlan2.ips, is_([ExactIpNetwork('2.2.2.2', 24), ExactIpNetwork('3.3.3.3', 24)])) assert_that(vlan2.vrf_forwarding, is_(None)) assert_that(vlan2.access_groups[IN], is_(None)) assert_that(vlan2.access_groups[OUT], is_(None)) assert_that(vlan2.dhcp_relay_servers, is_([IPAddress("10.10.10.1")])) vrrp_group1, vrrp_group2 = vlan2.vrrp_groups assert_that(vrrp_group1.id, is_(1)) assert_that(vrrp_group1.ips, is_([IPAddress("2.2.2.2")])) assert_that(vrrp_group1.priority, is_(100)) assert_that(vrrp_group1.hello_interval, is_(None)) assert_that(vrrp_group1.dead_interval, is_(None)) assert_that(vrrp_group1.track_id, is_(None)) assert_that(vrrp_group1.track_decrement, is_(None)) assert_that(vrrp_group2.id, is_(2)) assert_that(vrrp_group2.ips, is_([IPAddress("3.3.3.1")])) assert_that(vrrp_group2.priority, is_(100)) assert_that(vlan2.varp_ips, is_([IPNetwork('4.4.4.4/24'), IPNetwork('5.5.5.5/24')])) def test_get_vlan_interfaces(self): self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/vlans/1/interfaces', headers=self.headers ).and_return( Reply( content=open_fixture('get_switch_hostname_vlans_vlan_interfaces.json').read(), status_code=200) ) interfaces = self.switch.get_vlan_interfaces(1) assert_that(interfaces, is_(["ethernet 1/4", "FastEthernet0/3", "GigabitEthernet0/8"])) def test_get_vlan_interfaces_with_no_vlan_raises(self): self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/vlans/4000/interfaces', headers=self.headers ).and_return( Reply( content=json.dumps({ "error": "Vlan 4000 not found", "error-module": UnknownVlan.__module__, "error-class": UnknownVlan.__name__ }), status_code=404)) with self.assertRaises(UnknownVlan) as expect: self.switch.get_vlan_interfaces('4000') assert_that(str(expect.exception), equal_to("Vlan 4000 not found")) def test_get_interface(self): self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ethernet 1/4', headers=self.headers ).and_return( Reply( content=open_fixture('get_switch_hostname_interface.json').read(), status_code=200)) interface = self.switch.get_interface('ethernet 1/4') assert_that(interface.name, equal_to("ethernet 1/4")) assert_that(interface.shutdown, equal_to(False)) assert_that(interface.port_mode, equal_to(TRUNK)) assert_that(interface.access_vlan, equal_to(None)) assert_that(interface.trunk_native_vlan, equal_to(2999)) assert_that(interface.trunk_vlans, equal_to([3000, 3001, 3002])) def test_get_nonexistent_interface_raises(self): self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ethernet 1/INEXISTENT', headers=self.headers ).and_return( Reply( content=json.dumps({ "error": "Interface ethernet 1/INEXISTENT not found", "error-module": UnknownInterface.__module__, "error-class": UnknownInterface.__name__ }), status_code=404)) with self.assertRaises(UnknownInterface) as expect: self.switch.get_interface('ethernet 1/INEXISTENT') assert_that(str(expect.exception), equal_to("Interface ethernet 1/INEXISTENT not found")) def test_get_interfaces(self): self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/interfaces', headers=self.headers ).and_return( Reply( content=open_fixture('get_switch_hostname_interfaces.json').read(), status_code=200)) if1, if2, if3, if4 = self.switch.get_interfaces() assert_that(if1.name, equal_to("ethernet 1/4")) assert_that(if1.shutdown, equal_to(False)) assert_that(if1.port_mode, equal_to(TRUNK)) assert_that(if1.access_vlan, equal_to(None)) assert_that(if1.trunk_native_vlan, equal_to(2999)) assert_that(if1.trunk_vlans, equal_to([3000, 3001, 3002])) assert_that(if2.name, equal_to("FastEthernet0/3")) assert_that(if2.shutdown, equal_to(True)) assert_that(if2.port_mode, equal_to(ACCESS)) assert_that(if2.access_vlan, equal_to(1999)) assert_that(if2.trunk_native_vlan, equal_to(None)) assert_that(if2.trunk_vlans, equal_to([])) assert_that(if3.name, equal_to("GigabitEthernet0/6")) assert_that(if3.port_mode, equal_to(DYNAMIC)) assert_that(if3.access_vlan, equal_to(1999)) assert_that(if3.trunk_native_vlan, equal_to(2999)) assert_that(if3.trunk_vlans, equal_to([3000, 3001, 3002])) assert_that(if4.name, equal_to("GigabitEthernet0/8")) assert_that(if4.shutdown, equal_to(False)) assert_that(if4.bond_master, equal_to(12)) @ignore_deprecation_warnings def test_get_bond_v1(self): self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/bonds/3', headers=self.headers ).and_return( Reply( content=open_fixture('get_switch_hostname_bond_v1.json').read(), status_code=200)) if1 = self.switch.get_bond(3) assert_that(if1.number, equal_to(3)) assert_that(if1.link_speed, equal_to('1g')) assert_that(if1.interface.name, equal_to(None)) assert_that(if1.interface.shutdown, equal_to(True)) assert_that(if1.interface.port_mode, equal_to(ACCESS)) assert_that(if1.interface.access_vlan, equal_to(1999)) assert_that(if1.interface.trunk_native_vlan, equal_to(None)) assert_that(if1.interface.trunk_vlans, equal_to([])) assert_that(if1.members, equal_to([])) def test_get_bond_v2(self): self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/bonds/3', headers=self.headers ).and_return( Reply( headers={'Netman-Version': '2'}, content=open_fixture('get_switch_hostname_bond_v2.json').read(), status_code=200)) if1 = self.switch.get_bond(3) assert_that(if1.number, equal_to(3)) assert_that(if1.link_speed, equal_to('1g')) assert_that(if1.shutdown, equal_to(True)) assert_that(if1.port_mode, equal_to(ACCESS)) assert_that(if1.access_vlan, equal_to(1999)) assert_that(if1.trunk_native_vlan, equal_to(None)) assert_that(if1.trunk_vlans, equal_to([])) assert_that(if1.members, equal_to([])) def test_get_bonds_v1(self): self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/bonds', headers=self.headers ).and_return( Reply( content=open_fixture('get_switch_hostname_bonds_v1.json').read(), status_code=200)) if1, if2, if3 = self.switch.get_bonds() assert_that(if1.number, equal_to(3)) assert_that(if1.link_speed, equal_to('1g')) assert_that(if1.interface.name, equal_to(None)) assert_that(if1.interface.shutdown, equal_to(True)) assert_that(if1.interface.port_mode, equal_to(ACCESS)) assert_that(if1.interface.access_vlan, equal_to(1999)) assert_that(if1.interface.trunk_native_vlan, equal_to(None)) assert_that(if1.interface.trunk_vlans, equal_to([])) assert_that(if1.members, equal_to([])) assert_that(if2.number, equal_to(4)) assert_that(if2.members, equal_to(["ge-0/0/1", "ge-1/0/1"])) assert_that(if2.interface.name, equal_to(None)) assert_that(if2.interface.shutdown, equal_to(False)) assert_that(if2.interface.port_mode, equal_to(TRUNK)) assert_that(if2.interface.access_vlan, equal_to(None)) assert_that(if2.interface.trunk_native_vlan, equal_to(2999)) assert_that(if2.interface.trunk_vlans, equal_to([3000, 3001, 3002])) assert_that(if3.number, equal_to(6)) assert_that(if3.link_speed, equal_to('10g')) assert_that(if3.interface.name, equal_to(None)) assert_that(if3.interface.shutdown, equal_to(False)) assert_that(if3.interface.port_mode, equal_to(DYNAMIC)) assert_that(if3.interface.access_vlan, equal_to(1999)) assert_that(if3.interface.trunk_native_vlan, equal_to(2999)) assert_that(if3.interface.trunk_vlans, equal_to([3000, 3001, 3002])) assert_that(if3.members, equal_to([])) def test_get_bonds_v2(self): self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/bonds', headers=self.headers ).and_return( Reply( headers={'Netman-Version': '2'}, content=open_fixture('get_switch_hostname_bonds_v2.json').read(), status_code=200)) if1, if2, if3 = self.switch.get_bonds() assert_that(if1.number, equal_to(3)) assert_that(if1.link_speed, equal_to('1g')) assert_that(if1.shutdown, equal_to(True)) assert_that(if1.port_mode, equal_to(ACCESS)) assert_that(if1.access_vlan, equal_to(1999)) assert_that(if1.trunk_native_vlan, equal_to(None)) assert_that(if1.trunk_vlans, equal_to([])) assert_that(if1.members, equal_to([])) assert_that(if2.number, equal_to(4)) assert_that(if2.members, equal_to(["ge-0/0/1", "ge-1/0/1"])) assert_that(if2.shutdown, equal_to(False)) assert_that(if2.port_mode, equal_to(TRUNK)) assert_that(if2.access_vlan, equal_to(None)) assert_that(if2.trunk_native_vlan, equal_to(2999)) assert_that(if2.trunk_vlans, equal_to([3000, 3001, 3002])) assert_that(if2.members, equal_to(['ge-0/0/1', 'ge-1/0/1'])) assert_that(if3.number, equal_to(6)) assert_that(if3.link_speed, equal_to('10g')) assert_that(if3.shutdown, equal_to(False)) assert_that(if3.port_mode, equal_to(DYNAMIC)) assert_that(if3.access_vlan, equal_to(1999)) assert_that(if3.trunk_native_vlan, equal_to(2999)) assert_that(if3.trunk_vlans, equal_to([3000, 3001, 3002])) assert_that(if3.members, equal_to([])) def test_add_vlan(self): self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches/toto/vlans', headers=self.headers, data=JsonData(number=2000, name="deux-milles") ).and_return( Reply( content='', status_code=201)) self.switch.add_vlan(2000, name="deux-milles") def test_add_vlan_without_a_name(self): self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches/toto/vlans', headers=self.headers, data=JsonData(number=2000) ).and_return( Reply( content='', status_code=201)) self.switch.add_vlan(2000) def test_add_vlan_already_exist(self): self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches/toto/vlans', headers=self.headers, data=JsonData(number=2000, name="deux-milles") ).and_return( Reply( content=json.dumps({ "error": "Vlan 2000 already exists", "error-module": VlanAlreadyExist.__module__, "error-class": VlanAlreadyExist.__name__ }), status_code=409)) with self.assertRaises(VlanAlreadyExist) as expect: self.switch.add_vlan(2000, name="deux-milles") assert_that(str(expect.exception), equal_to("Vlan 2000 already exists")) def test_remove_vlan(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/vlans/2000', headers=self.headers, ).and_return( Reply( content='', status_code=204)) self.switch.remove_vlan(2000) def test_put_access_groups_in(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/vlans/2500/access-groups/in', headers=self.headers, data='spaceless-string' ).and_return( Reply( content='', status_code=204)) self.switch.set_vlan_access_group(2500, IN, "spaceless-string") def test_put_access_groups_out(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/vlans/2500/access-groups/out', headers=self.headers, data='spaceless-string' ).and_return( Reply( content='', status_code=204)) self.switch.set_vlan_access_group(2500, OUT, "spaceless-string") def test_remove_access_groups_in(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/vlans/2500/access-groups/in', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.unset_vlan_access_group(2500, IN) def test_remove_access_groups_out(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/vlans/2500/access-groups/out', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.unset_vlan_access_group(2500, OUT) def test_add_ip_to_vlan(self): self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches/toto/vlans/2500/ips', headers=self.headers, data="1.2.3.4/25" ).and_return( Reply( content='', status_code=201)) self.switch.add_ip_to_vlan(2500, ExactIpNetwork("1.2.3.4", 25)) def test_remove_ip(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/vlans/2500/ips/1.2.3.4/25', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.remove_ip_from_vlan(2500, ExactIpNetwork("1.2.3.4", 25)) def test_set_vlan_vrf(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/vlans/2500/vrf-forwarding', headers=self.headers, data="DEFAULT_LAN" ).and_return( Reply( content='', status_code=204)) self.switch.set_vlan_vrf(2500, "DEFAULT_LAN") def test_unset_vlan_vrf(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/vlans/2500/vrf-forwarding', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.unset_vlan_vrf(2500) def test_port_mode_access(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/port-mode', headers=self.headers, data='access' ).and_return( Reply( content='', status_code=204)) self.switch.set_access_mode("ge-0/0/6") def test_port_mode_trunk(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/port-mode', headers=self.headers, data='trunk' ).and_return( Reply( content='', status_code=204)) self.switch.set_trunk_mode("ge-0/0/6") def test_bond_port_mode_access(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/bonds/123/port-mode', headers=self.headers, data='access' ).and_return( Reply( content='', status_code=204)) self.switch.set_bond_access_mode(123) def test_bond_port_mode_trunk(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/bonds/123/port-mode', headers=self.headers, data='trunk' ).and_return( Reply( content='', status_code=204)) self.switch.set_bond_trunk_mode(123) def test_set_access_vlan(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/access-vlan', headers=self.headers, data='1000' ).and_return( Reply( content='', status_code=204)) self.switch.set_access_vlan("ge-0/0/6", 1000) def test_reset_interface(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6', headers=self.headers, data=None ).and_return( Reply( content='', status_code=204)) self.switch.reset_interface("ge-0/0/6") def test_reset_interface_with_unknown_interface_raises(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ne-0/0/66', headers=self.headers, data=None ).and_return( Reply( content=json.dumps({ "error": "Interface ethernet ne-0/0/66 not found", "error-module": UnknownInterface.__module__, "error-class": UnknownInterface.__name__ }), status_code=404)) with self.assertRaises(UnknownInterface): self.switch.reset_interface('ne-0/0/66') def test_unset_interface_access_vlan(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/access-vlan', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.unset_interface_access_vlan("ge-0/0/6") def test_set_interface_native_vlan(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/trunk-native-vlan', headers=self.headers, data='1000' ).and_return( Reply( content='', status_code=204)) self.switch.set_interface_native_vlan("ge-0/0/6", 1000) def test_unset_interface_native_vlan(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/trunk-native-vlan', headers=self.headers, ).and_return( Reply( content='', status_code=204)) self.switch.unset_interface_native_vlan("ge-0/0/6") def test_set_bond_native_vlan(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/bonds/123/trunk-native-vlan', headers=self.headers, data='1000' ).and_return( Reply( content='', status_code=204)) self.switch.set_bond_native_vlan(123, 1000) def test_unset_bond_native_vlan(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/bonds/123/trunk-native-vlan', headers=self.headers, ).and_return( Reply( content='', status_code=204)) self.switch.unset_bond_native_vlan(123) def test_add_trunk_vlan(self): self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/trunk-vlans', headers=self.headers, data='1000' ).and_return( Reply( content='', status_code=204)) self.switch.add_trunk_vlan("ge-0/0/6", 1000) def test_remove_trunk_vlan(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/trunk-vlans/1000', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.remove_trunk_vlan("ge-0/0/6", 1000) def test_add_bond_trunk_vlan(self): self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches/toto/bonds/123/trunk-vlans', headers=self.headers, data='1000' ).and_return( Reply( content='', status_code=204)) self.switch.add_bond_trunk_vlan(123, 1000) def test_remove_bond_trunk_vlan(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/bonds/123/trunk-vlans/1000', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.remove_bond_trunk_vlan(123, 1000) def test_set_interface_description(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/description', headers=self.headers, data='Resistance is futile' ).and_return( Reply( content='', status_code=204)) self.switch.set_interface_description("ge-0/0/6", "Resistance is futile") def test_unset_interface_description(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/description', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.unset_interface_description("ge-0/0/6") def test_set_bond_description(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/bonds/123/description', headers=self.headers, data='Resistance is futile' ).and_return( Reply( content='', status_code=204)) self.switch.set_bond_description(123, "Resistance is futile") def test_unset_bond_description(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/bonds/123/description', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.unset_bond_description(123) def test_set_interface_mtu(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/mtu', headers=self.headers, data='5000' ).and_return( Reply( content='', status_code=204)) self.switch.set_interface_mtu("ge-0/0/6", 5000) def test_unset_interface_mtu(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/mtu', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.unset_interface_mtu("ge-0/0/6") def test_set_bond_mtu(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/bonds/123/mtu', headers=self.headers, data='5000' ).and_return( Reply( content='', status_code=204)) self.switch.set_bond_mtu(123, 5000) def test_unset_bond_mtu(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/bonds/123/mtu', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.unset_bond_mtu(123) def test_edit_interface_spanning_tree_succeeds(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/spanning-tree', headers=self.headers, data=json.dumps({"edge": True}) ).and_return( Reply( content='', status_code=204)) self.switch.edit_interface_spanning_tree("ge-0/0/6", edge=True) def test_edit_interface_spanning_tree_optional_params(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/spanning-tree', headers=self.headers, data=json.dumps({}) ).and_return( Reply( content='', status_code=204)) self.switch.edit_interface_spanning_tree("ge-0/0/6") def test_enable_interface(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/shutdown', headers=self.headers, data='false' ).and_return( Reply( content='', status_code=204)) self.switch.set_interface_state("ge-0/0/6", ON) def test_disable_interface(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/shutdown', headers=self.headers, data='true' ).and_return( Reply( content='', status_code=204)) self.switch.set_interface_state("ge-0/0/6", OFF) def test_unset_interface_state(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/shutdown', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.unset_interface_state("ge-0/0/6") def test_enable_interface_auto_negotiation(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/auto-negotiation', headers=self.headers, data='true' ).and_return( Reply( content='', status_code=204)) self.switch.set_interface_auto_negotiation_state("ge-0/0/6", ON) def test_disable_interface_auto_negotiation(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/auto-negotiation', headers=self.headers, data='false' ).and_return( Reply( content='', status_code=204)) self.switch.set_interface_auto_negotiation_state("ge-0/0/6", OFF) def test_unset_interface_auto_negotiation_state(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/auto-negotiation', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.unset_interface_auto_negotiation_state("ge-0/0/6") def test_add_bond(self): self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches/toto/bonds', headers=self.headers, data=JsonData(number=6) ).and_return( Reply( content='', status_code=201)) self.switch.add_bond(6) def test_remove(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/bonds/6', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.remove_bond(6) def test_add_interface_to_bond(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/bond-master', headers=self.headers, data='10' ).and_return( Reply( content='', status_code=204)) self.switch.add_interface_to_bond('ge-0/0/6', 10) def test_remove_interface_from_bond(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/bond-master', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.remove_interface_from_bond('ge-0/0/6') def test_edit_bond_spanning_tree(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/bonds/5/spanning-tree', headers=self.headers, data=json.dumps({"edge": True}) ).and_return( Reply( content='', status_code=204)) self.switch.edit_bond_spanning_tree(5, edge=True) def edit_bond_spanning_tree_optional_params(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/bonds/5/spanning-tree', headers=self.headers, data=json.dumps({}) ).and_return( Reply( content='', status_code=204)) self.switch.edit_bond_spanning_tree(5) def test_change_bond_speed(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/bonds/10/link-speed', headers=self.headers, data='1g' ).and_return( Reply( content='', status_code=204)) self.switch.set_bond_link_speed(10, '1g') def test_change_bond_speed_missing_bond(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/bonds/10/link-speed', headers=self.headers, data='1g' ).and_return( Reply( content=json.dumps({ "error": "Bond 10 not found", "error-module": UnknownBond.__module__, "error-class": UnknownBond.__name__ }), status_code=404)) with self.assertRaises(UnknownBond) as expect: self.switch.set_bond_link_speed(10, '1g') assert_that(str(expect.exception), equal_to("Bond 10 not found")) def test_change_bond_speed_wrong_value(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/bonds/10/link-speed', headers=self.headers, data='1z' ).and_return( Reply( content=json.dumps({ "error": "Malformed bond link speed", "error-module": BadBondLinkSpeed.__module__, "error-class": BadBondLinkSpeed.__name__ }), status_code=400)) with self.assertRaises(BadBondLinkSpeed) as expect: self.switch.set_bond_link_speed(10, '1z') assert_that(str(expect.exception), equal_to("Malformed bond link speed")) def test_change_bond_speed_switch_locked(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/bonds/10/link-speed', headers=self.headers, data='1z' ).and_return( Reply( content=json.dumps({ "error": "Switch is locked and can't be modified", "error-module": LockedSwitch.__module__, "error-class": LockedSwitch.__name__ }), status_code=423)) with self.assertRaises(LockedSwitch) as expect: self.switch.set_bond_link_speed(10, '1z') assert_that(str(expect.exception), equal_to("Switch is locked and can't be modified")) def test_add_vrrp_group(self): self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches/toto/vlans/2000/vrrp-groups', headers=self.headers, data=JsonData(id=1, priority=2, ips=['1.2.3.4'], hello_interval=5, dead_interval=15, track_id="101", track_decrement=50) ).and_return( Reply( content='', status_code=201)) self.switch.add_vrrp_group(2000, group_id=1, priority=2, ips=[IPAddress('1.2.3.4')], hello_interval=5, dead_interval=15, track_id='101', track_decrement=50) def test_remove_vrrp_group(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/vlans/2000/vrrp-groups/123', headers=self.headers ).and_return( Reply( content='', status_code=201)) self.switch.remove_vrrp_group(2000, group_id=123) def test_add_dhcp_relay_server(self): self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches/toto/vlans/2000/dhcp-relay-server', headers=self.headers, data='1.2.3.4' ).and_return( Reply( content='', status_code=201)) self.switch.add_dhcp_relay_server(2000, '1.2.3.4') def test_remove_dhcp_relay_server(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/vlans/2000/dhcp-relay-server/1.2.3.4', headers=self.headers ).and_return( Reply( content='', status_code=201)) self.switch.remove_dhcp_relay_server(2000, '1.2.3.4') def test_add_varp_ip(self): self.requests_mock.should_receive("post").once().with_args( url=self.netman_url+'/switches/toto/vlans/2000/varp-ips', headers=self.headers, data='1.2.3.4/29' ).and_return( Reply( content='', status_code=201)) self.switch.add_vlan_varp_ip(2000, IPNetwork('1.2.3.4/29')) def test_remove_varp_ip(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url+'/switches/toto/vlans/2000/varp-ips/1.2.3.4/29', headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.remove_vlan_varp_ip(2000, IPNetwork('1.2.3.4/29')) def test_set_interface_lldp_state(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/lldp', headers=self.headers, data='true' ).and_return( Reply( content='', status_code=204)) self.switch.set_interface_lldp_state("ge-0/0/6", True) def test_disable_lldp(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/interfaces/ge-0/0/6/lldp', headers=self.headers, data='false' ).and_return( Reply( content='', status_code=204)) self.switch.set_interface_lldp_state("ge-0/0/6", False) def test_set_vlan_icmp_redirects_state_False_should_send_false(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/vlans/2000/icmp-redirects', headers=self.headers, data='false' ).and_return( Reply( content='', status_code=204)) self.switch.set_vlan_icmp_redirects_state(2000, False) def test_set_vlan_icmp_redirects_state_True_should_send_true(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url+'/switches/toto/vlans/2000/icmp-redirects', headers=self.headers, data='true' ).and_return( Reply( content='', status_code=204)) self.switch.set_vlan_icmp_redirects_state(2000, True) def test_get_versions(self): data = { "v": "1.0", "units": { "1": { "v": "1.0" } } } self.requests_mock.should_receive("get").once().with_args( url=self.netman_url+'/switches/toto/versions', headers=self.headers ).and_return( Reply( content=json.dumps(data), status_code=204)) result = self.switch.get_versions() assert_that(result, is_(data)) def test_unformatted_exceptions_are_handled(self): self.requests_mock.should_receive("put").once().and_return(Reply( content='Oops an unexpected excepton occured', status_code=500 )) with self.assertRaises(Exception) as expect: self.switch.set_bond_link_speed(10, '1z') assert_that(str(expect.exception), equal_to("500: Oops an unexpected excepton occured")) def test_native_exceptions_are_handled(self): self.requests_mock.should_receive("put").once().and_return(Reply( content=json.dumps({ "error": "Oops an unexpected excepton occured", "error-class": "Exception" }), status_code=500 )) with self.assertRaises(Exception) as expect: self.switch.set_bond_link_speed(10, '1z') assert_that(str(expect.exception), equal_to("Oops an unexpected excepton occured")) def test_exceptions_missing_error_classes_work(self): self.requests_mock.should_receive("put").once().and_return(Reply( content=json.dumps({ "error": "Oops an unexpected excepton occured" }), status_code=500 )) with self.assertRaises(Exception) as expect: self.switch.set_bond_link_speed(10, '1z') assert_that(str(expect.exception), equal_to("Oops an unexpected excepton occured")) def test_exceptions_bad_init_works(self): self.requests_mock.should_receive("put").once().and_return(Reply( content=json.dumps({ "error": "Switch is locked and can't be modified", "error-module": RPCError.__module__, "error-class": RPCError.__name__ }), status_code=400 )) with self.assertRaises(NetmanException) as expect: self.switch.set_bond_link_speed(10, '1z') assert_that( str(expect.exception), equal_to("ncclient.operations.rpc.RPCError: Switch is locked and can't be modified")) def test_set_vlan_load_interval(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url + "/switches/toto/vlans/123/load-interval", headers=self.headers, data="30" ).and_return( Reply( content='', status_code=204)) self.switch.set_vlan_load_interval(123, 30) def test_unset_vlan_load_interval(self): self.requests_mock.should_receive("delete").once().with_args( url=self.netman_url + "/switches/toto/vlans/123/load-interval", headers=self.headers ).and_return( Reply( content='', status_code=204)) self.switch.unset_vlan_load_interval(123) def test_set_vlan_mpls_ip_state_true(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url + "/switches/toto/vlans/123/mpls-ip", headers=self.headers, data='true' ).and_return( Reply( content='', status_code=204)) self.switch.set_vlan_mpls_ip_state(123, True) def test_set_vlan_mpls_ip_state_false(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url + "/switches/toto/vlans/123/mpls-ip", headers=self.headers, data='false' ).and_return( Reply( content='', status_code=204)) self.switch.set_vlan_mpls_ip_state(123, False) def test_set_vlan_mpls_ip_state_invalid(self): self.requests_mock.should_receive("put").once().with_args( url=self.netman_url + "/switches/toto/vlans/123/mpls-ip", headers=self.headers, data='30' ).and_return( Reply( content=json.dumps({"error": "", "error-module": BadMplsIpState.__module__, "error-class": BadMplsIpState.__name__}), status_code=400)) with self.assertRaises(BadMplsIpState): self.switch.set_vlan_mpls_ip_state(123, 30) class Reply: def __init__(self, status_code, content, headers=None): self.status_code = status_code self.content = content self.headers = headers or {} def json(self): return json.loads(self.content) class JsonData: def __init__(self, **data): self.data = data def __eq__(self, other): try: return json.loads(other) == self.data except ValueError: return False
38.011021
127
0.590957
7,599
65,531
4.828267
0.049612
0.043881
0.051022
0.066558
0.870973
0.849032
0.833034
0.799836
0.766285
0.744208
0
0.046094
0.283255
65,531
1,723
128
38.033082
0.735059
0.008332
0
0.724638
0
0.00138
0.13723
0.065968
0
0
0
0
0.122843
1
0.071084
false
0.006211
0.010352
0.00069
0.086957
0
0
0
0
null
0
0
0
1
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
7
f42d96dc143c1156ee4b6b32a5c46df54b92f152
19,468
py
Python
netbox_onboarding/tests/test_netbox_keeper.py
fallenfuzz/ntc-netbox-plugin-onboarding
aeebc17a8e297c8f7694c59484e68ef28b464fad
[ "Apache-2.0" ]
180
2020-05-19T21:30:01.000Z
2022-03-15T15:18:27.000Z
netbox_onboarding/tests/test_netbox_keeper.py
fallenfuzz/ntc-netbox-plugin-onboarding
aeebc17a8e297c8f7694c59484e68ef28b464fad
[ "Apache-2.0" ]
85
2020-05-20T22:12:12.000Z
2022-01-17T20:52:30.000Z
netbox_onboarding/tests/test_netbox_keeper.py
isabella232/ntc-netbox-plugin-onboarding
2eca893c2e97ed40f2b2c45ef3be93c0d120b6fc
[ "Apache-2.0" ]
44
2020-05-21T00:43:17.000Z
2022-03-11T05:12:48.000Z
"""Unit tests for netbox_onboarding.onboard module and its classes. (c) 2020 Network To Code Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from django.conf import settings from django.test import TestCase from django.utils.text import slugify from dcim.models import Site, Manufacturer, DeviceType, DeviceRole, Device, Interface, Platform from ipam.models import IPAddress # from netbox_onboarding.netbox_keeper import NetdevKeeper from netbox_onboarding.exceptions import OnboardException from netbox_onboarding.netbox_keeper import NetboxKeeper PLUGIN_SETTINGS = settings.PLUGINS_CONFIG["netbox_onboarding"] class NetboxKeeperTestCase(TestCase): """Test the NetboxKeeper Class.""" def setUp(self): """Create a superuser and token for API calls.""" self.site1 = Site.objects.create(name="USWEST", slug="uswest") def test_ensure_device_manufacturer_strict_missing(self): """Verify ensure_device_manufacturer function when Manufacturer object is not present.""" PLUGIN_SETTINGS["object_match_strategy"] = "strict" onboarding_kwargs = { "netdev_hostname": "device1", "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_vendor": "Cisco", "netdev_model": "CSR1000v", "netdev_nb_site_slug": self.site1.slug, } nbk = NetboxKeeper(**onboarding_kwargs) with self.assertRaises(OnboardException) as exc_info: nbk.ensure_device_manufacturer(create_manufacturer=False) self.assertEqual(exc_info.exception.message, "ERROR manufacturer not found: Cisco") self.assertEqual(exc_info.exception.reason, "fail-config") nbk.ensure_device_manufacturer(create_manufacturer=True) self.assertIsInstance(nbk.nb_manufacturer, Manufacturer) self.assertEqual(nbk.nb_manufacturer.slug, slugify(onboarding_kwargs["netdev_vendor"])) def test_ensure_device_manufacturer_loose_missing(self): """Verify ensure_device_manufacturer function when Manufacturer object is not present.""" PLUGIN_SETTINGS["object_match_strategy"] = "loose" onboarding_kwargs = { "netdev_hostname": "device1", "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_vendor": "Cisco", "netdev_model": "CSR1000v", "netdev_nb_site_slug": self.site1.slug, } nbk = NetboxKeeper(**onboarding_kwargs) with self.assertRaises(OnboardException) as exc_info: nbk.ensure_device_manufacturer(create_manufacturer=False) self.assertEqual(exc_info.exception.message, "ERROR manufacturer not found: Cisco") self.assertEqual(exc_info.exception.reason, "fail-config") nbk.ensure_device_manufacturer(create_manufacturer=True) self.assertIsInstance(nbk.nb_manufacturer, Manufacturer) self.assertEqual(nbk.nb_manufacturer.slug, slugify(onboarding_kwargs["netdev_vendor"])) def test_ensure_device_type_strict_missing(self): """Verify ensure_device_type function when DeviceType object is not present.""" PLUGIN_SETTINGS["object_match_strategy"] = "strict" onboarding_kwargs = { "netdev_hostname": "device1", "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_vendor": "Cisco", "netdev_model": "CSR1000v", "netdev_nb_site_slug": self.site1.slug, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.nb_manufacturer = Manufacturer.objects.create(name="Cisco", slug="cisco") with self.assertRaises(OnboardException) as exc_info: nbk.ensure_device_type(create_device_type=False) self.assertEqual(exc_info.exception.message, "ERROR device type not found: CSR1000v") self.assertEqual(exc_info.exception.reason, "fail-config") nbk.ensure_device_type(create_device_type=True) self.assertIsInstance(nbk.nb_device_type, DeviceType) self.assertEqual(nbk.nb_device_type.slug, slugify(onboarding_kwargs["netdev_model"])) def test_ensure_device_type_loose_missing(self): """Verify ensure_device_type function when DeviceType object is not present.""" PLUGIN_SETTINGS["object_match_strategy"] = "loose" onboarding_kwargs = { "netdev_hostname": "device1", "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_vendor": "Cisco", "netdev_model": "CSR1000v", "netdev_nb_site_slug": self.site1.slug, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.nb_manufacturer = Manufacturer.objects.create(name="Cisco", slug="cisco") with self.assertRaises(OnboardException) as exc_info: nbk.ensure_device_type(create_device_type=False) self.assertEqual(exc_info.exception.message, "ERROR device type not found: CSR1000v") self.assertEqual(exc_info.exception.reason, "fail-config") nbk.ensure_device_type(create_device_type=True) self.assertIsInstance(nbk.nb_device_type, DeviceType) self.assertEqual(nbk.nb_device_type.slug, slugify(onboarding_kwargs["netdev_model"])) def test_ensure_device_type_strict_present(self): """Verify ensure_device_type function when DeviceType object is already present.""" PLUGIN_SETTINGS["object_match_strategy"] = "strict" manufacturer = Manufacturer.objects.create(name="Juniper", slug="juniper") device_type = DeviceType.objects.create(slug="srx3600", model="SRX3600", manufacturer=manufacturer) onboarding_kwargs = { "netdev_hostname": "device2", "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_vendor": "Juniper", "netdev_nb_device_type_slug": device_type.slug, "netdev_nb_site_slug": self.site1.slug, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.nb_manufacturer = manufacturer nbk.ensure_device_type(create_device_type=False) self.assertEqual(nbk.nb_device_type, device_type) def test_ensure_device_type_loose_present(self): """Verify ensure_device_type function when DeviceType object is already present.""" PLUGIN_SETTINGS["object_match_strategy"] = "loose" manufacturer = Manufacturer.objects.create(name="Juniper", slug="juniper") device_type = DeviceType.objects.create(slug="srx3600", model="SRX3600", manufacturer=manufacturer) onboarding_kwargs = { "netdev_hostname": "device2", "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_vendor": "Juniper", "netdev_nb_device_type_slug": device_type.slug, "netdev_nb_site_slug": self.site1.slug, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.nb_manufacturer = manufacturer nbk.ensure_device_type(create_device_type=False) self.assertEqual(nbk.nb_device_type, device_type) def test_ensure_device_role_not_exist(self): """Verify ensure_device_role function when DeviceRole does not already exist.""" test_role_name = "mytestrole" onboarding_kwargs = { "netdev_hostname": "device1", "netdev_nb_role_slug": test_role_name, "netdev_nb_role_color": PLUGIN_SETTINGS["default_device_role_color"], "netdev_vendor": "Cisco", "netdev_nb_site_slug": self.site1.slug, } nbk = NetboxKeeper(**onboarding_kwargs) with self.assertRaises(OnboardException) as exc_info: nbk.ensure_device_role(create_device_role=False) self.assertEqual(exc_info.exception.message, f"ERROR device role not found: {test_role_name}") self.assertEqual(exc_info.exception.reason, "fail-config") nbk.ensure_device_role(create_device_role=True) self.assertIsInstance(nbk.nb_device_role, DeviceRole) self.assertEqual(nbk.nb_device_role.slug, slugify(test_role_name)) def test_ensure_device_role_exist(self): """Verify ensure_device_role function when DeviceRole exist but is not assigned to the OT.""" device_role = DeviceRole.objects.create(name="Firewall", slug="firewall") onboarding_kwargs = { "netdev_hostname": "device1", "netdev_nb_role_slug": device_role.slug, "netdev_nb_role_color": PLUGIN_SETTINGS["default_device_role_color"], "netdev_vendor": "Cisco", "netdev_nb_site_slug": self.site1.slug, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.ensure_device_role(create_device_role=False) self.assertEqual(nbk.nb_device_role, device_role) # def test_ensure_device_role_assigned(self): """Verify ensure_device_role function when DeviceRole exist and is already assigned.""" device_role = DeviceRole.objects.create(name="Firewall", slug="firewall") onboarding_kwargs = { "netdev_hostname": "device1", "netdev_nb_role_slug": device_role.slug, "netdev_nb_role_color": PLUGIN_SETTINGS["default_device_role_color"], "netdev_vendor": "Cisco", "netdev_nb_site_slug": self.site1.slug, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.ensure_device_role(create_device_role=True) self.assertEqual(nbk.nb_device_role, device_role) def test_ensure_device_instance_not_exist(self): """Verify ensure_device_instance function.""" serial_number = "123456" platform_slug = "cisco_ios" hostname = "device1" onboarding_kwargs = { "netdev_hostname": hostname, "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_nb_role_color": PLUGIN_SETTINGS["default_device_role_color"], "netdev_vendor": "Cisco", "netdev_model": "CSR1000v", "netdev_nb_site_slug": self.site1.slug, "netdev_netmiko_device_type": platform_slug, "netdev_serial_number": serial_number, "netdev_mgmt_ip_address": "192.0.2.10", "netdev_mgmt_ifname": "GigaEthernet0", "netdev_mgmt_pflen": 24, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.ensure_device() self.assertIsInstance(nbk.device, Device) self.assertEqual(nbk.device.name, hostname) self.assertEqual(nbk.device.status, PLUGIN_SETTINGS["default_device_status"]) self.assertEqual(nbk.device.platform.slug, platform_slug) self.assertEqual(nbk.device.serial, serial_number) def test_ensure_device_instance_exist(self): """Verify ensure_device_instance function.""" manufacturer = Manufacturer.objects.create(name="Cisco", slug="cisco") device_role = DeviceRole.objects.create(name="Switch", slug="switch") device_type = DeviceType.objects.create(slug="c2960", model="c2960", manufacturer=manufacturer) device_name = "test_name" device = Device.objects.create( name=device_name, site=self.site1, device_type=device_type, device_role=device_role, status="planned", serial="987654", ) onboarding_kwargs = { "netdev_hostname": device_name, "netdev_nb_role_slug": "switch", "netdev_vendor": "Cisco", "netdev_model": "c2960", "netdev_nb_site_slug": self.site1.slug, "netdev_netmiko_device_type": "cisco_ios", "netdev_serial_number": "123456", "netdev_mgmt_ip_address": "192.0.2.10", "netdev_mgmt_ifname": "GigaEthernet0", "netdev_mgmt_pflen": 24, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.ensure_device() self.assertIsInstance(nbk.device, Device) self.assertEqual(nbk.device.pk, device.pk) self.assertEqual(nbk.device.name, device_name) self.assertEqual(nbk.device.platform.slug, "cisco_ios") self.assertEqual(nbk.device.serial, "123456") def test_ensure_interface_not_exist(self): """Verify ensure_interface function when the interface do not exist.""" onboarding_kwargs = { "netdev_hostname": "device1", "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_nb_role_color": PLUGIN_SETTINGS["default_device_role_color"], "netdev_vendor": "Cisco", "netdev_model": "CSR1000v", "netdev_nb_site_slug": self.site1.slug, "netdev_netmiko_device_type": "cisco_ios", "netdev_serial_number": "123456", "netdev_mgmt_ip_address": "192.0.2.10", "netdev_mgmt_ifname": "ge-0/0/0", "netdev_mgmt_pflen": 24, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.ensure_device() self.assertIsInstance(nbk.nb_mgmt_ifname, Interface) self.assertEqual(nbk.nb_mgmt_ifname.name, "ge-0/0/0") def test_ensure_interface_exist(self): """Verify ensure_interface function when the interface already exist.""" manufacturer = Manufacturer.objects.create(name="Cisco", slug="cisco") device_role = DeviceRole.objects.create(name="Switch", slug="switch") device_type = DeviceType.objects.create(slug="c2960", model="c2960", manufacturer=manufacturer) device_name = "test_name" netdev_mgmt_ifname = "GigaEthernet0" device = Device.objects.create( name=device_name, site=self.site1, device_type=device_type, device_role=device_role, status="planned", serial="987654", ) intf = Interface.objects.create(name=netdev_mgmt_ifname, device=device) onboarding_kwargs = { "netdev_hostname": device_name, "netdev_nb_role_slug": "switch", "netdev_vendor": "Cisco", "netdev_model": "c2960", "netdev_nb_site_slug": self.site1.slug, "netdev_netmiko_device_type": "cisco_ios", "netdev_serial_number": "123456", "netdev_mgmt_ip_address": "192.0.2.10", "netdev_mgmt_ifname": netdev_mgmt_ifname, "netdev_mgmt_pflen": 24, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.ensure_device() self.assertEqual(nbk.nb_mgmt_ifname, intf) def test_ensure_primary_ip_not_exist(self): """Verify ensure_primary_ip function when the IP address do not already exist.""" onboarding_kwargs = { "netdev_hostname": "device1", "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_nb_role_color": PLUGIN_SETTINGS["default_device_role_color"], "netdev_vendor": "Cisco", "netdev_model": "CSR1000v", "netdev_nb_site_slug": self.site1.slug, "netdev_netmiko_device_type": "cisco_ios", "netdev_serial_number": "123456", "netdev_mgmt_ip_address": "192.0.2.10", "netdev_mgmt_ifname": "ge-0/0/0", "netdev_mgmt_pflen": 24, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.ensure_device() self.assertIsInstance(nbk.nb_primary_ip, IPAddress) self.assertIn(nbk.nb_primary_ip, Interface.objects.get(device=nbk.device, name="ge-0/0/0").ip_addresses.all()) self.assertEqual(nbk.device.primary_ip, nbk.nb_primary_ip) def test_ensure_device_platform_missing(self): """Verify ensure_device_platform function when Platform object is not present.""" platform_name = "cisco_ios" onboarding_kwargs = { "netdev_hostname": "device1", "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_vendor": "Cisco", "netdev_model": "CSR1000v", "netdev_nb_site_slug": self.site1.slug, "netdev_nb_platform_slug": platform_name, "netdev_netmiko_device_type": platform_name, } nbk = NetboxKeeper(**onboarding_kwargs) with self.assertRaises(OnboardException) as exc_info: nbk.ensure_device_platform(create_platform_if_missing=False) self.assertEqual(exc_info.exception.message, f"ERROR device platform not found: {platform_name}") self.assertEqual(exc_info.exception.reason, "fail-config") nbk.ensure_device_platform(create_platform_if_missing=True) self.assertIsInstance(nbk.nb_platform, Platform) self.assertEqual(nbk.nb_platform.slug, slugify(platform_name)) def test_ensure_platform_present(self): """Verify ensure_device_platform function when Platform object is present.""" platform_name = "juniper_junos" manufacturer = Manufacturer.objects.create(name="Juniper", slug="juniper") device_type = DeviceType.objects.create(slug="srx3600", model="SRX3600", manufacturer=manufacturer) platform = Platform.objects.create(slug=platform_name, name=platform_name,) onboarding_kwargs = { "netdev_hostname": "device2", "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_vendor": "Juniper", "netdev_nb_device_type_slug": device_type.slug, "netdev_nb_site_slug": self.site1.slug, "netdev_nb_platform_slug": platform_name, } nbk = NetboxKeeper(**onboarding_kwargs) nbk.ensure_device_platform(create_platform_if_missing=False) self.assertIsInstance(nbk.nb_platform, Platform) self.assertEqual(nbk.nb_platform, platform) self.assertEqual(nbk.nb_platform.slug, slugify(platform_name)) def test_platform_map(self): """Verify platform mapping of netmiko to slug functionality.""" # Create static mapping PLUGIN_SETTINGS["platform_map"] = {"cisco_ios": "ios", "arista_eos": "eos", "cisco_nxos": "cisco-nxos"} onboarding_kwargs = { "netdev_hostname": "device1", "netdev_nb_role_slug": PLUGIN_SETTINGS["default_device_role"], "netdev_vendor": "Cisco", "netdev_model": "CSR1000v", "netdev_nb_site_slug": self.site1.slug, "netdev_netmiko_device_type": "cisco_ios", } nbk = NetboxKeeper(**onboarding_kwargs) nbk.ensure_device_platform(create_platform_if_missing=True) self.assertIsInstance(nbk.nb_platform, Platform) self.assertEqual(nbk.nb_platform.slug, slugify(PLUGIN_SETTINGS["platform_map"]["cisco_ios"])) self.assertEqual( Platform.objects.get(name=PLUGIN_SETTINGS["platform_map"]["cisco_ios"]).name, slugify(PLUGIN_SETTINGS["platform_map"]["cisco_ios"]), )
42.50655
118
0.672026
2,191
19,468
5.644455
0.092652
0.042047
0.034932
0.041481
0.830436
0.805612
0.7744
0.760653
0.760653
0.731786
0
0.016097
0.224574
19,468
457
119
42.599562
0.803127
0.101449
0
0.736364
0
0
0.224912
0.041003
0
0
0
0
0.169697
1
0.054545
false
0
0.021212
0
0.078788
0
0
0
0
null
0
0
0
1
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
7
bebeeeee1bd23bd77af46e3628f66c35885e7633
68,666
py
Python
benchmarks/SimResults/_bigLittle_hrrs_splash_tugberk_ml/SystemIPC/EightThreads_radix/power.py
TugberkArkose/MLScheduler
e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061
[ "Unlicense" ]
null
null
null
benchmarks/SimResults/_bigLittle_hrrs_splash_tugberk_ml/SystemIPC/EightThreads_radix/power.py
TugberkArkose/MLScheduler
e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061
[ "Unlicense" ]
null
null
null
benchmarks/SimResults/_bigLittle_hrrs_splash_tugberk_ml/SystemIPC/EightThreads_radix/power.py
TugberkArkose/MLScheduler
e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061
[ "Unlicense" ]
null
null
null
power = {'BUSES': {'Area': 1.33155, 'Bus/Area': 1.33155, 'Bus/Gate Leakage': 0.00662954, 'Bus/Peak Dynamic': 0.0, 'Bus/Runtime Dynamic': 0.0, 'Bus/Subthreshold Leakage': 0.0691322, 'Bus/Subthreshold Leakage with power gating': 0.0259246, 'Gate Leakage': 0.00662954, 'Peak Dynamic': 0.0, 'Runtime Dynamic': 0.0, 'Subthreshold Leakage': 0.0691322, 'Subthreshold Leakage with power gating': 0.0259246}, 'Core': [{'Area': 32.6082, 'Execution Unit/Area': 8.2042, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.0980777, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.279723, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.394, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.122718, 'Execution Unit/Instruction Scheduler/Area': 2.17927, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.328073, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.00115349, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.20978, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.148207, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.017004, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00962066, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00730101, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 1.00996, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00529112, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 2.07911, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.256641, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0800117, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0455351, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 4.84781, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.841232, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.000856399, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.55892, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.147191, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.0178624, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00897339, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.55204, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.114878, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.0641291, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.0860909, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 5.81603, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.0744351, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00537263, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.0810849, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0397339, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.15552, 'Execution Unit/Register Files/Runtime Dynamic': 0.0451065, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0442632, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00607074, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.222804, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.402293, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.0920413, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0345155, 'Execution Unit/Runtime Dynamic': 1.68454, 'Execution Unit/Subthreshold Leakage': 1.83518, 'Execution Unit/Subthreshold Leakage with power gating': 0.709678, 'Gate Leakage': 0.372997, 'Instruction Fetch Unit/Area': 5.86007, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.000225002, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.000225002, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.000194444, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 7.44341e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.000570781, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00121523, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.00221206, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0590479, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0381972, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 2.42967, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0551552, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.129735, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 4.76791, 'Instruction Fetch Unit/Runtime Dynamic': 0.226515, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932587, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.408542, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.0140516, 'L2/Runtime Dynamic': 0.00517116, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80969, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 1.57809, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.182297, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0351387, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.0110311, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0110311, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 1.63039, 'Load Store Unit/Runtime Dynamic': 0.247729, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.0272009, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.0544015, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591622, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283406, 'Memory Management Unit/Area': 0.434579, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.0096537, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.00986453, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00813591, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.151068, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.00904231, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.326256, 'Memory Management Unit/Runtime Dynamic': 0.0189068, 'Memory Management Unit/Subthreshold Leakage': 0.0769113, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0399462, 'Peak Dynamic': 17.1163, 'Renaming Unit/Area': 0.369768, 'Renaming Unit/FP Front End RAT/Area': 0.168486, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00489731, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 3.33511, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.259687, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0437281, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.024925, 'Renaming Unit/Free List/Area': 0.0414755, 'Renaming Unit/Free List/Gate Leakage': 4.15911e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0401324, 'Renaming Unit/Free List/Runtime Dynamic': 0.0107034, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000670426, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000377987, 'Renaming Unit/Gate Leakage': 0.00863632, 'Renaming Unit/Int Front End RAT/Area': 0.114751, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.00038343, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.86945, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.0719334, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00611897, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781, 'Renaming Unit/Peak Dynamic': 4.56169, 'Renaming Unit/Runtime Dynamic': 0.342324, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime Dynamic': 2.52519, 'Subthreshold Leakage': 6.21877, 'Subthreshold Leakage with power gating': 2.58311}, {'Area': 32.0201, 'Execution Unit/Area': 7.68434, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.0982865, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.279887, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.394843, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.120359, 'Execution Unit/Instruction Scheduler/Area': 1.66526, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.123408, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.199053, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.100475, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.422937, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.0806077, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 4.75412, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.0745942, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0051763, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.0797547, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0382819, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.154349, 'Execution Unit/Register Files/Runtime Dynamic': 0.0434582, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.192598, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.345046, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 1.49671, 'Execution Unit/Subthreshold Leakage': 1.79543, 'Execution Unit/Subthreshold Leakage with power gating': 0.688821, 'Gate Leakage': 0.368936, 'Instruction Fetch Unit/Area': 5.85939, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.000196117, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.000196117, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.000169484, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 6.48802e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.000549923, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00111164, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.00192802, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0589979, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0368014, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 2.34089, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0552637, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.124994, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 4.67301, 'Instruction Fetch Unit/Runtime Dynamic': 0.220099, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932286, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.0129726, 'L2/Runtime Dynamic': 0.00485966, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80901, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 1.53514, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.160709, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0350888, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.00964176, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.00964166, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 1.58067, 'Load Store Unit/Runtime Dynamic': 0.2179, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.0237749, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.0475494, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591321, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283293, 'Memory Management Unit/Area': 0.4339, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.0084378, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.00863242, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00808595, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.145548, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.00906, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.316151, 'Memory Management Unit/Runtime Dynamic': 0.0176924, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 14.9264, 'Renaming Unit/Area': 0.303608, 'Renaming Unit/FP Front End RAT/Area': 0.131045, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.196223, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885, 'Renaming Unit/Free List/Area': 0.0340654, 'Renaming Unit/Free List/Gate Leakage': 2.5481e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0306032, 'Renaming Unit/Free List/Runtime Dynamic': 0.00795584, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064, 'Renaming Unit/Gate Leakage': 0.00708398, 'Renaming Unit/Int Front End RAT/Area': 0.0941223, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.0588229, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.263002, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.22026, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}, {'Area': 32.0201, 'Execution Unit/Area': 7.68434, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.0978179, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.279519, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.392958, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.120359, 'Execution Unit/Instruction Scheduler/Area': 1.66526, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.123829, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.199732, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.100818, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.424379, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.081378, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 4.75194, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.0742381, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00519396, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.0796807, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0384125, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.153919, 'Execution Unit/Register Files/Runtime Dynamic': 0.0436065, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.192325, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.345489, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 1.49837, 'Execution Unit/Subthreshold Leakage': 1.79543, 'Execution Unit/Subthreshold Leakage with power gating': 0.688821, 'Gate Leakage': 0.368936, 'Instruction Fetch Unit/Area': 5.85939, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.000199387, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.000199387, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.000172309, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 6.59614e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.000551799, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00112288, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.0019602, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0589979, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0369269, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 2.34887, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0549932, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.12542, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 4.68138, 'Instruction Fetch Unit/Runtime Dynamic': 0.220424, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932286, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.013049, 'L2/Runtime Dynamic': 0.0049262, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80901, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 1.54336, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.164681, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0350888, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.00990766, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.00990762, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 1.59015, 'Load Store Unit/Runtime Dynamic': 0.22345, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.0244306, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.048861, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591321, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283293, 'Memory Management Unit/Area': 0.4339, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.0086705, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.00886632, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00808595, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.146044, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.00901559, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.317047, 'Memory Management Unit/Runtime Dynamic': 0.0178819, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 14.943, 'Renaming Unit/Area': 0.303608, 'Renaming Unit/FP Front End RAT/Area': 0.131045, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.195287, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885, 'Renaming Unit/Free List/Area': 0.0340654, 'Renaming Unit/Free List/Gate Leakage': 2.5481e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0306032, 'Renaming Unit/Free List/Runtime Dynamic': 0.00796344, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064, 'Renaming Unit/Gate Leakage': 0.00708398, 'Renaming Unit/Int Front End RAT/Area': 0.0941223, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.0590762, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.262327, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.22738, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}, {'Area': 32.0201, 'Execution Unit/Area': 7.68434, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.0979794, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.279646, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.393608, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.120359, 'Execution Unit/Instruction Scheduler/Area': 1.66526, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.123725, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.199564, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.100733, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.424022, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.0811593, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 4.75278, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.074361, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00518958, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.0797187, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0383801, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.15408, 'Execution Unit/Register Files/Runtime Dynamic': 0.0435697, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.192445, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.345389, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 1.498, 'Execution Unit/Subthreshold Leakage': 1.79543, 'Execution Unit/Subthreshold Leakage with power gating': 0.688821, 'Gate Leakage': 0.368936, 'Instruction Fetch Unit/Area': 5.85939, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.000197415, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.000197415, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.000170604, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 6.53086e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.000551334, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00111677, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.00194081, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0589979, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0368958, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 2.34689, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0550619, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.125315, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 4.6793, 'Instruction Fetch Unit/Runtime Dynamic': 0.22033, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932286, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.0131558, 'L2/Runtime Dynamic': 0.0049838, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80901, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 1.5413, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.163934, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0350888, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.00984081, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0098409, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 1.58777, 'Load Store Unit/Runtime Dynamic': 0.222306, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.0242658, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.048532, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591321, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283293, 'Memory Management Unit/Area': 0.4339, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.008612, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.00880954, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00808595, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.145921, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.00902684, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.316824, 'Memory Management Unit/Runtime Dynamic': 0.0178364, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 14.9393, 'Renaming Unit/Area': 0.303608, 'Renaming Unit/FP Front End RAT/Area': 0.131045, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.195609, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885, 'Renaming Unit/Free List/Area': 0.0340654, 'Renaming Unit/Free List/Gate Leakage': 2.5481e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0306032, 'Renaming Unit/Free List/Runtime Dynamic': 0.00796266, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064, 'Renaming Unit/Gate Leakage': 0.00708398, 'Renaming Unit/Int Front End RAT/Area': 0.0941223, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.0590131, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.262585, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.22605, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}], 'DRAM': {'Area': 0, 'Gate Leakage': 0, 'Peak Dynamic': 1.2868175454447888, 'Runtime Dynamic': 1.2868175454447888, 'Subthreshold Leakage': 4.252, 'Subthreshold Leakage with power gating': 4.252}, 'L3': [{'Area': 61.9075, 'Gate Leakage': 0.0484137, 'Peak Dynamic': 0.0451325, 'Runtime Dynamic': 0.0231622, 'Subthreshold Leakage': 6.80085, 'Subthreshold Leakage with power gating': 3.32364}], 'Processor': {'Area': 191.908, 'Gate Leakage': 1.53485, 'Peak Dynamic': 61.9702, 'Peak Power': 95.0824, 'Runtime Dynamic': 9.22203, 'Subthreshold Leakage': 31.5774, 'Subthreshold Leakage with power gating': 13.9484, 'Total Cores/Area': 128.669, 'Total Cores/Gate Leakage': 1.4798, 'Total Cores/Peak Dynamic': 61.9251, 'Total Cores/Runtime Dynamic': 9.19887, 'Total Cores/Subthreshold Leakage': 24.7074, 'Total Cores/Subthreshold Leakage with power gating': 10.2429, 'Total L3s/Area': 61.9075, 'Total L3s/Gate Leakage': 0.0484137, 'Total L3s/Peak Dynamic': 0.0451325, 'Total L3s/Runtime Dynamic': 0.0231622, 'Total L3s/Subthreshold Leakage': 6.80085, 'Total L3s/Subthreshold Leakage with power gating': 3.32364, 'Total Leakage': 33.1122, 'Total NoCs/Area': 1.33155, 'Total NoCs/Gate Leakage': 0.00662954, 'Total NoCs/Peak Dynamic': 0.0, 'Total NoCs/Runtime Dynamic': 0.0, 'Total NoCs/Subthreshold Leakage': 0.0691322, 'Total NoCs/Subthreshold Leakage with power gating': 0.0259246}}
75.126915
124
0.682288
8,086
68,666
5.788029
0.067524
0.123414
0.112816
0.093329
0.939084
0.9312
0.91823
0.887483
0.862485
0.84178
0
0.132726
0.224143
68,666
914
125
75.126915
0.745772
0
0
0.642232
0
0
0.656866
0.048058
0
0
0
0
0
1
0
false
0
0
0
0
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
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
bec8f3e8e25615ec47e0f369b37c577cbda48806
20,401
py
Python
salt/runners/saltutil.py
casselt/salt
d8a2ef4e0cd544656489d23d161928879b1fc1c0
[ "Apache-2.0" ]
1
2016-08-21T21:19:12.000Z
2016-08-21T21:19:12.000Z
salt/runners/saltutil.py
casselt/salt
d8a2ef4e0cd544656489d23d161928879b1fc1c0
[ "Apache-2.0" ]
2
2019-03-06T20:43:44.000Z
2019-04-10T23:56:02.000Z
salt/runners/saltutil.py
casselt/salt
d8a2ef4e0cd544656489d23d161928879b1fc1c0
[ "Apache-2.0" ]
1
2018-11-14T11:01:16.000Z
2018-11-14T11:01:16.000Z
# -*- coding: utf-8 -*- ''' The Saltutil runner is used to sync custom types to the Master. See the :mod:`saltutil module <salt.modules.saltutil>` for documentation on managing updates to minions. .. versionadded:: 2016.3.0 ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt libs import salt.utils.extmods log = logging.getLogger(__name__) def sync_all(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync all custom types saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None dictionary of modules to sync based on type extmod_blacklist : None dictionary of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_all salt-run saltutil.sync_all extmod_whitelist={'runners': ['custom_runner'], 'grains': []} ''' log.debug('Syncing all') ret = {} ret['clouds'] = sync_clouds(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['modules'] = sync_modules(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['states'] = sync_states(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['grains'] = sync_grains(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['renderers'] = sync_renderers(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['returners'] = sync_returners(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['output'] = sync_output(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['proxymodules'] = sync_proxymodules(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['runners'] = sync_runners(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['wheel'] = sync_wheel(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['engines'] = sync_engines(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['thorium'] = sync_thorium(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['queues'] = sync_queues(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['pillar'] = sync_pillar(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['utils'] = sync_utils(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['sdb'] = sync_sdb(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['cache'] = sync_cache(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['fileserver'] = sync_fileserver(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['tops'] = sync_tops(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['tokens'] = sync_eauth_tokens(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) ret['serializers'] = sync_serializers(saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist) return ret def sync_modules(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync execution modules from ``salt://_modules`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_modules ''' return salt.utils.extmods.sync(__opts__, 'modules', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_states(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync state modules from ``salt://_states`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_states ''' return salt.utils.extmods.sync(__opts__, 'states', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_grains(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync grains modules from ``salt://_grains`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_grains ''' return salt.utils.extmods.sync(__opts__, 'grains', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_renderers(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync renderer modules from from ``salt://_renderers`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_renderers ''' return salt.utils.extmods.sync(__opts__, 'renderers', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_returners(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync returner modules from ``salt://_returners`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_returners ''' return salt.utils.extmods.sync(__opts__, 'returners', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_output(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync output modules from ``salt://_output`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_output ''' return salt.utils.extmods.sync(__opts__, 'output', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_proxymodules(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync proxy modules from ``salt://_proxy`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_proxymodules ''' return salt.utils.extmods.sync(__opts__, 'proxy', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_runners(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync runners from ``salt://_runners`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_runners ''' return salt.utils.extmods.sync(__opts__, 'runners', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_wheel(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync wheel modules from ``salt://_wheel`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_wheel ''' return salt.utils.extmods.sync(__opts__, 'wheel', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_engines(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync engines from ``salt://_engines`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_engines ''' return salt.utils.extmods.sync(__opts__, 'engines', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_thorium(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2018.3.0 Sync Thorium from ``salt://_thorium`` to the master saltenv: ``base`` The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist comma-seperated list of modules to sync extmod_blacklist comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_thorium ''' return salt.utils.extmods.sync(__opts__, 'thorium', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_queues(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync queue modules from ``salt://_queues`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_queues ''' return salt.utils.extmods.sync(__opts__, 'queues', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_pillar(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' Sync pillar modules from ``salt://_pillar`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_pillar ''' return salt.utils.extmods.sync(__opts__, 'pillar', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_utils(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2016.11.0 Sync utils modules from ``salt://_utils`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_utils ''' return salt.utils.extmods.sync(__opts__, 'utils', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_sdb(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2017.7.0 Sync sdb modules from ``salt://_sdb`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_sdb ''' return salt.utils.extmods.sync(__opts__, 'sdb', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_tops(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2016.3.7,2016.11.4,2017.7.0 Sync master_tops modules from ``salt://_tops`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. CLI Example: .. code-block:: bash salt-run saltutil.sync_tops ''' return salt.utils.extmods.sync(__opts__, 'tops', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_cache(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2017.7.0 Sync cache modules from ``salt://_cache`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_cache ''' return salt.utils.extmods.sync(__opts__, 'cache', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_fileserver(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2018.3.0 Sync fileserver modules from ``salt://_fileserver`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_fileserver ''' return salt.utils.extmods.sync(__opts__, 'fileserver', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_clouds(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2017.7.0 Sync cloud modules from ``salt://_clouds`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_clouds ''' return salt.utils.extmods.sync(__opts__, 'clouds', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_roster(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2017.7.0 Sync roster modules from ``salt://_roster`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_roster ''' return salt.utils.extmods.sync(__opts__, 'roster', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_eauth_tokens(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2018.3.0 Sync eauth token modules from ``salt://_tokens`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_eauth_tokens ''' return salt.utils.extmods.sync(__opts__, 'tokens', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0] def sync_serializers(saltenv='base', extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: Fluorine Sync serializer modules from ``salt://_serializers`` to the master saltenv : base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. extmod_whitelist : None comma-seperated list of modules to sync extmod_blacklist : None comma-seperated list of modules to blacklist based on type CLI Example: .. code-block:: bash salt-run saltutil.sync_utils ''' return salt.utils.extmods.sync(__opts__, 'serializers', saltenv=saltenv, extmod_whitelist=extmod_whitelist, extmod_blacklist=extmod_blacklist)[0]
33.444262
128
0.688839
2,485
20,401
5.471227
0.045875
0.145631
0.132833
0.091718
0.880038
0.875625
0.831495
0.831495
0.831495
0.769712
0
0.00618
0.230577
20,401
609
129
33.499179
0.859973
0.502868
0
0.255102
0
0
0.043896
0
0
0
0
0
0
1
0.234694
false
0
0.030612
0
0.5
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
1
0
0
0
0
0
0
0
7
fe2c15558338948e894518940184ec48ac6136ab
5,732
py
Python
trello/actions.py
cmuozdiaz/trello-py
fa3e05972ad22796e515a6bb1a31e1ea5b365ed6
[ "BSD-2-Clause" ]
null
null
null
trello/actions.py
cmuozdiaz/trello-py
fa3e05972ad22796e515a6bb1a31e1ea5b365ed6
[ "BSD-2-Clause" ]
null
null
null
trello/actions.py
cmuozdiaz/trello-py
fa3e05972ad22796e515a6bb1a31e1ea5b365ed6
[ "BSD-2-Clause" ]
null
null
null
import json import requests class Actions(object): __module__ = 'trello' def __init__(self, apikey, token=None): self._apikey = apikey self._token = token def get(self, idAction, display=None, entities=None, fields=None, member=None, member_fields=None, memberCreator=None, memberCreator_fields=None): resp = requests.get("https://trello.com/1/actions/{}".format(idAction), params={"key": self._apikey, "token": self._token, "display": display, "entities": entities, "fields": fields, "member": member, "member_fields": member_fields, "memberCreator": memberCreator, "memberCreator_fields": memberCreator_fields}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_field(self, field, idAction): resp = requests.get("https://trello.com/1/actions/{}/{}".format(idAction, field), params={"key": self._apikey, "token": self._token}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_board(self, idAction, fields=None): resp = requests.get("https://trello.com/1/actions/{}/board".format(idAction), params={"key": self._apikey, "token": self._token, "fields": fields}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_board_field(self, field, idAction): resp = requests.get("https://trello.com/1/actions/{}/board/{}".format(idAction, field), params={"key": self._apikey, "token": self._token}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_card(self, idAction, fields=None): resp = requests.get("https://trello.com/1/actions/{}/card".format(idAction), params={"key": self._apikey, "token": self._token, "fields": fields}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_card_field(self, field, idAction): resp = requests.get("https://trello.com/1/actions/{}/card/{}".format(idAction, field), params={"key": self._apikey, "token": self._token}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_display(self, idAction): resp = requests.get("https://trello.com/1/actions/{}/display".format(idAction), params={"key": self._apikey, "token": self._token}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_entitie(self, idAction): resp = requests.get("https://trello.com/1/actions/{}/entities".format(idAction), params={"key": self._apikey, "token": self._token}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_list(self, idAction, fields=None): resp = requests.get("https://trello.com/1/actions/{}/list".format(idAction), params={"key": self._apikey, "token": self._token, "fields": fields}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_list_field(self, field, idAction): resp = requests.get("https://trello.com/1/actions/{}/list/{}".format(idAction, field), params={"key": self._apikey, "token": self._token}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_member(self, idAction, fields=None): resp = requests.get("https://trello.com/1/actions/{}/member".format(idAction), params={"key": self._apikey, "token": self._token, "fields": fields}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_member_field(self, field, idAction): resp = requests.get("https://trello.com/1/actions/{}/member/{}".format(idAction, field), params={"key": self._apikey, "token": self._token}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_memberCreator(self, idAction, fields=None): resp = requests.get("https://trello.com/1/actions/{}/memberCreator".format(idAction), params={"key": self._apikey, "token": self._token, "fields": fields}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_memberCreator_field(self, field, idAction): resp = requests.get("https://trello.com/1/actions/{}/memberCreator/{}".format(idAction, field), params={"key": self._apikey, "token": self._token}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_organization(self, idAction, fields=None): resp = requests.get("https://trello.com/1/actions/{}/organization".format(idAction), params={"key": self._apikey, "token": self._token, "fields": fields}, data=None) resp.raise_for_status() return json.loads(resp.text) def get_organization_field(self, field, idAction): resp = requests.get("https://trello.com/1/actions/{}/organization/{}".format(idAction, field), params={"key": self._apikey, "token": self._token}, data=None) resp.raise_for_status() return json.loads(resp.text) def update(self, idAction, text=None): resp = requests.put("https://trello.com/1/actions/{}".format(idAction), params={"key": self._apikey, "token": self._token}, data={"text": text}) resp.raise_for_status() return json.loads(resp.text) def update_text(self, idAction, value): resp = requests.put("https://trello.com/1/actions/{}/text".format(idAction), params={"key": self._apikey, "token": self._token}, data={"value": value}) resp.raise_for_status() return json.loads(resp.text) def delete(self, idAction): resp = requests.delete("https://trello.com/1/actions/{}".format(idAction), params={"key": self._apikey, "token": self._token}, data=None) resp.raise_for_status() return json.loads(resp.text)
54.075472
330
0.66626
743
5,732
4.986541
0.060565
0.053981
0.080972
0.076923
0.870175
0.870175
0.870175
0.870175
0.85614
0.85614
0
0.003948
0.160502
5,732
105
331
54.590476
0.766002
0
0
0.457831
0
0
0.175886
0
0
0
0
0
0
1
0.240964
false
0
0.024096
0
0.518072
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
1
0
0
0
0
1
0
0
8
fe9eea00f59c68728aba4c226c290f0abf2ab311
176
py
Python
deeplabcut/pose_estimation_3d/__init__.py
serre-lab/deeplabcut_mgh
aa37b104ba4967932528d4f79665648474f51112
[ "MIT" ]
null
null
null
deeplabcut/pose_estimation_3d/__init__.py
serre-lab/deeplabcut_mgh
aa37b104ba4967932528d4f79665648474f51112
[ "MIT" ]
1
2019-12-15T00:37:15.000Z
2019-12-15T00:37:15.000Z
deeplabcut/pose_estimation_3d/__init__.py
kalpitthakkar/deeplabcut_mgh_pose
8fa4a59f422ff0357552e290230838239edcfe1b
[ "MIT" ]
null
null
null
from deeplabcut.pose_estimation_3d.camera_calibration import * from deeplabcut.pose_estimation_3d.plotting3D import * from deeplabcut.pose_estimation_3d.triangulation import *
44
62
0.880682
22
176
6.727273
0.454545
0.283784
0.364865
0.567568
0.689189
0.486486
0
0
0
0
0
0.02439
0.068182
176
3
63
58.666667
0.878049
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
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
8
feaceee91130522bb582df1a0bee35551eed8a74
119
py
Python
src/ctc/protocols/fei_utils/analytics/metric_groups/__init__.py
fei-protocol/checkthechain
ec838f3d0d44af228f45394d9ba8d8eb7f677520
[ "MIT" ]
94
2022-02-15T19:34:49.000Z
2022-03-26T19:26:22.000Z
src/ctc/protocols/fei_utils/analytics/metric_groups/__init__.py
fei-protocol/checkthechain
ec838f3d0d44af228f45394d9ba8d8eb7f677520
[ "MIT" ]
7
2022-03-03T02:58:47.000Z
2022-03-11T18:41:05.000Z
src/ctc/protocols/fei_utils/analytics/metric_groups/__init__.py
fei-protocol/checkthechain
ec838f3d0d44af228f45394d9ba8d8eb7f677520
[ "MIT" ]
7
2022-02-15T17:53:07.000Z
2022-03-17T19:14:17.000Z
from .buyback_metrics import * from .fei_metrics import * from .fei_volume_metrics import * from .pcv_metrics import *
23.8
33
0.798319
17
119
5.294118
0.411765
0.577778
0.566667
0.444444
0
0
0
0
0
0
0
0
0.134454
119
4
34
29.75
0.873786
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
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
8
feb02663b37774724d6bc2b05800a55eedb65572
68,010
py
Python
atom/nucleus/python/nucleus_api/api/decision_tree_api.py
AbhiGupta03/SDK
f3a61aae7a847f07f0c22a154ca88dc378e9d25e
[ "Apache-2.0" ]
null
null
null
atom/nucleus/python/nucleus_api/api/decision_tree_api.py
AbhiGupta03/SDK
f3a61aae7a847f07f0c22a154ca88dc378e9d25e
[ "Apache-2.0" ]
null
null
null
atom/nucleus/python/nucleus_api/api/decision_tree_api.py
AbhiGupta03/SDK
f3a61aae7a847f07f0c22a154ca88dc378e9d25e
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ Hydrogen Nucleus API The Hydrogen Nucleus API # noqa: E501 OpenAPI spec version: 1.9.5 Contact: info@hydrogenplatform.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from nucleus_api.api_client import ApiClient class DecisionTreeApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def create_decision_tree_result_using_post(self, decision_tree_co, **kwargs): # noqa: E501 """Decision tree result # noqa: E501 Decision tree result. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_decision_tree_result_using_post(decision_tree_co, async_req=True) >>> result = thread.get() :param async_req bool :param DecisionTreeCO decision_tree_co: decisionTreeCO (required) :return: DecisionTreeResultVO If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_decision_tree_result_using_post_with_http_info(decision_tree_co, **kwargs) # noqa: E501 else: (data) = self.create_decision_tree_result_using_post_with_http_info(decision_tree_co, **kwargs) # noqa: E501 return data def create_decision_tree_result_using_post_with_http_info(self, decision_tree_co, **kwargs): # noqa: E501 """Decision tree result # noqa: E501 Decision tree result. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_decision_tree_result_using_post_with_http_info(decision_tree_co, async_req=True) >>> result = thread.get() :param async_req bool :param DecisionTreeCO decision_tree_co: decisionTreeCO (required) :return: DecisionTreeResultVO If the method is called asynchronously, returns the request thread. """ all_params = ['decision_tree_co'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method create_decision_tree_result_using_post" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'decision_tree_co' is set if self.api_client.client_side_validation and ('decision_tree_co' not in params or params['decision_tree_co'] is None): # noqa: E501 raise ValueError("Missing the required parameter `decision_tree_co` when calling `create_decision_tree_result_using_post`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'decision_tree_co' in params: body_params = params['decision_tree_co'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/decision_tree_result', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='DecisionTreeResultVO', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def create_decision_tree_using_post(self, decision_tree, **kwargs): # noqa: E501 """Create a decision tree # noqa: E501 Create a new decision tree for your firm. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_decision_tree_using_post(decision_tree, async_req=True) >>> result = thread.get() :param async_req bool :param DecisionTree decision_tree: decisionTree (required) :return: DecisionTree If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_decision_tree_using_post_with_http_info(decision_tree, **kwargs) # noqa: E501 else: (data) = self.create_decision_tree_using_post_with_http_info(decision_tree, **kwargs) # noqa: E501 return data def create_decision_tree_using_post_with_http_info(self, decision_tree, **kwargs): # noqa: E501 """Create a decision tree # noqa: E501 Create a new decision tree for your firm. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_decision_tree_using_post_with_http_info(decision_tree, async_req=True) >>> result = thread.get() :param async_req bool :param DecisionTree decision_tree: decisionTree (required) :return: DecisionTree If the method is called asynchronously, returns the request thread. """ all_params = ['decision_tree'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method create_decision_tree_using_post" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'decision_tree' is set if self.api_client.client_side_validation and ('decision_tree' not in params or params['decision_tree'] is None): # noqa: E501 raise ValueError("Missing the required parameter `decision_tree` when calling `create_decision_tree_using_post`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'decision_tree' in params: body_params = params['decision_tree'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/decision_tree', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='DecisionTree', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def create_node_relationship_using_post(self, node, **kwargs): # noqa: E501 """Create a node relationship # noqa: E501 Create a new node relationship for your firm. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_node_relationship_using_post(node, async_req=True) >>> result = thread.get() :param async_req bool :param NodeRelationship node: node (required) :return: NodeRelationship If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_node_relationship_using_post_with_http_info(node, **kwargs) # noqa: E501 else: (data) = self.create_node_relationship_using_post_with_http_info(node, **kwargs) # noqa: E501 return data def create_node_relationship_using_post_with_http_info(self, node, **kwargs): # noqa: E501 """Create a node relationship # noqa: E501 Create a new node relationship for your firm. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_node_relationship_using_post_with_http_info(node, async_req=True) >>> result = thread.get() :param async_req bool :param NodeRelationship node: node (required) :return: NodeRelationship If the method is called asynchronously, returns the request thread. """ all_params = ['node'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method create_node_relationship_using_post" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'node' is set if self.api_client.client_side_validation and ('node' not in params or params['node'] is None): # noqa: E501 raise ValueError("Missing the required parameter `node` when calling `create_node_relationship_using_post`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'node' in params: body_params = params['node'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/node_relationship', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='NodeRelationship', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def create_node_using_post(self, node, **kwargs): # noqa: E501 """Create a node # noqa: E501 Create a new node for your firm that can be used in a decision tree and mapped to other nodes. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_node_using_post(node, async_req=True) >>> result = thread.get() :param async_req bool :param Node node: node (required) :return: Node If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_node_using_post_with_http_info(node, **kwargs) # noqa: E501 else: (data) = self.create_node_using_post_with_http_info(node, **kwargs) # noqa: E501 return data def create_node_using_post_with_http_info(self, node, **kwargs): # noqa: E501 """Create a node # noqa: E501 Create a new node for your firm that can be used in a decision tree and mapped to other nodes. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_node_using_post_with_http_info(node, async_req=True) >>> result = thread.get() :param async_req bool :param Node node: node (required) :return: Node If the method is called asynchronously, returns the request thread. """ all_params = ['node'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method create_node_using_post" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'node' is set if self.api_client.client_side_validation and ('node' not in params or params['node'] is None): # noqa: E501 raise ValueError("Missing the required parameter `node` when calling `create_node_using_post`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'node' in params: body_params = params['node'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/node', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Node', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def delete_decision_tree_using_delete(self, decision_tree_id, **kwargs): # noqa: E501 """Delete a decision tree # noqa: E501 Permanently delete a decision tree. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_decision_tree_using_delete(decision_tree_id, async_req=True) >>> result = thread.get() :param async_req bool :param str decision_tree_id: UUID decision_tree_id (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_decision_tree_using_delete_with_http_info(decision_tree_id, **kwargs) # noqa: E501 else: (data) = self.delete_decision_tree_using_delete_with_http_info(decision_tree_id, **kwargs) # noqa: E501 return data def delete_decision_tree_using_delete_with_http_info(self, decision_tree_id, **kwargs): # noqa: E501 """Delete a decision tree # noqa: E501 Permanently delete a decision tree. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_decision_tree_using_delete_with_http_info(decision_tree_id, async_req=True) >>> result = thread.get() :param async_req bool :param str decision_tree_id: UUID decision_tree_id (required) :return: None If the method is called asynchronously, returns the request thread. """ all_params = ['decision_tree_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method delete_decision_tree_using_delete" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'decision_tree_id' is set if self.api_client.client_side_validation and ('decision_tree_id' not in params or params['decision_tree_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `decision_tree_id` when calling `delete_decision_tree_using_delete`") # noqa: E501 collection_formats = {} path_params = {} if 'decision_tree_id' in params: path_params['decision_tree_id'] = params['decision_tree_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/decision_tree/{decision_tree_id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def delete_node_relationship_using_delete(self, node_relationship_id, **kwargs): # noqa: E501 """Delete a node relationship # noqa: E501 Permanently delete a node relationship. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_node_relationship_using_delete(node_relationship_id, async_req=True) >>> result = thread.get() :param async_req bool :param str node_relationship_id: UUID node_relationship_id (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_node_relationship_using_delete_with_http_info(node_relationship_id, **kwargs) # noqa: E501 else: (data) = self.delete_node_relationship_using_delete_with_http_info(node_relationship_id, **kwargs) # noqa: E501 return data def delete_node_relationship_using_delete_with_http_info(self, node_relationship_id, **kwargs): # noqa: E501 """Delete a node relationship # noqa: E501 Permanently delete a node relationship. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_node_relationship_using_delete_with_http_info(node_relationship_id, async_req=True) >>> result = thread.get() :param async_req bool :param str node_relationship_id: UUID node_relationship_id (required) :return: None If the method is called asynchronously, returns the request thread. """ all_params = ['node_relationship_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method delete_node_relationship_using_delete" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'node_relationship_id' is set if self.api_client.client_side_validation and ('node_relationship_id' not in params or params['node_relationship_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `node_relationship_id` when calling `delete_node_relationship_using_delete`") # noqa: E501 collection_formats = {} path_params = {} if 'node_relationship_id' in params: path_params['node_relationship_id'] = params['node_relationship_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/node_relationship/{node_relationship_id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def delete_node_using_delete(self, node_id, **kwargs): # noqa: E501 """Delete a node # noqa: E501 Permanently delete a node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_node_using_delete(node_id, async_req=True) >>> result = thread.get() :param async_req bool :param str node_id: UUID node_id (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_node_using_delete_with_http_info(node_id, **kwargs) # noqa: E501 else: (data) = self.delete_node_using_delete_with_http_info(node_id, **kwargs) # noqa: E501 return data def delete_node_using_delete_with_http_info(self, node_id, **kwargs): # noqa: E501 """Delete a node # noqa: E501 Permanently delete a node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_node_using_delete_with_http_info(node_id, async_req=True) >>> result = thread.get() :param async_req bool :param str node_id: UUID node_id (required) :return: None If the method is called asynchronously, returns the request thread. """ all_params = ['node_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method delete_node_using_delete" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'node_id' is set if self.api_client.client_side_validation and ('node_id' not in params or params['node_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `node_id` when calling `delete_node_using_delete`") # noqa: E501 collection_formats = {} path_params = {} if 'node_id' in params: path_params['node_id'] = params['node_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/node/{node_id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_decision_tree_all_using_get(self, **kwargs): # noqa: E501 """List all decision tree # noqa: E501 Get the information for all decision trees defined for your firm. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_decision_tree_all_using_get(async_req=True) >>> result = thread.get() :param async_req bool :param bool ascending: ascending :param str filter: filter :param str order_by: order_by :param int page: page :param int size: size :return: PageDecisionTree If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_decision_tree_all_using_get_with_http_info(**kwargs) # noqa: E501 else: (data) = self.get_decision_tree_all_using_get_with_http_info(**kwargs) # noqa: E501 return data def get_decision_tree_all_using_get_with_http_info(self, **kwargs): # noqa: E501 """List all decision tree # noqa: E501 Get the information for all decision trees defined for your firm. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_decision_tree_all_using_get_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool :param bool ascending: ascending :param str filter: filter :param str order_by: order_by :param int page: page :param int size: size :return: PageDecisionTree If the method is called asynchronously, returns the request thread. """ all_params = ['ascending', 'filter', 'order_by', 'page', 'size'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_decision_tree_all_using_get" % key ) params[key] = val del params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'ascending' in params: query_params.append(('ascending', params['ascending'])) # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 if 'order_by' in params: query_params.append(('order_by', params['order_by'])) # noqa: E501 if 'page' in params: query_params.append(('page', params['page'])) # noqa: E501 if 'size' in params: query_params.append(('size', params['size'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/decision_tree', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='PageDecisionTree', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_decision_tree_using_get(self, decision_tree_id, **kwargs): # noqa: E501 """Retrieve a decision tree # noqa: E501 Retrieve the information for a decision tree. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_decision_tree_using_get(decision_tree_id, async_req=True) >>> result = thread.get() :param async_req bool :param str decision_tree_id: UUID decision_tree_id (required) :return: DecisionTree If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_decision_tree_using_get_with_http_info(decision_tree_id, **kwargs) # noqa: E501 else: (data) = self.get_decision_tree_using_get_with_http_info(decision_tree_id, **kwargs) # noqa: E501 return data def get_decision_tree_using_get_with_http_info(self, decision_tree_id, **kwargs): # noqa: E501 """Retrieve a decision tree # noqa: E501 Retrieve the information for a decision tree. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_decision_tree_using_get_with_http_info(decision_tree_id, async_req=True) >>> result = thread.get() :param async_req bool :param str decision_tree_id: UUID decision_tree_id (required) :return: DecisionTree If the method is called asynchronously, returns the request thread. """ all_params = ['decision_tree_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_decision_tree_using_get" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'decision_tree_id' is set if self.api_client.client_side_validation and ('decision_tree_id' not in params or params['decision_tree_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `decision_tree_id` when calling `get_decision_tree_using_get`") # noqa: E501 collection_formats = {} path_params = {} if 'decision_tree_id' in params: path_params['decision_tree_id'] = params['decision_tree_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/decision_tree/{decision_tree_id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='DecisionTree', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_node_all_using_get(self, **kwargs): # noqa: E501 """List all nodes # noqa: E501 List all nodes that are defined for your firm. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_node_all_using_get(async_req=True) >>> result = thread.get() :param async_req bool :param bool ascending: ascending :param str filter: filter :param str order_by: order_by :param int page: page :param int size: size :return: PageNode If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_node_all_using_get_with_http_info(**kwargs) # noqa: E501 else: (data) = self.get_node_all_using_get_with_http_info(**kwargs) # noqa: E501 return data def get_node_all_using_get_with_http_info(self, **kwargs): # noqa: E501 """List all nodes # noqa: E501 List all nodes that are defined for your firm. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_node_all_using_get_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool :param bool ascending: ascending :param str filter: filter :param str order_by: order_by :param int page: page :param int size: size :return: PageNode If the method is called asynchronously, returns the request thread. """ all_params = ['ascending', 'filter', 'order_by', 'page', 'size'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_node_all_using_get" % key ) params[key] = val del params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'ascending' in params: query_params.append(('ascending', params['ascending'])) # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 if 'order_by' in params: query_params.append(('order_by', params['order_by'])) # noqa: E501 if 'page' in params: query_params.append(('page', params['page'])) # noqa: E501 if 'size' in params: query_params.append(('size', params['size'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/node', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='PageNode', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_node_relationship_all_using_get(self, **kwargs): # noqa: E501 """List all node relationships # noqa: E501 Get the information for all the node relationships defined for your firm. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_node_relationship_all_using_get(async_req=True) >>> result = thread.get() :param async_req bool :param bool ascending: ascending :param str filter: filter :param str order_by: order_by :param int page: page :param int size: size :return: PageNodeRelationship If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_node_relationship_all_using_get_with_http_info(**kwargs) # noqa: E501 else: (data) = self.get_node_relationship_all_using_get_with_http_info(**kwargs) # noqa: E501 return data def get_node_relationship_all_using_get_with_http_info(self, **kwargs): # noqa: E501 """List all node relationships # noqa: E501 Get the information for all the node relationships defined for your firm. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_node_relationship_all_using_get_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool :param bool ascending: ascending :param str filter: filter :param str order_by: order_by :param int page: page :param int size: size :return: PageNodeRelationship If the method is called asynchronously, returns the request thread. """ all_params = ['ascending', 'filter', 'order_by', 'page', 'size'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_node_relationship_all_using_get" % key ) params[key] = val del params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'ascending' in params: query_params.append(('ascending', params['ascending'])) # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 if 'order_by' in params: query_params.append(('order_by', params['order_by'])) # noqa: E501 if 'page' in params: query_params.append(('page', params['page'])) # noqa: E501 if 'size' in params: query_params.append(('size', params['size'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/node_relationship', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='PageNodeRelationship', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_node_relationship_using_get(self, node_relationship_id, **kwargs): # noqa: E501 """Retrieve a node relationship # noqa: E501 Retrieve the information for a node relationship. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_node_relationship_using_get(node_relationship_id, async_req=True) >>> result = thread.get() :param async_req bool :param str node_relationship_id: UUID node_relationship_id (required) :return: NodeRelationship If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_node_relationship_using_get_with_http_info(node_relationship_id, **kwargs) # noqa: E501 else: (data) = self.get_node_relationship_using_get_with_http_info(node_relationship_id, **kwargs) # noqa: E501 return data def get_node_relationship_using_get_with_http_info(self, node_relationship_id, **kwargs): # noqa: E501 """Retrieve a node relationship # noqa: E501 Retrieve the information for a node relationship. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_node_relationship_using_get_with_http_info(node_relationship_id, async_req=True) >>> result = thread.get() :param async_req bool :param str node_relationship_id: UUID node_relationship_id (required) :return: NodeRelationship If the method is called asynchronously, returns the request thread. """ all_params = ['node_relationship_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_node_relationship_using_get" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'node_relationship_id' is set if self.api_client.client_side_validation and ('node_relationship_id' not in params or params['node_relationship_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `node_relationship_id` when calling `get_node_relationship_using_get`") # noqa: E501 collection_formats = {} path_params = {} if 'node_relationship_id' in params: path_params['node_relationship_id'] = params['node_relationship_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/node_relationship/{node_relationship_id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='NodeRelationship', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_node_using_get(self, node_id, **kwargs): # noqa: E501 """Retrieve a node # noqa: E501 Retrieve the information for a node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_node_using_get(node_id, async_req=True) >>> result = thread.get() :param async_req bool :param str node_id: UUID node_id (required) :return: Node If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_node_using_get_with_http_info(node_id, **kwargs) # noqa: E501 else: (data) = self.get_node_using_get_with_http_info(node_id, **kwargs) # noqa: E501 return data def get_node_using_get_with_http_info(self, node_id, **kwargs): # noqa: E501 """Retrieve a node # noqa: E501 Retrieve the information for a node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_node_using_get_with_http_info(node_id, async_req=True) >>> result = thread.get() :param async_req bool :param str node_id: UUID node_id (required) :return: Node If the method is called asynchronously, returns the request thread. """ all_params = ['node_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_node_using_get" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'node_id' is set if self.api_client.client_side_validation and ('node_id' not in params or params['node_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `node_id` when calling `get_node_using_get`") # noqa: E501 collection_formats = {} path_params = {} if 'node_id' in params: path_params['node_id'] = params['node_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/node/{node_id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Node', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def update_decision_tree_using_put(self, decision_tree, decision_tree_id, **kwargs): # noqa: E501 """Update a decision tree # noqa: E501 Updated the information for a decision tree. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_decision_tree_using_put(decision_tree, decision_tree_id, async_req=True) >>> result = thread.get() :param async_req bool :param object decision_tree: decision_tree (required) :param str decision_tree_id: UUID decision_tree_id (required) :return: DecisionTree If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.update_decision_tree_using_put_with_http_info(decision_tree, decision_tree_id, **kwargs) # noqa: E501 else: (data) = self.update_decision_tree_using_put_with_http_info(decision_tree, decision_tree_id, **kwargs) # noqa: E501 return data def update_decision_tree_using_put_with_http_info(self, decision_tree, decision_tree_id, **kwargs): # noqa: E501 """Update a decision tree # noqa: E501 Updated the information for a decision tree. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_decision_tree_using_put_with_http_info(decision_tree, decision_tree_id, async_req=True) >>> result = thread.get() :param async_req bool :param object decision_tree: decision_tree (required) :param str decision_tree_id: UUID decision_tree_id (required) :return: DecisionTree If the method is called asynchronously, returns the request thread. """ all_params = ['decision_tree', 'decision_tree_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method update_decision_tree_using_put" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'decision_tree' is set if self.api_client.client_side_validation and ('decision_tree' not in params or params['decision_tree'] is None): # noqa: E501 raise ValueError("Missing the required parameter `decision_tree` when calling `update_decision_tree_using_put`") # noqa: E501 # verify the required parameter 'decision_tree_id' is set if self.api_client.client_side_validation and ('decision_tree_id' not in params or params['decision_tree_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `decision_tree_id` when calling `update_decision_tree_using_put`") # noqa: E501 collection_formats = {} path_params = {} if 'decision_tree_id' in params: path_params['decision_tree_id'] = params['decision_tree_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'decision_tree' in params: body_params = params['decision_tree'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/decision_tree/{decision_tree_id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='DecisionTree', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def update_node_relationship_using_put(self, json_node, node_relationship_id, **kwargs): # noqa: E501 """Update a node relationship # noqa: E501 Update the information for a node relationship. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_node_relationship_using_put(json_node, node_relationship_id, async_req=True) >>> result = thread.get() :param async_req bool :param object json_node: jsonNode (required) :param str node_relationship_id: UUID node_relationship_id (required) :return: NodeRelationship If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.update_node_relationship_using_put_with_http_info(json_node, node_relationship_id, **kwargs) # noqa: E501 else: (data) = self.update_node_relationship_using_put_with_http_info(json_node, node_relationship_id, **kwargs) # noqa: E501 return data def update_node_relationship_using_put_with_http_info(self, json_node, node_relationship_id, **kwargs): # noqa: E501 """Update a node relationship # noqa: E501 Update the information for a node relationship. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_node_relationship_using_put_with_http_info(json_node, node_relationship_id, async_req=True) >>> result = thread.get() :param async_req bool :param object json_node: jsonNode (required) :param str node_relationship_id: UUID node_relationship_id (required) :return: NodeRelationship If the method is called asynchronously, returns the request thread. """ all_params = ['json_node', 'node_relationship_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method update_node_relationship_using_put" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'json_node' is set if self.api_client.client_side_validation and ('json_node' not in params or params['json_node'] is None): # noqa: E501 raise ValueError("Missing the required parameter `json_node` when calling `update_node_relationship_using_put`") # noqa: E501 # verify the required parameter 'node_relationship_id' is set if self.api_client.client_side_validation and ('node_relationship_id' not in params or params['node_relationship_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `node_relationship_id` when calling `update_node_relationship_using_put`") # noqa: E501 collection_formats = {} path_params = {} if 'node_relationship_id' in params: path_params['node_relationship_id'] = params['node_relationship_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'json_node' in params: body_params = params['json_node'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/node_relationship/{node_relationship_id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='NodeRelationship', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def update_node_using_put(self, json_node, node_id, **kwargs): # noqa: E501 """Update a node # noqa: E501 Updated the information for a node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_node_using_put(json_node, node_id, async_req=True) >>> result = thread.get() :param async_req bool :param object json_node: jsonNode (required) :param str node_id: UUID node_id (required) :return: Node If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.update_node_using_put_with_http_info(json_node, node_id, **kwargs) # noqa: E501 else: (data) = self.update_node_using_put_with_http_info(json_node, node_id, **kwargs) # noqa: E501 return data def update_node_using_put_with_http_info(self, json_node, node_id, **kwargs): # noqa: E501 """Update a node # noqa: E501 Updated the information for a node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_node_using_put_with_http_info(json_node, node_id, async_req=True) >>> result = thread.get() :param async_req bool :param object json_node: jsonNode (required) :param str node_id: UUID node_id (required) :return: Node If the method is called asynchronously, returns the request thread. """ all_params = ['json_node', 'node_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method update_node_using_put" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'json_node' is set if self.api_client.client_side_validation and ('json_node' not in params or params['json_node'] is None): # noqa: E501 raise ValueError("Missing the required parameter `json_node` when calling `update_node_using_put`") # noqa: E501 # verify the required parameter 'node_id' is set if self.api_client.client_side_validation and ('node_id' not in params or params['node_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `node_id` when calling `update_node_using_put`") # noqa: E501 collection_formats = {} path_params = {} if 'node_id' in params: path_params['node_id'] = params['node_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'json_node' in params: body_params = params['json_node'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['oauth2'] # noqa: E501 return self.api_client.call_api( '/nucleus/v1/node/{node_id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Node', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats)
41.393792
152
0.616733
7,933
68,010
4.98626
0.024203
0.05319
0.022651
0.029123
0.986677
0.981343
0.976868
0.971863
0.967793
0.954773
0
0.017357
0.296883
68,010
1,642
153
41.419001
0.809845
0.318071
0
0.830508
1
0
0.189148
0.059703
0
0
0
0
0
1
0.037288
false
0
0.00452
0
0.097175
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
feb46fa9bd771779bd0ea126f4b086a2c209a3da
3,818
py
Python
src/sst/elements/ember/test/networkConfig.py
zhangyjBU/sst-elements
d2c6725ea5fbb4dd493bf7d1a8c321aea4ff556c
[ "BSD-3-Clause" ]
2
2021-12-24T03:24:33.000Z
2022-01-11T23:03:39.000Z
src/sst/elements/ember/test/networkConfig.py
zhangyjBU/sst-elements
d2c6725ea5fbb4dd493bf7d1a8c321aea4ff556c
[ "BSD-3-Clause" ]
null
null
null
src/sst/elements/ember/test/networkConfig.py
zhangyjBU/sst-elements
d2c6725ea5fbb4dd493bf7d1a8c321aea4ff556c
[ "BSD-3-Clause" ]
2
2021-05-23T02:28:02.000Z
2021-09-08T13:38:46.000Z
import sys class TopoInfo: def getNumNodes(self): pass def getNetworkParams(self): pass class TorusInfo(TopoInfo): def __init__( self, shape, local_ports ): width = 1 self.params = {} self.params["num_dims"] = self.calcNumDim(shape) self.params["torus:shape"] = shape self.params["torus:width"] = self.calcWidth(shape,width) self.params["torus:local_ports"] = local_ports self.numNodes = self.calcNumNodes( shape ) * local_ports def getNetworkParams(self): return self.params def getNumNodes(self): return self.numNodes def calcNumDim(self,shape): return len( shape.split( 'x' ) ) def calcNumNodes(self,shape): tmp = shape.split( 'x' ) num = 1 for d in tmp: num = num * int(d) return num def calcWidth(self,shape,width): tmp = len( shape.split( 'x' ) ) - 1 retval = str(width) count = 0 while ( count < tmp ): retval += "x" + str(width) count += 1 return retval class HyperXInfo(TopoInfo): def __init__( self, shape, local_ports ): width = 1 self.params = {} self.params["num_dims"] = self.calcNumDim(shape) self.params["hyperx:shape"] = shape self.params["hyperx:width"] = self.calcWidth(shape,width) self.params["hyperx:local_ports"] = local_ports self.numNodes = self.calcNumNodes( shape ) * local_ports def getNetworkParams(self): return self.params def getNumNodes(self): return self.numNodes def calcNumDim(self,shape): return len( shape.split( 'x' ) ) def calcNumNodes(self,shape): tmp = shape.split( 'x' ) num = 1 for d in tmp: num = num * int(d) return num def calcWidth(self,shape,width): tmp = len( shape.split( 'x' ) ) - 1 retval = str(width) count = 0 while ( count < tmp ): retval += "x" + str(width) count += 1 return retval class FattreeInfo(TopoInfo): def __init__( self, shape ): self.params = {} self.numNodes = self.calcNumNodes(shape) self.params["fattree:shape"] = shape def getNetworkParams(self): return self.params def getNumNodes(self): return self.numNodes def calcNumNodes(self, shape): levels = shape.split(":") total_hosts = 1; for l in levels: links = l.split(",") total_hosts = total_hosts * int(links[0]) return total_hosts class DragonFlyLegacyInfo(TopoInfo): def __init__( self, shape ): radix, lcl, glbl, nRtrs = shape.split(':') self.params = {} hostsPerGroup = int(nRtrs) * int(lcl) nGrp = int(nRtrs) * int(glbl) + 1 self.params["router_radix"] = radix self.params["dragonfly:shape"] = "" self.params["dragonfly:hosts_per_router"] = lcl self.params["dragonfly:routers_per_group"] = nRtrs self.params["dragonfly:intergroup_per_router"] = glbl self.params["dragonfly:num_groups"] = nGrp self.params["dragonfly:algorithm"] = "minimal" self.numNodes = nGrp * hostsPerGroup def getNetworkParams(self): return self.params def getNumNodes(self): return self.numNodes class DragonFlyInfo(TopoInfo): def __init__( self, shape ): lcl, nRtrs, glbl, nGrp = shape.split(':') self.params = {} hostsPerGroup = int(nRtrs) * int(lcl) self.params["dragonfly:shape"] = "" self.params["dragonfly:hosts_per_router"] = lcl self.params["dragonfly:routers_per_group"] = nRtrs self.params["dragonfly:intergroup_links"] = glbl self.params["dragonfly:num_groups"] = nGrp self.params["dragonfly:algorithm"] = "minimal" self.numNodes = int(nGrp) * hostsPerGroup def getNetworkParams(self): return self.params def getNumNodes(self): return self.numNodes
25.972789
65
0.628339
455
3,818
5.167033
0.140659
0.136112
0.09698
0.040408
0.800085
0.755423
0.755423
0.723097
0.723097
0.683114
0
0.004506
0.244369
3,818
146
66
26.150685
0.810399
0
0
0.745614
0
0
0.109743
0.042693
0
0
0
0
0
0
null
null
0.017544
0.008772
null
null
0
0
0
0
null
0
0
0
1
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
1
0
0
0
0
0
0
0
0
8
2284f2a698312a1d8ce04561f1eac7c53893a1c5
66,138
py
Python
tests/test_distributed_splunk_image.py
ridvan70/docker-splunk
467800a6038419d954eb8635a4812df643c881a8
[ "Apache-2.0" ]
535
2016-09-29T15:38:32.000Z
2022-03-30T09:11:26.000Z
tests/test_distributed_splunk_image.py
ridvan70/docker-splunk
467800a6038419d954eb8635a4812df643c881a8
[ "Apache-2.0" ]
319
2016-09-29T17:20:20.000Z
2022-03-30T13:40:47.000Z
tests/test_distributed_splunk_image.py
ridvan70/docker-splunk
467800a6038419d954eb8635a4812df643c881a8
[ "Apache-2.0" ]
388
2016-09-29T19:34:34.000Z
2022-03-31T00:40:27.000Z
#!/usr/bin/env python # encoding: utf-8 import pytest import time import re import os import tarfile import requests import tarfile import docker import json import urllib import yaml import subprocess from shutil import copy, copytree, rmtree from executor import Executor from docker.types import Mount # Code to suppress insecure https warnings import urllib3 from urllib3.exceptions import InsecureRequestWarning, SubjectAltNameWarning urllib3.disable_warnings(InsecureRequestWarning) urllib3.disable_warnings(SubjectAltNameWarning) global PLATFORM PLATFORM = "debian-9" OLD_SPLUNK_VERSION = "7.3.4" def pytest_generate_tests(metafunc): # This is called for every test. Only get/set command line arguments # if the argument is specified in the list of test "fixturenames". option_value = metafunc.config.option.platform global PLATFORM PLATFORM = option_value class TestDockerSplunk(Executor): @classmethod def setup_class(cls): super(TestDockerSplunk, cls).setup_class(PLATFORM) def setup_method(self, method): # Make sure all running containers are removed self._clean_docker_env() self.compose_file_name = None self.project_name = None self.DIR = None def teardown_method(self, method): if self.compose_file_name and self.project_name: if self.DIR: command = "docker-compose -p {} -f {} down --volumes --remove-orphans".format(self.project_name, os.path.join(self.DIR, self.compose_file_name)) else: command = "docker-compose -p {} -f test_scenarios/{} down --volumes --remove-orphans".format(self.project_name, self.compose_file_name) out, err, rc = self._run_command(command) self._clean_docker_env() if self.DIR: try: rmtree(self.DIR) except OSError: pass self.compose_file_name, self.project_name, self.DIR = None, None, None def test_compose_3idx1cm_custom_repl_factor(self): self.project_name = self.generate_random_string() # Generate default.yml cid = self.client.create_container(self.SPLUNK_IMAGE_NAME, tty=True, command="create-defaults") self.client.start(cid.get("Id")) output = self.get_container_logs(cid.get("Id")) self.client.remove_container(cid.get("Id"), v=True, force=True) # Get the password password = re.search(r"^ password: (.*?)\n", output, flags=re.MULTILINE|re.DOTALL).group(1).strip() assert password and password != "null" # Change repl factor & search factor output = re.sub(r' replication_factor: 3', r''' replication_factor: 2''', output) output = re.sub(r' search_factor: 3', r''' search_factor: 1''', output) # Write the default.yml to a file with open(os.path.join(self.SCENARIOS_DIR, "defaults", "{}.yml".format(self.project_name)), "w") as f: f.write(output) # Standup deployment try: self.compose_file_name = "3idx1cm.yaml" container_count, rc = self.compose_up(defaults_url="/tmp/defaults/{}.yml".format(self.project_name)) assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name), timeout=600) # Get container logs container_mapping = {"cm1": "cm", "idx1": "idx", "idx2": "idx", "idx3": "idx"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs("{}_{}_1".format(self.project_name, container)) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json("{}_{}_1".format(self.project_name, container)) self.check_common_keys(inventory_json, container_mapping[container]) try: assert inventory_json["splunk_indexer"]["hosts"] == ["idx1", "idx2", "idx3"] assert inventory_json["splunk_cluster_master"]["hosts"] == ["cm1"] except KeyError as e: self.logger.error(e) raise e # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Make sure apps are installed, and shcluster is setup properly containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) assert len(containers) == 4 for container in containers: container_name = container["Names"][0].strip("/").split("_")[1] splunkd_port = self.client.port(container["Id"], 8089)[0]["HostPort"] if container_name == "cm1": # Check the replication factor & search factor url = "https://localhost:{}/services/cluster/config/config?output_mode=json".format(splunkd_port) kwargs = {"auth": ("admin", self.password), "verify": False} status, content = self.handle_request_retry("GET", url, kwargs) assert status == 200 assert json.loads(content)["entry"][0]["content"]["replication_factor"] == 2 assert json.loads(content)["entry"][0]["content"]["search_factor"] == 1 except Exception as e: self.logger.error(e) raise e finally: try: os.remove(os.path.join(self.SCENARIOS_DIR, "defaults", "{}.yml".format(self.project_name))) except OSError as e: pass def test_compose_1idx3sh1cm1dep(self): self.project_name = self.generate_random_string() # Generate default.yml -- for SHC, we need a common default.yml otherwise things won't work cid = self.client.create_container(self.SPLUNK_IMAGE_NAME, tty=True, command="create-defaults") self.client.start(cid.get("Id")) output = self.get_container_logs(cid.get("Id")) self.client.remove_container(cid.get("Id"), v=True, force=True) # Get the password password = re.search(r"^ password: (.*?)\n", output, flags=re.MULTILINE|re.DOTALL).group(1).strip() assert password and password != "null" # Write the default.yml to a file with open(os.path.join(self.SCENARIOS_DIR, "defaults", "{}.yml".format(self.project_name)), "w") as f: f.write(output) # Tar the app before spinning up the scenario with tarfile.open(os.path.join(self.FIXTURES_DIR, "{}.tgz".format(self.project_name)), "w:gz") as tar: tar.add(self.EXAMPLE_APP, arcname=os.path.basename(self.EXAMPLE_APP)) # Standup deployment try: self.compose_file_name = "1idx3sh1cm1dep.yaml" container_count, rc = self.compose_up(defaults_url="/tmp/defaults/{}.yml".format(self.project_name), apps_url="http://appserver/{}.tgz".format(self.project_name)) assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name), timeout=600) # Get container logs container_mapping = {"sh1": "sh", "sh2": "sh", "sh3": "sh", "cm1": "cm", "idx1": "idx", "dep1": "dep"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs("{}_{}_1".format(self.project_name, container)) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json("{}_{}_1".format(self.project_name, container)) self.check_common_keys(inventory_json, container_mapping[container]) try: assert inventory_json["splunk_indexer"]["hosts"] == ["idx1"] assert inventory_json["splunk_search_head_captain"]["hosts"] == ["sh1"] assert inventory_json["splunk_search_head"]["hosts"] == ["sh2", "sh3"] assert inventory_json["splunk_cluster_master"]["hosts"] == ["cm1"] assert inventory_json["splunk_deployer"]["hosts"] == ["dep1"] except KeyError as e: self.logger.error(e) raise e # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Make sure apps are installed, and shcluster is setup properly containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) assert len(containers) == 7 for container in containers: # Skip the nginx container if "nginx" in container["Image"]: continue container_name = container["Names"][0].strip("/").split("_")[1] splunkd_port = self.client.port(container["Id"], 8089)[0]["HostPort"] if container_name in {"sh1", "sh2", "sh3", "idx1"}: # Check the app and version url = "https://localhost:{}/servicesNS/nobody/splunk_app_example/configs/conf-app/launcher?output_mode=json".format(splunkd_port) kwargs = {"auth": ("admin", self.password), "verify": False} status, content = self.handle_request_retry("GET", url, kwargs) assert status == 200 assert json.loads(content)["entry"][0]["content"]["version"] == "0.0.1" # Make sure preferred captain is set if container_name == "sh1": url = "https://localhost:{}/servicesNS/nobody/system/configs/conf-server/shclustering?output_mode=json".format(splunkd_port) kwargs = {"auth": ("admin", self.password), "verify": False} status, content = self.handle_request_retry("GET", url, kwargs) assert json.loads(content)["entry"][0]["content"]["preferred_captain"] == "1" # Search results won't return the correct results immediately :( time.sleep(30) RETRIES = 10 IMPLICIT_WAIT = 6 for n in range(RETRIES): try: self.logger.info("Attempt #{}: checking internal search host count".format(n+1)) search_providers, distinct_hosts = self.search_internal_distinct_hosts("{}_sh1_1".format(self.project_name), password=self.password) assert len(search_providers) == 2 assert "idx1" in search_providers and "sh1" in search_providers assert distinct_hosts == 6 break except Exception as e: self.logger.error("Attempt #{} error: {}".format(n+1, str(e))) if n < RETRIES-1: time.sleep(IMPLICIT_WAIT) continue raise e except Exception as e: self.logger.error(e) raise e finally: try: os.remove(os.path.join(self.SCENARIOS_DIR, "defaults", "{}.yml".format(self.project_name))) os.remove(os.path.join(self.FIXTURES_DIR, "{}.tgz".format(self.project_name))) except OSError as e: pass def test_compose_1uf1so(self): # Standup deployment self.compose_file_name = "1uf1so.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) # Get container logs container_mapping = {"so1": "so", "uf1": "uf"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs("{}_{}_1".format(self.project_name, container)) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json("{}_{}_1".format(self.project_name, container)) self.check_common_keys(inventory_json, container_mapping[container]) try: assert inventory_json["splunk_standalone"]["hosts"] == ["so1"] except KeyError as e: self.logger.error(e) raise e # Search results won't return the correct results immediately :( time.sleep(30) search_providers, distinct_hosts = self.search_internal_distinct_hosts("{}_so1_1".format(self.project_name), password=self.password) assert len(search_providers) == 1 assert search_providers[0] == "so1" assert distinct_hosts == 2 def test_compose_3idx1cm_default_repl_factor(self): self.project_name = self.generate_random_string() # Generate default.yml cid = self.client.create_container(self.SPLUNK_IMAGE_NAME, tty=True, command="create-defaults") self.client.start(cid.get("Id")) output = self.get_container_logs(cid.get("Id")) self.client.remove_container(cid.get("Id"), v=True, force=True) # Get the password password = re.search(r"^ password: (.*?)\n", output, flags=re.MULTILINE|re.DOTALL).group(1).strip() assert password and password != "null" # Write the default.yml to a file with open(os.path.join(self.SCENARIOS_DIR, "defaults", "{}.yml".format(self.project_name)), "w") as f: f.write(output) # Standup deployment try: self.compose_file_name = "3idx1cm.yaml" container_count, rc = self.compose_up(defaults_url="/tmp/defaults/{}.yml".format(self.project_name)) assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name), timeout=600) # Get container logs container_mapping = {"cm1": "cm", "idx1": "idx", "idx2": "idx", "idx3": "idx"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs("{}_{}_1".format(self.project_name, container)) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json("{}_{}_1".format(self.project_name, container)) self.check_common_keys(inventory_json, container_mapping[container]) try: assert inventory_json["splunk_indexer"]["hosts"] == ["idx1", "idx2", "idx3"] assert inventory_json["splunk_cluster_master"]["hosts"] == ["cm1"] except KeyError as e: self.logger.error(e) raise e # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Make sure apps are installed, and shcluster is setup properly containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) assert len(containers) == 4 for container in containers: container_name = container["Names"][0].strip("/").split("_")[1] splunkd_port = self.client.port(container["Id"], 8089)[0]["HostPort"] if container_name == "cm1": # Check the replication factor & search factor url = "https://localhost:{}/services/cluster/config/config?output_mode=json".format(splunkd_port) kwargs = {"auth": ("admin", self.password), "verify": False} status, content = self.handle_request_retry("GET", url, kwargs) assert status == 200 assert json.loads(content)["entry"][0]["content"]["replication_factor"] == 3 assert json.loads(content)["entry"][0]["content"]["search_factor"] == 3 except Exception as e: self.logger.error(e) raise e finally: try: os.remove(os.path.join(self.SCENARIOS_DIR, "defaults", "{}.yml".format(self.project_name))) except OSError as e: pass def test_compose_1so1cm_connected(self): # Standup deployment self.compose_file_name = "1so1cm_connected.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) # Get container logs container_mapping = {"so1": "so", "cm1": "cm"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs("{}_{}_1".format(self.project_name, container)) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json("{}_{}_1".format(self.project_name, container)) self.check_common_keys(inventory_json, container_mapping[container]) # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Check connections containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) for container in containers: container_name = container["Names"][0].strip("/").split('_')[1] splunkd_port = self.client.port(container["Id"], 8089)[0]["HostPort"] if container_name == "cm1": status, content = self.handle_request_retry("GET", "https://localhost:{}/services/cluster/master/searchheads?output_mode=json".format(splunkd_port), {"auth": ("admin", self.password), "verify": False}) assert status == 200 output = json.loads(content) assert len(output["entry"]) == 2 for sh in output["entry"]: assert sh["content"]["label"] in ["cm1", "so1"] assert sh["content"]["status"] == "Connected" def test_compose_1so1cm_unconnected(self): # Standup deployment self.compose_file_name = "1so1cm_unconnected.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) # Get container logs container_mapping = {"so1": "so", "cm1": "cm"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs("{}_{}_1".format(self.project_name, container)) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json("{}_{}_1".format(self.project_name, container)) self.check_common_keys(inventory_json, container_mapping[container]) # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Check connections containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) for container in containers: container_name = container["Names"][0].strip("/").split('_')[1] splunkd_port = self.client.port(container["Id"], 8089)[0]["HostPort"] if container_name == "cm1": status, content = self.handle_request_retry("GET", "https://localhost:{}/services/cluster/master/searchheads?output_mode=json".format(splunkd_port), {"auth": ("admin", self.password), "verify": False}) assert status == 200 output = json.loads(content) assert len(output["entry"]) == 1 assert output["entry"][0]["content"]["label"] == "cm1" assert output["entry"][0]["content"]["status"] == "Connected" def test_adhoc_1cm_idxc_pass4symmkey(self): # Create the container cid = None try: self.project_name = self.generate_random_string() cid = self.client.create_container(self.SPLUNK_IMAGE_NAME, tty=True, ports=[8089], name=self.project_name, environment={ "DEBUG": "true", "SPLUNK_START_ARGS": "--accept-license", "SPLUNK_PASSWORD": self.password, "SPLUNK_ROLE": "splunk_cluster_master", "SPLUNK_INDEXER_URL": "idx1", "SPLUNK_IDXC_PASS4SYMMKEY": "keepsummerbeingliketotallystokedaboutlikethegeneralvibeandstuff", "SPLUNK_IDXC_LABEL": "keepsummersafe", }, host_config=self.client.create_host_config(port_bindings={8089: ("0.0.0.0",)}) ) cid = cid.get("Id") self.client.start(cid) # Poll for the container to be ready assert self.wait_for_containers(1, name=self.project_name) # Check splunkd splunkd_port = self.client.port(cid, 8089)[0]["HostPort"] url = "https://localhost:{}/services/server/info".format(splunkd_port) kwargs = {"auth": ("admin", self.password), "verify": False} status, content = self.handle_request_retry("GET", url, kwargs) assert status == 200 # Check if the cluster label and pass4SymmKey line up exec_command = self.client.exec_create(cid, "cat /opt/splunk/etc/system/local/server.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "cluster_label = keepsummersafe" in std_out pass4SymmKey = re.search(r'\[clustering\].*?pass4SymmKey = (.*?)\n', std_out, flags=re.MULTILINE|re.DOTALL).group(1).strip() exec_command = self.client.exec_create(cid, "/opt/splunk/bin/splunk show-decrypted --value '{}'".format(pass4SymmKey), user="splunk") std_out = self.client.exec_start(exec_command) assert "keepsummerbeingliketotallystokedaboutlikethegeneralvibeandstuff" in std_out except Exception as e: self.logger.error(e) raise e finally: if cid: self.client.remove_container(cid, v=True, force=True) def test_compose_1cm_smartstore(self): # Generate default.yml self.project_name = self.generate_random_string() self.DIR = os.path.join(self.FIXTURES_DIR, self.project_name) os.mkdir(self.DIR) cid = self.client.create_container(self.SPLUNK_IMAGE_NAME, tty=True, command="create-defaults") self.client.start(cid.get("Id")) output = self.get_container_logs(cid.get("Id")) self.client.remove_container(cid.get("Id"), v=True, force=True) # Get the password password = re.search(r"^ password: (.*?)\n", output, flags=re.MULTILINE|re.DOTALL).group(1).strip() assert password and password != "null" # Add a custom conf file output = re.sub(r' smartstore: null', r''' smartstore: index: - indexName: default remoteName: remote_vol scheme: s3 remoteLocation: smartstore-test s3: access_key: abcd secret_key: 1234 endpoint: https://s3-region.amazonaws.com''', output) # Write the default.yml to a file with open(os.path.join(self.DIR, "default.yml"), "w") as f: f.write(output) # Create the container and mount the default.yml cid = None try: cid = self.client.create_container(self.SPLUNK_IMAGE_NAME, tty=True, ports=[8089], volumes=["/tmp/defaults/default.yml"], name=self.project_name, environment={ "DEBUG": "true", "SPLUNK_START_ARGS": "--accept-license", "SPLUNK_PASSWORD": self.password, "SPLUNK_ROLE": "splunk_cluster_master", "SPLUNK_INDEXER_URL": "idx1" }, host_config=self.client.create_host_config(binds=[self.DIR + "/default.yml:/tmp/defaults/default.yml"], port_bindings={8089: ("0.0.0.0",)}) ) cid = cid.get("Id") self.client.start(cid) # Poll for the container to be ready assert self.wait_for_containers(1, name=self.project_name) # Check splunkd splunkd_port = self.client.port(cid, 8089)[0]["HostPort"] url = "https://localhost:{}/services/server/info".format(splunkd_port) kwargs = {"auth": ("admin", self.password), "verify": False} status, content = self.handle_request_retry("GET", url, kwargs) assert status == 200 # Check if the created file exists exec_command = self.client.exec_create(cid, "cat /opt/splunk/etc/master-apps/_cluster/local/indexes.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert 'remotePath = volume:remote_vol/$_index_name' in std_out assert 'repFactor = auto' in std_out assert '[volume:remote_vol]' in std_out assert 'storageType = remote' in std_out assert 'path = s3://smartstore-test' in std_out assert 'remote.s3.access_key = abcd' in std_out assert 'remote.s3.secret_key = 1234' in std_out assert 'remote.s3.endpoint = https://s3-region.amazonaws.com' in std_out except Exception as e: self.logger.error(e) raise e finally: if cid: self.client.remove_container(cid, v=True, force=True) try: os.remove(os.path.join(self.DIR, "default.yml")) except OSError: pass def test_compose_1sh1cm(self): # Standup deployment self.compose_file_name = "1sh1cm.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) # Get container logs container_mapping = {"sh1": "sh", "cm1": "cm"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs("{}_{}_1".format(self.project_name, container)) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json("{}_{}_1".format(self.project_name, container)) self.check_common_keys(inventory_json, container_mapping[container]) # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Check connections containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) for container in containers: container_name = container["Names"][0].strip("/").split('_')[1] splunkd_port = self.client.port(container["Id"], 8089)[0]["HostPort"] if container_name == "cm1": status, content = self.handle_request_retry("GET", "https://localhost:{}/services/cluster/master/searchheads?output_mode=json".format(splunkd_port), {"auth": ("admin", self.password), "verify": False}) assert status == 200 output = json.loads(content) # There's only 1 "standalone" search head connected and 1 cluster master assert len(output["entry"]) == 2 for sh in output["entry"]: assert sh["content"]["label"] == "sh1" or sh["content"]["label"] == "cm1" assert sh["content"]["status"] == "Connected" def test_compose_1sh1cm1dmc(self): # Standup deployment self.compose_file_name = "1sh1cm1dmc.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) self.check_dmc(containers, 2, 0, 2, 1, 3) def test_compose_1sh2idx2hf1dmc(self): # Standup deployment self.compose_file_name = "1sh2idx2hf1dmc.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) self.check_dmc(containers, 3, 2, 2, 0, 4) def test_compose_3idx1cm1dmc(self): # Standup deployment self.compose_file_name = "3idx1cm1dmc.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name), timeout=900) containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) self.check_dmc(containers, 4, 3, 2, 1, 5) def test_compose_1uf1so1dmc(self): # Standup deployment self.compose_file_name = "1uf1so1dmc.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) self.check_dmc(containers, 1, 1, 1, 0, 2) def test_compose_1so1dmc(self): # Standup deployment self.compose_file_name = "1so1dmc.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) self.check_dmc(containers, 1, 1, 1, 0, 2) def test_compose_2idx2sh1dmc(self): # Standup deployment self.compose_file_name = "2idx2sh1dmc.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) self.check_dmc(containers, 4, 2, 3, 0, 5) def test_compose_2idx2sh(self): # Standup deployment self.compose_file_name = "2idx2sh.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) # Get container logs container_mapping = {"sh1": "sh", "sh2": "sh", "idx1": "idx", "idx2": "idx"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs("{}_{}_1".format(self.project_name, container)) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json("{}_{}_1".format(self.project_name, container)) self.check_common_keys(inventory_json, container_mapping[container]) try: assert inventory_json["splunk_indexer"]["hosts"] == ["idx1", "idx2"] assert inventory_json["splunk_search_head"]["hosts"] == ["sh1", "sh2"] except KeyError as e: self.logger.error(e) raise e # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Check connections idx_list = ["idx1", "idx2"] containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) for container in containers: c_name = container["Labels"]["com.docker.compose.service"] if "sh1" in c_name or "sh2" in c_name: splunkd_port = self.client.port(container["Id"], 8089)[0]["HostPort"] url = "https://localhost:{}/services/search/distributed/peers?output_mode=json".format(splunkd_port) kwargs = {"auth": ("admin", self.password), "verify": False} status, content = self.handle_request_retry("GET", url, kwargs) assert status == 200 output = json.loads(content) peers = [x["content"]["peerName"] for x in output["entry"]] assert len(peers) == 2 and set(peers) == set(idx_list) # Search results won't return the correct results immediately :( time.sleep(30) search_providers, distinct_hosts = self.search_internal_distinct_hosts("{}_sh1_1".format(self.project_name), password=self.password) assert len(search_providers) == 3 assert "idx1" in search_providers and "idx2" in search_providers and "sh1" in search_providers assert distinct_hosts == 4 def test_compose_2idx2sh1cm(self): # Standup deployment self.compose_file_name = "2idx2sh1cm.yaml" self.project_name = self.generate_random_string() container_count, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name), timeout=600) # Get container logs container_mapping = {"sh1": "sh", "sh2": "sh", "idx1": "idx", "idx2": "idx", "cm1": "cm"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs("{}_{}_1".format(self.project_name, container)) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json("{}_{}_1".format(self.project_name, container)) self.check_common_keys(inventory_json, container_mapping[container]) try: assert inventory_json["splunk_cluster_master"]["hosts"] == ["cm1"] assert inventory_json["splunk_indexer"]["hosts"] == ["idx1", "idx2"] assert inventory_json["splunk_search_head"]["hosts"] == ["sh1", "sh2"] except KeyError as e: self.logger.error(e) raise e # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Check connections idx_list = ["idx1", "idx2"] sh_list = ["sh1", "sh2", "cm1"] containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) for container in containers: container_name = container["Names"][0].strip("/").split('_')[1] splunkd_port = self.client.port(container["Id"], 8089)[0]["HostPort"] if container_name == "cm1": status, content = self.handle_request_retry("GET", "https://localhost:{}/services/cluster/master/searchheads?output_mode=json".format(splunkd_port), {"auth": ("admin", self.password), "verify": False}) assert status == 200 output = json.loads(content) for sh in output["entry"]: if sh["content"]["label"] in sh_list and sh["content"]["status"] == "Connected": sh_list.remove(sh["content"]["label"]) status, content = self.handle_request_retry("GET", "https://localhost:{}/services/cluster/master/peers?output_mode=json".format(splunkd_port), {"auth": ("admin", self.password), "verify": False}) assert status == 200 output = json.loads(content) for idx in output["entry"]: if idx["content"]["label"] in idx_list and idx["content"]["status"] == "Up": idx_list.remove(idx["content"]["label"]) assert len(idx_list) == 0 and len(sh_list) == 0 # Add one more indexer self.compose_file_name = "2idx2sh1cm_idx3.yaml" _, rc = self.compose_up() assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count+1, label="com.docker.compose.project={}".format(self.project_name), timeout=600) retries = 10 for n in range(retries): try: status, content = self.handle_request_retry("GET", "https://localhost:{}/services/cluster/master/peers?output_mode=json".format(splunkd_port), {"auth": ("admin", self.password), "verify": False}) assert status == 200 output = json.loads(content) assert len(output["entry"]) == 3 indexers = [] for idx in output["entry"]: indexers.append(idx["content"]["label"]) assert "idx1" in indexers assert "idx2" in indexers assert "idx3" in indexers break except Exception as err: time.sleep(10) if n < retries-1: continue raise err def test_compose_1deployment1cm(self): self.project_name = self.generate_random_string() # Tar the app before spinning up the scenario with tarfile.open(os.path.join(self.FIXTURES_DIR, "{}.tgz".format(self.project_name)), "w:gz") as tar: tar.add(self.EXAMPLE_APP, arcname=os.path.basename(self.EXAMPLE_APP)) # Generate default.yml cid = self.client.create_container(self.SPLUNK_IMAGE_NAME, tty=True, command="create-defaults") self.client.start(cid.get("Id")) output = self.get_container_logs(cid.get("Id")) self.client.remove_container(cid.get("Id"), v=True, force=True) # Add a custom conf file output = re.sub(r' group: splunk', r''' group: splunk conf: - key: user-prefs value: directory: /opt/splunk/etc/users/admin/user-prefs/local content: general: default_namespace: appboilerplate search_syntax_highlighting: dark search_assistant: "serverClass:secrets:app:test": {}''', output) # Write the default.yml to a file with open(os.path.join(self.SCENARIOS_DIR, "defaults", "{}.yml".format(self.project_name)), "w") as f: f.write(output) # Standup deployment try: self.compose_file_name = "1deployment1cm.yaml" container_count, rc = self.compose_up(defaults_url="/tmp/defaults/{}.yml".format(self.project_name), apps_url="http://appserver/{}.tgz".format(self.project_name)) assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) # Get container logs container_mapping = {"cm1": "cm", "depserver1": "deployment_server"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs("{}_{}_1".format(self.project_name, container)) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json("{}_{}_1".format(self.project_name, container)) self.check_common_keys(inventory_json, container_mapping[container]) # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Make sure apps are installed and certain subdirectories are excluded containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) assert len(containers) == 3 for container in containers: # Skip the nginx container if "nginx" in container["Image"]: continue container_name = container["Names"][0].strip("/").split("_")[1] splunkd_port = self.client.port(container["Id"], 8089)[0]["HostPort"] if container_name == "depserver1": # Check the app and version url = "https://localhost:{}/servicesNS/nobody/splunk_app_example/configs/conf-app/launcher?output_mode=json".format(splunkd_port) resp = requests.get(url, auth=("admin", self.password), verify=False) # Deployment server should *not* install the app assert resp.status_code == 404 # Check that the app exists in etc/apps exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/apps/splunk_app_example/local/", user="splunk") std_out = self.client.exec_start(exec_command) assert "savedsearches.conf" in std_out assert "app.conf" in std_out exec_command = self.client.exec_create(container["Id"], "cat /opt/splunk/etc/apps/splunk_app_example/local/app.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "state = disabled" in std_out # Check that the app exists in etc/deployment-apps exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/deployment-apps/splunk_app_example/local/", user="splunk") std_out = self.client.exec_start(exec_command) assert "savedsearches.conf" in std_out assert "app.conf" in std_out exec_command = self.client.exec_create(container["Id"], "cat /opt/splunk/etc/deployment-apps/splunk_app_example/local/app.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "# Autogenerated file " == std_out if container_name == "cm1": # Check if the created file exists exec_command = self.client.exec_create(container["Id"], "cat /opt/splunk/etc/users/admin/user-prefs/local/user-prefs.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "[serverClass:secrets:app:test]" in std_out assert "[general]" in std_out assert "default_namespace = appboilerplate" in std_out assert "search_syntax_highlighting = dark" in std_out assert "search_assistant" in std_out RETRIES = 5 for i in range(RETRIES): try: # Check the app and version url = "https://localhost:{}/servicesNS/nobody/splunk_app_example/configs/conf-app/launcher?output_mode=json".format(splunkd_port) kwargs = {"auth": ("admin", self.password), "verify": False} status, content = self.handle_request_retry("GET", url, kwargs) assert status == 200 assert json.loads(content)["entry"][0]["content"]["version"] == "0.0.1" exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/apps/splunk_app_example/local/", user="splunk") std_out = self.client.exec_start(exec_command) assert "savedsearches.conf" in std_out assert "app.conf" in std_out exec_command = self.client.exec_create(container["Id"], "cat /opt/splunk/etc/apps/splunk_app_example/local/app.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "# Autogenerated file" in std_out assert "state = enabled" in std_out except Exception as e: self.logger.error(e) if i < RETRIES-1: time.sleep(30) continue raise e except Exception as e: self.logger.error(e) raise e finally: try: os.remove(os.path.join(self.SCENARIOS_DIR, "defaults", "{}.yml".format(self.project_name))) os.remove(os.path.join(self.FIXTURES_DIR, "{}.tgz".format(self.project_name))) except OSError as e: pass def test_compose_1deployment1so(self): self.project_name = self.generate_random_string() # Tar the app before spinning up the scenario with tarfile.open(os.path.join(self.FIXTURES_DIR, "{}.tgz".format(self.project_name)), "w:gz") as tar: tar.add(self.EXAMPLE_APP, arcname=os.path.basename(self.EXAMPLE_APP)) # Standup deployment try: self.compose_file_name = "1deployment1so.yaml" container_count, rc = self.compose_up(apps_url="http://appserver/{}.tgz".format(self.project_name)) assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) # Get container logs container_mapping = {"{}_so1_1".format(self.project_name): "so", "{}_depserver1_1".format(self.project_name): "deployment_server"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs(container) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json(container) self.check_common_keys(inventory_json, container_mapping[container]) # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Make sure apps are installed and certain subdirectories are excluded containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) assert len(containers) == 3 for container in containers: # Skip the nginx container if "nginx" in container["Image"]: continue container_name = container["Names"][0].strip("/").split('_')[1] splunkd_port = self.client.port(container["Id"], 8089)[0]["HostPort"] if container_name == "depserver1": # Check the app and version url = "https://localhost:{}/servicesNS/nobody/splunk_app_example/configs/conf-app/launcher?output_mode=json".format(splunkd_port) resp = requests.get(url, auth=("admin", self.password), verify=False) # Deployment server should *not* install the app assert resp.status_code == 404 # Check that the app exists in etc/apps exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/apps/splunk_app_example/local/", user="splunk") std_out = self.client.exec_start(exec_command) assert "savedsearches.conf" in std_out assert "app.conf" in std_out exec_command = self.client.exec_create(container["Id"], "cat /opt/splunk/etc/apps/splunk_app_example/local/app.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "state = disabled" in std_out # Check that the app exists in etc/deployment-apps exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/deployment-apps/splunk_app_example/local/", user="splunk") std_out = self.client.exec_start(exec_command) assert "savedsearches.conf" in std_out assert "app.conf" in std_out exec_command = self.client.exec_create(container["Id"], "cat /opt/splunk/etc/deployment-apps/splunk_app_example/local/app.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "# Autogenerated file " == std_out if container_name == "so1": RETRIES = 5 for i in range(RETRIES): try: # Check the app and version url = "https://localhost:{}/servicesNS/nobody/splunk_app_example/configs/conf-app/launcher?output_mode=json".format(splunkd_port) kwargs = {"auth": ("admin", self.password), "verify": False} status, content = self.handle_request_retry("GET", url, kwargs) assert status == 200 assert json.loads(content)["entry"][0]["content"]["version"] == "0.0.1" exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/apps/splunk_app_example/local/", user="splunk") std_out = self.client.exec_start(exec_command) assert "savedsearches.conf" in std_out assert "app.conf" in std_out exec_command = self.client.exec_create(container["Id"], "cat /opt/splunk/etc/apps/splunk_app_example/local/app.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "# Autogenerated file" in std_out assert "state = enabled" in std_out except Exception as e: self.logger.error(e) if i < RETRIES-1: time.sleep(30) continue raise e except Exception as e: self.logger.error(e) raise e finally: try: os.remove(os.path.join(self.FIXTURES_DIR, "{}.tgz".format(self.project_name))) except OSError: pass def test_compose_1deployment1uf(self): self.project_name = self.generate_random_string() # Tar the app before spinning up the scenario with tarfile.open(os.path.join(self.FIXTURES_DIR, "{}.tgz".format(self.project_name)), "w:gz") as tar: tar.add(self.EXAMPLE_APP, arcname=os.path.basename(self.EXAMPLE_APP)) # Standup deployment try: self.compose_file_name = "1deployment1uf.yaml" container_count, rc = self.compose_up(apps_url="http://appserver/{}.tgz".format(self.project_name)) assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name)) # Get container logs container_mapping = {"{}_uf1_1".format(self.project_name): "uf", "{}_depserver1_1".format(self.project_name): "deployment_server"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs(container) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json(container) self.check_common_keys(inventory_json, container_mapping[container]) # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Make sure apps are installed, and shcluster is setup properly containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) assert len(containers) == 3 for container in containers: # Skip the nginx container if "nginx" in container["Image"]: continue container_name = container["Names"][0].strip("/") container_name = container_name.split('_')[1] splunkd_port = self.client.port(container["Id"], 8089)[0]["HostPort"] if container_name == "depserver1": # Check the app and version url = "https://localhost:{}/servicesNS/nobody/splunk_app_example/configs/conf-app/launcher?output_mode=json".format(splunkd_port) resp = requests.get(url, auth=("admin", self.password), verify=False) # Deployment server should *not* install the app assert resp.status_code == 404 # Check that the app exists in etc/apps exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/apps/splunk_app_example/local/", user="splunk") std_out = self.client.exec_start(exec_command) assert "savedsearches.conf" in std_out assert "app.conf" in std_out exec_command = self.client.exec_create(container["Id"], "cat /opt/splunk/etc/apps/splunk_app_example/local/app.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "state = disabled" in std_out # Check that the app exists in etc/deployment-apps exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/deployment-apps/splunk_app_example/local/", user="splunk") std_out = self.client.exec_start(exec_command) assert "savedsearches.conf" in std_out assert "app.conf" in std_out exec_command = self.client.exec_create(container["Id"], "cat /opt/splunk/etc/deployment-apps/splunk_app_example/local/app.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "# Autogenerated file " == std_out if container_name == "uf1": RETRIES = 5 for i in range(RETRIES): try: # Check the app and version url = "https://localhost:{}/servicesNS/nobody/splunk_app_example/configs/conf-app/launcher?output_mode=json".format(splunkd_port) kwargs = {"auth": ("admin", self.password), "verify": False} status, content = self.handle_request_retry("GET", url, kwargs) assert status == 200 assert json.loads(content)["entry"][0]["content"]["version"] == "0.0.1" exec_command = self.client.exec_create(container["Id"], "ls /opt/splunkforwarder/etc/apps/splunk_app_example/local/", user="splunk") std_out = self.client.exec_start(exec_command) assert "savedsearches.conf" in std_out assert "app.conf" in std_out exec_command = self.client.exec_create(container["Id"], "cat /opt/splunkforwarder/etc/apps/splunk_app_example/local/app.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "# Autogenerated file" in std_out assert "state = enabled" in std_out except Exception as e: self.logger.error(e) if i < RETRIES-1: time.sleep(30) continue raise e except Exception as e: self.logger.error(e) raise e finally: try: os.remove(os.path.join(self.FIXTURES_DIR, "{}.tgz".format(self.project_name))) except OSError: pass def test_compose_3idx1cm_splunktcp_ssl(self): self.project_name = self.generate_random_string() # Generate default.yml cid = self.client.create_container(self.SPLUNK_IMAGE_NAME, tty=True, command="create-defaults") self.client.start(cid.get("Id")) output = self.get_container_logs(cid.get("Id")) self.client.remove_container(cid.get("Id"), v=True, force=True) # Get the password password = re.search(r"^ password: (.*?)\n", output, flags=re.MULTILINE|re.DOTALL).group(1).strip() assert password and password != "null" # Commands to generate self-signed certificates for Splunk here: https://docs.splunk.com/Documentation/Splunk/latest/Security/ConfigureSplunkforwardingtousesignedcertificates passphrase = "carolebaskindidit" cmds = [ "openssl genrsa -aes256 -passout pass:{pw} -out {path}/ca.key 2048".format(pw=passphrase, path=self.DEFAULTS_DIR), "openssl req -new -key {path}/ca.key -passin pass:{pw} -out {path}/ca.csr -subj /CN=localhost".format(pw=passphrase, path=self.DEFAULTS_DIR), "openssl x509 -req -in {path}/ca.csr -sha512 -passin pass:{pw} -signkey {path}/ca.key -CAcreateserial -out {path}/ca.pem -days 3".format(pw=passphrase, path=self.DEFAULTS_DIR), "openssl genrsa -aes256 -passout pass:{pw} -out {path}/server.key 2048".format(pw=passphrase, path=self.DEFAULTS_DIR), "openssl req -new -passin pass:{pw} -key {path}/server.key -out {path}/server.csr -subj /CN=localhost".format(pw=passphrase, path=self.DEFAULTS_DIR), "openssl x509 -req -passin pass:{pw} -in {path}/server.csr -SHA256 -CA {path}/ca.pem -CAkey {path}/ca.key -CAcreateserial -out {path}/server.pem -days 3".format(pw=passphrase, path=self.DEFAULTS_DIR), "cat {path}/server.pem {path}/server.key {path}/ca.pem > {path}/cert.pem".format(path=self.DEFAULTS_DIR) ] for cmd in cmds: execute_cmd = subprocess.check_output(["/bin/sh", "-c", cmd]) # Update s2s ssl settings output = re.sub(r''' s2s:.*?ssl: false''', r''' s2s: ca: /tmp/defaults/ca.pem cert: /tmp/defaults/cert.pem enable: true password: {} port: 9997 ssl: true'''.format(passphrase), output, flags=re.DOTALL) # Write the default.yml to a file with open(os.path.join(self.DEFAULTS_DIR, "{}.yml".format(self.project_name)), "w") as f: f.write(output) # Standup deployment try: self.compose_file_name = "3idx1cm.yaml" container_count, rc = self.compose_up(defaults_url="/tmp/defaults/{}.yml".format(self.project_name)) assert rc == 0 # Wait for containers to come up assert self.wait_for_containers(container_count, label="com.docker.compose.project={}".format(self.project_name), timeout=600) # Get container logs container_mapping = {"cm1": "cm", "idx1": "idx", "idx2": "idx", "idx3": "idx"} for container in container_mapping: # Check ansible version & configs ansible_logs = self.get_container_logs("{}_{}_1".format(self.project_name, container)) self.check_ansible(ansible_logs) # Check values in log output inventory_json = self.extract_json("{}_{}_1".format(self.project_name, container)) self.check_common_keys(inventory_json, container_mapping[container]) try: assert inventory_json["splunk_indexer"]["hosts"] == ["idx1", "idx2", "idx3"] assert inventory_json["splunk_cluster_master"]["hosts"] == ["cm1"] except KeyError as e: self.logger.error(e) raise e # Check Splunkd on all the containers assert self.check_splunkd("admin", self.password) # Make sure apps are installed, and shcluster is setup properly containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)}) assert len(containers) == 4 for container in containers: container_name = container["Names"][0].strip("/").split("_")[1] cid = container["Id"] exec_command = self.client.exec_create(cid, "cat /opt/splunk/etc/system/local/inputs.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "[splunktcp-ssl:9997]" in std_out assert "disabled = 0" in std_out assert "[SSL]" in std_out assert "serverCert = /tmp/defaults/cert.pem" in std_out assert "[sslConfig]" not in std_out assert "rootCA = /tmp/defaults/ca.pem" in std_out if container_name == "cm1": exec_command = self.client.exec_create(cid, "cat /opt/splunk/etc/system/local/outputs.conf", user="splunk") std_out = self.client.exec_start(exec_command) assert "clientCert = /tmp/defaults/cert.pem" in std_out assert "sslPassword" in std_out assert "useClientSSLCompression = true" in std_out # Check that data is being forwarded properly time.sleep(30) search_providers, distinct_hosts = self.search_internal_distinct_hosts("{}_cm1_1".format(self.project_name), password=self.password) assert len(search_providers) == 4 assert "idx1" in search_providers assert "idx2" in search_providers assert "idx3" in search_providers assert distinct_hosts == 4 except Exception as e: self.logger.error(e) raise e finally: files = [ os.path.join(self.DEFAULTS_DIR, "ca.key"), os.path.join(self.DEFAULTS_DIR, "ca.csr"), os.path.join(self.DEFAULTS_DIR, "ca.pem"), os.path.join(self.DEFAULTS_DIR, "server.key"), os.path.join(self.DEFAULTS_DIR, "server.csr"), os.path.join(self.DEFAULTS_DIR, "server.pem"), os.path.join(self.DEFAULTS_DIR, "cert.pem"), os.path.join(self.DEFAULTS_DIR, "{}.yml".format(self.project_name)) ] self.cleanup_files(files)
59.745257
220
0.582146
7,434
66,138
5.011299
0.063761
0.037204
0.050733
0.054679
0.861277
0.850325
0.838702
0.810463
0.796049
0.791915
0
0.01415
0.302247
66,138
1,107
221
59.745257
0.793122
0.084112
0
0.708287
0
0.01547
0.180717
0.05142
0
0
0
0
0.21326
1
0.027624
false
0.076243
0.018785
0
0.047514
0
0
0
0
null
0
0
0
1
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
1
0
0
0
0
0
8
229d3a5fba43840eafc7a8fc273b583ec8760d17
134
py
Python
tests/pyflakes_bears/pep8_naming_test_files/E11/invalid.py
MacBox7/coala-pyflakes
637f8a2e77973384be79d30b0dae1f43072e60c8
[ "MIT" ]
null
null
null
tests/pyflakes_bears/pep8_naming_test_files/E11/invalid.py
MacBox7/coala-pyflakes
637f8a2e77973384be79d30b0dae1f43072e60c8
[ "MIT" ]
12
2018-05-21T06:12:59.000Z
2018-07-30T10:37:16.000Z
tests/pyflakes_bears/pep8_naming_test_files/E11/invalid.py
MacBox7/coala-pyflakes
637f8a2e77973384be79d30b0dae1f43072e60c8
[ "MIT" ]
1
2018-06-10T16:16:47.000Z
2018-06-10T16:16:47.000Z
class Foo: [mix_Case, var2] = range(2) def bar(): ''' >>> class Foo(): ... mix_Case = 0 ''' pass
13.4
31
0.395522
15
134
3.4
0.733333
0.313725
0.431373
0.588235
0
0
0
0
0
0
0
0.037975
0.410448
134
9
32
14.888889
0.607595
0.276119
0
0
0
0
0
0
0
0
0
0
0
1
0.25
true
0.25
0
0
0.5
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
0
0
0
0
0
8
22a99f31ad3d646eaec1ecd1f7a1bf796c852740
168,089
py
Python
test/IECoreHoudini/SceneCacheTest.py
goddardl/cortex
323a160fd831569591cde1504f415a638f8b85bc
[ "BSD-3-Clause" ]
null
null
null
test/IECoreHoudini/SceneCacheTest.py
goddardl/cortex
323a160fd831569591cde1504f415a638f8b85bc
[ "BSD-3-Clause" ]
null
null
null
test/IECoreHoudini/SceneCacheTest.py
goddardl/cortex
323a160fd831569591cde1504f415a638f8b85bc
[ "BSD-3-Clause" ]
null
null
null
########################################################################## # # Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Image Engine Design nor the names of any # other contributors to this software may be used to endorse or # promote products derived from this software without specific prior # written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ########################################################################## import os import hou import IECore import IECoreHoudini import unittest class TestSceneCache( IECoreHoudini.TestCase ) : __testFile = "test/test.scc" __testOutFile = "test/testOut.scc" __testLinkedOutFile = "test/testOut.lscc" __testHip = "test/test.hip" __testBgeo = "test/test.bgeo" __testBgeoGz = "test/test.bgeo.gz" __testGeo = "test/test.geo" def sop( self, parent=None ) : if not parent : parent = hou.node( "/obj" ).createNode( "geo", run_init_scripts=False ) sop = parent.createNode( "ieSceneCacheSource" ) sop.parm( "file" ).set( TestSceneCache.__testFile ) return sop def xform( self, parent=None ) : if not parent : parent = hou.node( "/obj" ) xform = parent.createNode( "ieSceneCacheTransform" ) xform.parm( "file" ).set( TestSceneCache.__testFile ) return xform def geometry( self, parent=None ) : if not parent : parent = hou.node( "/obj" ) geometry = parent.createNode( "ieSceneCacheGeometry" ) geometry.parm( "file" ).set( TestSceneCache.__testFile ) return geometry def sopXform( self, parent=None ) : if not parent : parent = hou.node( "/obj" ).createNode( "geo", run_init_scripts=False ) box1 = parent.createNode( "box" ) box2 = parent.createNode( "box" ) box3 = parent.createNode( "box" ) name1 = box1.createOutputNode( "name" ) name1.parm( "name1" ).set( "/1" ) name2 = box2.createOutputNode( "name" ) name2.parm( "name1" ).set( "/1/2" ) name3 = box3.createOutputNode( "name" ) name3.parm( "name1" ).set( "/1/2/3" ) merge = name1.createOutputNode( "merge" ) merge.setInput( 1, name2 ) merge.setInput( 2, name3 ) sop = merge.createOutputNode( "ieSceneCacheTransform" ) sop.parm( "file" ).set( TestSceneCache.__testFile ) return sop def rop( self, rootObject ) : rop = hou.node( "/out" ).createNode( "ieSceneCacheWriter" ) rop.parm( "file" ).set( TestSceneCache.__testOutFile ) rop.parm( "rootObject" ).set( rootObject.path() ) rop.parmTuple( "f" ).deleteAllKeyframes() return rop def writeSCC( self, rotation=IECore.V3d( 0, 0, 0 ), time=0 ) : scene = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Write ) sc = scene.createChild( str( 1 ) ) mesh = IECore.MeshPrimitive.createBox(IECore.Box3f(IECore.V3f(0),IECore.V3f(1))) mesh["Cs"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Uniform, IECore.V3fVectorData( [ IECore.V3f( 1, 0, 0 ) ] * 6 ) ) sc.writeObject( mesh, time ) matrix = IECore.M44d.createTranslated( IECore.V3d( 1, 0, 0 ) ) matrix = matrix.rotate( rotation ) sc.writeTransform( IECore.M44dData( matrix ), time ) sc = sc.createChild( str( 2 ) ) mesh = IECore.MeshPrimitive.createBox(IECore.Box3f(IECore.V3f(0),IECore.V3f(1))) mesh["Cs"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Uniform, IECore.V3fVectorData( [ IECore.V3f( 0, 1, 0 ) ] * 6 ) ) sc.writeObject( mesh, time ) matrix = IECore.M44d.createTranslated( IECore.V3d( 2, 0, 0 ) ) matrix = matrix.rotate( rotation ) sc.writeTransform( IECore.M44dData( matrix ), time ) sc = sc.createChild( str( 3 ) ) mesh = IECore.MeshPrimitive.createBox(IECore.Box3f(IECore.V3f(0),IECore.V3f(1))) mesh["Cs"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Uniform, IECore.V3fVectorData( [ IECore.V3f( 0, 0, 1 ) ] * 6 ) ) sc.writeObject( mesh, time ) matrix = IECore.M44d.createTranslated( IECore.V3d( 3, 0, 0 ) ) matrix = matrix.rotate( rotation ) sc.writeTransform( IECore.M44dData( matrix ), time ) return scene def testBadFile( self ) : def testNode( node ) : node.parm( "file" ).set( "" ) self.assertRaises( hou.OperationFailed, IECore.curry( node.cook, True ) ) self.failUnless( node.errors() ) node.parm( "file" ).set( "/tmp/fake" ) self.assertRaises( hou.OperationFailed, IECore.curry( node.cook, True ) ) self.failUnless( node.errors() ) node.parm( "file" ).set( TestSceneCache.__testFile ) self.assertRaises( hou.OperationFailed, IECore.curry( node.cook, True ) ) self.failUnless( node.errors() ) self.writeSCC() node.cook( force=True ) self.failUnless( not node.errors() ) testNode( self.sop() ) os.remove( TestSceneCache.__testFile ) testNode( self.xform() ) os.remove( TestSceneCache.__testFile ) testNode( self.geometry() ) os.remove( TestSceneCache.__testFile ) testNode( self.sopXform() ) def testBadPath( self ) : def testNode( node ) : node.cook( force=True ) self.failUnless( not node.errors() ) node.parm( "root" ).set( "/1/fake" ) self.assertRaises( hou.OperationFailed, IECore.curry( node.cook, True ) ) self.failUnless( node.errors() ) node.parm( "root" ).set( "/1/2" ) node.cook( force=True ) self.failUnless( not node.errors() ) if isinstance( node, hou.ObjNode ) : node.parm( "expand" ).pressButton() self.failUnless( node.children() ) node.parm( "root" ).set( "/1/fake" ) node.parm( "collapse" ).pressButton() node.parm( "expand" ).pressButton() self.assertEqual( node.children(), tuple() ) self.writeSCC() testNode( self.sop() ) testNode( self.xform() ) testNode( self.geometry() ) testNode( self.sopXform() ) def testObjSubPaths( self ) : self.writeSCC() def testSimple( node ) : node.parm( "reload" ).pressButton() self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 0, 0, 0 ) ) node.parm( "root" ).set( "/1" ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 1, 0, 0 ) ) node.parm( "root" ).set( "/1/2" ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 3, 0, 0 ) ) node.parm( "root" ).set( "/1/2/3" ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 6, 0, 0 ) ) xform = self.xform() geo = self.geometry() testSimple( xform ) testSimple( geo ) self.writeSCC( rotation = IECore.V3d( 0, 0, IECore.degreesToRadians( -30 ) ) ) def testRotated( node ) : node.parm( "reload" ).pressButton() node.parm( "root" ).set( "/" ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( node.parmTransform().extractRotates(), hou.Vector3( 0, 0, 0 ) ) self.failUnless( node.parmTransform().extractRotates().isAlmostEqual( hou.Vector3( 0, 0, 0 ) ) ) node.parm( "root" ).set( "/1" ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 1, 0, 0 ) ) self.failUnless( node.parmTransform().extractRotates().isAlmostEqual( hou.Vector3( 0, 0, -30 ) ) ) node.parm( "root" ).set( "/1/2" ) self.failUnless( node.parmTransform().extractTranslates().isAlmostEqual( hou.Vector3( 2.73205, -1, 0 ) ) ) self.failUnless( node.parmTransform().extractRotates().isAlmostEqual( hou.Vector3( 0, 0, -60 ) ) ) node.parm( "root" ).set( "/1/2/3" ) self.failUnless( node.parmTransform().extractTranslates().isAlmostEqual( hou.Vector3( 4.23205, -3.59808, 0 ) ) ) self.failUnless( node.parmTransform().extractRotates().isAlmostEqual( hou.Vector3( 0, 0, -90 ) ) ) testRotated( xform ) testRotated( geo ) def testObjSpaceModes( self ) : self.writeSCC() def testSimple( node ) : node.parm( "reload" ).pressButton() node.parm( "root" ).set( "/1/2" ) self.assertEqual( node.parm( "space" ).eval(), IECoreHoudini.SceneCacheNode.Space.World ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 3, 0, 0 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Path ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 0, 0, 0 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Local ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 2, 0, 0 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Object ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 0, 0, 0 ) ) xform = self.xform() geo = self.geometry() testSimple( xform ) testSimple( geo ) self.writeSCC( rotation = IECore.V3d( 0, 0, IECore.degreesToRadians( -30 ) ) ) def testRotated( node ) : node.parm( "reload" ).pressButton() node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.World ) self.failUnless( node.parmTransform().extractTranslates().isAlmostEqual( hou.Vector3( 2.73205, -1, 0 ) ) ) self.failUnless( node.parmTransform().extractRotates().isAlmostEqual( hou.Vector3( 0, 0, -60 ) ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Path ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 0, 0, 0 ) ) self.failUnless( node.parmTransform().extractRotates().isAlmostEqual( hou.Vector3( 0, 0, 0 ) ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Local ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 2, 0, 0 ) ) self.failUnless( node.parmTransform().extractRotates().isAlmostEqual( hou.Vector3( 0, 0, -30 ) ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Object ) self.assertEqual( node.parmTransform().extractTranslates(), hou.Vector3( 0, 0, 0 ) ) self.failUnless( node.parmTransform().extractRotates().isAlmostEqual( hou.Vector3( 0, 0, 0 ) ) ) testRotated( xform ) testRotated( geo ) def testSopSubPaths( self ) : self.writeSCC() node = self.sop() node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "root" ).set( "/1" ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "root" ).set( "/1/2" ) prims = node.geometry().prims() self.assertEqual( len(prims), 12 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "root" ).set( "/1/2/3" ) prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) def testSopSpaceModes( self ) : self.writeSCC() node = self.sop() node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) self.assertEqual( node.parm( "space" ).eval(), IECoreHoudini.SceneCacheNode.Space.World ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = node.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 1.5, 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 3.5, 0.5, 0.5 ) ) self.assertEqual( prims[2].vertices()[0].point().position(), hou.Vector3( 6.5, 0.5, 0.5 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Path ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = node.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 1.5, 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 3.5, 0.5, 0.5 ) ) self.assertEqual( prims[2].vertices()[0].point().position(), hou.Vector3( 6.5, 0.5, 0.5 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Local ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 2, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = node.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 1.5, 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 2.5, 0.5, 0.5 ) ) self.assertEqual( prims[2].vertices()[0].point().position(), hou.Vector3( 3.5, 0.5, 0.5 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Object ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = node.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 0.5, 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 0.5, 0.5, 0.5 ) ) self.assertEqual( prims[2].vertices()[0].point().position(), hou.Vector3( 0.5, 0.5, 0.5 ) ) node.parm( "root" ).set( "/1" ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.World ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = node.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 1.5, 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 3.5, 0.5, 0.5 ) ) self.assertEqual( prims[2].vertices()[0].point().position(), hou.Vector3( 6.5, 0.5, 0.5 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Path ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 2, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 5, 0, 0 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = node.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 0.5, 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 2.5, 0.5, 0.5 ) ) self.assertEqual( prims[2].vertices()[0].point().position(), hou.Vector3( 5.5, 0.5, 0.5 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Local ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 2, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = node.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 1.5, 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 2.5, 0.5, 0.5 ) ) self.assertEqual( prims[2].vertices()[0].point().position(), hou.Vector3( 3.5, 0.5, 0.5 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Object ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = node.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 0.5, 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 0.5, 0.5, 0.5 ) ) self.assertEqual( prims[2].vertices()[0].point().position(), hou.Vector3( 0.5, 0.5, 0.5 ) ) def testSopTransformsPrimvars( self ) : def writeTestFile() : scene = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Write ) sc = scene.createChild( str( 1 ) ) matrix = IECore.M44d.createTranslated( IECore.V3d( 1, 0, 0 ) ) sc.writeTransform( IECore.M44dData( matrix ), 0 ) sc = sc.createChild( str( 2 ) ) matrix = IECore.M44d.createTranslated( IECore.V3d( 2, 0, 0 ) ) sc.writeTransform( IECore.M44dData( matrix ), 0 ) sc = sc.createChild( str( 3 ) ) matrix = IECore.M44d.createTranslated( IECore.V3d( 3, 0, 0 ) ) sc.writeTransform( IECore.M44dData( matrix ), 0 ) mesh = IECore.MeshPrimitive.createBox(IECore.Box3f(IECore.V3f(0),IECore.V3f(1))) mesh["Pref"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Vertex, mesh["P"].data ) mesh["otherP"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Vertex, mesh["P"].data ) mesh["Cs"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Vertex, IECore.V3fVectorData( [ IECore.V3f( 0, 0, 1 ) ] * 8 ) ) sc.writeObject( mesh, 0 ) writeTestFile() node = self.sop() node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.World ) prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["Cd", "P", "Pw", "otherP", "rest"] ) # P is transformed self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) # other Point data is as well self.assertEqual( prims[0].vertex( 0 ).point().attribValue( "otherP" ), ( 6, 0, 0 ) ) # rest is not transformed self.assertEqual( prims[0].vertex( 0 ).point().attribValue( "rest" ), ( 0, 0, 0 ) ) # other data is not self.assertEqual( prims[0].vertex( 0 ).point().attribValue( "Cd" ), ( 0, 0, 1 ) ) def testSopShapeFilter( self ) : self.writeSCC() node = self.sop() node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = node.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 1.5, 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 3.5, 0.5, 0.5 ) ) self.assertEqual( prims[2].vertices()[0].point().position(), hou.Vector3( 6.5, 0.5, 0.5 ) ) node.parm( "shapeFilter" ).set( "* ^2" ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 12 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1','/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = node.geometry().prims() self.assertEqual( len(prims), 2 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 1.5, 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 6.5, 0.5, 0.5 ) ) node.parm( "shapeFilter" ).set( "3" ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = node.geometry().prims() self.assertEqual( len(prims), 1 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 6.5, 0.5, 0.5 ) ) node.parm( "shapeFilter" ).set( "" ) self.assertEqual( len(node.geometry().prims()), 0 ) self.assertEqual( len(node.geometry().primGroups()), 0 ) def testSopAttributeFilter( self ) : self.writeSCC() node = self.sop() node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) self.assertEqual( len(node.geometry().prims()), 18 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["P", "Pw"] ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["Cd", "ieMeshInterpolation", "name"] ) self.assertEqual( node.geometry().vertexAttribs(), tuple() ) self.assertEqual( node.geometry().globalAttribs(), tuple() ) node.parm( "attributeFilter" ).set( "P" ) self.assertEqual( len(node.geometry().prims()), 18 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["P", "Pw"] ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["ieMeshInterpolation", "name"] ) self.assertEqual( node.geometry().vertexAttribs(), tuple() ) self.assertEqual( node.geometry().globalAttribs(), tuple() ) node.parm( "attributeFilter" ).set( "* ^Cs" ) self.assertEqual( len(node.geometry().prims()), 18 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["P", "Pw"] ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["ieMeshInterpolation", "name"] ) self.assertEqual( node.geometry().vertexAttribs(), tuple() ) self.assertEqual( node.geometry().globalAttribs(), tuple() ) node.parm( "attributeFilter" ).set( "Cs" ) self.assertEqual( len(node.geometry().prims()), 18 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["P", "Pw"] ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["Cd", "ieMeshInterpolation", "name"] ) self.assertEqual( node.geometry().vertexAttribs(), tuple() ) self.assertEqual( node.geometry().globalAttribs(), tuple() ) node.parm( "attributeFilter" ).set( "" ) self.assertEqual( len(node.geometry().prims()), 18 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["P", "Pw"] ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["ieMeshInterpolation", "name"] ) self.assertEqual( node.geometry().vertexAttribs(), tuple() ) self.assertEqual( node.geometry().globalAttribs(), tuple() ) def testSopAttributeCopy( self ) : self.writeSCC() node = self.sop() node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) self.assertEqual( len(node.geometry().prims()), 18 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["P", "Pw"] ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["Cd", "ieMeshInterpolation", "name"] ) self.assertEqual( node.geometry().vertexAttribs(), tuple() ) self.assertEqual( node.geometry().globalAttribs(), tuple() ) # copying as expected, including automatic translation to rest node.parm( "attributeCopy" ).set( "P:Pref" ) self.assertEqual( len(node.geometry().prims()), 18 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["P", "Pw", "rest"] ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["Cd", "ieMeshInterpolation", "name"] ) self.assertEqual( node.geometry().vertexAttribs(), tuple() ) self.assertEqual( node.geometry().globalAttribs(), tuple() ) # ensure the rest does not transform along with P by making sure it matches the static P original = IECore.MeshPrimitive.createBox(IECore.Box3f(IECore.V3f(0),IECore.V3f(1))) for point in node.geometry().points() : rest = point.attribValue( "rest" ) self.assertNotEqual( point.attribValue( "P" ), rest ) self.assertEqual( original["P"].data[ point.number() % 8 ], IECore.V3f( rest[0], rest[1], rest[2] ) ) # copying multiple prim vars node.parm( "attributeCopy" ).set( "P:Pref Cs:Cspecial" ) self.assertEqual( len(node.geometry().prims()), 18 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["P", "Pw", "rest"] ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["Cd", "Cspecial", "ieMeshInterpolation", "name"] ) self.assertEqual( node.geometry().vertexAttribs(), tuple() ) self.assertEqual( node.geometry().globalAttribs(), tuple() ) # ensure the rest does not transform along with P by making sure it matches the static P for point in node.geometry().points() : rest = point.attribValue( "rest" ) self.assertNotEqual( point.attribValue( "P" ), rest ) self.assertEqual( original["P"].data[ point.number() % 8 ], IECore.V3f( rest[0], rest[1], rest[2] ) ) for prim in node.geometry().prims() : self.assertEqual( prim.attribValue( "Cd" ), prim.attribValue( "Cspecial" ) ) # copied prim var makes it through even though filtered one doesn't node.parm( "attributeFilter" ).set( "* ^Cs" ) node.parm( "attributeCopy" ).set( "Cs:Cspecial" ) self.assertEqual( len(node.geometry().prims()), 18 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["P", "Pw"] ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["Cspecial", "ieMeshInterpolation", "name"] ) self.assertEqual( node.geometry().vertexAttribs(), tuple() ) self.assertEqual( node.geometry().globalAttribs(), tuple() ) # nonexistant prim vars are a no-op node.parm( "attributeFilter" ).set( "*" ) node.parm( "attributeCopy" ).set( "fake:notThere" ) self.assertEqual( len(node.geometry().prims()), 18 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["P", "Pw"] ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["Cd", "ieMeshInterpolation", "name"] ) self.assertEqual( node.geometry().vertexAttribs(), tuple() ) self.assertEqual( node.geometry().globalAttribs(), tuple() ) # still works for Cortex geo node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) node.parm( "attributeCopy" ).set( "P:Pref" ) self.assertEqual( len(node.geometry().prims()), 3 ) self.assertEqual( sorted( [ x.name() for x in node.geometry().pointAttribs() ] ), ["P", "Pw"] ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["name"] ) self.assertEqual( node.geometry().vertexAttribs(), tuple() ) self.assertEqual( node.geometry().globalAttribs(), tuple() ) result = IECoreHoudini.FromHoudiniCompoundObjectConverter( node ).convert() self.assertEqual( sorted( result.keys() ), [ "/1", "/1/2", "/1/2/3" ] ) for key in result.keys() : self.assertTrue( isinstance( result[key], IECore.MeshPrimitive ) ) self.assertEqual( sorted( result[key].keys() ), [ "Cs", "P", "Pref" ] ) self.assertNotEqual( result[key]["P"], result[key]["Pref"] ) self.assertEqual( original["P"], result[key]["Pref"] ) def testExpandGeo( self ) : self.writeSCC() geo = self.geometry() self.assertEqual( geo.children(), tuple() ) geo.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) geo.parm( "expand" ).pressButton() self.assertEqual( len(geo.children()), 1 ) node = geo.children()[0] self.assertEqual( node.name(), "root" ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 6, 0, 0 ) ) self.assertEqual( geo.parmTuple( "outT" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( geo.parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( geo.parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) geo.parm( "root" ).set( "/1/2" ) geo.parm( "collapse" ).pressButton() geo.parm( "expand" ).pressButton() self.assertEqual( len(geo.children()), 1 ) node = geo.children()[0] self.assertEqual( node.name(), "2" ) node.parm( "root" ).set( "/1/2" ) prims = node.geometry().prims() self.assertEqual( len(prims), 12 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 6, 0, 0 ) ) self.assertEqual( geo.parmTuple( "outT" ).eval(), ( 3, 0, 0 ) ) self.assertEqual( geo.parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( geo.parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) def cookAll( self, node ) : node.cook( force=True ) for child in node.children() : self.cookAll( child ) def testExpandSubNetwork( self ) : self.writeSCC() xform = self.xform() self.assertEqual( xform.children(), tuple() ) xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.SubNetworks ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) xform.parm( "expand" ).pressButton() self.assertEqual( len(xform.children()), 1 ) self.failUnless( isinstance( hou.node( xform.path()+"/1" ), hou.ObjNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/1/geo" ), hou.ObjNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/1/2" ), hou.ObjNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/1/2/geo" ), hou.ObjNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/1/2/3" ), hou.ObjNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/1/2/3/geo" ), hou.ObjNode ) ) geo = hou.node( xform.path()+"/1/2/geo" ) self.cookAll( xform ) node = geo.children()[0] prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outT" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/1" ).parmTuple( "outT" ).eval(), ( 1, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/1/geo" ).parmTuple( "outT" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1/geo" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1/geo" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/1/2" ).parmTuple( "outT" ).eval(), ( 2, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1/2" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1/2" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/1/2/geo" ).parmTuple( "outT" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1/2/geo" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1/2/geo" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/1/2/3" ).parmTuple( "outT" ).eval(), ( 3, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1/2/3" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1/2/3" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/1/2/3/geo" ).parmTuple( "outT" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1/2/3/geo" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1/2/3/geo" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) xform.parm( "root" ).set( "/1/2" ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() self.assertEqual( len(xform.children()), 2 ) geo = hou.node( xform.path()+"/geo" ) self.failUnless( isinstance( geo, hou.ObjNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/3" ), hou.ObjNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/3/geo" ), hou.ObjNode ) ) self.cookAll( xform ) node = geo.children()[0] prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outT" ).eval(), ( 3, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/3" ).parmTuple( "outT" ).eval(), ( 3, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/3" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/3" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/3/geo" ).parmTuple( "outT" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/3/geo" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/3/geo" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) xform.parm( "root" ).set( "/1" ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.Children ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() self.assertEqual( len(xform.children()), 2 ) geo = hou.node( xform.path()+"/geo" ) self.failUnless( isinstance( hou.node( xform.path()+"/geo" ), hou.ObjNode ) ) self.cookAll( xform ) node = geo.children()[0] prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 1, 0, 0 ) ) next = hou.node( xform.path()+"/2" ) self.failUnless( isinstance( next, hou.ObjNode ) ) self.assertEqual( len(next.children()), 0 ) next.parm( "expand" ).pressButton() self.assertEqual( len(next.children()), 2 ) self.failUnless( isinstance( hou.node( xform.path()+"/2/3" ), hou.ObjNode ) ) geo = hou.node( xform.path()+"/2/geo" ) self.failUnless( isinstance( geo, hou.ObjNode ) ) self.cookAll( xform ) node = geo.children()[0] prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 3, 0, 0 ) ) next = hou.node( xform.path()+"/2/3" ) self.failUnless( isinstance( next, hou.ObjNode ) ) self.assertEqual( len(next.children()), 0 ) next.parm( "expand" ).pressButton() self.assertEqual( len(next.children()), 1 ) self.failUnless( isinstance( hou.node( xform.path()+"/2/3/geo" ), hou.ObjNode ) ) def testExpandParenting( self ) : self.writeSCC() xform = self.xform() self.assertEqual( xform.children(), tuple() ) xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.Parenting ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) xform.parm( "expand" ).pressButton() self.assertEqual( len(xform.children()), 3 ) self.failUnless( isinstance( hou.node( xform.path()+"/1" ), hou.ObjNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/1" ).children()[0], hou.SopNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/2" ), hou.ObjNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/2" ).children()[0], hou.SopNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/3" ), hou.ObjNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/3" ).children()[0], hou.SopNode ) ) self.assertEqual( len(hou.node( xform.path()+"/1" ).inputs()), 0 ) self.assertEqual( len(hou.node( xform.path()+"/2" ).inputs()), 1 ) self.assertEqual( len(hou.node( xform.path()+"/3" ).inputs()), 1 ) self.assertEqual( len(hou.node( xform.path()+"/1" ).outputs()), 1 ) self.assertEqual( len(hou.node( xform.path()+"/2" ).outputs()), 1 ) self.assertEqual( len(hou.node( xform.path()+"/3" ).outputs()), 0 ) self.assertEqual( hou.node( xform.path()+"/1" ).outputs()[0], hou.node( xform.path()+"/2" ) ) self.assertEqual( hou.node( xform.path()+"/2" ).outputs()[0], hou.node( xform.path()+"/3" ) ) self.cookAll( xform ) geo = hou.node( xform.path()+"/2" ) node = geo.children()[0] prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outT" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/1" ).parmTuple( "outT" ).eval(), ( 1, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/1" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/2" ).parmTuple( "outT" ).eval(), ( 2, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/2" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/2" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/3" ).parmTuple( "outT" ).eval(), ( 3, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/3" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/3" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) xform.parm( "root" ).set( "/1/2" ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() self.assertEqual( len(xform.children()), 2 ) geo = hou.node( xform.path()+"/geo" ) self.failUnless( isinstance( geo, hou.ObjNode ) ) self.failUnless( isinstance( geo.children()[0], hou.SopNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/3" ), hou.ObjNode ) ) self.failUnless( isinstance( hou.node( xform.path()+"/3" ).children()[0], hou.SopNode ) ) self.assertEqual( len(geo.inputs()), 0 ) self.assertEqual( len(hou.node( xform.path()+"/3" ).inputs()), 1 ) self.assertEqual( len(geo.outputs()), 1 ) self.assertEqual( len(hou.node( xform.path()+"/3" ).outputs()), 0 ) self.assertEqual( geo.outputs()[0], hou.node( xform.path()+"/3" ) ) self.cookAll( xform ) node = geo.children()[0] prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outT" ).eval(), ( 3, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( xform.parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) self.assertEqual( hou.node( xform.path()+"/3" ).parmTuple( "outT" ).eval(), ( 3, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/3" ).parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( hou.node( xform.path()+"/3" ).parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) xform.parm( "root" ).set( "/1" ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.Children ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() self.assertEqual( len(xform.children()), 2 ) geo = hou.node( xform.path()+"/geo" ) self.failUnless( isinstance( geo, hou.ObjNode ) ) self.failUnless( isinstance( geo.children()[0], hou.SopNode ) ) self.cookAll( xform ) node = geo.children()[0] prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 1, 0, 0 ) ) next = hou.node( xform.path()+"/2" ) self.failUnless( isinstance( next, hou.ObjNode ) ) self.assertEqual( len(geo.inputs()), 0 ) self.assertEqual( len(next.inputs()), 1 ) self.assertEqual( len(geo.outputs()), 1 ) self.assertEqual( len(next.outputs()), 0 ) self.assertEqual( geo.outputs()[0], next ) self.assertEqual( len(next.children()), 1 ) self.failUnless( isinstance( next.children()[0], hou.SopNode ) ) def testExpandFlatGeometry( self ) : self.writeSCC() xform = self.xform() self.assertEqual( xform.children(), tuple() ) xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.FlatGeometry ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) xform.parm( "expand" ).pressButton() self.assertEqual( len(xform.children()), 1 ) geo = hou.node( xform.path()+"/geo" ) self.failUnless( isinstance( geo, hou.ObjNode ) ) self.failUnless( isinstance( geo.children()[0], hou.SopNode ) ) self.cookAll( xform ) node = geo.children()[0] self.assertEqual( node.name(), "root" ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 6, 0, 0 ) ) xform.parm( "root" ).set( "/1/2" ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() self.assertEqual( len(xform.children()), 1 ) geo = hou.node( xform.path()+"/geo" ) self.failUnless( isinstance( geo, hou.ObjNode ) ) self.failUnless( isinstance( geo.children()[0], hou.SopNode ) ) self.cookAll( xform ) node = geo.children()[0] self.assertEqual( node.name(), "2" ) prims = node.geometry().prims() self.assertEqual( len(prims), 12 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 6, 0, 0 ) ) xform.parm( "root" ).set( "/1" ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.Children ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() self.assertEqual( len(xform.children()), 1 ) geo = hou.node( xform.path()+"/geo" ) self.failUnless( isinstance( geo, hou.ObjNode ) ) self.failUnless( isinstance( geo.children()[0], hou.SopNode ) ) self.cookAll( xform ) node = geo.children()[0] self.assertEqual( node.name(), "1" ) prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position() * geo.worldTransform(), hou.Vector3( 1, 0, 0 ) ) def writeTaggedSCC( self ) : scene = self.writeSCC() sc1 = scene.child( str( 1 ) ) sc2 = sc1.child( str( 2 ) ) sc3 = sc2.child( str( 3 ) ) sc1.writeTags( [ "a" ] ) sc2.writeTags( [ "b" ] ) sc3.writeTags( [ "c" ] ) return scene def writeDualTaggedSCC( self ) : scene = self.writeTaggedSCC() sc1 = scene.child( str(1 ) ) sc4 = sc1.createChild( str(4) ) sc4.writeTags( [ "d" ] ) box = IECore.MeshPrimitive.createBox(IECore.Box3f(IECore.V3f(0),IECore.V3f(1))) sc5 = sc4.createChild( str(5) ) sc5.writeObject( box, 0 ) def testParmTrickleDown( self ) : def checkParms( node, geoType, tagFilter, attribFilter, shapeFilter, attribCopy, fullPathName ) : self.assertEqual( node.parm( "geometryType" ).eval(), geoType ) self.assertEqual( node.parm( "attributeFilter" ).eval(), attribFilter ) self.assertEqual( node.parm( "attributeCopy" ).eval(), attribCopy ) self.assertEqual( node.parm( "shapeFilter" ).eval(), shapeFilter ) self.assertEqual( node.parm( "fullPathName" ).eval(), fullPathName ) if isinstance( node, hou.ObjNode ) : self.assertEqual( node.parm( "expanded" ).eval(), True ) if node.isObjectDisplayed() : self.assertEqual( node.parm( "tagFilter" ).eval(), tagFilter ) else : self.assertEqual( node.parm( "tagFilter" ).eval(), "*" ) for child in node.children() : checkParms( child, geoType, tagFilter, attribFilter, shapeFilter, attribCopy, fullPathName ) self.writeDualTaggedSCC() xform = self.xform() xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) xform.parm( "attributeFilter" ).set( "*" ) xform.parm( "shapeFilter" ).set( "*" ) xform.parm( "fullPathName" ).set( "fullPath" ) xform.parm( "expand" ).pressButton() checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Cortex, "*", "*", "*", "", "fullPath" ) xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) xform.parm( "attributeFilter" ).set( "P ^N" ) xform.parm( "attributeCopy" ).set( "P:Pref" ) xform.parm( "shapeFilter" ).set( "2 ^3" ) xform.parm( "fullPathName" ).set( "customName" ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Houdini, "*", "P ^N", "2 ^3", "P:Pref", "customName" ) xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.Parenting ) xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) xform.parm( "attributeFilter" ).set( "*" ) xform.parm( "attributeCopy" ).set( "" ) xform.parm( "shapeFilter" ).set( "*" ) xform.parm( "fullPathName" ).set( "fullPath" ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Cortex, "*", "*", "*", "", "fullPath" ) xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) xform.parm( "attributeFilter" ).set( "P ^N" ) xform.parm( "attributeCopy" ).set( "v:vIn" ) xform.parm( "shapeFilter" ).set( "2 ^3" ) xform.parm( "fullPathName" ).set( "customName" ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Houdini, "*", "P ^N", "2 ^3", "v:vIn", "customName" ) # now check just pushing the parms xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.SubNetworks ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) xform.parm( "attributeFilter" ).set( "P ^N" ) xform.parm( "attributeCopy" ).set( "P:Pref" ) xform.parm( "shapeFilter" ).set( "2 ^3" ) xform.parm( "fullPathName" ).set( "fullPath" ) xform.parm( "push" ).pressButton() checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Cortex, "*", "P ^N", "2 ^3", "P:Pref", "fullPath" ) self.assertTrue( hou.node( xform.path()+"/1" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/geo" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2/geo" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2/3" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2/3/geo" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/4" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/4/5" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/4/5/geo" ).isObjectDisplayed() ) xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) xform.parm( "attributeFilter" ).set( "P N" ) xform.parm( "attributeCopy" ).set( "P:Pref v:vIn" ) xform.parm( "shapeFilter" ).set( "2 3" ) xform.parm( "fullPathName" ).set( "customName" ) xform.parm( "tagFilter" ).set( "d" ) xform.parm( "push" ).pressButton() checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Houdini, "d", "P N", "2 3", "P:Pref v:vIn", "customName" ) self.assertTrue( hou.node( xform.path()+"/1" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/geo" ).isObjectDisplayed() ) self.assertFalse( hou.node( xform.path()+"/1/2" ).isObjectDisplayed() ) self.assertFalse( hou.node( xform.path()+"/1/2/geo" ).isObjectDisplayed() ) self.assertFalse( hou.node( xform.path()+"/1/2/3" ).isObjectDisplayed() ) self.assertFalse( hou.node( xform.path()+"/1/2/3/geo" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/4" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/4/5" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/4/5/geo" ).isObjectDisplayed() ) def testTagFilter( self ) : self.writeDualTaggedSCC() xform = self.xform() xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.SubNetworks ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) self.assertEqual( sorted( xform.parm( "tagFilter" ).menuItems() ), [ "*", "ObjectType:MeshPrimitive", "a", "b", "c", "d" ] ) xform.parm( "tagFilter" ).set( "b" ) xform.parm( "expand" ).pressButton() self.assertTrue( hou.node( xform.path()+"/1" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/geo" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2/geo" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2/3" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2/3/geo" ).isObjectDisplayed() ) self.assertFalse( hou.node( xform.path()+"/1/4" ).isObjectDisplayed() ) self.assertEqual( hou.node( xform.path()+"/1/4/5" ), None ) xform.parm( "collapse" ).pressButton() xform.parm( "tagFilter" ).set( "d" ) xform.parm( "expand" ).pressButton() self.assertTrue( hou.node( xform.path()+"/1" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/geo" ).isObjectDisplayed() ) self.assertFalse( hou.node( xform.path()+"/1/2" ).isObjectDisplayed() ) self.assertEqual( hou.node( xform.path()+"/1/2/geo" ), None ) self.assertEqual( hou.node( xform.path()+"/1/2/3" ), None ) self.assertTrue( hou.node( xform.path()+"/1/4" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/4/5" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/4/5/geo" ).isObjectDisplayed() ) xform.parm( "collapse" ).pressButton() xform.parm( "tagFilter" ).set( "b d" ) xform.parm( "expand" ).pressButton() self.assertTrue( hou.node( xform.path()+"/1" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/geo" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2/geo" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2/3" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2/3/geo" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/4/5" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/4/5/geo" ).isObjectDisplayed() ) xform.parm( "collapse" ).pressButton() xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.SubNetworks ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.Children ) xform.parm( "tagFilter" ).set( "b" ) xform.parm( "expand" ).pressButton() self.assertTrue( hou.node( xform.path()+"/1" ).isObjectDisplayed() ) self.assertEqual( hou.node( xform.path()+"/1/geo" ), None ) hou.node( xform.path()+"/1" ).parm( "expand" ).pressButton() self.assertTrue( hou.node( xform.path()+"/1/geo" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2" ).isObjectDisplayed() ) self.assertEqual( hou.node( xform.path()+"/1/2/geo" ), None ) hou.node( xform.path()+"/1/2" ).parm( "expand" ).pressButton() self.assertTrue( hou.node( xform.path()+"/1/2/geo" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2/3" ).isObjectDisplayed() ) self.assertEqual( hou.node( xform.path()+"/1/2//3geo" ), None ) hou.node( xform.path()+"/1/2/3" ).parm( "expand" ).pressButton() self.assertTrue( hou.node( xform.path()+"/1/2/3/geo" ).isObjectDisplayed() ) self.assertEqual( hou.node( xform.path()+"/1/4/5" ), None ) self.assertEqual( hou.node( xform.path()+"/1/4/5/geo" ), None ) # is displayed because we forced it by expanding 4 explicitly hou.node( xform.path()+"/1/4" ).parm( "expand" ).pressButton() self.assertTrue( hou.node( xform.path()+"/1/4/5" ).isObjectDisplayed() ) self.assertEqual( hou.node( xform.path()+"/1/4/5/geo" ), None ) hou.node( xform.path()+"/1/4/5" ).parm( "expand" ).pressButton() self.assertTrue( hou.node( xform.path()+"/1/4/5/geo" ).isObjectDisplayed() ) xform.parm( "collapse" ).pressButton() xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.Parenting ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) xform.parm( "tagFilter" ).set( "b" ) xform.parm( "expand" ).pressButton() self.assertTrue( hou.node( xform.path()+"/1" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/2" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/3" ).isObjectDisplayed() ) self.assertFalse( hou.node( xform.path()+"/4" ).isObjectDisplayed() ) self.assertFalse( hou.node( xform.path()+"/5" ).isObjectDisplayed() ) def testSopTagFilter( self ) : self.writeDualTaggedSCC() sop = self.sop() sop.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) sop.parm( "tagFilter" ).set( "b" ) prims = sop.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = sop.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) sop.parm( "tagFilter" ).set( "a" ) prims = sop.geometry().prims() self.assertEqual( len(prims), 24 ) nameAttr = sop.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3', '/1/4/5' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) self.assertEqual( prims[18].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) sop.parm( "tagFilter" ).set( "d" ) prims = sop.geometry().prims() self.assertEqual( len(prims), 12 ) nameAttr = sop.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/4/5' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) sop.parm( "tagFilter" ).set( "b d" ) prims = sop.geometry().prims() self.assertEqual( len(prims), 24 ) nameAttr = sop.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3', '/1/4/5' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) self.assertEqual( prims[18].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) def testEmptyTags( self ) : scene = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Write ) sc = scene.createChild( str( 1 ) ) matrix = IECore.M44d.createTranslated( IECore.V3d( 1, 0, 0 ) ) sc.writeTransform( IECore.M44dData( matrix ), 0 ) sc = sc.createChild( str( 2 ) ) matrix = IECore.M44d.createTranslated( IECore.V3d( 2, 0, 0 ) ) sc.writeTransform( IECore.M44dData( matrix ), 0 ) sc = sc.createChild( str( 3 ) ) matrix = IECore.M44d.createTranslated( IECore.V3d( 3, 0, 0 ) ) sc.writeTransform( IECore.M44dData( matrix ), 0 ) del scene, sc xform = self.xform() xform.parm( "expand" ).pressButton() self.assertEqual( len(xform.children()), 1 ) self.assertEqual( len(hou.node( xform.path()+"/1" ).children()), 1 ) self.assertEqual( len(hou.node( xform.path()+"/1/2" ).children()), 1 ) self.assertEqual( len(hou.node( xform.path()+"/1/2/3" ).children()), 0 ) scene = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) self.assertEqual( scene.readTags( IECore.SceneInterface.EveryTag ), [] ) self.assertTrue( hou.node( xform.path()+"/1" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2" ).isObjectDisplayed() ) self.assertTrue( hou.node( xform.path()+"/1/2/3" ).isObjectDisplayed() ) xform.parm( "tagFilter" ).set( "" ) xform.parm( "push" ).pressButton() self.assertFalse( hou.node( xform.path()+"/1" ).isObjectDisplayed() ) self.assertFalse( hou.node( xform.path()+"/1/2" ).isObjectDisplayed() ) self.assertFalse( hou.node( xform.path()+"/1/2/3" ).isObjectDisplayed() ) def testLiveTags( self ) : self.writeTaggedSCC() xform = self.xform() xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.SubNetworks ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) xform.parm( "expand" ).pressButton() scene = IECoreHoudini.LiveScene( xform.path() ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.EveryTag ) ]), [ "ObjectType:MeshPrimitive", "a", "b", "c" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.LocalTag ) ]), [] ) for tag in scene.readTags(IECore.SceneInterface.EveryTag) : self.assertTrue( scene.hasTag( tag, IECore.SceneInterface.EveryTag ) ) self.assertFalse( scene.hasTag( "fakeTag", IECore.SceneInterface.EveryTag ) ) scene = IECoreHoudini.LiveScene( xform.path()+"/1/2" ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.AncestorTag ) ]), [ "ObjectType:MeshPrimitive", "a" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.DescendantTag ) ]), [ "ObjectType:MeshPrimitive", "c" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.LocalTag ) ]), [ "ObjectType:MeshPrimitive", "b" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.EveryTag ) ]), [ "ObjectType:MeshPrimitive", "a", "b", "c" ] ) for tag in scene.readTags( IECore.SceneInterface.EveryTag ) : self.assertTrue( scene.hasTag( tag, IECore.SceneInterface.EveryTag ) ) self.assertFalse( scene.hasTag( "fakeTag", IECore.SceneInterface.EveryTag ) ) # test tags exist even when children aren't expanded xform.parm( "collapse" ).pressButton() xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.Children ) xform.parm( "expand" ).pressButton() scene = IECoreHoudini.LiveScene( xform.path() ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.EveryTag ) ]), [ "ObjectType:MeshPrimitive", "a", "b", "c" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.LocalTag ) ]), [] ) for tag in scene.readTags( IECore.SceneInterface.EveryTag ) : self.assertTrue( scene.hasTag( tag, IECore.SceneInterface.EveryTag ) ) self.assertFalse( scene.hasTag( "fakeTag", IECore.SceneInterface.EveryTag ) ) hou.node( xform.path()+"/1" ).parm( "expand" ).pressButton() scene = IECoreHoudini.LiveScene( xform.path()+"/1/2" ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.AncestorTag ) ]), [ "ObjectType:MeshPrimitive", "a" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.DescendantTag ) ]), [ "ObjectType:MeshPrimitive", "c" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.LocalTag ) ]), [ "ObjectType:MeshPrimitive", "b" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.EveryTag ) ]), [ "ObjectType:MeshPrimitive", "a", "b", "c" ] ) for tag in scene.readTags( IECore.SceneInterface.EveryTag ) : self.assertTrue( scene.hasTag( tag, IECore.SceneInterface.EveryTag ) ) self.assertFalse( scene.hasTag( "fakeTag", IECore.SceneInterface.EveryTag ) ) # test tags for parented expansion xform.parm( "collapse" ).pressButton() xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.Parenting ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) xform.parm( "expand" ).pressButton() scene = IECoreHoudini.LiveScene( xform.path() ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.EveryTag ) ]), [ "ObjectType:MeshPrimitive", "a", "b", "c" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.LocalTag ) ]), [] ) for tag in scene.readTags( IECore.SceneInterface.EveryTag ) : self.assertTrue( scene.hasTag( tag, IECore.SceneInterface.EveryTag ) ) self.assertFalse( scene.hasTag( "fakeTag", IECore.SceneInterface.EveryTag ) ) scene = IECoreHoudini.LiveScene( xform.path()+"/2" ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.AncestorTag ) ]), [ "ObjectType:MeshPrimitive", "a" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.DescendantTag ) ]), [ "ObjectType:MeshPrimitive", "c" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.LocalTag ) ]), [ "ObjectType:MeshPrimitive", "b" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.EveryTag ) ]), [ "ObjectType:MeshPrimitive", "a", "b", "c" ] ) for tag in scene.readTags( IECore.SceneInterface.EveryTag ) : self.assertTrue( scene.hasTag( tag, IECore.SceneInterface.EveryTag ) ) self.assertFalse( scene.hasTag( "fakeTag", IECore.SceneInterface.EveryTag ) ) # test user tags b = hou.node( xform.path()+"/2" ) b.parm( "ieTags" ).set( "testing user:tags" ) group = b.renderNode().createOutputNode( "group" ) group.parm( "crname" ).set( "ieTag_green" ) group2 = group.createOutputNode( "group" ) group2.parm( "crname" ).set( "notATag" ) group2.setRenderFlag( True ) scene = IECoreHoudini.LiveScene( xform.path() ) # they don't currently affect parents, just the immediate node self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.EveryTag ) ]), [ "ObjectType:MeshPrimitive", "a", "b", "c" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.LocalTag ) ]), [] ) for tag in scene.readTags( IECore.SceneInterface.EveryTag ) : self.assertTrue( scene.hasTag( tag, IECore.SceneInterface.EveryTag ) ) self.assertFalse( scene.hasTag( "testing", IECore.SceneInterface.EveryTag ) ) self.assertFalse( scene.hasTag( "user:tags", IECore.SceneInterface.EveryTag ) ) self.assertFalse( scene.hasTag( "green", IECore.SceneInterface.EveryTag ) ) self.assertFalse( scene.hasTag( "notATag", IECore.SceneInterface.EveryTag ) ) scene = IECoreHoudini.LiveScene( xform.path()+"/2" ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.AncestorTag ) ]), [ "ObjectType:MeshPrimitive", "a" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.DescendantTag ) ]), [ "ObjectType:MeshPrimitive", "c" ] ) self.assertEqual( sorted([ str(x) for x in scene.readTags( IECore.SceneInterface.LocalTag ) ]), [ "ObjectType:MeshPrimitive", "b", "green", "testing", "user:tags" ] ) for tag in scene.readTags(IECore.SceneInterface.EveryTag) : self.assertTrue( scene.hasTag( tag, IECore.SceneInterface.EveryTag ) ) self.assertFalse( scene.hasTag( "notATag", IECore.SceneInterface.EveryTag ) ) def writeAttributeSCC( self ) : scene = self.writeSCC() sc1 = scene.child( str( 1 ) ) sc2 = sc1.child( str( 2 ) ) sc3 = sc2.child( str( 3 ) ) sc1.writeAttribute( "label", IECore.StringData( "a" ), 0 ) sc1.writeAttribute( "color", IECore.Color3dData( IECore.Color3d( 0.5 ) ), 0 ) sc2.writeAttribute( "label", IECore.StringData( "b" ), 0 ) sc2.writeAttribute( "material", IECore.StringData( "rubber" ), 0 ) sc3.writeAttribute( "label", IECore.StringData( "c" ), 0 ) sc3.writeAttribute( "animColor", IECore.Color3dData( IECore.Color3d( 0 ) ), 0 ) sc3.writeAttribute( "animColor", IECore.Color3dData( IECore.Color3d( 0.5 ) ), 0.5 ) sc3.writeAttribute( "animColor", IECore.Color3dData( IECore.Color3d( 1 ) ), 1 ) return scene def testLiveAttributes( self ) : self.writeAttributeSCC() xform = self.xform() xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.SubNetworks ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) # its a link before it is expanded scene = IECoreHoudini.LiveScene( xform.path() ) self.assertEqual( scene.attributeNames(), [ IECore.LinkedScene.linkAttribute ] ) self.assertTrue( scene.hasAttribute( IECore.LinkedScene.linkAttribute ) ) self.assertEqual( scene.readAttribute( IECore.LinkedScene.linkAttribute, 0 ), IECore.CompoundData( { "time" : IECore.DoubleData( 0 ), "fileName" : IECore.StringData( "test/test.scc" ), "root" : IECore.InternedStringVectorData( [] ) } ) ) # the link disapears once expanded xform.parm( "expand" ).pressButton() self.assertEqual( scene.attributeNames(), [] ) self.assertFalse( scene.hasAttribute( IECore.LinkedScene.linkAttribute ) ) self.assertEqual( scene.readAttribute( IECore.LinkedScene.linkAttribute, 0 ), None ) # nodes expose their attributes a = scene.child( "1" ) self.assertEqual( sorted(a.attributeNames()), [ "color", "label", "sceneInterface:animatedObjectPrimVars" ] ) for attr in a.attributeNames() : self.assertTrue( a.hasAttribute( attr ) ) self.assertFalse( a.hasAttribute( "material" ) ) self.assertEqual( a.readAttribute( "label", 0 ), IECore.StringData( "a" ) ) self.assertEqual( a.readAttribute( "color", 0 ), IECore.Color3dData( IECore.Color3d( 0.5 ) ) ) b = a.child( "2" ) self.assertEqual( sorted(b.attributeNames()), [ "label", "material", "sceneInterface:animatedObjectPrimVars" ] ) for attr in b.attributeNames() : self.assertTrue( b.hasAttribute( attr ) ) self.assertFalse( b.hasAttribute( "color" ) ) self.assertEqual( b.readAttribute( "label", 0 ), IECore.StringData( "b" ) ) self.assertEqual( b.readAttribute( "material", 0 ), IECore.StringData( "rubber" ) ) c = b.child( "3" ) self.assertEqual( sorted(c.attributeNames()), [ "animColor", "label", "sceneInterface:animatedObjectPrimVars" ] ) for attr in c.attributeNames() : self.assertTrue( c.hasAttribute( attr ) ) self.assertFalse( c.hasAttribute( "color" ) ) self.assertFalse( c.hasAttribute( "material" ) ) self.assertEqual( c.readAttribute( "label", 0 ), IECore.StringData( "c" ) ) self.assertEqual( c.readAttribute( "animColor", 0 ), IECore.Color3dData( IECore.Color3d( 0 ) ) ) self.assertEqual( c.readAttribute( "animColor", 0.5 ), IECore.Color3dData( IECore.Color3d( 0.5 ) ) ) self.assertEqual( c.readAttribute( "animColor", 1 ), IECore.Color3dData( IECore.Color3d( 1 ) ) ) def testFullPathName( self ) : self.writeSCC() node = self.sop() node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) # make sure the full path doesn't load until the parm has a value self.assertEqual( node.parm( "fullPathName" ).eval(), "" ) self.assertEqual( node.geometry().findPrimAttrib( "path" ), None ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["Cd", "ieMeshInterpolation", "name"] ) # now lets load it an validate the paths node.parm( "fullPathName" ).set( "path" ) self.assertEqual( sorted( [ x.name() for x in node.geometry().primAttribs() ] ), ["Cd", "ieMeshInterpolation", "name", "path"] ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) pathAttr = node.geometry().findPrimAttrib( "path" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) self.assertEqual( pathAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) for path in pathAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "path" ) == path ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "root" ).set( "/1" ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) pathAttr = node.geometry().findPrimAttrib( "path" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) self.assertEqual( pathAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) for path in pathAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "path" ) == path ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "root" ).set( "/1/2" ) prims = node.geometry().prims() self.assertEqual( len(prims), 12 ) nameAttr = node.geometry().findPrimAttrib( "name" ) pathAttr = node.geometry().findPrimAttrib( "path" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/3' ] ) ) self.assertEqual( pathAttr.strings(), tuple( [ '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) for path in pathAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "path" ) == path ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) node.parm( "root" ).set( "/1/2/3" ) prims = node.geometry().prims() self.assertEqual( len(prims), 6 ) nameAttr = node.geometry().findPrimAttrib( "name" ) pathAttr = node.geometry().findPrimAttrib( "path" ) self.assertEqual( nameAttr.strings(), tuple( [ '/' ] ) ) self.assertEqual( pathAttr.strings(), tuple( [ '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) for path in pathAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "path" ) == path ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) ) def testReloadButton( self ) : def testNode( node ) : self.assertEqual( node.cookCount(), 0 ) node.cook() self.assertEqual( node.cookCount(), 1 ) node.cook() self.assertEqual( node.cookCount(), 1 ) node.parm( "reload" ).pressButton() node.cook() self.assertEqual( node.cookCount(), 2 ) node.cook() self.assertEqual( node.cookCount(), 2 ) node.parm( "reload" ).pressButton() node.cook() self.assertEqual( node.cookCount(), 3 ) self.writeSCC() testNode( self.sop() ) testNode( self.xform() ) testNode( self.geometry() ) testNode( self.sopXform() ) def writeAnimSCC( self, rotate = False ) : scene = self.writeSCC() sc1 = scene.child( str( 1 ) ) sc2 = sc1.child( str( 2 ) ) sc3 = sc2.child( str( 3 ) ) mesh = IECore.MeshPrimitive.createBox(IECore.Box3f(IECore.V3f(0),IECore.V3f(1))) for time in [ 0.5, 1, 1.5, 2, 5, 10 ] : matrix = IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) if rotate : matrix.rotate( IECore.V3d( time, 0, 0 ) ) sc1.writeTransform( IECore.M44dData( matrix ), time ) mesh["Cs"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Uniform, IECore.V3fVectorData( [ IECore.V3f( time, 1, 0 ) ] * 6 ) ) sc2.writeObject( mesh, time ) matrix = IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) if rotate : matrix.rotate( IECore.V3d( time, 0, 0 ) ) sc2.writeTransform( IECore.M44dData( matrix ), time ) matrix = IECore.M44d.createTranslated( IECore.V3d( 3, time, 0 ) ) if rotate : matrix.rotate( IECore.V3d( time, 0, 0 ) ) sc3.writeTransform( IECore.M44dData( matrix ), time ) return scene def testAnimatedScene( self ) : self.writeAnimSCC() times = range( 0, 10 ) halves = [ x + 0.5 for x in times ] quarters = [ x + 0.25 for x in times ] times.extend( [ x + 0.75 for x in times ] ) times.extend( halves ) times.extend( quarters ) times.sort() spf = 1.0 / hou.fps() sop = self.sop() for time in times : hou.setTime( time - spf ) sop.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = sop.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = sop.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, time, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 2*time, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 3*time, 0 ) ) self.assertEqual( prims[6].attribValue( "Cd" ), ( time, 1, 0 ) ) sop.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = sop.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = sop.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 1.5, time + 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 3.5, 2*time + 0.5, 0.5 ) ) self.assertEqual( prims[2].vertices()[0].point().position(), hou.Vector3( 6.5, 3*time + 0.5, 0.5 ) ) xform = self.xform() xform.parm( "expand" ).pressButton() a = xform.children()[0] b = [ x for x in a.children() if x.name() != "geo" ][0] c = [ x for x in b.children() if x.name() != "geo" ][0] for time in times : if hou.applicationVersion()[0] >= 14 : self.assertEqual( IECore.M44d( list(xform.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(xform.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, time * 2, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 6, time * 3, 0 ) ) ) else : self.assertEqual( IECore.M44d( list(xform.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, time, 0 ) ) ) for time in times : hou.setTime( time - spf ) self.assertEqual( IECore.M44d( list(xform.parmTransform().asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, time, 0 ) ) ) xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.Parenting ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() a = xform.children()[0] b = xform.children()[1] c = xform.children()[2] for time in times : if hou.applicationVersion()[0] >= 14 : self.assertEqual( IECore.M44d( list(xform.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.localTransformAtTime( time -spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(xform.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, 2*time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.worldTransformAtTime( time -spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 6, 3*time, 0 ) ) ) else : self.assertEqual( IECore.M44d( list(xform.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, 2*time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.worldTransformAtTime( time -spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 6, 3*time, 0 ) ) ) for time in times : hou.setTime( time - spf ) self.assertEqual( IECore.M44d( list(xform.parmTransform().asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, time, 0 ) ) ) def testSopXformNameMode( self ) : self.writeAnimSCC() times = range( 0, 10 ) halves = [ x + 0.5 for x in times ] quarters = [ x + 0.25 for x in times ] times.extend( [ x + 0.75 for x in times ] ) times.extend( halves ) times.extend( quarters ) times.sort() spf = 1.0 / hou.fps() node = self.sopXform() # prims transform according to their name for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1.5, time - 0.5, -0.5 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3.5, time*2 - 0.5, -0.5 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6.5, time*3 - 0.5, -0.5 ) ) # names are relative to the root parm, and non-matching names are ignored node.parm( "root" ).set( "/1/2" ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 0.5, -0.5, -0.5 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 0.5, -0.5, -0.5 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 0.5, -0.5, -0.5 ) ) # making the names relative again so the transformations take effect node.inputConnections()[0].inputNode().inputConnections()[1].inputNode().parm( "name1" ).set( "/" ) node.inputConnections()[0].inputNode().inputConnections()[2].inputNode().parm( "name1" ).set( "/3" ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/', '/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) # still doesn't animate because /1 doesn't match any child of /1/2 self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 0.5, -0.5, -0.5 ) ) # these ones are proper relative paths self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3.5, time*2 - 0.5, -0.5 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6.5, time*3 - 0.5, -0.5 ) ) # testing invert toggle node.parm( "invert" ).set( True ) node.parm( "root" ).set( "/" ) node.inputConnections()[0].inputNode().inputConnections()[1].inputNode().parm( "name1" ).set( "/1/2" ) node.inputConnections()[0].inputNode().inputConnections()[2].inputNode().parm( "name1" ).set( "/1/2/3" ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertTrue( prims[0].vertex( 0 ).point().position().isAlmostEqual( hou.Vector3( -0.5, -time - 0.5, -0.5 ) ) ) self.assertTrue( prims[6].vertex( 0 ).point().position().isAlmostEqual( hou.Vector3( -2.5, -time*2 - 0.5, -0.5 ) ) ) self.assertTrue( prims[12].vertex( 0 ).point().position().isAlmostEqual( hou.Vector3( -5.5, -time*3 - 0.5, -0.5 ) ) ) def testSopXformRootMode( self ) : self.writeAnimSCC() times = range( 0, 10 ) halves = [ x + 0.5 for x in times ] quarters = [ x + 0.25 for x in times ] times.extend( [ x + 0.75 for x in times ] ) times.extend( halves ) times.extend( quarters ) times.sort() spf = 1.0 / hou.fps() node = self.sopXform() node.parm( "mode" ).set( 1 ) # in root mode all prims transform to match the root transform, regardless of name node.parm( "root" ).set( "/1" ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1.5, time - 0.5, -0.5 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 1.5, time - 0.5, -0.5 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 1.5, time - 0.5, -0.5 ) ) node.parm( "root" ).set( "/1/2" ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 3.5, 2*time - 0.5, -0.5 ) ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 3.5, 2*time - 0.5, -0.5 ) ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 3.5, 2*time - 0.5, -0.5 ) ) # testing invert toggle node.parm( "invert" ).set( True ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertTrue( prims[0].vertex( 0 ).point().position().isAlmostEqual( hou.Vector3( -2.5, -2*time - 0.5, -0.5 ) ) ) self.assertTrue( prims[6].vertex( 0 ).point().position().isAlmostEqual( hou.Vector3( -2.5, -2*time - 0.5, -0.5 ) ) ) self.assertTrue( prims[12].vertex( 0 ).point().position().isAlmostEqual( hou.Vector3( -2.5, -2*time - 0.5, -0.5 ) ) ) def testSopXformSpaces( self ) : self.writeAnimSCC() times = range( 0, 10 ) halves = [ x + 0.5 for x in times ] quarters = [ x + 0.25 for x in times ] times.extend( [ x + 0.75 for x in times ] ) times.extend( halves ) times.extend( quarters ) times.sort() spf = 1.0 / hou.fps() node = self.sopXform() node.parm( "root" ).set( "/1" ) node.inputConnections()[0].inputNode().inputConnections()[0].inputNode().parm( "name1" ).set( "/" ) node.inputConnections()[0].inputNode().inputConnections()[1].inputNode().parm( "name1" ).set( "/2" ) node.inputConnections()[0].inputNode().inputConnections()[2].inputNode().parm( "name1" ).set( "/2/3" ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.World ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1.5, time - 0.5, -0.5 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3.5, time*2 - 0.5, -0.5 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6.5, time*3 - 0.5, -0.5 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Path ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 0.5, -0.5, -0.5 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 2.5, time - 0.5, -0.5 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 5.5,time*2 - 0.5, -0.5 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Local ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1.5, time - 0.5, -0.5 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 2.5, time - 0.5, -0.5 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 3.5, time - 0.5, -0.5 ) ) node.parm( "space" ).set( IECoreHoudini.SceneCacheNode.Space.Object ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/', '/2', '/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 0.5, -0.5, -0.5 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 0.5, -0.5, -0.5 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 0.5, -0.5, -0.5 ) ) def testSopXformRestDoesNotTransform( self ) : self.writeAnimSCC() times = range( 0, 10 ) halves = [ x + 0.5 for x in times ] quarters = [ x + 0.25 for x in times ] times.extend( [ x + 0.75 for x in times ] ) times.extend( halves ) times.extend( quarters ) times.sort() spf = 1.0 / hou.fps() source = self.sop() source.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) source.parm( "attributeCopy" ).set( "P:Pref" ) xform = source.createOutputNode( "ieSceneCacheTransform" ) xform.parm( "file" ).set( TestSceneCache.__testFile ) for time in times : hou.setTime( time - spf ) prims = xform.geometry().prims() self.assertEqual( len(prims), 18 ) # positions are double transformed (once by the source sop and once by the xform) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 2, 2*time, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 6, 4*time, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 12, 6*time, 0 ) ) # rest doesn't transform from either source or xform self.assertEqual( prims[0].vertex( 0 ).point().attribValue( "rest" ), ( 0, 0, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().attribValue( "rest" ), ( 0, 0, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().attribValue( "rest" ), ( 0, 0, 0 ) ) def testOBJOutputParms( self ) : self.writeAnimSCC() xform = self.xform() xform.parm( "expand" ).pressButton() c = hou.node( xform.path()+"/1/2/3" ) spf = 1.0 / hou.fps() hou.setTime( 0 - spf ) self.assertEqual( c.cookCount(), 0 ) self.assertEqual( c.parmTuple( "outT" ).eval(), ( 3, 0, 0 ) ) self.assertEqual( c.parmTuple( "outR" ).eval(), ( 0, 0, 0 ) ) self.assertEqual( c.parmTuple( "outS" ).eval(), ( 1, 1, 1 ) ) # evaluating the output parms forces a cook self.assertEqual( c.cookCount(), 0 ) # referencing the output parms forces a cook null = hou.node( "/obj" ).createNode( "null" ) self.assertEqual( null.parmTuple( "t" ).eval(), ( 0, 0, 0 ) ) null.parm( "tx" ).setExpression( 'ch( "%s/outTx" )' % c.path() ) null.parm( "ty" ).setExpression( 'ch( "%s/outTy" )' % c.path() ) null.parm( "tz" ).setExpression( 'ch( "%s/outTz" )' % c.path() ) self.assertEqual( null.parmTuple( "t" ).eval(), ( 3, 0, 0 ) ) self.assertEqual( c.parmTuple( "outT" ).eval(), ( 3, 0, 0 ) ) self.assertEqual( c.cookCount(), 0 ) # changing the time updates the output parms hou.setTime( 2.5 - spf ) self.assertEqual( null.parmTuple( "t" ).eval(), ( 3, 2.5, 0 ) ) self.assertEqual( c.parmTuple( "outT" ).eval(), ( 3, 2.5, 0 ) ) self.assertEqual( c.cookCount(), 0 ) # referencing the node via origin returns the same results null2 = hou.node( "/obj" ).createNode( "null" ) self.assertEqual( null2.parmTuple( "t" ).eval(), ( 0, 0, 0 ) ) null2.parm( "tx" ).setExpression( 'origin( "", "%s", "TX" )' % c.path() ) null2.parm( "ty" ).setExpression( 'origin( "", "%s", "TY" )' % c.path() ) null2.parm( "tz" ).setExpression( 'origin( "", "%s", "TZ" )' % c.path() ) if hou.applicationVersion()[0] >= 14 : self.assertEqual( null2.parmTuple( "t" ).eval(), ( 6, 2.5 * 3, 0 ) ) else : self.assertEqual( null2.parmTuple( "t" ).eval(), ( 3, 2.5, 0 ) ) self.assertEqual( c.parmTuple( "outT" ).eval(), ( 3, 2.5, 0 ) ) self.assertEqual( c.cookCount(), 1 ) # evaluating at different times also works self.assertEqual( c.parmTuple( "outT" ).evalAtTime( 2.75 - spf ), ( 3, 2.75, 0 ) ) self.assertEqual( null.parmTuple( "t" ).evalAtTime( 5.25 - spf ), ( 3, 5.25, 0 ) ) self.assertEqual( c.cookCount(), 1 ) def compareScene( self, a, b, time = 0, bakedObjects = [], parentTransform = None ) : self.assertEqual( a.name(), b.name() ) self.assertEqual( a.path(), b.path() ) if b.name() in bakedObjects : aTransform = a.readTransformAsMatrix( time ) parentTransform = aTransform if parentTransform is None else aTransform * parentTransform self.assertEqual( b.readTransformAsMatrix( time ), IECore.M44d() ) else : self.assertEqual( set(a.readTags(IECore.SceneInterface.LocalTag)), set(b.readTags(IECore.SceneInterface.LocalTag)) ) self.assertEqual( set(a.readTags(IECore.SceneInterface.DescendantTag)), set(b.readTags(IECore.SceneInterface.DescendantTag)) ) self.assertEqual( set(a.readTags(IECore.SceneInterface.AncestorTag)), set(b.readTags(IECore.SceneInterface.AncestorTag)) ) self.assertEqual( set(a.readTags(IECore.SceneInterface.EveryTag)), set(b.readTags(IECore.SceneInterface.EveryTag)) ) self.assertTrue( a.readTransformAsMatrix( time ).equalWithAbsError( b.readTransformAsMatrix( time ), 1e-6 ) ) ab = a.readBound( time ) bb = b.readBound( time ) self.assertTrue( ab.min.equalWithAbsError( bb.min, 1e-6 ) ) self.assertTrue( ab.max.equalWithAbsError( bb.max, 1e-6 ) ) aAttrs = a.attributeNames() bAttrs = b.attributeNames() # need to remove the animatedObjectPrimVars attribute since it doesn't exist in some circumstances if "sceneInterface:animatedObjectPrimVars" in aAttrs : aAttrs.remove( "sceneInterface:animatedObjectPrimVars" ) if "sceneInterface:animatedObjectPrimVars" in bAttrs : bAttrs.remove( "sceneInterface:animatedObjectPrimVars" ) self.assertEqual( aAttrs, bAttrs ) for attr in aAttrs : self.assertTrue( a.hasAttribute( attr ) ) self.assertTrue( b.hasAttribute( attr ) ) self.assertEqual( a.readAttribute( attr, time ), b.readAttribute( attr, time ) ) self.assertEqual( a.hasObject(), b.hasObject() ) if a.hasObject() : ma = a.readObject( time ) mb = b.readObject( time ) # need to adjust P for baked objects if b.name() in bakedObjects : IECore.TransformOp()( input=ma, copyInput=False, matrix=IECore.M44dData( parentTransform ) ) self.assertEqual( ma, mb ) self.assertEqual( sorted( a.childNames() ), sorted( b.childNames() ) ) for child in a.childNames() : self.compareScene( a.child( child ), b.child( child ), time = time, bakedObjects = bakedObjects, parentTransform = parentTransform ) def testRopHierarchy( self ) : # test a parented xform self.writeTaggedSCC() xform = self.xform() xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.Parenting ) xform.parm( "expand" ).pressButton() rop = self.rop( xform ) self.assertFalse( os.path.exists( TestSceneCache.__testOutFile ) ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) self.assertTrue( os.path.exists( TestSceneCache.__testOutFile ) ) orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) self.compareScene( orig, output ) # test a subnet xform os.remove( TestSceneCache.__testOutFile ) xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.SubNetworks ) xform.parm( "expand" ).pressButton() rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) self.compareScene( orig, output ) # test a mixed subnet/parented xform os.remove( TestSceneCache.__testOutFile ) xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.SubNetworks ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.Children ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() a = xform.children()[0] a.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.Parenting ) a.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) a.parm( "expand" ).pressButton() rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) self.compareScene( orig, output ) def testRopFlattened( self ) : # test a flat xform self.writeSCC() xform = self.xform() rop = self.rop( xform ) xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.FlatGeometry ) xform.parm( "expand" ).pressButton() rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) self.compareScene( orig, output, bakedObjects = [ "1", "2", "3" ] ) # test a mixed subnet/flat xform os.remove( TestSceneCache.__testOutFile ) xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.SubNetworks ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.Children ) xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() a = xform.children()[0] a.parm( "expand" ).pressButton() b = a.children()[1] b.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.FlatGeometry ) b.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) b.parm( "expand" ).pressButton() rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) self.compareScene( orig, output, bakedObjects = [ "3" ] ) # test a OBJ Geo os.remove( TestSceneCache.__testOutFile ) geo = self.geometry() geo.parm( "expand" ).pressButton() rop.parm( "rootObject" ).set( geo.path() ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) self.compareScene( orig, output, bakedObjects = [ "1", "2", "3" ] ) def testRopFlattenedWithGaps( self ) : scene = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Write ) sc = scene.createChild( str( 1 ) ) mesh = IECore.MeshPrimitive.createBox(IECore.Box3f(IECore.V3f(0),IECore.V3f(1))) mesh["Cs"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Uniform, IECore.V3fVectorData( [ IECore.V3f( 1, 0, 0 ) ] * 6 ) ) sc.writeObject( mesh, 0 ) matrix = IECore.M44d.createTranslated( IECore.V3d( 1, 0, 0 ) ) sc.writeTransform( IECore.M44dData( matrix ), 0 ) sc = sc.createChild( str( 2 ) ) matrix = IECore.M44d.createTranslated( IECore.V3d( 2, 0, 0 ) ) sc.writeTransform( IECore.M44dData( matrix ), 0 ) sc = sc.createChild( str( 3 ) ) mesh = IECore.MeshPrimitive.createBox(IECore.Box3f(IECore.V3f(0),IECore.V3f(1))) mesh["Cs"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Uniform, IECore.V3fVectorData( [ IECore.V3f( 0, 0, 1 ) ] * 6 ) ) sc.writeObject( mesh, 0 ) matrix = IECore.M44d.createTranslated( IECore.V3d( 3, 0, 0 ) ) sc.writeTransform( IECore.M44dData( matrix ), 0 ) del scene, sc geo = self.geometry() geo.parm( "expand" ).pressButton() self.assertEqual( len(geo.children()), 1 ) node = geo.children()[0] self.assertEqual( node.name(), "root" ) prims = node.geometry().prims() self.assertEqual( len(prims), 2 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 1.5, 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 6.5, 0.5, 0.5 ) ) rop = self.rop( geo ) rop.parm( "rootObject" ).set( geo.path() ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) self.compareScene( orig, output, bakedObjects = [ "1", "2", "3" ] ) def testRopTopLevelGeo( self ) : self.writeSCC() geo = self.geometry() geo.parm( "expand" ).pressButton() attr = geo.children()[0].createOutputNode( "attribute" ) attr.parm( "primdel" ).set( "name" ) attr.setDisplayFlag( True ) attr.setRenderFlag( True ) rop = self.rop( geo ) rop.parm( "trange" ).set( 1 ) rop.parmTuple( "f" ).set( ( 1, 10, 1 ) ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) self.assertEqual( output.name(), "/" ) self.assertEqual( output.readTransformAsMatrix( 0 ), IECore.M44d() ) self.assertFalse( output.hasObject() ) self.assertEqual( output.childNames(), [ "ieSceneCacheGeometry1" ] ) root = output.child( "ieSceneCacheGeometry1" ) self.assertEqual( root.name(), "ieSceneCacheGeometry1" ) self.assertEqual( root.readTransformAsMatrix( 0 ), IECore.M44d() ) self.assertTrue( root.hasObject() ) obj = root.readObject( 0 ) self.assertTrue( obj.isInstanceOf( IECore.TypeId.Group ) ) self.assertEqual( len(obj.children()), 3 ) for child in obj.children() : self.assertTrue( child.isInstanceOf( IECore.TypeId.MeshPrimitive ) ) self.assertEqual( root.childNames(), [] ) def testRopFlattenedAndHidden( self ) : self.writeSCC() subnet = hou.node( "/obj" ).createNode( "subnet" ) subnet.setDisplayFlag( False ) geo = self.geometry( parent = subnet ) geo.parm( "expand" ).pressButton() attr = geo.children()[0].createOutputNode( "attribute" ) attr.parm( "primdel" ).set( "name" ) attr.setDisplayFlag( True ) attr.setRenderFlag( True ) rop = self.rop( geo ) rop.parm( "trange" ).set( 1 ) rop.parmTuple( "f" ).set( ( 1, 10, 1 ) ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) self.assertEqual( output.name(), "/" ) self.assertEqual( output.readTransformAsMatrix( 0 ), IECore.M44d() ) self.assertFalse( output.hasObject() ) self.assertEqual( output.childNames(), [ "ieSceneCacheGeometry1" ] ) root = output.child( "ieSceneCacheGeometry1" ) self.assertEqual( root.name(), "ieSceneCacheGeometry1" ) self.assertEqual( root.readTransformAsMatrix( 0 ), IECore.M44d() ) self.assertTrue( root.hasObject() ) obj = root.readObject( 0 ) self.assertTrue( obj.isInstanceOf( IECore.TypeId.Group ) ) self.assertEqual( len(obj.children()), 3 ) for child in obj.children() : self.assertTrue( child.isInstanceOf( IECore.TypeId.MeshPrimitive ) ) self.assertEqual( root.childNames(), [] ) def testRopFlattenedWithErrors( self ) : self.writeSCC() geo = self.geometry() geo.parm( "expand" ).pressButton() rop = self.rop( geo ) rop.parm( "rootObject" ).set( geo.path() ) rop.parm( "trange" ).set( 1 ) rop.parmTuple( "f" ).set( ( 1, 10, 1 ) ) geo.renderNode().parm( "file" ).set( "fake.scc" ) rop.parm( "execute" ).pressButton() self.assertNotEqual( rop.errors(), "" ) self.assertTrue( geo.renderNode().path() in rop.errors() ) self.assertTrue( geo.renderNode().errors() in rop.errors() ) def testRopLinked( self ) : self.writeTaggedSCC() xform = self.xform() xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.SubNetworks ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.Children ) xform.parm( "expand" ).pressButton() a = xform.children()[0] a.parm( "expand" ).pressButton() # leaving b and below as a link rop = self.rop( xform ) rop.parm( "file" ).set( TestSceneCache.__testLinkedOutFile ) self.assertFalse( os.path.exists( TestSceneCache.__testLinkedOutFile ) ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) self.assertTrue( os.path.exists( TestSceneCache.__testLinkedOutFile ) ) orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) linked = IECore.LinkedScene( TestSceneCache.__testLinkedOutFile, IECore.IndexedIO.OpenMode.Read ) self.compareScene( orig, linked ) # make sure there really is a link unlinked = IECore.SceneCache( TestSceneCache.__testLinkedOutFile, IECore.IndexedIO.OpenMode.Read ) a = unlinked.child( "1" ) self.assertFalse( a.hasAttribute( IECore.LinkedScene.linkAttribute ) ) self.assertFalse( a.hasAttribute( IECore.LinkedScene.fileNameLinkAttribute ) ) self.assertFalse( a.hasAttribute( IECore.LinkedScene.rootLinkAttribute ) ) self.assertFalse( a.hasAttribute( IECore.LinkedScene.timeLinkAttribute ) ) b = a.child( "2" ) self.assertEqual( b.childNames(), [] ) self.assertFalse( b.hasAttribute( IECore.LinkedScene.linkAttribute ) ) self.assertTrue( b.hasAttribute( IECore.LinkedScene.fileNameLinkAttribute ) ) self.assertTrue( b.hasAttribute( IECore.LinkedScene.rootLinkAttribute ) ) self.assertEqual( b.readAttribute( IECore.LinkedScene.fileNameLinkAttribute, 0 ), IECore.StringData( TestSceneCache.__testFile ) ) self.assertEqual( b.readAttribute( IECore.LinkedScene.rootLinkAttribute, 0 ), IECore.InternedStringVectorData( [ "1", "2" ] ) ) self.assertEqual( b.readAttribute( IECore.LinkedScene.timeLinkAttribute, 0 ), IECore.DoubleData( 1.0 / hou.fps() ) ) # make sure we can force link expansion xform.parm( "collapse" ).pressButton() xform.parm( "file" ).set( TestSceneCache.__testLinkedOutFile ) self.assertEqual( xform.children(), tuple() ) self.assertEqual( xform.parm( "expanded" ).eval(), False ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.Children ) xform.parm( "expand" ).pressButton() rop.parm( "file" ).set( TestSceneCache.__testOutFile ) self.assertFalse( os.path.exists( TestSceneCache.__testOutFile ) ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) self.assertTrue( os.path.exists( TestSceneCache.__testOutFile ) ) expanded = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) self.compareScene( orig, expanded ) self.compareScene( expanded, linked ) # make sure we can read back the whole structure in Houdini xform.parm( "collapse" ).pressButton() xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) xform.parm( "expand" ).pressButton() live = IECoreHoudini.LiveScene( xform.path(), rootPath = [ xform.name() ] ) self.compareScene( orig, live ) # make sure it doesn't crash if the linked scene doesn't exist anymore xform.parm( "collapse" ).pressButton() os.remove( TestSceneCache.__testFile ) IECore.SharedSceneInterfaces.clear() xform.parm( "reload" ).pressButton() xform.parm( "expand" ).pressButton() self.assertEqual( xform.parm( "root" ).menuItems(), ( "/", "/1", "/1/2" ) ) def testRopForceObjects( self ) : s = self.writeAttributeSCC() d = s.child( "1" ).createChild( "4" ) e = d.createChild( "5" ) box = IECore.MeshPrimitive.createBox(IECore.Box3f(IECore.V3f(0),IECore.V3f(1))) d.writeObject( box, 0 ) e.writeObject( box, 0 ) del s, d, e def testLinks( bakedObjects = None ) : if os.path.exists( TestSceneCache.__testLinkedOutFile ) : os.remove( TestSceneCache.__testLinkedOutFile ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) self.assertTrue( os.path.exists( TestSceneCache.__testLinkedOutFile ) ) linked = IECore.LinkedScene( TestSceneCache.__testLinkedOutFile, IECore.IndexedIO.OpenMode.Read ) if bakedObjects : live = IECoreHoudini.LiveScene( xform.path(), rootPath = [ xform.name() ] ) self.compareScene( linked, live, bakedObjects = bakedObjects ) else : orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) self.compareScene( orig, linked ) # make sure the links are where we expect unlinked = IECore.SceneCache( TestSceneCache.__testLinkedOutFile, IECore.IndexedIO.OpenMode.Read ) a = unlinked.child( "1" ) self.assertFalse( a.hasAttribute( IECore.LinkedScene.linkAttribute ) ) self.assertFalse( a.hasAttribute( IECore.LinkedScene.fileNameLinkAttribute ) ) self.assertFalse( a.hasAttribute( IECore.LinkedScene.rootLinkAttribute ) ) self.assertFalse( a.hasAttribute( IECore.LinkedScene.timeLinkAttribute ) ) b = a.child( "2" ) self.assertEqual( b.childNames(), [] ) self.assertFalse( b.hasAttribute( IECore.LinkedScene.linkAttribute ) ) self.assertTrue( b.hasAttribute( IECore.LinkedScene.fileNameLinkAttribute ) ) self.assertTrue( b.hasAttribute( IECore.LinkedScene.rootLinkAttribute ) ) self.assertEqual( b.readAttribute( IECore.LinkedScene.fileNameLinkAttribute, 0 ), IECore.StringData( TestSceneCache.__testFile ) ) self.assertEqual( b.readAttribute( IECore.LinkedScene.rootLinkAttribute, 0 ), IECore.InternedStringVectorData( [ "1", "2" ] ) ) self.assertEqual( b.readAttribute( IECore.LinkedScene.timeLinkAttribute, 0 ), IECore.DoubleData( 0 ) ) d = a.child( "4" ) self.assertFalse( d.hasAttribute( IECore.LinkedScene.linkAttribute ) ) self.assertFalse( d.hasAttribute( IECore.LinkedScene.fileNameLinkAttribute ) ) self.assertFalse( d.hasAttribute( IECore.LinkedScene.rootLinkAttribute ) ) self.assertFalse( d.hasAttribute( IECore.LinkedScene.timeLinkAttribute ) ) # force b and below as links even though they are expanded hou.setTime( -1.0 / hou.fps() ) xform = self.xform() xform.parm( "expand" ).pressButton() rop = self.rop( xform ) rop.parm( "file" ).set( TestSceneCache.__testLinkedOutFile ) rop.parm( "forceObjects" ).set( "*4*" ) testLinks() # make sure parents expand if their child is forced rop.parm( "forceObjects" ).set( "*5*" ) testLinks() # make sure normal geo gets expanded regardless geo = xform.createNode( "geo", "real" ) geo.createNode( "box" ) testLinks( bakedObjects = [ "real" ] ) unlinked = IECore.SceneCache( TestSceneCache.__testLinkedOutFile, IECore.IndexedIO.OpenMode.Read ) real = unlinked.child( "real" ) self.assertFalse( real.hasAttribute( IECore.LinkedScene.linkAttribute ) ) self.assertFalse( real.hasAttribute( IECore.LinkedScene.fileNameLinkAttribute ) ) self.assertFalse( real.hasAttribute( IECore.LinkedScene.rootLinkAttribute ) ) self.assertFalse( real.hasAttribute( IECore.LinkedScene.timeLinkAttribute ) ) self.assertTrue( real.hasObject() ) geo.destroy() # make sure natural links (unexpanded branches) still work hou.node( xform.path() + "/1/2" ).parm( "collapse" ).pressButton() testLinks() # make sure normal SceneCaches aren't broken by forceObjects rop.parm( "file" ).set( TestSceneCache.__testOutFile ) self.assertFalse( os.path.exists( TestSceneCache.__testOutFile ) ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) self.assertTrue( os.path.exists( TestSceneCache.__testOutFile ) ) orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) result = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) self.compareScene( orig, result ) def testRopErrors( self ) : xform = self.xform() rop = self.rop( xform ) rop.parm( "file" ).set( "/tmp/bad.file" ) rop.parm( "execute" ).pressButton() self.assertNotEqual( rop.errors(), "" ) self.assertFalse( os.path.exists( TestSceneCache.__testOutFile ) ) rop.parm( "file" ).set( TestSceneCache.__testOutFile ) rop.parm( "rootObject" ).set( "/obj/fake/object" ) self.assertNotEqual( rop.errors(), "" ) self.assertFalse( os.path.exists( TestSceneCache.__testOutFile ) ) rop.parm( "rootObject" ).set( xform.path() ) xform.destroy() self.assertNotEqual( rop.errors(), "" ) self.assertFalse( os.path.exists( TestSceneCache.__testOutFile ) ) sop = self.sop() rop.parm( "rootObject" ).set( sop.path() ) rop.parm( "execute" ).pressButton() self.assertNotEqual( rop.errors(), "" ) self.assertFalse( os.path.exists( TestSceneCache.__testOutFile ) ) newXform = self.xform() rop.parm( "rootObject" ).set( newXform.path() ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) self.assertTrue( os.path.exists( TestSceneCache.__testOutFile ) ) def testAnimatedRop( self ) : self.writeAnimSCC() xform = self.xform() xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.Parenting ) xform.parm( "expand" ).pressButton() rop = self.rop( xform ) rop.parm( "trange" ).set( 1 ) rop.parmTuple( "f" ).set( ( 0, 10 * hou.fps(), 1 ) ) rop.parm( "execute" ).pressButton() orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) times = range( 0, 10 ) halves = [ x + 0.5 for x in times ] quarters = [ x + 0.25 for x in times ] times.extend( [ x + 0.75 for x in times ] ) times.extend( halves ) times.extend( quarters ) times.sort() for time in times : self.compareScene( orig, output, time ) def testRopCookCounts( self ) : self.writeAnimSCC() xform = self.xform() xform.parm( "expand" ).pressButton() a = hou.node( xform.path()+"/1/geo/1" ) # static b = hou.node( xform.path()+"/1/2/geo/2" ) # animated c = hou.node( xform.path()+"/1/2/3/geo/3" ) # static # make sure nothing has been cooked self.assertEqual( a.cookCount(), 0 ) self.assertEqual( b.cookCount(), 0 ) self.assertEqual( c.cookCount(), 0 ) # cook current frame rop = self.rop( xform ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) self.assertEqual( a.cookCount(), 1 ) self.assertEqual( b.cookCount(), 1 ) self.assertEqual( c.cookCount(), 1 ) # cook single frame that is not the current frame self.assertNotEqual( hou.frame(), 10 ) rop.parm( "trange" ).set( 1 ) rop.parm( "f1" ).set( 10 ) rop.parm( "f2" ).set( 10 ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) self.assertEqual( a.cookCount(), 1 ) self.assertEqual( b.cookCount(), 2 ) self.assertEqual( c.cookCount(), 1 ) # cook a range rop.parm( "f1" ).set( 1 ) rop.parm( "f2" ).set( 10 ) rop.parm( "execute" ).pressButton() self.assertEqual( rop.errors(), "" ) self.assertEqual( a.cookCount(), 1 ) self.assertEqual( b.cookCount(), 12 ) self.assertEqual( c.cookCount(), 1 ) # with flat geo sop = self.sop() self.assertEqual( sop.cookCount(), 0 ) rop.parm( "rootObject" ).set( sop.parent().path() ) rop.parm( "trange" ).set( 1 ) rop.parm( "f1" ).set( 10 ) rop.parm( "f2" ).set( 10 ) rop.parm( "execute" ).pressButton() self.assertEqual( sop.cookCount(), 1 ) def testRopDynamicSopHierarchy( self ) : self.writeAnimSCC() obj = self.geometry() obj.parm( "expand" ).pressButton() delete = obj.renderNode().createOutputNode( "delete" ) delete.parm( "groupop" ).set( 1 ) # by range delete.parm( "rangestart" ).set( 2 ) delete.parm( "rangeend" ).set( 2 ) switch = obj.renderNode().createOutputNode( "switch" ) switch.setInput( 1, delete ) switch.parm( "input" ).setExpression( "if hou.frame() >= 5 :\n\treturn 0\nelse :\n\treturn 1", hou.exprLanguage.Python ) switch.setRenderFlag( True ) rop = self.rop( obj ) rop.parm( "trange" ).set( 1 ) rop.parm( "f1" ).set( 1 ) rop.parm( "f2" ).set( 20 ) rop.parm( "execute" ).pressButton() output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) a = output.child( "1" ) b = a.child( "2" ) c = b.child( "3" ) attr = "scene:visible" self.assertFalse( a.hasAttribute( attr ) ) self.assertFalse( b.hasAttribute( attr ) ) self.assertTrue( c.hasAttribute( attr ) ) self.assertEqual( c.readAttribute( attr, 0 ), IECore.BoolData( False ) ) self.assertEqual( c.readAttribute( attr, 0.2083 ), IECore.BoolData( False ) ) self.assertEqual( c.readAttribute( attr, 0.2084 ), IECore.BoolData( True ) ) self.assertEqual( c.readAttribute( attr, 1 ), IECore.BoolData( True ) ) del output, a, b, c IECore.SharedSceneInterfaces.clear() # make sure it can appear and disappear correctly switch.parm( "input" ).setExpression( "if hou.frame() < 5 or hou.frame() >= 10 :\n\treturn 1\nelse :\n\treturn 0", hou.exprLanguage.Python ) rop.parm( "execute" ).pressButton() hou.hipFile.save( "/tmp/bunk.hip" ) output = IECore.SceneCache( TestSceneCache.__testOutFile, IECore.IndexedIO.OpenMode.Read ) a = output.child( "1" ) b = a.child( "2" ) c = b.child( "3" ) self.assertFalse( a.hasAttribute( attr ) ) self.assertFalse( b.hasAttribute( attr ) ) self.assertTrue( c.hasAttribute( attr ) ) self.assertEqual( c.readAttribute( attr, 0 ), IECore.BoolData( False ) ) self.assertEqual( c.readAttribute( attr, 0.2083 ), IECore.BoolData( False ) ) self.assertEqual( c.readAttribute( attr, 0.2084 ), IECore.BoolData( True ) ) self.assertEqual( c.readAttribute( attr, 0.3 ), IECore.BoolData( True ) ) self.assertEqual( c.readAttribute( attr, 0.4167 ), IECore.BoolData( False ) ) self.assertEqual( c.readAttribute( attr, 1 ), IECore.BoolData( False ) ) def testLiveScene( self ) : self.writeTaggedSCC() xform = self.xform() xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.SubNetworks ) xform.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.Children ) xform.parm( "expand" ).pressButton() a = xform.children()[0] a.parm( "expand" ).pressButton() b = a.children()[1] b.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.FlatGeometry ) b.parm( "depth" ).set( IECoreHoudini.SceneCacheNode.Depth.AllDescendants ) b.parm( "expand" ).pressButton() orig = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Read ) live = IECoreHoudini.LiveScene( xform.path(), rootPath = [ xform.name() ] ) self.compareScene( orig, live, bakedObjects = [ "3" ] ) def testTopologyChanges( self ) : plane = IECore.MeshPrimitive.createPlane( IECore.Box2f( IECore.V2f( -1 ), IECore.V2f( 1 ) ) ) box = IECore.MeshPrimitive.createBox( IECore.Box3f( IECore.V3f( 0 ), IECore.V3f( 1 ) ) ) box["Cd"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Uniform, IECore.Color3fVectorData( [ IECore.Color3f( 1, 0, 0 ) ] * box.variableSize( IECore.PrimitiveVariable.Interpolation.Uniform ) ) ) box2 = IECore.MeshPrimitive.createBox( IECore.Box3f( IECore.V3f( 2 ), IECore.V3f( 3 ) ) ) box2["Cd"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Uniform, IECore.Color3fVectorData( [ IECore.Color3f( 0, 1, 0 ) ] * box.variableSize( IECore.PrimitiveVariable.Interpolation.Uniform ) ) ) s = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Write ) a = s.createChild( "a" ) b = a.createChild( "b" ) c = a.createChild( "c" ) d = a.createChild( "d" ) # animated topology b.writeObject( box, 0 ) b.writeObject( plane, 1 ) # static c.writeObject( box, 0 ) c.writeObject( box, 1 ) # animated P and Cd d.writeObject( box, 0 ) d.writeObject( box2, 1 ) del s, a, b, c, d spf = 1.0 / hou.fps() hou.setTime( 0 - spf ) node = self.sop() node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) self.assertEqual( len(node.geometry().points()), 24 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( set(nameAttr.strings()), set([ '/a/b', '/a/c', '/a/d' ]) ) bPrims = [ x for x in prims if x.attribValue( nameAttr ) == '/a/b' ] cPrims = [ x for x in prims if x.attribValue( nameAttr ) == '/a/c' ] dPrims = [ x for x in prims if x.attribValue( nameAttr ) == '/a/d' ] self.assertEqual( len(bPrims), 6 ) self.assertEqual( len(cPrims), 6 ) self.assertEqual( len(dPrims), 6 ) self.assertEqual( bPrims[0].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( cPrims[0].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( dPrims[0].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( bPrims[0].attribValue( "Cd" ), ( 1, 0, 0 ) ) self.assertEqual( cPrims[0].attribValue( "Cd" ), ( 1, 0, 0 ) ) self.assertEqual( dPrims[0].attribValue( "Cd" ), ( 1, 0, 0 ) ) hou.setTime( 1 - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 13 ) self.assertEqual( len(node.geometry().points()), 20 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( set(nameAttr.strings()), set([ '/a/b', '/a/c', '/a/d' ]) ) bPrims = [ x for x in prims if x.attribValue( nameAttr ) == '/a/b' ] cPrims = [ x for x in prims if x.attribValue( nameAttr ) == '/a/c' ] dPrims = [ x for x in prims if x.attribValue( nameAttr ) == '/a/d' ] self.assertEqual( len(bPrims), 1 ) self.assertEqual( len(cPrims), 6 ) self.assertEqual( len(dPrims), 6 ) self.assertEqual( bPrims[0].vertex( 0 ).point().position(), hou.Vector3( -1, 1, 0 ) ) self.assertEqual( cPrims[0].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( dPrims[0].vertex( 0 ).point().position(), hou.Vector3( 2, 2, 2 ) ) self.assertEqual( bPrims[0].attribValue( "Cd" ), ( 0, 0, 0 ) ) self.assertEqual( cPrims[0].attribValue( "Cd" ), ( 1, 0, 0 ) ) self.assertEqual( dPrims[0].attribValue( "Cd" ), ( 0, 1, 0 ) ) hou.setTime( 0.5 - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 13 ) self.assertEqual( len(node.geometry().points()), 20 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( set(nameAttr.strings()), set([ '/a/b', '/a/c', '/a/d' ]) ) bPrims = [ x for x in prims if x.attribValue( nameAttr ) == '/a/b' ] cPrims = [ x for x in prims if x.attribValue( nameAttr ) == '/a/c' ] dPrims = [ x for x in prims if x.attribValue( nameAttr ) == '/a/d' ] self.assertEqual( len(bPrims), 1 ) self.assertEqual( len(cPrims), 6 ) self.assertEqual( len(dPrims), 6 ) self.assertEqual( bPrims[0].vertex( 0 ).point().position(), hou.Vector3( -1, 1, 0 ) ) self.assertEqual( cPrims[0].vertex( 0 ).point().position(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( dPrims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 1, 1 ) ) self.assertEqual( bPrims[0].attribValue( "Cd" ), ( 0, 0, 0 ) ) self.assertEqual( cPrims[0].attribValue( "Cd" ), ( 1, 0, 0 ) ) self.assertEqual( dPrims[0].attribValue( "Cd" ), ( 0.5, 0.5, 0 ) ) def testSaveLoadCortexObjects( self ) : self.writeSCC() sop = self.sop() sop.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) null = sop.createOutputNode( "null" ) nullPath = null.path() prims = null.geometry().prims() self.assertEqual( len(prims), 3 ) for i in range( 0, 3 ) : self.assertEqual( prims[i].type(), hou.primType.Custom ) self.assertEqual( prims[i].vertices()[0].point().number(), i ) # make sure they survive the locks null.setHardLocked( True ) null.setInput( 0, None ) prims = null.geometry().prims() self.assertEqual( len(prims), 3 ) for i in range( 0, 3 ) : self.assertEqual( prims[i].type(), hou.primType.Custom ) self.assertEqual( prims[i].vertices()[0].point().number(), i ) # make sure they survive a scene save/load hou.hipFile.save( TestSceneCache.__testHip ) hou.hipFile.load( TestSceneCache.__testHip ) null = hou.node( nullPath ) prims = null.geometry().prims() self.assertEqual( len(prims), 3 ) for i in range( 0, 3 ) : self.assertEqual( prims[i].type(), hou.primType.Custom ) self.assertEqual( prims[i].vertices()[0].point().number(), i ) # make sure they survive bgeo caching writer = null.createOutputNode( "file" ) writer.parm( "file" ).set( TestSceneCache.__testBgeo ) writer.parm( "filemode" ).set( 2 ) # write writer.cook( force = True ) reader = null.parent().createNode( "file" ) reader.parm( "file" ).set( TestSceneCache.__testBgeo ) prims = reader.geometry().prims() self.assertEqual( len(prims), 3 ) for i in range( 0, 3 ) : self.assertEqual( prims[i].type(), hou.primType.Custom ) self.assertEqual( prims[i].vertices()[0].point().number(), i ) # make sure they survive bgeo.gz caching writer.parm( "file" ).set( TestSceneCache.__testBgeoGz ) writer.cook( force = True ) reader = null.parent().createNode( "file" ) reader.parm( "file" ).set( TestSceneCache.__testBgeoGz ) prims = reader.geometry().prims() self.assertEqual( len(prims), 3 ) for i in range( 0, 3 ) : self.assertEqual( prims[i].type(), hou.primType.Custom ) self.assertEqual( prims[i].vertices()[0].point().number(), i ) # make sure they survive geo caching writer.parm( "file" ).set( TestSceneCache.__testGeo ) writer.cook( force = True ) reader = null.parent().createNode( "file" ) reader.parm( "file" ).set( TestSceneCache.__testGeo ) prims = reader.geometry().prims() self.assertEqual( len(prims), 3 ) for i in range( 0, 3 ) : self.assertEqual( prims[i].type(), hou.primType.Custom ) self.assertEqual( prims[i].vertices()[0].point().number(), i ) def testStashing( self ) : self.writeSCC() sop = self.sop() writer = sop.createOutputNode( "file" ) writer.parm( "file" ).set( TestSceneCache.__testBgeo ) writer.parm( "filemode" ).set( 2 ) # write writer.cook( force = True ) reader = sop.parent().createNode( "file" ) reader.parm( "file" ).set( TestSceneCache.__testBgeo ) reader.cook( force = True ) reader.cook( force = True ) def testNonPrimitiveCortexObjects( self ) : scene = self.writeAnimSCC() coordChild = scene.child( "1" ).createChild( "coord" ) coord = IECore.CoordinateSystem() coord.setName( "testing" ) coord.setTransform( IECore.MatrixTransform( IECore.M44f.createTranslated( IECore.V3f( 1, 2, 3 ) ) ) ) coordChild.writeObject( coord, 0 ) coord.setTransform( IECore.MatrixTransform( IECore.M44f.createTranslated( IECore.V3f( 1, 5, 5 ) ) ) ) coordChild.writeObject( coord, 1 ) intsChild = scene.createChild( "ints" ) intsChild.writeObject( IECore.IntVectorData( [ 1, 10, 20, 30 ] ), 0 ) del scene, coordChild, intsChild spf = 1.0 / hou.fps() hou.setTime( 0 - spf ) sop = self.sop() sop.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = sop.geometry().prims() self.assertEqual( len(prims), 5 ) nameAttr = sop.geometry().findPrimAttrib( "name" ) self.assertEqual( sorted(nameAttr.strings()), ['/1', '/1/2', '/1/2/3', '/1/coord', '/ints'] ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) for i in range( 0, 5 ) : self.assertEqual( prims[i].type(), hou.primType.Custom ) self.assertEqual( prims[i].vertices()[0].point().number(), i ) aPrim = [ x for x in prims if x.attribValue( nameAttr ) == '/1' ][0] bPrim = [ x for x in prims if x.attribValue( nameAttr ) == '/1/2' ][0] cPrim = [ x for x in prims if x.attribValue( nameAttr ) == '/1/2/3' ][0] coordPrim = [ x for x in prims if x.attribValue( nameAttr ) == '/1/coord' ][0] intsPrim = [ x for x in prims if x.attribValue( nameAttr ) == '/ints' ][0] self.assertEqual( aPrim.vertices()[0].point().position(), hou.Vector3( 1.5, 0.5, 0.5 ) ) self.assertEqual( bPrim.vertices()[0].point().position(), hou.Vector3( 3.5, 0.5, 0.5 ) ) self.assertEqual( cPrim.vertices()[0].point().position(), hou.Vector3( 6.5, 0.5, 0.5 ) ) self.assertEqual( coordPrim.vertices()[0].point().position(), hou.Vector3( 2, 2, 3 ) ) self.assertEqual( intsPrim.vertices()[0].point().position(), hou.Vector3( 0, 0, 0 ) ) converter = IECoreHoudini.FromHoudiniGeometryConverter.create( sop ) self.assertTrue( isinstance( converter, IECoreHoudini.FromHoudiniCompoundObjectConverter ) ) result = converter.convert() self.assertTrue( isinstance( result, IECore.CompoundObject ) ) self.assertEqual( sorted( result.keys() ), ['/1', '/1/2', '/1/2/3', '/1/coord', '/ints'] ) self.assertTrue( isinstance( result["/1"], IECore.MeshPrimitive ) ) self.assertTrue( isinstance( result["/1/2"], IECore.MeshPrimitive ) ) self.assertTrue( isinstance( result["/1/2/3"], IECore.MeshPrimitive ) ) self.assertTrue( isinstance( result["/1/coord"], IECore.CoordinateSystem ) ) self.assertEqual( result["/ints"], IECore.IntVectorData( [ 1, 10, 20, 30 ] ) ) hou.setTime( 1 - spf ) prims = sop.geometry().prims() self.assertEqual( len(prims), 5 ) nameAttr = sop.geometry().findPrimAttrib( "name" ) self.assertEqual( sorted(nameAttr.strings()), ['/1', '/1/2', '/1/2/3', '/1/coord', '/ints'] ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) for i in range( 0, 5 ) : self.assertEqual( prims[i].type(), hou.primType.Custom ) self.assertEqual( prims[i].vertices()[0].point().number(), i ) aPrim = [ x for x in prims if x.attribValue( nameAttr ) == '/1' ][0] bPrim = [ x for x in prims if x.attribValue( nameAttr ) == '/1/2' ][0] cPrim = [ x for x in prims if x.attribValue( nameAttr ) == '/1/2/3' ][0] coordPrim = [ x for x in prims if x.attribValue( nameAttr ) == '/1/coord' ][0] intsPrim = [ x for x in prims if x.attribValue( nameAttr ) == '/ints' ][0] self.assertEqual( aPrim.vertices()[0].point().position(), hou.Vector3( 1.5, 1.5, 0.5 ) ) self.assertEqual( bPrim.vertices()[0].point().position(), hou.Vector3( 3.5, 2.5, 0.5 ) ) self.assertEqual( cPrim.vertices()[0].point().position(), hou.Vector3( 6.5, 3.5, 0.5 ) ) self.assertEqual( coordPrim.vertices()[0].point().position(), hou.Vector3( 2, 6, 5 ) ) self.assertEqual( intsPrim.vertices()[0].point().position(), hou.Vector3( 0, 0, 0 ) ) sop.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) prims = sop.geometry().prims() self.assertEqual( len(prims), 18 ) self.assertTrue( "/1/coord" in sop.warnings() ) self.assertTrue( "/ints" in sop.warnings() ) nameAttr = sop.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, 1, 0 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, 2, 0 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, 3, 0 ) ) def testCoordinateSystemNoTransform( self ) : scene = IECore.SceneCache( TestSceneCache.__testFile, IECore.IndexedIO.OpenMode.Write ) coordChild = scene.createChild( "coord") coord = IECore.CoordinateSystem() coord.setName( "testing" ) coordChild.writeObject( coord, 0 ) coordChild2 = coordChild.createChild( "other") coordChild2.writeTransform( IECore.M44dData( IECore.M44d.createTranslated( IECore.V3d( 1, 2, 3 ) ) ), 0 ) coordChild2.writeObject( coord, 0 ) del scene, coordChild, coordChild2 sop = self.sop() sop.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) prims = sop.geometry().prims() self.assertEqual( len(prims), 2 ) nameAttr = sop.geometry().findPrimAttrib( "name" ) self.assertEqual( sorted(nameAttr.strings()), [ "/coord", "/coord/other" ] ) self.assertEqual( prims[0].attribValue( "name" ), "/coord" ) self.assertEqual( prims[0].type(), hou.primType.Custom ) self.assertEqual( prims[0].vertices()[0].point().number(), 0 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 0, 0, 0 ) ) self.assertEqual( prims[1].attribValue( "name" ), "/coord/other" ) self.assertEqual( prims[1].type(), hou.primType.Custom ) self.assertEqual( prims[1].vertices()[0].point().number(), 1 ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 1, 2, 3 ) ) def testObjectMerge( self ) : self.writeSCC() xform = self.xform() xform.parm( "expand" ).pressButton() origSop = hou.node( xform.path()+"/1/2/geo/2" ) merge = hou.node( "/obj" ).createNode( "geo" ).createNode( "object_merge" ) merge.parm( "objpath1" ).set( origSop.path() ) # not transformed because we haven't set "Into this Object" geo = merge.geometry() self.assertEqual( geo.points()[0].position(), hou.Vector3( 0.5, 0.5, 0.5 ) ) self.assertEqual( geo.boundingBox(), hou.BoundingBox( 0, 0, 0, 1, 1, 1 ) ) # transformed to its world position merge.parm( "xformtype" ).set( 1 ) # "Into this Object" geo = merge.geometry() self.assertEqual( geo.points()[0].position(), hou.Vector3( 3.5, 0.5, 0.5 ) ) self.assertEqual( geo.boundingBox(), hou.BoundingBox( 3, 0, 0, 4, 1, 1 ) ) mesh = IECoreHoudini.FromHoudiniGeometryConverter.create( merge ).convert() self.assertEqual( mesh.bound(), IECore.Box3f( IECore.V3f( 3, 0, 0 ), IECore.V3f( 4, 1, 1 ) ) ) # didn't affect the original SOP because it stores it's own copy of the prim geo = origSop.geometry() self.assertEqual( geo.points()[0].position(), hou.Vector3( 0.5, 0.5, 0.5 ) ) self.assertEqual( geo.boundingBox(), hou.BoundingBox( 0, 0, 0, 1, 1, 1 ) ) mesh = IECoreHoudini.FromHoudiniGeometryConverter.create( origSop ).convert() self.assertEqual( mesh.bound(), IECore.Box3f( IECore.V3f( 0 ), IECore.V3f( 1 ) ) ) # transformable at the SOP level as well sopXform = merge.createOutputNode( "xform" ) sopXform.parm( "ty" ).set( 7 ) geo = sopXform.geometry() self.assertEqual( geo.points()[0].position(), hou.Vector3( 3.5, 7.5, 0.5 ) ) self.assertEqual( geo.boundingBox(), hou.BoundingBox( 3, 7, 0, 4, 8, 1 ) ) mesh = IECoreHoudini.FromHoudiniGeometryConverter.create( sopXform ).convert() self.assertEqual( mesh.bound(), IECore.Box3f( IECore.V3f( 3, 7, 0 ), IECore.V3f( 4, 8, 1 ) ) ) # didn't affect the input SOP because it stores it's own copy of the prim geo = merge.geometry() self.assertEqual( geo.points()[0].position(), hou.Vector3( 3.5, 0.5, 0.5 ) ) self.assertEqual( geo.boundingBox(), hou.BoundingBox( 3, 0, 0, 4, 1, 1 ) ) mesh = IECoreHoudini.FromHoudiniGeometryConverter.create( merge ).convert() self.assertEqual( mesh.bound(), IECore.Box3f( IECore.V3f( 3, 0, 0 ), IECore.V3f( 4, 1, 1 ) ) ) def testPointsDontAccumulate( self ) : obj = hou.node("/obj") geo = obj.createNode("geo", run_init_scripts=False) box = geo.createNode( "box" ) facet = geo.createNode( "facet" ) facet.parm("postnml").set(True) points = geo.createNode( "scatter" ) points.parm( "npts" ).set( 5000 ) facet.setInput( 0, box ) points.setInput( 0, facet ) points.setRenderFlag( True ) points.setDisplayFlag( True ) rop = self.rop( geo ) rop.parm( "trange" ).set( 1 ) rop.parmTuple( "f" ).set( ( 1, 10, 1 ) ) rop.parm( "execute" ).pressButton() sop = self.sop() sop.parm( "file" ).set( TestSceneCache.__testOutFile ) sop.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) for t in range( 0, 10 ) : hou.setTime( t ) self.assertEqual( len(sop.geometry().points()), 5000 ) self.assertEqual( len(sop.geometry().prims()), 1 ) def testTimeDependent( self ) : self.writeSCC() xform = self.xform() xform.parm( "expand" ).pressButton() self.assertFalse( hou.node( xform.path()+"/1" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/geo" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/geo/1" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/2" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/2/geo" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/2/geo/2" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/2/3" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/2/3/geo" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/2/3/geo/3" ).isTimeDependent() ) scene = self.writeSCC() sc1 = scene.child( str( 1 ) ) sc2 = sc1.child( str( 2 ) ) sc3 = sc2.child( str( 3 ) ) for time in [ 0.5, 1, 1.5, 2, 5, 10 ] : matrix = IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) sc2.writeTransform( IECore.M44dData( matrix ), time ) matrix = IECore.M44d.createTranslated( IECore.V3d( 3, time, 0 ) ) sc3.writeTransform( IECore.M44dData( matrix ), time ) del scene, sc1, sc2, sc3 xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() self.assertFalse( hou.node( xform.path()+"/1" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/geo" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/geo/1" ).isTimeDependent() ) self.assertTrue( hou.node( xform.path()+"/1/2" ).isTimeDependent() ) self.assertTrue( hou.node( xform.path()+"/1/2/geo" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/2/geo/2" ).isTimeDependent() ) self.assertTrue( hou.node( xform.path()+"/1/2/3" ).isTimeDependent() ) self.assertTrue( hou.node( xform.path()+"/1/2/3/geo" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/2/3/geo/3" ).isTimeDependent() ) scene = self.writeSCC() sc1 = scene.child( str( 1 ) ) sc2 = sc1.child( str( 2 ) ) sc3 = sc2.child( str( 3 ) ) mesh = IECore.MeshPrimitive.createBox(IECore.Box3f(IECore.V3f(0),IECore.V3f(1))) for time in [ 0.5, 1, 1.5, 2, 5, 10 ] : matrix = IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) sc2.writeTransform( IECore.M44dData( matrix ), time ) mesh["Cs"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Uniform, IECore.V3fVectorData( [ IECore.V3f( time, 1, 0 ) ] * 6 ) ) sc2.writeObject( mesh, time ) del scene, sc1, sc2, sc3 xform.parm( "collapse" ).pressButton() xform.parm( "expand" ).pressButton() self.assertFalse( hou.node( xform.path()+"/1" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/geo" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/geo/1" ).isTimeDependent() ) self.assertTrue( hou.node( xform.path()+"/1/2" ).isTimeDependent() ) self.assertTrue( hou.node( xform.path()+"/1/2/geo" ).isTimeDependent() ) self.assertTrue( hou.node( xform.path()+"/1/2/geo/2" ).isTimeDependent() ) if hou.applicationVersion()[0] >= 14 : self.assertTrue( hou.node( xform.path()+"/1/2/3" ).isTimeDependent() ) else : self.assertFalse( hou.node( xform.path()+"/1/2/3" ).isTimeDependent() ) self.assertTrue( hou.node( xform.path()+"/1/2/3/geo" ).isTimeDependent() ) self.assertFalse( hou.node( xform.path()+"/1/2/3/geo/3" ).isTimeDependent() ) def testSceneMethod( self ) : def testNode( node ) : sceneNode = IECoreHoudini.SceneCacheNode( node ) shared = IECore.SharedSceneInterfaces.get( TestSceneCache.__testFile ) self.assertTrue( sceneNode.scene().isSame( shared ) ) node.parm( "root" ).set( "/1/fake" ) self.assertEqual( sceneNode.scene(), None ) node.parm( "root" ).set( "/1/2" ) self.compareScene( sceneNode.scene(), shared.scene( [ "1", "2" ] ) ) self.writeSCC() testNode( self.sop() ) testNode( self.xform() ) testNode( self.geometry() ) testNode( self.sopXform() ) def testTransformOverride( self ) : self.writeAnimSCC() times = range( 0, 10 ) halves = [ x + 0.5 for x in times ] quarters = [ x + 0.25 for x in times ] times.extend( [ x + 0.75 for x in times ] ) times.extend( halves ) times.extend( quarters ) times.sort() spf = 1.0 / hou.fps() xform = self.xform() xform.parm( "expand" ).pressButton() a = xform.children()[0] b = [ x for x in a.children() if x.name() != "geo" ][0] c = [ x for x in b.children() if x.name() != "geo" ][0] for time in times : if hou.applicationVersion()[0] >= 14 : self.assertEqual( IECore.M44d( list(xform.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(xform.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, time * 2, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 6, time * 3, 0 ) ) ) else : self.assertEqual( IECore.M44d( list(xform.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, time, 0 ) ) ) for time in times : hou.setTime( time - spf ) self.assertEqual( IECore.M44d( list(xform.parmTransform().asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 1, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 3, time, 0 ) ) ) a.parm( "overrideTransform" ).set( True ) c.parm( "overrideTransform" ).set( True ) c.parm( "tx" ).setExpression( "$T+1/$FPS" ) for time in times : if hou.applicationVersion()[0] >= 14 : self.assertEqual( IECore.M44d( list(xform.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 0, 0, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.localTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( time, 0, 0 ) ) ) self.assertEqual( IECore.M44d( list(xform.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 0, 0, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2 + time, time, 0 ) ) ) else : self.assertEqual( IECore.M44d( list(xform.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 0, 0, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.worldTransformAtTime( time - spf ).asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( time, 0, 0 ) ) ) for time in times : hou.setTime( time - spf ) self.assertEqual( IECore.M44d( list(xform.parmTransform().asTuple()) ), IECore.M44d() ) self.assertEqual( IECore.M44d( list(a.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 0, 0, 0 ) ) ) self.assertEqual( IECore.M44d( list(b.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( 2, time, 0 ) ) ) self.assertEqual( IECore.M44d( list(c.parmTransform().asTuple()) ), IECore.M44d.createTranslated( IECore.V3d( time, 0, 0 ) ) ) def testGeometryTypes( self ) : self.writeAnimSCC() times = range( 0, 10 ) halves = [ x + 0.5 for x in times ] quarters = [ x + 0.25 for x in times ] times.extend( [ x + 0.75 for x in times ] ) times.extend( halves ) times.extend( quarters ) times.sort() spf = 1.0 / hou.fps() node = self.sop() node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) self.assertEqual( prims[0].vertices()[0].point().position(), hou.Vector3( 1.5, time + 0.5, 0.5 ) ) self.assertEqual( prims[1].vertices()[0].point().position(), hou.Vector3( 3.5, time*2 + 0.5, 0.5 ) ) self.assertEqual( prims[2].vertices()[0].point().position(), hou.Vector3( 6.5, time*3 + 0.5, 0.5 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, time, 0 ) ) self.assertEqual( prims[4].vertex( 0 ).point().position(), hou.Vector3( 2, time + 1, 1 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, time*2, 0 ) ) self.assertEqual( prims[10].vertex( 0 ).point().position(), hou.Vector3( 4, time*2 + 1, 1 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, time*3, 0 ) ) self.assertEqual( prims[16].vertex( 0 ).point().position(), hou.Vector3( 7, time*3 + 1, 1 ) ) node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.BoundingBox ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 18 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 6 ) self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 1, time, 0 ) ) self.assertEqual( prims[4].vertex( 0 ).point().position(), hou.Vector3( 7, time*3 + 1, 1 ) ) self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 3, time*2, 0 ) ) self.assertEqual( prims[10].vertex( 0 ).point().position(), hou.Vector3( 7, time*3 + 1, 1 ) ) self.assertEqual( prims[12].vertex( 0 ).point().position(), hou.Vector3( 6, time*3, 0 ) ) self.assertEqual( prims[16].vertex( 0 ).point().position(), hou.Vector3( 7, time*3 + 1, 1 ) ) # re-write with rotation to prove point cloud basis vectors are accurate self.writeAnimSCC( rotate = True ) scene = IECore.SharedSceneInterfaces.get( TestSceneCache.__testFile ) a = scene.child( "1" ) b = a.child( "2" ) c = b.child( "3" ) node.parm( "reload" ).pressButton() node.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.PointCloud ) for time in times : hou.setTime( time - spf ) prims = node.geometry().prims() self.assertEqual( len(prims), 3 ) nameAttr = node.geometry().findPrimAttrib( "name" ) self.assertEqual( nameAttr.strings(), tuple( [ '/1', '/1/2', '/1/2/3' ] ) ) for name in nameAttr.strings() : self.assertEqual( len([ x for x in prims if x.attribValue( "name" ) == name ]), 1 ) aPoint = prims[0].vertices()[0].point() bPoint = prims[1].vertices()[0].point() cPoint = prims[2].vertices()[0].point() aWorld = scene.readTransformAsMatrix( time ) * a.readTransformAsMatrix( time ) bWorld = aWorld * b.readTransformAsMatrix( time ) cWorld = bWorld * c.readTransformAsMatrix( time ) self.assertTrue( IECore.V3d( list(aPoint.position()) ).equalWithAbsError( aWorld.multVecMatrix( a.readBound( time ).center() ), 1e-6 ) ) self.assertTrue( IECore.V3d( list(bPoint.position()) ).equalWithAbsError( bWorld.multVecMatrix( b.readBound( time ).center() ), 1e-6 ) ) self.assertTrue( IECore.V3d( list(cPoint.position()) ).equalWithAbsError( cWorld.multVecMatrix( c.readBound( time ).center() ), 1e-6 ) ) self.assertTrue( IECore.V3d( list(aPoint.attribValue( "basis1" )) ).equalWithAbsError( IECore.V3d( aWorld[(0,0)], aWorld[(0,1)], aWorld[(0,2)] ), 1e-6 ) ) self.assertTrue( IECore.V3d( list(aPoint.attribValue( "basis2" )) ).equalWithAbsError( IECore.V3d( aWorld[(1,0)], aWorld[(1,1)], aWorld[(1,2)] ), 1e-6 ) ) self.assertTrue( IECore.V3d( list(aPoint.attribValue( "basis3" )) ).equalWithAbsError( IECore.V3d( aWorld[(2,0)], aWorld[(2,1)], aWorld[(2,2)] ), 1e-6 ) ) self.assertTrue( IECore.V3d( list(bPoint.attribValue( "basis1" )) ).equalWithAbsError( IECore.V3d( bWorld[(0,0)], bWorld[(0,1)], bWorld[(0,2)] ), 1e-6 ) ) self.assertTrue( IECore.V3d( list(bPoint.attribValue( "basis2" )) ).equalWithAbsError( IECore.V3d( bWorld[(1,0)], bWorld[(1,1)], bWorld[(1,2)] ), 1e-6 ) ) self.assertTrue( IECore.V3d( list(bPoint.attribValue( "basis3" )) ).equalWithAbsError( IECore.V3d( bWorld[(2,0)], bWorld[(2,1)], bWorld[(2,2)] ), 1e-6 ) ) self.assertTrue( IECore.V3d( list(cPoint.attribValue( "basis1" )) ).equalWithAbsError( IECore.V3d( cWorld[(0,0)], cWorld[(0,1)], cWorld[(0,2)] ), 1e-6 ) ) self.assertTrue( IECore.V3d( list(cPoint.attribValue( "basis2" )) ).equalWithAbsError( IECore.V3d( cWorld[(1,0)], cWorld[(1,1)], cWorld[(1,2)] ), 1e-6 ) ) self.assertTrue( IECore.V3d( list(cPoint.attribValue( "basis3" )) ).equalWithAbsError( IECore.V3d( cWorld[(2,0)], cWorld[(2,1)], cWorld[(2,2)] ), 1e-6 ) ) def testNonExistantAttributes( self ) : self.writeSCC() node = self.xform() node.parm( "expand" ).pressButton() scene = IECoreHoudini.LiveScene( node.path(), rootPath = [ node.name() ] ) self.assertEqual( scene.attributeNames(), [] ) self.assertFalse( scene.hasAttribute( "test" ) ) self.assertEqual( scene.readAttribute( "test", 0 ), None ) def tearDown( self ) : for f in [ TestSceneCache.__testFile, TestSceneCache.__testOutFile, TestSceneCache.__testLinkedOutFile, TestSceneCache.__testHip, TestSceneCache.__testBgeo, TestSceneCache.__testBgeoGz, TestSceneCache.__testGeo ] : if os.path.exists( f ) : os.remove( f ) if __name__ == "__main__": unittest.main()
51.815351
217
0.661465
21,181
168,089
5.238705
0.037675
0.121124
0.034715
0.027685
0.875172
0.854643
0.831319
0.807266
0.788583
0.770892
0
0.032071
0.153562
168,089
3,243
218
51.831329
0.747823
0.029098
0
0.751924
0
0.000366
0.056477
0.005696
0
0
0
0
0.406742
1
0.028215
false
0
0.001832
0
0.036277
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
8
22c55f667de0fc14bef7956bdd168df035a20ead
117
py
Python
src/utils/pause.py
Kamuish/serval
37807c4dc9d16bd91daa3931a89f128404c83dd6
[ "MIT" ]
null
null
null
src/utils/pause.py
Kamuish/serval
37807c4dc9d16bd91daa3931a89f128404c83dd6
[ "MIT" ]
20
2020-01-30T22:08:59.000Z
2020-02-17T23:24:11.000Z
src/utils/pause.py
Kamuish/serval
37807c4dc9d16bd91daa3931a89f128404c83dd6
[ "MIT" ]
null
null
null
""" TEMPORARY FIX """ def pause(*args): print("TRYING TO PAUSE") def stop(*args): print("TRYING TO STOP")
14.625
28
0.598291
16
117
4.375
0.5625
0.257143
0.428571
0.485714
0
0
0
0
0
0
0
0
0.213675
117
8
29
14.625
0.76087
0.111111
0
0
0
0
0.298969
0
0
0
0
0
0
1
0.5
true
0
0
0
0.5
0.5
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
1
0
8
22d27ee665e3d4185325e8a0ae49d628517eabd0
225
py
Python
pycaprio/core/objects/__init__.py
reckart/pycaprio
1d030ecd97cb324e404c16520fe6250c49c3bb06
[ "MIT" ]
9
2019-08-27T11:21:07.000Z
2021-03-11T15:41:44.000Z
pycaprio/core/objects/__init__.py
reckart/pycaprio
1d030ecd97cb324e404c16520fe6250c49c3bb06
[ "MIT" ]
25
2019-09-03T11:05:18.000Z
2021-04-18T15:57:33.000Z
pycaprio/core/objects/__init__.py
reckart/pycaprio
1d030ecd97cb324e404c16520fe6250c49c3bb06
[ "MIT" ]
6
2019-10-02T16:51:10.000Z
2021-03-11T15:41:52.000Z
# flake8: noqa from pycaprio.core.objects.annotation import Annotation from pycaprio.core.objects.document import Document from pycaprio.core.objects.project import Project from pycaprio.core.objects.curation import Curation
37.5
55
0.853333
30
225
6.4
0.366667
0.25
0.333333
0.479167
0
0
0
0
0
0
0
0.004854
0.084444
225
5
56
45
0.927184
0.053333
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
1
0
0
7
22ed871a0065b44d748a83c43965b08f77dba746
12,318
py
Python
src/abaqus/BoundaryCondition/SubmodelBC.py
Haiiliin/PyAbaqus
f20db6ebea19b73059fe875a53be370253381078
[ "MIT" ]
7
2022-01-21T09:15:45.000Z
2022-02-15T09:31:58.000Z
src/abaqus/BoundaryCondition/SubmodelBC.py
Haiiliin/PyAbaqus
f20db6ebea19b73059fe875a53be370253381078
[ "MIT" ]
null
null
null
src/abaqus/BoundaryCondition/SubmodelBC.py
Haiiliin/PyAbaqus
f20db6ebea19b73059fe875a53be370253381078
[ "MIT" ]
null
null
null
from abaqusConstants import * from .BoundaryCondition import BoundaryCondition from ..Region.Region import Region class SubmodelBC(BoundaryCondition): """The SubmodelBC object stores the data for a submodel boundary condition. The SubmodelBC object is derived from the BoundaryCondition object. Attributes ---------- name: str A String specifying the boundary condition repository key. shellThickness: float A Float specifying the thickness of the shell in the global model. This argument is required for shell-to-solid submodeling and is not applicable to other submodels. The default value is 0.0. absoluteExteriorTolerance: float None or a Float specifying the absolute value by which a driven node of the submodel can lie outside the region of the elements of the global model. The default value is None. exteriorTolerance: float None or a Float specifying the fraction of the average element size in the global model by which a driven node of the submodel can lie outside the region of the elements of the global model. The default value is 0.05. globalDrivingRegion: str A String specifying the element set in the global model that will be searched for elements whose responses will be used to drive the submodel. An empty string indicates that the entire global model will be searched. The default value is an empty string. category: SymbolicConstant A SymbolicConstant specifying the category of the boundary condition. Possible values are MECHANICAL and THERMAL. region: Region A :py:class:`~abaqus.Region.Region.Region` object specifying the region to which the boundary condition is applied. localCsys: str None or a :py:class:`~abaqus.Datum.DatumCsys.DatumCsys` object specifying the local coordinate system of the boundary condition's degrees of freedom. If **localCsys=None**, the degrees of freedom are defined in the global coordinate system. The default value is None. Notes ----- This object can be accessed by: .. code-block:: python import load mdb.models[name].boundaryConditions[name] """ # A String specifying the boundary condition repository key. name: str = '' # A Float specifying the thickness of the shell in the global model. This argument is # required for shell-to-solid submodeling and is not applicable to other submodels. The # default value is 0.0. shellThickness: float = 0 # None or a Float specifying the absolute value by which a driven node of the submodel can # lie outside the region of the elements of the global model. The default value is None. absoluteExteriorTolerance: float = None # None or a Float specifying the fraction of the average element size in the global model # by which a driven node of the submodel can lie outside the region of the elements of the # global model. The default value is 0.05. exteriorTolerance: float = 0 # A String specifying the element set in the global model that will be searched for # elements whose responses will be used to drive the submodel. An empty string indicates # that the entire global model will be searched. The default value is an empty string. globalDrivingRegion: str = '' # A SymbolicConstant specifying the category of the boundary condition. Possible values # are MECHANICAL and THERMAL. category: SymbolicConstant = None # A Region object specifying the region to which the boundary condition is applied. region: Region = Region() # None or a DatumCsys object specifying the local coordinate system of the boundary # condition's degrees of freedom. If *localCsys*=None, the degrees of freedom are defined # in the global coordinate system. The default value is None. localCsys: str = None def __init__(self, name: str, createStepName: str, region: Region, dof: tuple, globalStep: str, timeScale: Boolean, shellThickness: float, globalDrivingRegion: str = '', absoluteExteriorTolerance: float = None, exteriorTolerance: float = 0, localCsys: str = None, globalIncrement: int = 0, centerZoneSize: float = None, intersectionOnly: Boolean = OFF): """This method creates a SubmodelBC object. Notes ----- This function can be accessed by: .. code-block:: python mdb.models[name].SubmodelBC Parameters ---------- name A String specifying the boundary condition repository key. createStepName A String specifying the name of the step in which the boundary condition is created. region A Region object specifying the region to which the boundary condition is applied. dof A sequence of Ints specifying the degrees of freedom to which the boundary condition is applied. globalStep A String specifying the step in the global model from which Abaqus reads the values of the variables that will drive the submodel analysis. The String indicates the position of the step in the sequence of analysis steps. For example, *globalStep*='1' indicates the first step. timeScale A Boolean specifying whether to scale the time variable for the driven nodes' amplitude functions to match the submodel analysis step time. The default value is OFF. shellThickness A Float specifying the thickness of the shell in the global model. This argument is required for shell-to-solid submodeling and is not applicable to other submodels. The default value is 0.0. globalDrivingRegion A String specifying the element set in the global model that will be searched for elements whose responses will be used to drive the submodel. An empty string indicates that the entire global model will be searched. The default value is an empty string. absoluteExteriorTolerance None or a Float specifying the absolute value by which a driven node of the submodel can lie outside the region of the elements of the global model. The default value is None. exteriorTolerance None or a Float specifying the fraction of the average element size in the global model by which a driven node of the submodel can lie outside the region of the elements of the global model. The default value is 0.05. localCsys None or a DatumCsys object specifying the local coordinate system of the boundary condition's degrees of freedom. If *localCsys*=None, the degrees of freedom are defined in the global coordinate system. The default value is None. globalIncrement An Int specifying the increment number in the global model step from which the solution will be used to specify the values of the driven variables. If *globalIncrement*=0, the solution from the last increment will be used. The *globalIncrement* argument is applicable only for linear perturbation steps. The default value is 0. centerZoneSize A Float specifying the thickness of the center zone size around the shell midsurface. The default value is None. intersectionOnly A Boolean specifying whether to ignore driven nodes that lie outside the region of elements of the global model after accounting for the exterior search tolerance. The default value is OFF. Returns ------- A SubmodelBC object. """ super().__init__() pass def setValues(self, globalDrivingRegion: str = '', absoluteExteriorTolerance: float = None, exteriorTolerance: float = 0, localCsys: str = None, globalIncrement: int = 0, centerZoneSize: float = None, intersectionOnly: Boolean = OFF): """This method modifies the data for an existing SubmodelBC object in the step where it is created. Parameters ---------- globalDrivingRegion A String specifying the element set in the global model that will be searched for elements whose responses will be used to drive the submodel. An empty string indicates that the entire global model will be searched. The default value is an empty string. absoluteExteriorTolerance None or a Float specifying the absolute value by which a driven node of the submodel can lie outside the region of the elements of the global model. The default value is None. exteriorTolerance None or a Float specifying the fraction of the average element size in the global model by which a driven node of the submodel can lie outside the region of the elements of the global model. The default value is 0.05. localCsys None or a DatumCsys object specifying the local coordinate system of the boundary condition's degrees of freedom. If *localCsys*=None, the degrees of freedom are defined in the global coordinate system. The default value is None. globalIncrement An Int specifying the increment number in the global model step from which the solution will be used to specify the values of the driven variables. If *globalIncrement*=0, the solution from the last increment will be used. The *globalIncrement* argument is applicable only for linear perturbation steps. The default value is 0. centerZoneSize A Float specifying the thickness of the center zone size around the shell midsurface. The default value is None. intersectionOnly A Boolean specifying whether to ignore driven nodes that lie outside the region of elements of the global model after accounting for the exterior search tolerance. The default value is OFF. """ pass def setValuesInStep(self, stepName: str, fixed: Boolean = ON, dof: tuple = (), globalStep: str = '', globalIncrement: int = 0, centerZoneSize: float = None): """This method modifies the propagating data for an existing SubmodelBC object in the specified step. Parameters ---------- stepName A String specifying the name of the step in which the boundary condition is modified. fixed A Boolean specifying whether the boundary condition should remain fixed at the current values at the start of the step. The default value is ON. dof A sequence of Ints specifying the degrees of freedom to which the boundary condition is applied. The *dof* argument is applicable only if *fixed*=OFF. globalStep A String specifying the step in the global model from which Abaqus reads the values of the variables that will drive the submodel analysis. The String indicates the position of the step in the sequence of analysis steps. For example, *globalStep*='1' indicates the first step. The *globalStep* argument is applicable only if *fixed*=OFF. globalIncrement An Int specifying the increment number in the global model step at which the solution will be used to specify the values of the driven variables. If *globalIncrement*=0, the solution from the last increment will be used. The *globalIncrement* argument is applicable only for linear perturbation steps and if *fixed*=OFF. The default value is 0. centerZoneSize A Float specifying the thickness of the center zone size around the shell midsurface. The default value is None.The *centerZoneSize* argument is applicable only if *fixed*=OFF. """ pass
54.264317
125
0.67787
1,604
12,318
5.200748
0.115337
0.031168
0.052146
0.059099
0.833613
0.82726
0.822225
0.801606
0.786502
0.773556
0
0.003746
0.284786
12,318
226
126
54.504425
0.943133
0.785598
0
0.115385
0
0
0
0
0
0
0
0
0
1
0.115385
false
0.115385
0.115385
0
0.576923
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
1
0
0
1
0
0
8
a3b9ea1610a20059786b5c26c1c0b33d5b50f05f
185
py
Python
streamer_pytorch/__init__.py
liruilong940607/streamer_pytorch
83a7962d8a9f064d9b78e093cbf3223ec1dd24cd
[ "MIT" ]
2
2020-12-22T17:20:25.000Z
2021-09-14T03:15:27.000Z
streamer_pytorch/__init__.py
liruilong940607/streamer_pytorch
83a7962d8a9f064d9b78e093cbf3223ec1dd24cd
[ "MIT" ]
null
null
null
streamer_pytorch/__init__.py
liruilong940607/streamer_pytorch
83a7962d8a9f064d9b78e093cbf3223ec1dd24cd
[ "MIT" ]
1
2021-09-19T09:37:59.000Z
2021-09-19T09:37:59.000Z
from .streamer import BaseStreamer from .streamer import CaptureStreamer from .streamer import VideoListStreamer from .streamer import ImageListStreamer from .streamer import aug_matrix
37
39
0.87027
21
185
7.619048
0.428571
0.375
0.5625
0
0
0
0
0
0
0
0
0
0.102703
185
5
40
37
0.963855
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
a3e400ab7bd7a1c612da672f2be4f9a3db674ba3
170
py
Python
polls/admin.py
arunko350/deblog
3dc7c8b4a50ecaef252483053a205781333b60fd
[ "MIT" ]
null
null
null
polls/admin.py
arunko350/deblog
3dc7c8b4a50ecaef252483053a205781333b60fd
[ "MIT" ]
null
null
null
polls/admin.py
arunko350/deblog
3dc7c8b4a50ecaef252483053a205781333b60fd
[ "MIT" ]
null
null
null
from django.contrib import admin from polls.models import Choice # Register your models here. from polls.models import Question admin.site.register([Question, Choice])
21.25
39
0.805882
24
170
5.708333
0.541667
0.131387
0.218978
0.306569
0
0
0
0
0
0
0
0
0.123529
170
7
40
24.285714
0.919463
0.152941
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.75
0
0.75
0
1
0
0
null
0
1
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
7
4308ec7488dc78ab8943889dd1964fdd1f1397c9
2,546
py
Python
umbra/common/protobuf/umbra_pb2_grpc.py
banoris/umbra
3c141d8f54398dfa2b0e991db25e74533f49fe8b
[ "Apache-2.0" ]
null
null
null
umbra/common/protobuf/umbra_pb2_grpc.py
banoris/umbra
3c141d8f54398dfa2b0e991db25e74533f49fe8b
[ "Apache-2.0" ]
9
2020-06-19T11:09:26.000Z
2020-08-19T14:46:34.000Z
umbra/common/protobuf/umbra_pb2_grpc.py
banoris/umbra
3c141d8f54398dfa2b0e991db25e74533f49fe8b
[ "Apache-2.0" ]
null
null
null
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import umbra_pb2 as umbra__pb2 class BrokerStub(object): # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.Run = channel.unary_unary( '/umbra.Broker/Run', request_serializer=umbra__pb2.Config.SerializeToString, response_deserializer=umbra__pb2.Report.FromString, ) class BrokerServicer(object): # missing associated documentation comment in .proto file pass def Run(self, request, context): # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_BrokerServicer_to_server(servicer, server): rpc_method_handlers = { 'Run': grpc.unary_unary_rpc_method_handler( servicer.Run, request_deserializer=umbra__pb2.Config.FromString, response_serializer=umbra__pb2.Report.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'umbra.Broker', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) class ScenarioStub(object): # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.Run = channel.unary_unary( '/umbra.Scenario/Run', request_serializer=umbra__pb2.Deploy.SerializeToString, response_deserializer=umbra__pb2.Built.FromString, ) class ScenarioServicer(object): # missing associated documentation comment in .proto file pass def Run(self, request, context): # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_ScenarioServicer_to_server(servicer, server): rpc_method_handlers = { 'Run': grpc.unary_unary_rpc_method_handler( servicer.Run, request_deserializer=umbra__pb2.Deploy.FromString, response_serializer=umbra__pb2.Built.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'umbra.Scenario', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
28.606742
69
0.728987
283
2,546
6.279152
0.240283
0.04502
0.101294
0.12493
0.839617
0.716939
0.716939
0.716939
0.716939
0.640405
0
0.004833
0.187353
2,546
88
70
28.931818
0.854036
0.195601
0
0.555556
1
0
0.079801
0
0
0
0
0
0
1
0.111111
false
0.111111
0.037037
0
0.222222
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
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
8
4335cbb133cded5a126d4a1039ab72dba04cb065
160
py
Python
networkx/algorithms/community/__init__.py
kakila/networkx
a7c7e0bd2057acf8066d796e53f6ea1a77be803e
[ "BSD-3-Clause" ]
1
2020-11-10T08:15:23.000Z
2020-11-10T08:15:23.000Z
networkx/algorithms/community/__init__.py
kakila/networkx
a7c7e0bd2057acf8066d796e53f6ea1a77be803e
[ "BSD-3-Clause" ]
null
null
null
networkx/algorithms/community/__init__.py
kakila/networkx
a7c7e0bd2057acf8066d796e53f6ea1a77be803e
[ "BSD-3-Clause" ]
null
null
null
from networkx.algorithms.community.asyn_lpa import * from networkx.algorithms.community.centrality import * from networkx.algorithms.community.kclique import *
40
54
0.85
19
160
7.105263
0.473684
0.266667
0.488889
0.688889
0.548148
0
0
0
0
0
0
0
0.075
160
3
55
53.333333
0.912162
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
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
8
4a5c0e2c07a4d6ee0b1da80f434de76e68fe7d3a
464,066
py
Python
applications/z3pyir/opt/check-healthplus.py
wangjwchn/autogr
c6b5404f6165ea6374f628dbd433ef25253ab5f8
[ "MIT" ]
null
null
null
applications/z3pyir/opt/check-healthplus.py
wangjwchn/autogr
c6b5404f6165ea6374f628dbd433ef25253ab5f8
[ "MIT" ]
null
null
null
applications/z3pyir/opt/check-healthplus.py
wangjwchn/autogr
c6b5404f6165ea6374f628dbd433ef25253ab5f8
[ "MIT" ]
null
null
null
import sys sys.path.append("../../") from z3 import * from Rigi.axioms import * from Rigi.checker import * from Rigi.table import * from Rigi.tableIns import * from Rigi.argvbuilder import * ############################################################################################## BloodGroupingRh = Table('BloodGroupingRh') BloodGroupingRh.addAttr('tst_bloodG_id', Table.Type.STRING) BloodGroupingRh.addAttr('prescription_id', Table.Type.STRING) BloodGroupingRh.addAttr('bloodGroup', Table.Type.STRING) BloodGroupingRh.addAttr('rhesusD', Table.Type.STRING) BloodGroupingRh.addAttr('appointment_id', Table.Type.STRING) BloodGroupingRh.addAttr('date', Table.Type.INT) BloodGroupingRh.addAttr('__ts', Table.Type.INT) BloodGroupingRh.setPKey('tst_bloodG_id') BloodGroupingRh.build() LipidTest = Table('LipidTest') LipidTest.addAttr('tst_li_id', Table.Type.STRING) LipidTest.addAttr('prescription_id', Table.Type.STRING) LipidTest.addAttr('cholestrolHDL', Table.Type.STRING) LipidTest.addAttr('cholestrolLDL', Table.Type.STRING) LipidTest.addAttr('triglycerides', Table.Type.STRING) LipidTest.addAttr('totalCholestrolLDLHDLratio', Table.Type.STRING) LipidTest.addAttr('appointment_id', Table.Type.STRING) LipidTest.addAttr('date', Table.Type.INT) LipidTest.addAttr('__ts', Table.Type.INT) LipidTest.setPKey('tst_li_id') LipidTest.build() LiverFunctionTest = Table('LiverFunctionTest') LiverFunctionTest.addAttr('tst_liver_id', Table.Type.STRING) LiverFunctionTest.addAttr('prescription_id', Table.Type.STRING) LiverFunctionTest.addAttr('totalProtein', Table.Type.REAL) LiverFunctionTest.addAttr('albumin', Table.Type.REAL) LiverFunctionTest.addAttr('globulin', Table.Type.REAL) LiverFunctionTest.addAttr('totalBilirubin', Table.Type.REAL) LiverFunctionTest.addAttr('directBilirubin', Table.Type.REAL) LiverFunctionTest.addAttr('sgotast', Table.Type.REAL) LiverFunctionTest.addAttr('sgptalt', Table.Type.REAL) LiverFunctionTest.addAttr('alkalinePhospates', Table.Type.REAL) LiverFunctionTest.addAttr('appointment_id', Table.Type.STRING) LiverFunctionTest.addAttr('date', Table.Type.INT) LiverFunctionTest.addAttr('__ts', Table.Type.INT) LiverFunctionTest.setPKey('tst_liver_id') LiverFunctionTest.build() RenalFunctionTest = Table('RenalFunctionTest') RenalFunctionTest.addAttr('tst_renal_id', Table.Type.STRING) RenalFunctionTest.addAttr('prescription_id', Table.Type.STRING) RenalFunctionTest.addAttr('creatinine', Table.Type.REAL) RenalFunctionTest.addAttr('urea', Table.Type.REAL) RenalFunctionTest.addAttr('totalBilirubin', Table.Type.REAL) RenalFunctionTest.addAttr('directBilirubin', Table.Type.REAL) RenalFunctionTest.addAttr('sgotast', Table.Type.REAL) RenalFunctionTest.addAttr('sgptalt', Table.Type.REAL) RenalFunctionTest.addAttr('alkalinePhospates', Table.Type.REAL) RenalFunctionTest.addAttr('appointment_id', Table.Type.STRING) RenalFunctionTest.addAttr('date', Table.Type.INT) RenalFunctionTest.addAttr('__ts', Table.Type.INT) RenalFunctionTest.setPKey('tst_renal_id') RenalFunctionTest.build() SeriumCreatinePhosphokinase = Table('SeriumCreatinePhosphokinase') SeriumCreatinePhosphokinase.addAttr('tst_SCP_id', Table.Type.STRING) SeriumCreatinePhosphokinase.addAttr('prescription_id', Table.Type.STRING) SeriumCreatinePhosphokinase.addAttr('hiv12ELISA', Table.Type.STRING) SeriumCreatinePhosphokinase.addAttr('appointment_id', Table.Type.STRING) SeriumCreatinePhosphokinase.addAttr('date', Table.Type.INT) SeriumCreatinePhosphokinase.addAttr('__ts', Table.Type.INT) SeriumCreatinePhosphokinase.setPKey('tst_SCP_id') SeriumCreatinePhosphokinase.build() SeriumCreatinePhosphokinaseTotal = Table('SeriumCreatinePhosphokinaseTotal') SeriumCreatinePhosphokinaseTotal.addAttr('tst_SCPT_id', Table.Type.STRING) SeriumCreatinePhosphokinaseTotal.addAttr('test_id', Table.Type.STRING) SeriumCreatinePhosphokinaseTotal.addAttr('prescription_id', Table.Type.STRING) SeriumCreatinePhosphokinaseTotal.addAttr('cpkTotal', Table.Type.INT) SeriumCreatinePhosphokinaseTotal.addAttr('appointment_id', Table.Type.STRING) SeriumCreatinePhosphokinaseTotal.addAttr('date', Table.Type.INT) SeriumCreatinePhosphokinaseTotal.addAttr('__ts', Table.Type.INT) SeriumCreatinePhosphokinaseTotal.setPKey('tst_SCPT_id') SeriumCreatinePhosphokinaseTotal.build() UrineFullReport = Table('UrineFullReport') UrineFullReport.addAttr('tst_ur_id', Table.Type.STRING) UrineFullReport.addAttr('prescription_id', Table.Type.STRING) UrineFullReport.addAttr('appearance', Table.Type.STRING) UrineFullReport.addAttr('sgRefractometer', Table.Type.STRING) UrineFullReport.addAttr('ph', Table.Type.REAL) UrineFullReport.addAttr('protein', Table.Type.STRING) UrineFullReport.addAttr('glucose', Table.Type.STRING) UrineFullReport.addAttr('ketoneBodies', Table.Type.STRING) UrineFullReport.addAttr('bilirubin', Table.Type.STRING) UrineFullReport.addAttr('urobilirubin', Table.Type.STRING) UrineFullReport.addAttr('contrifugedDepositsphaseContrastMicroscopy', Table.Type.STRING) UrineFullReport.addAttr('pusCells', Table.Type.STRING) UrineFullReport.addAttr('redCells', Table.Type.STRING) UrineFullReport.addAttr('epithelialCells', Table.Type.STRING) UrineFullReport.addAttr('casts', Table.Type.STRING) UrineFullReport.addAttr('cristals', Table.Type.STRING) UrineFullReport.addAttr('appointment_id', Table.Type.STRING) UrineFullReport.addAttr('date', Table.Type.INT) UrineFullReport.addAttr('__ts', Table.Type.INT) UrineFullReport.setPKey('tst_ur_id') UrineFullReport.build() appointment = Table('appointment') appointment.addAttr('appointment_id', Table.Type.STRING) appointment.addAttr('date', Table.Type.INT) appointment.addAttr('info', Table.Type.STRING) appointment.addAttr('patient_id', Table.Type.STRING) appointment.addAttr('bill_id', Table.Type.STRING) appointment.addAttr('slmc_reg_no', Table.Type.STRING) appointment.addAttr('cancelled', Table.Type.INT) appointment.addAttr('__ts', Table.Type.INT) appointment.setPKey('appointment_id') appointment.build() bill = Table('bill') bill.addAttr('bill_id', Table.Type.STRING) bill.addAttr('bill_date', Table.Type.INT) bill.addAttr('doctor_fee', Table.Type.INT) bill.addAttr('hospital_fee', Table.Type.INT) bill.addAttr('pharmacy_fee', Table.Type.INT) bill.addAttr('laboratory_fee', Table.Type.INT) bill.addAttr('appointment_fee', Table.Type.INT) bill.addAttr('vat', Table.Type.INT) bill.addAttr('discount', Table.Type.INT) bill.addAttr('total', Table.Type.INT) bill.addAttr('payment_method', Table.Type.STRING) bill.addAttr('consultant_id', Table.Type.STRING) bill.addAttr('patient_id', Table.Type.STRING) bill.addAttr('refund', Table.Type.INT) bill.addAttr('__ts', Table.Type.INT) bill.setPKey('bill_id') bill.build() completeBloodCount = Table('completeBloodCount') completeBloodCount.addAttr('tst_CBC_id', Table.Type.STRING) completeBloodCount.addAttr('prescription_id', Table.Type.STRING) completeBloodCount.addAttr('totalWhiteCellCount', Table.Type.INT) completeBloodCount.addAttr('differentialCount', Table.Type.INT) completeBloodCount.addAttr('neutrophils', Table.Type.INT) completeBloodCount.addAttr('lymphocytes', Table.Type.INT) completeBloodCount.addAttr('monocytes', Table.Type.INT) completeBloodCount.addAttr('eosonophils', Table.Type.INT) completeBloodCount.addAttr('basophils', Table.Type.INT) completeBloodCount.addAttr('haemoglobin', Table.Type.REAL) completeBloodCount.addAttr('redBloodCells', Table.Type.REAL) completeBloodCount.addAttr('meanCellVolume', Table.Type.REAL) completeBloodCount.addAttr('haematocrit', Table.Type.REAL) completeBloodCount.addAttr('meanCellHaemoglobin', Table.Type.REAL) completeBloodCount.addAttr('mchConcentration', Table.Type.REAL) completeBloodCount.addAttr('redCellsDistributionWidth', Table.Type.REAL) completeBloodCount.addAttr('plateletCount', Table.Type.INT) completeBloodCount.addAttr('appointment_id', Table.Type.STRING) completeBloodCount.addAttr('date', Table.Type.INT) completeBloodCount.addAttr('__ts', Table.Type.INT) completeBloodCount.setPKey('tst_CBC_id') completeBloodCount.build() diagnose_history = Table('diagnose_history') diagnose_history.addAttr('diagnostic_id', Table.Type.STRING) diagnose_history.addAttr('patient_id', Table.Type.STRING) diagnose_history.addAttr('diagnose', Table.Type.STRING) diagnose_history.addAttr('date', Table.Type.INT) diagnose_history.addAttr('consultant_id', Table.Type.STRING) diagnose_history.addAttr('prescription_id', Table.Type.STRING) diagnose_history.addAttr('__ts', Table.Type.INT) diagnose_history.setPKey('diagnostic_id') diagnose_history.build() doctor = Table('doctor') doctor.addAttr('slmc_reg_no', Table.Type.STRING) doctor.addAttr('user_id', Table.Type.STRING) doctor.addAttr('education', Table.Type.STRING) doctor.addAttr('training', Table.Type.STRING) doctor.addAttr('experienced_areas', Table.Type.STRING) doctor.addAttr('experience', Table.Type.STRING) doctor.addAttr('achievements', Table.Type.STRING) doctor.addAttr('channelling_fee', Table.Type.INT) doctor.addAttr('__ts', Table.Type.INT) doctor.setPKey('slmc_reg_no') doctor.build() doctor_availability = Table('doctor_availability') doctor_availability.addAttr('time_slot_id', Table.Type.STRING) doctor_availability.addAttr('slmc_reg_no', Table.Type.STRING) doctor_availability.addAttr('day', Table.Type.INT) doctor_availability.addAttr('time_slot', Table.Type.STRING) doctor_availability.addAttr('current_week_appointments', Table.Type.INT) doctor_availability.addAttr('next_week_appointments', Table.Type.INT) doctor_availability.addAttr('__ts', Table.Type.INT) doctor_availability.setPKey('time_slot_id') doctor_availability.setPKey('time_slot','slmc_reg_no','day') doctor_availability.build() drug = Table('drug') drug.addAttr('drug_id', Table.Type.STRING) drug.addAttr('drug_name', Table.Type.STRING) drug.addAttr('dangerous_drug', Table.Type.INT) drug.addAttr('__ts', Table.Type.INT) drug.setPKey('drug_id') drug.build() drug_brand_names = Table('drug_brand_names') drug_brand_names.addAttr('brand_id', Table.Type.STRING) drug_brand_names.addAttr('brand_name', Table.Type.STRING) drug_brand_names.addAttr('generic_name', Table.Type.STRING) drug_brand_names.addAttr('drug_type', Table.Type.STRING) drug_brand_names.addAttr('drug_unit', Table.Type.STRING) drug_brand_names.addAttr('unit_price', Table.Type.INT) drug_brand_names.addAttr('__ts', Table.Type.INT) drug_brand_names.setPKey('brand_id') drug_brand_names.build() lab_appointment = Table('lab_appointment') lab_appointment.addAttr('lab_appointment_id', Table.Type.STRING) lab_appointment.addAttr('test_id', Table.Type.STRING) lab_appointment.addAttr('date', Table.Type.INT) lab_appointment.addAttr('info', Table.Type.STRING) lab_appointment.addAttr('patient_id', Table.Type.STRING) lab_appointment.addAttr('bill_id', Table.Type.STRING) lab_appointment.addAttr('lab_assistant_id', Table.Type.STRING) lab_appointment.addAttr('cancelled', Table.Type.INT) lab_appointment.addAttr('doctor_id', Table.Type.STRING) lab_appointment.addAttr('__ts', Table.Type.INT) lab_appointment.setPKey('lab_appointment_id') lab_appointment.build() lab_appointment_timetable = Table('lab_appointment_timetable') lab_appointment_timetable.addAttr('app_id', Table.Type.STRING) lab_appointment_timetable.addAttr('app_test_id', Table.Type.STRING) lab_appointment_timetable.addAttr('app_day', Table.Type.INT) lab_appointment_timetable.addAttr('time_slot', Table.Type.STRING) lab_appointment_timetable.addAttr('current_week_appointments', Table.Type.INT) lab_appointment_timetable.addAttr('next_week_appointments', Table.Type.INT) lab_appointment_timetable.addAttr('__ts', Table.Type.INT) lab_appointment_timetable.setPKey('app_id') lab_appointment_timetable.build() lab_assistant = Table('lab_assistant') lab_assistant.addAttr('lab_assistant_id', Table.Type.STRING) lab_assistant.addAttr('user_id', Table.Type.STRING) lab_assistant.addAttr('education', Table.Type.STRING) lab_assistant.addAttr('training', Table.Type.STRING) lab_assistant.addAttr('experience', Table.Type.STRING) lab_assistant.addAttr('achievements', Table.Type.STRING) lab_assistant.addAttr('__ts', Table.Type.INT) lab_assistant.setPKey('lab_assistant_id') lab_assistant.build() lab_test = Table('lab_test') lab_test.addAttr('test_id', Table.Type.STRING) lab_test.addAttr('test_name', Table.Type.STRING) lab_test.addAttr('test_description', Table.Type.STRING) lab_test.addAttr('test_fee', Table.Type.INT) lab_test.addAttr('__ts', Table.Type.INT) lab_test.setPKey('test_id') lab_test.build() medical_history = Table('medical_history') medical_history.addAttr('history_id', Table.Type.STRING) medical_history.addAttr('patient_id', Table.Type.STRING) medical_history.addAttr('doctor_id', Table.Type.STRING) medical_history.addAttr('date', Table.Type.INT) medical_history.addAttr('history', Table.Type.STRING) medical_history.addAttr('__ts', Table.Type.INT) medical_history.setPKey('history_id') medical_history.build() patient = Table('patient') patient.addAttr('patient_id', Table.Type.STRING) patient.addAttr('person_id', Table.Type.STRING) patient.addAttr('drug_allergies_and_reactions', Table.Type.STRING) patient.addAttr('__ts', Table.Type.INT) patient.setPKey('patient_id') patient.build() patient_message_receive = Table('patient_message_receive') patient_message_receive.addAttr('message_id', Table.Type.STRING) patient_message_receive.addAttr('receiver', Table.Type.STRING) patient_message_receive.addAttr('sender', Table.Type.STRING) patient_message_receive.addAttr('subject', Table.Type.STRING) patient_message_receive.addAttr('message', Table.Type.STRING) patient_message_receive.addAttr('date', Table.Type.INT) patient_message_receive.addAttr('__ts', Table.Type.INT) patient_message_receive.setPKey('message_id') patient_message_receive.build() patient_message_send = Table('patient_message_send') patient_message_send.addAttr('message_id', Table.Type.STRING) patient_message_send.addAttr('receiver', Table.Type.STRING) patient_message_send.addAttr('sender', Table.Type.STRING) patient_message_send.addAttr('email', Table.Type.STRING) patient_message_send.addAttr('message', Table.Type.STRING) patient_message_send.addAttr('date', Table.Type.INT) patient_message_send.addAttr('__ts', Table.Type.INT) patient_message_send.setPKey('message_id') patient_message_send.build() patient_useraccount = Table('patient_useraccount') patient_useraccount.addAttr('patient_id', Table.Type.STRING) patient_useraccount.addAttr('person_id', Table.Type.STRING) patient_useraccount.addAttr('username', Table.Type.STRING) patient_useraccount.addAttr('password', Table.Type.STRING) patient_useraccount.addAttr('__ts', Table.Type.INT) patient_useraccount.setPKey('patient_id') patient_useraccount.build() person = Table('person') person.addAttr('person_id', Table.Type.STRING) person.addAttr('user_id', Table.Type.STRING) person.addAttr('nic', Table.Type.STRING) person.addAttr('gender', Table.Type.STRING) person.addAttr('date_of_birth', Table.Type.INT) person.addAttr('address', Table.Type.STRING) person.addAttr('mobile', Table.Type.STRING) person.addAttr('first_name', Table.Type.STRING) person.addAttr('last_name', Table.Type.STRING) person.addAttr('email', Table.Type.STRING) person.addAttr('nationality', Table.Type.STRING) person.addAttr('religion', Table.Type.STRING) person.addAttr('__ts', Table.Type.INT) person.setPKey('person_id') person.build() pharmacist = Table('pharmacist') pharmacist.addAttr('pharmacist_id', Table.Type.STRING) pharmacist.addAttr('user_id', Table.Type.STRING) pharmacist.addAttr('education', Table.Type.STRING) pharmacist.addAttr('training', Table.Type.STRING) pharmacist.addAttr('experience', Table.Type.STRING) pharmacist.addAttr('achievements', Table.Type.STRING) pharmacist.addAttr('__ts', Table.Type.INT) pharmacist.setPKey('pharmacist_id') pharmacist.build() pharmacy_history = Table('pharmacy_history') pharmacy_history.addAttr('history_id', Table.Type.STRING) pharmacy_history.addAttr('prescription_id', Table.Type.STRING) pharmacy_history.addAttr('bill_id', Table.Type.STRING) pharmacy_history.addAttr('date', Table.Type.INT) pharmacy_history.addAttr('no_of_drugs', Table.Type.INT) pharmacy_history.addAttr('excluded', Table.Type.STRING) pharmacy_history.addAttr('__ts', Table.Type.INT) pharmacy_history.setPKey('history_id') pharmacy_history.build() pharmacy_stock = Table('pharmacy_stock') pharmacy_stock.addAttr('stock_id', Table.Type.STRING) pharmacy_stock.addAttr('drug_id', Table.Type.STRING) pharmacy_stock.addAttr('brand_id', Table.Type.STRING) pharmacy_stock.addAttr('stock', Table.Type.INT) pharmacy_stock.addAttr('remaining_quantity', Table.Type.INT) pharmacy_stock.addAttr('manufac_date', Table.Type.INT) pharmacy_stock.addAttr('exp_date', Table.Type.INT) pharmacy_stock.addAttr('supplier_id', Table.Type.STRING) pharmacy_stock.addAttr('date', Table.Type.INT) pharmacy_stock.addAttr('__ts', Table.Type.INT) pharmacy_stock.setPKey('stock_id') pharmacy_stock.build() prescription = Table('prescription') prescription.addAttr('prescription_id', Table.Type.STRING) prescription.addAttr('patient_id', Table.Type.STRING) prescription.addAttr('consultant_id', Table.Type.STRING) prescription.addAttr('date', Table.Type.INT) prescription.addAttr('drugs_dose', Table.Type.STRING) prescription.addAttr('tests', Table.Type.STRING) prescription.addAttr('__ts', Table.Type.INT) prescription.setPKey('prescription_id') prescription.build() refund = Table('refund') refund.addAttr('refund_id', Table.Type.STRING) refund.addAttr('bill_id', Table.Type.STRING) refund.addAttr('payment_type', Table.Type.STRING) refund.addAttr('reason', Table.Type.STRING) refund.addAttr('amount', Table.Type.INT) refund.addAttr('date', Table.Type.INT) refund.addAttr('__ts', Table.Type.INT) refund.setPKey('refund_id') refund.build() signup = Table('signup') signup.addAttr('id', Table.Type.INT) signup.addAttr('fname', Table.Type.STRING) signup.addAttr('lname', Table.Type.STRING) signup.addAttr('nic', Table.Type.STRING) signup.addAttr('address', Table.Type.STRING) signup.addAttr('contact', Table.Type.INT) signup.addAttr('email', Table.Type.STRING) signup.addAttr('gender', Table.Type.STRING) signup.addAttr('dob', Table.Type.STRING) signup.addAttr('religion', Table.Type.STRING) signup.addAttr('nationality', Table.Type.STRING) signup.addAttr('maritalstatus', Table.Type.STRING) signup.addAttr('medicalhistory', Table.Type.STRING) signup.addAttr('username', Table.Type.STRING) signup.addAttr('password', Table.Type.STRING) signup.addAttr('__ts', Table.Type.INT) signup.setPKey('id') signup.build() suppliers = Table('suppliers') suppliers.addAttr('supplier_id', Table.Type.STRING) suppliers.addAttr('supplier_name', Table.Type.STRING) suppliers.addAttr('__ts', Table.Type.INT) suppliers.setPKey('supplier_id') suppliers.build() sys_user = Table('sys_user') sys_user.addAttr('person_id', Table.Type.STRING) sys_user.addAttr('user_id', Table.Type.STRING) sys_user.addAttr('user_name', Table.Type.STRING) sys_user.addAttr('user_type', Table.Type.STRING) sys_user.addAttr('other_info', Table.Type.STRING) sys_user.addAttr('password', Table.Type.STRING) sys_user.addAttr('online', Table.Type.INT) sys_user.addAttr('login', Table.Type.INT) sys_user.addAttr('logout', Table.Type.INT) sys_user.addAttr('profile_pic', Table.Type.STRING) sys_user.addAttr('suspend', Table.Type.INT) sys_user.addAttr('__ts', Table.Type.INT) sys_user.setPKey('user_id') sys_user.build() tempappointment = Table('tempappointment') tempappointment.addAttr('id', Table.Type.INT) tempappointment.addAttr('doctor_id', Table.Type.STRING) tempappointment.addAttr('time', Table.Type.INT) tempappointment.addAttr('date', Table.Type.INT) tempappointment.addAttr('patient_id', Table.Type.STRING) tempappointment.addAttr('__ts', Table.Type.INT) tempappointment.setPKey('id') tempappointment.build() tmp_bill = Table('tmp_bill') tmp_bill.addAttr('tmp_bill_id', Table.Type.STRING) tmp_bill.addAttr('doctor_fee', Table.Type.INT) tmp_bill.addAttr('hospital_fee', Table.Type.INT) tmp_bill.addAttr('pharmacy_fee', Table.Type.INT) tmp_bill.addAttr('laboratory_fee', Table.Type.INT) tmp_bill.addAttr('appointment_fee', Table.Type.INT) tmp_bill.addAttr('vat', Table.Type.INT) tmp_bill.addAttr('discount', Table.Type.INT) tmp_bill.addAttr('consultant_id', Table.Type.STRING) tmp_bill.addAttr('patient_id', Table.Type.STRING) tmp_bill.addAttr('__ts', Table.Type.INT) tmp_bill.setPKey('tmp_bill_id') tmp_bill.setPKey('patient_id') tmp_bill.build() user_message = Table('user_message') user_message.addAttr('message_id', Table.Type.STRING) user_message.addAttr('reciver', Table.Type.STRING) user_message.addAttr('sender', Table.Type.STRING) user_message.addAttr('subject', Table.Type.STRING) user_message.addAttr('message', Table.Type.STRING) user_message.addAttr('date', Table.Type.INT) user_message.addAttr('rd', Table.Type.INT) user_message.addAttr('__ts', Table.Type.INT) user_message.setPKey('message_id') user_message.build() website_messages = Table('website_messages') website_messages.addAttr('id', Table.Type.INT) website_messages.addAttr('first_name', Table.Type.STRING) website_messages.addAttr('last_name', Table.Type.STRING) website_messages.addAttr('email', Table.Type.STRING) website_messages.addAttr('message', Table.Type.STRING) website_messages.addAttr('__ts', Table.Type.INT) website_messages.setPKey('id') website_messages.build() def GenState(): TABLE_BloodGroupingRh = TableInstance(BloodGroupingRh) TABLE_LipidTest = TableInstance(LipidTest) TABLE_LiverFunctionTest = TableInstance(LiverFunctionTest) TABLE_RenalFunctionTest = TableInstance(RenalFunctionTest) TABLE_SeriumCreatinePhosphokinase = TableInstance(SeriumCreatinePhosphokinase) TABLE_SeriumCreatinePhosphokinaseTotal = TableInstance(SeriumCreatinePhosphokinaseTotal) TABLE_UrineFullReport = TableInstance(UrineFullReport) TABLE_appointment = TableInstance(appointment) TABLE_bill = TableInstance(bill) TABLE_completeBloodCount = TableInstance(completeBloodCount) TABLE_diagnose_history = TableInstance(diagnose_history) TABLE_doctor = TableInstance(doctor) TABLE_doctor_availability = TableInstance(doctor_availability) TABLE_drug = TableInstance(drug) TABLE_drug_brand_names = TableInstance(drug_brand_names) TABLE_lab_appointment = TableInstance(lab_appointment) TABLE_lab_appointment_timetable = TableInstance(lab_appointment_timetable) TABLE_lab_assistant = TableInstance(lab_assistant) TABLE_lab_test = TableInstance(lab_test) TABLE_medical_history = TableInstance(medical_history) TABLE_patient = TableInstance(patient) TABLE_patient_message_receive = TableInstance(patient_message_receive) TABLE_patient_message_send = TableInstance(patient_message_send) TABLE_patient_useraccount = TableInstance(patient_useraccount) TABLE_person = TableInstance(person) TABLE_pharmacist = TableInstance(pharmacist) TABLE_pharmacy_history = TableInstance(pharmacy_history) TABLE_pharmacy_stock = TableInstance(pharmacy_stock) TABLE_prescription = TableInstance(prescription) TABLE_refund = TableInstance(refund) TABLE_signup = TableInstance(signup) TABLE_suppliers = TableInstance(suppliers) TABLE_sys_user = TableInstance(sys_user) TABLE_tempappointment = TableInstance(tempappointment) TABLE_tmp_bill = TableInstance(tmp_bill) TABLE_user_message = TableInstance(user_message) TABLE_website_messages = TableInstance(website_messages) return {'TABLE_BloodGroupingRh': TABLE_BloodGroupingRh,'TABLE_LipidTest': TABLE_LipidTest,'TABLE_LiverFunctionTest': TABLE_LiverFunctionTest,'TABLE_RenalFunctionTest': TABLE_RenalFunctionTest,'TABLE_SeriumCreatinePhosphokinase': TABLE_SeriumCreatinePhosphokinase,'TABLE_SeriumCreatinePhosphokinaseTotal': TABLE_SeriumCreatinePhosphokinaseTotal,'TABLE_UrineFullReport': TABLE_UrineFullReport,'TABLE_appointment': TABLE_appointment,'TABLE_bill': TABLE_bill,'TABLE_completeBloodCount': TABLE_completeBloodCount,'TABLE_diagnose_history': TABLE_diagnose_history,'TABLE_doctor': TABLE_doctor,'TABLE_doctor_availability': TABLE_doctor_availability,'TABLE_drug': TABLE_drug,'TABLE_drug_brand_names': TABLE_drug_brand_names,'TABLE_lab_appointment': TABLE_lab_appointment,'TABLE_lab_appointment_timetable': TABLE_lab_appointment_timetable,'TABLE_lab_assistant': TABLE_lab_assistant,'TABLE_lab_test': TABLE_lab_test,'TABLE_medical_history': TABLE_medical_history,'TABLE_patient': TABLE_patient,'TABLE_patient_message_receive': TABLE_patient_message_receive,'TABLE_patient_message_send': TABLE_patient_message_send,'TABLE_patient_useraccount': TABLE_patient_useraccount,'TABLE_person': TABLE_person,'TABLE_pharmacist': TABLE_pharmacist,'TABLE_pharmacy_history': TABLE_pharmacy_history,'TABLE_pharmacy_stock': TABLE_pharmacy_stock,'TABLE_prescription': TABLE_prescription,'TABLE_refund': TABLE_refund,'TABLE_signup': TABLE_signup,'TABLE_suppliers': TABLE_suppliers,'TABLE_sys_user': TABLE_sys_user,'TABLE_tempappointment': TABLE_tempappointment,'TABLE_tmp_bill': TABLE_tmp_bill,'TABLE_user_message': TABLE_user_message,'TABLE_website_messages': TABLE_website_messages} def GenArgv(): builder = ArgvBuilder() builder.NewOp('Op_Doctor_doctorTimeTableAddSlot_run_8412') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newTimeSlotId', ArgvBuilder.Type.STRING) builder.AddArgv('slmcReg', ArgvBuilder.Type.STRING) builder.AddArgv('day', ArgvBuilder.Type.INT) builder.AddArgv('timeSlot', ArgvBuilder.Type.STRING) builder.AddArgv('currentWeekAppointments', ArgvBuilder.Type.INT) builder.AddArgv('nextWeekAppointments', ArgvBuilder.Type.INT) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Pharmacist_addNewDrug2_run_8413') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newDrugId', ArgvBuilder.Type.STRING) builder.AddArgv('drugName', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Cashier_bill_run_8414') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newBillId', ArgvBuilder.Type.STRING) builder.AddArgv('date', ArgvBuilder.Type.INT) builder.AddArgv('doctorFee', ArgvBuilder.Type.INT) builder.AddArgv('hospitalFee', ArgvBuilder.Type.INT) builder.AddArgv('pharmacyFee', ArgvBuilder.Type.INT) builder.AddArgv('laboratoryFee', ArgvBuilder.Type.INT) builder.AddArgv('appointmentFee', ArgvBuilder.Type.INT) builder.AddArgv('vat', ArgvBuilder.Type.INT) builder.AddArgv('discount', ArgvBuilder.Type.INT) builder.AddArgv('total', ArgvBuilder.Type.INT) builder.AddArgv('paymentMethod', ArgvBuilder.Type.STRING) builder.AddArgv('consultantId', ArgvBuilder.Type.STRING) builder.AddArgv('patientId', ArgvBuilder.Type.STRING) builder.AddArgv('refund', ArgvBuilder.Type.INT) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Pharmacist_updateStock_run_8415') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newStockId', ArgvBuilder.Type.STRING) builder.AddArgv('drugId', ArgvBuilder.Type.STRING) builder.AddArgv('brandId', ArgvBuilder.Type.STRING) builder.AddArgv('stock', ArgvBuilder.Type.INT) builder.AddArgv('manuDate', ArgvBuilder.Type.INT) builder.AddArgv('expDate', ArgvBuilder.Type.INT) builder.AddArgv('suppId', ArgvBuilder.Type.STRING) builder.AddArgv('date', ArgvBuilder.Type.INT) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Pharmacist_reduceStock_run_8416') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('pharmacy_stock_stock_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_LabAssistant_updateLabAssistantInfo_run_8417') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('lab_assistant_lab_assistant_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Receptionist_updateAccountInfo_run_8418') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('doctor_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Doctor_diagnose_run_8419') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newHistoryId', ArgvBuilder.Type.STRING) builder.AddArgv('patientId', ArgvBuilder.Type.STRING) builder.AddArgv('doctorId', ArgvBuilder.Type.STRING) builder.AddArgv('date', ArgvBuilder.Type.INT) builder.AddArgv('history', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Pharmacist_updateAccountInfo_run_8420') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('pharmacistId', ArgvBuilder.Type.STRING) builder.AddArgv('pharmacist_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_LabAssistant_UrineFullReport_run_8421') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newTstId', ArgvBuilder.Type.STRING) builder.AddArgv('appId', ArgvBuilder.Type.STRING) builder.AddArgv('appearance', ArgvBuilder.Type.STRING) builder.AddArgv('sgRefractometer', ArgvBuilder.Type.STRING) builder.AddArgv('ph', ArgvBuilder.Type.REAL) builder.AddArgv('protein', ArgvBuilder.Type.STRING) builder.AddArgv('glucose', ArgvBuilder.Type.STRING) builder.AddArgv('ketoneBodies', ArgvBuilder.Type.STRING) builder.AddArgv('bilirubin', ArgvBuilder.Type.STRING) builder.AddArgv('urobilirubin', ArgvBuilder.Type.STRING) builder.AddArgv('contrifugedDepositsphaseContrastMicroscopy', ArgvBuilder.Type.STRING) builder.AddArgv('pusCells', ArgvBuilder.Type.STRING) builder.AddArgv('redCells', ArgvBuilder.Type.STRING) builder.AddArgv('epithelialCells', ArgvBuilder.Type.STRING) builder.AddArgv('casts', ArgvBuilder.Type.STRING) builder.AddArgv('cristals', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Receptionist_cancelAppointment_run_8422') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('appointmentId', ArgvBuilder.Type.STRING) builder.AddArgv('appointment_appointment_id', ArgvBuilder.Type.STRING) builder.AddArgv('appointment_bill_id', ArgvBuilder.Type.STRING) builder.AddArgv('newRefundId', ArgvBuilder.Type.STRING) builder.AddArgv('bill_total', ArgvBuilder.Type.INT) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.AddArgv('bill_bill_id', ArgvBuilder.Type.STRING) builder.NewOp('Op_Cashier_makeRefund_run_8423') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Cashier_refund_run_8424') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newRefundId', ArgvBuilder.Type.STRING) builder.AddArgv('billId', ArgvBuilder.Type.STRING) builder.AddArgv('paymentType', ArgvBuilder.Type.STRING) builder.AddArgv('reason', ArgvBuilder.Type.STRING) builder.AddArgv('amount', ArgvBuilder.Type.INT) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Doctor_allergies_run_8425') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('patientId', ArgvBuilder.Type.STRING) builder.AddArgv('patient_drug_allergies_and_reactions', ArgvBuilder.Type.STRING) builder.AddArgv('allergies', ArgvBuilder.Type.STRING) builder.AddArgv('patient_patient_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Admin_createNewUser_run_8426') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newPersonId', ArgvBuilder.Type.STRING) builder.AddArgv('firstName', ArgvBuilder.Type.STRING) builder.AddArgv('lastName', ArgvBuilder.Type.STRING) builder.AddArgv('nic', ArgvBuilder.Type.STRING) builder.AddArgv('mobile', ArgvBuilder.Type.STRING) builder.AddArgv('newUserId', ArgvBuilder.Type.STRING) builder.AddArgv('userName', ArgvBuilder.Type.STRING) builder.AddArgv('userType', ArgvBuilder.Type.STRING) builder.AddArgv('newLabAssistantId', ArgvBuilder.Type.STRING) builder.AddArgv('newPharmacistId', ArgvBuilder.Type.STRING) builder.AddArgv('newSlmcReg', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Pharmacist_bill_run_8427') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('tmp_bill_tmp_bill_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Receptionist_updatePatientInfo_run_8428') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('patientId', ArgvBuilder.Type.STRING) builder.AddArgv('info', ArgvBuilder.Type.STRING) builder.AddArgv('patient_patient_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Doctor_updateDoctorInfo_run_8429') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('doctor_slmc_reg_no', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Receptionist_updateProfileInfo_run_8430') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('userId', ArgvBuilder.Type.STRING) builder.AddArgv('address', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_person_id', ArgvBuilder.Type.STRING) builder.AddArgv('person_person_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newTstId', ArgvBuilder.Type.STRING) builder.AddArgv('appId', ArgvBuilder.Type.STRING) builder.AddArgv('cpkTotal', ArgvBuilder.Type.INT) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Cashier_updateAccountInfo_run_8432') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Admin_suspendUser_run_8433') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Doctor_updateProfileInfo_run_8434') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('doctor_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_person_id', ArgvBuilder.Type.STRING) builder.AddArgv('person_person_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Pharmacist_updateProfileInfo_run_8435') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('address', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_person_id', ArgvBuilder.Type.STRING) builder.AddArgv('person_person_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Doctor_bill_run_8436') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('tmp_bill_tmp_bill_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_LabAssistant_BloodGroupingTest_run_8437') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newTstId', ArgvBuilder.Type.STRING) builder.AddArgv('appId', ArgvBuilder.Type.STRING) builder.AddArgv('bloodGroup', ArgvBuilder.Type.STRING) builder.AddArgv('rh', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Doctor_prescribe_run_8438') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newPrescId', ArgvBuilder.Type.STRING) builder.AddArgv('patientId', ArgvBuilder.Type.STRING) builder.AddArgv('consultantId', ArgvBuilder.Type.STRING) builder.AddArgv('date', ArgvBuilder.Type.INT) builder.AddArgv('drugDose', ArgvBuilder.Type.STRING) builder.AddArgv('tests', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Receptionist_setPatientInfo_run_8439') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newPersonId', ArgvBuilder.Type.STRING) builder.AddArgv('newPatientId', ArgvBuilder.Type.STRING) builder.AddArgv('nic', ArgvBuilder.Type.STRING) builder.AddArgv('gender', ArgvBuilder.Type.STRING) builder.AddArgv('birth', ArgvBuilder.Type.INT) builder.AddArgv('address', ArgvBuilder.Type.STRING) builder.AddArgv('mobile', ArgvBuilder.Type.STRING) builder.AddArgv('firstName', ArgvBuilder.Type.STRING) builder.AddArgv('lastName', ArgvBuilder.Type.STRING) builder.AddArgv('email', ArgvBuilder.Type.STRING) builder.AddArgv('nationality', ArgvBuilder.Type.STRING) builder.AddArgv('religion', ArgvBuilder.Type.STRING) builder.AddArgv('patientInfo', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_LabAssistant_RenalFunctionTest_run_8440') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newTstId', ArgvBuilder.Type.STRING) builder.AddArgv('appId', ArgvBuilder.Type.STRING) builder.AddArgv('creatinine', ArgvBuilder.Type.REAL) builder.AddArgv('urea', ArgvBuilder.Type.REAL) builder.AddArgv('totalBilirubin', ArgvBuilder.Type.REAL) builder.AddArgv('directBilirubin', ArgvBuilder.Type.REAL) builder.AddArgv('sgotast', ArgvBuilder.Type.REAL) builder.AddArgv('sgptalt', ArgvBuilder.Type.REAL) builder.AddArgv('alkalinePhospates', ArgvBuilder.Type.REAL) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Admin_updateProfileInfo_run_8441') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_person_id', ArgvBuilder.Type.STRING) builder.AddArgv('person_person_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Admin_resetPassword_run_8442') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Receptionist_refund_run_8443') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newRefundId', ArgvBuilder.Type.STRING) builder.AddArgv('billId', ArgvBuilder.Type.STRING) builder.AddArgv('paymentType', ArgvBuilder.Type.STRING) builder.AddArgv('reason', ArgvBuilder.Type.STRING) builder.AddArgv('amount', ArgvBuilder.Type.INT) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Admin_unsuspendUser_run_8444') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Receptionist_makeLabAppointment_run_8445') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newAppId', ArgvBuilder.Type.STRING) builder.AddArgv('testId', ArgvBuilder.Type.STRING) builder.AddArgv('patientId', ArgvBuilder.Type.STRING) builder.AddArgv('doctorId', ArgvBuilder.Type.STRING) builder.AddArgv('currentDate', ArgvBuilder.Type.INT) builder.AddArgv('day', ArgvBuilder.Type.INT) builder.AddArgv('lab_test_test_fee', ArgvBuilder.Type.INT) builder.AddArgv('tmp_bill_tmp_bill_id', ArgvBuilder.Type.STRING) builder.AddArgv('newTmpBillId', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_LabAssistant_LipidTest_run_8446') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newTstId', ArgvBuilder.Type.STRING) builder.AddArgv('appId', ArgvBuilder.Type.STRING) builder.AddArgv('cholestrolHDL', ArgvBuilder.Type.STRING) builder.AddArgv('cholestrolLDL', ArgvBuilder.Type.STRING) builder.AddArgv('triglycerides', ArgvBuilder.Type.STRING) builder.AddArgv('totalCholestrolLDLHDLratio', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Doctor_updateAccountInfo_run_8447') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('doctor_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_LabAssistant_completeBloodCount_run_8448') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newTstId', ArgvBuilder.Type.STRING) builder.AddArgv('appId', ArgvBuilder.Type.STRING) builder.AddArgv('totalWhiteCellCount', ArgvBuilder.Type.INT) builder.AddArgv('differentialCount', ArgvBuilder.Type.INT) builder.AddArgv('neutrophils', ArgvBuilder.Type.INT) builder.AddArgv('lymphocytes', ArgvBuilder.Type.INT) builder.AddArgv('monocytes', ArgvBuilder.Type.INT) builder.AddArgv('eosonophils', ArgvBuilder.Type.INT) builder.AddArgv('basophils', ArgvBuilder.Type.INT) builder.AddArgv('haemoglobin', ArgvBuilder.Type.REAL) builder.AddArgv('redBloodCells', ArgvBuilder.Type.REAL) builder.AddArgv('meanCellVolume', ArgvBuilder.Type.REAL) builder.AddArgv('haematocrit', ArgvBuilder.Type.REAL) builder.AddArgv('meanCellHaemoglobin', ArgvBuilder.Type.REAL) builder.AddArgv('mchConcentration', ArgvBuilder.Type.REAL) builder.AddArgv('redCellsDistributionWidth', ArgvBuilder.Type.REAL) builder.AddArgv('plateletCount', ArgvBuilder.Type.INT) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Receptionist_makeAppointment_run_8449') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newAppId', ArgvBuilder.Type.STRING) builder.AddArgv('patientId', ArgvBuilder.Type.STRING) builder.AddArgv('doctorId', ArgvBuilder.Type.STRING) builder.AddArgv('currentDate', ArgvBuilder.Type.INT) builder.AddArgv('day', ArgvBuilder.Type.INT) builder.AddArgv('timeSlot', ArgvBuilder.Type.STRING) builder.AddArgv('doctor_availability_time_slot', ArgvBuilder.Type.STRING) builder.AddArgv('doctor_availability_slmc_reg_no', ArgvBuilder.Type.STRING) builder.AddArgv('doctor_availability_day', ArgvBuilder.Type.INT) builder.AddArgv('tmp_bill_tmp_bill_id', ArgvBuilder.Type.STRING) builder.AddArgv('newTmpBillId', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Pharmacist_addNewSupplier_run_8450') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newSupplierId', ArgvBuilder.Type.STRING) builder.AddArgv('name', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Pharmacist_updatePharmacistInfo_run_8451') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('pharmacist_pharmacist_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_LabAssistant_updateProfileInfo_run_8452') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_person_id', ArgvBuilder.Type.STRING) builder.AddArgv('person_person_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Cashier_removeFromTempBill_run_8453') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_LabAssistant_liverFunctionTest_run_8454') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newTstId', ArgvBuilder.Type.STRING) builder.AddArgv('appId', ArgvBuilder.Type.STRING) builder.AddArgv('totalBilirubin', ArgvBuilder.Type.REAL) builder.AddArgv('albumin', ArgvBuilder.Type.REAL) builder.AddArgv('globulin', ArgvBuilder.Type.REAL) builder.AddArgv('directBilirubin', ArgvBuilder.Type.REAL) builder.AddArgv('sgotast', ArgvBuilder.Type.REAL) builder.AddArgv('sgptalt', ArgvBuilder.Type.REAL) builder.AddArgv('alkalinePhospates', ArgvBuilder.Type.REAL) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Receptionist_cancelLabAppointment_run_8455') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('labAppointmentId', ArgvBuilder.Type.STRING) builder.AddArgv('lab_appointment_lab_appointment_id', ArgvBuilder.Type.STRING) builder.AddArgv('lab_appointment_bill_id', ArgvBuilder.Type.STRING) builder.AddArgv('newRefundId', ArgvBuilder.Type.STRING) builder.AddArgv('bill_total', ArgvBuilder.Type.INT) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.AddArgv('bill_bill_id', ArgvBuilder.Type.STRING) builder.NewOp('Op_Pharmacist_addNewBrand_run_8456') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newBrandId', ArgvBuilder.Type.STRING) builder.AddArgv('brandName', ArgvBuilder.Type.STRING) builder.AddArgv('genericName', ArgvBuilder.Type.STRING) builder.AddArgv('drugType', ArgvBuilder.Type.STRING) builder.AddArgv('drugUnit', ArgvBuilder.Type.STRING) builder.AddArgv('unitPrice', ArgvBuilder.Type.INT) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('newTstId', ArgvBuilder.Type.STRING) builder.AddArgv('appId', ArgvBuilder.Type.STRING) builder.AddArgv('hiv12ELISA', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Doctor_removeDoctorTime_run_8458') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Admin_updateAccountInfo_run_8459') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_LabAssistant_updateAccountInfo_run_8460') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('doctor_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_user_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) builder.NewOp('Op_Cashier_updateProfileInfo_run_8461') builder.AddArgv('__ts', ArgvBuilder.Type.INT) builder.AddArgv('id', ArgvBuilder.Type.STRING) builder.AddArgv('sys_user_person_id', ArgvBuilder.Type.STRING) builder.AddArgv('now', ArgvBuilder.Type.INT) return builder.Build() class Op_Doctor_doctorTimeTableAddSlot_run_8412(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Doctor_doctorTimeTableAddSlot_run_8412', 'newTimeSlotId'), AxiomUniqueArguments('Op_Doctor_doctorTimeTableAddSlot_run_8412', ['slmcReg', 'timeSlot', 'day'])) def cond0(self, state, argv): __ts = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['__ts'] newTimeSlotId = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['newTimeSlotId'] slmcReg = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['slmcReg'] day = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['day'] timeSlot = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['timeSlot'] currentWeekAppointments = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['currentWeekAppointments'] nextWeekAppointments = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['nextWeekAppointments'] return (state['TABLE_doctor_availability'].notNil({'time_slot_id': argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['newTimeSlotId']}) == False) def csop0(self, state, argv): now = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['now'] __ts = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['__ts'] newTimeSlotId = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['newTimeSlotId'] slmcReg = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['slmcReg'] day = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['day'] timeSlot = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['timeSlot'] currentWeekAppointments = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['currentWeekAppointments'] nextWeekAppointments = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['nextWeekAppointments'] doctor_availability_time_slot_id = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['newTimeSlotId'] doctor_availability_slmc_reg_no = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['slmcReg'] doctor_availability_day = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['day'] doctor_availability_time_slot = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['timeSlot'] doctor_availability_current_week_appointments = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['currentWeekAppointments'] doctor_availability_next_week_appointments = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['nextWeekAppointments'] doctor_availability__ts = state['TABLE_doctor_availability'].get({'time_slot_id': doctor_availability_time_slot_id}, '__ts') return And((doctor_availability__ts < now)) def sop0(self, state, argv): now = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['now'] __ts = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['__ts'] newTimeSlotId = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['newTimeSlotId'] slmcReg = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['slmcReg'] day = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['day'] timeSlot = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['timeSlot'] currentWeekAppointments = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['currentWeekAppointments'] nextWeekAppointments = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['nextWeekAppointments'] doctor_availability_time_slot_id = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['newTimeSlotId'] doctor_availability_slmc_reg_no = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['slmcReg'] doctor_availability_day = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['day'] doctor_availability_time_slot = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['timeSlot'] doctor_availability_current_week_appointments = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['currentWeekAppointments'] doctor_availability_next_week_appointments = argv['Op_Doctor_doctorTimeTableAddSlot_run_8412']['nextWeekAppointments'] state['TABLE_doctor_availability'].add({'time_slot_id': doctor_availability_time_slot_id}, {'slmc_reg_no': doctor_availability_slmc_reg_no,'day': doctor_availability_day,'time_slot': doctor_availability_time_slot,'current_week_appointments': doctor_availability_current_week_appointments,'next_week_appointments': doctor_availability_next_week_appointments, '__ts': now}) return state class Op_Pharmacist_addNewDrug2_run_8413(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Pharmacist_addNewDrug2_run_8413', 'newDrugId')) def cond0(self, state, argv): __ts = argv['Op_Pharmacist_addNewDrug2_run_8413']['__ts'] newDrugId = argv['Op_Pharmacist_addNewDrug2_run_8413']['newDrugId'] drugName = argv['Op_Pharmacist_addNewDrug2_run_8413']['drugName'] return (state['TABLE_drug'].notNil({'drug_id': argv['Op_Pharmacist_addNewDrug2_run_8413']['newDrugId']}) == False) def csop0(self, state, argv): now = argv['Op_Pharmacist_addNewDrug2_run_8413']['now'] __ts = argv['Op_Pharmacist_addNewDrug2_run_8413']['__ts'] newDrugId = argv['Op_Pharmacist_addNewDrug2_run_8413']['newDrugId'] drugName = argv['Op_Pharmacist_addNewDrug2_run_8413']['drugName'] drug_drug_id = argv['Op_Pharmacist_addNewDrug2_run_8413']['newDrugId'] drug_drug_name = argv['Op_Pharmacist_addNewDrug2_run_8413']['drugName'] drug_dangerous_drug = 0 drug__ts = state['TABLE_drug'].get({'drug_id': drug_drug_id}, '__ts') return And((drug__ts < now)) def sop0(self, state, argv): now = argv['Op_Pharmacist_addNewDrug2_run_8413']['now'] __ts = argv['Op_Pharmacist_addNewDrug2_run_8413']['__ts'] newDrugId = argv['Op_Pharmacist_addNewDrug2_run_8413']['newDrugId'] drugName = argv['Op_Pharmacist_addNewDrug2_run_8413']['drugName'] drug_drug_id = argv['Op_Pharmacist_addNewDrug2_run_8413']['newDrugId'] drug_drug_name = argv['Op_Pharmacist_addNewDrug2_run_8413']['drugName'] drug_dangerous_drug = 0 state['TABLE_drug'].add({'drug_id': drug_drug_id}, {'drug_name': drug_drug_name,'dangerous_drug': drug_dangerous_drug, '__ts': now}) return state class Op_Cashier_bill_run_8414(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Cashier_bill_run_8414', 'newBillId')) def cond0(self, state, argv): __ts = argv['Op_Cashier_bill_run_8414']['__ts'] newBillId = argv['Op_Cashier_bill_run_8414']['newBillId'] date = argv['Op_Cashier_bill_run_8414']['date'] doctorFee = argv['Op_Cashier_bill_run_8414']['doctorFee'] hospitalFee = argv['Op_Cashier_bill_run_8414']['hospitalFee'] pharmacyFee = argv['Op_Cashier_bill_run_8414']['pharmacyFee'] laboratoryFee = argv['Op_Cashier_bill_run_8414']['laboratoryFee'] appointmentFee = argv['Op_Cashier_bill_run_8414']['appointmentFee'] vat = argv['Op_Cashier_bill_run_8414']['vat'] discount = argv['Op_Cashier_bill_run_8414']['discount'] total = argv['Op_Cashier_bill_run_8414']['total'] paymentMethod = argv['Op_Cashier_bill_run_8414']['paymentMethod'] consultantId = argv['Op_Cashier_bill_run_8414']['consultantId'] patientId = argv['Op_Cashier_bill_run_8414']['patientId'] refund = argv['Op_Cashier_bill_run_8414']['refund'] return True def csop0(self, state, argv): now = argv['Op_Cashier_bill_run_8414']['now'] __ts = argv['Op_Cashier_bill_run_8414']['__ts'] newBillId = argv['Op_Cashier_bill_run_8414']['newBillId'] date = argv['Op_Cashier_bill_run_8414']['date'] doctorFee = argv['Op_Cashier_bill_run_8414']['doctorFee'] hospitalFee = argv['Op_Cashier_bill_run_8414']['hospitalFee'] pharmacyFee = argv['Op_Cashier_bill_run_8414']['pharmacyFee'] laboratoryFee = argv['Op_Cashier_bill_run_8414']['laboratoryFee'] appointmentFee = argv['Op_Cashier_bill_run_8414']['appointmentFee'] vat = argv['Op_Cashier_bill_run_8414']['vat'] discount = argv['Op_Cashier_bill_run_8414']['discount'] total = argv['Op_Cashier_bill_run_8414']['total'] paymentMethod = argv['Op_Cashier_bill_run_8414']['paymentMethod'] consultantId = argv['Op_Cashier_bill_run_8414']['consultantId'] patientId = argv['Op_Cashier_bill_run_8414']['patientId'] refund = argv['Op_Cashier_bill_run_8414']['refund'] bill_bill_id = argv['Op_Cashier_bill_run_8414']['newBillId'] bill_bill_date = argv['Op_Cashier_bill_run_8414']['date'] bill_doctor_fee = argv['Op_Cashier_bill_run_8414']['doctorFee'] bill_hospital_fee = argv['Op_Cashier_bill_run_8414']['hospitalFee'] bill_pharmacy_fee = argv['Op_Cashier_bill_run_8414']['pharmacyFee'] bill_laboratory_fee = argv['Op_Cashier_bill_run_8414']['laboratoryFee'] bill_appointment_fee = argv['Op_Cashier_bill_run_8414']['appointmentFee'] bill_vat = argv['Op_Cashier_bill_run_8414']['vat'] bill_discount = argv['Op_Cashier_bill_run_8414']['discount'] bill_total = argv['Op_Cashier_bill_run_8414']['total'] bill_payment_method = argv['Op_Cashier_bill_run_8414']['paymentMethod'] bill_consultant_id = argv['Op_Cashier_bill_run_8414']['consultantId'] bill_patient_id = argv['Op_Cashier_bill_run_8414']['patientId'] bill_refund = argv['Op_Cashier_bill_run_8414']['refund'] bill__ts = state['TABLE_bill'].get({'bill_id': bill_bill_id}, '__ts') return And((bill__ts < now)) def sop0(self, state, argv): now = argv['Op_Cashier_bill_run_8414']['now'] __ts = argv['Op_Cashier_bill_run_8414']['__ts'] newBillId = argv['Op_Cashier_bill_run_8414']['newBillId'] date = argv['Op_Cashier_bill_run_8414']['date'] doctorFee = argv['Op_Cashier_bill_run_8414']['doctorFee'] hospitalFee = argv['Op_Cashier_bill_run_8414']['hospitalFee'] pharmacyFee = argv['Op_Cashier_bill_run_8414']['pharmacyFee'] laboratoryFee = argv['Op_Cashier_bill_run_8414']['laboratoryFee'] appointmentFee = argv['Op_Cashier_bill_run_8414']['appointmentFee'] vat = argv['Op_Cashier_bill_run_8414']['vat'] discount = argv['Op_Cashier_bill_run_8414']['discount'] total = argv['Op_Cashier_bill_run_8414']['total'] paymentMethod = argv['Op_Cashier_bill_run_8414']['paymentMethod'] consultantId = argv['Op_Cashier_bill_run_8414']['consultantId'] patientId = argv['Op_Cashier_bill_run_8414']['patientId'] refund = argv['Op_Cashier_bill_run_8414']['refund'] bill_bill_id = argv['Op_Cashier_bill_run_8414']['newBillId'] bill_bill_date = argv['Op_Cashier_bill_run_8414']['date'] bill_doctor_fee = argv['Op_Cashier_bill_run_8414']['doctorFee'] bill_hospital_fee = argv['Op_Cashier_bill_run_8414']['hospitalFee'] bill_pharmacy_fee = argv['Op_Cashier_bill_run_8414']['pharmacyFee'] bill_laboratory_fee = argv['Op_Cashier_bill_run_8414']['laboratoryFee'] bill_appointment_fee = argv['Op_Cashier_bill_run_8414']['appointmentFee'] bill_vat = argv['Op_Cashier_bill_run_8414']['vat'] bill_discount = argv['Op_Cashier_bill_run_8414']['discount'] bill_total = argv['Op_Cashier_bill_run_8414']['total'] bill_payment_method = argv['Op_Cashier_bill_run_8414']['paymentMethod'] bill_consultant_id = argv['Op_Cashier_bill_run_8414']['consultantId'] bill_patient_id = argv['Op_Cashier_bill_run_8414']['patientId'] bill_refund = argv['Op_Cashier_bill_run_8414']['refund'] state['TABLE_bill'].add({'bill_id': bill_bill_id}, {'bill_date': bill_bill_date,'doctor_fee': bill_doctor_fee,'hospital_fee': bill_hospital_fee,'pharmacy_fee': bill_pharmacy_fee,'laboratory_fee': bill_laboratory_fee,'appointment_fee': bill_appointment_fee,'vat': bill_vat,'discount': bill_discount,'total': bill_total,'payment_method': bill_payment_method,'consultant_id': bill_consultant_id,'patient_id': bill_patient_id,'refund': bill_refund, '__ts': now}) return state class Op_Pharmacist_updateStock_run_8415(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Pharmacist_updateStock_run_8415', 'newStockId')) def cond0(self, state, argv): __ts = argv['Op_Pharmacist_updateStock_run_8415']['__ts'] newStockId = argv['Op_Pharmacist_updateStock_run_8415']['newStockId'] drugId = argv['Op_Pharmacist_updateStock_run_8415']['drugId'] brandId = argv['Op_Pharmacist_updateStock_run_8415']['brandId'] stock = argv['Op_Pharmacist_updateStock_run_8415']['stock'] manuDate = argv['Op_Pharmacist_updateStock_run_8415']['manuDate'] expDate = argv['Op_Pharmacist_updateStock_run_8415']['expDate'] suppId = argv['Op_Pharmacist_updateStock_run_8415']['suppId'] date = argv['Op_Pharmacist_updateStock_run_8415']['date'] return (state['TABLE_pharmacy_stock'].notNil({'stock_id': argv['Op_Pharmacist_updateStock_run_8415']['newStockId']}) == False) def csop0(self, state, argv): now = argv['Op_Pharmacist_updateStock_run_8415']['now'] __ts = argv['Op_Pharmacist_updateStock_run_8415']['__ts'] newStockId = argv['Op_Pharmacist_updateStock_run_8415']['newStockId'] drugId = argv['Op_Pharmacist_updateStock_run_8415']['drugId'] brandId = argv['Op_Pharmacist_updateStock_run_8415']['brandId'] stock = argv['Op_Pharmacist_updateStock_run_8415']['stock'] manuDate = argv['Op_Pharmacist_updateStock_run_8415']['manuDate'] expDate = argv['Op_Pharmacist_updateStock_run_8415']['expDate'] suppId = argv['Op_Pharmacist_updateStock_run_8415']['suppId'] date = argv['Op_Pharmacist_updateStock_run_8415']['date'] pharmacy_stock_stock_id = argv['Op_Pharmacist_updateStock_run_8415']['newStockId'] pharmacy_stock_drug_id = argv['Op_Pharmacist_updateStock_run_8415']['drugId'] pharmacy_stock_brand_id = argv['Op_Pharmacist_updateStock_run_8415']['brandId'] pharmacy_stock_stock = argv['Op_Pharmacist_updateStock_run_8415']['stock'] pharmacy_stock_remaining_quantity = argv['Op_Pharmacist_updateStock_run_8415']['stock'] pharmacy_stock_manufac_date = argv['Op_Pharmacist_updateStock_run_8415']['manuDate'] pharmacy_stock_exp_date = argv['Op_Pharmacist_updateStock_run_8415']['expDate'] pharmacy_stock_supplier_id = argv['Op_Pharmacist_updateStock_run_8415']['suppId'] pharmacy_stock_date = argv['Op_Pharmacist_updateStock_run_8415']['date'] pharmacy_stock__ts = state['TABLE_pharmacy_stock'].get({'stock_id': pharmacy_stock_stock_id}, '__ts') return And((pharmacy_stock__ts < now)) def sop0(self, state, argv): now = argv['Op_Pharmacist_updateStock_run_8415']['now'] __ts = argv['Op_Pharmacist_updateStock_run_8415']['__ts'] newStockId = argv['Op_Pharmacist_updateStock_run_8415']['newStockId'] drugId = argv['Op_Pharmacist_updateStock_run_8415']['drugId'] brandId = argv['Op_Pharmacist_updateStock_run_8415']['brandId'] stock = argv['Op_Pharmacist_updateStock_run_8415']['stock'] manuDate = argv['Op_Pharmacist_updateStock_run_8415']['manuDate'] expDate = argv['Op_Pharmacist_updateStock_run_8415']['expDate'] suppId = argv['Op_Pharmacist_updateStock_run_8415']['suppId'] date = argv['Op_Pharmacist_updateStock_run_8415']['date'] pharmacy_stock_stock_id = argv['Op_Pharmacist_updateStock_run_8415']['newStockId'] pharmacy_stock_drug_id = argv['Op_Pharmacist_updateStock_run_8415']['drugId'] pharmacy_stock_brand_id = argv['Op_Pharmacist_updateStock_run_8415']['brandId'] pharmacy_stock_stock = argv['Op_Pharmacist_updateStock_run_8415']['stock'] pharmacy_stock_remaining_quantity = argv['Op_Pharmacist_updateStock_run_8415']['stock'] pharmacy_stock_manufac_date = argv['Op_Pharmacist_updateStock_run_8415']['manuDate'] pharmacy_stock_exp_date = argv['Op_Pharmacist_updateStock_run_8415']['expDate'] pharmacy_stock_supplier_id = argv['Op_Pharmacist_updateStock_run_8415']['suppId'] pharmacy_stock_date = argv['Op_Pharmacist_updateStock_run_8415']['date'] state['TABLE_pharmacy_stock'].add({'stock_id': pharmacy_stock_stock_id}, {'drug_id': pharmacy_stock_drug_id,'brand_id': pharmacy_stock_brand_id,'stock': pharmacy_stock_stock,'remaining_quantity': pharmacy_stock_remaining_quantity,'manufac_date': pharmacy_stock_manufac_date,'exp_date': pharmacy_stock_exp_date,'supplier_id': pharmacy_stock_supplier_id,'date': pharmacy_stock_date, '__ts': now}) return state class Op_Pharmacist_reduceStock_run_8416(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Pharmacist_reduceStock_run_8416']['__ts'] id = argv['Op_Pharmacist_reduceStock_run_8416']['id'] pharmacy_stock_stock_id = argv['Op_Pharmacist_reduceStock_run_8416']['pharmacy_stock_stock_id'] return (state['TABLE_pharmacy_stock'].notNil({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}) == True) def csop0(self, state, argv): now = argv['Op_Pharmacist_reduceStock_run_8416']['now'] __ts = argv['Op_Pharmacist_reduceStock_run_8416']['__ts'] id = argv['Op_Pharmacist_reduceStock_run_8416']['id'] pharmacy_stock_stock_id = argv['Op_Pharmacist_reduceStock_run_8416']['pharmacy_stock_stock_id'] pharmacy_stock__ts = state['TABLE_pharmacy_stock'].get({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}, '__ts') return And((pharmacy_stock__ts < now)) def sop0(self, state, argv): now = argv['Op_Pharmacist_reduceStock_run_8416']['now'] __ts = argv['Op_Pharmacist_reduceStock_run_8416']['__ts'] id = argv['Op_Pharmacist_reduceStock_run_8416']['id'] pharmacy_stock_stock_id = argv['Op_Pharmacist_reduceStock_run_8416']['pharmacy_stock_stock_id'] pharmacy_stock_stock_id = state['TABLE_pharmacy_stock'].get({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}, 'stock_id') pharmacy_stock_drug_id = state['TABLE_pharmacy_stock'].get({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}, 'drug_id') pharmacy_stock_brand_id = state['TABLE_pharmacy_stock'].get({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}, 'brand_id') pharmacy_stock_stock = state['TABLE_pharmacy_stock'].get({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}, 'stock') pharmacy_stock_remaining_quantity = state['TABLE_pharmacy_stock'].get({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}, 'remaining_quantity') pharmacy_stock_manufac_date = state['TABLE_pharmacy_stock'].get({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}, 'manufac_date') pharmacy_stock_exp_date = state['TABLE_pharmacy_stock'].get({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}, 'exp_date') pharmacy_stock_supplier_id = state['TABLE_pharmacy_stock'].get({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}, 'supplier_id') pharmacy_stock_date = state['TABLE_pharmacy_stock'].get({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}, 'date') pharmacy_stock_remaining_quantity = (pharmacy_stock_remaining_quantity)-(10) state['TABLE_pharmacy_stock'].update({'stock_id': argv['Op_Pharmacist_reduceStock_run_8416']['id']}, {'stock_id': pharmacy_stock_stock_id, 'drug_id': pharmacy_stock_drug_id, 'brand_id': pharmacy_stock_brand_id, 'stock': pharmacy_stock_stock, 'remaining_quantity': pharmacy_stock_remaining_quantity, 'manufac_date': pharmacy_stock_manufac_date, 'exp_date': pharmacy_stock_exp_date, 'supplier_id': pharmacy_stock_supplier_id, 'date': pharmacy_stock_date, '__ts': now}) return state class Op_LabAssistant_updateLabAssistantInfo_run_8417(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['__ts'] id = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id'] lab_assistant_lab_assistant_id = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['lab_assistant_lab_assistant_id'] return (state['TABLE_lab_assistant'].notNil({'lab_assistant_id': argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id']}) == True) def csop0(self, state, argv): now = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['now'] __ts = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['__ts'] id = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id'] lab_assistant_lab_assistant_id = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['lab_assistant_lab_assistant_id'] lab_assistant__ts = state['TABLE_lab_assistant'].get({'lab_assistant_id': argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id']}, '__ts') return And((lab_assistant__ts < now)) def sop0(self, state, argv): now = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['now'] __ts = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['__ts'] id = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id'] lab_assistant_lab_assistant_id = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['lab_assistant_lab_assistant_id'] lab_assistant_lab_assistant_id = state['TABLE_lab_assistant'].get({'lab_assistant_id': argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id']}, 'lab_assistant_id') lab_assistant_user_id = state['TABLE_lab_assistant'].get({'lab_assistant_id': argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id']}, 'user_id') lab_assistant_education = state['TABLE_lab_assistant'].get({'lab_assistant_id': argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id']}, 'education') lab_assistant_training = state['TABLE_lab_assistant'].get({'lab_assistant_id': argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id']}, 'training') lab_assistant_experience = state['TABLE_lab_assistant'].get({'lab_assistant_id': argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id']}, 'experience') lab_assistant_achievements = state['TABLE_lab_assistant'].get({'lab_assistant_id': argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id']}, 'achievements') lab_assistant_education = argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id'] state['TABLE_lab_assistant'].update({'lab_assistant_id': argv['Op_LabAssistant_updateLabAssistantInfo_run_8417']['id']}, {'lab_assistant_id': lab_assistant_lab_assistant_id, 'user_id': lab_assistant_user_id, 'education': lab_assistant_education, 'training': lab_assistant_training, 'experience': lab_assistant_experience, 'achievements': lab_assistant_achievements, '__ts': now}) return state class Op_Receptionist_updateAccountInfo_run_8418(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Receptionist_updateAccountInfo_run_8418']['__ts'] id = argv['Op_Receptionist_updateAccountInfo_run_8418']['id'] doctor_user_id = argv['Op_Receptionist_updateAccountInfo_run_8418']['doctor_user_id'] sys_user_user_id = argv['Op_Receptionist_updateAccountInfo_run_8418']['sys_user_user_id'] return And((state['TABLE_doctor'].notNil({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}) == True),(state['TABLE_sys_user'].notNil({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}) == True)) def csop0(self, state, argv): now = argv['Op_Receptionist_updateAccountInfo_run_8418']['now'] __ts = argv['Op_Receptionist_updateAccountInfo_run_8418']['__ts'] id = argv['Op_Receptionist_updateAccountInfo_run_8418']['id'] doctor_user_id = argv['Op_Receptionist_updateAccountInfo_run_8418']['doctor_user_id'] sys_user_user_id = argv['Op_Receptionist_updateAccountInfo_run_8418']['sys_user_user_id'] sys_user__ts = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, '__ts') return And((sys_user__ts < now)) def sop0(self, state, argv): now = argv['Op_Receptionist_updateAccountInfo_run_8418']['now'] __ts = argv['Op_Receptionist_updateAccountInfo_run_8418']['__ts'] id = argv['Op_Receptionist_updateAccountInfo_run_8418']['id'] doctor_user_id = argv['Op_Receptionist_updateAccountInfo_run_8418']['doctor_user_id'] sys_user_user_id = argv['Op_Receptionist_updateAccountInfo_run_8418']['sys_user_user_id'] sys_user_person_id = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, 'person_id') sys_user_user_id = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, 'user_id') sys_user_user_name = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, 'user_name') sys_user_user_type = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, 'user_type') sys_user_other_info = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, 'other_info') sys_user_password = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, 'password') sys_user_online = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, 'online') sys_user_login = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, 'login') sys_user_logout = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, 'logout') sys_user_profile_pic = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, 'profile_pic') sys_user_suspend = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, 'suspend') sys_user_other_info = argv['Op_Receptionist_updateAccountInfo_run_8418']['id'] state['TABLE_sys_user'].update({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Receptionist_updateAccountInfo_run_8418']['id']}, 'user_id')}, {'person_id': sys_user_person_id, 'user_id': sys_user_user_id, 'user_name': sys_user_user_name, 'user_type': sys_user_user_type, 'other_info': sys_user_other_info, 'password': sys_user_password, 'online': sys_user_online, 'login': sys_user_login, 'logout': sys_user_logout, 'profile_pic': sys_user_profile_pic, 'suspend': sys_user_suspend, '__ts': now}) return state class Op_Doctor_diagnose_run_8419(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Doctor_diagnose_run_8419', 'newHistoryId')) def cond0(self, state, argv): __ts = argv['Op_Doctor_diagnose_run_8419']['__ts'] newHistoryId = argv['Op_Doctor_diagnose_run_8419']['newHistoryId'] patientId = argv['Op_Doctor_diagnose_run_8419']['patientId'] doctorId = argv['Op_Doctor_diagnose_run_8419']['doctorId'] date = argv['Op_Doctor_diagnose_run_8419']['date'] history = argv['Op_Doctor_diagnose_run_8419']['history'] return (state['TABLE_medical_history'].notNil({'history_id': argv['Op_Doctor_diagnose_run_8419']['newHistoryId']}) == False) def csop0(self, state, argv): now = argv['Op_Doctor_diagnose_run_8419']['now'] __ts = argv['Op_Doctor_diagnose_run_8419']['__ts'] newHistoryId = argv['Op_Doctor_diagnose_run_8419']['newHistoryId'] patientId = argv['Op_Doctor_diagnose_run_8419']['patientId'] doctorId = argv['Op_Doctor_diagnose_run_8419']['doctorId'] date = argv['Op_Doctor_diagnose_run_8419']['date'] history = argv['Op_Doctor_diagnose_run_8419']['history'] medical_history_history_id = argv['Op_Doctor_diagnose_run_8419']['newHistoryId'] medical_history_patient_id = argv['Op_Doctor_diagnose_run_8419']['patientId'] medical_history_doctor_id = argv['Op_Doctor_diagnose_run_8419']['doctorId'] medical_history_date = 1451606400 medical_history_history = StringVal('Took medicine for dengue fever') medical_history__ts = state['TABLE_medical_history'].get({'history_id': medical_history_history_id}, '__ts') return And((medical_history__ts < now)) def sop0(self, state, argv): now = argv['Op_Doctor_diagnose_run_8419']['now'] __ts = argv['Op_Doctor_diagnose_run_8419']['__ts'] newHistoryId = argv['Op_Doctor_diagnose_run_8419']['newHistoryId'] patientId = argv['Op_Doctor_diagnose_run_8419']['patientId'] doctorId = argv['Op_Doctor_diagnose_run_8419']['doctorId'] date = argv['Op_Doctor_diagnose_run_8419']['date'] history = argv['Op_Doctor_diagnose_run_8419']['history'] medical_history_history_id = argv['Op_Doctor_diagnose_run_8419']['newHistoryId'] medical_history_patient_id = argv['Op_Doctor_diagnose_run_8419']['patientId'] medical_history_doctor_id = argv['Op_Doctor_diagnose_run_8419']['doctorId'] medical_history_date = 1451606400 medical_history_history = StringVal('Took medicine for dengue fever') state['TABLE_medical_history'].add({'history_id': medical_history_history_id}, {'patient_id': medical_history_patient_id,'doctor_id': medical_history_doctor_id,'date': medical_history_date,'history': medical_history_history, '__ts': now}) return state class Op_Pharmacist_updateAccountInfo_run_8420(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Pharmacist_updateAccountInfo_run_8420']['__ts'] pharmacistId = argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId'] pharmacist_user_id = argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacist_user_id'] sys_user_user_id = argv['Op_Pharmacist_updateAccountInfo_run_8420']['sys_user_user_id'] return And((state['TABLE_pharmacist'].notNil({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}) == True),(state['TABLE_sys_user'].notNil({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}) == True)) def csop0(self, state, argv): now = argv['Op_Pharmacist_updateAccountInfo_run_8420']['now'] __ts = argv['Op_Pharmacist_updateAccountInfo_run_8420']['__ts'] pharmacistId = argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId'] pharmacist_user_id = argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacist_user_id'] sys_user_user_id = argv['Op_Pharmacist_updateAccountInfo_run_8420']['sys_user_user_id'] sys_user__ts = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, '__ts') return And((sys_user__ts < now)) def sop0(self, state, argv): now = argv['Op_Pharmacist_updateAccountInfo_run_8420']['now'] __ts = argv['Op_Pharmacist_updateAccountInfo_run_8420']['__ts'] pharmacistId = argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId'] pharmacist_user_id = argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacist_user_id'] sys_user_user_id = argv['Op_Pharmacist_updateAccountInfo_run_8420']['sys_user_user_id'] sys_user_person_id = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, 'person_id') sys_user_user_id = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, 'user_id') sys_user_user_name = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, 'user_name') sys_user_user_type = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, 'user_type') sys_user_other_info = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, 'other_info') sys_user_password = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, 'password') sys_user_online = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, 'online') sys_user_login = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, 'login') sys_user_logout = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, 'logout') sys_user_profile_pic = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, 'profile_pic') sys_user_suspend = state['TABLE_sys_user'].get({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, 'suspend') sys_user_other_info = argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId'] state['TABLE_sys_user'].update({'user_id': state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updateAccountInfo_run_8420']['pharmacistId']}, 'user_id')}, {'person_id': sys_user_person_id, 'user_id': sys_user_user_id, 'user_name': sys_user_user_name, 'user_type': sys_user_user_type, 'other_info': sys_user_other_info, 'password': sys_user_password, 'online': sys_user_online, 'login': sys_user_login, 'logout': sys_user_logout, 'profile_pic': sys_user_profile_pic, 'suspend': sys_user_suspend, '__ts': now}) return state class Op_LabAssistant_UrineFullReport_run_8421(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_LabAssistant_UrineFullReport_run_8421', 'newTstId')) def cond0(self, state, argv): __ts = argv['Op_LabAssistant_UrineFullReport_run_8421']['__ts'] newTstId = argv['Op_LabAssistant_UrineFullReport_run_8421']['newTstId'] appId = argv['Op_LabAssistant_UrineFullReport_run_8421']['appId'] appearance = argv['Op_LabAssistant_UrineFullReport_run_8421']['appearance'] sgRefractometer = argv['Op_LabAssistant_UrineFullReport_run_8421']['sgRefractometer'] ph = argv['Op_LabAssistant_UrineFullReport_run_8421']['ph'] protein = argv['Op_LabAssistant_UrineFullReport_run_8421']['protein'] glucose = argv['Op_LabAssistant_UrineFullReport_run_8421']['glucose'] ketoneBodies = argv['Op_LabAssistant_UrineFullReport_run_8421']['ketoneBodies'] bilirubin = argv['Op_LabAssistant_UrineFullReport_run_8421']['bilirubin'] urobilirubin = argv['Op_LabAssistant_UrineFullReport_run_8421']['urobilirubin'] contrifugedDepositsphaseContrastMicroscopy = argv['Op_LabAssistant_UrineFullReport_run_8421']['contrifugedDepositsphaseContrastMicroscopy'] pusCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['pusCells'] redCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['redCells'] epithelialCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['epithelialCells'] casts = argv['Op_LabAssistant_UrineFullReport_run_8421']['casts'] cristals = argv['Op_LabAssistant_UrineFullReport_run_8421']['cristals'] now = argv['Op_LabAssistant_UrineFullReport_run_8421']['now'] return (state['TABLE_UrineFullReport'].notNil({'tst_ur_id': argv['Op_LabAssistant_UrineFullReport_run_8421']['newTstId']}) == False) def csop0(self, state, argv): now = argv['Op_LabAssistant_UrineFullReport_run_8421']['now'] __ts = argv['Op_LabAssistant_UrineFullReport_run_8421']['__ts'] newTstId = argv['Op_LabAssistant_UrineFullReport_run_8421']['newTstId'] appId = argv['Op_LabAssistant_UrineFullReport_run_8421']['appId'] appearance = argv['Op_LabAssistant_UrineFullReport_run_8421']['appearance'] sgRefractometer = argv['Op_LabAssistant_UrineFullReport_run_8421']['sgRefractometer'] ph = argv['Op_LabAssistant_UrineFullReport_run_8421']['ph'] protein = argv['Op_LabAssistant_UrineFullReport_run_8421']['protein'] glucose = argv['Op_LabAssistant_UrineFullReport_run_8421']['glucose'] ketoneBodies = argv['Op_LabAssistant_UrineFullReport_run_8421']['ketoneBodies'] bilirubin = argv['Op_LabAssistant_UrineFullReport_run_8421']['bilirubin'] urobilirubin = argv['Op_LabAssistant_UrineFullReport_run_8421']['urobilirubin'] contrifugedDepositsphaseContrastMicroscopy = argv['Op_LabAssistant_UrineFullReport_run_8421']['contrifugedDepositsphaseContrastMicroscopy'] pusCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['pusCells'] redCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['redCells'] epithelialCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['epithelialCells'] casts = argv['Op_LabAssistant_UrineFullReport_run_8421']['casts'] cristals = argv['Op_LabAssistant_UrineFullReport_run_8421']['cristals'] now = argv['Op_LabAssistant_UrineFullReport_run_8421']['now'] UrineFullReport_tst_ur_id = argv['Op_LabAssistant_UrineFullReport_run_8421']['newTstId'] UrineFullReport_appointment_id = argv['Op_LabAssistant_UrineFullReport_run_8421']['appId'] UrineFullReport_appearance = argv['Op_LabAssistant_UrineFullReport_run_8421']['appearance'] UrineFullReport_sgRefractometer = argv['Op_LabAssistant_UrineFullReport_run_8421']['sgRefractometer'] UrineFullReport_ph = argv['Op_LabAssistant_UrineFullReport_run_8421']['ph'] UrineFullReport_protein = argv['Op_LabAssistant_UrineFullReport_run_8421']['protein'] UrineFullReport_glucose = argv['Op_LabAssistant_UrineFullReport_run_8421']['glucose'] UrineFullReport_ketoneBodies = argv['Op_LabAssistant_UrineFullReport_run_8421']['ketoneBodies'] UrineFullReport_bilirubin = argv['Op_LabAssistant_UrineFullReport_run_8421']['bilirubin'] UrineFullReport_urobilirubin = argv['Op_LabAssistant_UrineFullReport_run_8421']['urobilirubin'] UrineFullReport_contrifugedDepositsphaseContrastMicroscopy = argv['Op_LabAssistant_UrineFullReport_run_8421']['contrifugedDepositsphaseContrastMicroscopy'] UrineFullReport_pusCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['pusCells'] UrineFullReport_redCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['redCells'] UrineFullReport_epithelialCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['epithelialCells'] UrineFullReport_casts = argv['Op_LabAssistant_UrineFullReport_run_8421']['casts'] UrineFullReport_cristals = argv['Op_LabAssistant_UrineFullReport_run_8421']['cristals'] UrineFullReport_date = argv['Op_LabAssistant_UrineFullReport_run_8421']['now'] UrineFullReport__ts = state['TABLE_UrineFullReport'].get({'tst_ur_id': UrineFullReport_tst_ur_id}, '__ts') return And((UrineFullReport__ts < now)) def sop0(self, state, argv): now = argv['Op_LabAssistant_UrineFullReport_run_8421']['now'] __ts = argv['Op_LabAssistant_UrineFullReport_run_8421']['__ts'] newTstId = argv['Op_LabAssistant_UrineFullReport_run_8421']['newTstId'] appId = argv['Op_LabAssistant_UrineFullReport_run_8421']['appId'] appearance = argv['Op_LabAssistant_UrineFullReport_run_8421']['appearance'] sgRefractometer = argv['Op_LabAssistant_UrineFullReport_run_8421']['sgRefractometer'] ph = argv['Op_LabAssistant_UrineFullReport_run_8421']['ph'] protein = argv['Op_LabAssistant_UrineFullReport_run_8421']['protein'] glucose = argv['Op_LabAssistant_UrineFullReport_run_8421']['glucose'] ketoneBodies = argv['Op_LabAssistant_UrineFullReport_run_8421']['ketoneBodies'] bilirubin = argv['Op_LabAssistant_UrineFullReport_run_8421']['bilirubin'] urobilirubin = argv['Op_LabAssistant_UrineFullReport_run_8421']['urobilirubin'] contrifugedDepositsphaseContrastMicroscopy = argv['Op_LabAssistant_UrineFullReport_run_8421']['contrifugedDepositsphaseContrastMicroscopy'] pusCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['pusCells'] redCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['redCells'] epithelialCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['epithelialCells'] casts = argv['Op_LabAssistant_UrineFullReport_run_8421']['casts'] cristals = argv['Op_LabAssistant_UrineFullReport_run_8421']['cristals'] now = argv['Op_LabAssistant_UrineFullReport_run_8421']['now'] UrineFullReport_tst_ur_id = argv['Op_LabAssistant_UrineFullReport_run_8421']['newTstId'] UrineFullReport_appointment_id = argv['Op_LabAssistant_UrineFullReport_run_8421']['appId'] UrineFullReport_appearance = argv['Op_LabAssistant_UrineFullReport_run_8421']['appearance'] UrineFullReport_sgRefractometer = argv['Op_LabAssistant_UrineFullReport_run_8421']['sgRefractometer'] UrineFullReport_ph = argv['Op_LabAssistant_UrineFullReport_run_8421']['ph'] UrineFullReport_protein = argv['Op_LabAssistant_UrineFullReport_run_8421']['protein'] UrineFullReport_glucose = argv['Op_LabAssistant_UrineFullReport_run_8421']['glucose'] UrineFullReport_ketoneBodies = argv['Op_LabAssistant_UrineFullReport_run_8421']['ketoneBodies'] UrineFullReport_bilirubin = argv['Op_LabAssistant_UrineFullReport_run_8421']['bilirubin'] UrineFullReport_urobilirubin = argv['Op_LabAssistant_UrineFullReport_run_8421']['urobilirubin'] UrineFullReport_contrifugedDepositsphaseContrastMicroscopy = argv['Op_LabAssistant_UrineFullReport_run_8421']['contrifugedDepositsphaseContrastMicroscopy'] UrineFullReport_pusCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['pusCells'] UrineFullReport_redCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['redCells'] UrineFullReport_epithelialCells = argv['Op_LabAssistant_UrineFullReport_run_8421']['epithelialCells'] UrineFullReport_casts = argv['Op_LabAssistant_UrineFullReport_run_8421']['casts'] UrineFullReport_cristals = argv['Op_LabAssistant_UrineFullReport_run_8421']['cristals'] UrineFullReport_date = argv['Op_LabAssistant_UrineFullReport_run_8421']['now'] state['TABLE_UrineFullReport'].add({'tst_ur_id': UrineFullReport_tst_ur_id}, {'appointment_id': UrineFullReport_appointment_id,'appearance': UrineFullReport_appearance,'sgRefractometer': UrineFullReport_sgRefractometer,'ph': UrineFullReport_ph,'protein': UrineFullReport_protein,'glucose': UrineFullReport_glucose,'ketoneBodies': UrineFullReport_ketoneBodies,'bilirubin': UrineFullReport_bilirubin,'urobilirubin': UrineFullReport_urobilirubin,'contrifugedDepositsphaseContrastMicroscopy': UrineFullReport_contrifugedDepositsphaseContrastMicroscopy,'pusCells': UrineFullReport_pusCells,'redCells': UrineFullReport_redCells,'epithelialCells': UrineFullReport_epithelialCells,'casts': UrineFullReport_casts,'cristals': UrineFullReport_cristals,'date': UrineFullReport_date, '__ts': now}) return state class Op_Receptionist_cancelAppointment_run_8422(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0), (self.cond1, self.csop1, self.sop1), (self.cond2, self.csop2, self.sop2)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Receptionist_cancelAppointment_run_8422', 'newRefundId')) def cond0(self, state, argv): __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] appointment_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] bill_total = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_total'] now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] appointment_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] bill_total = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_total'] now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] bill_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_bill_id'] return And((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}) == True),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}) == True)),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}) == True)),Not((state['TABLE_bill'].notNil({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}) == True)),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}) == True)),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}) == True)),Not((state['TABLE_bill'].notNil({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}) == True)),Not((state['TABLE_bill'].notNil({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}) == True))) def csop0(self, state, argv): now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] appointment__ts = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, '__ts') return And((appointment__ts < now)) def sop0(self, state, argv): now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] appointment_appointment_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'appointment_id') appointment_date = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'date') appointment_info = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'info') appointment_patient_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'patient_id') appointment_bill_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id') appointment_slmc_reg_no = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'slmc_reg_no') appointment_cancelled = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'cancelled') appointment_cancelled = True state['TABLE_appointment'].update({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, {'appointment_id': appointment_appointment_id, 'date': appointment_date, 'info': appointment_info, 'patient_id': appointment_patient_id, 'bill_id': appointment_bill_id, 'slmc_reg_no': appointment_slmc_reg_no, 'cancelled': appointment_cancelled, '__ts': now}) return state def cond1(self, state, argv): __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] appointment_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] bill_total = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_total'] now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] appointment_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] bill_total = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_total'] now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] bill_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_bill_id'] return And((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}) == True),(state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}) == True),(state['TABLE_bill'].notNil({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}) == True),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}) == True)),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}) == True)),Not((state['TABLE_bill'].notNil({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}) == True)),Not((state['TABLE_bill'].notNil({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}) == True))) def csop1(self, state, argv): now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] appointment_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] bill_total = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_total'] now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] appointment__ts = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, '__ts') refund_refund_id = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] refund_bill_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id') refund_payment_type = StringVal('docApp') refund_reason = StringVal('no_reason') refund_amount = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'total') refund_date = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] refund__ts = state['TABLE_refund'].get({'refund_id': refund_refund_id}, '__ts') return And((appointment__ts < now), (refund__ts < now)) def sop1(self, state, argv): now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] appointment_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] bill_total = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_total'] now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] appointment_appointment_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'appointment_id') appointment_date = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'date') appointment_info = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'info') appointment_patient_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'patient_id') appointment_bill_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id') appointment_slmc_reg_no = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'slmc_reg_no') appointment_cancelled = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'cancelled') appointment_cancelled = True state['TABLE_appointment'].update({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, {'appointment_id': appointment_appointment_id, 'date': appointment_date, 'info': appointment_info, 'patient_id': appointment_patient_id, 'bill_id': appointment_bill_id, 'slmc_reg_no': appointment_slmc_reg_no, 'cancelled': appointment_cancelled, '__ts': now}) refund_refund_id = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] refund_bill_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id') refund_payment_type = StringVal('docApp') refund_reason = StringVal('no_reason') refund_amount = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'total') refund_date = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] state['TABLE_refund'].add({'refund_id': refund_refund_id}, {'bill_id': refund_bill_id,'payment_type': refund_payment_type,'reason': refund_reason,'amount': refund_amount,'date': refund_date, '__ts': now}) return state def cond2(self, state, argv): __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] appointment_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] bill_total = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_total'] now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] bill_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_bill_id'] return And((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}) == True),(state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}) == True),(state['TABLE_bill'].notNil({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}) == True),(state['TABLE_bill'].notNil({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}) == True)) def csop2(self, state, argv): now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] appointment_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] bill_total = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_total'] now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] bill_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_bill_id'] appointment__ts = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, '__ts') refund_refund_id = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] refund_bill_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id') refund_payment_type = StringVal('docApp') refund_reason = StringVal('no_reason') refund_amount = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'total') refund_date = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] refund__ts = state['TABLE_refund'].get({'refund_id': refund_refund_id}, '__ts') bill__ts = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, '__ts') return And((appointment__ts < now), (refund__ts < now), (bill__ts < now)) def sop2(self, state, argv): now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] __ts = argv['Op_Receptionist_cancelAppointment_run_8422']['__ts'] appointmentId = argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId'] appointment_appointment_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_appointment_id'] appointment_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] bill_total = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_total'] now = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] bill_bill_id = argv['Op_Receptionist_cancelAppointment_run_8422']['bill_bill_id'] appointment_appointment_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'appointment_id') appointment_date = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'date') appointment_info = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'info') appointment_patient_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'patient_id') appointment_bill_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id') appointment_slmc_reg_no = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'slmc_reg_no') appointment_cancelled = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'cancelled') appointment_cancelled = True state['TABLE_appointment'].update({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, {'appointment_id': appointment_appointment_id, 'date': appointment_date, 'info': appointment_info, 'patient_id': appointment_patient_id, 'bill_id': appointment_bill_id, 'slmc_reg_no': appointment_slmc_reg_no, 'cancelled': appointment_cancelled, '__ts': now}) refund_refund_id = argv['Op_Receptionist_cancelAppointment_run_8422']['newRefundId'] refund_bill_id = state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id') refund_payment_type = StringVal('docApp') refund_reason = StringVal('no_reason') refund_amount = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'total') refund_date = argv['Op_Receptionist_cancelAppointment_run_8422']['now'] state['TABLE_refund'].add({'refund_id': refund_refund_id}, {'bill_id': refund_bill_id,'payment_type': refund_payment_type,'reason': refund_reason,'amount': refund_amount,'date': refund_date, '__ts': now}) bill_bill_id = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'bill_id') bill_bill_date = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'bill_date') bill_doctor_fee = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'doctor_fee') bill_hospital_fee = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'hospital_fee') bill_pharmacy_fee = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'pharmacy_fee') bill_laboratory_fee = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'laboratory_fee') bill_appointment_fee = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'appointment_fee') bill_vat = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'vat') bill_discount = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'discount') bill_total = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'total') bill_payment_method = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'payment_method') bill_consultant_id = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'consultant_id') bill_patient_id = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'patient_id') bill_refund = state['TABLE_bill'].get({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, 'refund') bill_refund = 1 state['TABLE_bill'].update({'bill_id': state['TABLE_appointment'].get({'appointment_id': argv['Op_Receptionist_cancelAppointment_run_8422']['appointmentId']}, 'bill_id')}, {'bill_id': bill_bill_id, 'bill_date': bill_bill_date, 'doctor_fee': bill_doctor_fee, 'hospital_fee': bill_hospital_fee, 'pharmacy_fee': bill_pharmacy_fee, 'laboratory_fee': bill_laboratory_fee, 'appointment_fee': bill_appointment_fee, 'vat': bill_vat, 'discount': bill_discount, 'total': bill_total, 'payment_method': bill_payment_method, 'consultant_id': bill_consultant_id, 'patient_id': bill_patient_id, 'refund': bill_refund, '__ts': now}) return state class Op_Cashier_makeRefund_run_8423(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Cashier_makeRefund_run_8423']['__ts'] id = argv['Op_Cashier_makeRefund_run_8423']['id'] return True def csop0(self, state, argv): now = argv['Op_Cashier_makeRefund_run_8423']['now'] __ts = argv['Op_Cashier_makeRefund_run_8423']['__ts'] id = argv['Op_Cashier_makeRefund_run_8423']['id'] return And() def sop0(self, state, argv): now = argv['Op_Cashier_makeRefund_run_8423']['now'] __ts = argv['Op_Cashier_makeRefund_run_8423']['__ts'] id = argv['Op_Cashier_makeRefund_run_8423']['id'] state['TABLE_refund'].delete({'refund_id': argv['Op_Cashier_makeRefund_run_8423']['id']}) return state class Op_Cashier_refund_run_8424(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Cashier_refund_run_8424', 'newRefundId')) def cond0(self, state, argv): __ts = argv['Op_Cashier_refund_run_8424']['__ts'] newRefundId = argv['Op_Cashier_refund_run_8424']['newRefundId'] billId = argv['Op_Cashier_refund_run_8424']['billId'] paymentType = argv['Op_Cashier_refund_run_8424']['paymentType'] reason = argv['Op_Cashier_refund_run_8424']['reason'] amount = argv['Op_Cashier_refund_run_8424']['amount'] now = argv['Op_Cashier_refund_run_8424']['now'] return (state['TABLE_refund'].notNil({'refund_id': argv['Op_Cashier_refund_run_8424']['newRefundId']}) == False) def csop0(self, state, argv): now = argv['Op_Cashier_refund_run_8424']['now'] __ts = argv['Op_Cashier_refund_run_8424']['__ts'] newRefundId = argv['Op_Cashier_refund_run_8424']['newRefundId'] billId = argv['Op_Cashier_refund_run_8424']['billId'] paymentType = argv['Op_Cashier_refund_run_8424']['paymentType'] reason = argv['Op_Cashier_refund_run_8424']['reason'] amount = argv['Op_Cashier_refund_run_8424']['amount'] now = argv['Op_Cashier_refund_run_8424']['now'] refund_refund_id = argv['Op_Cashier_refund_run_8424']['newRefundId'] refund_bill_id = argv['Op_Cashier_refund_run_8424']['billId'] refund_payment_type = argv['Op_Cashier_refund_run_8424']['paymentType'] refund_reason = argv['Op_Cashier_refund_run_8424']['reason'] refund_amount = argv['Op_Cashier_refund_run_8424']['amount'] refund_date = argv['Op_Cashier_refund_run_8424']['now'] refund__ts = state['TABLE_refund'].get({'refund_id': refund_refund_id}, '__ts') return And((refund__ts < now)) def sop0(self, state, argv): now = argv['Op_Cashier_refund_run_8424']['now'] __ts = argv['Op_Cashier_refund_run_8424']['__ts'] newRefundId = argv['Op_Cashier_refund_run_8424']['newRefundId'] billId = argv['Op_Cashier_refund_run_8424']['billId'] paymentType = argv['Op_Cashier_refund_run_8424']['paymentType'] reason = argv['Op_Cashier_refund_run_8424']['reason'] amount = argv['Op_Cashier_refund_run_8424']['amount'] now = argv['Op_Cashier_refund_run_8424']['now'] refund_refund_id = argv['Op_Cashier_refund_run_8424']['newRefundId'] refund_bill_id = argv['Op_Cashier_refund_run_8424']['billId'] refund_payment_type = argv['Op_Cashier_refund_run_8424']['paymentType'] refund_reason = argv['Op_Cashier_refund_run_8424']['reason'] refund_amount = argv['Op_Cashier_refund_run_8424']['amount'] refund_date = argv['Op_Cashier_refund_run_8424']['now'] state['TABLE_refund'].add({'refund_id': refund_refund_id}, {'bill_id': refund_bill_id,'payment_type': refund_payment_type,'reason': refund_reason,'amount': refund_amount,'date': refund_date, '__ts': now}) return state class Op_Doctor_allergies_run_8425(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Doctor_allergies_run_8425']['__ts'] patientId = argv['Op_Doctor_allergies_run_8425']['patientId'] patient_drug_allergies_and_reactions = argv['Op_Doctor_allergies_run_8425']['patient_drug_allergies_and_reactions'] allergies = argv['Op_Doctor_allergies_run_8425']['allergies'] patient_patient_id = argv['Op_Doctor_allergies_run_8425']['patient_patient_id'] return And((state['TABLE_patient'].notNil({'patient_id': argv['Op_Doctor_allergies_run_8425']['patientId']}) == True),(state['TABLE_patient'].notNil({'patient_id': argv['Op_Doctor_allergies_run_8425']['patientId']}) == True)) def csop0(self, state, argv): now = argv['Op_Doctor_allergies_run_8425']['now'] __ts = argv['Op_Doctor_allergies_run_8425']['__ts'] patientId = argv['Op_Doctor_allergies_run_8425']['patientId'] patient_drug_allergies_and_reactions = argv['Op_Doctor_allergies_run_8425']['patient_drug_allergies_and_reactions'] allergies = argv['Op_Doctor_allergies_run_8425']['allergies'] patient_patient_id = argv['Op_Doctor_allergies_run_8425']['patient_patient_id'] patient__ts = state['TABLE_patient'].get({'patient_id': argv['Op_Doctor_allergies_run_8425']['patientId']}, '__ts') return And((patient__ts < now)) def sop0(self, state, argv): now = argv['Op_Doctor_allergies_run_8425']['now'] __ts = argv['Op_Doctor_allergies_run_8425']['__ts'] patientId = argv['Op_Doctor_allergies_run_8425']['patientId'] patient_drug_allergies_and_reactions = argv['Op_Doctor_allergies_run_8425']['patient_drug_allergies_and_reactions'] allergies = argv['Op_Doctor_allergies_run_8425']['allergies'] patient_patient_id = argv['Op_Doctor_allergies_run_8425']['patient_patient_id'] patient_patient_id = state['TABLE_patient'].get({'patient_id': argv['Op_Doctor_allergies_run_8425']['patientId']}, 'patient_id') patient_person_id = state['TABLE_patient'].get({'patient_id': argv['Op_Doctor_allergies_run_8425']['patientId']}, 'person_id') patient_drug_allergies_and_reactions = state['TABLE_patient'].get({'patient_id': argv['Op_Doctor_allergies_run_8425']['patientId']}, 'drug_allergies_and_reactions') patient_drug_allergies_and_reactions = ((state['TABLE_patient'].get({'patient_id': argv['Op_Doctor_allergies_run_8425']['patientId']}, 'drug_allergies_and_reactions'))+(StringVal(',')))+(argv['Op_Doctor_allergies_run_8425']['allergies']) state['TABLE_patient'].update({'patient_id': argv['Op_Doctor_allergies_run_8425']['patientId']}, {'patient_id': patient_patient_id, 'person_id': patient_person_id, 'drug_allergies_and_reactions': patient_drug_allergies_and_reactions, '__ts': now}) return state class Op_Admin_createNewUser_run_8426(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0), (self.cond1, self.csop1, self.sop1), (self.cond2, self.csop2, self.sop2), (self.cond3, self.csop3, self.sop3), (self.cond4, self.csop4, self.sop4), (self.cond5, self.csop5, self.sop5), (self.cond6, self.csop6, self.sop6), (self.cond7, self.csop7, self.sop7), (self.cond8, self.csop8, self.sop8)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Admin_createNewUser_run_8426', 'newPersonId'), AxiomUniqueArgument('Op_Admin_createNewUser_run_8426', 'newUserId'), AxiomUniqueArgument('Op_Admin_createNewUser_run_8426', 'newLabAssistantId'), AxiomUniqueArgument('Op_Admin_createNewUser_run_8426', 'newPharmacistId'), AxiomUniqueArgument('Op_Admin_createNewUser_run_8426', 'newSlmcReg')) def cond0(self, state, argv): __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] return And((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')),(argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant')),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')))) def csop0(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] person__ts = state['TABLE_person'].get({'person_id': person_person_id}, '__ts') return And((person__ts < now)) def sop0(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] state['TABLE_person'].add({'person_id': person_person_id}, {'first_name': person_first_name,'last_name': person_last_name,'nic': person_nic,'mobile': person_mobile, '__ts': now}) return state def cond1(self, state, argv): __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] return And((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')),(argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant')),(argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist')),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')))) def csop1(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] person__ts = state['TABLE_person'].get({'person_id': person_person_id}, '__ts') return And((person__ts < now)) def sop1(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] state['TABLE_person'].add({'person_id': person_person_id}, {'first_name': person_first_name,'last_name': person_last_name,'nic': person_nic,'mobile': person_mobile, '__ts': now}) return state def cond2(self, state, argv): __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] return And((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')))) def csop2(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] person__ts = state['TABLE_person'].get({'person_id': person_person_id}, '__ts') return And((person__ts < now)) def sop2(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] state['TABLE_person'].add({'person_id': person_person_id}, {'first_name': person_first_name,'last_name': person_last_name,'nic': person_nic,'mobile': person_mobile, '__ts': now}) return state def cond3(self, state, argv): __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] return And((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')),(argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant')),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')))) def csop3(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] person__ts = state['TABLE_person'].get({'person_id': person_person_id}, '__ts') sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') sys_user__ts = state['TABLE_sys_user'].get({'user_id': sys_user_user_id}, '__ts') return And((person__ts < now), (sys_user__ts < now)) def sop3(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] state['TABLE_person'].add({'person_id': person_person_id}, {'first_name': person_first_name,'last_name': person_last_name,'nic': person_nic,'mobile': person_mobile, '__ts': now}) sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') state['TABLE_sys_user'].add({'user_id': sys_user_user_id}, {'person_id': sys_user_person_id,'user_name': sys_user_user_name,'user_type': sys_user_user_type,'password': sys_user_password, '__ts': now}) return state def cond4(self, state, argv): __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] return And((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')),(argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant')),(argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist')),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')))) def csop4(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] person__ts = state['TABLE_person'].get({'person_id': person_person_id}, '__ts') sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') sys_user__ts = state['TABLE_sys_user'].get({'user_id': sys_user_user_id}, '__ts') return And((person__ts < now), (sys_user__ts < now)) def sop4(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] state['TABLE_person'].add({'person_id': person_person_id}, {'first_name': person_first_name,'last_name': person_last_name,'nic': person_nic,'mobile': person_mobile, '__ts': now}) sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') state['TABLE_sys_user'].add({'user_id': sys_user_user_id}, {'person_id': sys_user_person_id,'user_name': sys_user_user_name,'user_type': sys_user_user_type,'password': sys_user_password, '__ts': now}) return state def cond5(self, state, argv): __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] return And((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist'))),Not((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')))) def csop5(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] person__ts = state['TABLE_person'].get({'person_id': person_person_id}, '__ts') sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') sys_user__ts = state['TABLE_sys_user'].get({'user_id': sys_user_user_id}, '__ts') return And((person__ts < now), (sys_user__ts < now)) def sop5(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] state['TABLE_person'].add({'person_id': person_person_id}, {'first_name': person_first_name,'last_name': person_last_name,'nic': person_nic,'mobile': person_mobile, '__ts': now}) sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') state['TABLE_sys_user'].add({'user_id': sys_user_user_id}, {'person_id': sys_user_person_id,'user_name': sys_user_user_name,'user_type': sys_user_user_type,'password': sys_user_password, '__ts': now}) return state def cond6(self, state, argv): __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] return And((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')),(argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant'))) def csop6(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] person__ts = state['TABLE_person'].get({'person_id': person_person_id}, '__ts') sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') sys_user__ts = state['TABLE_sys_user'].get({'user_id': sys_user_user_id}, '__ts') lab_assistant_lab_assistant_id = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] lab_assistant_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] lab_assistant__ts = state['TABLE_lab_assistant'].get({'lab_assistant_id': lab_assistant_lab_assistant_id}, '__ts') return And((person__ts < now), (sys_user__ts < now), (lab_assistant__ts < now)) def sop6(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newLabAssistantId = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] state['TABLE_person'].add({'person_id': person_person_id}, {'first_name': person_first_name,'last_name': person_last_name,'nic': person_nic,'mobile': person_mobile, '__ts': now}) sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') state['TABLE_sys_user'].add({'user_id': sys_user_user_id}, {'person_id': sys_user_person_id,'user_name': sys_user_user_name,'user_type': sys_user_user_type,'password': sys_user_password, '__ts': now}) lab_assistant_lab_assistant_id = argv['Op_Admin_createNewUser_run_8426']['newLabAssistantId'] lab_assistant_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] state['TABLE_lab_assistant'].add({'lab_assistant_id': lab_assistant_lab_assistant_id}, {'user_id': lab_assistant_user_id, '__ts': now}) return state def cond7(self, state, argv): __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] return And((argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')),(argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('lab_assistant')),(argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('pharmacist'))) def csop7(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] person__ts = state['TABLE_person'].get({'person_id': person_person_id}, '__ts') sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') sys_user__ts = state['TABLE_sys_user'].get({'user_id': sys_user_user_id}, '__ts') pharmacist_pharmacist_id = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] pharmacist_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] pharmacist__ts = state['TABLE_pharmacist'].get({'pharmacist_id': pharmacist_pharmacist_id}, '__ts') return And((person__ts < now), (sys_user__ts < now), (pharmacist__ts < now)) def sop7(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newPharmacistId = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] state['TABLE_person'].add({'person_id': person_person_id}, {'first_name': person_first_name,'last_name': person_last_name,'nic': person_nic,'mobile': person_mobile, '__ts': now}) sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') state['TABLE_sys_user'].add({'user_id': sys_user_user_id}, {'person_id': sys_user_person_id,'user_name': sys_user_user_name,'user_type': sys_user_user_type,'password': sys_user_password, '__ts': now}) pharmacist_pharmacist_id = argv['Op_Admin_createNewUser_run_8426']['newPharmacistId'] pharmacist_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] state['TABLE_pharmacist'].add({'pharmacist_id': pharmacist_pharmacist_id}, {'user_id': pharmacist_user_id, '__ts': now}) return state def cond8(self, state, argv): __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] return (argv['Op_Admin_createNewUser_run_8426']['userType'])==(StringVal('doctor')) def csop8(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] person__ts = state['TABLE_person'].get({'person_id': person_person_id}, '__ts') sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') sys_user__ts = state['TABLE_sys_user'].get({'user_id': sys_user_user_id}, '__ts') doctor_slmc_reg_no = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] doctor_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] doctor__ts = state['TABLE_doctor'].get({'slmc_reg_no': doctor_slmc_reg_no}, '__ts') return And((person__ts < now), (sys_user__ts < now), (doctor__ts < now)) def sop8(self, state, argv): now = argv['Op_Admin_createNewUser_run_8426']['now'] __ts = argv['Op_Admin_createNewUser_run_8426']['__ts'] newPersonId = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] firstName = argv['Op_Admin_createNewUser_run_8426']['firstName'] lastName = argv['Op_Admin_createNewUser_run_8426']['lastName'] nic = argv['Op_Admin_createNewUser_run_8426']['nic'] mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] newUserId = argv['Op_Admin_createNewUser_run_8426']['newUserId'] userName = argv['Op_Admin_createNewUser_run_8426']['userName'] userType = argv['Op_Admin_createNewUser_run_8426']['userType'] newSlmcReg = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] person_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] person_first_name = argv['Op_Admin_createNewUser_run_8426']['firstName'] person_last_name = argv['Op_Admin_createNewUser_run_8426']['lastName'] person_nic = argv['Op_Admin_createNewUser_run_8426']['nic'] person_mobile = argv['Op_Admin_createNewUser_run_8426']['mobile'] state['TABLE_person'].add({'person_id': person_person_id}, {'first_name': person_first_name,'last_name': person_last_name,'nic': person_nic,'mobile': person_mobile, '__ts': now}) sys_user_person_id = argv['Op_Admin_createNewUser_run_8426']['newPersonId'] sys_user_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] sys_user_user_name = argv['Op_Admin_createNewUser_run_8426']['userName'] sys_user_user_type = argv['Op_Admin_createNewUser_run_8426']['userType'] sys_user_password = StringVal('1234') state['TABLE_sys_user'].add({'user_id': sys_user_user_id}, {'person_id': sys_user_person_id,'user_name': sys_user_user_name,'user_type': sys_user_user_type,'password': sys_user_password,'suspend':0, '__ts': now}) doctor_slmc_reg_no = argv['Op_Admin_createNewUser_run_8426']['newSlmcReg'] doctor_user_id = argv['Op_Admin_createNewUser_run_8426']['newUserId'] state['TABLE_doctor'].add({'slmc_reg_no': doctor_slmc_reg_no}, {'user_id': doctor_user_id, '__ts': now}) return state class Op_Pharmacist_bill_run_8427(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Pharmacist_bill_run_8427']['__ts'] id = argv['Op_Pharmacist_bill_run_8427']['id'] tmp_bill_tmp_bill_id = argv['Op_Pharmacist_bill_run_8427']['tmp_bill_tmp_bill_id'] return And((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}) == True),(state['TABLE_tmp_bill'].notNil({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}) == True)) def csop0(self, state, argv): now = argv['Op_Pharmacist_bill_run_8427']['now'] __ts = argv['Op_Pharmacist_bill_run_8427']['__ts'] id = argv['Op_Pharmacist_bill_run_8427']['id'] tmp_bill_tmp_bill_id = argv['Op_Pharmacist_bill_run_8427']['tmp_bill_tmp_bill_id'] tmp_bill__ts = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, '__ts') return And((tmp_bill__ts < now)) def sop0(self, state, argv): now = argv['Op_Pharmacist_bill_run_8427']['now'] __ts = argv['Op_Pharmacist_bill_run_8427']['__ts'] id = argv['Op_Pharmacist_bill_run_8427']['id'] tmp_bill_tmp_bill_id = argv['Op_Pharmacist_bill_run_8427']['tmp_bill_tmp_bill_id'] tmp_bill_tmp_bill_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, 'tmp_bill_id') tmp_bill_doctor_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, 'doctor_fee') tmp_bill_hospital_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, 'hospital_fee') tmp_bill_pharmacy_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, 'pharmacy_fee') tmp_bill_laboratory_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, 'laboratory_fee') tmp_bill_appointment_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, 'appointment_fee') tmp_bill_vat = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, 'vat') tmp_bill_discount = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, 'discount') tmp_bill_consultant_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, 'consultant_id') tmp_bill_patient_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, 'patient_id') tmp_bill_laboratory_fee = 100 state['TABLE_tmp_bill'].update({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Pharmacist_bill_run_8427']['id']}, 'tmp_bill_id')}, {'tmp_bill_id': tmp_bill_tmp_bill_id, 'doctor_fee': tmp_bill_doctor_fee, 'hospital_fee': tmp_bill_hospital_fee, 'pharmacy_fee': tmp_bill_pharmacy_fee, 'laboratory_fee': tmp_bill_laboratory_fee, 'appointment_fee': tmp_bill_appointment_fee, 'vat': tmp_bill_vat, 'discount': tmp_bill_discount, 'consultant_id': tmp_bill_consultant_id, 'patient_id': tmp_bill_patient_id, '__ts': now}) return state class Op_Receptionist_updatePatientInfo_run_8428(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Receptionist_updatePatientInfo_run_8428']['__ts'] patientId = argv['Op_Receptionist_updatePatientInfo_run_8428']['patientId'] info = argv['Op_Receptionist_updatePatientInfo_run_8428']['info'] patient_patient_id = argv['Op_Receptionist_updatePatientInfo_run_8428']['patient_patient_id'] return And((state['TABLE_patient'].notNil({'patient_id': argv['Op_Receptionist_updatePatientInfo_run_8428']['patientId']}) == True),(state['TABLE_patient'].notNil({'patient_id': argv['Op_Receptionist_updatePatientInfo_run_8428']['patientId']}) == True)) def csop0(self, state, argv): now = argv['Op_Receptionist_updatePatientInfo_run_8428']['now'] __ts = argv['Op_Receptionist_updatePatientInfo_run_8428']['__ts'] patientId = argv['Op_Receptionist_updatePatientInfo_run_8428']['patientId'] info = argv['Op_Receptionist_updatePatientInfo_run_8428']['info'] patient_patient_id = argv['Op_Receptionist_updatePatientInfo_run_8428']['patient_patient_id'] patient__ts = state['TABLE_patient'].get({'patient_id': argv['Op_Receptionist_updatePatientInfo_run_8428']['patientId']}, '__ts') return And((patient__ts < now)) def sop0(self, state, argv): now = argv['Op_Receptionist_updatePatientInfo_run_8428']['now'] __ts = argv['Op_Receptionist_updatePatientInfo_run_8428']['__ts'] patientId = argv['Op_Receptionist_updatePatientInfo_run_8428']['patientId'] info = argv['Op_Receptionist_updatePatientInfo_run_8428']['info'] patient_patient_id = argv['Op_Receptionist_updatePatientInfo_run_8428']['patient_patient_id'] patient_patient_id = state['TABLE_patient'].get({'patient_id': argv['Op_Receptionist_updatePatientInfo_run_8428']['patientId']}, 'patient_id') patient_person_id = state['TABLE_patient'].get({'patient_id': argv['Op_Receptionist_updatePatientInfo_run_8428']['patientId']}, 'person_id') patient_drug_allergies_and_reactions = state['TABLE_patient'].get({'patient_id': argv['Op_Receptionist_updatePatientInfo_run_8428']['patientId']}, 'drug_allergies_and_reactions') patient_drug_allergies_and_reactions = argv['Op_Receptionist_updatePatientInfo_run_8428']['info'] state['TABLE_patient'].update({'patient_id': argv['Op_Receptionist_updatePatientInfo_run_8428']['patientId']}, {'patient_id': patient_patient_id, 'person_id': patient_person_id, 'drug_allergies_and_reactions': patient_drug_allergies_and_reactions, '__ts': now}) return state class Op_Doctor_updateDoctorInfo_run_8429(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Doctor_updateDoctorInfo_run_8429']['__ts'] id = argv['Op_Doctor_updateDoctorInfo_run_8429']['id'] doctor_slmc_reg_no = argv['Op_Doctor_updateDoctorInfo_run_8429']['doctor_slmc_reg_no'] return (state['TABLE_doctor'].notNil({'slmc_reg_no': argv['Op_Doctor_updateDoctorInfo_run_8429']['id']}) == True) def csop0(self, state, argv): now = argv['Op_Doctor_updateDoctorInfo_run_8429']['now'] __ts = argv['Op_Doctor_updateDoctorInfo_run_8429']['__ts'] id = argv['Op_Doctor_updateDoctorInfo_run_8429']['id'] doctor_slmc_reg_no = argv['Op_Doctor_updateDoctorInfo_run_8429']['doctor_slmc_reg_no'] doctor__ts = state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateDoctorInfo_run_8429']['id']}, '__ts') return And((doctor__ts < now)) def sop0(self, state, argv): now = argv['Op_Doctor_updateDoctorInfo_run_8429']['now'] __ts = argv['Op_Doctor_updateDoctorInfo_run_8429']['__ts'] id = argv['Op_Doctor_updateDoctorInfo_run_8429']['id'] doctor_slmc_reg_no = argv['Op_Doctor_updateDoctorInfo_run_8429']['doctor_slmc_reg_no'] doctor_slmc_reg_no = state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateDoctorInfo_run_8429']['id']}, 'slmc_reg_no') doctor_user_id = state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateDoctorInfo_run_8429']['id']}, 'user_id') doctor_education = state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateDoctorInfo_run_8429']['id']}, 'education') doctor_training = state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateDoctorInfo_run_8429']['id']}, 'training') doctor_experienced_areas = state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateDoctorInfo_run_8429']['id']}, 'experienced_areas') doctor_experience = state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateDoctorInfo_run_8429']['id']}, 'experience') doctor_achievements = state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateDoctorInfo_run_8429']['id']}, 'achievements') doctor_channelling_fee = state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateDoctorInfo_run_8429']['id']}, 'channelling_fee') doctor_achievements = argv['Op_Doctor_updateDoctorInfo_run_8429']['id'] state['TABLE_doctor'].update({'slmc_reg_no': argv['Op_Doctor_updateDoctorInfo_run_8429']['id']}, {'slmc_reg_no': doctor_slmc_reg_no, 'user_id': doctor_user_id, 'education': doctor_education, 'training': doctor_training, 'experienced_areas': doctor_experienced_areas, 'experience': doctor_experience, 'achievements': doctor_achievements, 'channelling_fee': doctor_channelling_fee, '__ts': now}) return state class Op_Receptionist_updateProfileInfo_run_8430(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Receptionist_updateProfileInfo_run_8430']['__ts'] userId = argv['Op_Receptionist_updateProfileInfo_run_8430']['userId'] address = argv['Op_Receptionist_updateProfileInfo_run_8430']['address'] sys_user_person_id = argv['Op_Receptionist_updateProfileInfo_run_8430']['sys_user_person_id'] person_person_id = argv['Op_Receptionist_updateProfileInfo_run_8430']['person_person_id'] return And((state['TABLE_sys_user'].notNil({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}) == True),(state['TABLE_person'].notNil({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}) == True)) def csop0(self, state, argv): now = argv['Op_Receptionist_updateProfileInfo_run_8430']['now'] __ts = argv['Op_Receptionist_updateProfileInfo_run_8430']['__ts'] userId = argv['Op_Receptionist_updateProfileInfo_run_8430']['userId'] address = argv['Op_Receptionist_updateProfileInfo_run_8430']['address'] sys_user_person_id = argv['Op_Receptionist_updateProfileInfo_run_8430']['sys_user_person_id'] person_person_id = argv['Op_Receptionist_updateProfileInfo_run_8430']['person_person_id'] person__ts = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, '__ts') return And((person__ts < now)) def sop0(self, state, argv): now = argv['Op_Receptionist_updateProfileInfo_run_8430']['now'] __ts = argv['Op_Receptionist_updateProfileInfo_run_8430']['__ts'] userId = argv['Op_Receptionist_updateProfileInfo_run_8430']['userId'] address = argv['Op_Receptionist_updateProfileInfo_run_8430']['address'] sys_user_person_id = argv['Op_Receptionist_updateProfileInfo_run_8430']['sys_user_person_id'] person_person_id = argv['Op_Receptionist_updateProfileInfo_run_8430']['person_person_id'] person_person_id = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'person_id') person_user_id = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'user_id') person_nic = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'nic') person_gender = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'gender') person_date_of_birth = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'date_of_birth') person_address = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'address') person_mobile = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'mobile') person_first_name = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'first_name') person_last_name = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'last_name') person_email = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'email') person_nationality = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'nationality') person_religion = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, 'religion') person_address = argv['Op_Receptionist_updateProfileInfo_run_8430']['address'] state['TABLE_person'].update({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Receptionist_updateProfileInfo_run_8430']['userId']}, 'person_id')}, {'person_id': person_person_id, 'user_id': person_user_id, 'nic': person_nic, 'gender': person_gender, 'date_of_birth': person_date_of_birth, 'address': person_address, 'mobile': person_mobile, 'first_name': person_first_name, 'last_name': person_last_name, 'email': person_email, 'nationality': person_nationality, 'religion': person_religion, '__ts': now}) return state class Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431', 'newTstId')) def cond0(self, state, argv): __ts = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['__ts'] newTstId = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['newTstId'] appId = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['appId'] cpkTotal = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['cpkTotal'] now = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['now'] return (state['TABLE_SeriumCreatinePhosphokinaseTotal'].notNil({'tst_SCPT_id': argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['newTstId']}) == False) def csop0(self, state, argv): now = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['now'] __ts = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['__ts'] newTstId = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['newTstId'] appId = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['appId'] cpkTotal = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['cpkTotal'] now = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['now'] SeriumCreatinePhosphokinaseTotal_tst_SCPT_id = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['newTstId'] SeriumCreatinePhosphokinaseTotal_appointment_id = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['appId'] SeriumCreatinePhosphokinaseTotal_cpkTotal = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['cpkTotal'] SeriumCreatinePhosphokinaseTotal_date = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['now'] SeriumCreatinePhosphokinaseTotal__ts = state['TABLE_SeriumCreatinePhosphokinaseTotal'].get({'tst_SCPT_id': SeriumCreatinePhosphokinaseTotal_tst_SCPT_id}, '__ts') return And((SeriumCreatinePhosphokinaseTotal__ts < now)) def sop0(self, state, argv): now = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['now'] __ts = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['__ts'] newTstId = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['newTstId'] appId = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['appId'] cpkTotal = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['cpkTotal'] now = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['now'] SeriumCreatinePhosphokinaseTotal_tst_SCPT_id = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['newTstId'] SeriumCreatinePhosphokinaseTotal_appointment_id = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['appId'] SeriumCreatinePhosphokinaseTotal_cpkTotal = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['cpkTotal'] SeriumCreatinePhosphokinaseTotal_date = argv['Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431']['now'] state['TABLE_SeriumCreatinePhosphokinaseTotal'].add({'tst_SCPT_id': SeriumCreatinePhosphokinaseTotal_tst_SCPT_id}, {'appointment_id': SeriumCreatinePhosphokinaseTotal_appointment_id,'cpkTotal': SeriumCreatinePhosphokinaseTotal_cpkTotal,'date': SeriumCreatinePhosphokinaseTotal_date, '__ts': now}) return state class Op_Cashier_updateAccountInfo_run_8432(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Cashier_updateAccountInfo_run_8432']['__ts'] id = argv['Op_Cashier_updateAccountInfo_run_8432']['id'] sys_user_user_id = argv['Op_Cashier_updateAccountInfo_run_8432']['sys_user_user_id'] return (state['TABLE_sys_user'].notNil({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}) == True) def csop0(self, state, argv): now = argv['Op_Cashier_updateAccountInfo_run_8432']['now'] __ts = argv['Op_Cashier_updateAccountInfo_run_8432']['__ts'] id = argv['Op_Cashier_updateAccountInfo_run_8432']['id'] sys_user_user_id = argv['Op_Cashier_updateAccountInfo_run_8432']['sys_user_user_id'] sys_user__ts = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, '__ts') return And((sys_user__ts < now)) def sop0(self, state, argv): now = argv['Op_Cashier_updateAccountInfo_run_8432']['now'] __ts = argv['Op_Cashier_updateAccountInfo_run_8432']['__ts'] id = argv['Op_Cashier_updateAccountInfo_run_8432']['id'] sys_user_user_id = argv['Op_Cashier_updateAccountInfo_run_8432']['sys_user_user_id'] sys_user_person_id = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, 'person_id') sys_user_user_id = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, 'user_id') sys_user_user_name = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, 'user_name') sys_user_user_type = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, 'user_type') sys_user_other_info = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, 'other_info') sys_user_password = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, 'password') sys_user_online = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, 'online') sys_user_login = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, 'login') sys_user_logout = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, 'logout') sys_user_profile_pic = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, 'profile_pic') sys_user_suspend = state['TABLE_sys_user'].get({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, 'suspend') sys_user_other_info = argv['Op_Cashier_updateAccountInfo_run_8432']['id'] state['TABLE_sys_user'].update({'user_id': argv['Op_Cashier_updateAccountInfo_run_8432']['id']}, {'person_id': sys_user_person_id, 'user_id': sys_user_user_id, 'user_name': sys_user_user_name, 'user_type': sys_user_user_type, 'other_info': sys_user_other_info, 'password': sys_user_password, 'online': sys_user_online, 'login': sys_user_login, 'logout': sys_user_logout, 'profile_pic': sys_user_profile_pic, 'suspend': sys_user_suspend, '__ts': now}) return state class Op_Admin_suspendUser_run_8433(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Admin_suspendUser_run_8433']['__ts'] id = argv['Op_Admin_suspendUser_run_8433']['id'] sys_user_user_id = argv['Op_Admin_suspendUser_run_8433']['sys_user_user_id'] return (state['TABLE_sys_user'].notNil({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}) == True) def csop0(self, state, argv): now = argv['Op_Admin_suspendUser_run_8433']['now'] __ts = argv['Op_Admin_suspendUser_run_8433']['__ts'] id = argv['Op_Admin_suspendUser_run_8433']['id'] sys_user_user_id = argv['Op_Admin_suspendUser_run_8433']['sys_user_user_id'] sys_user__ts = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, '__ts') return And((sys_user__ts < now)) def sop0(self, state, argv): now = argv['Op_Admin_suspendUser_run_8433']['now'] __ts = argv['Op_Admin_suspendUser_run_8433']['__ts'] id = argv['Op_Admin_suspendUser_run_8433']['id'] sys_user_user_id = argv['Op_Admin_suspendUser_run_8433']['sys_user_user_id'] sys_user_person_id = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, 'person_id') sys_user_user_id = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, 'user_id') sys_user_user_name = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, 'user_name') sys_user_user_type = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, 'user_type') sys_user_other_info = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, 'other_info') sys_user_password = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, 'password') sys_user_online = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, 'online') sys_user_login = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, 'login') sys_user_logout = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, 'logout') sys_user_profile_pic = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, 'profile_pic') sys_user_suspend = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, 'suspend') sys_user_suspend = 1 state['TABLE_sys_user'].update({'user_id': argv['Op_Admin_suspendUser_run_8433']['id']}, {'person_id': sys_user_person_id, 'user_id': sys_user_user_id, 'user_name': sys_user_user_name, 'user_type': sys_user_user_type, 'other_info': sys_user_other_info, 'password': sys_user_password, 'online': sys_user_online, 'login': sys_user_login, 'logout': sys_user_logout, 'profile_pic': sys_user_profile_pic, 'suspend': sys_user_suspend, '__ts': now}) return state class Op_Doctor_updateProfileInfo_run_8434(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Doctor_updateProfileInfo_run_8434']['__ts'] id = argv['Op_Doctor_updateProfileInfo_run_8434']['id'] doctor_user_id = argv['Op_Doctor_updateProfileInfo_run_8434']['doctor_user_id'] sys_user_person_id = argv['Op_Doctor_updateProfileInfo_run_8434']['sys_user_person_id'] person_person_id = argv['Op_Doctor_updateProfileInfo_run_8434']['person_person_id'] return And((state['TABLE_doctor'].notNil({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}) == True),(state['TABLE_sys_user'].notNil({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}) == True),(state['TABLE_person'].notNil({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}) == True)) def csop0(self, state, argv): now = argv['Op_Doctor_updateProfileInfo_run_8434']['now'] __ts = argv['Op_Doctor_updateProfileInfo_run_8434']['__ts'] id = argv['Op_Doctor_updateProfileInfo_run_8434']['id'] doctor_user_id = argv['Op_Doctor_updateProfileInfo_run_8434']['doctor_user_id'] sys_user_person_id = argv['Op_Doctor_updateProfileInfo_run_8434']['sys_user_person_id'] person_person_id = argv['Op_Doctor_updateProfileInfo_run_8434']['person_person_id'] person__ts = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, '__ts') return And((person__ts < now)) def sop0(self, state, argv): now = argv['Op_Doctor_updateProfileInfo_run_8434']['now'] __ts = argv['Op_Doctor_updateProfileInfo_run_8434']['__ts'] id = argv['Op_Doctor_updateProfileInfo_run_8434']['id'] doctor_user_id = argv['Op_Doctor_updateProfileInfo_run_8434']['doctor_user_id'] sys_user_person_id = argv['Op_Doctor_updateProfileInfo_run_8434']['sys_user_person_id'] person_person_id = argv['Op_Doctor_updateProfileInfo_run_8434']['person_person_id'] person_person_id = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'person_id') person_user_id = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'user_id') person_nic = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'nic') person_gender = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'gender') person_date_of_birth = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'date_of_birth') person_address = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'address') person_mobile = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'mobile') person_first_name = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'first_name') person_last_name = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'last_name') person_email = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'email') person_nationality = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'nationality') person_religion = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, 'religion') person_address = argv['Op_Doctor_updateProfileInfo_run_8434']['id'] state['TABLE_person'].update({'person_id': state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateProfileInfo_run_8434']['id']}, 'user_id')}, 'person_id')}, {'person_id': person_person_id, 'user_id': person_user_id, 'nic': person_nic, 'gender': person_gender, 'date_of_birth': person_date_of_birth, 'address': person_address, 'mobile': person_mobile, 'first_name': person_first_name, 'last_name': person_last_name, 'email': person_email, 'nationality': person_nationality, 'religion': person_religion, '__ts': now}) return state class Op_Pharmacist_updateProfileInfo_run_8435(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Pharmacist_updateProfileInfo_run_8435']['__ts'] id = argv['Op_Pharmacist_updateProfileInfo_run_8435']['id'] address = argv['Op_Pharmacist_updateProfileInfo_run_8435']['address'] sys_user_person_id = argv['Op_Pharmacist_updateProfileInfo_run_8435']['sys_user_person_id'] person_person_id = argv['Op_Pharmacist_updateProfileInfo_run_8435']['person_person_id'] return And((state['TABLE_sys_user'].notNil({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}) == True),(state['TABLE_person'].notNil({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}) == True)) def csop0(self, state, argv): now = argv['Op_Pharmacist_updateProfileInfo_run_8435']['now'] __ts = argv['Op_Pharmacist_updateProfileInfo_run_8435']['__ts'] id = argv['Op_Pharmacist_updateProfileInfo_run_8435']['id'] address = argv['Op_Pharmacist_updateProfileInfo_run_8435']['address'] sys_user_person_id = argv['Op_Pharmacist_updateProfileInfo_run_8435']['sys_user_person_id'] person_person_id = argv['Op_Pharmacist_updateProfileInfo_run_8435']['person_person_id'] person__ts = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, '__ts') return And((person__ts < now)) def sop0(self, state, argv): now = argv['Op_Pharmacist_updateProfileInfo_run_8435']['now'] __ts = argv['Op_Pharmacist_updateProfileInfo_run_8435']['__ts'] id = argv['Op_Pharmacist_updateProfileInfo_run_8435']['id'] address = argv['Op_Pharmacist_updateProfileInfo_run_8435']['address'] sys_user_person_id = argv['Op_Pharmacist_updateProfileInfo_run_8435']['sys_user_person_id'] person_person_id = argv['Op_Pharmacist_updateProfileInfo_run_8435']['person_person_id'] person_person_id = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'person_id') person_user_id = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'user_id') person_nic = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'nic') person_gender = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'gender') person_date_of_birth = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'date_of_birth') person_address = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'address') person_mobile = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'mobile') person_first_name = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'first_name') person_last_name = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'last_name') person_email = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'email') person_nationality = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'nationality') person_religion = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, 'religion') person_address = argv['Op_Pharmacist_updateProfileInfo_run_8435']['address'] state['TABLE_person'].update({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Pharmacist_updateProfileInfo_run_8435']['id']}, 'person_id')}, {'person_id': person_person_id, 'user_id': person_user_id, 'nic': person_nic, 'gender': person_gender, 'date_of_birth': person_date_of_birth, 'address': person_address, 'mobile': person_mobile, 'first_name': person_first_name, 'last_name': person_last_name, 'email': person_email, 'nationality': person_nationality, 'religion': person_religion, '__ts': now}) return state class Op_Doctor_bill_run_8436(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Doctor_bill_run_8436']['__ts'] id = argv['Op_Doctor_bill_run_8436']['id'] tmp_bill_tmp_bill_id = argv['Op_Doctor_bill_run_8436']['tmp_bill_tmp_bill_id'] return And((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}) == True),(state['TABLE_tmp_bill'].notNil({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}) == True)) def csop0(self, state, argv): now = argv['Op_Doctor_bill_run_8436']['now'] __ts = argv['Op_Doctor_bill_run_8436']['__ts'] id = argv['Op_Doctor_bill_run_8436']['id'] tmp_bill_tmp_bill_id = argv['Op_Doctor_bill_run_8436']['tmp_bill_tmp_bill_id'] tmp_bill__ts = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, '__ts') return And((tmp_bill__ts < now)) def sop0(self, state, argv): now = argv['Op_Doctor_bill_run_8436']['now'] __ts = argv['Op_Doctor_bill_run_8436']['__ts'] id = argv['Op_Doctor_bill_run_8436']['id'] tmp_bill_tmp_bill_id = argv['Op_Doctor_bill_run_8436']['tmp_bill_tmp_bill_id'] tmp_bill_tmp_bill_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, 'tmp_bill_id') tmp_bill_doctor_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, 'doctor_fee') tmp_bill_hospital_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, 'hospital_fee') tmp_bill_pharmacy_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, 'pharmacy_fee') tmp_bill_laboratory_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, 'laboratory_fee') tmp_bill_appointment_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, 'appointment_fee') tmp_bill_vat = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, 'vat') tmp_bill_discount = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, 'discount') tmp_bill_consultant_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, 'consultant_id') tmp_bill_patient_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, 'patient_id') tmp_bill_laboratory_fee = 100 state['TABLE_tmp_bill'].update({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Doctor_bill_run_8436']['id']}, 'tmp_bill_id')}, {'tmp_bill_id': tmp_bill_tmp_bill_id, 'doctor_fee': tmp_bill_doctor_fee, 'hospital_fee': tmp_bill_hospital_fee, 'pharmacy_fee': tmp_bill_pharmacy_fee, 'laboratory_fee': tmp_bill_laboratory_fee, 'appointment_fee': tmp_bill_appointment_fee, 'vat': tmp_bill_vat, 'discount': tmp_bill_discount, 'consultant_id': tmp_bill_consultant_id, 'patient_id': tmp_bill_patient_id, '__ts': now}) return state class Op_LabAssistant_BloodGroupingTest_run_8437(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_LabAssistant_BloodGroupingTest_run_8437', 'newTstId')) def cond0(self, state, argv): __ts = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['__ts'] newTstId = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['newTstId'] appId = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['appId'] bloodGroup = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['bloodGroup'] rh = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['rh'] now = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['now'] return (state['TABLE_BloodGroupingRh'].notNil({'tst_bloodG_id': argv['Op_LabAssistant_BloodGroupingTest_run_8437']['newTstId']}) == False) def csop0(self, state, argv): now = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['now'] __ts = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['__ts'] newTstId = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['newTstId'] appId = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['appId'] bloodGroup = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['bloodGroup'] rh = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['rh'] now = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['now'] BloodGroupingRh_tst_bloodG_id = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['newTstId'] BloodGroupingRh_appointment_id = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['appId'] BloodGroupingRh_bloodGroup = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['bloodGroup'] BloodGroupingRh_rhesusD = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['rh'] BloodGroupingRh_date = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['now'] BloodGroupingRh__ts = state['TABLE_BloodGroupingRh'].get({'tst_bloodG_id': BloodGroupingRh_tst_bloodG_id}, '__ts') return And((BloodGroupingRh__ts < now)) def sop0(self, state, argv): now = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['now'] __ts = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['__ts'] newTstId = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['newTstId'] appId = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['appId'] bloodGroup = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['bloodGroup'] rh = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['rh'] now = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['now'] BloodGroupingRh_tst_bloodG_id = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['newTstId'] BloodGroupingRh_appointment_id = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['appId'] BloodGroupingRh_bloodGroup = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['bloodGroup'] BloodGroupingRh_rhesusD = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['rh'] BloodGroupingRh_date = argv['Op_LabAssistant_BloodGroupingTest_run_8437']['now'] state['TABLE_BloodGroupingRh'].add({'tst_bloodG_id': BloodGroupingRh_tst_bloodG_id}, {'appointment_id': BloodGroupingRh_appointment_id,'bloodGroup': BloodGroupingRh_bloodGroup,'rhesusD': BloodGroupingRh_rhesusD,'date': BloodGroupingRh_date, '__ts': now}) return state class Op_Doctor_prescribe_run_8438(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Doctor_prescribe_run_8438', 'newPrescId')) def cond0(self, state, argv): __ts = argv['Op_Doctor_prescribe_run_8438']['__ts'] newPrescId = argv['Op_Doctor_prescribe_run_8438']['newPrescId'] patientId = argv['Op_Doctor_prescribe_run_8438']['patientId'] consultantId = argv['Op_Doctor_prescribe_run_8438']['consultantId'] date = argv['Op_Doctor_prescribe_run_8438']['date'] drugDose = argv['Op_Doctor_prescribe_run_8438']['drugDose'] tests = argv['Op_Doctor_prescribe_run_8438']['tests'] return (state['TABLE_prescription'].notNil({'prescription_id': argv['Op_Doctor_prescribe_run_8438']['newPrescId']}) == False) def csop0(self, state, argv): now = argv['Op_Doctor_prescribe_run_8438']['now'] __ts = argv['Op_Doctor_prescribe_run_8438']['__ts'] newPrescId = argv['Op_Doctor_prescribe_run_8438']['newPrescId'] patientId = argv['Op_Doctor_prescribe_run_8438']['patientId'] consultantId = argv['Op_Doctor_prescribe_run_8438']['consultantId'] date = argv['Op_Doctor_prescribe_run_8438']['date'] drugDose = argv['Op_Doctor_prescribe_run_8438']['drugDose'] tests = argv['Op_Doctor_prescribe_run_8438']['tests'] prescription_prescription_id = argv['Op_Doctor_prescribe_run_8438']['newPrescId'] prescription_patient_id = argv['Op_Doctor_prescribe_run_8438']['patientId'] prescription_consultant_id = argv['Op_Doctor_prescribe_run_8438']['consultantId'] prescription_date = argv['Op_Doctor_prescribe_run_8438']['date'] prescription_drugs_dose = argv['Op_Doctor_prescribe_run_8438']['drugDose'] prescription_tests = argv['Op_Doctor_prescribe_run_8438']['tests'] prescription__ts = state['TABLE_prescription'].get({'prescription_id': prescription_prescription_id}, '__ts') return And((prescription__ts < now)) def sop0(self, state, argv): now = argv['Op_Doctor_prescribe_run_8438']['now'] __ts = argv['Op_Doctor_prescribe_run_8438']['__ts'] newPrescId = argv['Op_Doctor_prescribe_run_8438']['newPrescId'] patientId = argv['Op_Doctor_prescribe_run_8438']['patientId'] consultantId = argv['Op_Doctor_prescribe_run_8438']['consultantId'] date = argv['Op_Doctor_prescribe_run_8438']['date'] drugDose = argv['Op_Doctor_prescribe_run_8438']['drugDose'] tests = argv['Op_Doctor_prescribe_run_8438']['tests'] prescription_prescription_id = argv['Op_Doctor_prescribe_run_8438']['newPrescId'] prescription_patient_id = argv['Op_Doctor_prescribe_run_8438']['patientId'] prescription_consultant_id = argv['Op_Doctor_prescribe_run_8438']['consultantId'] prescription_date = argv['Op_Doctor_prescribe_run_8438']['date'] prescription_drugs_dose = argv['Op_Doctor_prescribe_run_8438']['drugDose'] prescription_tests = argv['Op_Doctor_prescribe_run_8438']['tests'] state['TABLE_prescription'].add({'prescription_id': prescription_prescription_id}, {'patient_id': prescription_patient_id,'consultant_id': prescription_consultant_id,'date': prescription_date,'drugs_dose': prescription_drugs_dose,'tests': prescription_tests, '__ts': now}) return state class Op_Receptionist_setPatientInfo_run_8439(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0), (self.cond1, self.csop1, self.sop1)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Receptionist_setPatientInfo_run_8439', 'newPersonId'), AxiomUniqueArgument('Op_Receptionist_setPatientInfo_run_8439', 'newPatientId')) def cond0(self, state, argv): __ts = argv['Op_Receptionist_setPatientInfo_run_8439']['__ts'] newPersonId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] newPatientId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId'] nic = argv['Op_Receptionist_setPatientInfo_run_8439']['nic'] gender = argv['Op_Receptionist_setPatientInfo_run_8439']['gender'] birth = argv['Op_Receptionist_setPatientInfo_run_8439']['birth'] address = argv['Op_Receptionist_setPatientInfo_run_8439']['address'] mobile = argv['Op_Receptionist_setPatientInfo_run_8439']['mobile'] firstName = argv['Op_Receptionist_setPatientInfo_run_8439']['firstName'] lastName = argv['Op_Receptionist_setPatientInfo_run_8439']['lastName'] email = argv['Op_Receptionist_setPatientInfo_run_8439']['email'] nationality = argv['Op_Receptionist_setPatientInfo_run_8439']['nationality'] religion = argv['Op_Receptionist_setPatientInfo_run_8439']['religion'] __ts = argv['Op_Receptionist_setPatientInfo_run_8439']['__ts'] newPersonId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] newPatientId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId'] nic = argv['Op_Receptionist_setPatientInfo_run_8439']['nic'] gender = argv['Op_Receptionist_setPatientInfo_run_8439']['gender'] birth = argv['Op_Receptionist_setPatientInfo_run_8439']['birth'] address = argv['Op_Receptionist_setPatientInfo_run_8439']['address'] mobile = argv['Op_Receptionist_setPatientInfo_run_8439']['mobile'] firstName = argv['Op_Receptionist_setPatientInfo_run_8439']['firstName'] lastName = argv['Op_Receptionist_setPatientInfo_run_8439']['lastName'] email = argv['Op_Receptionist_setPatientInfo_run_8439']['email'] nationality = argv['Op_Receptionist_setPatientInfo_run_8439']['nationality'] religion = argv['Op_Receptionist_setPatientInfo_run_8439']['religion'] patientInfo = argv['Op_Receptionist_setPatientInfo_run_8439']['patientInfo'] return And((state['TABLE_person'].notNil({'person_id': argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId']}) == False),(state['TABLE_patient'].notNil({'patient_id': argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId']}) == False),Not((state['TABLE_person'].notNil({'person_id': argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId']}) == False)),Not((state['TABLE_patient'].notNil({'patient_id': argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId']}) == False))) def csop0(self, state, argv): now = argv['Op_Receptionist_setPatientInfo_run_8439']['now'] __ts = argv['Op_Receptionist_setPatientInfo_run_8439']['__ts'] newPersonId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] newPatientId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId'] nic = argv['Op_Receptionist_setPatientInfo_run_8439']['nic'] gender = argv['Op_Receptionist_setPatientInfo_run_8439']['gender'] birth = argv['Op_Receptionist_setPatientInfo_run_8439']['birth'] address = argv['Op_Receptionist_setPatientInfo_run_8439']['address'] mobile = argv['Op_Receptionist_setPatientInfo_run_8439']['mobile'] firstName = argv['Op_Receptionist_setPatientInfo_run_8439']['firstName'] lastName = argv['Op_Receptionist_setPatientInfo_run_8439']['lastName'] email = argv['Op_Receptionist_setPatientInfo_run_8439']['email'] nationality = argv['Op_Receptionist_setPatientInfo_run_8439']['nationality'] religion = argv['Op_Receptionist_setPatientInfo_run_8439']['religion'] person_person_id = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] person_nic = argv['Op_Receptionist_setPatientInfo_run_8439']['nic'] person_gender = argv['Op_Receptionist_setPatientInfo_run_8439']['gender'] person_date_of_birth = argv['Op_Receptionist_setPatientInfo_run_8439']['birth'] person_address = argv['Op_Receptionist_setPatientInfo_run_8439']['address'] person_mobile = argv['Op_Receptionist_setPatientInfo_run_8439']['mobile'] person_first_name = argv['Op_Receptionist_setPatientInfo_run_8439']['firstName'] person_last_name = argv['Op_Receptionist_setPatientInfo_run_8439']['lastName'] person_email = argv['Op_Receptionist_setPatientInfo_run_8439']['email'] person_nationality = argv['Op_Receptionist_setPatientInfo_run_8439']['nationality'] person_religion = argv['Op_Receptionist_setPatientInfo_run_8439']['religion'] person__ts = state['TABLE_person'].get({'person_id': person_person_id}, '__ts') return And((person__ts < now)) def sop0(self, state, argv): now = argv['Op_Receptionist_setPatientInfo_run_8439']['now'] __ts = argv['Op_Receptionist_setPatientInfo_run_8439']['__ts'] newPersonId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] newPatientId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId'] nic = argv['Op_Receptionist_setPatientInfo_run_8439']['nic'] gender = argv['Op_Receptionist_setPatientInfo_run_8439']['gender'] birth = argv['Op_Receptionist_setPatientInfo_run_8439']['birth'] address = argv['Op_Receptionist_setPatientInfo_run_8439']['address'] mobile = argv['Op_Receptionist_setPatientInfo_run_8439']['mobile'] firstName = argv['Op_Receptionist_setPatientInfo_run_8439']['firstName'] lastName = argv['Op_Receptionist_setPatientInfo_run_8439']['lastName'] email = argv['Op_Receptionist_setPatientInfo_run_8439']['email'] nationality = argv['Op_Receptionist_setPatientInfo_run_8439']['nationality'] religion = argv['Op_Receptionist_setPatientInfo_run_8439']['religion'] person_person_id = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] person_user_id = StringVal('') person_nic = argv['Op_Receptionist_setPatientInfo_run_8439']['nic'] person_gender = argv['Op_Receptionist_setPatientInfo_run_8439']['gender'] person_date_of_birth = argv['Op_Receptionist_setPatientInfo_run_8439']['birth'] person_address = argv['Op_Receptionist_setPatientInfo_run_8439']['address'] person_mobile = argv['Op_Receptionist_setPatientInfo_run_8439']['mobile'] person_first_name = argv['Op_Receptionist_setPatientInfo_run_8439']['firstName'] person_last_name = argv['Op_Receptionist_setPatientInfo_run_8439']['lastName'] person_email = argv['Op_Receptionist_setPatientInfo_run_8439']['email'] person_nationality = argv['Op_Receptionist_setPatientInfo_run_8439']['nationality'] person_religion = argv['Op_Receptionist_setPatientInfo_run_8439']['religion'] state['TABLE_person'].add({'person_id': person_person_id}, {'user_id': person_user_id,'nic': person_nic,'gender': person_gender,'date_of_birth': person_date_of_birth,'address': person_address,'mobile': person_mobile,'first_name': person_first_name,'last_name': person_last_name,'email': person_email,'nationality': person_nationality,'religion': person_religion, '__ts': now}) return state def cond1(self, state, argv): __ts = argv['Op_Receptionist_setPatientInfo_run_8439']['__ts'] newPersonId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] newPatientId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId'] nic = argv['Op_Receptionist_setPatientInfo_run_8439']['nic'] gender = argv['Op_Receptionist_setPatientInfo_run_8439']['gender'] birth = argv['Op_Receptionist_setPatientInfo_run_8439']['birth'] address = argv['Op_Receptionist_setPatientInfo_run_8439']['address'] mobile = argv['Op_Receptionist_setPatientInfo_run_8439']['mobile'] firstName = argv['Op_Receptionist_setPatientInfo_run_8439']['firstName'] lastName = argv['Op_Receptionist_setPatientInfo_run_8439']['lastName'] email = argv['Op_Receptionist_setPatientInfo_run_8439']['email'] nationality = argv['Op_Receptionist_setPatientInfo_run_8439']['nationality'] religion = argv['Op_Receptionist_setPatientInfo_run_8439']['religion'] patientInfo = argv['Op_Receptionist_setPatientInfo_run_8439']['patientInfo'] return And((state['TABLE_person'].notNil({'person_id': argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId']}) == False),(state['TABLE_patient'].notNil({'patient_id': argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId']}) == False)) def csop1(self, state, argv): now = argv['Op_Receptionist_setPatientInfo_run_8439']['now'] __ts = argv['Op_Receptionist_setPatientInfo_run_8439']['__ts'] newPersonId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] newPatientId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId'] nic = argv['Op_Receptionist_setPatientInfo_run_8439']['nic'] gender = argv['Op_Receptionist_setPatientInfo_run_8439']['gender'] birth = argv['Op_Receptionist_setPatientInfo_run_8439']['birth'] address = argv['Op_Receptionist_setPatientInfo_run_8439']['address'] mobile = argv['Op_Receptionist_setPatientInfo_run_8439']['mobile'] firstName = argv['Op_Receptionist_setPatientInfo_run_8439']['firstName'] lastName = argv['Op_Receptionist_setPatientInfo_run_8439']['lastName'] email = argv['Op_Receptionist_setPatientInfo_run_8439']['email'] nationality = argv['Op_Receptionist_setPatientInfo_run_8439']['nationality'] religion = argv['Op_Receptionist_setPatientInfo_run_8439']['religion'] patientInfo = argv['Op_Receptionist_setPatientInfo_run_8439']['patientInfo'] person_person_id = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] person_nic = argv['Op_Receptionist_setPatientInfo_run_8439']['nic'] person_gender = argv['Op_Receptionist_setPatientInfo_run_8439']['gender'] person_date_of_birth = argv['Op_Receptionist_setPatientInfo_run_8439']['birth'] person_address = argv['Op_Receptionist_setPatientInfo_run_8439']['address'] person_mobile = argv['Op_Receptionist_setPatientInfo_run_8439']['mobile'] person_first_name = argv['Op_Receptionist_setPatientInfo_run_8439']['firstName'] person_last_name = argv['Op_Receptionist_setPatientInfo_run_8439']['lastName'] person_email = argv['Op_Receptionist_setPatientInfo_run_8439']['email'] person_nationality = argv['Op_Receptionist_setPatientInfo_run_8439']['nationality'] person_religion = argv['Op_Receptionist_setPatientInfo_run_8439']['religion'] person__ts = state['TABLE_person'].get({'person_id': person_person_id}, '__ts') patient_patient_id = argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId'] patient_person_id = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] patient_drug_allergies_and_reactions = argv['Op_Receptionist_setPatientInfo_run_8439']['patientInfo'] patient__ts = state['TABLE_patient'].get({'patient_id': patient_patient_id}, '__ts') return And((person__ts < now), (patient__ts < now)) def sop1(self, state, argv): now = argv['Op_Receptionist_setPatientInfo_run_8439']['now'] __ts = argv['Op_Receptionist_setPatientInfo_run_8439']['__ts'] newPersonId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] newPatientId = argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId'] nic = argv['Op_Receptionist_setPatientInfo_run_8439']['nic'] gender = argv['Op_Receptionist_setPatientInfo_run_8439']['gender'] birth = argv['Op_Receptionist_setPatientInfo_run_8439']['birth'] address = argv['Op_Receptionist_setPatientInfo_run_8439']['address'] mobile = argv['Op_Receptionist_setPatientInfo_run_8439']['mobile'] firstName = argv['Op_Receptionist_setPatientInfo_run_8439']['firstName'] lastName = argv['Op_Receptionist_setPatientInfo_run_8439']['lastName'] email = argv['Op_Receptionist_setPatientInfo_run_8439']['email'] nationality = argv['Op_Receptionist_setPatientInfo_run_8439']['nationality'] religion = argv['Op_Receptionist_setPatientInfo_run_8439']['religion'] patientInfo = argv['Op_Receptionist_setPatientInfo_run_8439']['patientInfo'] person_person_id = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] person_user_id = StringVal('') person_nic = argv['Op_Receptionist_setPatientInfo_run_8439']['nic'] person_gender = argv['Op_Receptionist_setPatientInfo_run_8439']['gender'] person_date_of_birth = argv['Op_Receptionist_setPatientInfo_run_8439']['birth'] person_address = argv['Op_Receptionist_setPatientInfo_run_8439']['address'] person_mobile = argv['Op_Receptionist_setPatientInfo_run_8439']['mobile'] person_first_name = argv['Op_Receptionist_setPatientInfo_run_8439']['firstName'] person_last_name = argv['Op_Receptionist_setPatientInfo_run_8439']['lastName'] person_email = argv['Op_Receptionist_setPatientInfo_run_8439']['email'] person_nationality = argv['Op_Receptionist_setPatientInfo_run_8439']['nationality'] person_religion = argv['Op_Receptionist_setPatientInfo_run_8439']['religion'] state['TABLE_person'].add({'person_id': person_person_id}, {'user_id': person_user_id,'nic': person_nic,'gender': person_gender,'date_of_birth': person_date_of_birth,'address': person_address,'mobile': person_mobile,'first_name': person_first_name,'last_name': person_last_name,'email': person_email,'nationality': person_nationality,'religion': person_religion, '__ts': now}) patient_patient_id = argv['Op_Receptionist_setPatientInfo_run_8439']['newPatientId'] patient_person_id = argv['Op_Receptionist_setPatientInfo_run_8439']['newPersonId'] patient_drug_allergies_and_reactions = argv['Op_Receptionist_setPatientInfo_run_8439']['patientInfo'] state['TABLE_patient'].add({'patient_id': patient_patient_id}, {'person_id': patient_person_id,'drug_allergies_and_reactions': patient_drug_allergies_and_reactions, '__ts': now}) return state class Op_LabAssistant_RenalFunctionTest_run_8440(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_LabAssistant_RenalFunctionTest_run_8440', 'newTstId')) def cond0(self, state, argv): __ts = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['__ts'] newTstId = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['newTstId'] appId = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['appId'] creatinine = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['creatinine'] urea = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['urea'] totalBilirubin = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['totalBilirubin'] directBilirubin = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['directBilirubin'] sgotast = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['sgotast'] sgptalt = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['sgptalt'] alkalinePhospates = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['alkalinePhospates'] now = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['now'] return (state['TABLE_RenalFunctionTest'].notNil({'tst_renal_id': argv['Op_LabAssistant_RenalFunctionTest_run_8440']['newTstId']}) == False) def csop0(self, state, argv): now = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['now'] __ts = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['__ts'] newTstId = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['newTstId'] appId = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['appId'] creatinine = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['creatinine'] urea = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['urea'] totalBilirubin = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['totalBilirubin'] directBilirubin = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['directBilirubin'] sgotast = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['sgotast'] sgptalt = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['sgptalt'] alkalinePhospates = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['alkalinePhospates'] now = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['now'] RenalFunctionTest_tst_renal_id = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['newTstId'] RenalFunctionTest_appointment_id = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['appId'] RenalFunctionTest_creatinine = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['creatinine'] RenalFunctionTest_urea = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['urea'] RenalFunctionTest_totalBilirubin = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['totalBilirubin'] RenalFunctionTest_directBilirubin = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['directBilirubin'] RenalFunctionTest_sgotast = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['sgotast'] RenalFunctionTest_sgptalt = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['sgptalt'] RenalFunctionTest_alkalinePhospates = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['alkalinePhospates'] RenalFunctionTest_date = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['now'] RenalFunctionTest__ts = state['TABLE_RenalFunctionTest'].get({'tst_renal_id': RenalFunctionTest_tst_renal_id}, '__ts') return And((RenalFunctionTest__ts < now)) def sop0(self, state, argv): now = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['now'] __ts = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['__ts'] newTstId = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['newTstId'] appId = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['appId'] creatinine = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['creatinine'] urea = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['urea'] totalBilirubin = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['totalBilirubin'] directBilirubin = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['directBilirubin'] sgotast = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['sgotast'] sgptalt = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['sgptalt'] alkalinePhospates = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['alkalinePhospates'] now = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['now'] RenalFunctionTest_tst_renal_id = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['newTstId'] RenalFunctionTest_appointment_id = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['appId'] RenalFunctionTest_creatinine = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['creatinine'] RenalFunctionTest_urea = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['urea'] RenalFunctionTest_totalBilirubin = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['totalBilirubin'] RenalFunctionTest_directBilirubin = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['directBilirubin'] RenalFunctionTest_sgotast = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['sgotast'] RenalFunctionTest_sgptalt = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['sgptalt'] RenalFunctionTest_alkalinePhospates = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['alkalinePhospates'] RenalFunctionTest_date = argv['Op_LabAssistant_RenalFunctionTest_run_8440']['now'] state['TABLE_RenalFunctionTest'].add({'tst_renal_id': RenalFunctionTest_tst_renal_id}, {'appointment_id': RenalFunctionTest_appointment_id,'creatinine': RenalFunctionTest_creatinine,'urea': RenalFunctionTest_urea,'totalBilirubin': RenalFunctionTest_totalBilirubin,'directBilirubin': RenalFunctionTest_directBilirubin,'sgotast': RenalFunctionTest_sgotast,'sgptalt': RenalFunctionTest_sgptalt,'alkalinePhospates': RenalFunctionTest_alkalinePhospates,'date': RenalFunctionTest_date, '__ts': now}) return state class Op_Admin_updateProfileInfo_run_8441(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Admin_updateProfileInfo_run_8441']['__ts'] id = argv['Op_Admin_updateProfileInfo_run_8441']['id'] sys_user_person_id = argv['Op_Admin_updateProfileInfo_run_8441']['sys_user_person_id'] person_person_id = argv['Op_Admin_updateProfileInfo_run_8441']['person_person_id'] return And((state['TABLE_sys_user'].notNil({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}) == True),(state['TABLE_person'].notNil({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}) == True)) def csop0(self, state, argv): now = argv['Op_Admin_updateProfileInfo_run_8441']['now'] __ts = argv['Op_Admin_updateProfileInfo_run_8441']['__ts'] id = argv['Op_Admin_updateProfileInfo_run_8441']['id'] sys_user_person_id = argv['Op_Admin_updateProfileInfo_run_8441']['sys_user_person_id'] person_person_id = argv['Op_Admin_updateProfileInfo_run_8441']['person_person_id'] person__ts = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, '__ts') return And((person__ts < now)) def sop0(self, state, argv): now = argv['Op_Admin_updateProfileInfo_run_8441']['now'] __ts = argv['Op_Admin_updateProfileInfo_run_8441']['__ts'] id = argv['Op_Admin_updateProfileInfo_run_8441']['id'] sys_user_person_id = argv['Op_Admin_updateProfileInfo_run_8441']['sys_user_person_id'] person_person_id = argv['Op_Admin_updateProfileInfo_run_8441']['person_person_id'] person_person_id = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'person_id') person_user_id = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'user_id') person_nic = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'nic') person_gender = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'gender') person_date_of_birth = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'date_of_birth') person_address = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'address') person_mobile = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'mobile') person_first_name = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'first_name') person_last_name = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'last_name') person_email = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'email') person_nationality = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'nationality') person_religion = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, 'religion') person_address = argv['Op_Admin_updateProfileInfo_run_8441']['id'] state['TABLE_person'].update({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateProfileInfo_run_8441']['id']}, 'person_id')}, {'person_id': person_person_id, 'user_id': person_user_id, 'nic': person_nic, 'gender': person_gender, 'date_of_birth': person_date_of_birth, 'address': person_address, 'mobile': person_mobile, 'first_name': person_first_name, 'last_name': person_last_name, 'email': person_email, 'nationality': person_nationality, 'religion': person_religion, '__ts': now}) return state class Op_Admin_resetPassword_run_8442(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Admin_resetPassword_run_8442']['__ts'] id = argv['Op_Admin_resetPassword_run_8442']['id'] sys_user_user_id = argv['Op_Admin_resetPassword_run_8442']['sys_user_user_id'] return (state['TABLE_sys_user'].notNil({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}) == True) def csop0(self, state, argv): now = argv['Op_Admin_resetPassword_run_8442']['now'] __ts = argv['Op_Admin_resetPassword_run_8442']['__ts'] id = argv['Op_Admin_resetPassword_run_8442']['id'] sys_user_user_id = argv['Op_Admin_resetPassword_run_8442']['sys_user_user_id'] sys_user__ts = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, '__ts') return And((sys_user__ts < now)) def sop0(self, state, argv): now = argv['Op_Admin_resetPassword_run_8442']['now'] __ts = argv['Op_Admin_resetPassword_run_8442']['__ts'] id = argv['Op_Admin_resetPassword_run_8442']['id'] sys_user_user_id = argv['Op_Admin_resetPassword_run_8442']['sys_user_user_id'] sys_user_person_id = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, 'person_id') sys_user_user_id = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, 'user_id') sys_user_user_name = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, 'user_name') sys_user_user_type = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, 'user_type') sys_user_other_info = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, 'other_info') sys_user_password = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, 'password') sys_user_online = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, 'online') sys_user_login = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, 'login') sys_user_logout = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, 'logout') sys_user_profile_pic = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, 'profile_pic') sys_user_suspend = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, 'suspend') sys_user_password = StringVal('123456') state['TABLE_sys_user'].update({'user_id': argv['Op_Admin_resetPassword_run_8442']['id']}, {'person_id': sys_user_person_id, 'user_id': sys_user_user_id, 'user_name': sys_user_user_name, 'user_type': sys_user_user_type, 'other_info': sys_user_other_info, 'password': sys_user_password, 'online': sys_user_online, 'login': sys_user_login, 'logout': sys_user_logout, 'profile_pic': sys_user_profile_pic, 'suspend': sys_user_suspend, '__ts': now}) return state class Op_Receptionist_refund_run_8443(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Receptionist_refund_run_8443', 'newRefundId')) def cond0(self, state, argv): __ts = argv['Op_Receptionist_refund_run_8443']['__ts'] newRefundId = argv['Op_Receptionist_refund_run_8443']['newRefundId'] billId = argv['Op_Receptionist_refund_run_8443']['billId'] paymentType = argv['Op_Receptionist_refund_run_8443']['paymentType'] reason = argv['Op_Receptionist_refund_run_8443']['reason'] amount = argv['Op_Receptionist_refund_run_8443']['amount'] now = argv['Op_Receptionist_refund_run_8443']['now'] return (state['TABLE_refund'].notNil({'refund_id': argv['Op_Receptionist_refund_run_8443']['newRefundId']}) == False) def csop0(self, state, argv): now = argv['Op_Receptionist_refund_run_8443']['now'] __ts = argv['Op_Receptionist_refund_run_8443']['__ts'] newRefundId = argv['Op_Receptionist_refund_run_8443']['newRefundId'] billId = argv['Op_Receptionist_refund_run_8443']['billId'] paymentType = argv['Op_Receptionist_refund_run_8443']['paymentType'] reason = argv['Op_Receptionist_refund_run_8443']['reason'] amount = argv['Op_Receptionist_refund_run_8443']['amount'] now = argv['Op_Receptionist_refund_run_8443']['now'] refund_refund_id = argv['Op_Receptionist_refund_run_8443']['newRefundId'] refund_bill_id = argv['Op_Receptionist_refund_run_8443']['billId'] refund_payment_type = argv['Op_Receptionist_refund_run_8443']['paymentType'] refund_reason = argv['Op_Receptionist_refund_run_8443']['reason'] refund_amount = argv['Op_Receptionist_refund_run_8443']['amount'] refund_date = argv['Op_Receptionist_refund_run_8443']['now'] refund__ts = state['TABLE_refund'].get({'refund_id': refund_refund_id}, '__ts') return And((refund__ts < now)) def sop0(self, state, argv): now = argv['Op_Receptionist_refund_run_8443']['now'] __ts = argv['Op_Receptionist_refund_run_8443']['__ts'] newRefundId = argv['Op_Receptionist_refund_run_8443']['newRefundId'] billId = argv['Op_Receptionist_refund_run_8443']['billId'] paymentType = argv['Op_Receptionist_refund_run_8443']['paymentType'] reason = argv['Op_Receptionist_refund_run_8443']['reason'] amount = argv['Op_Receptionist_refund_run_8443']['amount'] now = argv['Op_Receptionist_refund_run_8443']['now'] refund_refund_id = argv['Op_Receptionist_refund_run_8443']['newRefundId'] refund_bill_id = argv['Op_Receptionist_refund_run_8443']['billId'] refund_payment_type = argv['Op_Receptionist_refund_run_8443']['paymentType'] refund_reason = argv['Op_Receptionist_refund_run_8443']['reason'] refund_amount = argv['Op_Receptionist_refund_run_8443']['amount'] refund_date = argv['Op_Receptionist_refund_run_8443']['now'] state['TABLE_refund'].add({'refund_id': refund_refund_id}, {'bill_id': refund_bill_id,'payment_type': refund_payment_type,'reason': refund_reason,'amount': refund_amount,'date': refund_date, '__ts': now}) return state class Op_Admin_unsuspendUser_run_8444(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Admin_unsuspendUser_run_8444']['__ts'] id = argv['Op_Admin_unsuspendUser_run_8444']['id'] sys_user_user_id = argv['Op_Admin_unsuspendUser_run_8444']['sys_user_user_id'] return (state['TABLE_sys_user'].notNil({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}) == True) def csop0(self, state, argv): now = argv['Op_Admin_unsuspendUser_run_8444']['now'] __ts = argv['Op_Admin_unsuspendUser_run_8444']['__ts'] id = argv['Op_Admin_unsuspendUser_run_8444']['id'] sys_user_user_id = argv['Op_Admin_unsuspendUser_run_8444']['sys_user_user_id'] sys_user__ts = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, '__ts') return And((sys_user__ts < now)) def sop0(self, state, argv): now = argv['Op_Admin_unsuspendUser_run_8444']['now'] __ts = argv['Op_Admin_unsuspendUser_run_8444']['__ts'] id = argv['Op_Admin_unsuspendUser_run_8444']['id'] sys_user_user_id = argv['Op_Admin_unsuspendUser_run_8444']['sys_user_user_id'] sys_user_person_id = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, 'person_id') sys_user_user_id = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, 'user_id') sys_user_user_name = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, 'user_name') sys_user_user_type = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, 'user_type') sys_user_other_info = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, 'other_info') sys_user_password = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, 'password') sys_user_online = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, 'online') sys_user_login = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, 'login') sys_user_logout = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, 'logout') sys_user_profile_pic = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, 'profile_pic') sys_user_suspend = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, 'suspend') sys_user_suspend = 0 state['TABLE_sys_user'].update({'user_id': argv['Op_Admin_unsuspendUser_run_8444']['id']}, {'person_id': sys_user_person_id, 'user_id': sys_user_user_id, 'user_name': sys_user_user_name, 'user_type': sys_user_user_type, 'other_info': sys_user_other_info, 'password': sys_user_password, 'online': sys_user_online, 'login': sys_user_login, 'logout': sys_user_logout, 'profile_pic': sys_user_profile_pic, 'suspend': sys_user_suspend, '__ts': now}) return state class Op_Receptionist_makeLabAppointment_run_8445(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0), (self.cond1, self.csop1, self.sop1), (self.cond2, self.csop2, self.sop2)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Receptionist_makeLabAppointment_run_8445', 'newAppId'), AxiomUniqueArgument('Op_Receptionist_makeLabAppointment_run_8445', 'newTmpBillId')) def cond0(self, state, argv): __ts = argv['Op_Receptionist_makeLabAppointment_run_8445']['__ts'] newAppId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] testId = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] patientId = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] doctorId = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] currentDate = argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'] day = argv['Op_Receptionist_makeLabAppointment_run_8445']['day'] __ts = argv['Op_Receptionist_makeLabAppointment_run_8445']['__ts'] newAppId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] testId = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] patientId = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] doctorId = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] currentDate = argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'] day = argv['Op_Receptionist_makeLabAppointment_run_8445']['day'] lab_test_test_fee = argv['Op_Receptionist_makeLabAppointment_run_8445']['lab_test_test_fee'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['tmp_bill_tmp_bill_id'] __ts = argv['Op_Receptionist_makeLabAppointment_run_8445']['__ts'] newAppId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] testId = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] patientId = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] doctorId = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] currentDate = argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'] day = argv['Op_Receptionist_makeLabAppointment_run_8445']['day'] lab_test_test_fee = argv['Op_Receptionist_makeLabAppointment_run_8445']['lab_test_test_fee'] newTmpBillId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newTmpBillId'] return And((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId']}) == False),Not((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId']}) == False)),Not((state['TABLE_lab_test'].notNil({'test_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['testId']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}) == True)),Not((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId']}) == False)),Not((state['TABLE_lab_test'].notNil({'test_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['testId']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}) == False))) def csop0(self, state, argv): now = argv['Op_Receptionist_makeLabAppointment_run_8445']['now'] __ts = argv['Op_Receptionist_makeLabAppointment_run_8445']['__ts'] newAppId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] testId = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] patientId = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] doctorId = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] currentDate = argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'] day = argv['Op_Receptionist_makeLabAppointment_run_8445']['day'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] lab_appointment_test_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] lab_appointment_patient_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] lab_appointment_doctor_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] lab_appointment_date = (argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'])+(argv['Op_Receptionist_makeLabAppointment_run_8445']['day']) lab_appointment_cancelled = False lab_appointment__ts = state['TABLE_lab_appointment'].get({'lab_appointment_id': lab_appointment_lab_appointment_id}, '__ts') return And((lab_appointment__ts < now)) def sop0(self, state, argv): now = argv['Op_Receptionist_makeLabAppointment_run_8445']['now'] __ts = argv['Op_Receptionist_makeLabAppointment_run_8445']['__ts'] newAppId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] testId = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] patientId = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] doctorId = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] currentDate = argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'] day = argv['Op_Receptionist_makeLabAppointment_run_8445']['day'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] lab_appointment_test_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] lab_appointment_patient_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] lab_appointment_doctor_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] lab_appointment_date = (argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'])+(argv['Op_Receptionist_makeLabAppointment_run_8445']['day']) lab_appointment_cancelled = False state['TABLE_lab_appointment'].add({'lab_appointment_id': lab_appointment_lab_appointment_id}, {'test_id': lab_appointment_test_id,'patient_id': lab_appointment_patient_id,'doctor_id': lab_appointment_doctor_id,'date': lab_appointment_date,'cancelled': lab_appointment_cancelled, '__ts': now}) return state def cond1(self, state, argv): __ts = argv['Op_Receptionist_makeLabAppointment_run_8445']['__ts'] newAppId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] testId = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] patientId = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] doctorId = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] currentDate = argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'] day = argv['Op_Receptionist_makeLabAppointment_run_8445']['day'] lab_test_test_fee = argv['Op_Receptionist_makeLabAppointment_run_8445']['lab_test_test_fee'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['tmp_bill_tmp_bill_id'] return And((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId']}) == False),(state['TABLE_lab_test'].notNil({'test_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['testId']}) == True),(state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}) == True),(state['TABLE_tmp_bill'].notNil({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}) == True)) def csop1(self, state, argv): now = argv['Op_Receptionist_makeLabAppointment_run_8445']['now'] __ts = argv['Op_Receptionist_makeLabAppointment_run_8445']['__ts'] newAppId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] testId = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] patientId = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] doctorId = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] currentDate = argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'] day = argv['Op_Receptionist_makeLabAppointment_run_8445']['day'] lab_test_test_fee = argv['Op_Receptionist_makeLabAppointment_run_8445']['lab_test_test_fee'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['tmp_bill_tmp_bill_id'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] lab_appointment_test_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] lab_appointment_patient_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] lab_appointment_doctor_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] lab_appointment_date = (argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'])+(argv['Op_Receptionist_makeLabAppointment_run_8445']['day']) lab_appointment_cancelled = False lab_appointment__ts = state['TABLE_lab_appointment'].get({'lab_appointment_id': lab_appointment_lab_appointment_id}, '__ts') tmp_bill__ts = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, '__ts') return And((lab_appointment__ts < now), (tmp_bill__ts < now)) def sop1(self, state, argv): now = argv['Op_Receptionist_makeLabAppointment_run_8445']['now'] __ts = argv['Op_Receptionist_makeLabAppointment_run_8445']['__ts'] newAppId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] testId = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] patientId = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] doctorId = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] currentDate = argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'] day = argv['Op_Receptionist_makeLabAppointment_run_8445']['day'] lab_test_test_fee = argv['Op_Receptionist_makeLabAppointment_run_8445']['lab_test_test_fee'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['tmp_bill_tmp_bill_id'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] lab_appointment_test_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] lab_appointment_patient_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] lab_appointment_doctor_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] lab_appointment_date = (argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'])+(argv['Op_Receptionist_makeLabAppointment_run_8445']['day']) lab_appointment_cancelled = False state['TABLE_lab_appointment'].add({'lab_appointment_id': lab_appointment_lab_appointment_id}, {'test_id': lab_appointment_test_id,'patient_id': lab_appointment_patient_id,'doctor_id': lab_appointment_doctor_id,'date': lab_appointment_date,'cancelled': lab_appointment_cancelled, '__ts': now}) tmp_bill_tmp_bill_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, 'tmp_bill_id') tmp_bill_doctor_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, 'doctor_fee') tmp_bill_hospital_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, 'hospital_fee') tmp_bill_pharmacy_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, 'pharmacy_fee') tmp_bill_laboratory_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, 'laboratory_fee') tmp_bill_appointment_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, 'appointment_fee') tmp_bill_vat = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, 'vat') tmp_bill_discount = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, 'discount') tmp_bill_consultant_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, 'consultant_id') tmp_bill_patient_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, 'patient_id') tmp_bill_laboratory_fee = state['TABLE_lab_test'].get({'test_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['testId']}, 'test_fee') state['TABLE_tmp_bill'].update({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}, 'tmp_bill_id')}, {'tmp_bill_id': tmp_bill_tmp_bill_id, 'doctor_fee': tmp_bill_doctor_fee, 'hospital_fee': tmp_bill_hospital_fee, 'pharmacy_fee': tmp_bill_pharmacy_fee, 'laboratory_fee': tmp_bill_laboratory_fee, 'appointment_fee': tmp_bill_appointment_fee, 'vat': tmp_bill_vat, 'discount': tmp_bill_discount, 'consultant_id': tmp_bill_consultant_id, 'patient_id': tmp_bill_patient_id, '__ts': now}) return state def cond2(self, state, argv): __ts = argv['Op_Receptionist_makeLabAppointment_run_8445']['__ts'] newAppId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] testId = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] patientId = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] doctorId = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] currentDate = argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'] day = argv['Op_Receptionist_makeLabAppointment_run_8445']['day'] lab_test_test_fee = argv['Op_Receptionist_makeLabAppointment_run_8445']['lab_test_test_fee'] newTmpBillId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newTmpBillId'] return And((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId']}) == False),(state['TABLE_lab_test'].notNil({'test_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['testId']}) == True),(state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId']}) == False)) def csop2(self, state, argv): now = argv['Op_Receptionist_makeLabAppointment_run_8445']['now'] __ts = argv['Op_Receptionist_makeLabAppointment_run_8445']['__ts'] newAppId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] testId = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] patientId = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] doctorId = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] currentDate = argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'] day = argv['Op_Receptionist_makeLabAppointment_run_8445']['day'] lab_test_test_fee = argv['Op_Receptionist_makeLabAppointment_run_8445']['lab_test_test_fee'] newTmpBillId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newTmpBillId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] lab_appointment_test_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] lab_appointment_patient_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] lab_appointment_doctor_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] lab_appointment_date = (argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'])+(argv['Op_Receptionist_makeLabAppointment_run_8445']['day']) lab_appointment_cancelled = False lab_appointment__ts = state['TABLE_lab_appointment'].get({'lab_appointment_id': lab_appointment_lab_appointment_id}, '__ts') tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['newTmpBillId'] tmp_bill_patient_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] tmp_bill_laboratory_fee = state['TABLE_lab_test'].get({'test_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['testId']}, 'test_fee') tmp_bill__ts = state['TABLE_tmp_bill'].get({'tmp_bill_id': tmp_bill_tmp_bill_id}, '__ts') return And((lab_appointment__ts < now), (tmp_bill__ts < now)) def sop2(self, state, argv): now = argv['Op_Receptionist_makeLabAppointment_run_8445']['now'] __ts = argv['Op_Receptionist_makeLabAppointment_run_8445']['__ts'] newAppId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] testId = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] patientId = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] doctorId = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] currentDate = argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'] day = argv['Op_Receptionist_makeLabAppointment_run_8445']['day'] lab_test_test_fee = argv['Op_Receptionist_makeLabAppointment_run_8445']['lab_test_test_fee'] newTmpBillId = argv['Op_Receptionist_makeLabAppointment_run_8445']['newTmpBillId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['newAppId'] lab_appointment_test_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['testId'] lab_appointment_patient_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] lab_appointment_doctor_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['doctorId'] lab_appointment_date = (argv['Op_Receptionist_makeLabAppointment_run_8445']['currentDate'])+(argv['Op_Receptionist_makeLabAppointment_run_8445']['day']) lab_appointment_cancelled = False state['TABLE_lab_appointment'].add({'lab_appointment_id': lab_appointment_lab_appointment_id}, {'test_id': lab_appointment_test_id,'patient_id': lab_appointment_patient_id,'doctor_id': lab_appointment_doctor_id,'date': lab_appointment_date,'cancelled': lab_appointment_cancelled, '__ts': now}) tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['newTmpBillId'] tmp_bill_patient_id = argv['Op_Receptionist_makeLabAppointment_run_8445']['patientId'] tmp_bill_laboratory_fee = state['TABLE_lab_test'].get({'test_id': argv['Op_Receptionist_makeLabAppointment_run_8445']['testId']}, 'test_fee') state['TABLE_tmp_bill'].add({'tmp_bill_id': tmp_bill_tmp_bill_id}, {'patient_id': tmp_bill_patient_id,'laboratory_fee': tmp_bill_laboratory_fee, '__ts': now}) return state class Op_LabAssistant_LipidTest_run_8446(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_LabAssistant_LipidTest_run_8446', 'newTstId')) def cond0(self, state, argv): __ts = argv['Op_LabAssistant_LipidTest_run_8446']['__ts'] newTstId = argv['Op_LabAssistant_LipidTest_run_8446']['newTstId'] appId = argv['Op_LabAssistant_LipidTest_run_8446']['appId'] cholestrolHDL = argv['Op_LabAssistant_LipidTest_run_8446']['cholestrolHDL'] cholestrolLDL = argv['Op_LabAssistant_LipidTest_run_8446']['cholestrolLDL'] triglycerides = argv['Op_LabAssistant_LipidTest_run_8446']['triglycerides'] totalCholestrolLDLHDLratio = argv['Op_LabAssistant_LipidTest_run_8446']['totalCholestrolLDLHDLratio'] now = argv['Op_LabAssistant_LipidTest_run_8446']['now'] return (state['TABLE_LipidTest'].notNil({'tst_li_id': argv['Op_LabAssistant_LipidTest_run_8446']['newTstId']}) == False) def csop0(self, state, argv): now = argv['Op_LabAssistant_LipidTest_run_8446']['now'] __ts = argv['Op_LabAssistant_LipidTest_run_8446']['__ts'] newTstId = argv['Op_LabAssistant_LipidTest_run_8446']['newTstId'] appId = argv['Op_LabAssistant_LipidTest_run_8446']['appId'] cholestrolHDL = argv['Op_LabAssistant_LipidTest_run_8446']['cholestrolHDL'] cholestrolLDL = argv['Op_LabAssistant_LipidTest_run_8446']['cholestrolLDL'] triglycerides = argv['Op_LabAssistant_LipidTest_run_8446']['triglycerides'] totalCholestrolLDLHDLratio = argv['Op_LabAssistant_LipidTest_run_8446']['totalCholestrolLDLHDLratio'] now = argv['Op_LabAssistant_LipidTest_run_8446']['now'] LipidTest_tst_li_id = argv['Op_LabAssistant_LipidTest_run_8446']['newTstId'] LipidTest_appointment_id = argv['Op_LabAssistant_LipidTest_run_8446']['appId'] LipidTest_cholestrolHDL = argv['Op_LabAssistant_LipidTest_run_8446']['cholestrolHDL'] LipidTest_cholestrolLDL = argv['Op_LabAssistant_LipidTest_run_8446']['cholestrolLDL'] LipidTest_triglycerides = argv['Op_LabAssistant_LipidTest_run_8446']['triglycerides'] LipidTest_totalCholestrolLDLHDLratio = argv['Op_LabAssistant_LipidTest_run_8446']['totalCholestrolLDLHDLratio'] LipidTest_date = argv['Op_LabAssistant_LipidTest_run_8446']['now'] LipidTest__ts = state['TABLE_LipidTest'].get({'tst_li_id': LipidTest_tst_li_id}, '__ts') return And((LipidTest__ts < now)) def sop0(self, state, argv): now = argv['Op_LabAssistant_LipidTest_run_8446']['now'] __ts = argv['Op_LabAssistant_LipidTest_run_8446']['__ts'] newTstId = argv['Op_LabAssistant_LipidTest_run_8446']['newTstId'] appId = argv['Op_LabAssistant_LipidTest_run_8446']['appId'] cholestrolHDL = argv['Op_LabAssistant_LipidTest_run_8446']['cholestrolHDL'] cholestrolLDL = argv['Op_LabAssistant_LipidTest_run_8446']['cholestrolLDL'] triglycerides = argv['Op_LabAssistant_LipidTest_run_8446']['triglycerides'] totalCholestrolLDLHDLratio = argv['Op_LabAssistant_LipidTest_run_8446']['totalCholestrolLDLHDLratio'] now = argv['Op_LabAssistant_LipidTest_run_8446']['now'] LipidTest_tst_li_id = argv['Op_LabAssistant_LipidTest_run_8446']['newTstId'] LipidTest_appointment_id = argv['Op_LabAssistant_LipidTest_run_8446']['appId'] LipidTest_cholestrolHDL = argv['Op_LabAssistant_LipidTest_run_8446']['cholestrolHDL'] LipidTest_cholestrolLDL = argv['Op_LabAssistant_LipidTest_run_8446']['cholestrolLDL'] LipidTest_triglycerides = argv['Op_LabAssistant_LipidTest_run_8446']['triglycerides'] LipidTest_totalCholestrolLDLHDLratio = argv['Op_LabAssistant_LipidTest_run_8446']['totalCholestrolLDLHDLratio'] LipidTest_date = argv['Op_LabAssistant_LipidTest_run_8446']['now'] state['TABLE_LipidTest'].add({'tst_li_id': LipidTest_tst_li_id}, {'appointment_id': LipidTest_appointment_id,'cholestrolHDL': LipidTest_cholestrolHDL,'cholestrolLDL': LipidTest_cholestrolLDL,'triglycerides': LipidTest_triglycerides,'totalCholestrolLDLHDLratio': LipidTest_totalCholestrolLDLHDLratio,'date': LipidTest_date, '__ts': now}) return state class Op_Doctor_updateAccountInfo_run_8447(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Doctor_updateAccountInfo_run_8447']['__ts'] id = argv['Op_Doctor_updateAccountInfo_run_8447']['id'] doctor_user_id = argv['Op_Doctor_updateAccountInfo_run_8447']['doctor_user_id'] sys_user_user_id = argv['Op_Doctor_updateAccountInfo_run_8447']['sys_user_user_id'] return And((state['TABLE_doctor'].notNil({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}) == True),(state['TABLE_sys_user'].notNil({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}) == True)) def csop0(self, state, argv): now = argv['Op_Doctor_updateAccountInfo_run_8447']['now'] __ts = argv['Op_Doctor_updateAccountInfo_run_8447']['__ts'] id = argv['Op_Doctor_updateAccountInfo_run_8447']['id'] doctor_user_id = argv['Op_Doctor_updateAccountInfo_run_8447']['doctor_user_id'] sys_user_user_id = argv['Op_Doctor_updateAccountInfo_run_8447']['sys_user_user_id'] sys_user__ts = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, '__ts') return And((sys_user__ts < now)) def sop0(self, state, argv): now = argv['Op_Doctor_updateAccountInfo_run_8447']['now'] __ts = argv['Op_Doctor_updateAccountInfo_run_8447']['__ts'] id = argv['Op_Doctor_updateAccountInfo_run_8447']['id'] doctor_user_id = argv['Op_Doctor_updateAccountInfo_run_8447']['doctor_user_id'] sys_user_user_id = argv['Op_Doctor_updateAccountInfo_run_8447']['sys_user_user_id'] sys_user_person_id = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, 'person_id') sys_user_user_id = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, 'user_id') sys_user_user_name = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, 'user_name') sys_user_user_type = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, 'user_type') sys_user_other_info = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, 'other_info') sys_user_password = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, 'password') sys_user_online = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, 'online') sys_user_login = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, 'login') sys_user_logout = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, 'logout') sys_user_profile_pic = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, 'profile_pic') sys_user_suspend = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, 'suspend') sys_user_other_info = argv['Op_Doctor_updateAccountInfo_run_8447']['id'] state['TABLE_sys_user'].update({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_Doctor_updateAccountInfo_run_8447']['id']}, 'user_id')}, {'person_id': sys_user_person_id, 'user_id': sys_user_user_id, 'user_name': sys_user_user_name, 'user_type': sys_user_user_type, 'other_info': sys_user_other_info, 'password': sys_user_password, 'online': sys_user_online, 'login': sys_user_login, 'logout': sys_user_logout, 'profile_pic': sys_user_profile_pic, 'suspend': sys_user_suspend, '__ts': now}) return state class Op_LabAssistant_completeBloodCount_run_8448(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_LabAssistant_completeBloodCount_run_8448', 'newTstId')) def cond0(self, state, argv): __ts = argv['Op_LabAssistant_completeBloodCount_run_8448']['__ts'] newTstId = argv['Op_LabAssistant_completeBloodCount_run_8448']['newTstId'] appId = argv['Op_LabAssistant_completeBloodCount_run_8448']['appId'] totalWhiteCellCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['totalWhiteCellCount'] differentialCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['differentialCount'] neutrophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['neutrophils'] lymphocytes = argv['Op_LabAssistant_completeBloodCount_run_8448']['lymphocytes'] monocytes = argv['Op_LabAssistant_completeBloodCount_run_8448']['monocytes'] eosonophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['eosonophils'] basophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['basophils'] haemoglobin = argv['Op_LabAssistant_completeBloodCount_run_8448']['haemoglobin'] redBloodCells = argv['Op_LabAssistant_completeBloodCount_run_8448']['redBloodCells'] meanCellVolume = argv['Op_LabAssistant_completeBloodCount_run_8448']['meanCellVolume'] haematocrit = argv['Op_LabAssistant_completeBloodCount_run_8448']['haematocrit'] meanCellHaemoglobin = argv['Op_LabAssistant_completeBloodCount_run_8448']['meanCellHaemoglobin'] mchConcentration = argv['Op_LabAssistant_completeBloodCount_run_8448']['mchConcentration'] redCellsDistributionWidth = argv['Op_LabAssistant_completeBloodCount_run_8448']['redCellsDistributionWidth'] plateletCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['plateletCount'] now = argv['Op_LabAssistant_completeBloodCount_run_8448']['now'] return (state['TABLE_completeBloodCount'].notNil({'tst_CBC_id': argv['Op_LabAssistant_completeBloodCount_run_8448']['newTstId']}) == False) def csop0(self, state, argv): now = argv['Op_LabAssistant_completeBloodCount_run_8448']['now'] __ts = argv['Op_LabAssistant_completeBloodCount_run_8448']['__ts'] newTstId = argv['Op_LabAssistant_completeBloodCount_run_8448']['newTstId'] appId = argv['Op_LabAssistant_completeBloodCount_run_8448']['appId'] totalWhiteCellCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['totalWhiteCellCount'] differentialCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['differentialCount'] neutrophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['neutrophils'] lymphocytes = argv['Op_LabAssistant_completeBloodCount_run_8448']['lymphocytes'] monocytes = argv['Op_LabAssistant_completeBloodCount_run_8448']['monocytes'] eosonophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['eosonophils'] basophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['basophils'] haemoglobin = argv['Op_LabAssistant_completeBloodCount_run_8448']['haemoglobin'] redBloodCells = argv['Op_LabAssistant_completeBloodCount_run_8448']['redBloodCells'] meanCellVolume = argv['Op_LabAssistant_completeBloodCount_run_8448']['meanCellVolume'] haematocrit = argv['Op_LabAssistant_completeBloodCount_run_8448']['haematocrit'] meanCellHaemoglobin = argv['Op_LabAssistant_completeBloodCount_run_8448']['meanCellHaemoglobin'] mchConcentration = argv['Op_LabAssistant_completeBloodCount_run_8448']['mchConcentration'] redCellsDistributionWidth = argv['Op_LabAssistant_completeBloodCount_run_8448']['redCellsDistributionWidth'] plateletCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['plateletCount'] now = argv['Op_LabAssistant_completeBloodCount_run_8448']['now'] completeBloodCount_tst_CBC_id = argv['Op_LabAssistant_completeBloodCount_run_8448']['newTstId'] completeBloodCount_appointment_id = argv['Op_LabAssistant_completeBloodCount_run_8448']['appId'] completeBloodCount_totalWhiteCellCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['totalWhiteCellCount'] completeBloodCount_differentialCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['differentialCount'] completeBloodCount_neutrophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['neutrophils'] completeBloodCount_lymphocytes = argv['Op_LabAssistant_completeBloodCount_run_8448']['lymphocytes'] completeBloodCount_monocytes = argv['Op_LabAssistant_completeBloodCount_run_8448']['monocytes'] completeBloodCount_eosonophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['eosonophils'] completeBloodCount_basophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['basophils'] completeBloodCount_haemoglobin = argv['Op_LabAssistant_completeBloodCount_run_8448']['haemoglobin'] completeBloodCount_redBloodCells = argv['Op_LabAssistant_completeBloodCount_run_8448']['redBloodCells'] completeBloodCount_meanCellVolume = argv['Op_LabAssistant_completeBloodCount_run_8448']['meanCellVolume'] completeBloodCount_haematocrit = argv['Op_LabAssistant_completeBloodCount_run_8448']['haematocrit'] completeBloodCount_meanCellHaemoglobin = argv['Op_LabAssistant_completeBloodCount_run_8448']['meanCellHaemoglobin'] completeBloodCount_mchConcentration = argv['Op_LabAssistant_completeBloodCount_run_8448']['mchConcentration'] completeBloodCount_redCellsDistributionWidth = argv['Op_LabAssistant_completeBloodCount_run_8448']['redCellsDistributionWidth'] completeBloodCount_plateletCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['plateletCount'] completeBloodCount_date = argv['Op_LabAssistant_completeBloodCount_run_8448']['now'] completeBloodCount__ts = state['TABLE_completeBloodCount'].get({'tst_CBC_id': completeBloodCount_tst_CBC_id}, '__ts') return And((completeBloodCount__ts < now)) def sop0(self, state, argv): now = argv['Op_LabAssistant_completeBloodCount_run_8448']['now'] __ts = argv['Op_LabAssistant_completeBloodCount_run_8448']['__ts'] newTstId = argv['Op_LabAssistant_completeBloodCount_run_8448']['newTstId'] appId = argv['Op_LabAssistant_completeBloodCount_run_8448']['appId'] totalWhiteCellCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['totalWhiteCellCount'] differentialCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['differentialCount'] neutrophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['neutrophils'] lymphocytes = argv['Op_LabAssistant_completeBloodCount_run_8448']['lymphocytes'] monocytes = argv['Op_LabAssistant_completeBloodCount_run_8448']['monocytes'] eosonophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['eosonophils'] basophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['basophils'] haemoglobin = argv['Op_LabAssistant_completeBloodCount_run_8448']['haemoglobin'] redBloodCells = argv['Op_LabAssistant_completeBloodCount_run_8448']['redBloodCells'] meanCellVolume = argv['Op_LabAssistant_completeBloodCount_run_8448']['meanCellVolume'] haematocrit = argv['Op_LabAssistant_completeBloodCount_run_8448']['haematocrit'] meanCellHaemoglobin = argv['Op_LabAssistant_completeBloodCount_run_8448']['meanCellHaemoglobin'] mchConcentration = argv['Op_LabAssistant_completeBloodCount_run_8448']['mchConcentration'] redCellsDistributionWidth = argv['Op_LabAssistant_completeBloodCount_run_8448']['redCellsDistributionWidth'] plateletCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['plateletCount'] now = argv['Op_LabAssistant_completeBloodCount_run_8448']['now'] completeBloodCount_tst_CBC_id = argv['Op_LabAssistant_completeBloodCount_run_8448']['newTstId'] completeBloodCount_appointment_id = argv['Op_LabAssistant_completeBloodCount_run_8448']['appId'] completeBloodCount_totalWhiteCellCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['totalWhiteCellCount'] completeBloodCount_differentialCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['differentialCount'] completeBloodCount_neutrophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['neutrophils'] completeBloodCount_lymphocytes = argv['Op_LabAssistant_completeBloodCount_run_8448']['lymphocytes'] completeBloodCount_monocytes = argv['Op_LabAssistant_completeBloodCount_run_8448']['monocytes'] completeBloodCount_eosonophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['eosonophils'] completeBloodCount_basophils = argv['Op_LabAssistant_completeBloodCount_run_8448']['basophils'] completeBloodCount_haemoglobin = argv['Op_LabAssistant_completeBloodCount_run_8448']['haemoglobin'] completeBloodCount_redBloodCells = argv['Op_LabAssistant_completeBloodCount_run_8448']['redBloodCells'] completeBloodCount_meanCellVolume = argv['Op_LabAssistant_completeBloodCount_run_8448']['meanCellVolume'] completeBloodCount_haematocrit = argv['Op_LabAssistant_completeBloodCount_run_8448']['haematocrit'] completeBloodCount_meanCellHaemoglobin = argv['Op_LabAssistant_completeBloodCount_run_8448']['meanCellHaemoglobin'] completeBloodCount_mchConcentration = argv['Op_LabAssistant_completeBloodCount_run_8448']['mchConcentration'] completeBloodCount_redCellsDistributionWidth = argv['Op_LabAssistant_completeBloodCount_run_8448']['redCellsDistributionWidth'] completeBloodCount_plateletCount = argv['Op_LabAssistant_completeBloodCount_run_8448']['plateletCount'] completeBloodCount_date = argv['Op_LabAssistant_completeBloodCount_run_8448']['now'] state['TABLE_completeBloodCount'].add({'tst_CBC_id': completeBloodCount_tst_CBC_id}, {'appointment_id': completeBloodCount_appointment_id,'totalWhiteCellCount': completeBloodCount_totalWhiteCellCount,'differentialCount': completeBloodCount_differentialCount,'neutrophils': completeBloodCount_neutrophils,'lymphocytes': completeBloodCount_lymphocytes,'monocytes': completeBloodCount_monocytes,'eosonophils': completeBloodCount_eosonophils,'basophils': completeBloodCount_basophils,'haemoglobin': completeBloodCount_haemoglobin,'redBloodCells': completeBloodCount_redBloodCells,'meanCellVolume': completeBloodCount_meanCellVolume,'haematocrit': completeBloodCount_haematocrit,'meanCellHaemoglobin': completeBloodCount_meanCellHaemoglobin,'mchConcentration': completeBloodCount_mchConcentration,'redCellsDistributionWidth': completeBloodCount_redCellsDistributionWidth,'plateletCount': completeBloodCount_plateletCount,'date': completeBloodCount_date, '__ts': now}) return state class Op_Receptionist_makeAppointment_run_8449(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0), (self.cond1, self.csop1, self.sop1), (self.cond2, self.csop2, self.sop2), (self.cond3, self.csop3, self.sop3), (self.cond4, self.csop4, self.sop4), (self.cond5, self.csop5, self.sop5), (self.cond6, self.csop6, self.sop6)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Receptionist_makeAppointment_run_8449', 'newAppId'), AxiomUniqueArgument('Op_Receptionist_makeAppointment_run_8449', 'newTmpBillId')) def cond0(self, state, argv): __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['tmp_bill_tmp_bill_id'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['tmp_bill_tmp_bill_id'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] newTmpBillId = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] newTmpBillId = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] return And((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False)),Not((argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631)),Not((state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True)),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False)),Not((argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631)),Not((state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True)),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False)),Not((argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631)),Not((state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}) == True)),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False)),Not((argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631)),Not((state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}) == True)),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False)),Not((argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631)),Not((state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == False)),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False)),Not((argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631)),Not((state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == False))) def csop0(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False appointment__ts = state['TABLE_appointment'].get({'appointment_id': appointment_appointment_id}, '__ts') return And((appointment__ts < now)) def sop0(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False state['TABLE_appointment'].add({'appointment_id': appointment_appointment_id}, {'patient_id': appointment_patient_id,'slmc_reg_no': appointment_slmc_reg_no,'date': appointment_date,'cancelled': appointment_cancelled, '__ts': now}) return state def cond1(self, state, argv): __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['tmp_bill_tmp_bill_id'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] newTmpBillId = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] return And((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False),(argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631),(state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False)),Not((argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631)),Not((state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}) == True)),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False)),Not((argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631)),Not((state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == False))) def csop1(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False appointment__ts = state['TABLE_appointment'].get({'appointment_id': appointment_appointment_id}, '__ts') doctor_availability__ts = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, '__ts') return And((appointment__ts < now), (doctor_availability__ts < now)) def sop1(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False state['TABLE_appointment'].add({'appointment_id': appointment_appointment_id}, {'patient_id': appointment_patient_id,'slmc_reg_no': appointment_slmc_reg_no,'date': appointment_date,'cancelled': appointment_cancelled, '__ts': now}) doctor_availability_time_slot_id = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot_id') doctor_availability_slmc_reg_no = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'slmc_reg_no') doctor_availability_day = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'day') doctor_availability_time_slot = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot') doctor_availability_current_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'current_week_appointments') doctor_availability_next_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'next_week_appointments') doctor_availability_current_week_appointments = (doctor_availability_current_week_appointments)+(1) state['TABLE_doctor_availability'].update({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, {'time_slot_id': doctor_availability_time_slot_id, 'slmc_reg_no': doctor_availability_slmc_reg_no, 'day': doctor_availability_day, 'time_slot': doctor_availability_time_slot, 'current_week_appointments': doctor_availability_current_week_appointments, 'next_week_appointments': doctor_availability_next_week_appointments, '__ts': now}) return state def cond2(self, state, argv): __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['tmp_bill_tmp_bill_id'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] newTmpBillId = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] return And((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False),(argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631),(state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False)),Not((argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631)),Not((state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}) == True)),Not((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False)),Not((argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631)),Not((state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True)),Not((state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == False))) def csop2(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False appointment__ts = state['TABLE_appointment'].get({'appointment_id': appointment_appointment_id}, '__ts') doctor_availability__ts = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, '__ts') return And((appointment__ts < now), (doctor_availability__ts < now)) def sop2(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False state['TABLE_appointment'].add({'appointment_id': appointment_appointment_id}, {'patient_id': appointment_patient_id,'slmc_reg_no': appointment_slmc_reg_no,'date': appointment_date,'cancelled': appointment_cancelled, '__ts': now}) doctor_availability_time_slot_id = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot_id') doctor_availability_slmc_reg_no = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'slmc_reg_no') doctor_availability_day = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'day') doctor_availability_time_slot = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot') doctor_availability_current_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'current_week_appointments') doctor_availability_next_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'next_week_appointments') doctor_availability_next_week_appointments = (doctor_availability_next_week_appointments)+(1) state['TABLE_doctor_availability'].update({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, {'time_slot_id': doctor_availability_time_slot_id, 'slmc_reg_no': doctor_availability_slmc_reg_no, 'day': doctor_availability_day, 'time_slot': doctor_availability_time_slot, 'current_week_appointments': doctor_availability_current_week_appointments, 'next_week_appointments': doctor_availability_next_week_appointments, '__ts': now}) return state def cond3(self, state, argv): __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['tmp_bill_tmp_bill_id'] return And((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False),(argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631),(state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True),(state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == True),(state['TABLE_tmp_bill'].notNil({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}) == True)) def csop3(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['tmp_bill_tmp_bill_id'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False appointment__ts = state['TABLE_appointment'].get({'appointment_id': appointment_appointment_id}, '__ts') doctor_availability__ts = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, '__ts') tmp_bill__ts = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, '__ts') return And((appointment__ts < now), (doctor_availability__ts < now), (tmp_bill__ts < now)) def sop3(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['tmp_bill_tmp_bill_id'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False state['TABLE_appointment'].add({'appointment_id': appointment_appointment_id}, {'patient_id': appointment_patient_id,'slmc_reg_no': appointment_slmc_reg_no,'date': appointment_date,'cancelled': appointment_cancelled, '__ts': now}) doctor_availability_time_slot_id = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot_id') doctor_availability_slmc_reg_no = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'slmc_reg_no') doctor_availability_day = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'day') doctor_availability_time_slot = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot') doctor_availability_current_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'current_week_appointments') doctor_availability_next_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'next_week_appointments') doctor_availability_current_week_appointments = (doctor_availability_current_week_appointments)+(1) state['TABLE_doctor_availability'].update({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, {'time_slot_id': doctor_availability_time_slot_id, 'slmc_reg_no': doctor_availability_slmc_reg_no, 'day': doctor_availability_day, 'time_slot': doctor_availability_time_slot, 'current_week_appointments': doctor_availability_current_week_appointments, 'next_week_appointments': doctor_availability_next_week_appointments, '__ts': now}) tmp_bill_tmp_bill_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'tmp_bill_id') tmp_bill_doctor_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'doctor_fee') tmp_bill_hospital_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'hospital_fee') tmp_bill_pharmacy_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'pharmacy_fee') tmp_bill_laboratory_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'laboratory_fee') tmp_bill_appointment_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'appointment_fee') tmp_bill_vat = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'vat') tmp_bill_discount = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'discount') tmp_bill_consultant_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'consultant_id') tmp_bill_patient_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'patient_id') tmp_bill_appointment_fee = 500 state['TABLE_tmp_bill'].update({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, {'tmp_bill_id': tmp_bill_tmp_bill_id, 'doctor_fee': tmp_bill_doctor_fee, 'hospital_fee': tmp_bill_hospital_fee, 'pharmacy_fee': tmp_bill_pharmacy_fee, 'laboratory_fee': tmp_bill_laboratory_fee, 'appointment_fee': tmp_bill_appointment_fee, 'vat': tmp_bill_vat, 'discount': tmp_bill_discount, 'consultant_id': tmp_bill_consultant_id, 'patient_id': tmp_bill_patient_id, '__ts': now}) return state def cond4(self, state, argv): __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['tmp_bill_tmp_bill_id'] return And((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False),(argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631),(state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True),(state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == True),(state['TABLE_tmp_bill'].notNil({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}) == True)) def csop4(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['tmp_bill_tmp_bill_id'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False appointment__ts = state['TABLE_appointment'].get({'appointment_id': appointment_appointment_id}, '__ts') doctor_availability__ts = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, '__ts') tmp_bill__ts = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, '__ts') return And((appointment__ts < now), (doctor_availability__ts < now), (tmp_bill__ts < now)) def sop4(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['tmp_bill_tmp_bill_id'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False state['TABLE_appointment'].add({'appointment_id': appointment_appointment_id}, {'patient_id': appointment_patient_id,'slmc_reg_no': appointment_slmc_reg_no,'date': appointment_date,'cancelled': appointment_cancelled, '__ts': now}) doctor_availability_time_slot_id = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot_id') doctor_availability_slmc_reg_no = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'slmc_reg_no') doctor_availability_day = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'day') doctor_availability_time_slot = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot') doctor_availability_current_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'current_week_appointments') doctor_availability_next_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'next_week_appointments') doctor_availability_next_week_appointments = (doctor_availability_next_week_appointments)+(1) state['TABLE_doctor_availability'].update({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, {'time_slot_id': doctor_availability_time_slot_id, 'slmc_reg_no': doctor_availability_slmc_reg_no, 'day': doctor_availability_day, 'time_slot': doctor_availability_time_slot, 'current_week_appointments': doctor_availability_current_week_appointments, 'next_week_appointments': doctor_availability_next_week_appointments, '__ts': now}) tmp_bill_tmp_bill_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'tmp_bill_id') tmp_bill_doctor_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'doctor_fee') tmp_bill_hospital_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'hospital_fee') tmp_bill_pharmacy_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'pharmacy_fee') tmp_bill_laboratory_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'laboratory_fee') tmp_bill_appointment_fee = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'appointment_fee') tmp_bill_vat = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'vat') tmp_bill_discount = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'discount') tmp_bill_consultant_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'consultant_id') tmp_bill_patient_id = state['TABLE_tmp_bill'].get({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, 'patient_id') tmp_bill_appointment_fee = 500 state['TABLE_tmp_bill'].update({'tmp_bill_id': state['TABLE_tmp_bill'].get({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}, 'tmp_bill_id')}, {'tmp_bill_id': tmp_bill_tmp_bill_id, 'doctor_fee': tmp_bill_doctor_fee, 'hospital_fee': tmp_bill_hospital_fee, 'pharmacy_fee': tmp_bill_pharmacy_fee, 'laboratory_fee': tmp_bill_laboratory_fee, 'appointment_fee': tmp_bill_appointment_fee, 'vat': tmp_bill_vat, 'discount': tmp_bill_discount, 'consultant_id': tmp_bill_consultant_id, 'patient_id': tmp_bill_patient_id, '__ts': now}) return state def cond5(self, state, argv): __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] newTmpBillId = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] return And((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False),(argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631),(state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True),(state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == False)) def csop5(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] newTmpBillId = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False appointment__ts = state['TABLE_appointment'].get({'appointment_id': appointment_appointment_id}, '__ts') doctor_availability__ts = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, '__ts') tmp_bill_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] tmp_bill_appointment_fee = 500 tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] tmp_bill__ts = state['TABLE_tmp_bill'].get({'tmp_bill_id': tmp_bill_tmp_bill_id}, '__ts') return And((appointment__ts < now), (doctor_availability__ts < now), (tmp_bill__ts < now)) def sop5(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] newTmpBillId = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False state['TABLE_appointment'].add({'appointment_id': appointment_appointment_id}, {'patient_id': appointment_patient_id,'slmc_reg_no': appointment_slmc_reg_no,'date': appointment_date,'cancelled': appointment_cancelled, '__ts': now}) doctor_availability_time_slot_id = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot_id') doctor_availability_slmc_reg_no = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'slmc_reg_no') doctor_availability_day = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'day') doctor_availability_time_slot = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot') doctor_availability_current_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'current_week_appointments') doctor_availability_next_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'next_week_appointments') doctor_availability_current_week_appointments = (doctor_availability_current_week_appointments)+(1) state['TABLE_doctor_availability'].update({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, {'time_slot_id': doctor_availability_time_slot_id, 'slmc_reg_no': doctor_availability_slmc_reg_no, 'day': doctor_availability_day, 'time_slot': doctor_availability_time_slot, 'current_week_appointments': doctor_availability_current_week_appointments, 'next_week_appointments': doctor_availability_next_week_appointments, '__ts': now}) tmp_bill_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] tmp_bill_appointment_fee = 500 tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] state['TABLE_tmp_bill'].add({'tmp_bill_id': tmp_bill_tmp_bill_id}, {'patient_id': tmp_bill_patient_id,'appointment_fee': tmp_bill_appointment_fee, '__ts': now}) return state def cond6(self, state, argv): __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] newTmpBillId = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] return And((state['TABLE_appointment'].notNil({'appointment_id': argv['Op_Receptionist_makeAppointment_run_8449']['newAppId']}) == False),(argv['Op_Receptionist_makeAppointment_run_8449']['day'])<=(3631),(state['TABLE_doctor_availability'].notNil({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'], 'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'], 'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}) == True),(state['TABLE_tmp_bill'].notNil({'patient_id': argv['Op_Receptionist_makeAppointment_run_8449']['patientId']}) == False)) def csop6(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] newTmpBillId = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False appointment__ts = state['TABLE_appointment'].get({'appointment_id': appointment_appointment_id}, '__ts') doctor_availability__ts = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, '__ts') tmp_bill_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] tmp_bill_appointment_fee = 500 tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] tmp_bill__ts = state['TABLE_tmp_bill'].get({'tmp_bill_id': tmp_bill_tmp_bill_id}, '__ts') return And((appointment__ts < now), (doctor_availability__ts < now), (tmp_bill__ts < now)) def sop6(self, state, argv): now = argv['Op_Receptionist_makeAppointment_run_8449']['now'] __ts = argv['Op_Receptionist_makeAppointment_run_8449']['__ts'] newAppId = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] patientId = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] doctorId = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] currentDate = argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'] day = argv['Op_Receptionist_makeAppointment_run_8449']['day'] timeSlot = argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'] doctor_availability_time_slot = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_time_slot'] doctor_availability_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_slmc_reg_no'] doctor_availability_day = argv['Op_Receptionist_makeAppointment_run_8449']['doctor_availability_day'] newTmpBillId = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] appointment_appointment_id = argv['Op_Receptionist_makeAppointment_run_8449']['newAppId'] appointment_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] appointment_slmc_reg_no = argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'] appointment_date = (argv['Op_Receptionist_makeAppointment_run_8449']['currentDate'])+(argv['Op_Receptionist_makeAppointment_run_8449']['day']) appointment_cancelled = False state['TABLE_appointment'].add({'appointment_id': appointment_appointment_id}, {'patient_id': appointment_patient_id,'slmc_reg_no': appointment_slmc_reg_no,'date': appointment_date,'cancelled': appointment_cancelled, '__ts': now}) doctor_availability_time_slot_id = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot_id') doctor_availability_slmc_reg_no = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'slmc_reg_no') doctor_availability_day = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'day') doctor_availability_time_slot = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'time_slot') doctor_availability_current_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'current_week_appointments') doctor_availability_next_week_appointments = state['TABLE_doctor_availability'].get({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, 'next_week_appointments') doctor_availability_next_week_appointments = (doctor_availability_next_week_appointments)+(1) state['TABLE_doctor_availability'].update({'time_slot': argv['Op_Receptionist_makeAppointment_run_8449']['timeSlot'],'slmc_reg_no': argv['Op_Receptionist_makeAppointment_run_8449']['doctorId'],'day': argv['Op_Receptionist_makeAppointment_run_8449']['day']}, {'time_slot_id': doctor_availability_time_slot_id, 'slmc_reg_no': doctor_availability_slmc_reg_no, 'day': doctor_availability_day, 'time_slot': doctor_availability_time_slot, 'current_week_appointments': doctor_availability_current_week_appointments, 'next_week_appointments': doctor_availability_next_week_appointments, '__ts': now}) tmp_bill_patient_id = argv['Op_Receptionist_makeAppointment_run_8449']['patientId'] tmp_bill_appointment_fee = 500 tmp_bill_tmp_bill_id = argv['Op_Receptionist_makeAppointment_run_8449']['newTmpBillId'] state['TABLE_tmp_bill'].add({'tmp_bill_id': tmp_bill_tmp_bill_id}, {'patient_id': tmp_bill_patient_id,'appointment_fee': tmp_bill_appointment_fee, '__ts': now}) return state class Op_Pharmacist_addNewSupplier_run_8450(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Pharmacist_addNewSupplier_run_8450', 'newSupplierId')) def cond0(self, state, argv): __ts = argv['Op_Pharmacist_addNewSupplier_run_8450']['__ts'] newSupplierId = argv['Op_Pharmacist_addNewSupplier_run_8450']['newSupplierId'] name = argv['Op_Pharmacist_addNewSupplier_run_8450']['name'] return (state['TABLE_suppliers'].notNil({'supplier_id': argv['Op_Pharmacist_addNewSupplier_run_8450']['newSupplierId']}) == False) def csop0(self, state, argv): now = argv['Op_Pharmacist_addNewSupplier_run_8450']['now'] __ts = argv['Op_Pharmacist_addNewSupplier_run_8450']['__ts'] newSupplierId = argv['Op_Pharmacist_addNewSupplier_run_8450']['newSupplierId'] name = argv['Op_Pharmacist_addNewSupplier_run_8450']['name'] suppliers_supplier_id = argv['Op_Pharmacist_addNewSupplier_run_8450']['newSupplierId'] suppliers_supplier_name = argv['Op_Pharmacist_addNewSupplier_run_8450']['name'] suppliers__ts = state['TABLE_suppliers'].get({'supplier_id': suppliers_supplier_id}, '__ts') return And((suppliers__ts < now)) def sop0(self, state, argv): now = argv['Op_Pharmacist_addNewSupplier_run_8450']['now'] __ts = argv['Op_Pharmacist_addNewSupplier_run_8450']['__ts'] newSupplierId = argv['Op_Pharmacist_addNewSupplier_run_8450']['newSupplierId'] name = argv['Op_Pharmacist_addNewSupplier_run_8450']['name'] suppliers_supplier_id = argv['Op_Pharmacist_addNewSupplier_run_8450']['newSupplierId'] suppliers_supplier_name = argv['Op_Pharmacist_addNewSupplier_run_8450']['name'] state['TABLE_suppliers'].add({'supplier_id': suppliers_supplier_id}, {'supplier_name': suppliers_supplier_name, '__ts': now}) return state class Op_Pharmacist_updatePharmacistInfo_run_8451(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['__ts'] id = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id'] pharmacist_pharmacist_id = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['pharmacist_pharmacist_id'] return (state['TABLE_pharmacist'].notNil({'pharmacist_id': argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id']}) == True) def csop0(self, state, argv): now = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['now'] __ts = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['__ts'] id = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id'] pharmacist_pharmacist_id = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['pharmacist_pharmacist_id'] pharmacist__ts = state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id']}, '__ts') return And((pharmacist__ts < now)) def sop0(self, state, argv): now = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['now'] __ts = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['__ts'] id = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id'] pharmacist_pharmacist_id = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['pharmacist_pharmacist_id'] pharmacist_pharmacist_id = state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id']}, 'pharmacist_id') pharmacist_user_id = state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id']}, 'user_id') pharmacist_education = state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id']}, 'education') pharmacist_training = state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id']}, 'training') pharmacist_experience = state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id']}, 'experience') pharmacist_achievements = state['TABLE_pharmacist'].get({'pharmacist_id': argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id']}, 'achievements') pharmacist_education = argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id'] state['TABLE_pharmacist'].update({'pharmacist_id': argv['Op_Pharmacist_updatePharmacistInfo_run_8451']['id']}, {'pharmacist_id': pharmacist_pharmacist_id, 'user_id': pharmacist_user_id, 'education': pharmacist_education, 'training': pharmacist_training, 'experience': pharmacist_experience, 'achievements': pharmacist_achievements, '__ts': now}) return state class Op_LabAssistant_updateProfileInfo_run_8452(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_LabAssistant_updateProfileInfo_run_8452']['__ts'] id = argv['Op_LabAssistant_updateProfileInfo_run_8452']['id'] sys_user_person_id = argv['Op_LabAssistant_updateProfileInfo_run_8452']['sys_user_person_id'] person_person_id = argv['Op_LabAssistant_updateProfileInfo_run_8452']['person_person_id'] return And((state['TABLE_sys_user'].notNil({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}) == True),(state['TABLE_person'].notNil({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}) == True)) def csop0(self, state, argv): now = argv['Op_LabAssistant_updateProfileInfo_run_8452']['now'] __ts = argv['Op_LabAssistant_updateProfileInfo_run_8452']['__ts'] id = argv['Op_LabAssistant_updateProfileInfo_run_8452']['id'] sys_user_person_id = argv['Op_LabAssistant_updateProfileInfo_run_8452']['sys_user_person_id'] person_person_id = argv['Op_LabAssistant_updateProfileInfo_run_8452']['person_person_id'] person__ts = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, '__ts') return And((person__ts < now)) def sop0(self, state, argv): now = argv['Op_LabAssistant_updateProfileInfo_run_8452']['now'] __ts = argv['Op_LabAssistant_updateProfileInfo_run_8452']['__ts'] id = argv['Op_LabAssistant_updateProfileInfo_run_8452']['id'] sys_user_person_id = argv['Op_LabAssistant_updateProfileInfo_run_8452']['sys_user_person_id'] person_person_id = argv['Op_LabAssistant_updateProfileInfo_run_8452']['person_person_id'] person_person_id = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'person_id') person_user_id = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'user_id') person_nic = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'nic') person_gender = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'gender') person_date_of_birth = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'date_of_birth') person_address = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'address') person_mobile = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'mobile') person_first_name = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'first_name') person_last_name = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'last_name') person_email = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'email') person_nationality = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'nationality') person_religion = state['TABLE_person'].get({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, 'religion') person_address = argv['Op_LabAssistant_updateProfileInfo_run_8452']['id'] state['TABLE_person'].update({'person_id': state['TABLE_sys_user'].get({'user_id': argv['Op_LabAssistant_updateProfileInfo_run_8452']['id']}, 'person_id')}, {'person_id': person_person_id, 'user_id': person_user_id, 'nic': person_nic, 'gender': person_gender, 'date_of_birth': person_date_of_birth, 'address': person_address, 'mobile': person_mobile, 'first_name': person_first_name, 'last_name': person_last_name, 'email': person_email, 'nationality': person_nationality, 'religion': person_religion, '__ts': now}) return state class Op_Cashier_removeFromTempBill_run_8453(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Cashier_removeFromTempBill_run_8453']['__ts'] id = argv['Op_Cashier_removeFromTempBill_run_8453']['id'] return True def csop0(self, state, argv): now = argv['Op_Cashier_removeFromTempBill_run_8453']['now'] __ts = argv['Op_Cashier_removeFromTempBill_run_8453']['__ts'] id = argv['Op_Cashier_removeFromTempBill_run_8453']['id'] return And() def sop0(self, state, argv): now = argv['Op_Cashier_removeFromTempBill_run_8453']['now'] __ts = argv['Op_Cashier_removeFromTempBill_run_8453']['__ts'] id = argv['Op_Cashier_removeFromTempBill_run_8453']['id'] state['TABLE_tmp_bill'].delete({'patient_id': argv['Op_Cashier_removeFromTempBill_run_8453']['id']}) return state class Op_LabAssistant_liverFunctionTest_run_8454(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_LabAssistant_liverFunctionTest_run_8454', 'newTstId')) def cond0(self, state, argv): __ts = argv['Op_LabAssistant_liverFunctionTest_run_8454']['__ts'] newTstId = argv['Op_LabAssistant_liverFunctionTest_run_8454']['newTstId'] appId = argv['Op_LabAssistant_liverFunctionTest_run_8454']['appId'] totalBilirubin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['totalBilirubin'] albumin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['albumin'] globulin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['globulin'] directBilirubin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['directBilirubin'] sgotast = argv['Op_LabAssistant_liverFunctionTest_run_8454']['sgotast'] sgptalt = argv['Op_LabAssistant_liverFunctionTest_run_8454']['sgptalt'] alkalinePhospates = argv['Op_LabAssistant_liverFunctionTest_run_8454']['alkalinePhospates'] now = argv['Op_LabAssistant_liverFunctionTest_run_8454']['now'] return (state['TABLE_LiverFunctionTest'].notNil({'tst_liver_id': argv['Op_LabAssistant_liverFunctionTest_run_8454']['newTstId']}) == False) def csop0(self, state, argv): now = argv['Op_LabAssistant_liverFunctionTest_run_8454']['now'] __ts = argv['Op_LabAssistant_liverFunctionTest_run_8454']['__ts'] newTstId = argv['Op_LabAssistant_liverFunctionTest_run_8454']['newTstId'] appId = argv['Op_LabAssistant_liverFunctionTest_run_8454']['appId'] totalBilirubin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['totalBilirubin'] albumin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['albumin'] globulin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['globulin'] directBilirubin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['directBilirubin'] sgotast = argv['Op_LabAssistant_liverFunctionTest_run_8454']['sgotast'] sgptalt = argv['Op_LabAssistant_liverFunctionTest_run_8454']['sgptalt'] alkalinePhospates = argv['Op_LabAssistant_liverFunctionTest_run_8454']['alkalinePhospates'] now = argv['Op_LabAssistant_liverFunctionTest_run_8454']['now'] LiverFunctionTest_tst_liver_id = argv['Op_LabAssistant_liverFunctionTest_run_8454']['newTstId'] LiverFunctionTest_appointment_id = argv['Op_LabAssistant_liverFunctionTest_run_8454']['appId'] LiverFunctionTest_totalProtein = argv['Op_LabAssistant_liverFunctionTest_run_8454']['totalBilirubin'] LiverFunctionTest_albumin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['albumin'] LiverFunctionTest_globulin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['globulin'] LiverFunctionTest_totalBilirubin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['totalBilirubin'] LiverFunctionTest_directBilirubin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['directBilirubin'] LiverFunctionTest_sgotast = argv['Op_LabAssistant_liverFunctionTest_run_8454']['sgotast'] LiverFunctionTest_sgptalt = argv['Op_LabAssistant_liverFunctionTest_run_8454']['sgptalt'] LiverFunctionTest_alkalinePhospates = argv['Op_LabAssistant_liverFunctionTest_run_8454']['alkalinePhospates'] LiverFunctionTest_date = argv['Op_LabAssistant_liverFunctionTest_run_8454']['now'] LiverFunctionTest__ts = state['TABLE_LiverFunctionTest'].get({'tst_liver_id': LiverFunctionTest_tst_liver_id}, '__ts') return And((LiverFunctionTest__ts < now)) def sop0(self, state, argv): now = argv['Op_LabAssistant_liverFunctionTest_run_8454']['now'] __ts = argv['Op_LabAssistant_liverFunctionTest_run_8454']['__ts'] newTstId = argv['Op_LabAssistant_liverFunctionTest_run_8454']['newTstId'] appId = argv['Op_LabAssistant_liverFunctionTest_run_8454']['appId'] totalBilirubin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['totalBilirubin'] albumin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['albumin'] globulin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['globulin'] directBilirubin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['directBilirubin'] sgotast = argv['Op_LabAssistant_liverFunctionTest_run_8454']['sgotast'] sgptalt = argv['Op_LabAssistant_liverFunctionTest_run_8454']['sgptalt'] alkalinePhospates = argv['Op_LabAssistant_liverFunctionTest_run_8454']['alkalinePhospates'] now = argv['Op_LabAssistant_liverFunctionTest_run_8454']['now'] LiverFunctionTest_tst_liver_id = argv['Op_LabAssistant_liverFunctionTest_run_8454']['newTstId'] LiverFunctionTest_appointment_id = argv['Op_LabAssistant_liverFunctionTest_run_8454']['appId'] LiverFunctionTest_totalProtein = argv['Op_LabAssistant_liverFunctionTest_run_8454']['totalBilirubin'] LiverFunctionTest_albumin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['albumin'] LiverFunctionTest_globulin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['globulin'] LiverFunctionTest_totalBilirubin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['totalBilirubin'] LiverFunctionTest_directBilirubin = argv['Op_LabAssistant_liverFunctionTest_run_8454']['directBilirubin'] LiverFunctionTest_sgotast = argv['Op_LabAssistant_liverFunctionTest_run_8454']['sgotast'] LiverFunctionTest_sgptalt = argv['Op_LabAssistant_liverFunctionTest_run_8454']['sgptalt'] LiverFunctionTest_alkalinePhospates = argv['Op_LabAssistant_liverFunctionTest_run_8454']['alkalinePhospates'] LiverFunctionTest_date = argv['Op_LabAssistant_liverFunctionTest_run_8454']['now'] state['TABLE_LiverFunctionTest'].add({'tst_liver_id': LiverFunctionTest_tst_liver_id}, {'appointment_id': LiverFunctionTest_appointment_id,'totalProtein': LiverFunctionTest_totalProtein,'albumin': LiverFunctionTest_albumin,'globulin': LiverFunctionTest_globulin,'totalBilirubin': LiverFunctionTest_totalBilirubin,'directBilirubin': LiverFunctionTest_directBilirubin,'sgotast': LiverFunctionTest_sgotast,'sgptalt': LiverFunctionTest_sgptalt,'alkalinePhospates': LiverFunctionTest_alkalinePhospates,'date': LiverFunctionTest_date, '__ts': now}) return state class Op_Receptionist_cancelLabAppointment_run_8455(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0), (self.cond1, self.csop1, self.sop1), (self.cond2, self.csop2, self.sop2)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Receptionist_cancelLabAppointment_run_8455', 'newRefundId')) def cond0(self, state, argv): __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] lab_appointment_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] bill_total = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_total'] now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] lab_appointment_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] bill_total = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_total'] now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] bill_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_bill_id'] return And((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}) == True),Not((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}) == True)),Not((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}) == True)),Not((state['TABLE_bill'].notNil({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}) == True)),Not((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}) == True)),Not((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}) == True)),Not((state['TABLE_bill'].notNil({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}) == True)),Not((state['TABLE_bill'].notNil({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}) == True))) def csop0(self, state, argv): now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] lab_appointment__ts = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, '__ts') return And((lab_appointment__ts < now)) def sop0(self, state, argv): now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] lab_appointment_lab_appointment_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'lab_appointment_id') lab_appointment_test_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'test_id') lab_appointment_date = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'date') lab_appointment_info = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'info') lab_appointment_patient_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'patient_id') lab_appointment_bill_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id') lab_appointment_lab_assistant_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'lab_assistant_id') lab_appointment_cancelled = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'cancelled') lab_appointment_doctor_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'doctor_id') lab_appointment_cancelled = True state['TABLE_lab_appointment'].update({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, {'lab_appointment_id': lab_appointment_lab_appointment_id, 'test_id': lab_appointment_test_id, 'date': lab_appointment_date, 'info': lab_appointment_info, 'patient_id': lab_appointment_patient_id, 'bill_id': lab_appointment_bill_id, 'lab_assistant_id': lab_appointment_lab_assistant_id, 'cancelled': lab_appointment_cancelled, 'doctor_id': lab_appointment_doctor_id, '__ts': now}) return state def cond1(self, state, argv): __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] lab_appointment_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] bill_total = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_total'] now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] lab_appointment_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] bill_total = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_total'] now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] bill_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_bill_id'] return And((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}) == True),(state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}) == True),(state['TABLE_bill'].notNil({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}) == True),Not((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}) == True)),Not((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}) == True)),Not((state['TABLE_bill'].notNil({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}) == True)),Not((state['TABLE_bill'].notNil({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}) == True))) def csop1(self, state, argv): now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] lab_appointment_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] bill_total = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_total'] now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] lab_appointment__ts = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, '__ts') refund_refund_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] refund_bill_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id') refund_payment_type = StringVal('docApp') refund_reason = StringVal('no_reason') refund_amount = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'total') refund_date = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] refund__ts = state['TABLE_refund'].get({'refund_id': refund_refund_id}, '__ts') return And((lab_appointment__ts < now), (refund__ts < now)) def sop1(self, state, argv): now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] lab_appointment_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] bill_total = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_total'] now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] lab_appointment_lab_appointment_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'lab_appointment_id') lab_appointment_test_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'test_id') lab_appointment_date = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'date') lab_appointment_info = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'info') lab_appointment_patient_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'patient_id') lab_appointment_bill_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id') lab_appointment_lab_assistant_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'lab_assistant_id') lab_appointment_cancelled = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'cancelled') lab_appointment_doctor_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'doctor_id') lab_appointment_cancelled = True state['TABLE_lab_appointment'].update({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, {'lab_appointment_id': lab_appointment_lab_appointment_id, 'test_id': lab_appointment_test_id, 'date': lab_appointment_date, 'info': lab_appointment_info, 'patient_id': lab_appointment_patient_id, 'bill_id': lab_appointment_bill_id, 'lab_assistant_id': lab_appointment_lab_assistant_id, 'cancelled': lab_appointment_cancelled, 'doctor_id': lab_appointment_doctor_id, '__ts': now}) refund_refund_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] refund_bill_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id') refund_payment_type = StringVal('docApp') refund_reason = StringVal('no_reason') refund_amount = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'total') refund_date = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] state['TABLE_refund'].add({'refund_id': refund_refund_id}, {'bill_id': refund_bill_id,'payment_type': refund_payment_type,'reason': refund_reason,'amount': refund_amount,'date': refund_date, '__ts': now}) return state def cond2(self, state, argv): __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] lab_appointment_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] bill_total = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_total'] now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] bill_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_bill_id'] return And((state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}) == True),(state['TABLE_lab_appointment'].notNil({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}) == True),(state['TABLE_bill'].notNil({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}) == True),(state['TABLE_bill'].notNil({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}) == True)) def csop2(self, state, argv): now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] lab_appointment_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] bill_total = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_total'] now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] bill_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_bill_id'] lab_appointment__ts = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, '__ts') refund_refund_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] refund_bill_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id') refund_payment_type = StringVal('docApp') refund_reason = StringVal('no_reason') refund_amount = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'total') refund_date = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] refund__ts = state['TABLE_refund'].get({'refund_id': refund_refund_id}, '__ts') bill__ts = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, '__ts') return And((lab_appointment__ts < now), (refund__ts < now), (bill__ts < now)) def sop2(self, state, argv): now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] __ts = argv['Op_Receptionist_cancelLabAppointment_run_8455']['__ts'] labAppointmentId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId'] lab_appointment_lab_appointment_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_lab_appointment_id'] lab_appointment_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['lab_appointment_bill_id'] newRefundId = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] bill_total = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_total'] now = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] bill_bill_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['bill_bill_id'] lab_appointment_lab_appointment_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'lab_appointment_id') lab_appointment_test_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'test_id') lab_appointment_date = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'date') lab_appointment_info = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'info') lab_appointment_patient_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'patient_id') lab_appointment_bill_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id') lab_appointment_lab_assistant_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'lab_assistant_id') lab_appointment_cancelled = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'cancelled') lab_appointment_doctor_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'doctor_id') lab_appointment_cancelled = True state['TABLE_lab_appointment'].update({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, {'lab_appointment_id': lab_appointment_lab_appointment_id, 'test_id': lab_appointment_test_id, 'date': lab_appointment_date, 'info': lab_appointment_info, 'patient_id': lab_appointment_patient_id, 'bill_id': lab_appointment_bill_id, 'lab_assistant_id': lab_appointment_lab_assistant_id, 'cancelled': lab_appointment_cancelled, 'doctor_id': lab_appointment_doctor_id, '__ts': now}) refund_refund_id = argv['Op_Receptionist_cancelLabAppointment_run_8455']['newRefundId'] refund_bill_id = state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id') refund_payment_type = StringVal('docApp') refund_reason = StringVal('no_reason') refund_amount = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'total') refund_date = argv['Op_Receptionist_cancelLabAppointment_run_8455']['now'] state['TABLE_refund'].add({'refund_id': refund_refund_id}, {'bill_id': refund_bill_id,'payment_type': refund_payment_type,'reason': refund_reason,'amount': refund_amount,'date': refund_date, '__ts': now}) bill_bill_id = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'bill_id') bill_bill_date = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'bill_date') bill_doctor_fee = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'doctor_fee') bill_hospital_fee = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'hospital_fee') bill_pharmacy_fee = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'pharmacy_fee') bill_laboratory_fee = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'laboratory_fee') bill_appointment_fee = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'appointment_fee') bill_vat = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'vat') bill_discount = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'discount') bill_total = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'total') bill_payment_method = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'payment_method') bill_consultant_id = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'consultant_id') bill_patient_id = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'patient_id') bill_refund = state['TABLE_bill'].get({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, 'refund') bill_refund = 1 state['TABLE_bill'].update({'bill_id': state['TABLE_lab_appointment'].get({'lab_appointment_id': argv['Op_Receptionist_cancelLabAppointment_run_8455']['labAppointmentId']}, 'bill_id')}, {'bill_id': bill_bill_id, 'bill_date': bill_bill_date, 'doctor_fee': bill_doctor_fee, 'hospital_fee': bill_hospital_fee, 'pharmacy_fee': bill_pharmacy_fee, 'laboratory_fee': bill_laboratory_fee, 'appointment_fee': bill_appointment_fee, 'vat': bill_vat, 'discount': bill_discount, 'total': bill_total, 'payment_method': bill_payment_method, 'consultant_id': bill_consultant_id, 'patient_id': bill_patient_id, 'refund': bill_refund, '__ts': now}) return state class Op_Pharmacist_addNewBrand_run_8456(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_Pharmacist_addNewBrand_run_8456', 'newBrandId')) def cond0(self, state, argv): __ts = argv['Op_Pharmacist_addNewBrand_run_8456']['__ts'] newBrandId = argv['Op_Pharmacist_addNewBrand_run_8456']['newBrandId'] brandName = argv['Op_Pharmacist_addNewBrand_run_8456']['brandName'] genericName = argv['Op_Pharmacist_addNewBrand_run_8456']['genericName'] drugType = argv['Op_Pharmacist_addNewBrand_run_8456']['drugType'] drugUnit = argv['Op_Pharmacist_addNewBrand_run_8456']['drugUnit'] unitPrice = argv['Op_Pharmacist_addNewBrand_run_8456']['unitPrice'] return (state['TABLE_drug_brand_names'].notNil({'brand_id': argv['Op_Pharmacist_addNewBrand_run_8456']['newBrandId']}) == False) def csop0(self, state, argv): now = argv['Op_Pharmacist_addNewBrand_run_8456']['now'] __ts = argv['Op_Pharmacist_addNewBrand_run_8456']['__ts'] newBrandId = argv['Op_Pharmacist_addNewBrand_run_8456']['newBrandId'] brandName = argv['Op_Pharmacist_addNewBrand_run_8456']['brandName'] genericName = argv['Op_Pharmacist_addNewBrand_run_8456']['genericName'] drugType = argv['Op_Pharmacist_addNewBrand_run_8456']['drugType'] drugUnit = argv['Op_Pharmacist_addNewBrand_run_8456']['drugUnit'] unitPrice = argv['Op_Pharmacist_addNewBrand_run_8456']['unitPrice'] drug_brand_names_brand_id = argv['Op_Pharmacist_addNewBrand_run_8456']['newBrandId'] drug_brand_names_brand_name = argv['Op_Pharmacist_addNewBrand_run_8456']['brandName'] drug_brand_names_generic_name = argv['Op_Pharmacist_addNewBrand_run_8456']['genericName'] drug_brand_names_drug_type = argv['Op_Pharmacist_addNewBrand_run_8456']['drugType'] drug_brand_names_drug_unit = argv['Op_Pharmacist_addNewBrand_run_8456']['drugUnit'] drug_brand_names_unit_price = argv['Op_Pharmacist_addNewBrand_run_8456']['unitPrice'] drug_brand_names__ts = state['TABLE_drug_brand_names'].get({'brand_id': drug_brand_names_brand_id}, '__ts') return And((drug_brand_names__ts < now)) def sop0(self, state, argv): now = argv['Op_Pharmacist_addNewBrand_run_8456']['now'] __ts = argv['Op_Pharmacist_addNewBrand_run_8456']['__ts'] newBrandId = argv['Op_Pharmacist_addNewBrand_run_8456']['newBrandId'] brandName = argv['Op_Pharmacist_addNewBrand_run_8456']['brandName'] genericName = argv['Op_Pharmacist_addNewBrand_run_8456']['genericName'] drugType = argv['Op_Pharmacist_addNewBrand_run_8456']['drugType'] drugUnit = argv['Op_Pharmacist_addNewBrand_run_8456']['drugUnit'] unitPrice = argv['Op_Pharmacist_addNewBrand_run_8456']['unitPrice'] drug_brand_names_brand_id = argv['Op_Pharmacist_addNewBrand_run_8456']['newBrandId'] drug_brand_names_brand_name = argv['Op_Pharmacist_addNewBrand_run_8456']['brandName'] drug_brand_names_generic_name = argv['Op_Pharmacist_addNewBrand_run_8456']['genericName'] drug_brand_names_drug_type = argv['Op_Pharmacist_addNewBrand_run_8456']['drugType'] drug_brand_names_drug_unit = argv['Op_Pharmacist_addNewBrand_run_8456']['drugUnit'] drug_brand_names_unit_price = argv['Op_Pharmacist_addNewBrand_run_8456']['unitPrice'] state['TABLE_drug_brand_names'].add({'brand_id': drug_brand_names_brand_id}, {'brand_name': drug_brand_names_brand_name,'generic_name': drug_brand_names_generic_name,'drug_type': drug_brand_names_drug_type,'drug_unit': drug_brand_names_drug_unit,'unit_price': drug_brand_names_unit_price, '__ts': now}) return state class Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomsAnd(AxiomUniqueArgument('Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457', 'newTstId')) def cond0(self, state, argv): __ts = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['__ts'] newTstId = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['newTstId'] appId = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['appId'] hiv12ELISA = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['hiv12ELISA'] now = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['now'] return (state['TABLE_SeriumCreatinePhosphokinase'].notNil({'tst_SCP_id': argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['newTstId']}) == False) def csop0(self, state, argv): now = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['now'] __ts = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['__ts'] newTstId = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['newTstId'] appId = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['appId'] hiv12ELISA = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['hiv12ELISA'] now = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['now'] SeriumCreatinePhosphokinase_tst_SCP_id = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['newTstId'] SeriumCreatinePhosphokinase_appointment_id = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['appId'] SeriumCreatinePhosphokinase_hiv12ELISA = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['hiv12ELISA'] SeriumCreatinePhosphokinase_date = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['now'] SeriumCreatinePhosphokinase__ts = state['TABLE_SeriumCreatinePhosphokinase'].get({'tst_SCP_id': SeriumCreatinePhosphokinase_tst_SCP_id}, '__ts') return And((SeriumCreatinePhosphokinase__ts < now)) def sop0(self, state, argv): now = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['now'] __ts = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['__ts'] newTstId = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['newTstId'] appId = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['appId'] hiv12ELISA = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['hiv12ELISA'] now = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['now'] SeriumCreatinePhosphokinase_tst_SCP_id = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['newTstId'] SeriumCreatinePhosphokinase_appointment_id = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['appId'] SeriumCreatinePhosphokinase_hiv12ELISA = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['hiv12ELISA'] SeriumCreatinePhosphokinase_date = argv['Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457']['now'] state['TABLE_SeriumCreatinePhosphokinase'].add({'tst_SCP_id': SeriumCreatinePhosphokinase_tst_SCP_id}, {'appointment_id': SeriumCreatinePhosphokinase_appointment_id,'hiv12ELISA': SeriumCreatinePhosphokinase_hiv12ELISA,'date': SeriumCreatinePhosphokinase_date, '__ts': now}) return state class Op_Doctor_removeDoctorTime_run_8458(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Doctor_removeDoctorTime_run_8458']['__ts'] id = argv['Op_Doctor_removeDoctorTime_run_8458']['id'] return True def csop0(self, state, argv): now = argv['Op_Doctor_removeDoctorTime_run_8458']['now'] __ts = argv['Op_Doctor_removeDoctorTime_run_8458']['__ts'] id = argv['Op_Doctor_removeDoctorTime_run_8458']['id'] return And() def sop0(self, state, argv): now = argv['Op_Doctor_removeDoctorTime_run_8458']['now'] __ts = argv['Op_Doctor_removeDoctorTime_run_8458']['__ts'] id = argv['Op_Doctor_removeDoctorTime_run_8458']['id'] state['TABLE_doctor_availability'].delete({'time_slot_id': argv['Op_Doctor_removeDoctorTime_run_8458']['id']}) return state class Op_Admin_updateAccountInfo_run_8459(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Admin_updateAccountInfo_run_8459']['__ts'] id = argv['Op_Admin_updateAccountInfo_run_8459']['id'] sys_user_user_id = argv['Op_Admin_updateAccountInfo_run_8459']['sys_user_user_id'] return (state['TABLE_sys_user'].notNil({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}) == True) def csop0(self, state, argv): now = argv['Op_Admin_updateAccountInfo_run_8459']['now'] __ts = argv['Op_Admin_updateAccountInfo_run_8459']['__ts'] id = argv['Op_Admin_updateAccountInfo_run_8459']['id'] sys_user_user_id = argv['Op_Admin_updateAccountInfo_run_8459']['sys_user_user_id'] sys_user__ts = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, '__ts') return And((sys_user__ts < now)) def sop0(self, state, argv): now = argv['Op_Admin_updateAccountInfo_run_8459']['now'] __ts = argv['Op_Admin_updateAccountInfo_run_8459']['__ts'] id = argv['Op_Admin_updateAccountInfo_run_8459']['id'] sys_user_user_id = argv['Op_Admin_updateAccountInfo_run_8459']['sys_user_user_id'] sys_user_person_id = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, 'person_id') sys_user_user_id = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, 'user_id') sys_user_user_name = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, 'user_name') sys_user_user_type = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, 'user_type') sys_user_other_info = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, 'other_info') sys_user_password = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, 'password') sys_user_online = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, 'online') sys_user_login = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, 'login') sys_user_logout = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, 'logout') sys_user_profile_pic = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, 'profile_pic') sys_user_suspend = state['TABLE_sys_user'].get({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, 'suspend') sys_user_other_info = argv['Op_Admin_updateAccountInfo_run_8459']['id'] state['TABLE_sys_user'].update({'user_id': argv['Op_Admin_updateAccountInfo_run_8459']['id']}, {'person_id': sys_user_person_id, 'user_id': sys_user_user_id, 'user_name': sys_user_user_name, 'user_type': sys_user_user_type, 'other_info': sys_user_other_info, 'password': sys_user_password, 'online': sys_user_online, 'login': sys_user_login, 'logout': sys_user_logout, 'profile_pic': sys_user_profile_pic, 'suspend': sys_user_suspend, '__ts': now}) return state class Op_LabAssistant_updateAccountInfo_run_8460(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_LabAssistant_updateAccountInfo_run_8460']['__ts'] id = argv['Op_LabAssistant_updateAccountInfo_run_8460']['id'] doctor_user_id = argv['Op_LabAssistant_updateAccountInfo_run_8460']['doctor_user_id'] sys_user_user_id = argv['Op_LabAssistant_updateAccountInfo_run_8460']['sys_user_user_id'] return And((state['TABLE_doctor'].notNil({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}) == True),(state['TABLE_sys_user'].notNil({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}) == True)) def csop0(self, state, argv): now = argv['Op_LabAssistant_updateAccountInfo_run_8460']['now'] __ts = argv['Op_LabAssistant_updateAccountInfo_run_8460']['__ts'] id = argv['Op_LabAssistant_updateAccountInfo_run_8460']['id'] doctor_user_id = argv['Op_LabAssistant_updateAccountInfo_run_8460']['doctor_user_id'] sys_user_user_id = argv['Op_LabAssistant_updateAccountInfo_run_8460']['sys_user_user_id'] sys_user__ts = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, '__ts') return And((sys_user__ts < now)) def sop0(self, state, argv): now = argv['Op_LabAssistant_updateAccountInfo_run_8460']['now'] __ts = argv['Op_LabAssistant_updateAccountInfo_run_8460']['__ts'] id = argv['Op_LabAssistant_updateAccountInfo_run_8460']['id'] doctor_user_id = argv['Op_LabAssistant_updateAccountInfo_run_8460']['doctor_user_id'] sys_user_user_id = argv['Op_LabAssistant_updateAccountInfo_run_8460']['sys_user_user_id'] sys_user_person_id = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, 'person_id') sys_user_user_id = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, 'user_id') sys_user_user_name = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, 'user_name') sys_user_user_type = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, 'user_type') sys_user_other_info = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, 'other_info') sys_user_password = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, 'password') sys_user_online = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, 'online') sys_user_login = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, 'login') sys_user_logout = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, 'logout') sys_user_profile_pic = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, 'profile_pic') sys_user_suspend = state['TABLE_sys_user'].get({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, 'suspend') sys_user_other_info = argv['Op_LabAssistant_updateAccountInfo_run_8460']['id'] state['TABLE_sys_user'].update({'user_id': state['TABLE_doctor'].get({'slmc_reg_no': argv['Op_LabAssistant_updateAccountInfo_run_8460']['id']}, 'user_id')}, {'person_id': sys_user_person_id, 'user_id': sys_user_user_id, 'user_name': sys_user_user_name, 'user_type': sys_user_user_type, 'other_info': sys_user_other_info, 'password': sys_user_password, 'online': sys_user_online, 'login': sys_user_login, 'logout': sys_user_logout, 'profile_pic': sys_user_profile_pic, 'suspend': sys_user_suspend, '__ts': now}) return state class Op_Cashier_updateProfileInfo_run_8461(): def __init__(self): self.sops = [(self.cond0, self.csop0, self.sop0)] self.axiom = AxiomEmpty() def cond0(self, state, argv): __ts = argv['Op_Cashier_updateProfileInfo_run_8461']['__ts'] id = argv['Op_Cashier_updateProfileInfo_run_8461']['id'] sys_user_person_id = argv['Op_Cashier_updateProfileInfo_run_8461']['sys_user_person_id'] return (state['TABLE_sys_user'].notNil({'user_id': argv['Op_Cashier_updateProfileInfo_run_8461']['id']}) == True) def csop0(self, state, argv): now = argv['Op_Cashier_updateProfileInfo_run_8461']['now'] __ts = argv['Op_Cashier_updateProfileInfo_run_8461']['__ts'] id = argv['Op_Cashier_updateProfileInfo_run_8461']['id'] sys_user_person_id = argv['Op_Cashier_updateProfileInfo_run_8461']['sys_user_person_id'] return And() def sop0(self, state, argv): now = argv['Op_Cashier_updateProfileInfo_run_8461']['now'] __ts = argv['Op_Cashier_updateProfileInfo_run_8461']['__ts'] id = argv['Op_Cashier_updateProfileInfo_run_8461']['id'] sys_user_person_id = argv['Op_Cashier_updateProfileInfo_run_8461']['sys_user_person_id'] return state class HealthPlus(): def __init__(self): self.ops = [Op_Doctor_doctorTimeTableAddSlot_run_8412(),Op_Pharmacist_addNewDrug2_run_8413(),Op_Cashier_bill_run_8414(),Op_Pharmacist_updateStock_run_8415(),Op_Pharmacist_reduceStock_run_8416(),Op_LabAssistant_updateLabAssistantInfo_run_8417(),Op_Receptionist_updateAccountInfo_run_8418(),Op_Doctor_diagnose_run_8419(),Op_Pharmacist_updateAccountInfo_run_8420(),Op_LabAssistant_UrineFullReport_run_8421(),Op_Receptionist_cancelAppointment_run_8422(),Op_Cashier_makeRefund_run_8423(),Op_Cashier_refund_run_8424(),Op_Doctor_allergies_run_8425(),Op_Admin_createNewUser_run_8426(),Op_Pharmacist_bill_run_8427(),Op_Receptionist_updatePatientInfo_run_8428(),Op_Doctor_updateDoctorInfo_run_8429(),Op_Receptionist_updateProfileInfo_run_8430(),Op_LabAssistant_SeriumCreatinePhosphokinaseTotal_run_8431(),Op_Cashier_updateAccountInfo_run_8432(),Op_Admin_suspendUser_run_8433(),Op_Doctor_updateProfileInfo_run_8434(),Op_Pharmacist_updateProfileInfo_run_8435(),Op_Doctor_bill_run_8436(),Op_LabAssistant_BloodGroupingTest_run_8437(),Op_Doctor_prescribe_run_8438(),Op_Receptionist_setPatientInfo_run_8439(),Op_LabAssistant_RenalFunctionTest_run_8440(),Op_Admin_updateProfileInfo_run_8441(),Op_Admin_resetPassword_run_8442(),Op_Receptionist_refund_run_8443(),Op_Admin_unsuspendUser_run_8444(),Op_Receptionist_makeLabAppointment_run_8445(),Op_LabAssistant_LipidTest_run_8446(),Op_Doctor_updateAccountInfo_run_8447(),Op_LabAssistant_completeBloodCount_run_8448(),Op_Receptionist_makeAppointment_run_8449(),Op_Pharmacist_addNewSupplier_run_8450(),Op_Pharmacist_updatePharmacistInfo_run_8451(),Op_LabAssistant_updateProfileInfo_run_8452(),Op_Cashier_removeFromTempBill_run_8453(),Op_LabAssistant_liverFunctionTest_run_8454(),Op_Receptionist_cancelLabAppointment_run_8455(),Op_Pharmacist_addNewBrand_run_8456(),Op_LabAssistant_SeriumCreatinePhosphokinase_run_8457(),Op_Doctor_removeDoctorTime_run_8458(),Op_Admin_updateAccountInfo_run_8459(),Op_LabAssistant_updateAccountInfo_run_8460(),Op_Cashier_updateProfileInfo_run_8461()] self.tables = [BloodGroupingRh, LipidTest, LiverFunctionTest, RenalFunctionTest, SeriumCreatinePhosphokinase, SeriumCreatinePhosphokinaseTotal, UrineFullReport, appointment, bill, completeBloodCount, diagnose_history, doctor, doctor_availability, drug, drug_brand_names, lab_appointment, lab_appointment_timetable, lab_assistant, lab_test, medical_history, patient, patient_message_receive, patient_message_send, patient_useraccount, person, pharmacist, pharmacy_history, pharmacy_stock, prescription, refund, signup, suppliers, sys_user, tempappointment, tmp_bill, user_message, website_messages] self.state = GenState self.argv = GenArgv self.axiom = AxiomsAnd(BuildArgvAxiom(self.ops), AxiomCausal('Op_Pharmacist_updateStock_run_8415', ['newStockId'], 'Op_Pharmacist_reduceStock_run_8416', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_diagnose_run_8419', ['doctorId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_doctorTimeTableAddSlot_run_8412', ['slmcReg']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_updateDoctorInfo_run_8429', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_updateProfileInfo_run_8434', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_diagnose_run_8419', ['doctorId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_doctorTimeTableAddSlot_run_8412', ['slmcReg']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_updateDoctorInfo_run_8429', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_updateProfileInfo_run_8434', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_diagnose_run_8419', ['doctorId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_doctorTimeTableAddSlot_run_8412', ['slmcReg']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_updateDoctorInfo_run_8429', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_updateProfileInfo_run_8434', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_diagnose_run_8419', ['doctorId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_doctorTimeTableAddSlot_run_8412', ['slmcReg']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_updateDoctorInfo_run_8429', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newSlmcReg'], 'Op_Doctor_updateProfileInfo_run_8434', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Receptionist_updateProfileInfo_run_8430', ['userId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Cashier_updateAccountInfo_run_8432', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_suspendUser_run_8433', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Pharmacist_updateProfileInfo_run_8435', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateProfileInfo_run_8441', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_resetPassword_run_8442', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_unsuspendUser_run_8444', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_LabAssistant_updateProfileInfo_run_8452', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateAccountInfo_run_8459', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Receptionist_updateProfileInfo_run_8430', ['userId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Cashier_updateAccountInfo_run_8432', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_suspendUser_run_8433', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Pharmacist_updateProfileInfo_run_8435', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateProfileInfo_run_8441', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_resetPassword_run_8442', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_unsuspendUser_run_8444', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_LabAssistant_updateProfileInfo_run_8452', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateAccountInfo_run_8459', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Receptionist_updateProfileInfo_run_8430', ['userId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Cashier_updateAccountInfo_run_8432', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_suspendUser_run_8433', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Pharmacist_updateProfileInfo_run_8435', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateProfileInfo_run_8441', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_resetPassword_run_8442', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_unsuspendUser_run_8444', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_LabAssistant_updateProfileInfo_run_8452', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateAccountInfo_run_8459', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Receptionist_updateProfileInfo_run_8430', ['userId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Cashier_updateAccountInfo_run_8432', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_suspendUser_run_8433', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Pharmacist_updateProfileInfo_run_8435', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateProfileInfo_run_8441', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_resetPassword_run_8442', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_unsuspendUser_run_8444', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_LabAssistant_updateProfileInfo_run_8452', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateAccountInfo_run_8459', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Receptionist_updateProfileInfo_run_8430', ['userId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Cashier_updateAccountInfo_run_8432', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_suspendUser_run_8433', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Pharmacist_updateProfileInfo_run_8435', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateProfileInfo_run_8441', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_resetPassword_run_8442', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_unsuspendUser_run_8444', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_LabAssistant_updateProfileInfo_run_8452', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateAccountInfo_run_8459', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Receptionist_updateProfileInfo_run_8430', ['userId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Cashier_updateAccountInfo_run_8432', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_suspendUser_run_8433', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Pharmacist_updateProfileInfo_run_8435', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateProfileInfo_run_8441', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_resetPassword_run_8442', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_unsuspendUser_run_8444', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_LabAssistant_updateProfileInfo_run_8452', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateAccountInfo_run_8459', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Receptionist_updateProfileInfo_run_8430', ['userId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Cashier_updateAccountInfo_run_8432', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_suspendUser_run_8433', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Pharmacist_updateProfileInfo_run_8435', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateProfileInfo_run_8441', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_resetPassword_run_8442', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_unsuspendUser_run_8444', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_LabAssistant_updateProfileInfo_run_8452', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateAccountInfo_run_8459', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Receptionist_updateProfileInfo_run_8430', ['userId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Cashier_updateAccountInfo_run_8432', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_suspendUser_run_8433', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Pharmacist_updateProfileInfo_run_8435', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateProfileInfo_run_8441', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_resetPassword_run_8442', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_unsuspendUser_run_8444', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_LabAssistant_updateProfileInfo_run_8452', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateAccountInfo_run_8459', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Receptionist_updateProfileInfo_run_8430', ['userId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Cashier_updateAccountInfo_run_8432', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_suspendUser_run_8433', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Pharmacist_updateProfileInfo_run_8435', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateProfileInfo_run_8441', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_resetPassword_run_8442', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_unsuspendUser_run_8444', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_LabAssistant_updateProfileInfo_run_8452', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newUserId'], 'Op_Admin_updateAccountInfo_run_8459', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newLabAssistantId'], 'Op_LabAssistant_updateLabAssistantInfo_run_8417', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newPharmacistId'], 'Op_Pharmacist_updateAccountInfo_run_8420', ['pharmacistId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newPharmacistId'], 'Op_Pharmacist_updatePharmacistInfo_run_8451', ['id']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newPharmacistId'], 'Op_Pharmacist_updateAccountInfo_run_8420', ['pharmacistId']), AxiomCausal('Op_Admin_createNewUser_run_8426', ['newPharmacistId'], 'Op_Pharmacist_updatePharmacistInfo_run_8451', ['id']), AxiomCausal('Op_Receptionist_makeLabAppointment_run_8445', ['newAppId'], 'Op_Receptionist_cancelLabAppointment_run_8455', ['labAppointmentId']), AxiomCausal('Op_Receptionist_makeAppointment_run_8449', ['newAppId'], 'Op_Receptionist_cancelAppointment_run_8422', ['appointmentId'])) def factory(): cls = globals()["HealthPlus"] return cls() if __name__ == '__main__': check_parallel(factory, 8)
88.343042
11,915
0.755776
55,144
464,066
5.847762
0.007653
0.065737
0.080994
0.063479
0.957925
0.918498
0.899451
0.882758
0.875771
0.871132
0
0.039501
0.107918
464,066
5,252
11,916
88.359863
0.739437
0
0
0.75351
0
0
0.476255
0.326884
0
0
0
0
0
1
0.05512
false
0.013832
0.001445
0
0.111685
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
4ac4a388ab6c68e313885439546bafd38151c887
42,140
py
Python
tests/api/v2_2_1/test_event_management.py
oboehmer/dnacentersdk
25c4e99900640deee91a56aa886874d9cb0ca960
[ "MIT" ]
32
2019-09-05T05:16:56.000Z
2022-03-22T09:50:38.000Z
tests/api/v2_2_1/test_event_management.py
oboehmer/dnacentersdk
25c4e99900640deee91a56aa886874d9cb0ca960
[ "MIT" ]
35
2019-09-07T18:58:54.000Z
2022-03-24T19:29:36.000Z
tests/api/v2_2_1/test_event_management.py
oboehmer/dnacentersdk
25c4e99900640deee91a56aa886874d9cb0ca960
[ "MIT" ]
18
2019-09-09T11:07:21.000Z
2022-03-25T08:49:59.000Z
# -*- coding: utf-8 -*- """DNACenterAPI event_management API fixtures and tests. Copyright (c) 2019-2021 Cisco Systems. 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. """ import pytest from fastjsonschema.exceptions import JsonSchemaException from dnacentersdk.exceptions import MalformedRequest from tests.environment import DNA_CENTER_VERSION pytestmark = pytest.mark.skipif(DNA_CENTER_VERSION != '2.2.1', reason='version does not match') def is_valid_count_of_event_subscriptions(json_schema_validate, obj): json_schema_validate('jsd_c538dc50a4555b5fba17b672a89ee1b8_v2_2_1').validate(obj) return True def count_of_event_subscriptions(api): endpoint_result = api.event_management.count_of_event_subscriptions( event_ids='string' ) return endpoint_result @pytest.mark.event_management def test_count_of_event_subscriptions(api, validator): try: assert is_valid_count_of_event_subscriptions( validator, count_of_event_subscriptions(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def count_of_event_subscriptions_default(api): endpoint_result = api.event_management.count_of_event_subscriptions( event_ids=None ) return endpoint_result @pytest.mark.event_management def test_count_of_event_subscriptions_default(api, validator): try: assert is_valid_count_of_event_subscriptions( validator, count_of_event_subscriptions_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_count_of_notifications(json_schema_validate, obj): json_schema_validate('jsd_4431fd269fe156e4b5ad3f4210b7b168_v2_2_1').validate(obj) return True def count_of_notifications(api): endpoint_result = api.event_management.count_of_notifications( category='string', domain='string', end_time=0, event_ids='string', severity='string', source='string', start_time=0, sub_domain='string', type='string' ) return endpoint_result @pytest.mark.event_management def test_count_of_notifications(api, validator): try: assert is_valid_count_of_notifications( validator, count_of_notifications(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def count_of_notifications_default(api): endpoint_result = api.event_management.count_of_notifications( category=None, domain=None, end_time=None, event_ids=None, severity=None, source=None, start_time=None, sub_domain=None, type=None ) return endpoint_result @pytest.mark.event_management def test_count_of_notifications_default(api, validator): try: assert is_valid_count_of_notifications( validator, count_of_notifications_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_syslog_subscription_details(json_schema_validate, obj): json_schema_validate('jsd_c0dcb335458a58fa8bc5a485b174427d_v2_2_1').validate(obj) return True def get_syslog_subscription_details(api): endpoint_result = api.event_management.get_syslog_subscription_details( connector_type='string', instance_id='string', name='string' ) return endpoint_result @pytest.mark.event_management def test_get_syslog_subscription_details(api, validator): try: assert is_valid_get_syslog_subscription_details( validator, get_syslog_subscription_details(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_syslog_subscription_details_default(api): endpoint_result = api.event_management.get_syslog_subscription_details( connector_type=None, instance_id=None, name=None ) return endpoint_result @pytest.mark.event_management def test_get_syslog_subscription_details_default(api, validator): try: assert is_valid_get_syslog_subscription_details( validator, get_syslog_subscription_details_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_email_subscription_details(json_schema_validate, obj): json_schema_validate('jsd_403889d420225889bb16f99ec7ba099a_v2_2_1').validate(obj) return True def get_email_subscription_details(api): endpoint_result = api.event_management.get_email_subscription_details( connector_type='string', instance_id='string', name='string' ) return endpoint_result @pytest.mark.event_management def test_get_email_subscription_details(api, validator): try: assert is_valid_get_email_subscription_details( validator, get_email_subscription_details(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_email_subscription_details_default(api): endpoint_result = api.event_management.get_email_subscription_details( connector_type=None, instance_id=None, name=None ) return endpoint_result @pytest.mark.event_management def test_get_email_subscription_details_default(api, validator): try: assert is_valid_get_email_subscription_details( validator, get_email_subscription_details_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_email_event_subscriptions(json_schema_validate, obj): json_schema_validate('jsd_bc212b5ee1f252479f35e8dd58319f17_v2_2_1').validate(obj) return True def get_email_event_subscriptions(api): endpoint_result = api.event_management.get_email_event_subscriptions( event_ids='string', limit=0, offset=0, order='string', sort_by='string' ) return endpoint_result @pytest.mark.event_management def test_get_email_event_subscriptions(api, validator): try: assert is_valid_get_email_event_subscriptions( validator, get_email_event_subscriptions(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_email_event_subscriptions_default(api): endpoint_result = api.event_management.get_email_event_subscriptions( event_ids=None, limit=None, offset=None, order=None, sort_by=None ) return endpoint_result @pytest.mark.event_management def test_get_email_event_subscriptions_default(api, validator): try: assert is_valid_get_email_event_subscriptions( validator, get_email_event_subscriptions_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_update_email_event_subscription(json_schema_validate, obj): json_schema_validate('jsd_f8b4842604b65658afb34b4f124db469_v2_2_1').validate(obj) return True def update_email_event_subscription(api): endpoint_result = api.event_management.update_email_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_update_email_event_subscription(api, validator): try: assert is_valid_update_email_event_subscription( validator, update_email_event_subscription(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def update_email_event_subscription_default(api): endpoint_result = api.event_management.update_email_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_update_email_event_subscription_default(api, validator): try: assert is_valid_update_email_event_subscription( validator, update_email_event_subscription_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_create_email_event_subscription(json_schema_validate, obj): json_schema_validate('jsd_2e69d02d71905aecbd10b782469efbda_v2_2_1').validate(obj) return True def create_email_event_subscription(api): endpoint_result = api.event_management.create_email_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_create_email_event_subscription(api, validator): try: assert is_valid_create_email_event_subscription( validator, create_email_event_subscription(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def create_email_event_subscription_default(api): endpoint_result = api.event_management.create_email_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_create_email_event_subscription_default(api, validator): try: assert is_valid_create_email_event_subscription( validator, create_email_event_subscription_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_events(json_schema_validate, obj): json_schema_validate('jsd_bf36f1819e61575189c0709efab6e48a_v2_2_1').validate(obj) return True def get_events(api): endpoint_result = api.event_management.get_events( event_id='string', limit=0, offset=0, order='string', sort_by='string', tags='string' ) return endpoint_result @pytest.mark.event_management def test_get_events(api, validator): try: assert is_valid_get_events( validator, get_events(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_events_default(api): endpoint_result = api.event_management.get_events( event_id=None, limit=None, offset=None, order=None, sort_by=None, tags=None ) return endpoint_result @pytest.mark.event_management def test_get_events_default(api, validator): try: assert is_valid_get_events( validator, get_events_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_auditlog_summary(json_schema_validate, obj): json_schema_validate('jsd_894ea7c0220d55ae9e1a51d6823ce862_v2_2_1').validate(obj) return True def get_auditlog_summary(api): endpoint_result = api.event_management.get_auditlog_summary( category='string', context='string', description='string', device_id='string', domain='string', end_time=0, event_hierarchy='string', event_id='string', instance_id='string', is_parent_only=True, is_system_events=True, name='string', parent_instance_id='string', severity='string', site_id='string', source='string', start_time=0, sub_domain='string', user_id='string' ) return endpoint_result @pytest.mark.event_management def test_get_auditlog_summary(api, validator): try: assert is_valid_get_auditlog_summary( validator, get_auditlog_summary(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_auditlog_summary_default(api): endpoint_result = api.event_management.get_auditlog_summary( category=None, context=None, description=None, device_id=None, domain=None, end_time=None, event_hierarchy=None, event_id=None, instance_id=None, is_parent_only=None, is_system_events=None, name=None, parent_instance_id=None, severity=None, site_id=None, source=None, start_time=None, sub_domain=None, user_id=None ) return endpoint_result @pytest.mark.event_management def test_get_auditlog_summary_default(api, validator): try: assert is_valid_get_auditlog_summary( validator, get_auditlog_summary_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_event_subscriptions(json_schema_validate, obj): json_schema_validate('jsd_343538d7d4e55d6bbb21c34ce863a131_v2_2_1').validate(obj) return True def get_event_subscriptions(api): endpoint_result = api.event_management.get_event_subscriptions( event_ids='string', limit=0, offset=0, order='string', sort_by='string' ) return endpoint_result @pytest.mark.event_management def test_get_event_subscriptions(api, validator): try: assert is_valid_get_event_subscriptions( validator, get_event_subscriptions(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_event_subscriptions_default(api): endpoint_result = api.event_management.get_event_subscriptions( event_ids=None, limit=None, offset=None, order=None, sort_by=None ) return endpoint_result @pytest.mark.event_management def test_get_event_subscriptions_default(api, validator): try: assert is_valid_get_event_subscriptions( validator, get_event_subscriptions_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_update_event_subscriptions(json_schema_validate, obj): json_schema_validate('jsd_dfda5beca4cc5437876bff366493ebf0_v2_2_1').validate(obj) return True def update_event_subscriptions(api): endpoint_result = api.event_management.update_event_subscriptions( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_update_event_subscriptions(api, validator): try: assert is_valid_update_event_subscriptions( validator, update_event_subscriptions(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def update_event_subscriptions_default(api): endpoint_result = api.event_management.update_event_subscriptions( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_update_event_subscriptions_default(api, validator): try: assert is_valid_update_event_subscriptions( validator, update_event_subscriptions_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_create_event_subscriptions(json_schema_validate, obj): json_schema_validate('jsd_5fcc151af7615a84adf48b714d146192_v2_2_1').validate(obj) return True def create_event_subscriptions(api): endpoint_result = api.event_management.create_event_subscriptions( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_create_event_subscriptions(api, validator): try: assert is_valid_create_event_subscriptions( validator, create_event_subscriptions(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def create_event_subscriptions_default(api): endpoint_result = api.event_management.create_event_subscriptions( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_create_event_subscriptions_default(api, validator): try: assert is_valid_create_event_subscriptions( validator, create_event_subscriptions_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_delete_event_subscriptions(json_schema_validate, obj): json_schema_validate('jsd_a0e0b1772dfc5a02a96a9f6ee6e2579b_v2_2_1').validate(obj) return True def delete_event_subscriptions(api): endpoint_result = api.event_management.delete_event_subscriptions( subscriptions='string' ) return endpoint_result @pytest.mark.event_management def test_delete_event_subscriptions(api, validator): try: assert is_valid_delete_event_subscriptions( validator, delete_event_subscriptions(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def delete_event_subscriptions_default(api): endpoint_result = api.event_management.delete_event_subscriptions( subscriptions=None ) return endpoint_result @pytest.mark.event_management def test_delete_event_subscriptions_default(api, validator): try: assert is_valid_delete_event_subscriptions( validator, delete_event_subscriptions_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_syslog_event_subscriptions(json_schema_validate, obj): json_schema_validate('jsd_c7bed4b4148753e6bc9912e3be135217_v2_2_1').validate(obj) return True def get_syslog_event_subscriptions(api): endpoint_result = api.event_management.get_syslog_event_subscriptions( event_ids='string', limit=0, offset=0, order='string', sort_by='string' ) return endpoint_result @pytest.mark.event_management def test_get_syslog_event_subscriptions(api, validator): try: assert is_valid_get_syslog_event_subscriptions( validator, get_syslog_event_subscriptions(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_syslog_event_subscriptions_default(api): endpoint_result = api.event_management.get_syslog_event_subscriptions( event_ids=None, limit=None, offset=None, order=None, sort_by=None ) return endpoint_result @pytest.mark.event_management def test_get_syslog_event_subscriptions_default(api, validator): try: assert is_valid_get_syslog_event_subscriptions( validator, get_syslog_event_subscriptions_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_update_syslog_event_subscription(json_schema_validate, obj): json_schema_validate('jsd_8d8fc92ddeab597ebb50ea003a6d46bd_v2_2_1').validate(obj) return True def update_syslog_event_subscription(api): endpoint_result = api.event_management.update_syslog_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_update_syslog_event_subscription(api, validator): try: assert is_valid_update_syslog_event_subscription( validator, update_syslog_event_subscription(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def update_syslog_event_subscription_default(api): endpoint_result = api.event_management.update_syslog_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_update_syslog_event_subscription_default(api, validator): try: assert is_valid_update_syslog_event_subscription( validator, update_syslog_event_subscription_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_create_syslog_event_subscription(json_schema_validate, obj): json_schema_validate('jsd_99fb5a8c0075563491622171958074bf_v2_2_1').validate(obj) return True def create_syslog_event_subscription(api): endpoint_result = api.event_management.create_syslog_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_create_syslog_event_subscription(api, validator): try: assert is_valid_create_syslog_event_subscription( validator, create_syslog_event_subscription(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def create_syslog_event_subscription_default(api): endpoint_result = api.event_management.create_syslog_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_create_syslog_event_subscription_default(api, validator): try: assert is_valid_create_syslog_event_subscription( validator, create_syslog_event_subscription_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_count_of_events(json_schema_validate, obj): json_schema_validate('jsd_3b21d2947d715c198f5e62ba3149839a_v2_2_1').validate(obj) return True def count_of_events(api): endpoint_result = api.event_management.count_of_events( event_id='string', tags='string' ) return endpoint_result @pytest.mark.event_management def test_count_of_events(api, validator): try: assert is_valid_count_of_events( validator, count_of_events(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def count_of_events_default(api): endpoint_result = api.event_management.count_of_events( event_id=None, tags=None ) return endpoint_result @pytest.mark.event_management def test_count_of_events_default(api, validator): try: assert is_valid_count_of_events( validator, count_of_events_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_eventartifacts(json_schema_validate, obj): json_schema_validate('jsd_584c0e0d76b2561b8f2efd0220f02267_v2_2_1').validate(obj) return True def get_eventartifacts(api): endpoint_result = api.event_management.get_eventartifacts( event_ids='string', limit=0, offset=0, order='string', search='string', sort_by='string', tags='string' ) return endpoint_result @pytest.mark.event_management def test_get_eventartifacts(api, validator): try: assert is_valid_get_eventartifacts( validator, get_eventartifacts(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_eventartifacts_default(api): endpoint_result = api.event_management.get_eventartifacts( event_ids=None, limit=None, offset=None, order=None, search=None, sort_by=None, tags=None ) return endpoint_result @pytest.mark.event_management def test_get_eventartifacts_default(api, validator): try: assert is_valid_get_eventartifacts( validator, get_eventartifacts_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_notifications(json_schema_validate, obj): json_schema_validate('jsd_c641f481dd285301861010da8d6fbf9f_v2_2_1').validate(obj) return True def get_notifications(api): endpoint_result = api.event_management.get_notifications( category='string', domain='string', end_time=0, event_ids='string', limit=0, offset=0, order='string', severity='string', sort_by='string', source='string', start_time=0, sub_domain='string', type='string' ) return endpoint_result @pytest.mark.event_management def test_get_notifications(api, validator): try: assert is_valid_get_notifications( validator, get_notifications(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_notifications_default(api): endpoint_result = api.event_management.get_notifications( category=None, domain=None, end_time=None, event_ids=None, limit=None, offset=None, order=None, severity=None, sort_by=None, source=None, start_time=None, sub_domain=None, type=None ) return endpoint_result @pytest.mark.event_management def test_get_notifications_default(api, validator): try: assert is_valid_get_notifications( validator, get_notifications_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_auditlog_records(json_schema_validate, obj): json_schema_validate('jsd_b0aa5a61f64a5da997dfe05bc8a4a64f_v2_2_1').validate(obj) return True def get_auditlog_records(api): endpoint_result = api.event_management.get_auditlog_records( category='string', context='string', description='string', device_id='string', domain='string', end_time=0, event_hierarchy='string', event_id='string', instance_id='string', is_system_events=True, limit=0, name='string', offset=0, order='string', parent_instance_id='string', severity='string', site_id='string', sort_by='string', source='string', start_time=0, sub_domain='string', user_id='string' ) return endpoint_result @pytest.mark.event_management def test_get_auditlog_records(api, validator): try: assert is_valid_get_auditlog_records( validator, get_auditlog_records(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_auditlog_records_default(api): endpoint_result = api.event_management.get_auditlog_records( category=None, context=None, description=None, device_id=None, domain=None, end_time=None, event_hierarchy=None, event_id=None, instance_id=None, is_system_events=None, limit=None, name=None, offset=None, order=None, parent_instance_id=None, severity=None, site_id=None, sort_by=None, source=None, start_time=None, sub_domain=None, user_id=None ) return endpoint_result @pytest.mark.event_management def test_get_auditlog_records_default(api, validator): try: assert is_valid_get_auditlog_records( validator, get_auditlog_records_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_rest_webhook_event_subscriptions(json_schema_validate, obj): json_schema_validate('jsd_1ee2008494d158e7bff7f106519a64c5_v2_2_1').validate(obj) return True def get_rest_webhook_event_subscriptions(api): endpoint_result = api.event_management.get_rest_webhook_event_subscriptions( event_ids='string', limit=0, offset=0, order='string', sort_by='string' ) return endpoint_result @pytest.mark.event_management def test_get_rest_webhook_event_subscriptions(api, validator): try: assert is_valid_get_rest_webhook_event_subscriptions( validator, get_rest_webhook_event_subscriptions(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_rest_webhook_event_subscriptions_default(api): endpoint_result = api.event_management.get_rest_webhook_event_subscriptions( event_ids=None, limit=None, offset=None, order=None, sort_by=None ) return endpoint_result @pytest.mark.event_management def test_get_rest_webhook_event_subscriptions_default(api, validator): try: assert is_valid_get_rest_webhook_event_subscriptions( validator, get_rest_webhook_event_subscriptions_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_update_rest_webhook_event_subscription(json_schema_validate, obj): json_schema_validate('jsd_7474456b6581534bb321eaea272365b7_v2_2_1').validate(obj) return True def update_rest_webhook_event_subscription(api): endpoint_result = api.event_management.update_rest_webhook_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_update_rest_webhook_event_subscription(api, validator): try: assert is_valid_update_rest_webhook_event_subscription( validator, update_rest_webhook_event_subscription(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def update_rest_webhook_event_subscription_default(api): endpoint_result = api.event_management.update_rest_webhook_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_update_rest_webhook_event_subscription_default(api, validator): try: assert is_valid_update_rest_webhook_event_subscription( validator, update_rest_webhook_event_subscription_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_create_rest_webhook_event_subscription(json_schema_validate, obj): json_schema_validate('jsd_9f41eb48a0da56949cfaddeecb51ab66_v2_2_1').validate(obj) return True def create_rest_webhook_event_subscription(api): endpoint_result = api.event_management.create_rest_webhook_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_create_rest_webhook_event_subscription(api, validator): try: assert is_valid_create_rest_webhook_event_subscription( validator, create_rest_webhook_event_subscription(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def create_rest_webhook_event_subscription_default(api): endpoint_result = api.event_management.create_rest_webhook_event_subscription( active_validation=True, payload=None ) return endpoint_result @pytest.mark.event_management def test_create_rest_webhook_event_subscription_default(api, validator): try: assert is_valid_create_rest_webhook_event_subscription( validator, create_rest_webhook_event_subscription_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_auditlog_parent_records(json_schema_validate, obj): json_schema_validate('jsd_9f8e3a0674c15fd58cd78f42dca37c7c_v2_2_1').validate(obj) return True def get_auditlog_parent_records(api): endpoint_result = api.event_management.get_auditlog_parent_records( category='string', context='string', description='string', device_id='string', domain='string', end_time=0, event_hierarchy='string', event_id='string', instance_id='string', is_system_events=True, limit=0, name='string', offset=0, order='string', severity='string', site_id='string', sort_by='string', source='string', start_time=0, sub_domain='string', user_id='string' ) return endpoint_result @pytest.mark.event_management def test_get_auditlog_parent_records(api, validator): try: assert is_valid_get_auditlog_parent_records( validator, get_auditlog_parent_records(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_auditlog_parent_records_default(api): endpoint_result = api.event_management.get_auditlog_parent_records( category=None, context=None, description=None, device_id=None, domain=None, end_time=None, event_hierarchy=None, event_id=None, instance_id=None, is_system_events=None, limit=None, name=None, offset=None, order=None, severity=None, site_id=None, sort_by=None, source=None, start_time=None, sub_domain=None, user_id=None ) return endpoint_result @pytest.mark.event_management def test_get_auditlog_parent_records_default(api, validator): try: assert is_valid_get_auditlog_parent_records( validator, get_auditlog_parent_records_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_eventartifact_count(json_schema_validate, obj): json_schema_validate('jsd_a137e0b583c85ffe80fbbd85b480bf15_v2_2_1').validate(obj) return True def eventartifact_count(api): endpoint_result = api.event_management.eventartifact_count( ) return endpoint_result @pytest.mark.event_management def test_eventartifact_count(api, validator): try: assert is_valid_eventartifact_count( validator, eventartifact_count(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def eventartifact_count_default(api): endpoint_result = api.event_management.eventartifact_count( ) return endpoint_result @pytest.mark.event_management def test_eventartifact_count_default(api, validator): try: assert is_valid_eventartifact_count( validator, eventartifact_count_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_rest_webhook_subscription_details(json_schema_validate, obj): json_schema_validate('jsd_86272f278c72555e9a56f554b2a21c85_v2_2_1').validate(obj) return True def get_rest_webhook_subscription_details(api): endpoint_result = api.event_management.get_rest_webhook_subscription_details( connector_type='string', instance_id='string', name='string' ) return endpoint_result @pytest.mark.event_management def test_get_rest_webhook_subscription_details(api, validator): try: assert is_valid_get_rest_webhook_subscription_details( validator, get_rest_webhook_subscription_details(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_rest_webhook_subscription_details_default(api): endpoint_result = api.event_management.get_rest_webhook_subscription_details( connector_type=None, instance_id=None, name=None ) return endpoint_result @pytest.mark.event_management def test_get_rest_webhook_subscription_details_default(api, validator): try: assert is_valid_get_rest_webhook_subscription_details( validator, get_rest_webhook_subscription_details_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e def is_valid_get_status_api_for_events(json_schema_validate, obj): json_schema_validate('jsd_e1bd67a1a0225713ab23f0d0d3ceb4f6_v2_2_1').validate(obj) return True def get_status_api_for_events(api): endpoint_result = api.event_management.get_status_api_for_events( execution_id='string' ) return endpoint_result @pytest.mark.event_management def test_get_status_api_for_events(api, validator): try: assert is_valid_get_status_api_for_events( validator, get_status_api_for_events(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest)): print(original_e) raise original_e def get_status_api_for_events_default(api): endpoint_result = api.event_management.get_status_api_for_events( execution_id='string' ) return endpoint_result @pytest.mark.event_management def test_get_status_api_for_events_default(api, validator): try: assert is_valid_get_status_api_for_events( validator, get_status_api_for_events_default(api) ) except Exception as original_e: with pytest.raises((JsonSchemaException, MalformedRequest, TypeError)): raise original_e
28.863014
95
0.705505
4,726
42,140
5.910495
0.04909
0.043497
0.034798
0.038664
0.92167
0.919629
0.917982
0.91519
0.903519
0.85297
0
0.020504
0.229212
42,140
1,459
96
28.882796
0.839475
0.027053
0
0.710232
0
0
0.043617
0.028322
0
0
0
0
0.046432
1
0.116079
false
0
0.003439
0
0.189166
0.023216
0
0
0
null
0
0
0
1
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
7
435ba802f67bf5d3b4ad56fb9f2b89c19dce5931
123
py
Python
qmla/exploration_strategies/thesis_demos/__init__.py
Stewart-Wallace/QMLA
175123ca4e2b4f7af501034989b32f76999c386b
[ "MIT" ]
null
null
null
qmla/exploration_strategies/thesis_demos/__init__.py
Stewart-Wallace/QMLA
175123ca4e2b4f7af501034989b32f76999c386b
[ "MIT" ]
null
null
null
qmla/exploration_strategies/thesis_demos/__init__.py
Stewart-Wallace/QMLA
175123ca4e2b4f7af501034989b32f76999c386b
[ "MIT" ]
null
null
null
from qmla.exploration_strategies.thesis_demos.demo import * from qmla.exploration_strategies.thesis_demos.obj_fncs import *
61.5
63
0.878049
17
123
6.058824
0.588235
0.15534
0.368932
0.563107
0.776699
0.776699
0
0
0
0
0
0
0.056911
123
2
63
61.5
0.887931
0
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
1
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
8
78dab7a68b1754877be4adec17daa87a93cb8267
16,554
py
Python
source/backend/lambda_defaultschema/schema/stages.py
shyam-amazon/aws-cloudendure-migration-factory-solution
5d2aa971137346d2d9126b07776f2adc302410e0
[ "MIT-0" ]
24
2020-06-03T22:59:18.000Z
2022-02-07T19:25:32.000Z
source/backend/lambda_defaultschema/schema/stages.py
russomi-labs/aws-cloudendure-migration-factory-solution
2e7386ff3d5fca7847730aef0b6b05794d5579c6
[ "MIT-0" ]
4
2021-05-06T01:45:15.000Z
2021-10-16T23:32:34.000Z
source/backend/lambda_defaultschema/schema/stages.py
russomi-labs/aws-cloudendure-migration-factory-solution
2e7386ff3d5fca7847730aef0b6b05794d5579c6
[ "MIT-0" ]
21
2020-06-03T23:23:04.000Z
2022-03-25T16:11:33.000Z
schema = [ { "attributes": { "L": [ { "M": { "attr_name": { "S": "wave_name" }, "attr_type": { "S": "wave" } } }, { "M": { "attr_name": { "S": "wave_status" }, "attr_type": { "S": "wave" } } }, { "M": { "attr_name": { "S": "wave_start_time" }, "attr_type": { "S": "wave" } } }, { "M": { "attr_name": { "S": "wave_end_time" }, "attr_type": { "S": "wave" } } }, { "M": { "attr_name": { "S": "app_name" }, "attr_type": { "S": "app" } } }, { "M": { "attr_name": { "S": "wave_id" }, "attr_type": { "S": "app" } } }, { "M": { "attr_name": { "S": "cloudendure_projectname" }, "attr_type": { "S": "app" } } }, { "M": { "attr_name": { "S": "aws_accountid" }, "attr_type": { "S": "app" } } }, { "M": { "attr_name": { "S": "aws_region" }, "attr_type": { "S": "app" } } }, { "M": { "attr_name": { "S": "app_id" }, "attr_type": { "S": "server" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "server_fqdn" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "server_os_family" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "server_os_version" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "server_tier" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "server_environment" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "instanceType" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "iamRole" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "private_ip" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "tenancy" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "subnet_IDs_test" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "securitygroup_IDs_test" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "subnet_IDs" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "securitygroup_IDs" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "tags" }, "attr_type": { "S": "server" } } } ] }, "stage_id": { "S": "1" }, "stage_name": { "S": "Pre-migration" } }, { "attributes": { "L": [ { "M": { "attr_name": { "S": "wave_id" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "cloudendure_projectname" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "aws_accountid" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "migration_status" }, "attr_type": { "S": "server" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "replication_status" }, "attr_type": { "S": "server" }, "read_only": { "BOOL": True } } } ] }, "stage_id": { "S": "2" }, "stage_name": { "S": "Build" } }, { "attributes": { "L": [ { "M": { "attr_name": { "S": "wave_id" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "cloudendure_projectname" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "aws_accountid" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "migration_status" }, "attr_type": { "S": "server" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "replication_status" }, "attr_type": { "S": "server" }, "read_only": { "BOOL": True } } } ] }, "stage_id": { "S": "3" }, "stage_name": { "S": "Validate" } }, { "attributes": { "L": [ { "M": { "attr_name": { "S": "wave_id" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "cloudendure_projectname" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "aws_accountid" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "replication_status" }, "attr_type": { "S": "server" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "migration_status" }, "attr_type": { "S": "server" }, "read_only": { "BOOL": True } } } ] }, "stage_id": { "S": "4" }, "stage_name": { "S": "Boot up testing" } }, { "attributes": { "L": [ { "M": { "attr_name": { "S": "wave_id" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "cloudendure_projectname" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "aws_accountid" }, "attr_type": { "S": "app" }, "read_only": { "BOOL": True } } }, { "M": { "attr_name": { "S": "migration_status" }, "attr_type": { "S": "server" } } }, { "M": { "attr_name": { "S": "replication_status" }, "attr_type": { "S": "server" } } } ] }, "stage_id": { "S": "5" }, "stage_name": { "S": "Cutover" } } ]
29.560714
58
0.136704
572
16,554
3.671329
0.097902
0.116667
0.188571
0.209524
0.901429
0.895714
0.895714
0.869048
0.805238
0.704286
0
0.001288
0.765434
16,554
559
59
29.613596
0.539531
0
0
0.45975
0
0
0.131932
0.008276
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
1
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
9
78e437474e98204887a2c136a507e2064b82af45
16,053
py
Python
skyportal/tests/api/test_thumbnail.py
glenn2763/skyportal
79dc11bfe08076d9c1f920bad85681ab001e22c8
[ "BSD-3-Clause" ]
null
null
null
skyportal/tests/api/test_thumbnail.py
glenn2763/skyportal
79dc11bfe08076d9c1f920bad85681ab001e22c8
[ "BSD-3-Clause" ]
null
null
null
skyportal/tests/api/test_thumbnail.py
glenn2763/skyportal
79dc11bfe08076d9c1f920bad85681ab001e22c8
[ "BSD-3-Clause" ]
null
null
null
import os import uuid import datetime import base64 from skyportal.tests import api from skyportal.models import Thumbnail, DBSession, Photometry, Source def test_token_user_post_get_thumbnail(upload_data_token, public_group): name = str(uuid.uuid4()) status, data = api('POST', 'telescope', data={'name': name, 'nickname': name, 'lat': 0.0, 'lon': 0.0, 'elevation': 0.0, 'diameter': 10.0, 'group_ids': [public_group.id] }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' telescope_id = data['data']['id'] status, data = api('POST', 'instrument', data={'name': 'instrument_name', 'type': 'type', 'band': 'V', 'telescope_id': telescope_id }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' instrument_id = data['data']['id'] source_id = str(uuid.uuid4()) status, data = api('POST', 'sources', data={'id': source_id, 'ra': 234.22, 'dec': -22.33, 'redshift': 3, 'transient': False, 'ra_dis': 2.3, 'group_ids': [public_group.id]}, token=upload_data_token) assert status == 200 assert data['data']['id'] == source_id status, data = api('POST', 'photometry', data={'source_id': source_id, 'observed_at': str(datetime.datetime.now()), 'time_format': 'iso', 'time_scale': 'utc', 'instrument_id': instrument_id, 'mag': 12.24, 'e_mag': 0.031, 'lim_mag': 14.1, 'filter': 'V' }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' orig_source_thumbnail_count = len(DBSession.query(Source).filter( Source.id == source_id).first().thumbnails) data = base64.b64encode(open(os.path.abspath('skyportal/tests/data/14gqr_new.png'), 'rb').read()) ttype = 'new' status, data = api('POST', 'thumbnail', data={'source_id': source_id, 'data': data, 'ttype': ttype }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' thumbnail_id = data['data']['id'] assert isinstance(thumbnail_id, int) status, data = api( 'GET', f'thumbnail/{thumbnail_id}', token=upload_data_token) assert status == 200 assert data['status'] == 'success' assert data['data']['thumbnail']['type'] == 'new' assert (DBSession.query(Thumbnail).filter(Thumbnail.id == thumbnail_id) .first().source.id) == source_id assert len(DBSession.query(Source).filter(Source.id == source_id).first() .thumbnails) == orig_source_thumbnail_count + 1 def test_token_user_delete_thumbnail_cascade_source(upload_data_token, manage_sources_token, public_group): source_id = str(uuid.uuid4()) status, data = api('POST', 'sources', data={'id': source_id, 'ra': 234.22, 'dec': -22.33, 'redshift': 3, 'transient': False, 'ra_dis': 2.3, 'group_ids': [public_group.id]}, token=upload_data_token) assert status == 200 assert data['data']['id'] == source_id status, data = api('POST', 'photometry', data={'source_id': source_id, 'observed_at': str(datetime.datetime.now()), 'time_format': 'iso', 'time_scale': 'utc', 'instrument_id': 1, 'mag': 12.24, 'e_mag': 0.031, 'lim_mag': 14.1, 'filter': 'V' }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' orig_source_thumbnail_count = len(DBSession.query(Source).filter( Source.id == source_id).first().thumbnails) data = base64.b64encode(open(os.path.abspath('skyportal/tests/data/14gqr_new.png'), 'rb').read()) ttype = 'new' status, data = api('POST', 'thumbnail', data={'source_id': source_id, 'data': data, 'ttype': ttype }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' thumbnail_id = data['data']['id'] assert isinstance(thumbnail_id, int) status, data = api( 'GET', f'thumbnail/{thumbnail_id}', token=upload_data_token) assert status == 200 assert data['status'] == 'success' assert data['data']['thumbnail']['type'] == 'new' assert (DBSession.query(Thumbnail).filter(Thumbnail.id == thumbnail_id) .first().source.id) == source_id assert len(DBSession.query(Source).filter(Source.id == source_id).first() .thumbnails) == orig_source_thumbnail_count + 1 status, data = api( 'DELETE', f'thumbnail/{thumbnail_id}', token=manage_sources_token) assert status == 200 assert data['status'] == 'success' assert len(DBSession.query(Source).filter(Source.id == source_id).first() .thumbnails) == orig_source_thumbnail_count def test_token_user_post_get_thumbnail_phot_id(upload_data_token, public_group): source_id = str(uuid.uuid4()) status, data = api('POST', 'sources', data={'id': source_id, 'ra': 234.22, 'dec': -22.33, 'redshift': 3, 'transient': False, 'ra_dis': 2.3, 'group_ids': [public_group.id]}, token=upload_data_token) assert status == 200 assert data['data']['id'] == source_id status, data = api('POST', 'photometry', data={'source_id': source_id, 'observed_at': str(datetime.datetime.now()), 'time_format': 'iso', 'time_scale': 'utc', 'instrument_id': 1, 'mag': 12.24, 'e_mag': 0.031, 'lim_mag': 14.1, 'filter': 'V' }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' photometry_id = data['data']['ids'][0] orig_source_thumbnail_count = len(DBSession.query(Source).filter( Source.id == source_id).first().thumbnails) data = base64.b64encode(open(os.path.abspath('skyportal/tests/data/14gqr_new.png'), 'rb').read()) ttype = 'new' status, data = api('POST', 'thumbnail', data={'photometry_id': photometry_id, 'data': data, 'ttype': ttype }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' thumbnail_id = data['data']['id'] assert isinstance(thumbnail_id, int) status, data = api( 'GET', f'thumbnail/{thumbnail_id}', token=upload_data_token) assert status == 200 assert data['status'] == 'success' assert data['data']['thumbnail']['type'] == 'new' assert (DBSession.query(Thumbnail).filter(Thumbnail.id == thumbnail_id) .first().source.id) == source_id assert len(DBSession.query(Source).filter(Source.id == source_id).first() .thumbnails) == orig_source_thumbnail_count + 1 def test_cannot_post_thumbnail_invalid_ttype(upload_data_token, public_group): source_id = str(uuid.uuid4()) status, data = api('POST', 'sources', data={'id': source_id, 'ra': 234.22, 'dec': -22.33, 'redshift': 3, 'transient': False, 'ra_dis': 2.3, 'group_ids': [public_group.id]}, token=upload_data_token) assert status == 200 assert data['data']['id'] == source_id status, data = api('POST', 'photometry', data={'source_id': source_id, 'observed_at': str(datetime.datetime.now()), 'time_format': 'iso', 'time_scale': 'utc', 'instrument_id': 1, 'mag': 12.24, 'e_mag': 0.031, 'lim_mag': 14.1, 'filter': 'V' }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' data = base64.b64encode(open(os.path.abspath('skyportal/tests/data/14gqr_new.png'), 'rb').read()) ttype = 'invalid_ttype' status, data = api('POST', 'thumbnail', data={'source_id': source_id, 'data': data, 'ttype': ttype }, token=upload_data_token) assert status == 400 assert data['status'] == 'error' assert 'is not among the defined enum values' in data['message'] def test_cannot_post_thumbnail_invalid_image_type(upload_data_token, public_group): source_id = str(uuid.uuid4()) status, data = api('POST', 'sources', data={'id': source_id, 'ra': 234.22, 'dec': -22.33, 'redshift': 3, 'transient': False, 'ra_dis': 2.3, 'group_ids': [public_group.id]}, token=upload_data_token) assert status == 200 assert data['data']['id'] == source_id status, data = api('POST', 'photometry', data={'source_id': source_id, 'observed_at': str(datetime.datetime.now()), 'time_format': 'iso', 'time_scale': 'utc', 'instrument_id': 1, 'mag': 12.24, 'e_mag': 0.031, 'lim_mag': 14.1, 'filter': 'V' }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' data = base64.b64encode(open(os.path.abspath('skyportal/tests/data/candid-87704463155000_ref.jpg'), 'rb').read()) ttype = 'ref' status, data = api('POST', 'thumbnail', data={'source_id': source_id, 'data': data, 'ttype': ttype }, token=upload_data_token) assert status == 400 assert data['status'] == 'error' assert 'Invalid thumbnail image type. Only PNG are supported.' in data['message'] def test_cannot_post_thumbnail_invalid_size(upload_data_token, public_group): source_id = str(uuid.uuid4()) status, data = api('POST', 'sources', data={'id': source_id, 'ra': 234.22, 'dec': -22.33, 'redshift': 3, 'transient': False, 'ra_dis': 2.3, 'group_ids': [public_group.id]}, token=upload_data_token) assert status == 200 assert data['data']['id'] == source_id status, data = api('POST', 'photometry', data={'source_id': source_id, 'observed_at': str(datetime.datetime.now()), 'time_format': 'iso', 'time_scale': 'utc', 'instrument_id': 1, 'mag': 12.24, 'e_mag': 0.031, 'lim_mag': 14.1, 'filter': 'V' }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' data = base64.b64encode(open(os.path.abspath('skyportal/tests/data/14gqr_new_50px.png'), 'rb').read()) ttype = 'ref' status, data = api('POST', 'thumbnail', data={'source_id': source_id, 'data': data, 'ttype': ttype }, token=upload_data_token) assert status == 400 assert data['status'] == 'error' assert 'Invalid thumbnail size.' in data['message'] def test_cannot_post_thumbnail_invalid_file_type(upload_data_token, public_group): source_id = str(uuid.uuid4()) status, data = api('POST', 'sources', data={'id': source_id, 'ra': 234.22, 'dec': -22.33, 'redshift': 3, 'transient': False, 'ra_dis': 2.3, 'group_ids': [public_group.id]}, token=upload_data_token) assert status == 200 assert data['data']['id'] == source_id status, data = api('POST', 'photometry', data={'source_id': source_id, 'observed_at': str(datetime.datetime.now()), 'time_format': 'iso', 'time_scale': 'utc', 'instrument_id': 1, 'mag': 12.24, 'e_mag': 0.031, 'lim_mag': 14.1, 'filter': 'V' }, token=upload_data_token) assert status == 200 assert data['status'] == 'success' data = base64.b64encode(open(os.path.abspath('skyportal/tests/data/phot.csv'), 'rb').read()) ttype = 'ref' status, data = api('POST', 'thumbnail', data={'source_id': source_id, 'data': data, 'ttype': ttype }, token=upload_data_token) assert status == 400 assert data['status'] == 'error' assert 'cannot identify image file' in data['message']
41.267352
103
0.442721
1,477
16,053
4.615437
0.083277
0.078627
0.055743
0.07628
0.908464
0.896582
0.892768
0.879126
0.879126
0.852574
0
0.035781
0.434187
16,053
388
104
41.373711
0.714742
0
0
0.828652
0
0
0.144833
0.021803
0
0
0
0
0.199438
1
0.019663
false
0
0.016854
0
0.036517
0
0
0
0
null
0
0
0
1
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
7
6007410e8db039e6b7496e66d95c49b763f1487b
132
py
Python
__init__.py
MaVCArt/SDFGenerator
855f73fdef487ffe23e8c69f496b3c4c97a6ef7b
[ "MIT" ]
4
2022-01-06T09:18:17.000Z
2022-01-07T11:56:46.000Z
__init__.py
MaVCArt/SDFGenerator
855f73fdef487ffe23e8c69f496b3c4c97a6ef7b
[ "MIT" ]
null
null
null
__init__.py
MaVCArt/SDFGenerator
855f73fdef487ffe23e8c69f496b3c4c97a6ef7b
[ "MIT" ]
null
null
null
from .main import generate_sdf from .main import generate_sdf_data from .main import flood_fill from .main import generate_image_id
26.4
35
0.848485
22
132
4.818182
0.454545
0.301887
0.528302
0.622642
0.471698
0
0
0
0
0
0
0
0.121212
132
4
36
33
0.913793
0
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
9